Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -174662,6 +174662,19 @@ paths:
description: |-
Returns a list of all permissions, including name, description, and ID.
operationId: ListPermissions
parameters:
- description: |-
Set to `true` to return all permissions, including both permissions
that can be assigned to user roles and permissions that can only be
used as scopes for OAuth clients and scoped credentials. When `false`
(default), only permissions that can be assigned to user roles are
returned.
example: false
in: query
name: include_scopes
required: false
schema:
type: boolean
responses:
"200":
content:
Expand Down
15 changes: 15 additions & 0 deletions examples/v2/roles/ListPermissions_1350046915.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
"""
List permissions including scopes returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.roles_api import RolesApi

configuration = Configuration()
with ApiClient(configuration) as api_client:
api_instance = RolesApi(api_client)
response = api_instance.list_permissions(
include_scopes=True,
)

print(response)
19 changes: 18 additions & 1 deletion src/datadog_api_client/v2/api/roles_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,13 @@ def __init__(self, api_client=None):
"http_method": "GET",
"version": "v2",
},
params_map={},
params_map={
"include_scopes": {
"openapi_types": (bool,),
"attribute": "include_scopes",
"location": "query",
},
},
headers_map={
"accept": ["application/json"],
},
Expand Down Expand Up @@ -536,14 +542,25 @@ def get_role(

def list_permissions(
self,
*,
include_scopes: Union[bool, UnsetType] = unset,
) -> PermissionsResponse:
"""List permissions.

Returns a list of all permissions, including name, description, and ID.

:param include_scopes: Set to ``true`` to return all permissions, including both permissions
that can be assigned to user roles and permissions that can only be
used as scopes for OAuth clients and scoped credentials. When ``false``
(default), only permissions that can be assigned to user roles are
returned.
:type include_scopes: bool, optional
:rtype: PermissionsResponse
"""
kwargs: Dict[str, Any] = {}
if include_scopes is not unset:
kwargs["include_scopes"] = include_scopes

return self._list_permissions_endpoint.call_with_http_info(**kwargs)

def list_role_permissions(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2026-08-05T16:12:34.510Z
Loading
Loading