Skip to content

Commit ea6c3a4

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit e717de8 of spec repo
1 parent 52579f2 commit ea6c3a4

File tree

8 files changed

+111
-10
lines changed

8 files changed

+111
-10
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49734,6 +49734,18 @@ components:
4973449734
description: The name of the role. The name is neither unique nor a stable
4973549735
identifier of the role.
4973649736
type: string
49737+
receives_permissions_from:
49738+
description: 'The managed role from which this role automatically inherits
49739+
new permissions.
49740+
49741+
Specify one of the following: "Datadog Admin Role", "Datadog Standard
49742+
Role", or "Datadog Read Only Role".
49743+
49744+
If empty or not specified, the role does not automatically inherit permissions
49745+
from any managed role.'
49746+
items:
49747+
type: string
49748+
type: array
4973749749
user_count:
4973849750
description: Number of users with that role.
4973949751
format: int64
@@ -49759,6 +49771,18 @@ components:
4975949771
description: Name of the new role that is cloned.
4976049772
example: cloned-role
4976149773
type: string
49774+
receives_permissions_from:
49775+
description: 'The managed role from which this role automatically inherits
49776+
new permissions.
49777+
49778+
Specify one of the following: "Datadog Admin Role", "Datadog Standard
49779+
Role", or "Datadog Read Only Role".
49780+
49781+
If empty or not specified, the role does not automatically inherit permissions
49782+
from any managed role.'
49783+
items:
49784+
type: string
49785+
type: array
4976249786
required:
4976349787
- name
4976449788
type: object
@@ -49787,6 +49811,18 @@ components:
4978749811
description: Name of the role.
4978849812
example: developers
4978949813
type: string
49814+
receives_permissions_from:
49815+
description: 'The managed role from which this role automatically inherits
49816+
new permissions.
49817+
49818+
Specify one of the following: "Datadog Admin Role", "Datadog Standard
49819+
Role", or "Datadog Read Only Role".
49820+
49821+
If empty or not specified, the role does not automatically inherit permissions
49822+
from any managed role.'
49823+
items:
49824+
type: string
49825+
type: array
4979049826
required:
4979149827
- name
4979249828
type: object
@@ -49908,6 +49944,18 @@ components:
4990849944
name:
4990949945
description: Name of the role.
4991049946
type: string
49947+
receives_permissions_from:
49948+
description: 'The managed role from which this role automatically inherits
49949+
new permissions.
49950+
49951+
Specify one of the following: "Datadog Admin Role", "Datadog Standard
49952+
Role", or "Datadog Read Only Role".
49953+
49954+
If empty or not specified, the role does not automatically inherit permissions
49955+
from any managed role.'
49956+
items:
49957+
type: string
49958+
type: array
4991149959
user_count:
4991249960
description: The user count.
4991349961
format: int32
@@ -104429,7 +104477,12 @@ tags:
104429104477

104430104478
read access on a specific log index to a role can be done in Datadog from the
104431104479

