@gpuai/sdk 0.3.13 → 0.3.14
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 +26 -0
- package/README.md +32 -9
- package/dist/apis/AutolaunchApi.d.ts +109 -0
- package/dist/apis/AutolaunchApi.js +286 -0
- package/dist/apis/MarketApi.d.ts +56 -0
- package/dist/apis/MarketApi.js +112 -0
- package/dist/apis/WatchApi.d.ts +109 -0
- package/dist/apis/WatchApi.js +286 -0
- package/dist/apis/index.d.ts +3 -0
- package/dist/apis/index.js +3 -0
- package/dist/esm/apis/AutolaunchApi.d.ts +109 -0
- package/dist/esm/apis/AutolaunchApi.js +282 -0
- package/dist/esm/apis/MarketApi.d.ts +56 -0
- package/dist/esm/apis/MarketApi.js +108 -0
- package/dist/esm/apis/WatchApi.d.ts +109 -0
- package/dist/esm/apis/WatchApi.js +282 -0
- package/dist/esm/apis/index.d.ts +3 -0
- package/dist/esm/apis/index.js +3 -0
- package/dist/esm/models/AutolaunchRule.d.ts +181 -0
- package/dist/esm/models/AutolaunchRule.js +142 -0
- package/dist/esm/models/AutolaunchRuleCreate.d.ts +105 -0
- package/dist/esm/models/AutolaunchRuleCreate.js +84 -0
- package/dist/esm/models/AutolaunchRuleDisarm.d.ts +34 -0
- package/dist/esm/models/AutolaunchRuleDisarm.js +43 -0
- package/dist/esm/models/AutolaunchRulePage.d.ts +39 -0
- package/dist/esm/models/AutolaunchRulePage.js +48 -0
- package/dist/esm/models/MarketHistoryPoint.d.ts +59 -0
- package/dist/esm/models/MarketHistoryPoint.js +55 -0
- package/dist/esm/models/MarketHistoryResponse.d.ts +60 -0
- package/dist/esm/models/MarketHistoryResponse.js +60 -0
- package/dist/esm/models/Problem.d.ts +1 -0
- package/dist/esm/models/Problem.js +1 -0
- package/dist/esm/models/WatchRule.d.ts +141 -0
- package/dist/esm/models/WatchRule.js +117 -0
- package/dist/esm/models/WatchRuleCreate.d.ts +87 -0
- package/dist/esm/models/WatchRuleCreate.js +72 -0
- package/dist/esm/models/WatchRulePage.d.ts +39 -0
- package/dist/esm/models/WatchRulePage.js +48 -0
- package/dist/esm/models/WatchRuleUpdate.d.ts +86 -0
- package/dist/esm/models/WatchRuleUpdate.js +68 -0
- package/dist/esm/models/index.d.ts +10 -0
- package/dist/esm/models/index.js +10 -0
- package/dist/models/AutolaunchRule.d.ts +181 -0
- package/dist/models/AutolaunchRule.js +150 -0
- package/dist/models/AutolaunchRuleCreate.d.ts +105 -0
- package/dist/models/AutolaunchRuleCreate.js +92 -0
- package/dist/models/AutolaunchRuleDisarm.d.ts +34 -0
- package/dist/models/AutolaunchRuleDisarm.js +50 -0
- package/dist/models/AutolaunchRulePage.d.ts +39 -0
- package/dist/models/AutolaunchRulePage.js +55 -0
- package/dist/models/MarketHistoryPoint.d.ts +59 -0
- package/dist/models/MarketHistoryPoint.js +62 -0
- package/dist/models/MarketHistoryResponse.d.ts +60 -0
- package/dist/models/MarketHistoryResponse.js +67 -0
- package/dist/models/Problem.d.ts +1 -0
- package/dist/models/Problem.js +1 -0
- package/dist/models/WatchRule.d.ts +141 -0
- package/dist/models/WatchRule.js +125 -0
- package/dist/models/WatchRuleCreate.d.ts +87 -0
- package/dist/models/WatchRuleCreate.js +80 -0
- package/dist/models/WatchRulePage.d.ts +39 -0
- package/dist/models/WatchRulePage.js +55 -0
- package/dist/models/WatchRuleUpdate.d.ts +86 -0
- package/dist/models/WatchRuleUpdate.js +76 -0
- package/dist/models/index.d.ts +10 -0
- package/dist/models/index.js +10 -0
- package/docs/AutolaunchApi.md +390 -0
- package/docs/AutolaunchRule.md +69 -0
- package/docs/AutolaunchRuleCreate.md +50 -0
- package/docs/AutolaunchRuleDisarm.md +35 -0
- package/docs/AutolaunchRulePage.md +36 -0
- package/docs/MarketApi.md +98 -0
- package/docs/MarketHistoryPoint.md +43 -0
- package/docs/MarketHistoryResponse.md +43 -0
- package/docs/WatchApi.md +389 -0
- package/docs/WatchRule.md +61 -0
- package/docs/WatchRuleCreate.md +46 -0
- package/docs/WatchRulePage.md +36 -0
- package/docs/WatchRuleUpdate.md +47 -0
- package/package.json +1 -1
- package/src/apis/AutolaunchApi.ts +360 -0
- package/src/apis/MarketApi.ts +136 -0
- package/src/apis/WatchApi.ts +360 -0
- package/src/apis/index.ts +3 -0
- package/src/models/AutolaunchRule.ts +270 -0
- package/src/models/AutolaunchRuleCreate.ts +162 -0
- package/src/models/AutolaunchRuleDisarm.ts +68 -0
- package/src/models/AutolaunchRulePage.ts +83 -0
- package/src/models/MarketHistoryPoint.ts +103 -0
- package/src/models/MarketHistoryResponse.ts +113 -0
- package/src/models/Problem.ts +1 -0
- package/src/models/WatchRule.ts +219 -0
- package/src/models/WatchRuleCreate.ts +138 -0
- package/src/models/WatchRulePage.ts +83 -0
- package/src/models/WatchRuleUpdate.ts +135 -0
- package/src/models/index.ts +10 -0
|
@@ -0,0 +1,162 @@
|
|
|
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 AutolaunchRuleCreate
|
|
20
|
+
*/
|
|
21
|
+
export interface AutolaunchRuleCreate {
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @type {string}
|
|
25
|
+
* @memberof AutolaunchRuleCreate
|
|
26
|
+
*/
|
|
27
|
+
gpuModel: string;
|
|
28
|
+
/**
|
|
29
|
+
* Omit or send null to consider every region.
|
|
30
|
+
* @type {string}
|
|
31
|
+
* @memberof AutolaunchRuleCreate
|
|
32
|
+
*/
|
|
33
|
+
region?: string | null;
|
|
34
|
+
/**
|
|
35
|
+
* Omit or send null to consider both capacity classes.
|
|
36
|
+
* @type {AutolaunchRuleCreateCapacityClassEnum}
|
|
37
|
+
* @memberof AutolaunchRuleCreate
|
|
38
|
+
*/
|
|
39
|
+
capacityClass?: AutolaunchRuleCreateCapacityClassEnum | null;
|
|
40
|
+
/**
|
|
41
|
+
*
|
|
42
|
+
* @type {AutolaunchRuleCreateConditionKindEnum}
|
|
43
|
+
* @memberof AutolaunchRuleCreate
|
|
44
|
+
*/
|
|
45
|
+
conditionKind: AutolaunchRuleCreateConditionKindEnum;
|
|
46
|
+
/**
|
|
47
|
+
* The TRIGGER, in dollars PER GPU-HOUR for price_under or a unit count for count_at_least. Required and greater than zero for both. Ignored for in_stock. Not the spend cap. Values above the maximum are refused with a 422 naming the bound — it is the largest value the column stores.
|
|
48
|
+
*
|
|
49
|
+
* @type {number}
|
|
50
|
+
* @memberof AutolaunchRuleCreate
|
|
51
|
+
*/
|
|
52
|
+
threshold?: number | null;
|
|
53
|
+
/**
|
|
54
|
+
* The CEILING, in dollars per hour for the WHOLE INSTANCE. Required even for in_stock rules: "buy it when it comes back" with no ceiling is an unbounded authorization, and this resource has no such shape. Values above the maximum are refused with a 422 naming the bound.
|
|
55
|
+
*
|
|
56
|
+
* @type {number}
|
|
57
|
+
* @memberof AutolaunchRuleCreate
|
|
58
|
+
*/
|
|
59
|
+
maxPricePerHour: number;
|
|
60
|
+
/**
|
|
61
|
+
*
|
|
62
|
+
* @type {number}
|
|
63
|
+
* @memberof AutolaunchRuleCreate
|
|
64
|
+
*/
|
|
65
|
+
maxRuntimeHours: number;
|
|
66
|
+
/**
|
|
67
|
+
* The full create-instance body this rule freezes and replays — the same shape POST /v1/instances accepts. It is modelled as an open object rather than a $ref because the instance-create body is an inline requestBody schema rather than a named component; promoting it would rewrite the instances operation and every generated client's signature for it, in a change that only needs to STORE one.
|
|
68
|
+
*
|
|
69
|
+
* Two fields behave differently here than on a live create: `offering_id` is REJECTED (a pinned offering produces a rule that can never fire, because offering identity churns between catalog polls), and `auto_terminate_hours` is OVERWRITTEN from the rule's `max_runtime_hours` so a nested field cannot widen the runtime bound the customer approved.
|
|
70
|
+
*
|
|
71
|
+
* @type {{ [key: string]: any; }}
|
|
72
|
+
* @memberof AutolaunchRuleCreate
|
|
73
|
+
*/
|
|
74
|
+
spec: { [key: string]: any; };
|
|
75
|
+
/**
|
|
76
|
+
* REQUIRED. Echo of the worst-case total, max_price_per_hour × max_runtime_hours, accepted within one cent. This is the consent gate: a caller that never computed this number cannot have shown it to the person approving the rule, and a caller that displayed a different number disagrees with what is about to be stored. Either way the request is refused so the caller can re-render the real figure.
|
|
77
|
+
*
|
|
78
|
+
* @type {number}
|
|
79
|
+
* @memberof AutolaunchRuleCreate
|
|
80
|
+
*/
|
|
81
|
+
acknowledgedMaxTotalUsd: number;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* @export
|
|
87
|
+
*/
|
|
88
|
+
export const AutolaunchRuleCreateCapacityClassEnum = {
|
|
89
|
+
Secure: 'secure',
|
|
90
|
+
Community: 'community'
|
|
91
|
+
} as const;
|
|
92
|
+
export type AutolaunchRuleCreateCapacityClassEnum = typeof AutolaunchRuleCreateCapacityClassEnum[keyof typeof AutolaunchRuleCreateCapacityClassEnum];
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* @export
|
|
96
|
+
*/
|
|
97
|
+
export const AutolaunchRuleCreateConditionKindEnum = {
|
|
98
|
+
PriceUnder: 'price_under',
|
|
99
|
+
InStock: 'in_stock',
|
|
100
|
+
CountAtLeast: 'count_at_least'
|
|
101
|
+
} as const;
|
|
102
|
+
export type AutolaunchRuleCreateConditionKindEnum = typeof AutolaunchRuleCreateConditionKindEnum[keyof typeof AutolaunchRuleCreateConditionKindEnum];
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Check if a given object implements the AutolaunchRuleCreate interface.
|
|
107
|
+
*/
|
|
108
|
+
export function instanceOfAutolaunchRuleCreate(value: object): value is AutolaunchRuleCreate {
|
|
109
|
+
if ((!('gpuModel' in (value as Record<string, any>)) && !('gpu_model' in (value as Record<string, any>))) || ((value as Record<string, any>)['gpuModel'] === undefined && (value as Record<string, any>)['gpu_model'] === undefined)) return false;
|
|
110
|
+
if ((!('conditionKind' in (value as Record<string, any>)) && !('condition_kind' in (value as Record<string, any>))) || ((value as Record<string, any>)['conditionKind'] === undefined && (value as Record<string, any>)['condition_kind'] === undefined)) return false;
|
|
111
|
+
if ((!('maxPricePerHour' in (value as Record<string, any>)) && !('max_price_per_hour' in (value as Record<string, any>))) || ((value as Record<string, any>)['maxPricePerHour'] === undefined && (value as Record<string, any>)['max_price_per_hour'] === undefined)) return false;
|
|
112
|
+
if ((!('maxRuntimeHours' in (value as Record<string, any>)) && !('max_runtime_hours' in (value as Record<string, any>))) || ((value as Record<string, any>)['maxRuntimeHours'] === undefined && (value as Record<string, any>)['max_runtime_hours'] === undefined)) return false;
|
|
113
|
+
if (!('spec' in value) || value['spec'] === undefined) return false;
|
|
114
|
+
if ((!('acknowledgedMaxTotalUsd' in (value as Record<string, any>)) && !('acknowledged_max_total_usd' in (value as Record<string, any>))) || ((value as Record<string, any>)['acknowledgedMaxTotalUsd'] === undefined && (value as Record<string, any>)['acknowledged_max_total_usd'] === undefined)) return false;
|
|
115
|
+
return true;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export function AutolaunchRuleCreateFromJSON(json: any): AutolaunchRuleCreate {
|
|
119
|
+
return AutolaunchRuleCreateFromJSONTyped(json, false);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export function AutolaunchRuleCreateFromJSONTyped(json: any, ignoreDiscriminator: boolean): AutolaunchRuleCreate {
|
|
123
|
+
if (json == null) {
|
|
124
|
+
return json;
|
|
125
|
+
}
|
|
126
|
+
return {
|
|
127
|
+
|
|
128
|
+
'gpuModel': json['gpu_model'],
|
|
129
|
+
'region': json['region'] === undefined ? undefined : json['region'] === null ? null : json['region'],
|
|
130
|
+
'capacityClass': json['capacity_class'] === undefined ? undefined : json['capacity_class'] === null ? null : json['capacity_class'],
|
|
131
|
+
'conditionKind': json['condition_kind'],
|
|
132
|
+
'threshold': json['threshold'] === undefined ? undefined : json['threshold'] === null ? null : json['threshold'],
|
|
133
|
+
'maxPricePerHour': json['max_price_per_hour'],
|
|
134
|
+
'maxRuntimeHours': json['max_runtime_hours'],
|
|
135
|
+
'spec': json['spec'],
|
|
136
|
+
'acknowledgedMaxTotalUsd': json['acknowledged_max_total_usd'],
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export function AutolaunchRuleCreateToJSON(json: any): AutolaunchRuleCreate {
|
|
141
|
+
return AutolaunchRuleCreateToJSONTyped(json, false);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export function AutolaunchRuleCreateToJSONTyped(value?: AutolaunchRuleCreate | null, ignoreDiscriminator: boolean = false): any {
|
|
145
|
+
if (value == null) {
|
|
146
|
+
return value;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
return {
|
|
150
|
+
|
|
151
|
+
'gpu_model': value['gpuModel'],
|
|
152
|
+
'region': value['region'],
|
|
153
|
+
'capacity_class': value['capacityClass'],
|
|
154
|
+
'condition_kind': value['conditionKind'],
|
|
155
|
+
'threshold': value['threshold'],
|
|
156
|
+
'max_price_per_hour': value['maxPricePerHour'],
|
|
157
|
+
'max_runtime_hours': value['maxRuntimeHours'],
|
|
158
|
+
'spec': value['spec'],
|
|
159
|
+
'acknowledged_max_total_usd': value['acknowledgedMaxTotalUsd'],
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
|
|
@@ -0,0 +1,68 @@
|
|
|
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
|
+
* The entire PATCH surface. `enabled` must be present and must be false. Any other key is refused rather than accepted-and-ignored, because a PATCH carrying a new ceiling that returned 200 would leave the caller believing the cap had moved.
|
|
18
|
+
*
|
|
19
|
+
* @export
|
|
20
|
+
* @interface AutolaunchRuleDisarm
|
|
21
|
+
*/
|
|
22
|
+
export interface AutolaunchRuleDisarm {
|
|
23
|
+
/**
|
|
24
|
+
* Must be false. Sending true is refused: a fired rule consumed its one shot, so "resume" would silently be an authorization nobody gave, and arming again is a create.
|
|
25
|
+
*
|
|
26
|
+
* @type {boolean}
|
|
27
|
+
* @memberof AutolaunchRuleDisarm
|
|
28
|
+
*/
|
|
29
|
+
enabled: boolean;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Check if a given object implements the AutolaunchRuleDisarm interface.
|
|
34
|
+
*/
|
|
35
|
+
export function instanceOfAutolaunchRuleDisarm(value: object): value is AutolaunchRuleDisarm {
|
|
36
|
+
if (!('enabled' in value) || value['enabled'] === undefined) return false;
|
|
37
|
+
return true;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function AutolaunchRuleDisarmFromJSON(json: any): AutolaunchRuleDisarm {
|
|
41
|
+
return AutolaunchRuleDisarmFromJSONTyped(json, false);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export function AutolaunchRuleDisarmFromJSONTyped(json: any, ignoreDiscriminator: boolean): AutolaunchRuleDisarm {
|
|
45
|
+
if (json == null) {
|
|
46
|
+
return json;
|
|
47
|
+
}
|
|
48
|
+
return {
|
|
49
|
+
|
|
50
|
+
'enabled': json['enabled'],
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export function AutolaunchRuleDisarmToJSON(json: any): AutolaunchRuleDisarm {
|
|
55
|
+
return AutolaunchRuleDisarmToJSONTyped(json, false);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function AutolaunchRuleDisarmToJSONTyped(value?: AutolaunchRuleDisarm | null, ignoreDiscriminator: boolean = false): any {
|
|
59
|
+
if (value == null) {
|
|
60
|
+
return value;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return {
|
|
64
|
+
|
|
65
|
+
'enabled': value['enabled'],
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
|
|
@@ -0,0 +1,83 @@
|
|
|
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
|
+
import type { AutolaunchRule } from './AutolaunchRule';
|
|
17
|
+
import {
|
|
18
|
+
AutolaunchRuleFromJSON,
|
|
19
|
+
AutolaunchRuleFromJSONTyped,
|
|
20
|
+
AutolaunchRuleToJSON,
|
|
21
|
+
AutolaunchRuleToJSONTyped,
|
|
22
|
+
} from './AutolaunchRule';
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* @export
|
|
27
|
+
* @interface AutolaunchRulePage
|
|
28
|
+
*/
|
|
29
|
+
export interface AutolaunchRulePage {
|
|
30
|
+
/**
|
|
31
|
+
*
|
|
32
|
+
* @type {Array<AutolaunchRule>}
|
|
33
|
+
* @memberof AutolaunchRulePage
|
|
34
|
+
*/
|
|
35
|
+
data: Array<AutolaunchRule>;
|
|
36
|
+
/**
|
|
37
|
+
*
|
|
38
|
+
* @type {string}
|
|
39
|
+
* @memberof AutolaunchRulePage
|
|
40
|
+
*/
|
|
41
|
+
nextCursor: string | null;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Check if a given object implements the AutolaunchRulePage interface.
|
|
46
|
+
*/
|
|
47
|
+
export function instanceOfAutolaunchRulePage(value: object): value is AutolaunchRulePage {
|
|
48
|
+
if (!('data' in value) || value['data'] === undefined) return false;
|
|
49
|
+
if ((!('nextCursor' in (value as Record<string, any>)) && !('next_cursor' in (value as Record<string, any>))) || ((value as Record<string, any>)['nextCursor'] === undefined && (value as Record<string, any>)['next_cursor'] === undefined)) return false;
|
|
50
|
+
return true;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export function AutolaunchRulePageFromJSON(json: any): AutolaunchRulePage {
|
|
54
|
+
return AutolaunchRulePageFromJSONTyped(json, false);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export function AutolaunchRulePageFromJSONTyped(json: any, ignoreDiscriminator: boolean): AutolaunchRulePage {
|
|
58
|
+
if (json == null) {
|
|
59
|
+
return json;
|
|
60
|
+
}
|
|
61
|
+
return {
|
|
62
|
+
|
|
63
|
+
'data': ((json['data'] as Array<any>).map(AutolaunchRuleFromJSON)),
|
|
64
|
+
'nextCursor': json['next_cursor'],
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export function AutolaunchRulePageToJSON(json: any): AutolaunchRulePage {
|
|
69
|
+
return AutolaunchRulePageToJSONTyped(json, false);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export function AutolaunchRulePageToJSONTyped(value?: AutolaunchRulePage | null, ignoreDiscriminator: boolean = false): any {
|
|
73
|
+
if (value == null) {
|
|
74
|
+
return value;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return {
|
|
78
|
+
|
|
79
|
+
'data': ((value['data'] as Array<any>).map(AutolaunchRuleToJSON)),
|
|
80
|
+
'next_cursor': value['nextCursor'],
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
|
|
@@ -0,0 +1,103 @@
|
|
|
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
|
+
* One bucket of a price/stock series.
|
|
18
|
+
*
|
|
19
|
+
* The nullability of `price_per_gpu_hour` and `available_count` is the contract, not a convenience: a real 0 is a bucket we sampled and found sold out, and null is a bucket we never successfully sampled. A client that coerces null to 0 will report GPU.ai's own polling outages as supplier stockouts, and must not interpolate across a null.
|
|
20
|
+
*
|
|
21
|
+
* @export
|
|
22
|
+
* @interface MarketHistoryPoint
|
|
23
|
+
*/
|
|
24
|
+
export interface MarketHistoryPoint {
|
|
25
|
+
/**
|
|
26
|
+
* Start of the bucket, UTC, aligned to the bucket width.
|
|
27
|
+
* @type {Date}
|
|
28
|
+
* @memberof MarketHistoryPoint
|
|
29
|
+
*/
|
|
30
|
+
bucketTs: Date;
|
|
31
|
+
/**
|
|
32
|
+
* GPU.ai's floor per-GPU hourly rate for this bucket, or null if we did not sample this bucket. Null is NOT zero.
|
|
33
|
+
* @type {number}
|
|
34
|
+
* @memberof MarketHistoryPoint
|
|
35
|
+
*/
|
|
36
|
+
pricePerGpuHour: number | null;
|
|
37
|
+
/**
|
|
38
|
+
* Obtainable units across every matching offer in this bucket. 0 means we sampled and the market was sold out; null means we did not sample this bucket.
|
|
39
|
+
* @type {number}
|
|
40
|
+
* @memberof MarketHistoryPoint
|
|
41
|
+
*/
|
|
42
|
+
availableCount: number | null;
|
|
43
|
+
/**
|
|
44
|
+
* Whole-node hourly price the per-GPU rate was divided out of. Present only when the bucket's floor came from a multi-GPU node; absent for single-GPU capacity.
|
|
45
|
+
* @type {number}
|
|
46
|
+
* @memberof MarketHistoryPoint
|
|
47
|
+
*/
|
|
48
|
+
nodePricePerHour?: number;
|
|
49
|
+
/**
|
|
50
|
+
* GPUs in that node. Present only alongside `node_price_per_hour`, and it is what lets a renderer qualify a derived rate as "(from an 8-GPU node)" rather than implying single-GPU rentability.
|
|
51
|
+
* @type {number}
|
|
52
|
+
* @memberof MarketHistoryPoint
|
|
53
|
+
*/
|
|
54
|
+
gpuCount?: number;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Check if a given object implements the MarketHistoryPoint interface.
|
|
59
|
+
*/
|
|
60
|
+
export function instanceOfMarketHistoryPoint(value: object): value is MarketHistoryPoint {
|
|
61
|
+
if ((!('bucketTs' in (value as Record<string, any>)) && !('bucket_ts' in (value as Record<string, any>))) || ((value as Record<string, any>)['bucketTs'] === undefined && (value as Record<string, any>)['bucket_ts'] === undefined)) return false;
|
|
62
|
+
if ((!('pricePerGpuHour' in (value as Record<string, any>)) && !('price_per_gpu_hour' in (value as Record<string, any>))) || ((value as Record<string, any>)['pricePerGpuHour'] === undefined && (value as Record<string, any>)['price_per_gpu_hour'] === undefined)) return false;
|
|
63
|
+
if ((!('availableCount' in (value as Record<string, any>)) && !('available_count' in (value as Record<string, any>))) || ((value as Record<string, any>)['availableCount'] === undefined && (value as Record<string, any>)['available_count'] === undefined)) return false;
|
|
64
|
+
return true;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export function MarketHistoryPointFromJSON(json: any): MarketHistoryPoint {
|
|
68
|
+
return MarketHistoryPointFromJSONTyped(json, false);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function MarketHistoryPointFromJSONTyped(json: any, ignoreDiscriminator: boolean): MarketHistoryPoint {
|
|
72
|
+
if (json == null) {
|
|
73
|
+
return json;
|
|
74
|
+
}
|
|
75
|
+
return {
|
|
76
|
+
|
|
77
|
+
'bucketTs': (new Date(json['bucket_ts'])),
|
|
78
|
+
'pricePerGpuHour': json['price_per_gpu_hour'],
|
|
79
|
+
'availableCount': json['available_count'],
|
|
80
|
+
'nodePricePerHour': json['node_price_per_hour'] == null ? undefined : json['node_price_per_hour'],
|
|
81
|
+
'gpuCount': json['gpu_count'] == null ? undefined : json['gpu_count'],
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export function MarketHistoryPointToJSON(json: any): MarketHistoryPoint {
|
|
86
|
+
return MarketHistoryPointToJSONTyped(json, false);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export function MarketHistoryPointToJSONTyped(value?: MarketHistoryPoint | null, ignoreDiscriminator: boolean = false): any {
|
|
90
|
+
if (value == null) {
|
|
91
|
+
return value;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
return {
|
|
95
|
+
|
|
96
|
+
'bucket_ts': value['bucketTs'].toISOString(),
|
|
97
|
+
'price_per_gpu_hour': value['pricePerGpuHour'],
|
|
98
|
+
'available_count': value['availableCount'],
|
|
99
|
+
'node_price_per_hour': value['nodePricePerHour'],
|
|
100
|
+
'gpu_count': value['gpuCount'],
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
|
|
@@ -0,0 +1,113 @@
|
|
|
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
|
+
import type { MarketHistoryPoint } from './MarketHistoryPoint';
|
|
17
|
+
import {
|
|
18
|
+
MarketHistoryPointFromJSON,
|
|
19
|
+
MarketHistoryPointFromJSONTyped,
|
|
20
|
+
MarketHistoryPointToJSON,
|
|
21
|
+
MarketHistoryPointToJSONTyped,
|
|
22
|
+
} from './MarketHistoryPoint';
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* A price/stock series for one (gpu_model, region, capacity_class) key.
|
|
26
|
+
*
|
|
27
|
+
* Points cover the FULL bucket grid across the requested window, including the buckets we did not sample — a gap therefore has visible width rather than disappearing between two adjacent points.
|
|
28
|
+
*
|
|
29
|
+
* @export
|
|
30
|
+
* @interface MarketHistoryResponse
|
|
31
|
+
*/
|
|
32
|
+
export interface MarketHistoryResponse {
|
|
33
|
+
/**
|
|
34
|
+
*
|
|
35
|
+
* @type {string}
|
|
36
|
+
* @memberof MarketHistoryResponse
|
|
37
|
+
*/
|
|
38
|
+
gpuModel: string;
|
|
39
|
+
/**
|
|
40
|
+
* Echoes the request. Empty means the series is MERGED across every region, the same thing it meant on the way in.
|
|
41
|
+
* @type {string}
|
|
42
|
+
* @memberof MarketHistoryResponse
|
|
43
|
+
*/
|
|
44
|
+
region: string;
|
|
45
|
+
/**
|
|
46
|
+
* Echoes the request. Empty means the series is merged across both classes.
|
|
47
|
+
* @type {string}
|
|
48
|
+
* @memberof MarketHistoryResponse
|
|
49
|
+
*/
|
|
50
|
+
capacityClass: string;
|
|
51
|
+
/**
|
|
52
|
+
* Resolution the server actually answered at. Echoed because the wide views downsample at query time, so a client must never assume 900.
|
|
53
|
+
* @type {number}
|
|
54
|
+
* @memberof MarketHistoryResponse
|
|
55
|
+
*/
|
|
56
|
+
bucketSeconds: number;
|
|
57
|
+
/**
|
|
58
|
+
*
|
|
59
|
+
* @type {Array<MarketHistoryPoint>}
|
|
60
|
+
* @memberof MarketHistoryResponse
|
|
61
|
+
*/
|
|
62
|
+
points: Array<MarketHistoryPoint>;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Check if a given object implements the MarketHistoryResponse interface.
|
|
67
|
+
*/
|
|
68
|
+
export function instanceOfMarketHistoryResponse(value: object): value is MarketHistoryResponse {
|
|
69
|
+
if ((!('gpuModel' in (value as Record<string, any>)) && !('gpu_model' in (value as Record<string, any>))) || ((value as Record<string, any>)['gpuModel'] === undefined && (value as Record<string, any>)['gpu_model'] === undefined)) return false;
|
|
70
|
+
if (!('region' in value) || value['region'] === undefined) return false;
|
|
71
|
+
if ((!('capacityClass' in (value as Record<string, any>)) && !('capacity_class' in (value as Record<string, any>))) || ((value as Record<string, any>)['capacityClass'] === undefined && (value as Record<string, any>)['capacity_class'] === undefined)) return false;
|
|
72
|
+
if ((!('bucketSeconds' in (value as Record<string, any>)) && !('bucket_seconds' in (value as Record<string, any>))) || ((value as Record<string, any>)['bucketSeconds'] === undefined && (value as Record<string, any>)['bucket_seconds'] === undefined)) return false;
|
|
73
|
+
if (!('points' in value) || value['points'] === undefined) return false;
|
|
74
|
+
return true;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export function MarketHistoryResponseFromJSON(json: any): MarketHistoryResponse {
|
|
78
|
+
return MarketHistoryResponseFromJSONTyped(json, false);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export function MarketHistoryResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): MarketHistoryResponse {
|
|
82
|
+
if (json == null) {
|
|
83
|
+
return json;
|
|
84
|
+
}
|
|
85
|
+
return {
|
|
86
|
+
|
|
87
|
+
'gpuModel': json['gpu_model'],
|
|
88
|
+
'region': json['region'],
|
|
89
|
+
'capacityClass': json['capacity_class'],
|
|
90
|
+
'bucketSeconds': json['bucket_seconds'],
|
|
91
|
+
'points': ((json['points'] as Array<any>).map(MarketHistoryPointFromJSON)),
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export function MarketHistoryResponseToJSON(json: any): MarketHistoryResponse {
|
|
96
|
+
return MarketHistoryResponseToJSONTyped(json, false);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export function MarketHistoryResponseToJSONTyped(value?: MarketHistoryResponse | null, ignoreDiscriminator: boolean = false): any {
|
|
100
|
+
if (value == null) {
|
|
101
|
+
return value;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
return {
|
|
105
|
+
|
|
106
|
+
'gpu_model': value['gpuModel'],
|
|
107
|
+
'region': value['region'],
|
|
108
|
+
'capacity_class': value['capacityClass'],
|
|
109
|
+
'bucket_seconds': value['bucketSeconds'],
|
|
110
|
+
'points': ((value['points'] as Array<any>).map(MarketHistoryPointToJSON)),
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
|
package/src/models/Problem.ts
CHANGED
|
@@ -78,6 +78,7 @@ export const ProblemCodeEnum = {
|
|
|
78
78
|
InsufficientBalance: 'insufficient_balance',
|
|
79
79
|
QuotaExceeded: 'quota_exceeded',
|
|
80
80
|
RateLimited: 'rate_limited',
|
|
81
|
+
CreatorCheckUnavailable: 'creator_check_unavailable',
|
|
81
82
|
InternalError: 'internal_error',
|
|
82
83
|
OperationFailed: 'operation_failed'
|
|
83
84
|
} as const;
|