(permissions)
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
models.CreatePermissionResponse
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 |
*/* |
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
models.DeletePermissionResponse
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 |
*/* |
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
Parameter |
Type |
Required |
Description |
Example |
permission_id |
str |
✔️ |
N/A |
perm_123 |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
|
models.GetPermissionResponse
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 |
*/* |
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
Parameter |
Type |
Required |
Description |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.ListPermissionsResponse
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 |
*/* |
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
models.CreateRoleResponse
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 |
*/* |
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
models.DeleteRoleResponse
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 |
*/* |
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
Parameter |
Type |
Required |
Description |
Example |
role_id |
str |
✔️ |
N/A |
role_123 |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
|
models.GetRoleResponse
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 |
*/* |
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
Parameter |
Type |
Required |
Description |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.ListRolesResponse
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 |
*/* |