From 46e72ab03146ec4d1ebea20e7b0ed6015d957b68 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Mon, 20 Apr 2026 16:54:20 +0000 Subject: [PATCH] Regenerate client from commit 9adb7dd of spec repo --- .generator/schemas/v2/openapi.yaml | 234 +++++++++++-- .../BulkUpdateOrgGroupMemberships.java | 2 +- .../v2/org-groups/CreateOrgGroupPolicy.java | 6 +- .../CreateOrgGroupPolicyOverride.java | 2 +- examples/v2/org-groups/GetOrgGroupPolicy.java | 27 ++ .../org-groups/GetOrgGroupPolicyOverride.java | 28 ++ .../v2/org-groups/UpdateOrgGroupPolicy.java | 4 +- .../UpdateOrgGroupPolicyOverride.java | 2 +- .../com/datadog/api/client/ApiClient.java | 2 + .../api/client/v2/api/OrgGroupsApi.java | 328 +++++++++++++++++- .../v2/model/OrgGroupPolicyAttributes.java | 83 ++++- .../model/OrgGroupPolicyCreateAttributes.java | 77 +++- .../v2/model/OrgGroupPolicyCreateData.java | 4 +- .../model/OrgGroupPolicyEnforcementTier.java | 65 ++++ ...rgGroupPolicyOverrideUpdateAttributes.java | 5 +- .../OrgGroupPolicyOverrideUpdateData.java | 3 +- .../v2/model/OrgGroupPolicyPolicyType.java | 59 ++++ .../model/OrgGroupPolicyUpdateAttributes.java | 41 ++- .../api/client/v2/api/org_groups.feature | 78 ++++- .../com/datadog/api/client/v2/api/undo.json | 12 + 20 files changed, 982 insertions(+), 80 deletions(-) create mode 100644 examples/v2/org-groups/GetOrgGroupPolicy.java create mode 100644 examples/v2/org-groups/GetOrgGroupPolicyOverride.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/OrgGroupPolicyEnforcementTier.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/OrgGroupPolicyPolicyType.java diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 3161aa0d719..a3a9d2372e1 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -30990,7 +30990,7 @@ components: properties: org_site: description: The site of the organization. - example: "datadoghq.com" + example: "us1" type: string org_uuid: description: The UUID of the organization. @@ -51298,7 +51298,7 @@ components: type: string owner_org_site: description: The site of the organization that owns this org group. - example: "datadoghq.com" + example: "us1" type: string owner_org_uuid: description: The UUID of the organization that owns this org group. @@ -51404,7 +51404,7 @@ components: type: string org_site: description: The site of the member organization. - example: "datadoghq.com" + example: "us1" type: string org_uuid: description: The UUID of the member organization. @@ -51625,11 +51625,8 @@ components: example: value: "UTC" type: object - enforced_at: - description: Timestamp when the policy was enforced. - example: "2024-01-15T10:30:00Z" - format: date-time - type: string + enforcement_tier: + $ref: "#/components/schemas/OrgGroupPolicyEnforcementTier" modified_at: description: Timestamp when the policy was last modified. example: "2024-01-15T10:30:00Z" @@ -51639,9 +51636,12 @@ components: description: The name of the policy. example: "monitor_timezone" type: string + policy_type: + $ref: "#/components/schemas/OrgGroupPolicyPolicyType" required: - policy_name - - enforced_at + - policy_type + - enforcement_tier - modified_at type: object OrgGroupPolicyConfigAttributes: @@ -51712,7 +51712,8 @@ components: x-enum-varnames: - ORG_GROUP_POLICY_CONFIGS OrgGroupPolicyCreateAttributes: - description: Attributes for creating an org group policy. + description: >- + Attributes for creating an org group policy. If `policy_type` or `enforcement_tier` are not provided, they default to `org_config` and `DEFAULT` respectively. properties: content: additionalProperties: {} @@ -51720,10 +51721,14 @@ components: example: value: "UTC" type: object + enforcement_tier: + $ref: "#/components/schemas/OrgGroupPolicyEnforcementTier" policy_name: description: The name of the policy. example: "monitor_timezone" type: string + policy_type: + $ref: "#/components/schemas/OrgGroupPolicyPolicyType" required: - policy_name - content @@ -51777,6 +51782,20 @@ components: - type - attributes type: object + OrgGroupPolicyEnforcementTier: + default: DEFAULT + description: >- + 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. + enum: + - DEFAULT + - ENFORCE + - DELEGATE + example: DEFAULT + type: string + x-enum-varnames: + - DEFAULT + - ENFORCE + - DELEGATE OrgGroupPolicyListResponse: description: Response containing a list of org group policies. properties: @@ -51809,7 +51828,7 @@ components: type: string org_site: description: The site of the organization that has the override. - example: "datadoghq.com" + example: "us1" type: string org_uuid: description: The UUID of the organization that has the override. @@ -51827,7 +51846,7 @@ components: properties: org_site: description: The site of the organization. - example: "datadoghq.com" + example: "us1" type: string org_uuid: description: The UUID of the organization to grant the override. @@ -51943,11 +51962,12 @@ components: x-enum-varnames: - ORG_GROUP_POLICY_OVERRIDES OrgGroupPolicyOverrideUpdateAttributes: - description: Attributes for updating a policy override. + description: >- + Attributes for updating a policy override. The `org_uuid` and `org_site` fields must match the existing override and cannot be changed. properties: org_site: description: The site of the organization. - example: "datadoghq.com" + example: "us1" type: string org_uuid: description: The UUID of the organization. @@ -51983,6 +52003,16 @@ components: required: - data type: object + OrgGroupPolicyPolicyType: + default: org_config + description: >- + The type of the policy. Only `org_config` is supported, indicating a policy backed by an organization configuration setting. + enum: + - org_config + example: org_config + type: string + x-enum-varnames: + - ORG_CONFIG OrgGroupPolicyRelationshipToOne: description: Relationship to a single org group policy. properties: @@ -52051,6 +52081,8 @@ components: example: value: "UTC" type: object + enforcement_tier: + $ref: "#/components/schemas/OrgGroupPolicyEnforcementTier" type: object OrgGroupPolicyUpdateData: description: Data for updating an org group policy. @@ -108127,7 +108159,7 @@ paths: created_at: "2024-01-15T10:30:00Z" modified_at: "2024-01-15T10:30:00Z" org_name: "Acme Corp" - org_site: "datadoghq.com" + org_site: "us1" org_uuid: "c3d4e5f6-a7b8-9012-cdef-012345678901" id: "f1e2d3c4-b5a6-7890-1234-567890abcdef" relationships: @@ -108185,7 +108217,7 @@ paths: data: attributes: orgs: - - org_site: "datadoghq.com" + - org_site: "us1" org_uuid: "c3d4e5f6-a7b8-9012-cdef-012345678901" relationships: source_org_group: @@ -108212,7 +108244,7 @@ paths: created_at: "2024-01-15T10:30:00Z" modified_at: "2024-01-16T14:00:00Z" org_name: "Acme Corp" - org_site: "datadoghq.com" + org_site: "us1" org_uuid: "c3d4e5f6-a7b8-9012-cdef-012345678901" id: "f1e2d3c4-b5a6-7890-1234-567890abcdef" relationships: @@ -108277,7 +108309,7 @@ paths: created_at: "2024-01-15T10:30:00Z" modified_at: "2024-01-15T10:30:00Z" org_name: "Acme Corp" - org_site: "datadoghq.com" + org_site: "us1" org_uuid: "c3d4e5f6-a7b8-9012-cdef-012345678901" id: "f1e2d3c4-b5a6-7890-1234-567890abcdef" relationships: @@ -108358,7 +108390,7 @@ paths: created_at: "2024-01-15T10:30:00Z" modified_at: "2024-01-16T14:00:00Z" org_name: "Acme Corp" - org_site: "datadoghq.com" + org_site: "us1" org_uuid: "c3d4e5f6-a7b8-9012-cdef-012345678901" id: "f1e2d3c4-b5a6-7890-1234-567890abcdef" relationships: @@ -108426,9 +108458,10 @@ paths: - attributes: content: value: "UTC" - enforced_at: "2024-01-15T10:30:00Z" + enforcement_tier: "DEFAULT" modified_at: "2024-01-15T10:30:00Z" policy_name: "monitor_timezone" + policy_type: "org_config" id: "1a2b3c4d-5e6f-7890-abcd-ef0123456789" relationships: org_group: @@ -108484,7 +108517,9 @@ paths: attributes: content: value: "UTC" + enforcement_tier: "DEFAULT" policy_name: "monitor_timezone" + policy_type: "org_config" relationships: org_group: data: @@ -108505,9 +108540,10 @@ paths: attributes: content: value: "UTC" - enforced_at: "2024-01-15T10:30:00Z" + enforcement_tier: "DEFAULT" modified_at: "2024-01-15T10:30:00Z" policy_name: "monitor_timezone" + policy_type: "org_config" id: "1a2b3c4d-5e6f-7890-abcd-ef0123456789" relationships: org_group: @@ -108597,8 +108633,73 @@ paths: x-unstable: |- **Note**: This endpoint is in preview and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + get: + description: Get a specific organization group policy by its ID. + operationId: GetOrgGroupPolicy + parameters: + - $ref: "#/components/parameters/OrgGroupPolicyId" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + content: + value: "UTC" + enforcement_tier: "DEFAULT" + modified_at: "2024-01-15T10:30:00Z" + policy_name: "monitor_timezone" + policy_type: "org_config" + id: "1a2b3c4d-5e6f-7890-abcd-ef0123456789" + relationships: + org_group: + data: + id: "a1b2c3d4-e5f6-7890-abcd-ef0123456789" + type: org_groups + type: org_group_policies + schema: + $ref: "#/components/schemas/OrgGroupPolicyResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Get an org group policy + tags: [Org Groups] + "x-permission": + operator: OR + permissions: + - org_group_read + x-unstable: |- + **Note**: This endpoint is in Preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). patch: - description: Update the content of an existing organization group policy. + description: Update an existing organization group policy. operationId: UpdateOrgGroupPolicy parameters: - $ref: "#/components/parameters/OrgGroupPolicyId" @@ -108612,6 +108713,7 @@ paths: attributes: content: value: "US/Eastern" + enforcement_tier: "ENFORCE" id: "1a2b3c4d-5e6f-7890-abcd-ef0123456789" type: org_group_policies schema: @@ -108628,9 +108730,10 @@ paths: attributes: content: value: "US/Eastern" - enforced_at: "2024-01-15T10:30:00Z" + enforcement_tier: "ENFORCE" modified_at: "2024-01-16T14:00:00Z" policy_name: "monitor_timezone" + policy_type: "org_config" id: "1a2b3c4d-5e6f-7890-abcd-ef0123456789" relationships: org_group: @@ -108744,7 +108847,7 @@ paths: - attributes: created_at: "2024-01-15T10:30:00Z" modified_at: "2024-01-15T10:30:00Z" - org_site: "datadoghq.com" + org_site: "us1" org_uuid: "c3d4e5f6-a7b8-9012-cdef-012345678901" id: "9f8e7d6c-5b4a-3210-fedc-ba0987654321" relationships: @@ -108803,7 +108906,7 @@ paths: value: data: attributes: - org_site: "datadoghq.com" + org_site: "us1" org_uuid: "c3d4e5f6-a7b8-9012-cdef-012345678901" relationships: org_group: @@ -108829,7 +108932,7 @@ paths: attributes: created_at: "2024-01-15T10:30:00Z" modified_at: "2024-01-15T10:30:00Z" - org_site: "datadoghq.com" + org_site: "us1" org_uuid: "c3d4e5f6-a7b8-9012-cdef-012345678901" id: "9f8e7d6c-5b4a-3210-fedc-ba0987654321" relationships: @@ -108924,6 +109027,73 @@ paths: x-unstable: |- **Note**: This endpoint is in preview and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + get: + description: Get a specific organization group policy override by its ID. + operationId: GetOrgGroupPolicyOverride + parameters: + - $ref: "#/components/parameters/OrgGroupPolicyOverrideId" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + created_at: "2024-01-15T10:30:00Z" + modified_at: "2024-01-15T10:30:00Z" + org_site: "us1" + org_uuid: "c3d4e5f6-a7b8-9012-cdef-012345678901" + id: "9f8e7d6c-5b4a-3210-fedc-ba0987654321" + relationships: + org_group: + data: + id: "a1b2c3d4-e5f6-7890-abcd-ef0123456789" + type: org_groups + org_group_policy: + data: + id: "1a2b3c4d-5e6f-7890-abcd-ef0123456789" + type: org_group_policies + type: org_group_policy_overrides + schema: + $ref: "#/components/schemas/OrgGroupPolicyOverrideResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Get an org group policy override + tags: [Org Groups] + "x-permission": + operator: OR + permissions: + - org_group_read + x-unstable: |- + **Note**: This endpoint is in Preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). patch: description: Update an existing organization group policy override. operationId: UpdateOrgGroupPolicyOverride @@ -108937,7 +109107,7 @@ paths: value: data: attributes: - org_site: "datadoghq.com" + org_site: "us1" org_uuid: "c3d4e5f6-a7b8-9012-cdef-012345678901" id: "9f8e7d6c-5b4a-3210-fedc-ba0987654321" type: org_group_policy_overrides @@ -108955,7 +109125,7 @@ paths: attributes: created_at: "2024-01-15T10:30:00Z" modified_at: "2024-01-16T14:00:00Z" - org_site: "datadoghq.com" + org_site: "us1" org_uuid: "c3d4e5f6-a7b8-9012-cdef-012345678901" id: "9f8e7d6c-5b4a-3210-fedc-ba0987654321" relationships: @@ -109027,7 +109197,7 @@ paths: created_at: "2024-01-15T10:30:00Z" modified_at: "2024-01-15T10:30:00Z" name: "My Org Group" - owner_org_site: "datadoghq.com" + owner_org_site: "us1" owner_org_uuid: "b2c3d4e5-f6a7-8901-bcde-f01234567890" id: "a1b2c3d4-e5f6-7890-abcd-ef0123456789" type: org_groups @@ -109094,7 +109264,7 @@ paths: created_at: "2024-01-15T10:30:00Z" modified_at: "2024-01-15T10:30:00Z" name: "My Org Group" - owner_org_site: "datadoghq.com" + owner_org_site: "us1" owner_org_uuid: "b2c3d4e5-f6a7-8901-bcde-f01234567890" id: "a1b2c3d4-e5f6-7890-abcd-ef0123456789" type: org_groups @@ -109197,7 +109367,7 @@ paths: created_at: "2024-01-15T10:30:00Z" modified_at: "2024-01-15T10:30:00Z" name: "My Org Group" - owner_org_site: "datadoghq.com" + owner_org_site: "us1" owner_org_uuid: "b2c3d4e5-f6a7-8901-bcde-f01234567890" id: "a1b2c3d4-e5f6-7890-abcd-ef0123456789" type: org_groups @@ -109270,7 +109440,7 @@ paths: created_at: "2024-01-15T10:30:00Z" modified_at: "2024-01-16T14:00:00Z" name: "Updated Org Group Name" - owner_org_site: "datadoghq.com" + owner_org_site: "us1" owner_org_uuid: "b2c3d4e5-f6a7-8901-bcde-f01234567890" id: "a1b2c3d4-e5f6-7890-abcd-ef0123456789" type: org_groups diff --git a/examples/v2/org-groups/BulkUpdateOrgGroupMemberships.java b/examples/v2/org-groups/BulkUpdateOrgGroupMemberships.java index 2fe8696448f..7f873ad5dc0 100644 --- a/examples/v2/org-groups/BulkUpdateOrgGroupMemberships.java +++ b/examples/v2/org-groups/BulkUpdateOrgGroupMemberships.java @@ -31,7 +31,7 @@ public static void main(String[] args) { .orgs( Collections.singletonList( new GlobalOrgIdentifier() - .orgSite("datadoghq.com") + .orgSite("us1") .orgUuid( UUID.fromString( "c3d4e5f6-a7b8-9012-cdef-012345678901"))))) diff --git a/examples/v2/org-groups/CreateOrgGroupPolicy.java b/examples/v2/org-groups/CreateOrgGroupPolicy.java index 2550c0b516a..2520e6e84e7 100644 --- a/examples/v2/org-groups/CreateOrgGroupPolicy.java +++ b/examples/v2/org-groups/CreateOrgGroupPolicy.java @@ -7,6 +7,8 @@ import com.datadog.api.client.v2.model.OrgGroupPolicyCreateData; import com.datadog.api.client.v2.model.OrgGroupPolicyCreateRelationships; import com.datadog.api.client.v2.model.OrgGroupPolicyCreateRequest; +import com.datadog.api.client.v2.model.OrgGroupPolicyEnforcementTier; +import com.datadog.api.client.v2.model.OrgGroupPolicyPolicyType; import com.datadog.api.client.v2.model.OrgGroupPolicyResponse; import com.datadog.api.client.v2.model.OrgGroupPolicyType; import com.datadog.api.client.v2.model.OrgGroupRelationshipToOne; @@ -28,7 +30,9 @@ public static void main(String[] args) { .attributes( new OrgGroupPolicyCreateAttributes() .content(Map.ofEntries(Map.entry("value", "UTC"))) - .policyName("monitor_timezone")) + .enforcementTier(OrgGroupPolicyEnforcementTier.DEFAULT) + .policyName("monitor_timezone") + .policyType(OrgGroupPolicyPolicyType.ORG_CONFIG)) .relationships( new OrgGroupPolicyCreateRelationships() .orgGroup( diff --git a/examples/v2/org-groups/CreateOrgGroupPolicyOverride.java b/examples/v2/org-groups/CreateOrgGroupPolicyOverride.java index 7feb4026590..10ffeedc2dd 100644 --- a/examples/v2/org-groups/CreateOrgGroupPolicyOverride.java +++ b/examples/v2/org-groups/CreateOrgGroupPolicyOverride.java @@ -29,7 +29,7 @@ public static void main(String[] args) { new OrgGroupPolicyOverrideCreateData() .attributes( new OrgGroupPolicyOverrideCreateAttributes() - .orgSite("datadoghq.com") + .orgSite("us1") .orgUuid(UUID.fromString("c3d4e5f6-a7b8-9012-cdef-012345678901"))) .relationships( new OrgGroupPolicyOverrideCreateRelationships() diff --git a/examples/v2/org-groups/GetOrgGroupPolicy.java b/examples/v2/org-groups/GetOrgGroupPolicy.java new file mode 100644 index 00000000000..5c405fc2f6c --- /dev/null +++ b/examples/v2/org-groups/GetOrgGroupPolicy.java @@ -0,0 +1,27 @@ +// Get an org group policy returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.OrgGroupsApi; +import com.datadog.api.client.v2.model.OrgGroupPolicyResponse; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.getOrgGroupPolicy", true); + OrgGroupsApi apiInstance = new OrgGroupsApi(defaultClient); + + try { + OrgGroupPolicyResponse result = + apiInstance.getOrgGroupPolicy(UUID.fromString("1a2b3c4d-5e6f-7890-abcd-ef0123456789")); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling OrgGroupsApi#getOrgGroupPolicy"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/org-groups/GetOrgGroupPolicyOverride.java b/examples/v2/org-groups/GetOrgGroupPolicyOverride.java new file mode 100644 index 00000000000..6989093b49e --- /dev/null +++ b/examples/v2/org-groups/GetOrgGroupPolicyOverride.java @@ -0,0 +1,28 @@ +// Get an org group policy override returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.OrgGroupsApi; +import com.datadog.api.client.v2.model.OrgGroupPolicyOverrideResponse; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.getOrgGroupPolicyOverride", true); + OrgGroupsApi apiInstance = new OrgGroupsApi(defaultClient); + + try { + OrgGroupPolicyOverrideResponse result = + apiInstance.getOrgGroupPolicyOverride( + UUID.fromString("9f8e7d6c-5b4a-3210-fedc-ba0987654321")); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling OrgGroupsApi#getOrgGroupPolicyOverride"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/org-groups/UpdateOrgGroupPolicy.java b/examples/v2/org-groups/UpdateOrgGroupPolicy.java index a21e4b34543..e71c05b963e 100644 --- a/examples/v2/org-groups/UpdateOrgGroupPolicy.java +++ b/examples/v2/org-groups/UpdateOrgGroupPolicy.java @@ -3,6 +3,7 @@ import com.datadog.api.client.ApiClient; import com.datadog.api.client.ApiException; import com.datadog.api.client.v2.api.OrgGroupsApi; +import com.datadog.api.client.v2.model.OrgGroupPolicyEnforcementTier; import com.datadog.api.client.v2.model.OrgGroupPolicyResponse; import com.datadog.api.client.v2.model.OrgGroupPolicyType; import com.datadog.api.client.v2.model.OrgGroupPolicyUpdateAttributes; @@ -23,7 +24,8 @@ public static void main(String[] args) { new OrgGroupPolicyUpdateData() .attributes( new OrgGroupPolicyUpdateAttributes() - .content(Map.ofEntries(Map.entry("value", "UTC")))) + .content(Map.ofEntries(Map.entry("value", "UTC"))) + .enforcementTier(OrgGroupPolicyEnforcementTier.DEFAULT)) .id(UUID.fromString("1a2b3c4d-5e6f-7890-abcd-ef0123456789")) .type(OrgGroupPolicyType.ORG_GROUP_POLICIES)); diff --git a/examples/v2/org-groups/UpdateOrgGroupPolicyOverride.java b/examples/v2/org-groups/UpdateOrgGroupPolicyOverride.java index 1f553b641e5..1b29b6ff01a 100644 --- a/examples/v2/org-groups/UpdateOrgGroupPolicyOverride.java +++ b/examples/v2/org-groups/UpdateOrgGroupPolicyOverride.java @@ -22,7 +22,7 @@ public static void main(String[] args) { new OrgGroupPolicyOverrideUpdateData() .attributes( new OrgGroupPolicyOverrideUpdateAttributes() - .orgSite("datadoghq.com") + .orgSite("us1") .orgUuid(UUID.fromString("c3d4e5f6-a7b8-9012-cdef-012345678901"))) .id(UUID.fromString("9f8e7d6c-5b4a-3210-fedc-ba0987654321")) .type(OrgGroupPolicyOverrideType.ORG_GROUP_POLICY_OVERRIDES)); diff --git a/src/main/java/com/datadog/api/client/ApiClient.java b/src/main/java/com/datadog/api/client/ApiClient.java index 661be57e8db..d903d232150 100644 --- a/src/main/java/com/datadog/api/client/ApiClient.java +++ b/src/main/java/com/datadog/api/client/ApiClient.java @@ -975,6 +975,8 @@ public class ApiClient { put("v2.deleteOrgGroupPolicyOverride", false); put("v2.getOrgGroup", false); put("v2.getOrgGroupMembership", false); + put("v2.getOrgGroupPolicy", false); + put("v2.getOrgGroupPolicyOverride", false); put("v2.listOrgGroupMemberships", false); put("v2.listOrgGroupPolicies", false); put("v2.listOrgGroupPolicyConfigs", false); diff --git a/src/main/java/com/datadog/api/client/v2/api/OrgGroupsApi.java b/src/main/java/com/datadog/api/client/v2/api/OrgGroupsApi.java index f834931d079..3c0f5b30a56 100644 --- a/src/main/java/com/datadog/api/client/v2/api/OrgGroupsApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/OrgGroupsApi.java @@ -1475,6 +1475,332 @@ public ApiResponse getOrgGroupMembershipWithHttpInfo new GenericType() {}); } + /** + * Get an org group policy. + * + *

