Skip to content

Commit 281adea

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add name_aliases field to PermissionAttributes for ListPermissions endpoint (DataDog#3784)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 6844db6 commit 281adea

5 files changed

Lines changed: 684 additions & 178 deletions

File tree

.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

api/datadogV2/model_permission_attributes.go

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ type PermissionAttributes struct {
2424
GroupName *string `json:"group_name,omitempty"`
2525
// Name of the permission.
2626
Name *string `json:"name,omitempty"`
27+
// List of alias names for the permission.
28+
NameAliases []string `json:"name_aliases,omitempty"`
2729
// Whether or not the permission is restricted.
2830
Restricted *bool `json:"restricted,omitempty"`
2931
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
@@ -216,6 +218,34 @@ func (o *PermissionAttributes) SetName(v string) {
216218
o.Name = &v
217219
}
218220

221+
// GetNameAliases returns the NameAliases field value if set, zero value otherwise.
222+
func (o *PermissionAttributes) GetNameAliases() []string {
223+
if o == nil || o.NameAliases == nil {
224+
var ret []string
225+
return ret
226+
}
227+
return o.NameAliases
228+
}
229+
230+
// GetNameAliasesOk returns a tuple with the NameAliases field value if set, nil otherwise
231+
// and a boolean to check if the value has been set.
232+
func (o *PermissionAttributes) GetNameAliasesOk() (*[]string, bool) {
233+
if o == nil || o.NameAliases == nil {
234+
return nil, false
235+
}
236+
return &o.NameAliases, true
237+
}
238+
239+
// HasNameAliases returns a boolean if a field has been set.
240+
func (o *PermissionAttributes) HasNameAliases() bool {
241+
return o != nil && o.NameAliases != nil
242+
}
243+
244+
// SetNameAliases gets a reference to the given []string and assigns it to the NameAliases field.
245+
func (o *PermissionAttributes) SetNameAliases(v []string) {
246+
o.NameAliases = v
247+
}
248+
219249
// GetRestricted returns the Restricted field value if set, zero value otherwise.
220250
func (o *PermissionAttributes) GetRestricted() bool {
221251
if o == nil || o.Restricted == nil {
@@ -272,6 +302,9 @@ func (o PermissionAttributes) MarshalJSON() ([]byte, error) {
272302
if o.Name != nil {
273303
toSerialize["name"] = o.Name
274304
}
305+
if o.NameAliases != nil {
306+
toSerialize["name_aliases"] = o.NameAliases
307+
}
275308
if o.Restricted != nil {
276309
toSerialize["restricted"] = o.Restricted
277310
}
@@ -291,14 +324,15 @@ func (o *PermissionAttributes) UnmarshalJSON(bytes []byte) (err error) {
291324
DisplayType *string `json:"display_type,omitempty"`
292325
GroupName *string `json:"group_name,omitempty"`
293326
Name *string `json:"name,omitempty"`
327+
NameAliases []string `json:"name_aliases,omitempty"`
294328
Restricted *bool `json:"restricted,omitempty"`
295329
}{}
296330
if err = datadog.Unmarshal(bytes, &all); err != nil {
297331
return datadog.Unmarshal(bytes, &o.UnparsedObject)
298332
}
299333
additionalProperties := make(map[string]interface{})
300334
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
301-
datadog.DeleteKeys(additionalProperties, &[]string{"created", "description", "display_name", "display_type", "group_name", "name", "restricted"})
335+
datadog.DeleteKeys(additionalProperties, &[]string{"created", "description", "display_name", "display_type", "group_name", "name", "name_aliases", "restricted"})
302336
} else {
303337
return err
304338
}
@@ -308,6 +342,7 @@ func (o *PermissionAttributes) UnmarshalJSON(bytes []byte) (err error) {
308342
o.DisplayType = all.DisplayType
309343
o.GroupName = all.GroupName
310344
o.Name = all.Name
345+
o.NameAliases = all.NameAliases
311346
o.Restricted = all.Restricted
312347

313348
if len(additionalProperties) > 0 {
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

0 commit comments

Comments
 (0)