create
Example Usage
import os
from unkey_py import Unkey
s = Unkey(
bearer_auth=os.getenv("UNKEY_BEARER_AUTH", ""),
)
res = s.permissions.create(request={
"name": "record.write",
"description": "record.write can create new dns records for our domains.",
})
if res.object is not None:
# handle response
pass
Parameters
Response
models.CreatePermissionResponse
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
import os
from unkey_py import Unkey
s = Unkey(
bearer_auth=os.getenv("UNKEY_BEARER_AUTH", ""),
)
res = s.permissions.delete(request={
"permission_id": "perm_123",
})
if res.object is not None:
# handle response
pass
Parameters
Response
models.DeletePermissionResponse
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 | */* |
get
Example Usage
import os
from unkey_py import Unkey
s = Unkey(
bearer_auth=os.getenv("UNKEY_BEARER_AUTH", ""),
)
res = s.permissions.get(permission_id="perm_123")
if res.object is not None:
# handle response
pass
Parameters
Parameter | Type | Required | Description | Example |
---|
permission_id | str | :heavy_check_mark: | N/A | perm_123 |
retries | Optional[utils.RetryConfig] | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | |
Response
models.GetPermissionResponse
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
Example Usage
import os
from unkey_py import Unkey
s = Unkey(
bearer_auth=os.getenv("UNKEY_BEARER_AUTH", ""),
)
res = s.permissions.list()
if res.response_bodies is not None:
# handle response
pass
Parameters
Parameter | Type | Required | Description |
---|
retries | Optional[utils.RetryConfig] | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
Response
models.ListPermissionsResponse
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_role
Example Usage
import os
from unkey_py import Unkey
s = Unkey(
bearer_auth=os.getenv("UNKEY_BEARER_AUTH", ""),
)
res = s.permissions.create_role(request={
"name": "dns.records.manager",
"description": "dns.records.manager can read and write dns records for our domains.",
})
if res.object is not None:
# handle response
pass
Parameters
Response
models.CreateRoleResponse
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_role
Example Usage
import os
from unkey_py import Unkey
s = Unkey(
bearer_auth=os.getenv("UNKEY_BEARER_AUTH", ""),
)
res = s.permissions.delete_role(request={
"role_id": "role_123",
})
if res.object is not None:
# handle response
pass
Parameters
Response
models.DeleteRoleResponse
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 | */* |
get_role
Example Usage
import os
from unkey_py import Unkey
s = Unkey(
bearer_auth=os.getenv("UNKEY_BEARER_AUTH", ""),
)
res = s.permissions.get_role(role_id="role_123")
if res.object is not None:
# handle response
pass
Parameters
Parameter | Type | Required | Description | Example |
---|
role_id | str | :heavy_check_mark: | N/A | role_123 |
retries | Optional[utils.RetryConfig] | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | |
Response
models.GetRoleResponse
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_roles
Example Usage
import os
from unkey_py import Unkey
s = Unkey(
bearer_auth=os.getenv("UNKEY_BEARER_AUTH", ""),
)
res = s.permissions.list_roles()
if res.response_bodies is not None:
# handle response
pass
Parameters
Parameter | Type | Required | Description |
---|
retries | Optional[utils.RetryConfig] | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
Response
models.ListRolesResponse
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 | */* |