Skip to content

Commit 2bcffd6

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit e3cfb92 of spec repo
1 parent f19155b commit 2bcffd6

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
@@ -49600,6 +49600,18 @@ components:
4960049600
description: The name of the role. The name is neither unique nor a stable
4960149601
identifier of the role.
4960249602
type: string
49603+
receives_permissions_from:
49604+
description: 'The managed role from which this role automatically inherits
49605+
new permissions.
49606+
49607+
Specify one of the following: "Datadog Admin Role", "Datadog Standard
49608+
Role", or "Datadog Read Only Role".
49609+
49610+
If empty or not specified, the role does not automatically inherit permissions
49611+
from any managed role.'
49612+
items:
49613+
type: string
49614+
type: array
4960349615
user_count:
4960449616
description: Number of users with that role.
4960549617
format: int64
@@ -49625,6 +49637,18 @@ components:
4962549637
description: Name of the new role that is cloned.
4962649638
example: cloned-role
4962749639
type: string
49640+
receives_permissions_from:
49641+
description: 'The managed role from which this role automatically inherits
49642+
new permissions.
49643+
49644+
Specify one of the following: "Datadog Admin Role", "Datadog Standard
49645+
Role", or "Datadog Read Only Role".
49646+
49647+
If empty or not specified, the role does not automatically inherit permissions
49648+
from any managed role.'
49649+
items:
49650+
type: string
49651+
type: array
4962849652
required:
4962949653
- name
4963049654
type: object
@@ -49653,6 +49677,18 @@ components:
4965349677
description: Name of the role.
4965449678
example: developers
4965549679
type: string
49680+
receives_permissions_from:
49681+
description: 'The managed role from which this role automatically inherits
49682+
new permissions.
49683+
49684+
Specify one of the following: "Datadog Admin Role", "Datadog Standard
49685+
Role", or "Datadog Read Only Role".
49686+
49687+
If empty or not specified, the role does not automatically inherit permissions
49688+
from any managed role.'
49689+
items:
49690+
type: string
49691+
type: array
4965649692
required:
4965749693
- name
4965849694
type: object
@@ -49774,6 +49810,18 @@ components:
4977449810
name:
4977549811
description: Name of the role.
4977649812
type: string
49813+
receives_permissions_from:
49814+
description: 'The managed role from which this role automatically inherits
49815+
new permissions.
49816+
49817+
Specify one of the following: "Datadog Admin Role", "Datadog Standard
49818+
Role", or "Datadog Read Only Role".
49819+
49820+
If empty or not specified, the role does not automatically inherit permissions
49821+
from any managed role.'
49822+
items:
49823+
type: string
49824+
type: array
4977749825
user_count:
4977849826
description: The user count.
4977949827
format: int32
@@ -104192,7 +104240,12 @@ tags:
104192104240

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

104195-
[Pipelines page](https://app.datadoghq.com/logs/pipelines).'
104243+
[Pipelines page](https://app.datadoghq.com/logs/pipelines).
104244+
104245+
104246+
Roles can also be managed in bulk through the Datadog UI, which provides
104247+
104248+
the capability to assign a single permission to multiple roles simultaneously.'
104196104249
name: Roles
104197104250
- description: Auto-generated tag Rum Audience Management
104198104251
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)