Skip to content

Commit 3518204

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Rename Tiers for Org Group Policies and Remove Include Memberships Support (#4131)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent ff79504 commit 3518204

15 files changed

Lines changed: 43 additions & 607 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 13 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,20 +1051,6 @@ components:
10511051
example: "a1b2c3d4-e5f6-7890-abcd-ef0123456789"
10521052
format: uuid
10531053
type: string
1054-
OrgGroupInclude:
1055-
description: >-
1056-
List of related resources to include.
1057-
explode: false
1058-
in: query
1059-
name: include
1060-
required: false
1061-
schema:
1062-
example:
1063-
- memberships
1064-
items:
1065-
$ref: "#/components/schemas/OrgGroupIncludeOption"
1066-
type: array
1067-
style: form
10681054
OrgGroupMembershipFilterOrgGroupId:
10691055
description: Filter memberships by org group ID. Required when `filter[org_uuid]` is not provided.
10701056
in: query
@@ -59532,22 +59518,13 @@ components:
5953259518
example: "a1b2c3d4-e5f6-7890-abcd-ef0123456789"
5953359519
format: uuid
5953459520
type: string
59535-
relationships:
59536-
$ref: "#/components/schemas/OrgGroupRelationships"
5953759521
type:
5953859522
$ref: "#/components/schemas/OrgGroupType"
5953959523
required:
5954059524
- id
5954159525
- type
5954259526
- attributes
5954359527
type: object
59544-
OrgGroupIncludeOption:
59545-
description: Allowed include options for org group endpoints.
59546-
enum:
59547-
- memberships
59548-
type: string
59549-
x-enum-varnames:
59550-
- MEMBERSHIPS
5955159528
OrgGroupListResponse:
5955259529
description: Response containing a list of org groups.
5955359530
properties:
@@ -59556,11 +59533,6 @@ components:
5955659533
items:
5955759534
$ref: "#/components/schemas/OrgGroupData"
5955859535
type: array
59559-
included:
59560-
description: Related resources included in the response when requested with the `include` parameter.
59561-
items:
59562-
$ref: "#/components/schemas/OrgGroupMembershipData"
59563-
type: array
5956459536
links:
5956559537
$ref: "#/components/schemas/OrgGroupPaginationLinks"
5956659538
meta:
@@ -59687,20 +59659,6 @@ components:
5968759659
required:
5968859660
- data
5968959661
type: object
59690-
OrgGroupMembershipRelationshipData:
59691-
description: A reference to an org group membership.
59692-
properties:
59693-
id:
59694-
description: The ID of the membership.
59695-
example: "f1e2d3c4-b5a6-7890-1234-567890abcdef"
59696-
format: uuid
59697-
type: string
59698-
type:
59699-
$ref: "#/components/schemas/OrgGroupMembershipType"
59700-
required:
59701-
- id
59702-
- type
59703-
type: object
5970459662
OrgGroupMembershipRelationships:
5970559663
description: Relationships of an org group membership.
5970659664
properties:
@@ -59771,17 +59729,6 @@ components:
5977159729
required:
5977259730
- data
5977359731
type: object
59774-
OrgGroupMembershipsRelationship:
59775-
description: Relationship to org group memberships.
59776-
properties:
59777-
data:
59778-
description: An array of membership relationship references.
59779-
items:
59780-
$ref: "#/components/schemas/OrgGroupMembershipRelationshipData"
59781-
type: array
59782-
required:
59783-
- data
59784-
type: object
5978559732
OrgGroupPaginationLinks:
5978659733
description: Pagination links for navigating between pages of an org group list response.
5978759734
properties:
@@ -60015,18 +59962,18 @@ components:
6001559962
- attributes
6001659963
type: object
6001759964
OrgGroupPolicyEnforcementTier:
60018-
default: DEFAULT
59965+
default: OVERRIDE_ALLOWED
6001959966
description: >-
60020-
The enforcement tier of the policy. `DEFAULT` means the policy is set but member orgs may mutate it. `ENFORCE` means the policy is strictly controlled and mutations are blocked for affected orgs. `DELEGATE` means each member org controls its own value.
59967+
The enforcement tier of the policy. `OVERRIDE_ALLOWED` means the policy is set but member orgs may mutate it. `GROUP_MANAGED` means the policy is strictly controlled and mutations are blocked for affected orgs. `DELEGATE` means each member org controls its own value.
6002159968
enum:
60022-
- DEFAULT
60023-
- ENFORCE
59969+
- OVERRIDE_ALLOWED
59970+
- GROUP_MANAGED
6002459971
- DELEGATE
60025-
example: DEFAULT
59972+
example: OVERRIDE_ALLOWED
6002659973
type: string
6002759974
x-enum-varnames:
60028-
- DEFAULT
60029-
- ENFORCE
59975+
- OVERRIDE_ALLOWED
59976+
- GROUP_MANAGED
6003059977
- DELEGATE
6003159978
OrgGroupPolicyListResponse:
6003259979
description: Response containing a list of org group policies.
@@ -60367,12 +60314,6 @@ components:
6036760314
- id
6036860315
- type
6036960316
type: object
60370-
OrgGroupRelationships:
60371-
description: Relationships of an org group.
60372-
properties:
60373-
memberships:
60374-
$ref: "#/components/schemas/OrgGroupMembershipsRelationship"
60375-
type: object
6037660317
OrgGroupResponse:
6037760318
description: Response containing a single org group.
6037860319
properties:
@@ -134194,7 +134135,7 @@ paths:
134194134135
- attributes:
134195134136
content:
134196134137
value: "UTC"
134197-
enforcement_tier: "DEFAULT"
134138+
enforcement_tier: "OVERRIDE_ALLOWED"
134198134139
modified_at: "2024-01-15T10:30:00Z"
134199134140
policy_name: "monitor_timezone"
134200134141
policy_type: "org_config"
@@ -134266,7 +134207,7 @@ paths:
134266134207
attributes:
134267134208
content:
134268134209
value: "UTC"
134269-
enforcement_tier: "DEFAULT"
134210+
enforcement_tier: "OVERRIDE_ALLOWED"
134270134211
policy_name: "monitor_timezone"
134271134212
policy_type: "org_config"
134272134213
relationships:
@@ -134289,7 +134230,7 @@ paths:
134289134230
attributes:
134290134231
content:
134291134232
value: "UTC"
134292-
enforcement_tier: "DEFAULT"
134233+
enforcement_tier: "OVERRIDE_ALLOWED"
134293134234
modified_at: "2024-01-15T10:30:00Z"
134294134235
policy_name: "monitor_timezone"
134295134236
policy_type: "org_config"
@@ -134398,7 +134339,7 @@ paths:
134398134339
attributes:
134399134340
content:
134400134341
value: "UTC"
134401-
enforcement_tier: "DEFAULT"
134342+
enforcement_tier: "OVERRIDE_ALLOWED"
134402134343
modified_at: "2024-01-15T10:30:00Z"
134403134344
policy_name: "monitor_timezone"
134404134345
policy_type: "org_config"
@@ -134462,7 +134403,7 @@ paths:
134462134403
attributes:
134463134404
content:
134464134405
value: "US/Eastern"
134465-
enforcement_tier: "ENFORCE"
134406+
enforcement_tier: "GROUP_MANAGED"
134466134407
id: "1a2b3c4d-5e6f-7890-abcd-ef0123456789"
134467134408
type: org_group_policies
134468134409
schema:
@@ -134479,7 +134420,7 @@ paths:
134479134420
attributes:
134480134421
content:
134481134422
value: "US/Eastern"
134482-
enforcement_tier: "ENFORCE"
134423+
enforcement_tier: "GROUP_MANAGED"
134483134424
modified_at: "2024-01-16T14:00:00Z"
134484134425
policy_name: "monitor_timezone"
134485134426
policy_type: "org_config"
@@ -134946,7 +134887,6 @@ paths:
134946134887
- $ref: "#/components/parameters/OrgGroupPageNumber"
134947134888
- $ref: "#/components/parameters/OrgGroupPageSize"
134948134889
- $ref: "#/components/parameters/OrgGroupSort"
134949-
- $ref: "#/components/parameters/OrgGroupInclude"
134950134890
responses:
134951134891
"200":
134952134892
content:

api/datadogV2/api_org_groups.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1623,7 +1623,6 @@ type ListOrgGroupsOptionalParameters struct {
16231623
PageNumber *int64
16241624
PageSize *int64
16251625
Sort *OrgGroupSortOption
1626-
Include *[]OrgGroupIncludeOption
16271626
}
16281627

16291628
// NewListOrgGroupsOptionalParameters creates an empty struct for parameters.
@@ -1650,12 +1649,6 @@ func (r *ListOrgGroupsOptionalParameters) WithSort(sort OrgGroupSortOption) *Lis
16501649
return r
16511650
}
16521651

