@gpuai/sdk 0.3.18 → 0.4.1

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.
Files changed (187) hide show
  1. package/.openapi-generator/FILES +48 -0
  2. package/README.md +41 -2
  3. package/dist/apis/BillingApi.d.ts +70 -0
  4. package/dist/apis/BillingApi.js +197 -0
  5. package/dist/apis/FunctionsApi.d.ts +228 -0
  6. package/dist/apis/FunctionsApi.js +627 -0
  7. package/dist/apis/InstancesApi.d.ts +18 -0
  8. package/dist/apis/InstancesApi.js +49 -0
  9. package/dist/apis/index.d.ts +1 -0
  10. package/dist/apis/index.js +1 -0
  11. package/dist/esm/apis/BillingApi.d.ts +70 -0
  12. package/dist/esm/apis/BillingApi.js +197 -0
  13. package/dist/esm/apis/FunctionsApi.d.ts +228 -0
  14. package/dist/esm/apis/FunctionsApi.js +623 -0
  15. package/dist/esm/apis/InstancesApi.d.ts +18 -0
  16. package/dist/esm/apis/InstancesApi.js +49 -0
  17. package/dist/esm/apis/index.d.ts +1 -0
  18. package/dist/esm/apis/index.js +1 -0
  19. package/dist/esm/models/AutolaunchRule.d.ts +2 -1
  20. package/dist/esm/models/BillingDetails.d.ts +98 -0
  21. package/dist/esm/models/BillingDetails.js +85 -0
  22. package/dist/esm/models/CreateFunctionRequest.d.ts +32 -0
  23. package/dist/esm/models/CreateFunctionRequest.js +43 -0
  24. package/dist/esm/models/CreateFunctionRunRequest.d.ts +38 -0
  25. package/dist/esm/models/CreateFunctionRunRequest.js +45 -0
  26. package/dist/esm/models/CreateFunctionVersionRequest.d.ts +110 -0
  27. package/dist/esm/models/CreateFunctionVersionRequest.js +79 -0
  28. package/dist/esm/models/Function.d.ts +163 -0
  29. package/dist/esm/models/Function.js +109 -0
  30. package/dist/esm/models/FunctionList.d.ts +33 -0
  31. package/dist/esm/models/FunctionList.js +44 -0
  32. package/dist/esm/models/FunctionReplicaCounts.d.ts +44 -0
  33. package/dist/esm/models/FunctionReplicaCounts.js +51 -0
  34. package/dist/esm/models/FunctionRun.d.ts +130 -0
  35. package/dist/esm/models/FunctionRun.js +94 -0
  36. package/dist/esm/models/FunctionRunError.d.ts +44 -0
  37. package/dist/esm/models/FunctionRunError.js +49 -0
  38. package/dist/esm/models/FunctionRunList.d.ts +39 -0
  39. package/dist/esm/models/FunctionRunList.js +48 -0
  40. package/dist/esm/models/FunctionRunLogChunk.d.ts +59 -0
  41. package/dist/esm/models/FunctionRunLogChunk.js +63 -0
  42. package/dist/esm/models/FunctionRunLogs.d.ts +45 -0
  43. package/dist/esm/models/FunctionRunLogs.js +52 -0
  44. package/dist/esm/models/FunctionUpload.d.ts +51 -0
  45. package/dist/esm/models/FunctionUpload.js +59 -0
  46. package/dist/esm/models/FunctionVersion.d.ts +137 -0
  47. package/dist/esm/models/FunctionVersion.js +109 -0
  48. package/dist/esm/models/GpuSuggestion.d.ts +82 -0
  49. package/dist/esm/models/GpuSuggestion.js +77 -0
  50. package/dist/esm/models/GpuSuggestionCheaper.d.ts +62 -0
  51. package/dist/esm/models/GpuSuggestionCheaper.js +63 -0
  52. package/dist/esm/models/GpuSuggestionGpu.d.ts +50 -0
  53. package/dist/esm/models/GpuSuggestionGpu.js +55 -0
  54. package/dist/esm/models/Instance.d.ts +7 -0
  55. package/dist/esm/models/Instance.js +3 -0
  56. package/dist/esm/models/InstanceGpuMemory.d.ts +51 -0
  57. package/dist/esm/models/InstanceGpuMemory.js +55 -0
  58. package/dist/esm/models/Invoice.d.ts +68 -0
  59. package/dist/esm/models/Invoice.js +67 -0
  60. package/dist/esm/models/InvoiceList.d.ts +45 -0
  61. package/dist/esm/models/InvoiceList.js +50 -0
  62. package/dist/esm/models/ModelPricing.d.ts +46 -0
  63. package/dist/esm/models/ModelPricing.js +21 -0
  64. package/dist/esm/models/ModelRate.d.ts +62 -0
  65. package/dist/esm/models/ModelRate.js +51 -0
  66. package/dist/esm/models/PeakWindow.d.ts +38 -0
  67. package/dist/esm/models/PeakWindow.js +47 -0
  68. package/dist/esm/models/UpdateBillingDetailsRequest.d.ts +80 -0
  69. package/dist/esm/models/UpdateBillingDetailsRequest.js +57 -0
  70. package/dist/esm/models/index.d.ts +23 -0
  71. package/dist/esm/models/index.js +23 -0
  72. package/dist/esm/runtime.js +1 -1
  73. package/dist/models/AutolaunchRule.d.ts +2 -1
  74. package/dist/models/BillingDetails.d.ts +98 -0
  75. package/dist/models/BillingDetails.js +92 -0
  76. package/dist/models/CreateFunctionRequest.d.ts +32 -0
  77. package/dist/models/CreateFunctionRequest.js +50 -0
  78. package/dist/models/CreateFunctionRunRequest.d.ts +38 -0
  79. package/dist/models/CreateFunctionRunRequest.js +52 -0
  80. package/dist/models/CreateFunctionVersionRequest.d.ts +110 -0
  81. package/dist/models/CreateFunctionVersionRequest.js +86 -0
  82. package/dist/models/Function.d.ts +163 -0
  83. package/dist/models/Function.js +117 -0
  84. package/dist/models/FunctionList.d.ts +33 -0
  85. package/dist/models/FunctionList.js +51 -0
  86. package/dist/models/FunctionReplicaCounts.d.ts +44 -0
  87. package/dist/models/FunctionReplicaCounts.js +58 -0
  88. package/dist/models/FunctionRun.d.ts +130 -0
  89. package/dist/models/FunctionRun.js +102 -0
  90. package/dist/models/FunctionRunError.d.ts +44 -0
  91. package/dist/models/FunctionRunError.js +56 -0
  92. package/dist/models/FunctionRunList.d.ts +39 -0
  93. package/dist/models/FunctionRunList.js +55 -0
  94. package/dist/models/FunctionRunLogChunk.d.ts +59 -0
  95. package/dist/models/FunctionRunLogChunk.js +71 -0
  96. package/dist/models/FunctionRunLogs.d.ts +45 -0
  97. package/dist/models/FunctionRunLogs.js +59 -0
  98. package/dist/models/FunctionUpload.d.ts +51 -0
  99. package/dist/models/FunctionUpload.js +67 -0
  100. package/dist/models/FunctionVersion.d.ts +137 -0
  101. package/dist/models/FunctionVersion.js +117 -0
  102. package/dist/models/GpuSuggestion.d.ts +82 -0
  103. package/dist/models/GpuSuggestion.js +85 -0
  104. package/dist/models/GpuSuggestionCheaper.d.ts +62 -0
  105. package/dist/models/GpuSuggestionCheaper.js +70 -0
  106. package/dist/models/GpuSuggestionGpu.d.ts +50 -0
  107. package/dist/models/GpuSuggestionGpu.js +62 -0
  108. package/dist/models/Instance.d.ts +7 -0
  109. package/dist/models/Instance.js +3 -0
  110. package/dist/models/InstanceGpuMemory.d.ts +51 -0
  111. package/dist/models/InstanceGpuMemory.js +62 -0
  112. package/dist/models/Invoice.d.ts +68 -0
  113. package/dist/models/Invoice.js +74 -0
  114. package/dist/models/InvoiceList.d.ts +45 -0
  115. package/dist/models/InvoiceList.js +57 -0
  116. package/dist/models/ModelPricing.d.ts +46 -0
  117. package/dist/models/ModelPricing.js +22 -0
  118. package/dist/models/ModelRate.d.ts +62 -0
  119. package/dist/models/ModelRate.js +58 -0
  120. package/dist/models/PeakWindow.d.ts +38 -0
  121. package/dist/models/PeakWindow.js +54 -0
  122. package/dist/models/UpdateBillingDetailsRequest.d.ts +80 -0
  123. package/dist/models/UpdateBillingDetailsRequest.js +64 -0
  124. package/dist/models/index.d.ts +23 -0
  125. package/dist/models/index.js +23 -0
  126. package/dist/runtime.js +1 -1
  127. package/docs/BillingApi.md +299 -0
  128. package/docs/BillingDetails.md +56 -0
  129. package/docs/CreateFunctionRequest.md +34 -0
  130. package/docs/CreateFunctionRunRequest.md +36 -0
  131. package/docs/CreateFunctionVersionRequest.md +60 -0
  132. package/docs/Function.md +75 -0
  133. package/docs/FunctionList.md +34 -0
  134. package/docs/FunctionReplicaCounts.md +39 -0
  135. package/docs/FunctionRun.md +63 -0
  136. package/docs/FunctionRunError.md +38 -0
  137. package/docs/FunctionRunList.md +36 -0
  138. package/docs/FunctionRunLogChunk.md +40 -0
  139. package/docs/FunctionRunLogs.md +38 -0
  140. package/docs/FunctionUpload.md +38 -0
  141. package/docs/FunctionVersion.md +66 -0
  142. package/docs/FunctionsApi.md +880 -0
  143. package/docs/GpuSuggestion.md +47 -0
  144. package/docs/GpuSuggestionCheaper.md +45 -0
  145. package/docs/GpuSuggestionGpu.md +41 -0
  146. package/docs/Instance.md +2 -0
  147. package/docs/InstanceGpuMemory.md +41 -0
  148. package/docs/InstancesApi.md +75 -0
  149. package/docs/Invoice.md +46 -0
  150. package/docs/InvoiceList.md +38 -0
  151. package/docs/ModelPricing.md +12 -0
  152. package/docs/ModelRate.md +45 -0
  153. package/docs/PeakWindow.md +37 -0
  154. package/docs/UpdateBillingDetailsRequest.md +50 -0
  155. package/package.json +1 -1
  156. package/src/apis/BillingApi.ts +247 -0
  157. package/src/apis/FunctionsApi.ts +828 -0
  158. package/src/apis/InstancesApi.ts +64 -0
  159. package/src/apis/index.ts +1 -0
  160. package/src/models/AutolaunchRule.ts +2 -1
  161. package/src/models/BillingDetails.ts +164 -0
  162. package/src/models/CreateFunctionRequest.ts +66 -0
  163. package/src/models/CreateFunctionRunRequest.ts +74 -0
  164. package/src/models/CreateFunctionVersionRequest.ts +175 -0
  165. package/src/models/Function.ts +255 -0
  166. package/src/models/FunctionList.ts +74 -0
  167. package/src/models/FunctionReplicaCounts.ts +84 -0
  168. package/src/models/FunctionRun.ts +207 -0
  169. package/src/models/FunctionRunError.ts +83 -0
  170. package/src/models/FunctionRunList.ts +83 -0
  171. package/src/models/FunctionRunLogChunk.ts +105 -0
  172. package/src/models/FunctionRunLogs.ts +92 -0
  173. package/src/models/FunctionUpload.ts +96 -0
  174. package/src/models/FunctionVersion.ts +226 -0
  175. package/src/models/GpuSuggestion.ts +150 -0
  176. package/src/models/GpuSuggestionCheaper.ts +111 -0
  177. package/src/models/GpuSuggestionGpu.ts +93 -0
  178. package/src/models/Instance.ts +15 -0
  179. package/src/models/InstanceGpuMemory.ts +94 -0
  180. package/src/models/Invoice.ts +120 -0
  181. package/src/models/InvoiceList.ts +91 -0
  182. package/src/models/ModelPricing.ts +74 -0
  183. package/src/models/ModelRate.ts +105 -0
  184. package/src/models/PeakWindow.ts +75 -0
  185. package/src/models/UpdateBillingDetailsRequest.ts +129 -0
  186. package/src/models/index.ts +23 -0
  187. package/src/runtime.ts +1 -1
@@ -22,6 +22,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
22
22
  };
23
23
  import * as runtime from '../runtime';
24
24
  import { CreateInstanceRequestToJSON, } from '../models/CreateInstanceRequest';
25
+ import { GpuSuggestionFromJSON, } from '../models/GpuSuggestion';
25
26
  import { InstanceFromJSON, } from '../models/Instance';
26
27
  import { InstancePageFromJSON, } from '../models/InstancePage';
27
28
  import { OperationFromJSON, } from '../models/Operation';
@@ -180,6 +181,54 @@ export class InstancesApi extends runtime.BaseAPI {
180
181
  return yield response.value();
181
182
  });
182
183
  }
184
+ /**
185
+ * Creates request options for getInstanceGpuSuggestion without sending the request
186
+ */
187
+ getInstanceGpuSuggestionRequestOpts(requestParameters) {
188
+ return __awaiter(this, void 0, void 0, function* () {
189
+ if (requestParameters['id'] == null) {
190
+ throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling getInstanceGpuSuggestion().');
191
+ }
192
+ const queryParameters = {};
193
+ const headerParameters = {};
194
+ if (this.configuration && this.configuration.accessToken) {
195
+ const token = this.configuration.accessToken;
196
+ const tokenString = yield token("bearerAuth", []);
197
+ if (tokenString) {
198
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
199
+ }
200
+ }
201
+ let urlPath = `/instances/{id}/gpu-suggestion`;
202
+ urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
203
+ return {
204
+ path: urlPath,
205
+ method: 'GET',
206
+ headers: headerParameters,
207
+ query: queryParameters,
208
+ };
209
+ });
210
+ }
211
+ /**
212
+ * Compares the highest GPU memory this instance has used (its `gpu_memory` peak, plus headroom) with the GPU models currently listed, and names the cheapest model that would have fit when the saving is worth a look. It never changes anything: it reports what the telemetry shows. Memory use can grow later, so treat it as a starting point. `status` is `insufficient_data` until the instance has about an hour of telemetry, `no_cheaper_fit` when no cheaper listed model covers the peak, and `suggestion` when one does. Requires the `instances:read` scope. An instance owned by another organization returns 404.
213
+ * Suggest a lower-priced GPU for an instance
214
+ */
215
+ getInstanceGpuSuggestionRaw(requestParameters, initOverrides) {
216
+ return __awaiter(this, void 0, void 0, function* () {
217
+ const requestOptions = yield this.getInstanceGpuSuggestionRequestOpts(requestParameters);
218
+ const response = yield this.request(requestOptions, initOverrides);
219
+ return new runtime.JSONApiResponse(response, (jsonValue) => GpuSuggestionFromJSON(jsonValue));
220
+ });
221
+ }
222
+ /**
223
+ * Compares the highest GPU memory this instance has used (its `gpu_memory` peak, plus headroom) with the GPU models currently listed, and names the cheapest model that would have fit when the saving is worth a look. It never changes anything: it reports what the telemetry shows. Memory use can grow later, so treat it as a starting point. `status` is `insufficient_data` until the instance has about an hour of telemetry, `no_cheaper_fit` when no cheaper listed model covers the peak, and `suggestion` when one does. Requires the `instances:read` scope. An instance owned by another organization returns 404.
224
+ * Suggest a lower-priced GPU for an instance
225
+ */
226
+ getInstanceGpuSuggestion(requestParameters, initOverrides) {
227
+ return __awaiter(this, void 0, void 0, function* () {
228
+ const response = yield this.getInstanceGpuSuggestionRaw(requestParameters, initOverrides);
229
+ return yield response.value();
230
+ });
231
+ }
183
232
  /**
184
233
  * Creates request options for listInstances without sending the request
185
234
  */
