@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.
Files changed (151) hide show
  1. package/.openapi-generator/FILES +40 -0
  2. package/README.md +36 -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/index.d.ts +1 -0
  8. package/dist/apis/index.js +1 -0
  9. package/dist/esm/apis/BillingApi.d.ts +70 -0
  10. package/dist/esm/apis/BillingApi.js +197 -0
  11. package/dist/esm/apis/FunctionsApi.d.ts +228 -0
  12. package/dist/esm/apis/FunctionsApi.js +623 -0
  13. package/dist/esm/apis/index.d.ts +1 -0
  14. package/dist/esm/apis/index.js +1 -0
  15. package/dist/esm/models/AutolaunchRule.d.ts +2 -1
  16. package/dist/esm/models/BillingDetails.d.ts +98 -0
  17. package/dist/esm/models/BillingDetails.js +85 -0
  18. package/dist/esm/models/CreateFunctionRequest.d.ts +32 -0
  19. package/dist/esm/models/CreateFunctionRequest.js +43 -0
  20. package/dist/esm/models/CreateFunctionRunRequest.d.ts +38 -0
  21. package/dist/esm/models/CreateFunctionRunRequest.js +45 -0
  22. package/dist/esm/models/CreateFunctionVersionRequest.d.ts +110 -0
  23. package/dist/esm/models/CreateFunctionVersionRequest.js +79 -0
  24. package/dist/esm/models/Function.d.ts +163 -0
  25. package/dist/esm/models/Function.js +109 -0
  26. package/dist/esm/models/FunctionList.d.ts +33 -0
  27. package/dist/esm/models/FunctionList.js +44 -0
  28. package/dist/esm/models/FunctionReplicaCounts.d.ts +44 -0
  29. package/dist/esm/models/FunctionReplicaCounts.js +51 -0
  30. package/dist/esm/models/FunctionRun.d.ts +130 -0
  31. package/dist/esm/models/FunctionRun.js +94 -0
  32. package/dist/esm/models/FunctionRunError.d.ts +44 -0
  33. package/dist/esm/models/FunctionRunError.js +49 -0
  34. package/dist/esm/models/FunctionRunList.d.ts +39 -0
  35. package/dist/esm/models/FunctionRunList.js +48 -0
  36. package/dist/esm/models/FunctionRunLogChunk.d.ts +59 -0
  37. package/dist/esm/models/FunctionRunLogChunk.js +63 -0
  38. package/dist/esm/models/FunctionRunLogs.d.ts +45 -0
  39. package/dist/esm/models/FunctionRunLogs.js +52 -0
  40. package/dist/esm/models/FunctionUpload.d.ts +51 -0
  41. package/dist/esm/models/FunctionUpload.js +59 -0
  42. package/dist/esm/models/FunctionVersion.d.ts +137 -0
  43. package/dist/esm/models/FunctionVersion.js +109 -0
  44. package/dist/esm/models/Invoice.d.ts +68 -0
  45. package/dist/esm/models/Invoice.js +67 -0
  46. package/dist/esm/models/InvoiceList.d.ts +45 -0
  47. package/dist/esm/models/InvoiceList.js +50 -0
  48. package/dist/esm/models/ModelPricing.d.ts +46 -0
  49. package/dist/esm/models/ModelPricing.js +21 -0
  50. package/dist/esm/models/ModelRate.d.ts +62 -0
  51. package/dist/esm/models/ModelRate.js +51 -0
  52. package/dist/esm/models/PeakWindow.d.ts +38 -0
  53. package/dist/esm/models/PeakWindow.js +47 -0
  54. package/dist/esm/models/UpdateBillingDetailsRequest.d.ts +80 -0
  55. package/dist/esm/models/UpdateBillingDetailsRequest.js +57 -0
  56. package/dist/esm/models/index.d.ts +19 -0
  57. package/dist/esm/models/index.js +19 -0
  58. package/dist/esm/runtime.js +1 -1
  59. package/dist/models/AutolaunchRule.d.ts +2 -1
  60. package/dist/models/BillingDetails.d.ts +98 -0
  61. package/dist/models/BillingDetails.js +92 -0
  62. package/dist/models/CreateFunctionRequest.d.ts +32 -0
  63. package/dist/models/CreateFunctionRequest.js +50 -0
  64. package/dist/models/CreateFunctionRunRequest.d.ts +38 -0
  65. package/dist/models/CreateFunctionRunRequest.js +52 -0
  66. package/dist/models/CreateFunctionVersionRequest.d.ts +110 -0
  67. package/dist/models/CreateFunctionVersionRequest.js +86 -0
  68. package/dist/models/Function.d.ts +163 -0
  69. package/dist/models/Function.js +117 -0
  70. package/dist/models/FunctionList.d.ts +33 -0
  71. package/dist/models/FunctionList.js +51 -0
  72. package/dist/models/FunctionReplicaCounts.d.ts +44 -0
  73. package/dist/models/FunctionReplicaCounts.js +58 -0
  74. package/dist/models/FunctionRun.d.ts +130 -0
  75. package/dist/models/FunctionRun.js +102 -0
  76. package/dist/models/FunctionRunError.d.ts +44 -0
  77. package/dist/models/FunctionRunError.js +56 -0
  78. package/dist/models/FunctionRunList.d.ts +39 -0
  79. package/dist/models/FunctionRunList.js +55 -0
  80. package/dist/models/FunctionRunLogChunk.d.ts +59 -0
  81. package/dist/models/FunctionRunLogChunk.js +71 -0
  82. package/dist/models/FunctionRunLogs.d.ts +45 -0
  83. package/dist/models/FunctionRunLogs.js +59 -0
  84. package/dist/models/FunctionUpload.d.ts +51 -0
  85. package/dist/models/FunctionUpload.js +67 -0
  86. package/dist/models/FunctionVersion.d.ts +137 -0
  87. package/dist/models/FunctionVersion.js +117 -0
  88. package/dist/models/Invoice.d.ts +68 -0
  89. package/dist/models/Invoice.js +74 -0
  90. package/dist/models/InvoiceList.d.ts +45 -0
  91. package/dist/models/InvoiceList.js +57 -0
  92. package/dist/models/ModelPricing.d.ts +46 -0
  93. package/dist/models/ModelPricing.js +22 -0
  94. package/dist/models/ModelRate.d.ts +62 -0
  95. package/dist/models/ModelRate.js +58 -0
  96. package/dist/models/PeakWindow.d.ts +38 -0
  97. package/dist/models/PeakWindow.js +54 -0
  98. package/dist/models/UpdateBillingDetailsRequest.d.ts +80 -0
  99. package/dist/models/UpdateBillingDetailsRequest.js +64 -0
  100. package/dist/models/index.d.ts +19 -0
  101. package/dist/models/index.js +19 -0
  102. package/dist/runtime.js +1 -1
  103. package/docs/BillingApi.md +299 -0
  104. package/docs/BillingDetails.md +56 -0
  105. package/docs/CreateFunctionRequest.md +34 -0
  106. package/docs/CreateFunctionRunRequest.md +36 -0
  107. package/docs/CreateFunctionVersionRequest.md +60 -0
  108. package/docs/Function.md +75 -0
  109. package/docs/FunctionList.md +34 -0
  110. package/docs/FunctionReplicaCounts.md +39 -0
  111. package/docs/FunctionRun.md +63 -0
  112. package/docs/FunctionRunError.md +38 -0
  113. package/docs/FunctionRunList.md +36 -0
  114. package/docs/FunctionRunLogChunk.md +40 -0
  115. package/docs/FunctionRunLogs.md +38 -0
  116. package/docs/FunctionUpload.md +38 -0
  117. package/docs/FunctionVersion.md +66 -0
  118. package/docs/FunctionsApi.md +880 -0
  119. package/docs/Invoice.md +46 -0
  120. package/docs/InvoiceList.md +38 -0
  121. package/docs/ModelPricing.md +12 -0
  122. package/docs/ModelRate.md +45 -0
  123. package/docs/PeakWindow.md +37 -0
  124. package/docs/UpdateBillingDetailsRequest.md +50 -0
  125. package/package.json +1 -1
  126. package/src/apis/BillingApi.ts +247 -0
  127. package/src/apis/FunctionsApi.ts +828 -0
  128. package/src/apis/index.ts +1 -0
  129. package/src/models/AutolaunchRule.ts +2 -1
  130. package/src/models/BillingDetails.ts +164 -0
  131. package/src/models/CreateFunctionRequest.ts +66 -0
  132. package/src/models/CreateFunctionRunRequest.ts +74 -0
  133. package/src/models/CreateFunctionVersionRequest.ts +175 -0
  134. package/src/models/Function.ts +255 -0
  135. package/src/models/FunctionList.ts +74 -0
  136. package/src/models/FunctionReplicaCounts.ts +84 -0
  137. package/src/models/FunctionRun.ts +207 -0
  138. package/src/models/FunctionRunError.ts +83 -0
  139. package/src/models/FunctionRunList.ts +83 -0
  140. package/src/models/FunctionRunLogChunk.ts +105 -0
  141. package/src/models/FunctionRunLogs.ts +92 -0
  142. package/src/models/FunctionUpload.ts +96 -0
  143. package/src/models/FunctionVersion.ts +226 -0
  144. package/src/models/Invoice.ts +120 -0
  145. package/src/models/InvoiceList.ts +91 -0
  146. package/src/models/ModelPricing.ts +74 -0
  147. package/src/models/ModelRate.ts +105 -0
  148. package/src/models/PeakWindow.ts +75 -0
  149. package/src/models/UpdateBillingDetailsRequest.ts +129 -0
  150. package/src/models/index.ts +19 -0
  151. package/src/runtime.ts +1 -1