1653-
// WithInclude sets the corresponding parameter name and returns the struct.
1654-
func (r *ListOrgGroupsOptionalParameters) WithInclude(include []OrgGroupIncludeOption) *ListOrgGroupsOptionalParameters {
1655-
r.Include = &include
1656-
return r
1657-
}
1658-
16591652
// ListOrgGroups List org groups.
16601653
// List all organization groups that the requesting organization has access to.
16611654
func (a *OrgGroupsApi) ListOrgGroups(ctx _context.Context, o ...ListOrgGroupsOptionalParameters) (OrgGroupListResponse, *_nethttp.Response, error) {
@@ -1701,9 +1694,6 @@ func (a *OrgGroupsApi) ListOrgGroups(ctx _context.Context, o ...ListOrgGroupsOpt
17011694
if optionalParams.Sort != nil {
17021695
localVarQueryParams.Add("sort", datadog.ParameterToString(*optionalParams.Sort, ""))
17031696
}
1704-
if optionalParams.Include != nil {
1705-
localVarQueryParams.Add("include", datadog.ParameterToString(*optionalParams.Include, "csv"))
1706-
}
17071697
localVarHeaderParams["Accept"] = "application/json"
17081698

17091699
if a.Client.Cfg.DelegatedTokenConfig != nil {

api/datadogV2/model_org_group_data.go

Lines changed: 4 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ type OrgGroupData struct {
1818
Attributes OrgGroupAttributes `json:"attributes"`
1919
// The ID of the org group.
2020
Id uuid.UUID `json:"id"`
21-
// Relationships of an org group.
22-
Relationships *OrgGroupRelationships `json:"relationships,omitempty"`
2321
// Org groups resource type.
2422
Type OrgGroupType `json:"type"`
2523
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
@@ -93,34 +91,6 @@ func (o *OrgGroupData) SetId(v uuid.UUID) {
9391
o.Id = v
9492
}
9593

96-
// GetRelationships returns the Relationships field value if set, zero value otherwise.
97-
func (o *OrgGroupData) GetRelationships() OrgGroupRelationships {
98-
if o == nil || o.Relationships == nil {
99-
var ret OrgGroupRelationships
100-
return ret
101-
}
102-
return *o.Relationships
103-
}
104-
105-
// GetRelationshipsOk returns a tuple with the Relationships field value if set, nil otherwise
106-
// and a boolean to check if the value has been set.
107-
func (o *OrgGroupData) GetRelationshipsOk() (*OrgGroupRelationships, bool) {
108-
if o == nil || o.Relationships == nil {
109-
return nil, false
110-
}
111-
return o.Relationships, true
112-
}
113-
114-
// HasRelationships returns a boolean if a field has been set.
115-
func (o *OrgGroupData) HasRelationships() bool {
116-
return o != nil && o.Relationships != nil
117-
}
118-
119-
// SetRelationships gets a reference to the given OrgGroupRelationships and assigns it to the Relationships field.
120-
func (o *OrgGroupData) SetRelationships(v OrgGroupRelationships) {
121-
o.Relationships = &v
122-
}
123-
12494
// GetType returns the Type field value.
12595
func (o *OrgGroupData) GetType() OrgGroupType {
12696
if o == nil {
@@ -152,9 +122,6 @@ func (o OrgGroupData) MarshalJSON() ([]byte, error) {
152122
}
153123
toSerialize["attributes"] = o.Attributes
154124
toSerialize["id"] = o.Id
155-
if o.Relationships != nil {
156-
toSerialize["relationships"] = o.Relationships
157-
}
158125
toSerialize["type"] = o.Type
159126

160127
for key, value := range o.AdditionalProperties {
@@ -166,10 +133,9 @@ func (o OrgGroupData) MarshalJSON() ([]byte, error) {
166133
// UnmarshalJSON deserializes the given payload.
167134
func (o *OrgGroupData) UnmarshalJSON(bytes []byte) (err error) {
168135
all := struct {
169-
Attributes *OrgGroupAttributes `json:"attributes"`
170-
Id *uuid.UUID `json:"id"`
171-
Relationships *OrgGroupRelationships `json:"relationships,omitempty"`
172-
Type *OrgGroupType `json:"type"`
136+
Attributes *OrgGroupAttributes `json:"attributes"`
137+
Id *uuid.UUID `json:"id"`
138+
Type *OrgGroupType `json:"type"`
173139
}{}
174140
if err = datadog.Unmarshal(bytes, &all); err != nil {
175141
return datadog.Unmarshal(bytes, &o.UnparsedObject)
@@ -185,7 +151,7 @@ func (o *OrgGroupData) UnmarshalJSON(bytes []byte) (err error) {
185151
}
186152
additionalProperties := make(map[string]interface{})
187153
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
188-
datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "id", "relationships", "type"})
154+
datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "id", "type"})
189155
} else {
190156
return err
191157
}
@@ -196,10 +162,6 @@ func (o *OrgGroupData) UnmarshalJSON(bytes []byte) (err error) {
196162
}
197163
o.Attributes = *all.Attributes
198164
o.Id = *all.Id
199-
if all.Relationships != nil && all.Relationships.UnparsedObject != nil && o.UnparsedObject == nil {
200-
hasInvalidField = true
201-
}
202-
o.Relationships = all.Relationships
203165
if !all.Type.IsValid() {
204166
hasInvalidField = true
205167
} else {

api/datadogV2/model_org_group_include_option.go

Lines changed: 0 additions & 64 deletions
This file was deleted.

0 commit comments

Comments
 (0)