@@ -23,23 +23,20 @@ Delete an ApiEndpoint. This will also delete all associated Request Logs (if usi
23
23
24
24
``` typescript
25
25
import { Speakeasy } from " @speakeasy-api/speakeasy-client-sdk-typescript" ;
26
- import { DeleteApiEndpointRequest , DeleteApiEndpointResponse } from " @speakeasy-api/speakeasy-client-sdk-typescript/dist/sdk/models/operations" ;
27
- import { AxiosError } from " axios" ;
26
+ import { DeleteApiEndpointResponse } from " @speakeasy-api/speakeasy-client-sdk-typescript/dist/sdk/models/operations" ;
28
27
29
28
const sdk = new Speakeasy ({
30
29
security: {
31
30
apiKey: " YOUR_API_KEY_HERE" ,
32
31
},
33
32
});
34
33
35
- const req : DeleteApiEndpointRequest = {
34
+ sdk . apiEndpoints . deleteApiEndpoint ( {
36
35
apiEndpointID: " delectus" ,
37
36
apiID: " tempora" ,
38
37
versionID: " suscipit" ,
39
- };
40
-
41
- sdk .apiEndpoints .deleteApiEndpoint (req ).then ((res : DeleteApiEndpointResponse | AxiosError ) => {
42
- if (res instanceof UsageExamplePostResponse && res .statusCode == 200 ) {
38
+ }).then ((res : DeleteApiEndpointResponse ) => {
39
+ if (res .statusCode == 200 ) {
43
40
// handle response
44
41
}
45
42
});
@@ -54,23 +51,20 @@ This is useful for finding the ID of an ApiEndpoint to use in the /v1/apis/{apiI
54
51
55
52
``` typescript
56
53
import { Speakeasy } from " @speakeasy-api/speakeasy-client-sdk-typescript" ;
57
- import { FindApiEndpointRequest , FindApiEndpointResponse } from " @speakeasy-api/speakeasy-client-sdk-typescript/dist/sdk/models/operations" ;
58
- import { AxiosError } from " axios" ;
54
+ import { FindApiEndpointResponse } from " @speakeasy-api/speakeasy-client-sdk-typescript/dist/sdk/models/operations" ;
59
55
60
56
const sdk = new Speakeasy ({
61
57
security: {
62
58
apiKey: " YOUR_API_KEY_HERE" ,
63
59
},
64
60
});
65
61
66
- const req : FindApiEndpointRequest = {
62
+ sdk . apiEndpoints . findApiEndpoint ( {
67
63
apiID: " molestiae" ,
68
64
displayName: " minus" ,
69
65
versionID: " placeat" ,
70
- };
71
-
72
- sdk .apiEndpoints .findApiEndpoint (req ).then ((res : FindApiEndpointResponse | AxiosError ) => {
73
- if (res instanceof UsageExamplePostResponse && res .statusCode == 200 ) {
66
+ }).then ((res : FindApiEndpointResponse ) => {
67
+ if (res .statusCode == 200 ) {
74
68
// handle response
75
69
}
76
70
});
@@ -85,26 +79,20 @@ Returns the original document and the newly generated document allowing a diff t
85
79
86
80
``` typescript
87
81
import { Speakeasy } from " @speakeasy-api/speakeasy-client-sdk-typescript" ;
88
- import {
89
- GenerateOpenApiSpecForApiEndpointRequest ,
90
- GenerateOpenApiSpecForApiEndpointResponse ,
91
- } from " @speakeasy-api/speakeasy-client-sdk-typescript/dist/sdk/models/operations" ;
92
- import { AxiosError } from " axios" ;
82
+ import { GenerateOpenApiSpecForApiEndpointResponse } from " @speakeasy-api/speakeasy-client-sdk-typescript/dist/sdk/models/operations" ;
93
83
94
84
const sdk = new Speakeasy ({
95
85
security: {
96
86
apiKey: " YOUR_API_KEY_HERE" ,
97
87
},
98
88
});
99
89
100
- const req : GenerateOpenApiSpecForApiEndpointRequest = {
90
+ sdk . apiEndpoints . generateOpenApiSpecForApiEndpoint ( {
101
91
apiEndpointID: " voluptatum" ,
102
92
apiID: " iusto" ,
103
93
versionID: " excepturi" ,
104
- };
105
-
106
- sdk .apiEndpoints .generateOpenApiSpecForApiEndpoint (req ).then ((res : GenerateOpenApiSpecForApiEndpointResponse | AxiosError ) => {
107
- if (res instanceof UsageExamplePostResponse && res .statusCode == 200 ) {
94
+ }).then ((res : GenerateOpenApiSpecForApiEndpointResponse ) => {
95
+ if (res .statusCode == 200 ) {
108
96
// handle response
109
97
}
110
98
});
@@ -118,26 +106,20 @@ Generates a postman collection that allows the endpoint to be called from postma
118
106
119
107
``` typescript
120
108
import { Speakeasy } from " @speakeasy-api/speakeasy-client-sdk-typescript" ;
121
- import {
122
- GeneratePostmanCollectionForApiEndpointRequest ,
123
- GeneratePostmanCollectionForApiEndpointResponse ,
124
- } from " @speakeasy-api/speakeasy-client-sdk-typescript/dist/sdk/models/operations" ;
125
- import { AxiosError } from " axios" ;
109
+ import { GeneratePostmanCollectionForApiEndpointResponse } from " @speakeasy-api/speakeasy-client-sdk-typescript/dist/sdk/models/operations" ;
126
110
127
111
const sdk = new Speakeasy ({
128
112
security: {
129
113
apiKey: " YOUR_API_KEY_HERE" ,
130
114
},
131
115
});
132
116
133
- const req : GeneratePostmanCollectionForApiEndpointRequest = {
117
+ sdk . apiEndpoints . generatePostmanCollectionForApiEndpoint ( {
134
118
apiEndpointID: " nisi" ,
135
119
apiID: " recusandae" ,
136
120
versionID: " temporibus" ,
137
- };
138
-
139
- sdk .apiEndpoints .generatePostmanCollectionForApiEndpoint (req ).then ((res : GeneratePostmanCollectionForApiEndpointResponse | AxiosError ) => {
140
- if (res instanceof UsageExamplePostResponse && res .statusCode == 200 ) {
121
+ }).then ((res : GeneratePostmanCollectionForApiEndpointResponse ) => {
122
+ if (res .statusCode == 200 ) {
141
123
// handle response
142
124
}
143
125
});
@@ -151,21 +133,18 @@ Get all Api endpoints for a particular apiID.
151
133
152
134
``` typescript
153
135
import { Speakeasy } from " @speakeasy-api/speakeasy-client-sdk-typescript" ;
154
- import { GetAllApiEndpointsRequest , GetAllApiEndpointsResponse } from " @speakeasy-api/speakeasy-client-sdk-typescript/dist/sdk/models/operations" ;
155
- import { AxiosError } from " axios" ;
136
+ import { GetAllApiEndpointsResponse } from " @speakeasy-api/speakeasy-client-sdk-typescript/dist/sdk/models/operations" ;
156
137
157
138
const sdk = new Speakeasy ({
158
139
security: {
159
140
apiKey: " YOUR_API_KEY_HERE" ,
160
141
},
161
142
});
162
143
163
- const req : GetAllApiEndpointsRequest = {
144
+ sdk . apiEndpoints . getAllApiEndpoints ( {
164
145
apiID: " ab" ,
165
- };
166
-
167
- sdk .apiEndpoints .getAllApiEndpoints (req ).then ((res : GetAllApiEndpointsResponse | AxiosError ) => {
168
- if (res instanceof UsageExamplePostResponse && res .statusCode == 200 ) {
146
+ }).then ((res : GetAllApiEndpointsResponse ) => {
147
+ if (res .statusCode == 200 ) {
169
148
// handle response
170
149
}
171
150
});
@@ -179,22 +158,19 @@ Get all ApiEndpoints for a particular apiID and versionID.
179
158
180
159
``` typescript
181
160
import { Speakeasy } from " @speakeasy-api/speakeasy-client-sdk-typescript" ;
182
- import { GetAllForVersionApiEndpointsRequest , GetAllForVersionApiEndpointsResponse } from " @speakeasy-api/speakeasy-client-sdk-typescript/dist/sdk/models/operations" ;
183
- import { AxiosError } from " axios" ;
161
+ import { GetAllForVersionApiEndpointsResponse } from " @speakeasy-api/speakeasy-client-sdk-typescript/dist/sdk/models/operations" ;
184
162
185
163
const sdk = new Speakeasy ({
186
164
security: {
187
165
apiKey: " YOUR_API_KEY_HERE" ,
188
166
},
189
167
});
190
168
191
- const req : GetAllForVersionApiEndpointsRequest = {
169
+ sdk . apiEndpoints . getAllForVersionApiEndpoints ( {
192
170
apiID: " quis" ,
193
171
versionID: " veritatis" ,
194
- };
195
-
196
- sdk .apiEndpoints .getAllForVersionApiEndpoints (req ).then ((res : GetAllForVersionApiEndpointsResponse | AxiosError ) => {
197
- if (res instanceof UsageExamplePostResponse && res .statusCode == 200 ) {
172
+ }).then ((res : GetAllForVersionApiEndpointsResponse ) => {
173
+ if (res .statusCode == 200 ) {
198
174
// handle response
199
175
}
200
176
});
@@ -208,23 +184,20 @@ Get an ApiEndpoint.
208
184
209
185
``` typescript
210
186
import { Speakeasy } from " @speakeasy-api/speakeasy-client-sdk-typescript" ;
211
- import { GetApiEndpointRequest , GetApiEndpointResponse } from " @speakeasy-api/speakeasy-client-sdk-typescript/dist/sdk/models/operations" ;
212
- import { AxiosError } from " axios" ;
187
+ import { GetApiEndpointResponse } from " @speakeasy-api/speakeasy-client-sdk-typescript/dist/sdk/models/operations" ;
213
188
214
189
const sdk = new Speakeasy ({
215
190
security: {
216
191
apiKey: " YOUR_API_KEY_HERE" ,
217
192
},
218
193
});
219
194
220
- const req : GetApiEndpointRequest = {
195
+ sdk . apiEndpoints . getApiEndpoint ( {
221
196
apiEndpointID: " deserunt" ,
222
197
apiID: " perferendis" ,
223
198
versionID: " ipsam" ,
224
- };
225
-
226
- sdk .apiEndpoints .getApiEndpoint (req ).then ((res : GetApiEndpointResponse | AxiosError ) => {
227
- if (res instanceof UsageExamplePostResponse && res .statusCode == 200 ) {
199
+ }).then ((res : GetApiEndpointResponse ) => {
200
+ if (res .statusCode == 200 ) {
228
201
// handle response
229
202
}
230
203
});
@@ -238,16 +211,15 @@ Upsert an ApiEndpoint. If the ApiEndpoint does not exist it will be created, oth
238
211
239
212
``` typescript
240
213
import { Speakeasy } from " @speakeasy-api/speakeasy-client-sdk-typescript" ;
241
- import { UpsertApiEndpointRequest , UpsertApiEndpointResponse } from " @speakeasy-api/speakeasy-client-sdk-typescript/dist/sdk/models/operations" ;
242
- import { AxiosError } from " axios" ;
214
+ import { UpsertApiEndpointResponse } from " @speakeasy-api/speakeasy-client-sdk-typescript/dist/sdk/models/operations" ;
243
215
244
216
const sdk = new Speakeasy ({
245
217
security: {
246
218
apiKey: " YOUR_API_KEY_HERE" ,
247
219
},
248
220
});
249
221
250
- const req : UpsertApiEndpointRequest = {
222
+ sdk . apiEndpoints . upsertApiEndpoint ( {
251
223
apiEndpointInput: {
252
224
apiEndpointId: " repellendus" ,
253
225
description: " sapiente" ,
@@ -259,10 +231,8 @@ const req: UpsertApiEndpointRequest = {
259
231
apiEndpointID: " maiores" ,
260
232
apiID: " molestiae" ,
261
233
versionID: " quod" ,
262
- };
263
-
264
- sdk .apiEndpoints .upsertApiEndpoint (req ).then ((res : UpsertApiEndpointResponse | AxiosError ) => {
265
- if (res instanceof UsageExamplePostResponse && res .statusCode == 200 ) {
234
+ }).then ((res : UpsertApiEndpointResponse ) => {
235
+ if (res .statusCode == 200 ) {
266
236
// handle response
267
237
}
268
238
});
0 commit comments