Skip to content

Latest commit

 

History

History
231 lines (168 loc) · 12.6 KB

README.md

File metadata and controls

231 lines (168 loc) · 12.6 KB

Apis

(apis)

Overview

Available Operations

get

Example Usage

from unkey_py import Unkey

with Unkey(
    bearer_auth="UNKEY_ROOT_KEY",
) as s:
    res = s.apis.get(api_id="api_1234")

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

Parameters

Parameter Type Required Description Example
api_id str ✔️ N/A api_1234
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.GetAPIResponse

Errors

Error Type Status Code Content Type
models.ErrBadRequest 400 application/json
models.ErrUnauthorized 401 application/json
models.ErrForbidden 403 application/json
models.ErrNotFound 404 application/json
models.ErrConflict 409 application/json
models.ErrTooManyRequests 429 application/json
models.ErrInternalServerError 500 application/json
models.SDKError 4XX, 5XX */*

create

Example Usage

from unkey_py import Unkey

with Unkey(
    bearer_auth="UNKEY_ROOT_KEY",
) as s:
    res = s.apis.create(request={
        "name": "my-api",
    })

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

Parameters

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

Response

models.CreateAPIResponse

Errors

Error Type Status Code Content Type
models.ErrBadRequest 400 application/json
models.ErrUnauthorized 401 application/json
models.ErrForbidden 403 application/json
models.ErrNotFound 404 application/json
models.ErrConflict 409 application/json
models.ErrTooManyRequests 429 application/json
models.ErrInternalServerError 500 application/json
models.SDKError 4XX, 5XX */*

list_keys

Example Usage

from unkey_py import Unkey

with Unkey(
    bearer_auth="UNKEY_ROOT_KEY",
) as s:
    res = s.apis.list_keys(request={
        "api_id": "api_1234",
        "limit": 100,
    })

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

Parameters

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

Response

models.ListKeysResponse

Errors

Error Type Status Code Content Type
models.ErrBadRequest 400 application/json
models.ErrUnauthorized 401 application/json
models.ErrForbidden 403 application/json
models.ErrNotFound 404 application/json
models.ErrConflict 409 application/json
models.ErrTooManyRequests 429 application/json
models.ErrInternalServerError 500 application/json
models.SDKError 4XX, 5XX */*

delete

Example Usage

from unkey_py import Unkey

with Unkey(
    bearer_auth="UNKEY_ROOT_KEY",
) as s:
    res = s.apis.delete(request={
        "api_id": "api_1234",
    })

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

Parameters

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

Response

models.DeleteAPIResponse

Errors

Error Type Status Code Content Type
models.ErrBadRequest 400 application/json
models.ErrUnauthorized 401 application/json
models.ErrForbidden 403 application/json
models.ErrNotFound 404 application/json
models.ErrConflict 409 application/json
models.ErrDeleteProtected 429 application/json
models.ErrInternalServerError 500 application/json
models.SDKError 4XX, 5XX */*

delete_keys

Example Usage

from unkey_py import Unkey

with Unkey(
    bearer_auth="UNKEY_ROOT_KEY",
) as s:
    res = s.apis.delete_keys(request={
        "api_id": "api_1234",
    })

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

Parameters

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

Response

models.DeleteKeysResponse

Errors

Error Type Status Code Content Type
models.ErrBadRequest 400 application/json
models.ErrUnauthorized 401 application/json
models.ErrForbidden 403 application/json
models.ErrNotFound 404 application/json
models.ErrConflict 409 application/json
models.ErrTooManyRequests 429 application/json
models.ErrInternalServerError 500 application/json
models.SDKError 4XX, 5XX */*