package/src/apis/index.ts CHANGED
@@ -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';
@@ -108,7 +108,8 @@ export interface AutolaunchRule {
108
108
  */
109
109
  lastFailureReason: string | null;
110
110
  /**
111
- * The instance this rule launched, once it has fired.
111
+ * 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.
112
+ *
112
113
  * @type {string}
113
114
  * @memberof AutolaunchRule
114
115
  */
@@ -0,0 +1,164 @@
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 BillingDetails
20
+ */
21
+ export interface BillingDetails {
22
+ /**
23
+ *
24
+ * @type {string}
25
+ * @memberof BillingDetails
26
+ */
27
+ legalName: string;
28
+ /**
29
+ *
30
+ * @type {string}
31
+ * @memberof BillingDetails
32
+ */
33
+ addressLine1: string;
34
+ /**
35
+ *
36
+ * @type {string}
37
+ * @memberof BillingDetails
38
+ */
39
+ addressLine2: string;
40
+ /**
41
+ *
42
+ * @type {string}
43
+ * @memberof BillingDetails
44
+ */
45
+ city: string;
46
+ /**
47
+ *
48
+ * @type {string}
49
+ * @memberof BillingDetails
50
+ */
51
+ region: string;
52
+ /**
53
+ *
54
+ * @type {string}
55
+ * @memberof BillingDetails
56
+ */
57
+ postalCode: string;
58
+ /**
59
+ * ISO 3166-1 alpha-2 code, or empty.
60
+ * @type {string}
61
+ * @memberof BillingDetails
62
+ */
63
+ country: string;
64
+ /**
65
+ * 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.
66
+ * @type {string}
67
+ * @memberof BillingDetails
68
+ */
69
+ taxIdType: string;
70
+ /**
71
+ * The stored Tax ID, masked. Empty when none is stored.
72
+ * @type {string}
73
+ * @memberof BillingDetails
74
+ */
75
+ taxIdMasked: string;
76
+ /**
77
+ *
78
+ * @type {boolean}
79
+ * @memberof BillingDetails
80
+ */
81
+ hasTaxId: boolean;
82
+ /**
83
+ * False when this deployment cannot store a Tax ID.
84
+ * @type {boolean}
85
+ * @memberof BillingDetails
86
+ */
87
+ taxIdEnabled: boolean;
88
+ /**
89
+ *
90
+ * @type {Date}
91
+ * @memberof BillingDetails
92
+ */
93
+ updatedAt?: Date;
94
+ }
95
+
96
+ /**
97
+ * Check if a given object implements the BillingDetails interface.
98
+ */
99
+ export function instanceOfBillingDetails(value: object): value is BillingDetails {
100
+ if ((!('legalName' in (value as Record<string, any>)) && !('legal_name' in (value as Record<string, any>))) || ((value as Record<string, any>)['legalName'] === undefined && (value as Record<string, any>)['legal_name'] === undefined)) return false;
101
+ if ((!('addressLine1' in (value as Record<string, any>)) && !('address_line1' in (value as Record<string, any>))) || ((value as Record<string, any>)['addressLine1'] === undefined && (value as Record<string, any>)['address_line1'] === undefined)) return false;
102
+ if ((!('addressLine2' in (value as Record<string, any>)) && !('address_line2' in (value as Record<string, any>))) || ((value as Record<string, any>)['addressLine2'] === undefined && (value as Record<string, any>)['address_line2'] === undefined)) return false;
103
+ if (!('city' in value) || value['city'] === undefined) return false;
104
+ if (!('region' in value) || value['region'] === undefined) return false;
105
+ if ((!('postalCode' in (value as Record<string, any>)) && !('postal_code' in (value as Record<string, any>))) || ((value as Record<string, any>)['postalCode'] === undefined && (value as Record<string, any>)['postal_code'] === undefined)) return false;
106
+ if (!('country' in value) || value['country'] === undefined) return false;
107
+ if ((!('taxIdType' in (value as Record<string, any>)) && !('tax_id_type' in (value as Record<string, any>))) || ((value as Record<string, any>)['taxIdType'] === undefined && (value as Record<string, any>)['tax_id_type'] === undefined)) return false;
108
+ if ((!('taxIdMasked' in (value as Record<string, any>)) && !('tax_id_masked' in (value as Record<string, any>))) || ((value as Record<string, any>)['taxIdMasked'] === undefined && (value as Record<string, any>)['tax_id_masked'] === undefined)) return false;
109
+ if ((!('hasTaxId' in (value as Record<string, any>)) && !('has_tax_id' in (value as Record<string, any>))) || ((value as Record<string, any>)['hasTaxId'] === undefined && (value as Record<string, any>)['has_tax_id'] === undefined)) return false;
110
+ if ((!('taxIdEnabled' in (value as Record<string, any>)) && !('tax_id_enabled' in (value as Record<string, any>))) || ((value as Record<string, any>)['taxIdEnabled'] === undefined && (value as Record<string, any>)['tax_id_enabled'] === undefined)) return false;
111
+ return true;
112
+ }
113
+
114
+ export function BillingDetailsFromJSON(json: any): BillingDetails {
115
+ return BillingDetailsFromJSONTyped(json, false);
116
+ }
117
+
118
+ export function BillingDetailsFromJSONTyped(json: any, ignoreDiscriminator: boolean): BillingDetails {
119
+ if (json == null) {
120
+ return json;
121
+ }
122
+ return {
123
+
124
+ 'legalName': json['legal_name'],
125
+ 'addressLine1': json['address_line1'],
126
+ 'addressLine2': json['address_line2'],
127
+ 'city': json['city'],
128
+ 'region': json['region'],
129
+ 'postalCode': json['postal_code'],
130
+ 'country': json['country'],
131
+ 'taxIdType': json['tax_id_type'],
132
+ 'taxIdMasked': json['tax_id_masked'],
133
+ 'hasTaxId': json['has_tax_id'],
134
+ 'taxIdEnabled': json['tax_id_enabled'],
135
+ 'updatedAt': json['updated_at'] == null ? undefined : (new Date(json['updated_at'])),
136
+ };
137
+ }
138
+
139
+ export function BillingDetailsToJSON(json: any): BillingDetails {
140
+ return BillingDetailsToJSONTyped(json, false);
141
+ }
142
+
143
+ export function BillingDetailsToJSONTyped(value?: BillingDetails | null, ignoreDiscriminator: boolean = false): any {
144
+ if (value == null) {
145
+ return value;
146
+ }
147
+
148
+ return {
149
+
150
+ 'legal_name': value['legalName'],
151
+ 'address_line1': value['addressLine1'],
152
+ 'address_line2': value['addressLine2'],
153
+ 'city': value['city'],
154
+ 'region': value['region'],
155
+ 'postal_code': value['postalCode'],
156
+ 'country': value['country'],
157
+ 'tax_id_type': value['taxIdType'],
158
+ 'tax_id_masked': value['taxIdMasked'],
159
+ 'has_tax_id': value['hasTaxId'],
160
+ 'tax_id_enabled': value['taxIdEnabled'],
161
+ 'updated_at': value['updatedAt'] == null ? value['updatedAt'] : value['updatedAt'].toISOString(),
162
+ };
163
+ }
164
+
@@ -0,0 +1,66 @@
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 CreateFunctionRequest
20
+ */
21
+ export interface CreateFunctionRequest {
22
+ /**
23
+ * A letter, then letters, digits, underscores or hyphens; 63 characters at most.
24
+ * @type {string}
25
+ * @memberof CreateFunctionRequest
26
+ */
27
+ name: string;
28
+ }
29
+
30
+ /**
31
+ * Check if a given object implements the CreateFunctionRequest interface.
32
+ */
33
+ export function instanceOfCreateFunctionRequest(value: object): value is CreateFunctionRequest {
34
+ if (!('name' in value) || value['name'] === undefined) return false;
35
+ return true;
36
+ }
37
+
38
+ export function CreateFunctionRequestFromJSON(json: any): CreateFunctionRequest {
39
+ return CreateFunctionRequestFromJSONTyped(json, false);
40
+ }
41
+
42
+ export function CreateFunctionRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateFunctionRequest {
43
+ if (json == null) {
44
+ return json;
45
+ }
46
+ return {
47
+
48
+ 'name': json['name'],
49
+ };
50
+ }
51
+
52
+ export function CreateFunctionRequestToJSON(json: any): CreateFunctionRequest {
53
+ return CreateFunctionRequestToJSONTyped(json, false);
54
+ }
55
+
56
+ export function CreateFunctionRequestToJSONTyped(value?: CreateFunctionRequest | null, ignoreDiscriminator: boolean = false): any {
57
+ if (value == null) {
58
+ return value;
59
+ }
60
+
61
+ return {
62
+
63
+ 'name': value['name'],
64
+ };
65
+ }
66
+
@@ -0,0 +1,74 @@
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 CreateFunctionRunRequest
20
+ */
21
+ export interface CreateFunctionRunRequest {
22
+ /**
23
+ * The version to run. Omit to run the function's current version.
24
+ * @type {string}
25
+ * @memberof CreateFunctionRunRequest
26
+ */
27
+ versionId?: string;
28
+ /**
29
+ * The pickled (args, kwargs) of the call, base64-encoded. 4 MB at most before encoding.
30
+ * @type {string}
31
+ * @memberof CreateFunctionRunRequest
32
+ */
33
+ input: string;
34
+ }
35
+
36
+ /**
37
+ * Check if a given object implements the CreateFunctionRunRequest interface.
38
+ */
39
+ export function instanceOfCreateFunctionRunRequest(value: object): value is CreateFunctionRunRequest {
40
+ if (!('input' in value) || value['input'] === undefined) return false;
41
+ return true;
42
+ }
43
+
44
+ export function CreateFunctionRunRequestFromJSON(json: any): CreateFunctionRunRequest {
45
+ return CreateFunctionRunRequestFromJSONTyped(json, false);
46
+ }
47
+
48
+ export function CreateFunctionRunRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateFunctionRunRequest {
49
+ if (json == null) {
50
+ return json;
51
+ }
52
+ return {
53
+
54
+ 'versionId': json['version_id'] == null ? undefined : json['version_id'],
55
+ 'input': json['input'],
56
+ };
57
+ }
58
+
59
+ export function CreateFunctionRunRequestToJSON(json: any): CreateFunctionRunRequest {
60
+ return CreateFunctionRunRequestToJSONTyped(json, false);
61
+ }
62
+
63
+ export function CreateFunctionRunRequestToJSONTyped(value?: CreateFunctionRunRequest | null, ignoreDiscriminator: boolean = false): any {
64
+ if (value == null) {
65
+ return value;
66
+ }
67
+
68
+ return {
69
+
70
+ 'version_id': value['versionId'],
71
+ 'input': value['input'],
72
+ };
73
+ }
74
+
@@ -0,0 +1,175 @@
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 CreateFunctionVersionRequest
20
+ */
21
+ export interface CreateFunctionVersionRequest {
22
+ /**
23
+ * Lowercase hex SHA-256 over the code and everything declared about it.
24
+ * @type {string}
25
+ * @memberof CreateFunctionVersionRequest
26
+ */
27
+ contentHash: string;
28
+ /**
29
+ * Lowercase hex SHA-256 of the pickled function.
30
+ * @type {string}
31
+ * @memberof CreateFunctionVersionRequest
32
+ */
33
+ bundleSha256: string;
34
+ /**
35
+ * Size of the pickled function. 64 MB at most.
36
+ * @type {number}
37
+ * @memberof CreateFunctionVersionRequest
38
+ */
39
+ bundleBytes: number;
40
+ /**
41
+ * The Python minor version the function was pickled with, such as "3.11".
42
+ * @type {string}
43
+ * @memberof CreateFunctionVersionRequest
44
+ */
45
+ pythonVersion: string;
46
+ /**
47
+ *
48
+ * @type {string}
49
+ * @memberof CreateFunctionVersionRequest
50
+ */
51
+ cloudpickleVersion: string;
52
+ /**
53
+ * Requirements to install on the machine. Options (anything starting with "-") are refused.
54
+ * @type {Array<string>}
55
+ * @memberof CreateFunctionVersionRequest
56
+ */
57
+ pip?: Array<string>;
58
+ /**
59
+ * A GPU type from GET /gpu-types. Omit to use the cheapest GPU that fits.
60
+ * @type {string}
61
+ * @memberof CreateFunctionVersionRequest
62
+ */
63
+ gpu?: string;
64
+ /**
65
+ *
66
+ * @type {number}
67
+ * @memberof CreateFunctionVersionRequest
68
+ */
69
+ gpuCount?: number;
70
+ /**
71
+ * Least VRAM per GPU, used when gpu is omitted.
72
+ * @type {number}
73
+ * @memberof CreateFunctionVersionRequest
74
+ */
75
+ minVramGb?: number;
76
+ /**
77
+ *
78
+ * @type {Array<string>}
79
+ * @memberof CreateFunctionVersionRequest
80
+ */
81
+ regions?: Array<string>;
82
+ /**
83
+ *
84
+ * @type {number}
85
+ * @memberof CreateFunctionVersionRequest
86
+ */
87
+ maxPricePerHour?: number;
88
+ /**
89
+ * Seconds one call may run. 1 to 86400.
90
+ * @type {number}
91
+ * @memberof CreateFunctionVersionRequest
92
+ */
93
+ timeout: number;
94
+ /**
95
+ * Seconds a machine stays ready after a call. 0 releases it at once.
96
+ * @type {number}
97
+ * @memberof CreateFunctionVersionRequest
98
+ */
99
+ idleTimeout?: number;
100
+ /**
101
+ *
102
+ * @type {number}
103
+ * @memberof CreateFunctionVersionRequest
104
+ */
105
+ maxConcurrency?: number;
106
+ }
107
+
108
+ /**
109
+ * Check if a given object implements the CreateFunctionVersionRequest interface.
110
+ */
111
+ export function instanceOfCreateFunctionVersionRequest(value: object): value is CreateFunctionVersionRequest {
112
+ if ((!('contentHash' in (value as Record<string, any>)) && !('content_hash' in (value as Record<string, any>))) || ((value as Record<string, any>)['contentHash'] === undefined && (value as Record<string, any>)['content_hash'] === undefined)) return false;
113
+ if ((!('bundleSha256' in (value as Record<string, any>)) && !('bundle_sha256' in (value as Record<string, any>))) || ((value as Record<string, any>)['bundleSha256'] === undefined && (value as Record<string, any>)['bundle_sha256'] === undefined)) return false;
114
+ if ((!('bundleBytes' in (value as Record<string, any>)) && !('bundle_bytes' in (value as Record<string, any>))) || ((value as Record<string, any>)['bundleBytes'] === undefined && (value as Record<string, any>)['bundle_bytes'] === undefined)) return false;
115
+ if ((!('pythonVersion' in (value as Record<string, any>)) && !('python_version' in (value as Record<string, any>))) || ((value as Record<string, any>)['pythonVersion'] === undefined && (value as Record<string, any>)['python_version'] === undefined)) return false;
116
+ if ((!('cloudpickleVersion' in (value as Record<string, any>)) && !('cloudpickle_version' in (value as Record<string, any>))) || ((value as Record<string, any>)['cloudpickleVersion'] === undefined && (value as Record<string, any>)['cloudpickle_version'] === undefined)) return false;
117
+ if (!('timeout' in value) || value['timeout'] === undefined) return false;
118
+ return true;
119
+ }
120
+
121
+ export function CreateFunctionVersionRequestFromJSON(json: any): CreateFunctionVersionRequest {
122
+ return CreateFunctionVersionRequestFromJSONTyped(json, false);
123
+ }
124
+
125
+ export function CreateFunctionVersionRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateFunctionVersionRequest {
126
+ if (json == null) {
127
+ return json;
128
+ }
129
+ return {
130
+
131
+ 'contentHash': json['content_hash'],
132
+ 'bundleSha256': json['bundle_sha256'],
133
+ 'bundleBytes': json['bundle_bytes'],
134
+ 'pythonVersion': json['python_version'],
135
+ 'cloudpickleVersion': json['cloudpickle_version'],
136
+ 'pip': json['pip'] == null ? undefined : json['pip'],
137
+ 'gpu': json['gpu'] == null ? undefined : json['gpu'],
138
+ 'gpuCount': json['gpu_count'] == null ? undefined : json['gpu_count'],
139
+ 'minVramGb': json['min_vram_gb'] == null ? undefined : json['min_vram_gb'],
140
+ 'regions': json['regions'] == null ? undefined : json['regions'],
141
+ 'maxPricePerHour': json['max_price_per_hour'] == null ? undefined : json['max_price_per_hour'],
142
+ 'timeout': json['timeout'],
143
+ 'idleTimeout': json['idle_timeout'] == null ? undefined : json['idle_timeout'],
144
+ 'maxConcurrency': json['max_concurrency'] == null ? undefined : json['max_concurrency'],
145
+ };
146
+ }
147
+
148
+ export function CreateFunctionVersionRequestToJSON(json: any): CreateFunctionVersionRequest {
149
+ return CreateFunctionVersionRequestToJSONTyped(json, false);
150
+ }
151
+
152
+ export function CreateFunctionVersionRequestToJSONTyped(value?: CreateFunctionVersionRequest | null, ignoreDiscriminator: boolean = false): any {
153
+ if (value == null) {
154
+ return value;
155
+ }
156
+
157
+ return {
158
+
159
+ 'content_hash': value['contentHash'],
160
+ 'bundle_sha256': value['bundleSha256'],
161
+ 'bundle_bytes': value['bundleBytes'],
162
+ 'python_version': value['pythonVersion'],
163
+ 'cloudpickle_version': value['cloudpickleVersion'],
164
+ 'pip': value['pip'],
165
+ 'gpu': value['gpu'],
166
+ 'gpu_count': value['gpuCount'],
167
+ 'min_vram_gb': value['minVramGb'],
168
+ 'regions': value['regions'],
169
+ 'max_price_per_hour': value['maxPricePerHour'],
170
+ 'timeout': value['timeout'],
171
+ 'idle_timeout': value['idleTimeout'],
172
+ 'max_concurrency': value['maxConcurrency'],
173
+ };
174
+ }
175
+