-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathapiendpoints.ts
154 lines (144 loc) · 5.12 KB
/
apiendpoints.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
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
import { apiEndpointsDeleteApiEndpoint } from "../funcs/apiEndpointsDeleteApiEndpoint.js";
import { apiEndpointsFindApiEndpoint } from "../funcs/apiEndpointsFindApiEndpoint.js";
import { apiEndpointsGenerateOpenApiSpecForApiEndpoint } from "../funcs/apiEndpointsGenerateOpenApiSpecForApiEndpoint.js";
import {
apiEndpointsGeneratePostmanCollectionForApiEndpoint,
GeneratePostmanCollectionForApiEndpointAcceptEnum,
} from "../funcs/apiEndpointsGeneratePostmanCollectionForApiEndpoint.js";
import { apiEndpointsGetAllApiEndpoints } from "../funcs/apiEndpointsGetAllApiEndpoints.js";
import { apiEndpointsGetAllForVersionApiEndpoints } from "../funcs/apiEndpointsGetAllForVersionApiEndpoints.js";
import { apiEndpointsGetApiEndpoint } from "../funcs/apiEndpointsGetApiEndpoint.js";
import { apiEndpointsUpsertApiEndpoint } from "../funcs/apiEndpointsUpsertApiEndpoint.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 { GeneratePostmanCollectionForApiEndpointAcceptEnum } from "../funcs/apiEndpointsGeneratePostmanCollectionForApiEndpoint.js";
export class ApiEndpoints extends ClientSDK {
/**
* Delete an ApiEndpoint.
*
* @remarks
* Delete an ApiEndpoint. This will also delete all associated Request Logs (if using a Postgres datastore).
*/
async deleteApiEndpoint(
request: operations.DeleteApiEndpointRequest,
options?: RequestOptions,
): Promise<shared.ErrorT | undefined> {
return unwrapAsync(apiEndpointsDeleteApiEndpoint(
this,
request,
options,
));
}
/**
* Find an ApiEndpoint via its displayName.
*
* @remarks
* Find an ApiEndpoint via its displayName (set by operationId from a registered OpenAPI schema).
* This is useful for finding the ID of an ApiEndpoint to use in the /v1/apis/{apiID}/version/{versionID}/api_endpoints/{apiEndpointID} endpoints.
*/
async findApiEndpoint(
request: operations.FindApiEndpointRequest,
options?: RequestOptions,
): Promise<operations.FindApiEndpointResponse> {
return unwrapAsync(apiEndpointsFindApiEndpoint(
this,
request,
options,
));
}
/**
* Generate an OpenAPI specification for a particular ApiEndpoint.
*
* @remarks
* This endpoint will generate a new operation in any registered OpenAPI document if the operation does not already exist in the document.
* Returns the original document and the newly generated document allowing a diff to be performed to see what has changed.
*/
async generateOpenApiSpecForApiEndpoint(
request: operations.GenerateOpenApiSpecForApiEndpointRequest,
options?: RequestOptions,
): Promise<operations.GenerateOpenApiSpecForApiEndpointResponse> {
return unwrapAsync(apiEndpointsGenerateOpenApiSpecForApiEndpoint(
this,
request,
options,
));
}
/**
* Generate a Postman collection for a particular ApiEndpoint.
*
* @remarks
* Generates a postman collection that allows the endpoint to be called from postman variables produced for any path/query/header parameters included in the OpenAPI document.
*/
async generatePostmanCollectionForApiEndpoint(
request: operations.GeneratePostmanCollectionForApiEndpointRequest,
options?: RequestOptions & {
acceptHeaderOverride?: GeneratePostmanCollectionForApiEndpointAcceptEnum;
},
): Promise<operations.GeneratePostmanCollectionForApiEndpointResponse> {
return unwrapAsync(apiEndpointsGeneratePostmanCollectionForApiEndpoint(
this,
request,
options,
));
}
/**
* Get all Api endpoints for a particular apiID.
*/
async getAllApiEndpoints(
request: operations.GetAllApiEndpointsRequest,
options?: RequestOptions,
): Promise<operations.GetAllApiEndpointsResponse> {
return unwrapAsync(apiEndpointsGetAllApiEndpoints(
this,
request,
options,
));
}
/**
* Get all ApiEndpoints for a particular apiID and versionID.
*/
async getAllForVersionApiEndpoints(
request: operations.GetAllForVersionApiEndpointsRequest,
options?: RequestOptions,
): Promise<operations.GetAllForVersionApiEndpointsResponse> {
return unwrapAsync(apiEndpointsGetAllForVersionApiEndpoints(
this,
request,
options,
));
}
/**
* Get an ApiEndpoint.
*/
async getApiEndpoint(
request: operations.GetApiEndpointRequest,
options?: RequestOptions,
): Promise<operations.GetApiEndpointResponse> {
return unwrapAsync(apiEndpointsGetApiEndpoint(
this,
request,
options,
));
}
/**
* Upsert an ApiEndpoint.
*
* @remarks
* Upsert an ApiEndpoint. If the ApiEndpoint does not exist it will be created, otherwise it will be updated.
*/
async upsertApiEndpoint(
request: operations.UpsertApiEndpointRequest,
options?: RequestOptions,
): Promise<operations.UpsertApiEndpointResponse> {
return unwrapAsync(apiEndpointsUpsertApiEndpoint(
this,
request,
options,
));
}
}