104432-
[Pipelines page](https://app.datadoghq.com/logs/pipelines).'
104480+
[Pipelines page](https://app.datadoghq.com/logs/pipelines).
104481+
104482+
104483+
Roles can also be managed in bulk through the Datadog UI, which provides
104484+
104485+
the capability to assign a single permission to multiple roles simultaneously.'
104433104486
name: Roles
104434104487
- description: Auto-generated tag Rum Audience Management
104435104488
name: Rum Audience Management

examples/v2/roles/CreateRole.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
data=RoleCreateData(
1818
attributes=RoleCreateAttributes(
1919
name="developers",
20+
receives_permissions_from=[],
2021
),
2122
relationships=RoleRelationships(
2223
permissions=RelationshipToPermissions(

src/datadog_api_client/v2/api/roles_api.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ class RolesApi:
3636
in the Datadog application without using this API. For example, granting
3737
read access on a specific log index to a role can be done in Datadog from the
3838
`Pipelines page <https://app.datadoghq.com/logs/pipelines>`_.
39+
40+
Roles can also be managed in bulk through the Datadog UI, which provides
41+
the capability to assign a single permission to multiple roles simultaneously.
3942
"""
4043

4144
def __init__(self, api_client=None):

src/datadog_api_client/v2/model/role_attributes.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Copyright 2019-Present Datadog, Inc.
44
from __future__ import annotations
55

6-
from typing import Union
6+
from typing import List, Union
77

88
from datadog_api_client.model_utils import (
99
ModelNormal,
@@ -21,13 +21,15 @@ def openapi_types(_):
2121
"created_at": (datetime,),
2222
"modified_at": (datetime,),
2323
"name": (str,),
24+
"receives_permissions_from": ([str],),
2425
"user_count": (int,),
2526
}
2627

2728
attribute_map = {
2829
"created_at": "created_at",
2930
"modified_at": "modified_at",
3031
"name": "name",
32+
"receives_permissions_from": "receives_permissions_from",
3133
"user_count": "user_count",
3234
}
3335
read_only_vars = {
@@ -41,6 +43,7 @@ def __init__(
4143
created_at: Union[datetime, UnsetType] = unset,
4244
modified_at: Union[datetime, UnsetType] = unset,
4345
name: Union[str, UnsetType] = unset,
46+
receives_permissions_from: Union[List[str], UnsetType] = unset,
4447
user_count: Union[int, UnsetType] = unset,
4548
**kwargs,
4649
):
@@ -56,6 +59,11 @@ def __init__(
5659
:param name: The name of the role. The name is neither unique nor a stable identifier of the role.
5760
:type name: str, optional
5861
62+
:param receives_permissions_from: The managed role from which this role automatically inherits new permissions.
63+
Specify one of the following: "Datadog Admin Role", "Datadog Standard Role", or "Datadog Read Only Role".
64+
If empty or not specified, the role does not automatically inherit permissions from any managed role.
65+
:type receives_permissions_from: [str], optional
66+
5967
:param user_count: Number of users with that role.
6068
:type user_count: int, optional
6169
"""
@@ -65,6 +73,8 @@ def __init__(
6573
kwargs["modified_at"] = modified_at
6674
if name is not unset:
6775
kwargs["name"] = name
76+
if receives_permissions_from is not unset:
77+
kwargs["receives_permissions_from"] = receives_permissions_from
6878
if user_count is not unset:
6979
kwargs["user_count"] = user_count
7080
super().__init__(kwargs)

src/datadog_api_client/v2/model/role_clone_attributes.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,13 @@
33
# Copyright 2019-Present Datadog, Inc.
44
from __future__ import annotations
55

6+
from typing import List, Union
67

78
from datadog_api_client.model_utils import (
89
ModelNormal,
910
cached_property,
11+
unset,
12+
UnsetType,
1013
)
1114

1215

@@ -15,19 +18,28 @@ class RoleCloneAttributes(ModelNormal):
1518
def openapi_types(_):
1619
return {
1720
"name": (str,),
21+
"receives_permissions_from": ([str],),
1822
}
1923

2024
attribute_map = {
2125
"name": "name",
26+
"receives_permissions_from": "receives_permissions_from",
2227
}
2328

24-
def __init__(self_, name: str, **kwargs):
29+
def __init__(self_, name: str, receives_permissions_from: Union[List[str], UnsetType] = unset, **kwargs):
2530
"""
2631
Attributes required to create a new role by cloning an existing one.
2732
2833
:param name: Name of the new role that is cloned.
2934
:type name: str
35+
36+
:param receives_permissions_from: The managed role from which this role automatically inherits new permissions.
37+
Specify one of the following: "Datadog Admin Role", "Datadog Standard Role", or "Datadog Read Only Role".
38+
If empty or not specified, the role does not automatically inherit permissions from any managed role.
39+
:type receives_permissions_from: [str], optional
3040
"""
41+
if receives_permissions_from is not unset:
42+
kwargs["receives_permissions_from"] = receives_permissions_from
3143
super().__init__(kwargs)
3244

3345
self_.name = name

src/datadog_api_client/v2/model/role_create_attributes.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Copyright 2019-Present Datadog, Inc.
44
from __future__ import annotations
55

6-
from typing import Union
6+
from typing import List, Union
77

88
from datadog_api_client.model_utils import (
99
ModelNormal,
@@ -21,12 +21,14 @@ def openapi_types(_):
2121
"created_at": (datetime,),
2222
"modified_at": (datetime,),
2323
"name": (str,),
24+
"receives_permissions_from": ([str],),
2425
}
2526

2627
attribute_map = {
2728
"created_at": "created_at",
2829
"modified_at": "modified_at",
2930
"name": "name",
31+
"receives_permissions_from": "receives_permissions_from",
3032
}
3133
read_only_vars = {
3234
"created_at",
@@ -38,6 +40,7 @@ def __init__(
3840
name: str,
3941
created_at: Union[datetime, UnsetType] = unset,
4042
modified_at: Union[datetime, UnsetType] = unset,
43+
receives_permissions_from: Union[List[str], UnsetType] = unset,
4144
**kwargs,
4245
):
4346
"""
@@ -51,11 +54,18 @@ def __init__(
5154
5255
:param name: Name of the role.
5356
:type name: str
57+
58+
:param receives_permissions_from: The managed role from which this role automatically inherits new permissions.
59+
Specify one of the following: "Datadog Admin Role", "Datadog Standard Role", or "Datadog Read Only Role".
60+
If empty or not specified, the role does not automatically inherit permissions from any managed role.
61+
:type receives_permissions_from: [str], optional
5462
"""
5563
if created_at is not unset:
5664
kwargs["created_at"] = created_at
5765
if modified_at is not unset:
5866
kwargs["modified_at"] = modified_at
67+
if receives_permissions_from is not unset:
68+
kwargs["receives_permissions_from"] = receives_permissions_from
5969
super().__init__(kwargs)
6070

6171
self_.name = name

src/datadog_api_client/v2/model/role_update_attributes.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Copyright 2019-Present Datadog, Inc.
44
from __future__ import annotations
55

6-
from typing import Union
6+
from typing import List, Union
77

88
from datadog_api_client.model_utils import (
99
ModelNormal,
@@ -27,13 +27,15 @@ def openapi_types(_):
2727
"created_at": (datetime,),
2828
"modified_at": (datetime,),
2929
"name": (str,),
30+
"receives_permissions_from": ([str],),
3031
"user_count": (int,),
3132
}
3233

3334
attribute_map = {
3435
"created_at": "created_at",
3536
"modified_at": "modified_at",
3637
"name": "name",
38+
"receives_permissions_from": "receives_permissions_from",
3739
"user_count": "user_count",
3840
}
3941
read_only_vars = {
@@ -46,6 +48,7 @@ def __init__(
4648
created_at: Union[datetime, UnsetType] = unset,
4749
modified_at: Union[datetime, UnsetType] = unset,
4850
name: Union[str, UnsetType] = unset,
51+
receives_permissions_from: Union[List[str], UnsetType] = unset,
4952
user_count: Union[int, UnsetType] = unset,
5053
**kwargs,
5154
):
@@ -61,6 +64,11 @@ def __init__(
6164
:param name: Name of the role.
6265
:type name: str, optional
6366
67+
:param receives_permissions_from: The managed role from which this role automatically inherits new permissions.
68+
Specify one of the following: "Datadog Admin Role", "Datadog Standard Role", or "Datadog Read Only Role".
69+
If empty or not specified, the role does not automatically inherit permissions from any managed role.
70+
:type receives_permissions_from: [str], optional
71+
6472
:param user_count: The user count.
6573
:type user_count: int, optional
6674
"""
@@ -70,6 +78,8 @@ def __init__(
7078
kwargs["modified_at"] = modified_at
7179
if name is not unset:
7280
kwargs["name"] = name
81+
if receives_permissions_from is not unset:
82+
kwargs["receives_permissions_from"] = receives_permissions_from
7383
if user_count is not unset:
7484
kwargs["user_count"] = user_count
7585
super().__init__(kwargs)

tests/v2/features/roles.feature

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ Feature: Roles
66
account assets can be granted to roles in the Datadog application without
77
using this API. For example, granting read access on a specific log index
88
to a role can be done in Datadog from the [Pipelines
9-
page](https://app.datadoghq.com/logs/pipelines).
9+
page](https://app.datadoghq.com/logs/pipelines). Roles can also be
10+
managed in bulk through the Datadog UI, which provides the capability to
11+
assign a single permission to multiple roles simultaneously.
1012

1113
Background:
1214
Given a valid "apiKeyAuth" key in the system
@@ -64,7 +66,7 @@ Feature: Roles
6466
Scenario: Create a new role by cloning an existing role returns "Not found" response
6567
Given new "CloneRole" request
6668
And request contains "role_id" parameter from "REPLACE.ME"
67-
And body with value {"data": {"attributes": {"name": "cloned-role"}, "type": "roles"}}
69+
And body with value {"data": {"attributes": {"name": "cloned-role", "receives_permissions_from": []}, "type": "roles"}}
6870
When the request is sent
6971
Then the response status is 404 Not found
7072

@@ -81,14 +83,14 @@ Feature: Roles
8183
@generated @skip @team:DataDog/aaa-core-access
8284
Scenario: Create role returns "Bad Request" response
8385
Given new "CreateRole" request
84-
And body with value {"data": {"attributes": {"name": "developers"}, "relationships": {"permissions": {"data": [{"type": "permissions"}]}}, "type": "roles"}}
86+
And body with value {"data": {"attributes": {"name": "developers", "receives_permissions_from": []}, "relationships": {"permissions": {"data": [{"type": "permissions"}]}}, "type": "roles"}}
8587
When the request is sent
8688
Then the response status is 400 Bad Request
8789

8890
@generated @skip @team:DataDog/aaa-core-access
8991
Scenario: Create role returns "OK" response
9092
Given new "CreateRole" request
91-
And body with value {"data": {"attributes": {"name": "developers"}, "relationships": {"permissions": {"data": [{"type": "permissions"}]}}, "type": "roles"}}
93+
And body with value {"data": {"attributes": {"name": "developers", "receives_permissions_from": []}, "relationships": {"permissions": {"data": [{"type": "permissions"}]}}, "type": "roles"}}
9294
When the request is sent
9395
Then the response status is 200 OK
9496

@@ -335,6 +337,6 @@ Feature: Roles
335337
Scenario: Update a role returns "Unprocessable Entity" response
336338
Given new "UpdateRole" request
337339
And request contains "role_id" parameter from "REPLACE.ME"
338-
And body with value {"data": {"attributes": {}, "id": "00000000-0000-1111-0000-000000000000", "relationships": {"permissions": {"data": [{"type": "permissions"}]}}, "type": "roles"}}
340+
And body with value {"data": {"attributes": {"receives_permissions_from": []}, "id": "00000000-0000-1111-0000-000000000000", "relationships": {"permissions": {"data": [{"type": "permissions"}]}}, "type": "roles"}}
339341
When the request is sent
340342
Then the response status is 422 Unprocessable Entity

0 commit comments

Comments
 (0)