@@ -3,6 +3,7 @@ export * from './BillingApi';
3
3
  export * from './CommunityApi';
4
4
  export * from './EnvironmentsApi';
5
5
  export * from './FineTuningApi';
6
+ export * from './FunctionsApi';
6
7
  export * from './GpuTypesApi';
7
8
  export * from './InferenceApi';
8
9
  export * from './InstancesApi';
@@ -5,6 +5,7 @@ export * from './BillingApi';
5
5
  export * from './CommunityApi';
6
6
  export * from './EnvironmentsApi';
7
7
  export * from './FineTuningApi';
8
+ export * from './FunctionsApi';
8
9
  export * from './GpuTypesApi';
9
10
  export * from './InferenceApi';
10
11
  export * from './InstancesApi';
@@ -106,7 +106,8 @@ export interface AutolaunchRule {
106
106
  */
107
107
  lastFailureReason: string | null;
108
108
  /**
109
- * The instance this rule launched, once it has fired.
109
+ * The instance this rule launched, once it has fired — an instance id of the form "gpu-" + 8 lowercase hex, the same string /v1/instances returns. Not a uuid, and deliberately carries no format or pattern: no other instance-id field in this document constrains its shape, and a generated client-side assertion on an id grammar turns a server-side widening into a client-side outage.
110
+ *
110
111
  * @type {string}
111
112
  * @memberof AutolaunchRule
112
113
  */
@@ -0,0 +1,98 @@
1
+ /**
2
+ * GPU.ai Public Developer API
3
+ * Programmatic API for GPU.ai. Authenticate with API keys minted from the dashboard. See https://gpu.ai/docs for details.
4
+ *
5
+ * The version of the OpenAPI document: 1.0.0
6
+ * Contact: support@gpu.ai
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ /**
13
+ *
14
+ * @export
15
+ * @interface BillingDetails
16
+ */
17
+ export interface BillingDetails {
18
+ /**
19
+ *
20
+ * @type {string}
21
+ * @memberof BillingDetails
22
+ */
23
+ legalName: string;
24
+ /**
25
+ *
26
+ * @type {string}
27
+ * @memberof BillingDetails
28
+ */
29
+ addressLine1: string;
30
+ /**
31
+ *
32
+ * @type {string}
33
+ * @memberof BillingDetails
34
+ */
35
+ addressLine2: string;
36
+ /**
37
+ *
38
+ * @type {string}
39
+ * @memberof BillingDetails
40
+ */
41
+ city: string;
42
+ /**
43
+ *
44
+ * @type {string}
45
+ * @memberof BillingDetails
46
+ */
47
+ region: string;
48
+ /**
49
+ *
50
+ * @type {string}
51
+ * @memberof BillingDetails
52
+ */
53
+ postalCode: string;
54
+ /**
55
+ * ISO 3166-1 alpha-2 code, or empty.
56
+ * @type {string}
57
+ * @memberof BillingDetails
58
+ */
59
+ country: string;
60
+ /**
61
+ * eu_vat, gb_vat, ch_vat, no_vat, us_ein, ca_bn, au_abn, nz_gst, in_gst, sg_uen, jp_cn, kr_brn, ae_trn, sa_vat, br_cnpj, mx_rfc or other. Empty when no Tax ID is stored.
62
+ * @type {string}
63
+ * @memberof BillingDetails
64
+ */
65
+ taxIdType: string;
66
+ /**
67
+ * The stored Tax ID, masked. Empty when none is stored.
68
+ * @type {string}
69
+ * @memberof BillingDetails
70
+ */
71
+ taxIdMasked: string;
72
+ /**
73
+ *
74
+ * @type {boolean}
75
+ * @memberof BillingDetails
76
+ */
77
+ hasTaxId: boolean;
78
+ /**
79
+ * False when this deployment cannot store a Tax ID.
80
+ * @type {boolean}
81
+ * @memberof BillingDetails
82
+ */
83
+ taxIdEnabled: boolean;
84
+ /**
85
+ *
86
+ * @type {Date}
87
+ * @memberof BillingDetails
88
+ */
89
+ updatedAt?: Date;
90
+ }
91
+ /**
92
+ * Check if a given object implements the BillingDetails interface.
93
+ */
94
+ export declare function instanceOfBillingDetails(value: object): value is BillingDetails;
95
+ export declare function BillingDetailsFromJSON(json: any): BillingDetails;
96
+ export declare function BillingDetailsFromJSONTyped(json: any, ignoreDiscriminator: boolean): BillingDetails;
97
+ export declare function BillingDetailsToJSON(json: any): BillingDetails;
98
+ export declare function BillingDetailsToJSONTyped(value?: BillingDetails | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,85 @@
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
+ * Check if a given object implements the BillingDetails interface.
16
+ */
17
+ export function instanceOfBillingDetails(value) {
18
+ if ((!('legalName' in value) && !('legal_name' in value)) || (value['legalName'] === undefined && value['legal_name'] === undefined))
19
+ return false;
20
+ if ((!('addressLine1' in value) && !('address_line1' in value)) || (value['addressLine1'] === undefined && value['address_line1'] === undefined))
21
+ return false;
22
+ if ((!('addressLine2' in value) && !('address_line2' in value)) || (value['addressLine2'] === undefined && value['address_line2'] === undefined))
23
+ return false;
24
+ if (!('city' in value) || value['city'] === undefined)
25
+ return false;
26
+ if (!('region' in value) || value['region'] === undefined)
27
+ return false;
28
+ if ((!('postalCode' in value) && !('postal_code' in value)) || (value['postalCode'] === undefined && value['postal_code'] === undefined))
29
+ return false;
30
+ if (!('country' in value) || value['country'] === undefined)
31
+ return false;
32
+ if ((!('taxIdType' in value) && !('tax_id_type' in value)) || (value['taxIdType'] === undefined && value['tax_id_type'] === undefined))
33
+ return false;
34
+ if ((!('taxIdMasked' in value) && !('tax_id_masked' in value)) || (value['taxIdMasked'] === undefined && value['tax_id_masked'] === undefined))
35
+ return false;
36
+ if ((!('hasTaxId' in value) && !('has_tax_id' in value)) || (value['hasTaxId'] === undefined && value['has_tax_id'] === undefined))
37
+ return false;
38
+ if ((!('taxIdEnabled' in value) && !('tax_id_enabled' in value)) || (value['taxIdEnabled'] === undefined && value['tax_id_enabled'] === undefined))
39
+ return false;
40
+ return true;
41
+ }
42
+ export function BillingDetailsFromJSON(json) {
43
+ return BillingDetailsFromJSONTyped(json, false);
44
+ }
45
+ export function BillingDetailsFromJSONTyped(json, ignoreDiscriminator) {
46
+ if (json == null) {
47
+ return json;
48
+ }
49
+ return {
50
+ 'legalName': json['legal_name'],
51
+ 'addressLine1': json['address_line1'],
52
+ 'addressLine2': json['address_line2'],
53
+ 'city': json['city'],
54
+ 'region': json['region'],
55
+ 'postalCode': json['postal_code'],
56
+ 'country': json['country'],
57
+ 'taxIdType': json['tax_id_type'],
58
+ 'taxIdMasked': json['tax_id_masked'],
59
+ 'hasTaxId': json['has_tax_id'],
60
+ 'taxIdEnabled': json['tax_id_enabled'],
61
+ 'updatedAt': json['updated_at'] == null ? undefined : (new Date(json['updated_at'])),
62
+ };
63
+ }
64
+ export function BillingDetailsToJSON(json) {
65
+ return BillingDetailsToJSONTyped(json, false);
66
+ }
67
+ export function BillingDetailsToJSONTyped(value, ignoreDiscriminator = false) {
68
+ if (value == null) {
69
+ return value;
70
+ }
71
+ return {
72
+ 'legal_name': value['legalName'],
73
+ 'address_line1': value['addressLine1'],
74
+ 'address_line2': value['addressLine2'],
75
+ 'city': value['city'],
76
+ 'region': value['region'],
77
+ 'postal_code': value['postalCode'],
78
+ 'country': value['country'],
79
+ 'tax_id_type': value['taxIdType'],
80
+ 'tax_id_masked': value['taxIdMasked'],
81
+ 'has_tax_id': value['hasTaxId'],
82
+ 'tax_id_enabled': value['taxIdEnabled'],
83
+ 'updated_at': value['updatedAt'] == null ? value['updatedAt'] : value['updatedAt'].toISOString(),
84
+ };
85
+ }
@@ -0,0 +1,32 @@
1
+ /**
2
+ * GPU.ai Public Developer API
3
+ * Programmatic API for GPU.ai. Authenticate with API keys minted from the dashboard. See https://gpu.ai/docs for details.
4
+ *
5
+ * The version of the OpenAPI document: 1.0.0
6
+ * Contact: support@gpu.ai
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ /**
13
+ *
14
+ * @export
15
+ * @interface CreateFunctionRequest
16
+ */
17
+ export interface CreateFunctionRequest {
18
+ /**
19
+ * A letter, then letters, digits, underscores or hyphens; 63 characters at most.
20
+ * @type {string}
21
+ * @memberof CreateFunctionRequest
22
+ */
23
+ name: string;
24
+ }
25
+ /**
26
+ * Check if a given object implements the CreateFunctionRequest interface.
27
+ */
28
+ export declare function instanceOfCreateFunctionRequest(value: object): value is CreateFunctionRequest;
29
+ export declare function CreateFunctionRequestFromJSON(json: any): CreateFunctionRequest;
30
+ export declare function CreateFunctionRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateFunctionRequest;
31
+ export declare function CreateFunctionRequestToJSON(json: any): CreateFunctionRequest;
32
+ export declare function CreateFunctionRequestToJSONTyped(value?: CreateFunctionRequest | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,43 @@
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
+ * Check if a given object implements the CreateFunctionRequest interface.
16
+ */
17
+ export function instanceOfCreateFunctionRequest(value) {
18
+ if (!('name' in value) || value['name'] === undefined)
19
+ return false;
20
+ return true;
21
+ }
22
+ export function CreateFunctionRequestFromJSON(json) {
23
+ return CreateFunctionRequestFromJSONTyped(json, false);
24
+ }
25
+ export function CreateFunctionRequestFromJSONTyped(json, ignoreDiscriminator) {
26
+ if (json == null) {
27
+ return json;
28
+ }
29
+ return {
30
+ 'name': json['name'],
31
+ };
32
+ }
33
+ export function CreateFunctionRequestToJSON(json) {
34
+ return CreateFunctionRequestToJSONTyped(json, false);
35
+ }
36
+ export function CreateFunctionRequestToJSONTyped(value, ignoreDiscriminator = false) {
37
+ if (value == null) {
38
+ return value;
39
+ }
40
+ return {
41
+ 'name': value['name'],
42
+ };
43
+ }
@@ -0,0 +1,38 @@
1
+ /**
2
+ * GPU.ai Public Developer API
3
+ * Programmatic API for GPU.ai. Authenticate with API keys minted from the dashboard. See https://gpu.ai/docs for details.
4
+ *
5
+ * The version of the OpenAPI document: 1.0.0
6
+ * Contact: support@gpu.ai
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ /**
13
+ *
14
+ * @export
15
+ * @interface CreateFunctionRunRequest
16
+ */
17
+ export interface CreateFunctionRunRequest {
18
+ /**
19
+ * The version to run. Omit to run the function's current version.
20
+ * @type {string}
21
+ * @memberof CreateFunctionRunRequest
22
+ */
23
+ versionId?: string;
24
+ /**
25
+ * The pickled (args, kwargs) of the call, base64-encoded. 4 MB at most before encoding.
26
+ * @type {string}
27
+ * @memberof CreateFunctionRunRequest
28
+ */
29
+ input: string;
30
+ }
31
+ /**
32
+ * Check if a given object implements the CreateFunctionRunRequest interface.
33
+ */
34
+ export declare function instanceOfCreateFunctionRunRequest(value: object): value is CreateFunctionRunRequest;
35
+ export declare function CreateFunctionRunRequestFromJSON(json: any): CreateFunctionRunRequest;
36
+ export declare function CreateFunctionRunRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateFunctionRunRequest;
37
+ export declare function CreateFunctionRunRequestToJSON(json: any): CreateFunctionRunRequest;
38
+ export declare function CreateFunctionRunRequestToJSONTyped(value?: CreateFunctionRunRequest | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,45 @@
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
+ * Check if a given object implements the CreateFunctionRunRequest interface.
16
+ */
17
+ export function instanceOfCreateFunctionRunRequest(value) {
18
+ if (!('input' in value) || value['input'] === undefined)
19
+ return false;
20
+ return true;
21
+ }
22
+ export function CreateFunctionRunRequestFromJSON(json) {
23
+ return CreateFunctionRunRequestFromJSONTyped(json, false);
24
+ }
25
+ export function CreateFunctionRunRequestFromJSONTyped(json, ignoreDiscriminator) {
26
+ if (json == null) {
27
+ return json;
28
+ }
29
+ return {
30
+ 'versionId': json['version_id'] == null ? undefined : json['version_id'],
31
+ 'input': json['input'],
32
+ };
33
+ }
34
+ export function CreateFunctionRunRequestToJSON(json) {
35
+ return CreateFunctionRunRequestToJSONTyped(json, false);
36
+ }
37
+ export function CreateFunctionRunRequestToJSONTyped(value, ignoreDiscriminator = false) {
38
+ if (value == null) {
39
+ return value;
40
+ }
41
+ return {
42
+ 'version_id': value['versionId'],
43
+ 'input': value['input'],
44
+ };
45
+ }
@@ -0,0 +1,110 @@
1
+ /**
2
+ * GPU.ai Public Developer API
3
+ * Programmatic API for GPU.ai. Authenticate with API keys minted from the dashboard. See https://gpu.ai/docs for details.
4
+ *
5
+ * The version of the OpenAPI document: 1.0.0
6
+ * Contact: support@gpu.ai
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ /**
13
+ *
14
+ * @export
15
+ * @interface CreateFunctionVersionRequest
16
+ */
17
+ export interface CreateFunctionVersionRequest {
18
+ /**
19
+ * Lowercase hex SHA-256 over the code and everything declared about it.
20
+ * @type {string}
21
+ * @memberof CreateFunctionVersionRequest
22
+ */
23
+ contentHash: string;
24
+ /**
25
+ * Lowercase hex SHA-256 of the pickled function.
26
+ * @type {string}
27
+ * @memberof CreateFunctionVersionRequest
28
+ */
29
+ bundleSha256: string;
30
+ /**
31
+ * Size of the pickled function. 64 MB at most.
32
+ * @type {number}
33
+ * @memberof CreateFunctionVersionRequest
34
+ */
35
+ bundleBytes: number;
36
+ /**
37
+ * The Python minor version the function was pickled with, such as "3.11".
38
+ * @type {string}
39
+ * @memberof CreateFunctionVersionRequest
40
+ */
41
+ pythonVersion: string;
42
+ /**
43
+ *
44
+ * @type {string}
45
+ * @memberof CreateFunctionVersionRequest
46
+ */
47
+ cloudpickleVersion: string;
48
+ /**
49
+ * Requirements to install on the machine. Options (anything starting with "-") are refused.
50
+ * @type {Array<string>}
51
+ * @memberof CreateFunctionVersionRequest
52
+ */
53
+ pip?: Array<string>;
54
+ /**
55
+ * A GPU type from GET /gpu-types. Omit to use the cheapest GPU that fits.
56
+ * @type {string}
57
+ * @memberof CreateFunctionVersionRequest
58
+ */
59
+ gpu?: string;
60
+ /**
61
+ *
62
+ * @type {number}
63
+ * @memberof CreateFunctionVersionRequest
64
+ */
65
+ gpuCount?: number;
66
+ /**
67
+ * Least VRAM per GPU, used when gpu is omitted.
68
+ * @type {number}
69
+ * @memberof CreateFunctionVersionRequest
70
+ */
71
+ minVramGb?: number;
72
+ /**
73
+ *
74
+ * @type {Array<string>}
75
+ * @memberof CreateFunctionVersionRequest
76
+ */
77
+ regions?: Array<string>;
78
+ /**
79
+ *
80
+ * @type {number}
81
+ * @memberof CreateFunctionVersionRequest
82
+ */
83
+ maxPricePerHour?: number;
84
+ /**
85
+ * Seconds one call may run. 1 to 86400.
86
+ * @type {number}
87
+ * @memberof CreateFunctionVersionRequest
88
+ */
89
+ timeout: number;
90
+ /**
91
+ * Seconds a machine stays ready after a call. 0 releases it at once.
92
+ * @type {number}
93
+ * @memberof CreateFunctionVersionRequest
94
+ */
95
+ idleTimeout?: number;
96
+ /**
97
+ *
98
+ * @type {number}
99
+ * @memberof CreateFunctionVersionRequest
100
+ */
101
+ maxConcurrency?: number;
102
+ }
103
+ /**
104
+ * Check if a given object implements the CreateFunctionVersionRequest interface.
105
+ */
106
+ export declare function instanceOfCreateFunctionVersionRequest(value: object): value is CreateFunctionVersionRequest;
107
+ export declare function CreateFunctionVersionRequestFromJSON(json: any): CreateFunctionVersionRequest;
108
+ export declare function CreateFunctionVersionRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateFunctionVersionRequest;
109
+ export declare function CreateFunctionVersionRequestToJSON(json: any): CreateFunctionVersionRequest;
110
+ export declare function CreateFunctionVersionRequestToJSONTyped(value?: CreateFunctionVersionRequest | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,79 @@
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
+ * Check if a given object implements the CreateFunctionVersionRequest interface.
16
+ */
17
+ export function instanceOfCreateFunctionVersionRequest(value) {
18
+ if ((!('contentHash' in value) && !('content_hash' in value)) || (value['contentHash'] === undefined && value['content_hash'] === undefined))
19
+ return false;
20
+ if ((!('bundleSha256' in value) && !('bundle_sha256' in value)) || (value['bundleSha256'] === undefined && value['bundle_sha256'] === undefined))
21
+ return false;
22
+ if ((!('bundleBytes' in value) && !('bundle_bytes' in value)) || (value['bundleBytes'] === undefined && value['bundle_bytes'] === undefined))
23
+ return false;
24
+ if ((!('pythonVersion' in value) && !('python_version' in value)) || (value['pythonVersion'] === undefined && value['python_version'] === undefined))
25
+ return false;
26
+ if ((!('cloudpickleVersion' in value) && !('cloudpickle_version' in value)) || (value['cloudpickleVersion'] === undefined && value['cloudpickle_version'] === undefined))
27
+ return false;
28
+ if (!('timeout' in value) || value['timeout'] === undefined)
29
+ return false;
30
+ return true;
31
+ }
32
+ export function CreateFunctionVersionRequestFromJSON(json) {
33
+ return CreateFunctionVersionRequestFromJSONTyped(json, false);
34
+ }
35
+ export function CreateFunctionVersionRequestFromJSONTyped(json, ignoreDiscriminator) {
36
+ if (json == null) {
37
+ return json;
38
+ }
39
+ return {
40
+ 'contentHash': json['content_hash'],
41
+ 'bundleSha256': json['bundle_sha256'],
42
+ 'bundleBytes': json['bundle_bytes'],
43
+ 'pythonVersion': json['python_version'],
44
+ 'cloudpickleVersion': json['cloudpickle_version'],
45
+ 'pip': json['pip'] == null ? undefined : json['pip'],
46
+ 'gpu': json['gpu'] == null ? undefined : json['gpu'],
47
+ 'gpuCount': json['gpu_count'] == null ? undefined : json['gpu_count'],
48
+ 'minVramGb': json['min_vram_gb'] == null ? undefined : json['min_vram_gb'],
49
+ 'regions': json['regions'] == null ? undefined : json['regions'],
50
+ 'maxPricePerHour': json['max_price_per_hour'] == null ? undefined : json['max_price_per_hour'],
51
+ 'timeout': json['timeout'],
52
+ 'idleTimeout': json['idle_timeout'] == null ? undefined : json['idle_timeout'],
53
+ 'maxConcurrency': json['max_concurrency'] == null ? undefined : json['max_concurrency'],
54
+ };
55
+ }
56
+ export function CreateFunctionVersionRequestToJSON(json) {
57
+ return CreateFunctionVersionRequestToJSONTyped(json, false);
58
+ }
59
+ export function CreateFunctionVersionRequestToJSONTyped(value, ignoreDiscriminator = false) {
60
+ if (value == null) {
61
+ return value;
62
+ }
63
+ return {
64
+ 'content_hash': value['contentHash'],
65
+ 'bundle_sha256': value['bundleSha256'],
66
+ 'bundle_bytes': value['bundleBytes'],
67
+ 'python_version': value['pythonVersion'],
68
+ 'cloudpickle_version': value['cloudpickleVersion'],
69
+ 'pip': value['pip'],
70
+ 'gpu': value['gpu'],
71
+ 'gpu_count': value['gpuCount'],
72
+ 'min_vram_gb': value['minVramGb'],
73
+ 'regions': value['regions'],
74
+ 'max_price_per_hour': value['maxPricePerHour'],
75
+ 'timeout': value['timeout'],
76
+ 'idle_timeout': value['idleTimeout'],
77
+ 'max_concurrency': value['maxConcurrency'],
78
+ };
79
+ }