See {@link #getOrgGroupPolicyWithHttpInfo}. + * + * @param orgGroupPolicyId The ID of the org group policy. (required) + * @return OrgGroupPolicyResponse + * @throws ApiException if fails to make API call + */ + public OrgGroupPolicyResponse getOrgGroupPolicy(UUID orgGroupPolicyId) throws ApiException { + return getOrgGroupPolicyWithHttpInfo(orgGroupPolicyId).getData(); + } + + /** + * Get an org group policy. + * + *

See {@link #getOrgGroupPolicyWithHttpInfoAsync}. + * + * @param orgGroupPolicyId The ID of the org group policy. (required) + * @return CompletableFuture<OrgGroupPolicyResponse> + */ + public CompletableFuture getOrgGroupPolicyAsync(UUID orgGroupPolicyId) { + return getOrgGroupPolicyWithHttpInfoAsync(orgGroupPolicyId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get a specific organization group policy by its ID. + * + * @param orgGroupPolicyId The ID of the org group policy. (required) + * @return ApiResponse<OrgGroupPolicyResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse getOrgGroupPolicyWithHttpInfo(UUID orgGroupPolicyId) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "getOrgGroupPolicy"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'orgGroupPolicyId' is set + if (orgGroupPolicyId == null) { + throw new ApiException( + 400, "Missing the required parameter 'orgGroupPolicyId' when calling getOrgGroupPolicy"); + } + // create path and map variables + String localVarPath = + "/api/v2/org_group_policies/{org_group_policy_id}" + .replaceAll( + "\\{" + "org_group_policy_id" + "\\}", + apiClient.escapeString(orgGroupPolicyId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.OrgGroupsApi.getOrgGroupPolicy", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get an org group policy. + * + *

See {@link #getOrgGroupPolicyWithHttpInfo}. + * + * @param orgGroupPolicyId The ID of the org group policy. (required) + * @return CompletableFuture<ApiResponse<OrgGroupPolicyResponse>> + */ + public CompletableFuture> getOrgGroupPolicyWithHttpInfoAsync( + UUID orgGroupPolicyId) { + // Check if unstable operation is enabled + String operationId = "getOrgGroupPolicy"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'orgGroupPolicyId' is set + if (orgGroupPolicyId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'orgGroupPolicyId' when calling getOrgGroupPolicy")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/org_group_policies/{org_group_policy_id}" + .replaceAll( + "\\{" + "org_group_policy_id" + "\\}", + apiClient.escapeString(orgGroupPolicyId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.OrgGroupsApi.getOrgGroupPolicy", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get an org group policy override. + * + *

See {@link #getOrgGroupPolicyOverrideWithHttpInfo}. + * + * @param orgGroupPolicyOverrideId The ID of the org group policy override. (required) + * @return OrgGroupPolicyOverrideResponse + * @throws ApiException if fails to make API call + */ + public OrgGroupPolicyOverrideResponse getOrgGroupPolicyOverride(UUID orgGroupPolicyOverrideId) + throws ApiException { + return getOrgGroupPolicyOverrideWithHttpInfo(orgGroupPolicyOverrideId).getData(); + } + + /** + * Get an org group policy override. + * + *

See {@link #getOrgGroupPolicyOverrideWithHttpInfoAsync}. + * + * @param orgGroupPolicyOverrideId The ID of the org group policy override. (required) + * @return CompletableFuture<OrgGroupPolicyOverrideResponse> + */ + public CompletableFuture getOrgGroupPolicyOverrideAsync( + UUID orgGroupPolicyOverrideId) { + return getOrgGroupPolicyOverrideWithHttpInfoAsync(orgGroupPolicyOverrideId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get a specific organization group policy override by its ID. + * + * @param orgGroupPolicyOverrideId The ID of the org group policy override. (required) + * @return ApiResponse<OrgGroupPolicyOverrideResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse getOrgGroupPolicyOverrideWithHttpInfo( + UUID orgGroupPolicyOverrideId) throws ApiException { + // Check if unstable operation is enabled + String operationId = "getOrgGroupPolicyOverride"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'orgGroupPolicyOverrideId' is set + if (orgGroupPolicyOverrideId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'orgGroupPolicyOverrideId' when calling" + + " getOrgGroupPolicyOverride"); + } + // create path and map variables + String localVarPath = + "/api/v2/org_group_policy_overrides/{org_group_policy_override_id}" + .replaceAll( + "\\{" + "org_group_policy_override_id" + "\\}", + apiClient.escapeString(orgGroupPolicyOverrideId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.OrgGroupsApi.getOrgGroupPolicyOverride", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get an org group policy override. + * + *

See {@link #getOrgGroupPolicyOverrideWithHttpInfo}. + * + * @param orgGroupPolicyOverrideId The ID of the org group policy override. (required) + * @return CompletableFuture<ApiResponse<OrgGroupPolicyOverrideResponse>> + */ + public CompletableFuture> + getOrgGroupPolicyOverrideWithHttpInfoAsync(UUID orgGroupPolicyOverrideId) { + // Check if unstable operation is enabled + String operationId = "getOrgGroupPolicyOverride"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'orgGroupPolicyOverrideId' is set + if (orgGroupPolicyOverrideId == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'orgGroupPolicyOverrideId' when calling" + + " getOrgGroupPolicyOverride")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/org_group_policy_overrides/{org_group_policy_override_id}" + .replaceAll( + "\\{" + "org_group_policy_override_id" + "\\}", + apiClient.escapeString(orgGroupPolicyOverrideId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.OrgGroupsApi.getOrgGroupPolicyOverride", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + /** Manage optional parameters to listOrgGroupMemberships. */ public static class ListOrgGroupMembershipsOptionalParameters { private UUID filterOrgGroupId; @@ -3054,7 +3380,7 @@ public CompletableFuture updateOrgGroupPolicyAsync( } /** - * Update the content of an existing organization group policy. + * Update an existing organization group policy. * * @param orgGroupPolicyId The ID of the org group policy. (required) * @param body (required) diff --git a/src/main/java/com/datadog/api/client/v2/model/OrgGroupPolicyAttributes.java b/src/main/java/com/datadog/api/client/v2/model/OrgGroupPolicyAttributes.java index cc19fe78892..82362a36e5e 100644 --- a/src/main/java/com/datadog/api/client/v2/model/OrgGroupPolicyAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/OrgGroupPolicyAttributes.java @@ -21,9 +21,10 @@ /** Attributes of an org group policy. */ @JsonPropertyOrder({ OrgGroupPolicyAttributes.JSON_PROPERTY_CONTENT, - OrgGroupPolicyAttributes.JSON_PROPERTY_ENFORCED_AT, + OrgGroupPolicyAttributes.JSON_PROPERTY_ENFORCEMENT_TIER, OrgGroupPolicyAttributes.JSON_PROPERTY_MODIFIED_AT, - OrgGroupPolicyAttributes.JSON_PROPERTY_POLICY_NAME + OrgGroupPolicyAttributes.JSON_PROPERTY_POLICY_NAME, + OrgGroupPolicyAttributes.JSON_PROPERTY_POLICY_TYPE }) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") @@ -32,8 +33,8 @@ public class OrgGroupPolicyAttributes { public static final String JSON_PROPERTY_CONTENT = "content"; private Map content = null; - public static final String JSON_PROPERTY_ENFORCED_AT = "enforced_at"; - private OffsetDateTime enforcedAt; + public static final String JSON_PROPERTY_ENFORCEMENT_TIER = "enforcement_tier"; + private OrgGroupPolicyEnforcementTier enforcementTier = OrgGroupPolicyEnforcementTier.DEFAULT; public static final String JSON_PROPERTY_MODIFIED_AT = "modified_at"; private OffsetDateTime modifiedAt; @@ -41,16 +42,25 @@ public class OrgGroupPolicyAttributes { public static final String JSON_PROPERTY_POLICY_NAME = "policy_name"; private String policyName; + public static final String JSON_PROPERTY_POLICY_TYPE = "policy_type"; + private OrgGroupPolicyPolicyType policyType = OrgGroupPolicyPolicyType.ORG_CONFIG; + public OrgGroupPolicyAttributes() {} @JsonCreator public OrgGroupPolicyAttributes( - @JsonProperty(required = true, value = JSON_PROPERTY_ENFORCED_AT) OffsetDateTime enforcedAt, + @JsonProperty(required = true, value = JSON_PROPERTY_ENFORCEMENT_TIER) + OrgGroupPolicyEnforcementTier enforcementTier, @JsonProperty(required = true, value = JSON_PROPERTY_MODIFIED_AT) OffsetDateTime modifiedAt, - @JsonProperty(required = true, value = JSON_PROPERTY_POLICY_NAME) String policyName) { - this.enforcedAt = enforcedAt; + @JsonProperty(required = true, value = JSON_PROPERTY_POLICY_NAME) String policyName, + @JsonProperty(required = true, value = JSON_PROPERTY_POLICY_TYPE) + OrgGroupPolicyPolicyType policyType) { + this.enforcementTier = enforcementTier; + this.unparsed |= !enforcementTier.isValid(); this.modifiedAt = modifiedAt; this.policyName = policyName; + this.policyType = policyType; + this.unparsed |= !policyType.isValid(); } public OrgGroupPolicyAttributes content(Map content) { @@ -82,24 +92,31 @@ public void setContent(Map content) { this.content = content; } - public OrgGroupPolicyAttributes enforcedAt(OffsetDateTime enforcedAt) { - this.enforcedAt = enforcedAt; + public OrgGroupPolicyAttributes enforcementTier(OrgGroupPolicyEnforcementTier enforcementTier) { + this.enforcementTier = enforcementTier; + this.unparsed |= !enforcementTier.isValid(); return this; } /** - * Timestamp when the policy was enforced. + * 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. * - * @return enforcedAt + * @return enforcementTier */ - @JsonProperty(JSON_PROPERTY_ENFORCED_AT) + @JsonProperty(JSON_PROPERTY_ENFORCEMENT_TIER) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public OffsetDateTime getEnforcedAt() { - return enforcedAt; + public OrgGroupPolicyEnforcementTier getEnforcementTier() { + return enforcementTier; } - public void setEnforcedAt(OffsetDateTime enforcedAt) { - this.enforcedAt = enforcedAt; + public void setEnforcementTier(OrgGroupPolicyEnforcementTier enforcementTier) { + if (!enforcementTier.isValid()) { + this.unparsed = true; + } + this.enforcementTier = enforcementTier; } public OrgGroupPolicyAttributes modifiedAt(OffsetDateTime modifiedAt) { @@ -142,6 +159,31 @@ public void setPolicyName(String policyName) { this.policyName = policyName; } + public OrgGroupPolicyAttributes policyType(OrgGroupPolicyPolicyType policyType) { + this.policyType = policyType; + this.unparsed |= !policyType.isValid(); + return this; + } + + /** + * The type of the policy. Only org_config is supported, indicating a policy backed + * by an organization configuration setting. + * + * @return policyType + */ + @JsonProperty(JSON_PROPERTY_POLICY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OrgGroupPolicyPolicyType getPolicyType() { + return policyType; + } + + public void setPolicyType(OrgGroupPolicyPolicyType policyType) { + if (!policyType.isValid()) { + this.unparsed = true; + } + this.policyType = policyType; + } + /** * A container for additional, undeclared properties. This is a holder for any undeclared * properties as specified with the 'additionalProperties' keyword in the OAS document. @@ -199,15 +241,17 @@ public boolean equals(Object o) { } OrgGroupPolicyAttributes orgGroupPolicyAttributes = (OrgGroupPolicyAttributes) o; return Objects.equals(this.content, orgGroupPolicyAttributes.content) - && Objects.equals(this.enforcedAt, orgGroupPolicyAttributes.enforcedAt) + && Objects.equals(this.enforcementTier, orgGroupPolicyAttributes.enforcementTier) && Objects.equals(this.modifiedAt, orgGroupPolicyAttributes.modifiedAt) && Objects.equals(this.policyName, orgGroupPolicyAttributes.policyName) + && Objects.equals(this.policyType, orgGroupPolicyAttributes.policyType) && Objects.equals(this.additionalProperties, orgGroupPolicyAttributes.additionalProperties); } @Override public int hashCode() { - return Objects.hash(content, enforcedAt, modifiedAt, policyName, additionalProperties); + return Objects.hash( + content, enforcementTier, modifiedAt, policyName, policyType, additionalProperties); } @Override @@ -215,9 +259,10 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class OrgGroupPolicyAttributes {\n"); sb.append(" content: ").append(toIndentedString(content)).append("\n"); - sb.append(" enforcedAt: ").append(toIndentedString(enforcedAt)).append("\n"); + sb.append(" enforcementTier: ").append(toIndentedString(enforcementTier)).append("\n"); sb.append(" modifiedAt: ").append(toIndentedString(modifiedAt)).append("\n"); sb.append(" policyName: ").append(toIndentedString(policyName)).append("\n"); + sb.append(" policyType: ").append(toIndentedString(policyType)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); diff --git a/src/main/java/com/datadog/api/client/v2/model/OrgGroupPolicyCreateAttributes.java b/src/main/java/com/datadog/api/client/v2/model/OrgGroupPolicyCreateAttributes.java index 0be94b1f43d..9e541d95040 100644 --- a/src/main/java/com/datadog/api/client/v2/model/OrgGroupPolicyCreateAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/OrgGroupPolicyCreateAttributes.java @@ -17,10 +17,16 @@ import java.util.Map; import java.util.Objects; -/** Attributes for creating an org group policy. */ +/** + * Attributes for creating an org group policy. If policy_type or + * enforcement_tier are not provided, they default to org_config and + * DEFAULT respectively. + */ @JsonPropertyOrder({ OrgGroupPolicyCreateAttributes.JSON_PROPERTY_CONTENT, - OrgGroupPolicyCreateAttributes.JSON_PROPERTY_POLICY_NAME + OrgGroupPolicyCreateAttributes.JSON_PROPERTY_ENFORCEMENT_TIER, + OrgGroupPolicyCreateAttributes.JSON_PROPERTY_POLICY_NAME, + OrgGroupPolicyCreateAttributes.JSON_PROPERTY_POLICY_TYPE }) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") @@ -29,9 +35,15 @@ public class OrgGroupPolicyCreateAttributes { public static final String JSON_PROPERTY_CONTENT = "content"; private Map content = new HashMap(); + public static final String JSON_PROPERTY_ENFORCEMENT_TIER = "enforcement_tier"; + private OrgGroupPolicyEnforcementTier enforcementTier = OrgGroupPolicyEnforcementTier.DEFAULT; + public static final String JSON_PROPERTY_POLICY_NAME = "policy_name"; private String policyName; + public static final String JSON_PROPERTY_POLICY_TYPE = "policy_type"; + private OrgGroupPolicyPolicyType policyType = OrgGroupPolicyPolicyType.ORG_CONFIG; + public OrgGroupPolicyCreateAttributes() {} @JsonCreator @@ -67,6 +79,35 @@ public void setContent(Map content) { this.content = content; } + public OrgGroupPolicyCreateAttributes enforcementTier( + OrgGroupPolicyEnforcementTier enforcementTier) { + this.enforcementTier = enforcementTier; + this.unparsed |= !enforcementTier.isValid(); + return this; + } + + /** + * 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. + * + * @return enforcementTier + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENFORCEMENT_TIER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OrgGroupPolicyEnforcementTier getEnforcementTier() { + return enforcementTier; + } + + public void setEnforcementTier(OrgGroupPolicyEnforcementTier enforcementTier) { + if (!enforcementTier.isValid()) { + this.unparsed = true; + } + this.enforcementTier = enforcementTier; + } + public OrgGroupPolicyCreateAttributes policyName(String policyName) { this.policyName = policyName; return this; @@ -87,6 +128,32 @@ public void setPolicyName(String policyName) { this.policyName = policyName; } + public OrgGroupPolicyCreateAttributes policyType(OrgGroupPolicyPolicyType policyType) { + this.policyType = policyType; + this.unparsed |= !policyType.isValid(); + return this; + } + + /** + * The type of the policy. Only org_config is supported, indicating a policy backed + * by an organization configuration setting. + * + * @return policyType + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_POLICY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OrgGroupPolicyPolicyType getPolicyType() { + return policyType; + } + + public void setPolicyType(OrgGroupPolicyPolicyType policyType) { + if (!policyType.isValid()) { + this.unparsed = true; + } + this.policyType = policyType; + } + /** * A container for additional, undeclared properties. This is a holder for any undeclared * properties as specified with the 'additionalProperties' keyword in the OAS document. @@ -145,14 +212,16 @@ public boolean equals(Object o) { OrgGroupPolicyCreateAttributes orgGroupPolicyCreateAttributes = (OrgGroupPolicyCreateAttributes) o; return Objects.equals(this.content, orgGroupPolicyCreateAttributes.content) + && Objects.equals(this.enforcementTier, orgGroupPolicyCreateAttributes.enforcementTier) && Objects.equals(this.policyName, orgGroupPolicyCreateAttributes.policyName) + && Objects.equals(this.policyType, orgGroupPolicyCreateAttributes.policyType) && Objects.equals( this.additionalProperties, orgGroupPolicyCreateAttributes.additionalProperties); } @Override public int hashCode() { - return Objects.hash(content, policyName, additionalProperties); + return Objects.hash(content, enforcementTier, policyName, policyType, additionalProperties); } @Override @@ -160,7 +229,9 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class OrgGroupPolicyCreateAttributes {\n"); sb.append(" content: ").append(toIndentedString(content)).append("\n"); + sb.append(" enforcementTier: ").append(toIndentedString(enforcementTier)).append("\n"); sb.append(" policyName: ").append(toIndentedString(policyName)).append("\n"); + sb.append(" policyType: ").append(toIndentedString(policyType)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); diff --git a/src/main/java/com/datadog/api/client/v2/model/OrgGroupPolicyCreateData.java b/src/main/java/com/datadog/api/client/v2/model/OrgGroupPolicyCreateData.java index 116ec810863..efea81a6f93 100644 --- a/src/main/java/com/datadog/api/client/v2/model/OrgGroupPolicyCreateData.java +++ b/src/main/java/com/datadog/api/client/v2/model/OrgGroupPolicyCreateData.java @@ -60,7 +60,9 @@ public OrgGroupPolicyCreateData attributes(OrgGroupPolicyCreateAttributes attrib } /** - * Attributes for creating an org group policy. + * Attributes for creating an org group policy. If policy_type or + * enforcement_tier are not provided, they default to org_config and + * DEFAULT respectively. * * @return attributes */ diff --git a/src/main/java/com/datadog/api/client/v2/model/OrgGroupPolicyEnforcementTier.java b/src/main/java/com/datadog/api/client/v2/model/OrgGroupPolicyEnforcementTier.java new file mode 100644 index 00000000000..73f2a240ff9 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OrgGroupPolicyEnforcementTier.java @@ -0,0 +1,65 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** + * 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. + */ +@JsonSerialize(using = OrgGroupPolicyEnforcementTier.OrgGroupPolicyEnforcementTierSerializer.class) +public class OrgGroupPolicyEnforcementTier extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("DEFAULT", "ENFORCE", "DELEGATE")); + + public static final OrgGroupPolicyEnforcementTier DEFAULT = + new OrgGroupPolicyEnforcementTier("DEFAULT"); + public static final OrgGroupPolicyEnforcementTier ENFORCE = + new OrgGroupPolicyEnforcementTier("ENFORCE"); + public static final OrgGroupPolicyEnforcementTier DELEGATE = + new OrgGroupPolicyEnforcementTier("DELEGATE"); + + OrgGroupPolicyEnforcementTier(String value) { + super(value, allowedValues); + } + + public static class OrgGroupPolicyEnforcementTierSerializer + extends StdSerializer { + public OrgGroupPolicyEnforcementTierSerializer(Class t) { + super(t); + } + + public OrgGroupPolicyEnforcementTierSerializer() { + this(null); + } + + @Override + public void serialize( + OrgGroupPolicyEnforcementTier value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static OrgGroupPolicyEnforcementTier fromValue(String value) { + return new OrgGroupPolicyEnforcementTier(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/OrgGroupPolicyOverrideUpdateAttributes.java b/src/main/java/com/datadog/api/client/v2/model/OrgGroupPolicyOverrideUpdateAttributes.java index 2da703d0c7b..499f98402d5 100644 --- a/src/main/java/com/datadog/api/client/v2/model/OrgGroupPolicyOverrideUpdateAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/OrgGroupPolicyOverrideUpdateAttributes.java @@ -18,7 +18,10 @@ import java.util.Objects; import java.util.UUID; -/** Attributes for updating a policy override. */ +/** + * Attributes for updating a policy override. The org_uuid and org_site + * fields must match the existing override and cannot be changed. + */ @JsonPropertyOrder({ OrgGroupPolicyOverrideUpdateAttributes.JSON_PROPERTY_ORG_SITE, OrgGroupPolicyOverrideUpdateAttributes.JSON_PROPERTY_ORG_UUID diff --git a/src/main/java/com/datadog/api/client/v2/model/OrgGroupPolicyOverrideUpdateData.java b/src/main/java/com/datadog/api/client/v2/model/OrgGroupPolicyOverrideUpdateData.java index 00d80af12c8..964879f945b 100644 --- a/src/main/java/com/datadog/api/client/v2/model/OrgGroupPolicyOverrideUpdateData.java +++ b/src/main/java/com/datadog/api/client/v2/model/OrgGroupPolicyOverrideUpdateData.java @@ -60,7 +60,8 @@ public OrgGroupPolicyOverrideUpdateData attributes( } /** - * Attributes for updating a policy override. + * Attributes for updating a policy override. The org_uuid and org_site + * fields must match the existing override and cannot be changed. * * @return attributes */ diff --git a/src/main/java/com/datadog/api/client/v2/model/OrgGroupPolicyPolicyType.java b/src/main/java/com/datadog/api/client/v2/model/OrgGroupPolicyPolicyType.java new file mode 100644 index 00000000000..ad8ee90b73d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OrgGroupPolicyPolicyType.java @@ -0,0 +1,59 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** + * The type of the policy. Only org_config is supported, indicating a policy backed by + * an organization configuration setting. + */ +@JsonSerialize(using = OrgGroupPolicyPolicyType.OrgGroupPolicyPolicyTypeSerializer.class) +public class OrgGroupPolicyPolicyType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("org_config")); + + public static final OrgGroupPolicyPolicyType ORG_CONFIG = + new OrgGroupPolicyPolicyType("org_config"); + + OrgGroupPolicyPolicyType(String value) { + super(value, allowedValues); + } + + public static class OrgGroupPolicyPolicyTypeSerializer + extends StdSerializer { + public OrgGroupPolicyPolicyTypeSerializer(Class t) { + super(t); + } + + public OrgGroupPolicyPolicyTypeSerializer() { + this(null); + } + + @Override + public void serialize( + OrgGroupPolicyPolicyType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static OrgGroupPolicyPolicyType fromValue(String value) { + return new OrgGroupPolicyPolicyType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/OrgGroupPolicyUpdateAttributes.java b/src/main/java/com/datadog/api/client/v2/model/OrgGroupPolicyUpdateAttributes.java index 48fd2c3aeda..428c121c21b 100644 --- a/src/main/java/com/datadog/api/client/v2/model/OrgGroupPolicyUpdateAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/OrgGroupPolicyUpdateAttributes.java @@ -17,7 +17,10 @@ import java.util.Objects; /** Attributes for updating an org group policy. */ -@JsonPropertyOrder({OrgGroupPolicyUpdateAttributes.JSON_PROPERTY_CONTENT}) +@JsonPropertyOrder({ + OrgGroupPolicyUpdateAttributes.JSON_PROPERTY_CONTENT, + OrgGroupPolicyUpdateAttributes.JSON_PROPERTY_ENFORCEMENT_TIER +}) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") public class OrgGroupPolicyUpdateAttributes { @@ -25,6 +28,9 @@ public class OrgGroupPolicyUpdateAttributes { public static final String JSON_PROPERTY_CONTENT = "content"; private Map content = null; + public static final String JSON_PROPERTY_ENFORCEMENT_TIER = "enforcement_tier"; + private OrgGroupPolicyEnforcementTier enforcementTier = OrgGroupPolicyEnforcementTier.DEFAULT; + public OrgGroupPolicyUpdateAttributes content(Map content) { this.content = content; return this; @@ -54,6 +60,35 @@ public void setContent(Map content) { this.content = content; } + public OrgGroupPolicyUpdateAttributes enforcementTier( + OrgGroupPolicyEnforcementTier enforcementTier) { + this.enforcementTier = enforcementTier; + this.unparsed |= !enforcementTier.isValid(); + return this; + } + + /** + * 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. + * + * @return enforcementTier + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENFORCEMENT_TIER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OrgGroupPolicyEnforcementTier getEnforcementTier() { + return enforcementTier; + } + + public void setEnforcementTier(OrgGroupPolicyEnforcementTier enforcementTier) { + if (!enforcementTier.isValid()) { + this.unparsed = true; + } + this.enforcementTier = enforcementTier; + } + /** * A container for additional, undeclared properties. This is a holder for any undeclared * properties as specified with the 'additionalProperties' keyword in the OAS document. @@ -112,13 +147,14 @@ public boolean equals(Object o) { OrgGroupPolicyUpdateAttributes orgGroupPolicyUpdateAttributes = (OrgGroupPolicyUpdateAttributes) o; return Objects.equals(this.content, orgGroupPolicyUpdateAttributes.content) + && Objects.equals(this.enforcementTier, orgGroupPolicyUpdateAttributes.enforcementTier) && Objects.equals( this.additionalProperties, orgGroupPolicyUpdateAttributes.additionalProperties); } @Override public int hashCode() { - return Objects.hash(content, additionalProperties); + return Objects.hash(content, enforcementTier, additionalProperties); } @Override @@ -126,6 +162,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class OrgGroupPolicyUpdateAttributes {\n"); sb.append(" content: ").append(toIndentedString(content)).append("\n"); + sb.append(" enforcementTier: ").append(toIndentedString(enforcementTier)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); diff --git a/src/test/resources/com/datadog/api/client/v2/api/org_groups.feature b/src/test/resources/com/datadog/api/client/v2/api/org_groups.feature index 73cce63cd8e..b8c5fe1b61d 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/org_groups.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/org_groups.feature @@ -12,7 +12,7 @@ Feature: Org Groups Scenario: Bulk update org group memberships returns "Bad Request" response Given operation "BulkUpdateOrgGroupMemberships" enabled And new "BulkUpdateOrgGroupMemberships" request - And body with value {"data": {"attributes": {"orgs": [{"org_site": "datadoghq.com", "org_uuid": "c3d4e5f6-a7b8-9012-cdef-012345678901"}]}, "relationships": {"source_org_group": {"data": {"id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789", "type": "org_groups"}}, "target_org_group": {"data": {"id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789", "type": "org_groups"}}}, "type": "org_group_membership_bulk_updates"}} + And body with value {"data": {"attributes": {"orgs": [{"org_site": "us1", "org_uuid": "c3d4e5f6-a7b8-9012-cdef-012345678901"}]}, "relationships": {"source_org_group": {"data": {"id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789", "type": "org_groups"}}, "target_org_group": {"data": {"id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789", "type": "org_groups"}}}, "type": "org_group_membership_bulk_updates"}} When the request is sent Then the response status is 400 Bad Request @@ -20,7 +20,7 @@ Feature: Org Groups Scenario: Bulk update org group memberships returns "Not Found" response Given operation "BulkUpdateOrgGroupMemberships" enabled And new "BulkUpdateOrgGroupMemberships" request - And body with value {"data": {"attributes": {"orgs": [{"org_site": "datadoghq.com", "org_uuid": "c3d4e5f6-a7b8-9012-cdef-012345678901"}]}, "relationships": {"source_org_group": {"data": {"id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789", "type": "org_groups"}}, "target_org_group": {"data": {"id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789", "type": "org_groups"}}}, "type": "org_group_membership_bulk_updates"}} + And body with value {"data": {"attributes": {"orgs": [{"org_site": "us1", "org_uuid": "c3d4e5f6-a7b8-9012-cdef-012345678901"}]}, "relationships": {"source_org_group": {"data": {"id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789", "type": "org_groups"}}, "target_org_group": {"data": {"id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789", "type": "org_groups"}}}, "type": "org_group_membership_bulk_updates"}} When the request is sent Then the response status is 404 Not Found @@ -28,7 +28,7 @@ Feature: Org Groups Scenario: Bulk update org group memberships returns "OK" response Given operation "BulkUpdateOrgGroupMemberships" enabled And new "BulkUpdateOrgGroupMemberships" request - And body with value {"data": {"attributes": {"orgs": [{"org_site": "datadoghq.com", "org_uuid": "c3d4e5f6-a7b8-9012-cdef-012345678901"}]}, "relationships": {"source_org_group": {"data": {"id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789", "type": "org_groups"}}, "target_org_group": {"data": {"id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789", "type": "org_groups"}}}, "type": "org_group_membership_bulk_updates"}} + And body with value {"data": {"attributes": {"orgs": [{"org_site": "us1", "org_uuid": "c3d4e5f6-a7b8-9012-cdef-012345678901"}]}, "relationships": {"source_org_group": {"data": {"id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789", "type": "org_groups"}}, "target_org_group": {"data": {"id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789", "type": "org_groups"}}}, "type": "org_group_membership_bulk_updates"}} When the request is sent Then the response status is 200 OK @@ -36,7 +36,7 @@ Feature: Org Groups Scenario: Create an org group policy override returns "Bad Request" response Given operation "CreateOrgGroupPolicyOverride" enabled And new "CreateOrgGroupPolicyOverride" request - And body with value {"data": {"attributes": {"org_site": "datadoghq.com", "org_uuid": "c3d4e5f6-a7b8-9012-cdef-012345678901"}, "relationships": {"org_group": {"data": {"id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789", "type": "org_groups"}}, "org_group_policy": {"data": {"id": "1a2b3c4d-5e6f-7890-abcd-ef0123456789", "type": "org_group_policies"}}}, "type": "org_group_policy_overrides"}} + And body with value {"data": {"attributes": {"org_site": "us1", "org_uuid": "c3d4e5f6-a7b8-9012-cdef-012345678901"}, "relationships": {"org_group": {"data": {"id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789", "type": "org_groups"}}, "org_group_policy": {"data": {"id": "1a2b3c4d-5e6f-7890-abcd-ef0123456789", "type": "org_group_policies"}}}, "type": "org_group_policy_overrides"}} When the request is sent Then the response status is 400 Bad Request @@ -44,7 +44,7 @@ Feature: Org Groups Scenario: Create an org group policy override returns "Conflict" response Given operation "CreateOrgGroupPolicyOverride" enabled And new "CreateOrgGroupPolicyOverride" request - And body with value {"data": {"attributes": {"org_site": "datadoghq.com", "org_uuid": "c3d4e5f6-a7b8-9012-cdef-012345678901"}, "relationships": {"org_group": {"data": {"id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789", "type": "org_groups"}}, "org_group_policy": {"data": {"id": "1a2b3c4d-5e6f-7890-abcd-ef0123456789", "type": "org_group_policies"}}}, "type": "org_group_policy_overrides"}} + And body with value {"data": {"attributes": {"org_site": "us1", "org_uuid": "c3d4e5f6-a7b8-9012-cdef-012345678901"}, "relationships": {"org_group": {"data": {"id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789", "type": "org_groups"}}, "org_group_policy": {"data": {"id": "1a2b3c4d-5e6f-7890-abcd-ef0123456789", "type": "org_group_policies"}}}, "type": "org_group_policy_overrides"}} When the request is sent Then the response status is 409 Conflict @@ -52,7 +52,7 @@ Feature: Org Groups Scenario: Create an org group policy override returns "Created" response Given operation "CreateOrgGroupPolicyOverride" enabled And new "CreateOrgGroupPolicyOverride" request - And body with value {"data": {"attributes": {"org_site": "datadoghq.com", "org_uuid": "c3d4e5f6-a7b8-9012-cdef-012345678901"}, "relationships": {"org_group": {"data": {"id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789", "type": "org_groups"}}, "org_group_policy": {"data": {"id": "1a2b3c4d-5e6f-7890-abcd-ef0123456789", "type": "org_group_policies"}}}, "type": "org_group_policy_overrides"}} + And body with value {"data": {"attributes": {"org_site": "us1", "org_uuid": "c3d4e5f6-a7b8-9012-cdef-012345678901"}, "relationships": {"org_group": {"data": {"id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789", "type": "org_groups"}}, "org_group_policy": {"data": {"id": "1a2b3c4d-5e6f-7890-abcd-ef0123456789", "type": "org_group_policies"}}}, "type": "org_group_policy_overrides"}} When the request is sent Then the response status is 201 Created @@ -60,7 +60,7 @@ Feature: Org Groups Scenario: Create an org group policy returns "Bad Request" response Given operation "CreateOrgGroupPolicy" enabled And new "CreateOrgGroupPolicy" request - And body with value {"data": {"attributes": {"content": {"value": "UTC"}, "policy_name": "monitor_timezone"}, "relationships": {"org_group": {"data": {"id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789", "type": "org_groups"}}}, "type": "org_group_policies"}} + And body with value {"data": {"attributes": {"content": {"value": "UTC"}, "enforcement_tier": "DEFAULT", "policy_name": "monitor_timezone", "policy_type": "org_config"}, "relationships": {"org_group": {"data": {"id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789", "type": "org_groups"}}}, "type": "org_group_policies"}} When the request is sent Then the response status is 400 Bad Request @@ -68,7 +68,7 @@ Feature: Org Groups Scenario: Create an org group policy returns "Conflict" response Given operation "CreateOrgGroupPolicy" enabled And new "CreateOrgGroupPolicy" request - And body with value {"data": {"attributes": {"content": {"value": "UTC"}, "policy_name": "monitor_timezone"}, "relationships": {"org_group": {"data": {"id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789", "type": "org_groups"}}}, "type": "org_group_policies"}} + And body with value {"data": {"attributes": {"content": {"value": "UTC"}, "enforcement_tier": "DEFAULT", "policy_name": "monitor_timezone", "policy_type": "org_config"}, "relationships": {"org_group": {"data": {"id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789", "type": "org_groups"}}}, "type": "org_group_policies"}} When the request is sent Then the response status is 409 Conflict @@ -76,7 +76,7 @@ Feature: Org Groups Scenario: Create an org group policy returns "Created" response Given operation "CreateOrgGroupPolicy" enabled And new "CreateOrgGroupPolicy" request - And body with value {"data": {"attributes": {"content": {"value": "UTC"}, "policy_name": "monitor_timezone"}, "relationships": {"org_group": {"data": {"id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789", "type": "org_groups"}}}, "type": "org_group_policies"}} + And body with value {"data": {"attributes": {"content": {"value": "UTC"}, "enforcement_tier": "DEFAULT", "policy_name": "monitor_timezone", "policy_type": "org_config"}, "relationships": {"org_group": {"data": {"id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789", "type": "org_groups"}}}, "type": "org_group_policies"}} When the request is sent Then the response status is 201 Created @@ -200,6 +200,54 @@ Feature: Org Groups When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/org-management + Scenario: Get an org group policy override returns "Bad Request" response + Given operation "GetOrgGroupPolicyOverride" enabled + And new "GetOrgGroupPolicyOverride" request + And request contains "org_group_policy_override_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/org-management + Scenario: Get an org group policy override returns "Not Found" response + Given operation "GetOrgGroupPolicyOverride" enabled + And new "GetOrgGroupPolicyOverride" request + And request contains "org_group_policy_override_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/org-management + Scenario: Get an org group policy override returns "OK" response + Given operation "GetOrgGroupPolicyOverride" enabled + And new "GetOrgGroupPolicyOverride" request + And request contains "org_group_policy_override_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/org-management + Scenario: Get an org group policy returns "Bad Request" response + Given operation "GetOrgGroupPolicy" enabled + And new "GetOrgGroupPolicy" request + And request contains "org_group_policy_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/org-management + Scenario: Get an org group policy returns "Not Found" response + Given operation "GetOrgGroupPolicy" enabled + And new "GetOrgGroupPolicy" request + And request contains "org_group_policy_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/org-management + Scenario: Get an org group policy returns "OK" response + Given operation "GetOrgGroupPolicy" enabled + And new "GetOrgGroupPolicy" request + And request contains "org_group_policy_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/org-management Scenario: Get an org group returns "Bad Request" response Given operation "GetOrgGroup" enabled @@ -323,7 +371,7 @@ Feature: Org Groups Given operation "UpdateOrgGroupPolicyOverride" enabled And new "UpdateOrgGroupPolicyOverride" request And request contains "org_group_policy_override_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"org_site": "datadoghq.com", "org_uuid": "c3d4e5f6-a7b8-9012-cdef-012345678901"}, "id": "9f8e7d6c-5b4a-3210-fedc-ba0987654321", "type": "org_group_policy_overrides"}} + And body with value {"data": {"attributes": {"org_site": "us1", "org_uuid": "c3d4e5f6-a7b8-9012-cdef-012345678901"}, "id": "9f8e7d6c-5b4a-3210-fedc-ba0987654321", "type": "org_group_policy_overrides"}} When the request is sent Then the response status is 400 Bad Request @@ -332,7 +380,7 @@ Feature: Org Groups Given operation "UpdateOrgGroupPolicyOverride" enabled And new "UpdateOrgGroupPolicyOverride" request And request contains "org_group_policy_override_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"org_site": "datadoghq.com", "org_uuid": "c3d4e5f6-a7b8-9012-cdef-012345678901"}, "id": "9f8e7d6c-5b4a-3210-fedc-ba0987654321", "type": "org_group_policy_overrides"}} + And body with value {"data": {"attributes": {"org_site": "us1", "org_uuid": "c3d4e5f6-a7b8-9012-cdef-012345678901"}, "id": "9f8e7d6c-5b4a-3210-fedc-ba0987654321", "type": "org_group_policy_overrides"}} When the request is sent Then the response status is 404 Not Found @@ -341,7 +389,7 @@ Feature: Org Groups Given operation "UpdateOrgGroupPolicyOverride" enabled And new "UpdateOrgGroupPolicyOverride" request And request contains "org_group_policy_override_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"org_site": "datadoghq.com", "org_uuid": "c3d4e5f6-a7b8-9012-cdef-012345678901"}, "id": "9f8e7d6c-5b4a-3210-fedc-ba0987654321", "type": "org_group_policy_overrides"}} + And body with value {"data": {"attributes": {"org_site": "us1", "org_uuid": "c3d4e5f6-a7b8-9012-cdef-012345678901"}, "id": "9f8e7d6c-5b4a-3210-fedc-ba0987654321", "type": "org_group_policy_overrides"}} When the request is sent Then the response status is 200 OK @@ -350,7 +398,7 @@ Feature: Org Groups Given operation "UpdateOrgGroupPolicy" enabled And new "UpdateOrgGroupPolicy" request And request contains "org_group_policy_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"content": {"value": "UTC"}}, "id": "1a2b3c4d-5e6f-7890-abcd-ef0123456789", "type": "org_group_policies"}} + And body with value {"data": {"attributes": {"content": {"value": "UTC"}, "enforcement_tier": "DEFAULT"}, "id": "1a2b3c4d-5e6f-7890-abcd-ef0123456789", "type": "org_group_policies"}} When the request is sent Then the response status is 400 Bad Request @@ -359,7 +407,7 @@ Feature: Org Groups Given operation "UpdateOrgGroupPolicy" enabled And new "UpdateOrgGroupPolicy" request And request contains "org_group_policy_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"content": {"value": "UTC"}}, "id": "1a2b3c4d-5e6f-7890-abcd-ef0123456789", "type": "org_group_policies"}} + And body with value {"data": {"attributes": {"content": {"value": "UTC"}, "enforcement_tier": "DEFAULT"}, "id": "1a2b3c4d-5e6f-7890-abcd-ef0123456789", "type": "org_group_policies"}} When the request is sent Then the response status is 404 Not Found @@ -368,7 +416,7 @@ Feature: Org Groups Given operation "UpdateOrgGroupPolicy" enabled And new "UpdateOrgGroupPolicy" request And request contains "org_group_policy_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"content": {"value": "UTC"}}, "id": "1a2b3c4d-5e6f-7890-abcd-ef0123456789", "type": "org_group_policies"}} + And body with value {"data": {"attributes": {"content": {"value": "UTC"}, "enforcement_tier": "DEFAULT"}, "id": "1a2b3c4d-5e6f-7890-abcd-ef0123456789", "type": "org_group_policies"}} When the request is sent Then the response status is 200 OK diff --git a/src/test/resources/com/datadog/api/client/v2/api/undo.json b/src/test/resources/com/datadog/api/client/v2/api/undo.json index 57c73cd7aa5..47557e46305 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/undo.json +++ b/src/test/resources/com/datadog/api/client/v2/api/undo.json @@ -4222,6 +4222,12 @@ "type": "unsafe" } }, + "GetOrgGroupPolicy": { + "tag": "Org Groups", + "undo": { + "type": "safe" + } + }, "UpdateOrgGroupPolicy": { "tag": "Org Groups", "undo": { @@ -4258,6 +4264,12 @@ "type": "unsafe" } }, + "GetOrgGroupPolicyOverride": { + "tag": "Org Groups", + "undo": { + "type": "safe" + } + }, "UpdateOrgGroupPolicyOverride": { "tag": "Org Groups", "undo": {