|
1 | 1 | # api_endpoints
|
2 | 2 |
|
| 3 | +## Overview |
| 4 | + |
3 | 5 | REST APIs for managing ApiEndpoint entities
|
4 | 6 |
|
| 7 | +### Available Operations |
| 8 | + |
| 9 | +* [delete_api_endpoint](#delete_api_endpoint) - Delete an ApiEndpoint. |
| 10 | +* [find_api_endpoint](#find_api_endpoint) - Find an ApiEndpoint via its displayName. |
| 11 | +* [generate_open_api_spec_for_api_endpoint](#generate_open_api_spec_for_api_endpoint) - Generate an OpenAPI specification for a particular ApiEndpoint. |
| 12 | +* [generate_postman_collection_for_api_endpoint](#generate_postman_collection_for_api_endpoint) - Generate a Postman collection for a particular ApiEndpoint. |
| 13 | +* [get_all_api_endpoints](#get_all_api_endpoints) - Get all Api endpoints for a particular apiID. |
| 14 | +* [get_all_for_version_api_endpoints](#get_all_for_version_api_endpoints) - Get all ApiEndpoints for a particular apiID and versionID. |
| 15 | +* [get_api_endpoint](#get_api_endpoint) - Get an ApiEndpoint. |
| 16 | +* [upsert_api_endpoint](#upsert_api_endpoint) - Upsert an ApiEndpoint. |
| 17 | + |
| 18 | +## delete_api_endpoint |
| 19 | + |
| 20 | +Delete an ApiEndpoint. This will also delete all associated Request Logs (if using a Postgres datastore). |
| 21 | + |
| 22 | +### Example Usage |
| 23 | + |
| 24 | +```python |
| 25 | +import speakeasy |
| 26 | +from speakeasy.models import operations |
| 27 | + |
| 28 | +s = speakeasy.Speakeasy( |
| 29 | + security=shared.Security( |
| 30 | + api_key="YOUR_API_KEY_HERE", |
| 31 | + ), |
| 32 | +) |
| 33 | + |
| 34 | + |
| 35 | +req = operations.DeleteAPIEndpointRequest( |
| 36 | + api_endpoint_id="delectus", |
| 37 | + api_id="tempora", |
| 38 | + version_id="suscipit", |
| 39 | +) |
| 40 | + |
| 41 | +res = s.api_endpoints.delete_api_endpoint(req) |
| 42 | + |
| 43 | +if res.status_code == 200: |
| 44 | + # handle response |
| 45 | +``` |
| 46 | + |
| 47 | +## find_api_endpoint |
| 48 | + |
| 49 | +Find an ApiEndpoint via its displayName (set by operationId from a registered OpenAPI schema). |
| 50 | +This is useful for finding the ID of an ApiEndpoint to use in the /v1/apis/{apiID}/version/{versionID}/api_endpoints/{apiEndpointID} endpoints. |
| 51 | + |
| 52 | +### Example Usage |
| 53 | + |
| 54 | +```python |
| 55 | +import speakeasy |
| 56 | +from speakeasy.models import operations |
| 57 | + |
| 58 | +s = speakeasy.Speakeasy( |
| 59 | + security=shared.Security( |
| 60 | + api_key="YOUR_API_KEY_HERE", |
| 61 | + ), |
| 62 | +) |
| 63 | + |
| 64 | + |
| 65 | +req = operations.FindAPIEndpointRequest( |
| 66 | + api_id="molestiae", |
| 67 | + display_name="minus", |
| 68 | + version_id="placeat", |
| 69 | +) |
| 70 | + |
| 71 | +res = s.api_endpoints.find_api_endpoint(req) |
| 72 | + |
| 73 | +if res.api_endpoint is not None: |
| 74 | + # handle response |
| 75 | +``` |
| 76 | + |
| 77 | +## generate_open_api_spec_for_api_endpoint |
| 78 | + |
| 79 | +This endpoint will generate a new operation in any registered OpenAPI document if the operation does not already exist in the document. |
| 80 | +Returns the original document and the newly generated document allowing a diff to be performed to see what has changed. |
| 81 | + |
| 82 | +### Example Usage |
| 83 | + |
| 84 | +```python |
| 85 | +import speakeasy |
| 86 | +from speakeasy.models import operations |
| 87 | + |
| 88 | +s = speakeasy.Speakeasy( |
| 89 | + security=shared.Security( |
| 90 | + api_key="YOUR_API_KEY_HERE", |
| 91 | + ), |
| 92 | +) |
| 93 | + |
| 94 | + |
| 95 | +req = operations.GenerateOpenAPISpecForAPIEndpointRequest( |
| 96 | + api_endpoint_id="voluptatum", |
| 97 | + api_id="iusto", |
| 98 | + version_id="excepturi", |
| 99 | +) |
| 100 | + |
| 101 | +res = s.api_endpoints.generate_open_api_spec_for_api_endpoint(req) |
| 102 | + |
| 103 | +if res.generate_open_api_spec_diff is not None: |
| 104 | + # handle response |
| 105 | +``` |
| 106 | + |
| 107 | +## generate_postman_collection_for_api_endpoint |
| 108 | + |
| 109 | +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. |
| 110 | + |
| 111 | +### Example Usage |
| 112 | + |
| 113 | +```python |
| 114 | +import speakeasy |
| 115 | +from speakeasy.models import operations |
| 116 | + |
| 117 | +s = speakeasy.Speakeasy( |
| 118 | + security=shared.Security( |
| 119 | + api_key="YOUR_API_KEY_HERE", |
| 120 | + ), |
| 121 | +) |
| 122 | + |
| 123 | + |
| 124 | +req = operations.GeneratePostmanCollectionForAPIEndpointRequest( |
| 125 | + api_endpoint_id="nisi", |
| 126 | + api_id="recusandae", |
| 127 | + version_id="temporibus", |
| 128 | +) |
| 129 | + |
| 130 | +res = s.api_endpoints.generate_postman_collection_for_api_endpoint(req) |
| 131 | + |
| 132 | +if res.postman_collection is not None: |
| 133 | + # handle response |
| 134 | +``` |
| 135 | + |
| 136 | +## get_all_api_endpoints |
| 137 | + |
| 138 | +Get all Api endpoints for a particular apiID. |
| 139 | + |
| 140 | +### Example Usage |
| 141 | + |
| 142 | +```python |
| 143 | +import speakeasy |
| 144 | +from speakeasy.models import operations |
| 145 | + |
| 146 | +s = speakeasy.Speakeasy( |
| 147 | + security=shared.Security( |
| 148 | + api_key="YOUR_API_KEY_HERE", |
| 149 | + ), |
| 150 | +) |
| 151 | + |
| 152 | + |
| 153 | +req = operations.GetAllAPIEndpointsRequest( |
| 154 | + api_id="ab", |
| 155 | +) |
| 156 | + |
| 157 | +res = s.api_endpoints.get_all_api_endpoints(req) |
| 158 | + |
| 159 | +if res.api_endpoints is not None: |
| 160 | + # handle response |
| 161 | +``` |
| 162 | + |
| 163 | +## get_all_for_version_api_endpoints |
| 164 | + |
| 165 | +Get all ApiEndpoints for a particular apiID and versionID. |
| 166 | + |
| 167 | +### Example Usage |
| 168 | + |
| 169 | +```python |
| 170 | +import speakeasy |
| 171 | +from speakeasy.models import operations |
| 172 | + |
| 173 | +s = speakeasy.Speakeasy( |
| 174 | + security=shared.Security( |
| 175 | + api_key="YOUR_API_KEY_HERE", |
| 176 | + ), |
| 177 | +) |
| 178 | + |
| 179 | + |
| 180 | +req = operations.GetAllForVersionAPIEndpointsRequest( |
| 181 | + api_id="quis", |
| 182 | + version_id="veritatis", |
| 183 | +) |
| 184 | + |
| 185 | +res = s.api_endpoints.get_all_for_version_api_endpoints(req) |
| 186 | + |
| 187 | +if res.api_endpoints is not None: |
| 188 | + # handle response |
| 189 | +``` |
| 190 | + |
| 191 | +## get_api_endpoint |
| 192 | + |
| 193 | +Get an ApiEndpoint. |
| 194 | + |
| 195 | +### Example Usage |
| 196 | + |
| 197 | +```python |
| 198 | +import speakeasy |
| 199 | +from speakeasy.models import operations |
| 200 | + |
| 201 | +s = speakeasy.Speakeasy( |
| 202 | + security=shared.Security( |
| 203 | + api_key="YOUR_API_KEY_HERE", |
| 204 | + ), |
| 205 | +) |
| 206 | + |
| 207 | + |
| 208 | +req = operations.GetAPIEndpointRequest( |
| 209 | + api_endpoint_id="deserunt", |
| 210 | + api_id="perferendis", |
| 211 | + version_id="ipsam", |
| 212 | +) |
| 213 | + |
| 214 | +res = s.api_endpoints.get_api_endpoint(req) |
| 215 | + |
| 216 | +if res.api_endpoint is not None: |
| 217 | + # handle response |
| 218 | +``` |
| 219 | + |
| 220 | +## upsert_api_endpoint |
| 221 | + |
| 222 | +Upsert an ApiEndpoint. If the ApiEndpoint does not exist it will be created, otherwise it will be updated. |
| 223 | + |
| 224 | +### Example Usage |
| 225 | + |
| 226 | +```python |
| 227 | +import speakeasy |
| 228 | +from speakeasy.models import operations, shared |
| 229 | + |
| 230 | +s = speakeasy.Speakeasy( |
| 231 | + security=shared.Security( |
| 232 | + api_key="YOUR_API_KEY_HERE", |
| 233 | + ), |
| 234 | +) |
| 235 | + |
| 236 | + |
| 237 | +req = operations.UpsertAPIEndpointRequest( |
| 238 | + api_endpoint_input=shared.APIEndpointInput( |
| 239 | + api_endpoint_id="repellendus", |
| 240 | + description="sapiente", |
| 241 | + display_name="quo", |
| 242 | + method="odit", |
| 243 | + path="at", |
| 244 | + version_id="at", |
| 245 | + ), |
| 246 | + api_endpoint_id="maiores", |
| 247 | + api_id="molestiae", |
| 248 | + version_id="quod", |
| 249 | +) |
| 250 | + |
| 251 | +res = s.api_endpoints.upsert_api_endpoint(req) |
5 | 252 |
|
6 |
| -* [delete_api_endpoint](deleteapiendpoint.md) - Delete an ApiEndpoint. |
7 |
| -* [find_api_endpoint](findapiendpoint.md) - Find an ApiEndpoint via its displayName. |
8 |
| -* [generate_open_api_spec_for_api_endpoint](generateopenapispecforapiendpoint.md) - Generate an OpenAPI specification for a particular ApiEndpoint. |
9 |
| -* [generate_postman_collection_for_api_endpoint](generatepostmancollectionforapiendpoint.md) - Generate a Postman collection for a particular ApiEndpoint. |
10 |
| -* [get_all_api_endpoints](getallapiendpoints.md) - Get all Api endpoints for a particular apiID. |
11 |
| -* [get_all_for_version_api_endpoints](getallforversionapiendpoints.md) - Get all ApiEndpoints for a particular apiID and versionID. |
12 |
| -* [get_api_endpoint](getapiendpoint.md) - Get an ApiEndpoint. |
13 |
| -* [upsert_api_endpoint](upsertapiendpoint.md) - Upsert an ApiEndpoint. |
| 253 | +if res.api_endpoint is not None: |
| 254 | + # handle response |
| 255 | +``` |
0 commit comments