@@ -23,23 +23,20 @@ Delete an ApiEndpoint. This will also delete all associated Request Logs (if usi
2323
2424``` typescript
2525import { 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" ;
2827
2928const sdk = new Speakeasy ({
3029 security: {
3130 apiKey: " YOUR_API_KEY_HERE" ,
3231 },
3332});
3433
35- const req : DeleteApiEndpointRequest = {
34+ sdk . apiEndpoints . deleteApiEndpoint ( {
3635 apiEndpointID: " delectus" ,
3736 apiID: " tempora" ,
3837 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 ) {
4340 // handle response
4441 }
4542});
@@ -54,23 +51,20 @@ This is useful for finding the ID of an ApiEndpoint to use in the /v1/apis/{apiI
5451
5552``` typescript
5653import { 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" ;
5955
6056const sdk = new Speakeasy ({
6157 security: {
6258 apiKey: " YOUR_API_KEY_HERE" ,
6359 },
6460});
6561
66- const req : FindApiEndpointRequest = {
62+ sdk . apiEndpoints . findApiEndpoint ( {
6763 apiID: " molestiae" ,
6864 displayName: " minus" ,
6965 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 ) {
7468 // handle response
7569 }
7670});
@@ -85,26 +79,20 @@ Returns the original document and the newly generated document allowing a diff t
8579
8680``` typescript
8781import { 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" ;
9383
9484const sdk = new Speakeasy ({
9585 security: {
9686 apiKey: " YOUR_API_KEY_HERE" ,
9787 },
9888});
9989
100- const req : GenerateOpenApiSpecForApiEndpointRequest = {
90+ sdk . apiEndpoints . generateOpenApiSpecForApiEndpoint ( {
10191 apiEndpointID: " voluptatum" ,
10292 apiID: " iusto" ,
10393 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 ) {
10896 // handle response
10997 }
11098});
@@ -118,26 +106,20 @@ Generates a postman collection that allows the endpoint to be called from postma
118106
119107``` typescript
120108import { 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" ;
126110
127111const sdk = new Speakeasy ({
128112 security: {
129113 apiKey: " YOUR_API_KEY_HERE" ,
130114 },
131115});
132116
133- const req : GeneratePostmanCollectionForApiEndpointRequest = {
117+ sdk . apiEndpoints . generatePostmanCollectionForApiEndpoint ( {
134118 apiEndpointID: " nisi" ,
135119 apiID: " recusandae" ,
136120 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 ) {
141123 // handle response
142124 }
143125});
@@ -151,21 +133,18 @@ Get all Api endpoints for a particular apiID.
151133
152134``` typescript
153135import { 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" ;
156137
157138const sdk = new Speakeasy ({
158139 security: {
159140 apiKey: " YOUR_API_KEY_HERE" ,
160141 },
161142});
162143
163- const req : GetAllApiEndpointsRequest = {
144+ sdk . apiEndpoints . getAllApiEndpoints ( {
164145 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 ) {
169148 // handle response
170149 }
171150});
@@ -179,22 +158,19 @@ Get all ApiEndpoints for a particular apiID and versionID.
179158
180159``` typescript
181160import { 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" ;
184162
185163const sdk = new Speakeasy ({
186164 security: {
187165 apiKey: " YOUR_API_KEY_HERE" ,
188166 },
189167});
190168
191- const req : GetAllForVersionApiEndpointsRequest = {
169+ sdk . apiEndpoints . getAllForVersionApiEndpoints ( {
192170 apiID: " quis" ,
193171 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 ) {
198174 // handle response
199175 }
200176});
@@ -208,23 +184,20 @@ Get an ApiEndpoint.
208184
209185``` typescript
210186import { 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" ;
213188
214189const sdk = new Speakeasy ({
215190 security: {
216191 apiKey: " YOUR_API_KEY_HERE" ,
217192 },
218193});
219194
220- const req : GetApiEndpointRequest = {
195+ sdk . apiEndpoints . getApiEndpoint ( {
221196 apiEndpointID: " deserunt" ,
222197 apiID: " perferendis" ,
223198 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 ) {
228201 // handle response
229202 }
230203});
@@ -238,16 +211,15 @@ Upsert an ApiEndpoint. If the ApiEndpoint does not exist it will be created, oth
238211
239212``` typescript
240213import { 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" ;
243215
244216const sdk = new Speakeasy ({
245217 security: {
246218 apiKey: " YOUR_API_KEY_HERE" ,
247219 },
248220});
249221
250- const req : UpsertApiEndpointRequest = {
222+ sdk . apiEndpoints . upsertApiEndpoint ( {
251223 apiEndpointInput: {
252224 apiEndpointId: " repellendus" ,
253225 description: " sapiente" ,
@@ -259,10 +231,8 @@ const req: UpsertApiEndpointRequest = {
259231 apiEndpointID: " maiores" ,
260232 apiID: " molestiae" ,
261233 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 ) {
266236 // handle response
267237 }
268238});
0 commit comments