-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmodels.ts
110 lines (92 loc) · 2.71 KB
/
models.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from '../resource';
import { isRequestOptions } from '../core';
import * as Core from '../core';
export class Models extends APIResource {
/**
* Get Model
*/
retrieve(
modelId: string,
params?: ModelRetrieveParams,
options?: Core.RequestOptions,
): Core.APIPromise<ModelRetrieveResponse>;
retrieve(modelId: string, options?: Core.RequestOptions): Core.APIPromise<ModelRetrieveResponse>;
retrieve(
modelId: string,
params: ModelRetrieveParams | Core.RequestOptions = {},
options?: Core.RequestOptions,
): Core.APIPromise<ModelRetrieveResponse> {
if (isRequestOptions(params)) {
return this.retrieve(modelId, {}, params);
}
const { 'CF-RAY': cfRay, 'X-Amz-Cf-Id': xAmzCfId } = params;
return this._client.get(`/v1/models/${modelId}`, {
...options,
headers: {
...(cfRay != null ? { 'CF-RAY': cfRay } : undefined),
...(xAmzCfId != null ? { 'X-Amz-Cf-Id': xAmzCfId } : undefined),
...options?.headers,
},
});
}
/**
* List Models
*/
list(params?: ModelListParams, options?: Core.RequestOptions): Core.APIPromise<ModelListResponse>;
list(options?: Core.RequestOptions): Core.APIPromise<ModelListResponse>;
list(
params: ModelListParams | Core.RequestOptions = {},
options?: Core.RequestOptions,
): Core.APIPromise<ModelListResponse> {
if (isRequestOptions(params)) {
return this.list({}, params);
}
const { 'CF-RAY': cfRay, 'X-Amz-Cf-Id': xAmzCfId } = params;
return this._client.get('/v1/models', {
...options,
headers: {
...(cfRay != null ? { 'CF-RAY': cfRay } : undefined),
...(xAmzCfId != null ? { 'X-Amz-Cf-Id': xAmzCfId } : undefined),
...options?.headers,
},
});
}
}
export interface ModelRetrieveResponse {
id: string;
created?: number;
object?: 'model';
owned_by?: string;
[k: string]: unknown;
}
export interface ModelListResponse {
data: Array<ModelListResponse.Data>;
object?: 'list';
[k: string]: unknown;
}
export namespace ModelListResponse {
export interface Data {
id: string;
created?: number;
object?: 'model';
owned_by?: string;
[k: string]: unknown;
}
}
export interface ModelRetrieveParams {
'CF-RAY'?: string;
'X-Amz-Cf-Id'?: string;
}
export interface ModelListParams {
'CF-RAY'?: string;
'X-Amz-Cf-Id'?: string;
}
export declare namespace Models {
export {
type ModelRetrieveResponse as ModelRetrieveResponse,
type ModelListResponse as ModelListResponse,
type ModelRetrieveParams as ModelRetrieveParams,
type ModelListParams as ModelListParams,
};
}