Skip to content

Latest commit

 

History

History
392 lines (268 loc) · 21.4 KB

File metadata and controls

392 lines (268 loc) · 21.4 KB

APIEndpoints

(api_endpoints)

Overview

REST APIs for managing ApiEndpoint entities

Available Operations

delete_api_endpoint

Delete an ApiEndpoint. This will also delete all associated Request Logs (if using a Postgres datastore).

Example Usage

from speakeasy_client_sdk_python import Speakeasy
from speakeasy_client_sdk_python.models import shared

s = Speakeasy(
    security=shared.Security(
        api_key="<YOUR_API_KEY_HERE>",
    ),
)


res = s.api_endpoints.delete_api_endpoint(request={
    "api_id": "<value>",
    "version_id": "<value>",
    "api_endpoint_id": "<value>",
})

if res is not None:
    # handle response
    pass

Parameters

Parameter Type Required Description
request operations.DeleteAPIEndpointRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.DeleteAPIEndpointResponse

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

find_api_endpoint

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.

Example Usage

from speakeasy_client_sdk_python import Speakeasy
from speakeasy_client_sdk_python.models import shared

s = Speakeasy(
    security=shared.Security(
        api_key="<YOUR_API_KEY_HERE>",
    ),
)


res = s.api_endpoints.find_api_endpoint(request={
    "api_id": "<value>",
    "version_id": "<value>",
    "display_name": "Don.Strosin",
})

if res.api_endpoint is not None:
    # handle response
    pass

Parameters

Parameter Type Required Description
request operations.FindAPIEndpointRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.FindAPIEndpointResponse

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

generate_open_api_spec_for_api_endpoint

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.

Example Usage

from speakeasy_client_sdk_python import Speakeasy
from speakeasy_client_sdk_python.models import shared

s = Speakeasy(
    security=shared.Security(
        api_key="<YOUR_API_KEY_HERE>",
    ),
)


res = s.api_endpoints.generate_open_api_spec_for_api_endpoint(request={
    "api_id": "<value>",
    "version_id": "<value>",
    "api_endpoint_id": "<value>",
})

if res.generate_open_api_spec_diff is not None:
    # handle response
    pass

Parameters

Parameter Type Required Description
request operations.GenerateOpenAPISpecForAPIEndpointRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.GenerateOpenAPISpecForAPIEndpointResponse

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

generate_postman_collection_for_api_endpoint

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.

Example Usage

from speakeasy_client_sdk_python import Speakeasy
from speakeasy_client_sdk_python.models import shared

s = Speakeasy(
    security=shared.Security(
        api_key="<YOUR_API_KEY_HERE>",
    ),
)


res = s.api_endpoints.generate_postman_collection_for_api_endpoint(request={
    "api_id": "<value>",
    "version_id": "<value>",
    "api_endpoint_id": "<value>",
})

if res.postman_collection is not None:
    # handle response
    pass

Parameters

Parameter Type Required Description
request operations.GeneratePostmanCollectionForAPIEndpointRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.GeneratePostmanCollectionForAPIEndpointResponse

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

get_all_api_endpoints

Get all Api endpoints for a particular apiID.

Example Usage

from speakeasy_client_sdk_python import Speakeasy
from speakeasy_client_sdk_python.models import shared

s = Speakeasy(
    security=shared.Security(
        api_key="<YOUR_API_KEY_HERE>",
    ),
)


res = s.api_endpoints.get_all_api_endpoints(request={
    "api_id": "<value>",
})

if res.api_endpoints is not None:
    # handle response
    pass

Parameters

Parameter Type Required Description
request operations.GetAllAPIEndpointsRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.GetAllAPIEndpointsResponse

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

get_all_for_version_api_endpoints

Get all ApiEndpoints for a particular apiID and versionID.

Example Usage

from speakeasy_client_sdk_python import Speakeasy
from speakeasy_client_sdk_python.models import shared

s = Speakeasy(
    security=shared.Security(
        api_key="<YOUR_API_KEY_HERE>",
    ),
)


res = s.api_endpoints.get_all_for_version_api_endpoints(request={
    "api_id": "<value>",
    "version_id": "<value>",
})

if res.api_endpoints is not None:
    # handle response
    pass

Parameters

Parameter Type Required Description
request operations.GetAllForVersionAPIEndpointsRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.GetAllForVersionAPIEndpointsResponse

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

get_api_endpoint

Get an ApiEndpoint.

Example Usage

from speakeasy_client_sdk_python import Speakeasy
from speakeasy_client_sdk_python.models import shared

s = Speakeasy(
    security=shared.Security(
        api_key="<YOUR_API_KEY_HERE>",
    ),
)


res = s.api_endpoints.get_api_endpoint(request={
    "api_id": "<value>",
    "version_id": "<value>",
    "api_endpoint_id": "<value>",
})

if res.api_endpoint is not None:
    # handle response
    pass

Parameters

Parameter Type Required Description
request operations.GetAPIEndpointRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.GetAPIEndpointResponse

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

upsert_api_endpoint

Upsert an ApiEndpoint. If the ApiEndpoint does not exist it will be created, otherwise it will be updated.

Example Usage

from speakeasy_client_sdk_python import Speakeasy
from speakeasy_client_sdk_python.models import shared

s = Speakeasy(
    security=shared.Security(
        api_key="<YOUR_API_KEY_HERE>",
    ),
)


res = s.api_endpoints.upsert_api_endpoint(request={
    "api_id": "<value>",
    "version_id": "<value>",
    "api_endpoint_id": "<value>",
    "api_endpoint": {
        "api_endpoint_id": "<value>",
        "description": "Public-key systematic attitude",
        "display_name": "Camille.Schaefer11",
        "method": "<value>",
        "path": "/Library",
        "version_id": "<value>",
    },
})

if res.api_endpoint is not None:
    # handle response
    pass

Parameters

Parameter Type Required Description
request operations.UpsertAPIEndpointRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.UpsertAPIEndpointResponse

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /