Skip to content

Commit cb1b53a

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add receives_permissions_from field to Roles API (#3482)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 44287c9 commit cb1b53a

File tree

6 files changed

+241
-12
lines changed

6 files changed

+241
-12
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49931,6 +49931,18 @@ components:
4993149931
description: The name of the role. The name is neither unique nor a stable
4993249932
identifier of the role.
4993349933
type: string
49934+
receives_permissions_from:
49935+
description: 'The managed role from which this role automatically inherits
49936+
new permissions.
49937+
49938+
Specify one of the following: "Datadog Admin Role", "Datadog Standard
49939+
Role", or "Datadog Read Only Role".
49940+
49941+
If empty or not specified, the role does not automatically inherit permissions
49942+
from any managed role.'
49943+
items:
49944+
type: string
49945+
type: array
4993449946
user_count:
4993549947
description: Number of users with that role.
4993649948
format: int64
@@ -49956,6 +49968,18 @@ components:
4995649968
description: Name of the new role that is cloned.
4995749969
example: cloned-role
4995849970
type: string
49971+
receives_permissions_from:
49972+
description: 'The managed role from which this role automatically inherits
49973+
new permissions.
49974+
49975+
Specify one of the following: "Datadog Admin Role", "Datadog Standard
49976+
Role", or "Datadog Read Only Role".
49977+
49978+
If empty or not specified, the role does not automatically inherit permissions
49979+
from any managed role.'
49980+
items:
49981+
type: string
49982+
type: array
4995949983
required:
4996049984
- name
4996149985
type: object
@@ -49984,6 +50008,18 @@ components:
4998450008
description: Name of the role.
4998550009
example: developers
4998650010
type: string
50011+
receives_permissions_from:
50012+
description: 'The managed role from which this role automatically inherits
50013+
new permissions.
50014+
50015+
Specify one of the following: "Datadog Admin Role", "Datadog Standard
50016+
Role", or "Datadog Read Only Role".
50017+
50018+
If empty or not specified, the role does not automatically inherit permissions
50019+
from any managed role.'
50020+
items:
50021+
type: string
50022+
type: array
4998750023
required:
4998850024
- name
4998950025
type: object
@@ -50105,6 +50141,18 @@ components:
5010550141
name:
5010650142
description: Name of the role.
5010750143
type: string
50144+
receives_permissions_from:
50145+
description: 'The managed role from which this role automatically inherits
50146+
new permissions.
50147+
50148+
Specify one of the following: "Datadog Admin Role", "Datadog Standard
50149+
Role", or "Datadog Read Only Role".
50150+
50151+
If empty or not specified, the role does not automatically inherit permissions
50152+
from any managed role.'
50153+
items:
50154+
type: string
50155+
type: array
5010850156
user_count:
5010950157
description: The user count.
5011050158
format: int32
@@ -105571,7 +105619,12 @@ tags:
105571105619

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

105574-
[Pipelines page](https://app.datadoghq.com/logs/pipelines).'
105622+
[Pipelines page](https://app.datadoghq.com/logs/pipelines).
105623+
105624+
105625+
Roles can also be managed in bulk through the Datadog UI, which provides
105626+
105627+
the capability to assign a single permission to multiple roles simultaneously.'
105575105628
name: Roles
105576105629
- description: Auto-generated tag Rum Audience Management
105577105630
name: Rum Audience Management

src/main/java/com/datadog/api/client/v2/model/RoleAttributes.java

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
import com.fasterxml.jackson.annotation.JsonProperty;
1414
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
1515
import java.time.OffsetDateTime;
16+
import java.util.ArrayList;
1617
import java.util.HashMap;
18+
import java.util.List;
1719
import java.util.Map;
1820
import java.util.Objects;
1921

@@ -22,6 +24,7 @@
2224
RoleAttributes.JSON_PROPERTY_CREATED_AT,
2325
RoleAttributes.JSON_PROPERTY_MODIFIED_AT,
2426
RoleAttributes.JSON_PROPERTY_NAME,
27+
RoleAttributes.JSON_PROPERTY_RECEIVES_PERMISSIONS_FROM,
2528
RoleAttributes.JSON_PROPERTY_USER_COUNT
2629
})
2730
@jakarta.annotation.Generated(
@@ -37,6 +40,9 @@ public class RoleAttributes {
3740
public static final String JSON_PROPERTY_NAME = "name";
3841
private String name;
3942

43+
public static final String JSON_PROPERTY_RECEIVES_PERMISSIONS_FROM = "receives_permissions_from";
44+
private List<String> receivesPermissionsFrom = null;
45+
4046
public static final String JSON_PROPERTY_USER_COUNT = "user_count";
4147
private Long userCount;
4248

@@ -85,6 +91,38 @@ public void setName(String name) {
8591
this.name = name;
8692
}
8793

94+
public RoleAttributes receivesPermissionsFrom(List<String> receivesPermissionsFrom) {
95+
this.receivesPermissionsFrom = receivesPermissionsFrom;
96+
return this;
97+
}
98+
99+
public RoleAttributes addReceivesPermissionsFromItem(String receivesPermissionsFromItem) {
100+
if (this.receivesPermissionsFrom == null) {
101+
this.receivesPermissionsFrom = new ArrayList<>();
102+
}
103+
this.receivesPermissionsFrom.add(receivesPermissionsFromItem);
104+
return this;
105+
}
106+
107+
/**
108+
* The managed role from which this role automatically inherits new permissions. Specify one of
109+
* the following: "Datadog Admin Role", "Datadog Standard Role", or "Datadog Read Only Role". If
110+
* empty or not specified, the role does not automatically inherit permissions from any managed
111+
* role.
112+
*
113+
* @return receivesPermissionsFrom
114+
*/
115+
@jakarta.annotation.Nullable
116+
@JsonProperty(JSON_PROPERTY_RECEIVES_PERMISSIONS_FROM)
117+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
118+
public List<String> getReceivesPermissionsFrom() {
119+
return receivesPermissionsFrom;
120+
}
121+
122+
public void setReceivesPermissionsFrom(List<String> receivesPermissionsFrom) {
123+
this.receivesPermissionsFrom = receivesPermissionsFrom;
124+
}
125+
88126
/**
89127
* Number of users with that role.
90128
*
@@ -156,13 +194,15 @@ public boolean equals(Object o) {
156194
return Objects.equals(this.createdAt, roleAttributes.createdAt)
157195
&& Objects.equals(this.modifiedAt, roleAttributes.modifiedAt)
158196
&& Objects.equals(this.name, roleAttributes.name)
197+
&& Objects.equals(this.receivesPermissionsFrom, roleAttributes.receivesPermissionsFrom)
159198
&& Objects.equals(this.userCount, roleAttributes.userCount)
160199
&& Objects.equals(this.additionalProperties, roleAttributes.additionalProperties);
161200
}
162201

163202
@Override
164203
public int hashCode() {
165-
return Objects.hash(createdAt, modifiedAt, name, userCount, additionalProperties);
204+
return Objects.hash(
205+
createdAt, modifiedAt, name, receivesPermissionsFrom, userCount, additionalProperties);
166206
}
167207

168208
@Override
@@ -172,6 +212,9 @@ public String toString() {
172212
sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n");
173213
sb.append(" modifiedAt: ").append(toIndentedString(modifiedAt)).append("\n");
174214
sb.append(" name: ").append(toIndentedString(name)).append("\n");
215+
sb.append(" receivesPermissionsFrom: ")
216+
.append(toIndentedString(receivesPermissionsFrom))
217+
.append("\n");
175218
sb.append(" userCount: ").append(toIndentedString(userCount)).append("\n");
176219
sb.append(" additionalProperties: ")
177220
.append(toIndentedString(additionalProperties))

src/main/java/com/datadog/api/client/v2/model/RoleCloneAttributes.java

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,27 @@
1313
import com.fasterxml.jackson.annotation.JsonInclude;
1414
import com.fasterxml.jackson.annotation.JsonProperty;
1515
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
16+
import java.util.ArrayList;
1617
import java.util.HashMap;
18+
import java.util.List;
1719
import java.util.Map;
1820
import java.util.Objects;
1921

2022
/** Attributes required to create a new role by cloning an existing one. */
21-
@JsonPropertyOrder({RoleCloneAttributes.JSON_PROPERTY_NAME})
23+
@JsonPropertyOrder({
24+
RoleCloneAttributes.JSON_PROPERTY_NAME,
25+
RoleCloneAttributes.JSON_PROPERTY_RECEIVES_PERMISSIONS_FROM
26+
})
2227
@jakarta.annotation.Generated(
2328
value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
2429
public class RoleCloneAttributes {
2530
@JsonIgnore public boolean unparsed = false;
2631
public static final String JSON_PROPERTY_NAME = "name";
2732
private String name;
2833

34+
public static final String JSON_PROPERTY_RECEIVES_PERMISSIONS_FROM = "receives_permissions_from";
35+
private List<String> receivesPermissionsFrom = null;
36+
2937
public RoleCloneAttributes() {}
3038

3139
@JsonCreator
@@ -54,6 +62,38 @@ public void setName(String name) {
5462
this.name = name;
5563
}
5664

65+
public RoleCloneAttributes receivesPermissionsFrom(List<String> receivesPermissionsFrom) {
66+
this.receivesPermissionsFrom = receivesPermissionsFrom;
67+
return this;
68+
}
69+
70+
public RoleCloneAttributes addReceivesPermissionsFromItem(String receivesPermissionsFromItem) {
71+
if (this.receivesPermissionsFrom == null) {
72+
this.receivesPermissionsFrom = new ArrayList<>();
73+
}
74+
this.receivesPermissionsFrom.add(receivesPermissionsFromItem);
75+
return this;
76+
}
77+
78+
/**
79+
* The managed role from which this role automatically inherits new permissions. Specify one of
80+
* the following: "Datadog Admin Role", "Datadog Standard Role", or "Datadog Read Only Role". If
81+
* empty or not specified, the role does not automatically inherit permissions from any managed
82+
* role.
83+
*
84+
* @return receivesPermissionsFrom
85+
*/
86+
@jakarta.annotation.Nullable
87+
@JsonProperty(JSON_PROPERTY_RECEIVES_PERMISSIONS_FROM)
88+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
89+
public List<String> getReceivesPermissionsFrom() {
90+
return receivesPermissionsFrom;
91+
}
92+
93+
public void setReceivesPermissionsFrom(List<String> receivesPermissionsFrom) {
94+
this.receivesPermissionsFrom = receivesPermissionsFrom;
95+
}
96+
5797
/**
5898
* A container for additional, undeclared properties. This is a holder for any undeclared
5999
* properties as specified with the 'additionalProperties' keyword in the OAS document.
@@ -111,19 +151,23 @@ public boolean equals(Object o) {
111151
}
112152
RoleCloneAttributes roleCloneAttributes = (RoleCloneAttributes) o;
113153
return Objects.equals(this.name, roleCloneAttributes.name)
154+
&& Objects.equals(this.receivesPermissionsFrom, roleCloneAttributes.receivesPermissionsFrom)
114155
&& Objects.equals(this.additionalProperties, roleCloneAttributes.additionalProperties);
115156
}
116157

117158
@Override
118159
public int hashCode() {
119-
return Objects.hash(name, additionalProperties);
160+
return Objects.hash(name, receivesPermissionsFrom, additionalProperties);
120161
}
121162

122163
@Override
123164
public String toString() {
124165
StringBuilder sb = new StringBuilder();
125166
sb.append("class RoleCloneAttributes {\n");
126167
sb.append(" name: ").append(toIndentedString(name)).append("\n");
168+
sb.append(" receivesPermissionsFrom: ")
169+
.append(toIndentedString(receivesPermissionsFrom))
170+
.append("\n");
127171
sb.append(" additionalProperties: ")
128172
.append(toIndentedString(additionalProperties))
129173
.append("\n");

src/main/java/com/datadog/api/client/v2/model/RoleCreateAttributes.java

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,18 @@
1414
import com.fasterxml.jackson.annotation.JsonProperty;
1515
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
1616
import java.time.OffsetDateTime;
17+
import java.util.ArrayList;
1718
import java.util.HashMap;
19+
import java.util.List;
1820
import java.util.Map;
1921
import java.util.Objects;
2022

2123
/** Attributes of the created role. */
2224
@JsonPropertyOrder({
2325
RoleCreateAttributes.JSON_PROPERTY_CREATED_AT,
2426
RoleCreateAttributes.JSON_PROPERTY_MODIFIED_AT,
25-
RoleCreateAttributes.JSON_PROPERTY_NAME
27+
RoleCreateAttributes.JSON_PROPERTY_NAME,
28+
RoleCreateAttributes.JSON_PROPERTY_RECEIVES_PERMISSIONS_FROM
2629
})
2730
@jakarta.annotation.Generated(
2831
value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
@@ -37,6 +40,9 @@ public class RoleCreateAttributes {
3740
public static final String JSON_PROPERTY_NAME = "name";
3841
private String name;
3942

43+
public static final String JSON_PROPERTY_RECEIVES_PERMISSIONS_FROM = "receives_permissions_from";
44+
private List<String> receivesPermissionsFrom = null;
45+
4046
public RoleCreateAttributes() {}
4147

4248
@JsonCreator
@@ -89,6 +95,38 @@ public void setName(String name) {
8995
this.name = name;
9096
}
9197

98+
public RoleCreateAttributes receivesPermissionsFrom(List<String> receivesPermissionsFrom) {
99+
this.receivesPermissionsFrom = receivesPermissionsFrom;
100+
return this;
101+
}
102+
103+
public RoleCreateAttributes addReceivesPermissionsFromItem(String receivesPermissionsFromItem) {
104+
if (this.receivesPermissionsFrom == null) {
105+
this.receivesPermissionsFrom = new ArrayList<>();
106+
}
107+
this.receivesPermissionsFrom.add(receivesPermissionsFromItem);
108+
return this;
109+
}
110+
111+
/**
112+
* The managed role from which this role automatically inherits new permissions. Specify one of
113+
* the following: "Datadog Admin Role", "Datadog Standard Role", or "Datadog Read Only Role". If
114+
* empty or not specified, the role does not automatically inherit permissions from any managed
115+
* role.
116+
*
117+
* @return receivesPermissionsFrom
118+
*/
119+
@jakarta.annotation.Nullable
120+
@JsonProperty(JSON_PROPERTY_RECEIVES_PERMISSIONS_FROM)
121+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
122+
public List<String> getReceivesPermissionsFrom() {
123+
return receivesPermissionsFrom;
124+
}
125+
126+
public void setReceivesPermissionsFrom(List<String> receivesPermissionsFrom) {
127+
this.receivesPermissionsFrom = receivesPermissionsFrom;
128+
}
129+
92130
/**
93131
* A container for additional, undeclared properties. This is a holder for any undeclared
94132
* properties as specified with the 'additionalProperties' keyword in the OAS document.
@@ -148,12 +186,14 @@ public boolean equals(Object o) {
148186
return Objects.equals(this.createdAt, roleCreateAttributes.createdAt)
149187
&& Objects.equals(this.modifiedAt, roleCreateAttributes.modifiedAt)
150188
&& Objects.equals(this.name, roleCreateAttributes.name)
189+
&& Objects.equals(
190+
this.receivesPermissionsFrom, roleCreateAttributes.receivesPermissionsFrom)
151191
&& Objects.equals(this.additionalProperties, roleCreateAttributes.additionalProperties);
152192
}
153193

154194
@Override
155195
public int hashCode() {
156-
return Objects.hash(createdAt, modifiedAt, name, additionalProperties);
196+
return Objects.hash(createdAt, modifiedAt, name, receivesPermissionsFrom, additionalProperties);
157197
}
158198

159199
@Override
@@ -163,6 +203,9 @@ public String toString() {
163203
sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n");
164204
sb.append(" modifiedAt: ").append(toIndentedString(modifiedAt)).append("\n");
165205
sb.append(" name: ").append(toIndentedString(name)).append("\n");
206+
sb.append(" receivesPermissionsFrom: ")
207+
.append(toIndentedString(receivesPermissionsFrom))
208+
.append("\n");
166209
sb.append(" additionalProperties: ")
167210
.append(toIndentedString(additionalProperties))
168211
.append("\n");

0 commit comments

Comments
 (0)