Skip to content

Commit 21061ea

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add name_aliases field to PermissionAttributes for ListPermissions endpoint (#3566)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent f48a01d commit 21061ea

File tree

5 files changed

+47
-3
lines changed

5 files changed

+47
-3
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49128,6 +49128,11 @@ components:
4912849128
name:
4912949129
description: Name of the permission.
4913049130
type: string
49131+
name_aliases:
49132+
description: List of alias names for the permission.
49133+
items:
49134+
type: string
49135+
type: array
4913149136
restricted:
4913249137
description: Whether or not the permission is restricted.
4913349138
type: boolean

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

Lines changed: 38 additions & 0 deletions
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

@@ -25,6 +27,7 @@
2527
PermissionAttributes.JSON_PROPERTY_DISPLAY_TYPE,
2628
PermissionAttributes.JSON_PROPERTY_GROUP_NAME,
2729
PermissionAttributes.JSON_PROPERTY_NAME,
30+
PermissionAttributes.JSON_PROPERTY_NAME_ALIASES,
2831
PermissionAttributes.JSON_PROPERTY_RESTRICTED
2932
})
3033
@jakarta.annotation.Generated(
@@ -49,6 +52,9 @@ public class PermissionAttributes {
4952
public static final String JSON_PROPERTY_NAME = "name";
5053
private String name;
5154

55+
public static final String JSON_PROPERTY_NAME_ALIASES = "name_aliases";
56+
private List<String> nameAliases = null;
57+
5258
public static final String JSON_PROPERTY_RESTRICTED = "restricted";
5359
private Boolean restricted;
5460

@@ -178,6 +184,35 @@ public void setName(String name) {
178184
this.name = name;
179185
}
180186

187+
public PermissionAttributes nameAliases(List<String> nameAliases) {
188+
this.nameAliases = nameAliases;
189+
return this;
190+
}
191+
192+
public PermissionAttributes addNameAliasesItem(String nameAliasesItem) {
193+
if (this.nameAliases == null) {
194+
this.nameAliases = new ArrayList<>();
195+
}
196+
this.nameAliases.add(nameAliasesItem);
197+
return this;
198+
}
199+
200+
/**
201+
* List of alias names for the permission.
202+
*
203+
* @return nameAliases
204+
*/
205+
@jakarta.annotation.Nullable
206+
@JsonProperty(JSON_PROPERTY_NAME_ALIASES)
207+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
208+
public List<String> getNameAliases() {
209+
return nameAliases;
210+
}
211+
212+
public void setNameAliases(List<String> nameAliases) {
213+
this.nameAliases = nameAliases;
214+
}
215+
181216
public PermissionAttributes restricted(Boolean restricted) {
182217
this.restricted = restricted;
183218
return this;
@@ -261,6 +296,7 @@ public boolean equals(Object o) {
261296
&& Objects.equals(this.displayType, permissionAttributes.displayType)
262297
&& Objects.equals(this.groupName, permissionAttributes.groupName)
263298
&& Objects.equals(this.name, permissionAttributes.name)
299+
&& Objects.equals(this.nameAliases, permissionAttributes.nameAliases)
264300
&& Objects.equals(this.restricted, permissionAttributes.restricted)
265301
&& Objects.equals(this.additionalProperties, permissionAttributes.additionalProperties);
266302
}
@@ -274,6 +310,7 @@ public int hashCode() {
274310
displayType,
275311
groupName,
276312
name,
313+
nameAliases,
277314
restricted,
278315
additionalProperties);
279316
}
@@ -288,6 +325,7 @@ public String toString() {
288325
sb.append(" displayType: ").append(toIndentedString(displayType)).append("\n");
289326
sb.append(" groupName: ").append(toIndentedString(groupName)).append("\n");
290327
sb.append(" name: ").append(toIndentedString(name)).append("\n");
328+
sb.append(" nameAliases: ").append(toIndentedString(nameAliases)).append("\n");
291329
sb.append(" restricted: ").append(toIndentedString(restricted)).append("\n");
292330
sb.append(" additionalProperties: ")
293331
.append(toIndentedString(additionalProperties))
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2022-01-06T00:52:01.679Z
1+
2026-03-13T15:14:58.673Z

src/test/resources/cassettes/features/v2/List_permissions_returns_OK_response.json

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

src/test/resources/com/datadog/api/client/v2/api/roles.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ Feature: Roles
217217
And the response "data" has item with field "attributes.restricted" with value true
218218
And the response "data" has item with field "attributes.restricted" with value false
219219
And the response "data" has item with field "attributes.name" with value "admin"
220+
And the response "data" has item with field "attributes.name_aliases" with value []
220221

221222
@generated @skip @team:DataDog/aaa-core-access
222223
Scenario: List role templates returns "OK" response

0 commit comments

Comments
 (0)