Skip to content

Commit 0ad2ae9

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 65463e1 of spec repo
1 parent 3803f85 commit 0ad2ae9

4 files changed

Lines changed: 54 additions & 1 deletion

File tree

.generator/schemas/v2/openapi.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174662,6 +174662,19 @@ paths:
174662174662
description: |-
174663174663
Returns a list of all permissions, including name, description, and ID.
174664174664
operationId: ListPermissions
174665+
parameters:
174666+
- description: |-
174667+
Set to `true` to return all permissions, including both permissions
174668+
that can be assigned to user roles and permissions that can only be
174669+
used as scopes for OAuth clients and scoped credentials. When `false`
174670+
(default), only permissions that can be assigned to user roles are
174671+
returned.
174672+
example: false
174673+
in: query
174674+
name: include_scopes
174675+
required: false
174676+
schema:
174677+
type: boolean
174665174678
responses:
174666174679
"200":
174667174680
content:
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
"""
2+
List permissions including scopes returns "OK" response
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v2.api.roles_api import RolesApi
7+
8+
configuration = Configuration()
9+
with ApiClient(configuration) as api_client:
10+
api_instance = RolesApi(api_client)
11+
response = api_instance.list_permissions(
12+
include_scopes=True,
13+
)
14+
15+
print(response)

src/datadog_api_client/v2/api/roles_api.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,13 @@ def __init__(self, api_client=None):
199199
"http_method": "GET",
200200
"version": "v2",
201201
},
202-
params_map={},
202+
params_map={
203+
"include_scopes": {
204+
"openapi_types": (bool,),
205+
"attribute": "include_scopes",
206+
"location": "query",
207+
},
208+
},
203209
headers_map={
204210
"accept": ["application/json"],
205211
},
@@ -536,14 +542,25 @@ def get_role(
536542

537543
def list_permissions(
538544
self,
545+
*,
546+
include_scopes: Union[bool, UnsetType] = unset,
539547
) -> PermissionsResponse:
540548
"""List permissions.
541549
542550
Returns a list of all permissions, including name, description, and ID.
543551
552+
:param include_scopes: Set to ``true`` to return all permissions, including both permissions
553+
that can be assigned to user roles and permissions that can only be
554+
used as scopes for OAuth clients and scoped credentials. When ``false``
555+
(default), only permissions that can be assigned to user roles are
556+
returned.
557+
:type include_scopes: bool, optional
544558
:rtype: PermissionsResponse
545559
"""
546560
kwargs: Dict[str, Any] = {}
561+
if include_scopes is not unset:
562+
kwargs["include_scopes"] = include_scopes
563+
547564
return self._list_permissions_endpoint.call_with_http_info(**kwargs)
548565

549566
def list_role_permissions(

tests/v2/features/roles.feature

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,14 @@ Feature: Roles
203203
And the response "data[0].type" is equal to "{{ permission.type }}"
204204
And the response "data" has item with field "id" with value "{{ permission.id }}"
205205

206+
@team:DataDog/aaa-core-access @team:DataDog/access-policies-lifecycle
207+
Scenario: List permissions including scopes returns "OK" response
208+
Given new "ListPermissions" request
209+
And request contains "include_scopes" parameter with value true
210+
When the request is sent
211+
Then the response status is 200 OK
212+
And the response "data" has item with field "attributes.name" with value "admin"
213+
206214
@generated @skip @team:DataDog/aaa-core-access @team:DataDog/access-policies-lifecycle
207215
Scenario: List permissions returns "Bad Request" response
208216
Given new "ListPermissions" request

0 commit comments

Comments
 (0)