-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathschemas.ts
160 lines (149 loc) · 4.52 KB
/
schemas.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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
import { schemasDeleteSchema } from "../funcs/schemasDeleteSchema.js";
import {
DownloadSchemaAcceptEnum,
schemasDownloadSchema,
} from "../funcs/schemasDownloadSchema.js";
import {
DownloadSchemaRevisionAcceptEnum,
schemasDownloadSchemaRevision,
} from "../funcs/schemasDownloadSchemaRevision.js";
import { schemasGetSchema } from "../funcs/schemasGetSchema.js";
import { schemasGetSchemaDiff } from "../funcs/schemasGetSchemaDiff.js";
import { schemasGetSchemaRevision } from "../funcs/schemasGetSchemaRevision.js";
import { schemasGetSchemas } from "../funcs/schemasGetSchemas.js";
import { schemasRegisterSchema } from "../funcs/schemasRegisterSchema.js";
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
import * as operations from "./models/operations/index.js";
import * as shared from "./models/shared/index.js";
import { unwrapAsync } from "./types/fp.js";
export { DownloadSchemaAcceptEnum } from "../funcs/schemasDownloadSchema.js";
export { DownloadSchemaRevisionAcceptEnum } from "../funcs/schemasDownloadSchemaRevision.js";
export class Schemas extends ClientSDK {
/**
* Delete a particular schema revision for an Api.
*/
async deleteSchema(
request: operations.DeleteSchemaRequest,
options?: RequestOptions,
): Promise<shared.ErrorT | undefined> {
return unwrapAsync(schemasDeleteSchema(
this,
request,
options,
));
}
/**
* Download the latest schema for a particular apiID.
*/
async downloadSchema(
request: operations.DownloadSchemaRequest,
options?: RequestOptions & {
acceptHeaderOverride?: DownloadSchemaAcceptEnum;
},
): Promise<operations.DownloadSchemaResponse> {
return unwrapAsync(schemasDownloadSchema(
this,
request,
options,
));
}
/**
* Download a particular schema revision for an Api.
*/
async downloadSchemaRevision(
request: operations.DownloadSchemaRevisionRequest,
options?: RequestOptions & {
acceptHeaderOverride?: DownloadSchemaRevisionAcceptEnum;
},
): Promise<operations.DownloadSchemaRevisionResponse> {
return unwrapAsync(schemasDownloadSchemaRevision(
this,
request,
options,
));
}
/**
* Get information about the latest schema.
*
* @remarks
* Returns information about the last uploaded schema for a particular API version.
* This won't include the schema itself, that can be retrieved via the downloadSchema operation.
*/
async getSchema(
request: operations.GetSchemaRequest,
options?: RequestOptions,
): Promise<operations.GetSchemaResponse> {
return unwrapAsync(schemasGetSchema(
this,
request,
options,
));
}
/**
* Get a diff of two schema revisions for an Api.
*/
async getSchemaDiff(
request: operations.GetSchemaDiffRequest,
options?: RequestOptions,
): Promise<operations.GetSchemaDiffResponse> {
return unwrapAsync(schemasGetSchemaDiff(
this,
request,
options,
));
}
/**
* Get information about a particular schema revision for an Api.
*
* @remarks
* Returns information about the last uploaded schema for a particular schema revision.
* This won't include the schema itself, that can be retrieved via the downloadSchema operation.
*/
async getSchemaRevision(
request: operations.GetSchemaRevisionRequest,
options?: RequestOptions,
): Promise<operations.GetSchemaRevisionResponse> {
return unwrapAsync(schemasGetSchemaRevision(
this,
request,
options,
));
}
/**
* Get information about all schemas associated with a particular apiID.
*
* @remarks
* Returns information the schemas associated with a particular apiID.
* This won't include the schemas themselves, they can be retrieved via the downloadSchema operation.
*/
async getSchemas(
request: operations.GetSchemasRequest,
options?: RequestOptions,
): Promise<operations.GetSchemasResponse> {
return unwrapAsync(schemasGetSchemas(
this,
request,
options,
));
}
/**
* Register a schema.
*
* @remarks
* Allows uploading a schema for a particular API version.
* This will be used to populate ApiEndpoints and used as a base for any schema generation if present.
*/
async registerSchema(
request: operations.RegisterSchemaRequest,
options?: RequestOptions,
): Promise<shared.ErrorT | undefined> {
return unwrapAsync(schemasRegisterSchema(
this,
request,
options,
));
}
}