From b2679ec228a3af95dbfe9695db2ab93a30d70727 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Fri, 17 Apr 2026 14:44:41 +0000 Subject: [PATCH] Regenerate client from commit 030c55e of spec repo --- .generator/schemas/v2/openapi.yaml | 234 ++++++++++-- features/v2/org_groups.feature | 78 +++- features/v2/undo.json | 12 + .../src/support/scenarios_model_mapping.ts | 14 + services/org_groups/src/v2/OrgGroupsApi.ts | 336 +++++++++++++++++- services/org_groups/src/v2/index.ts | 4 + .../src/v2/models/OrgGroupPolicyAttributes.ts | 23 +- .../models/OrgGroupPolicyCreateAttributes.ts | 21 +- .../src/v2/models/OrgGroupPolicyCreateData.ts | 2 +- .../models/OrgGroupPolicyEnforcementTier.ts | 13 + .../OrgGroupPolicyOverrideUpdateAttributes.ts | 2 +- .../OrgGroupPolicyOverrideUpdateData.ts | 2 +- .../src/v2/models/OrgGroupPolicyPolicyType.ts | 7 + .../models/OrgGroupPolicyUpdateAttributes.ts | 10 + .../org_groups/src/v2/models/TypingInfo.ts | 2 + 15 files changed, 702 insertions(+), 58 deletions(-) create mode 100644 services/org_groups/src/v2/models/OrgGroupPolicyEnforcementTier.ts create mode 100644 services/org_groups/src/v2/models/OrgGroupPolicyPolicyType.ts diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index d16435a94fcd..8cccc712751c 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -30982,7 +30982,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. @@ -50878,7 +50878,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. @@ -50984,7 +50984,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. @@ -51205,11 +51205,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" @@ -51219,9 +51216,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: @@ -51292,7 +51292,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: {} @@ -51300,10 +51301,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 @@ -51357,6 +51362,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: @@ -51389,7 +51408,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. @@ -51407,7 +51426,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. @@ -51523,11 +51542,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. @@ -51563,6 +51583,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: @@ -51631,6 +51661,8 @@ components: example: value: "UTC" type: object + enforcement_tier: + $ref: "#/components/schemas/OrgGroupPolicyEnforcementTier" type: object OrgGroupPolicyUpdateData: description: Data for updating an org group policy. @@ -104198,7 +104230,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: @@ -104256,7 +104288,7 @@ paths: data: attributes: orgs: - - org_site: "datadoghq.com" + - org_site: "us1" org_uuid: "c3d4e5f6-a7b8-9012-cdef-012345678901" relationships: source_org_group: @@ -104283,7 +104315,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: @@ -104348,7 +104380,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: @@ -104429,7 +104461,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: @@ -104497,9 +104529,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: @@ -104555,7 +104588,9 @@ paths: attributes: content: value: "UTC" + enforcement_tier: "DEFAULT" policy_name: "monitor_timezone" + policy_type: "org_config" relationships: org_group: data: @@ -104576,9 +104611,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: @@ -104668,8 +104704,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" @@ -104683,6 +104784,7 @@ paths: attributes: content: value: "US/Eastern" + enforcement_tier: "ENFORCE" id: "1a2b3c4d-5e6f-7890-abcd-ef0123456789" type: org_group_policies schema: @@ -104699,9 +104801,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: @@ -104815,7 +104918,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: @@ -104874,7 +104977,7 @@ paths: value: data: attributes: - org_site: "datadoghq.com" + org_site: "us1" org_uuid: "c3d4e5f6-a7b8-9012-cdef-012345678901" relationships: org_group: @@ -104900,7 +105003,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: @@ -104995,6 +105098,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 @@ -105008,7 +105178,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 @@ -105026,7 +105196,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: @@ -105098,7 +105268,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 @@ -105165,7 +105335,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 @@ -105268,7 +105438,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 @@ -105341,7 +105511,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/features/v2/org_groups.feature b/features/v2/org_groups.feature index 73cce63cd8eb..b8c5fe1b61d1 100644 --- a/features/v2/org_groups.feature +++ b/features/v2/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/features/v2/undo.json b/features/v2/undo.json index bbfa27e028c6..873a3e5bc089 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -4197,6 +4197,12 @@ "type": "unsafe" } }, + "GetOrgGroupPolicy": { + "tag": "Org Groups", + "undo": { + "type": "safe" + } + }, "UpdateOrgGroupPolicy": { "tag": "Org Groups", "undo": { @@ -4233,6 +4239,12 @@ "type": "unsafe" } }, + "GetOrgGroupPolicyOverride": { + "tag": "Org Groups", + "undo": { + "type": "safe" + } + }, "UpdateOrgGroupPolicyOverride": { "tag": "Org Groups", "undo": { diff --git a/private/bdd_runner/src/support/scenarios_model_mapping.ts b/private/bdd_runner/src/support/scenarios_model_mapping.ts index 1c8c6ca992ba..e4bff2eef179 100644 --- a/private/bdd_runner/src/support/scenarios_model_mapping.ts +++ b/private/bdd_runner/src/support/scenarios_model_mapping.ts @@ -9634,6 +9634,13 @@ export const ScenariosModelMappings: { [key: string]: OperationMapping } = { }, operationResponseType: "OrgGroupPolicyResponse", }, + "OrgGroupsApi.V2.GetOrgGroupPolicy": { + orgGroupPolicyId: { + type: "string", + format: "uuid", + }, + operationResponseType: "OrgGroupPolicyResponse", + }, "OrgGroupsApi.V2.DeleteOrgGroupPolicy": { orgGroupPolicyId: { type: "string", @@ -9685,6 +9692,13 @@ export const ScenariosModelMappings: { [key: string]: OperationMapping } = { }, operationResponseType: "OrgGroupPolicyOverrideResponse", }, + "OrgGroupsApi.V2.GetOrgGroupPolicyOverride": { + orgGroupPolicyOverrideId: { + type: "string", + format: "uuid", + }, + operationResponseType: "OrgGroupPolicyOverrideResponse", + }, "OrgGroupsApi.V2.DeleteOrgGroupPolicyOverride": { orgGroupPolicyOverrideId: { type: "string", diff --git a/services/org_groups/src/v2/OrgGroupsApi.ts b/services/org_groups/src/v2/OrgGroupsApi.ts index f1d89a353a3d..c2591f52c982 100644 --- a/services/org_groups/src/v2/OrgGroupsApi.ts +++ b/services/org_groups/src/v2/OrgGroupsApi.ts @@ -552,6 +552,116 @@ export class OrgGroupsApiRequestFactory extends BaseAPIRequestFactory { return requestContext; } + public async getOrgGroupPolicy( + orgGroupPolicyId: string, + _options?: Configuration, + ): Promise { + const _config = _options || this.configuration; + + if (!_config.unstableOperations["OrgGroupsApi.v2.getOrgGroupPolicy"]) { + throw new Error( + "Unstable operation 'getOrgGroupPolicy' is disabled. Enable it by setting `configuration.unstableOperations['OrgGroupsApi.v2.getOrgGroupPolicy'] = true`", + ); + } + + // verify required parameter 'orgGroupPolicyId' is not null or undefined + if (orgGroupPolicyId === null || orgGroupPolicyId === undefined) { + throw new RequiredError("orgGroupPolicyId", "getOrgGroupPolicy"); + } + + // Path Params + const localVarPath = + "/api/v2/org_group_policies/{org_group_policy_id}".replace( + "{org_group_policy_id}", + encodeURIComponent(String(orgGroupPolicyId)), + ); + + // Make Request Context + const { server, overrides } = _config.getServerAndOverrides( + "OrgGroupsApi.v2.getOrgGroupPolicy", + OrgGroupsApi.operationServers, + ); + const requestContext = server.makeRequestContext( + localVarPath, + HttpMethod.GET, + overrides, + ); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Set User-Agent + if (this.userAgent) { + requestContext.setHeaderParam("User-Agent", this.userAgent); + } + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + + public async getOrgGroupPolicyOverride( + orgGroupPolicyOverrideId: string, + _options?: Configuration, + ): Promise { + const _config = _options || this.configuration; + + if ( + !_config.unstableOperations["OrgGroupsApi.v2.getOrgGroupPolicyOverride"] + ) { + throw new Error( + "Unstable operation 'getOrgGroupPolicyOverride' is disabled. Enable it by setting `configuration.unstableOperations['OrgGroupsApi.v2.getOrgGroupPolicyOverride'] = true`", + ); + } + + // verify required parameter 'orgGroupPolicyOverrideId' is not null or undefined + if ( + orgGroupPolicyOverrideId === null || + orgGroupPolicyOverrideId === undefined + ) { + throw new RequiredError( + "orgGroupPolicyOverrideId", + "getOrgGroupPolicyOverride", + ); + } + + // Path Params + const localVarPath = + "/api/v2/org_group_policy_overrides/{org_group_policy_override_id}".replace( + "{org_group_policy_override_id}", + encodeURIComponent(String(orgGroupPolicyOverrideId)), + ); + + // Make Request Context + const { server, overrides } = _config.getServerAndOverrides( + "OrgGroupsApi.v2.getOrgGroupPolicyOverride", + OrgGroupsApi.operationServers, + ); + const requestContext = server.makeRequestContext( + localVarPath, + HttpMethod.GET, + overrides, + ); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Set User-Agent + if (this.userAgent) { + requestContext.setHeaderParam("User-Agent", this.userAgent); + } + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + public async listOrgGroupMemberships( filterOrgGroupId?: string, filterOrgUuid?: string, @@ -1917,6 +2027,170 @@ export class OrgGroupsApiResponseProcessor { ); } + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to getOrgGroupPolicy + * @throws ApiException if the response code was not in [200, 299] + */ + public async getOrgGroupPolicy( + response: ResponseContext, + ): Promise { + const contentType = normalizeMediaType(response.headers["content-type"]); + if (response.httpStatusCode === 200) { + const body: OrgGroupPolicyResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "OrgGroupPolicyResponse", + ) as OrgGroupPolicyResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 401 || + response.httpStatusCode === 403 || + response.httpStatusCode === 404 + ) { + const bodyText = parse(await response.body.text(), contentType); + let body: JSONAPIErrorResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "JSONAPIErrorResponse", + ) as JSONAPIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException( + response.httpStatusCode, + body, + ); + } + if (response.httpStatusCode === 429) { + const bodyText = parse(await response.body.text(), contentType); + let body: APIErrorResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "APIErrorResponse", + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: OrgGroupPolicyResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "OrgGroupPolicyResponse", + "", + ) as OrgGroupPolicyResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"', + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to getOrgGroupPolicyOverride + * @throws ApiException if the response code was not in [200, 299] + */ + public async getOrgGroupPolicyOverride( + response: ResponseContext, + ): Promise { + const contentType = normalizeMediaType(response.headers["content-type"]); + if (response.httpStatusCode === 200) { + const body: OrgGroupPolicyOverrideResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "OrgGroupPolicyOverrideResponse", + ) as OrgGroupPolicyOverrideResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 401 || + response.httpStatusCode === 403 || + response.httpStatusCode === 404 + ) { + const bodyText = parse(await response.body.text(), contentType); + let body: JSONAPIErrorResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "JSONAPIErrorResponse", + ) as JSONAPIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException( + response.httpStatusCode, + body, + ); + } + if (response.httpStatusCode === 429) { + const bodyText = parse(await response.body.text(), contentType); + let body: APIErrorResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "APIErrorResponse", + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: OrgGroupPolicyOverrideResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "OrgGroupPolicyOverrideResponse", + "", + ) as OrgGroupPolicyOverrideResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"', + ); + } + /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects @@ -2715,6 +2989,22 @@ export interface OrgGroupsApiGetOrgGroupMembershipRequest { orgGroupMembershipId: string; } +export interface OrgGroupsApiGetOrgGroupPolicyRequest { + /** + * The ID of the org group policy. + * @type string + */ + orgGroupPolicyId: string; +} + +export interface OrgGroupsApiGetOrgGroupPolicyOverrideRequest { + /** + * The ID of the org group policy override. + * @type string + */ + orgGroupPolicyOverrideId: string; +} + export interface OrgGroupsApiListOrgGroupMembershipsRequest { /** * Filter memberships by org group ID. Required when `filter[org_uuid]` is not provided. @@ -3081,6 +3371,50 @@ export class OrgGroupsApi { }); } + /** + * Get a specific organization group policy by its ID. + * @param param The request object + */ + public getOrgGroupPolicy( + param: OrgGroupsApiGetOrgGroupPolicyRequest, + options?: Configuration, + ): Promise { + const requestContextPromise = this.requestFactory.getOrgGroupPolicy( + param.orgGroupPolicyId, + options, + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.getOrgGroupPolicy(responseContext); + }); + }); + } + + /** + * Get a specific organization group policy override by its ID. + * @param param The request object + */ + public getOrgGroupPolicyOverride( + param: OrgGroupsApiGetOrgGroupPolicyOverrideRequest, + options?: Configuration, + ): Promise { + const requestContextPromise = this.requestFactory.getOrgGroupPolicyOverride( + param.orgGroupPolicyOverrideId, + options, + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.getOrgGroupPolicyOverride( + responseContext, + ); + }); + }); + } + /** * List organization group memberships. Filter by org group ID or org UUID. At least one of `filter[org_group_id]` or `filter[org_uuid]` must be provided. When filtering by org UUID, returns a single-item list with the membership for that org. * @param param The request object @@ -3252,7 +3586,7 @@ export class OrgGroupsApi { } /** - * Update the content of an existing organization group policy. + * Update an existing organization group policy. * @param param The request object */ public updateOrgGroupPolicy( diff --git a/services/org_groups/src/v2/index.ts b/services/org_groups/src/v2/index.ts index 452f59793f03..12957e63dc02 100644 --- a/services/org_groups/src/v2/index.ts +++ b/services/org_groups/src/v2/index.ts @@ -8,6 +8,8 @@ export { OrgGroupsApiDeleteOrgGroupPolicyOverrideRequest, OrgGroupsApiGetOrgGroupRequest, OrgGroupsApiGetOrgGroupMembershipRequest, + OrgGroupsApiGetOrgGroupPolicyRequest, + OrgGroupsApiGetOrgGroupPolicyOverrideRequest, OrgGroupsApiListOrgGroupMembershipsRequest, OrgGroupsApiListOrgGroupPoliciesRequest, OrgGroupsApiListOrgGroupPolicyOverridesRequest, @@ -60,6 +62,7 @@ export { OrgGroupPolicyCreateData } from "./models/OrgGroupPolicyCreateData"; export { OrgGroupPolicyCreateRelationships } from "./models/OrgGroupPolicyCreateRelationships"; export { OrgGroupPolicyCreateRequest } from "./models/OrgGroupPolicyCreateRequest"; export { OrgGroupPolicyData } from "./models/OrgGroupPolicyData"; +export { OrgGroupPolicyEnforcementTier } from "./models/OrgGroupPolicyEnforcementTier"; export { OrgGroupPolicyListResponse } from "./models/OrgGroupPolicyListResponse"; export { OrgGroupPolicyOverrideAttributes } from "./models/OrgGroupPolicyOverrideAttributes"; export { OrgGroupPolicyOverrideCreateAttributes } from "./models/OrgGroupPolicyOverrideCreateAttributes"; @@ -75,6 +78,7 @@ export { OrgGroupPolicyOverrideType } from "./models/OrgGroupPolicyOverrideType" export { OrgGroupPolicyOverrideUpdateAttributes } from "./models/OrgGroupPolicyOverrideUpdateAttributes"; export { OrgGroupPolicyOverrideUpdateData } from "./models/OrgGroupPolicyOverrideUpdateData"; export { OrgGroupPolicyOverrideUpdateRequest } from "./models/OrgGroupPolicyOverrideUpdateRequest"; +export { OrgGroupPolicyPolicyType } from "./models/OrgGroupPolicyPolicyType"; export { OrgGroupPolicyRelationships } from "./models/OrgGroupPolicyRelationships"; export { OrgGroupPolicyRelationshipToOne } from "./models/OrgGroupPolicyRelationshipToOne"; export { OrgGroupPolicyRelationshipToOneData } from "./models/OrgGroupPolicyRelationshipToOneData"; diff --git a/services/org_groups/src/v2/models/OrgGroupPolicyAttributes.ts b/services/org_groups/src/v2/models/OrgGroupPolicyAttributes.ts index c0eb756ad369..914ed51de467 100644 --- a/services/org_groups/src/v2/models/OrgGroupPolicyAttributes.ts +++ b/services/org_groups/src/v2/models/OrgGroupPolicyAttributes.ts @@ -1,5 +1,8 @@ import { AttributeTypeMap } from "@datadog/datadog-api-client"; +import { OrgGroupPolicyEnforcementTier } from "./OrgGroupPolicyEnforcementTier"; +import { OrgGroupPolicyPolicyType } from "./OrgGroupPolicyPolicyType"; + /** * Attributes of an org group policy. */ @@ -9,9 +12,9 @@ export class OrgGroupPolicyAttributes { */ "content"?: { [key: string]: any }; /** - * 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. */ - "enforcedAt": Date; + "enforcementTier": OrgGroupPolicyEnforcementTier; /** * Timestamp when the policy was last modified. */ @@ -20,6 +23,10 @@ export class OrgGroupPolicyAttributes { * The name of the policy. */ "policyName": string; + /** + * The type of the policy. Only `org_config` is supported, indicating a policy backed by an organization configuration setting. + */ + "policyType": OrgGroupPolicyPolicyType; /** * A container for additional, undeclared properties. * This is a holder for any undeclared properties as specified with @@ -39,11 +46,10 @@ export class OrgGroupPolicyAttributes { baseName: "content", type: "{ [key: string]: any; }", }, - enforcedAt: { - baseName: "enforced_at", - type: "Date", + enforcementTier: { + baseName: "enforcement_tier", + type: "OrgGroupPolicyEnforcementTier", required: true, - format: "date-time", }, modifiedAt: { baseName: "modified_at", @@ -56,6 +62,11 @@ export class OrgGroupPolicyAttributes { type: "string", required: true, }, + policyType: { + baseName: "policy_type", + type: "OrgGroupPolicyPolicyType", + required: true, + }, additionalProperties: { baseName: "additionalProperties", type: "{ [key: string]: any; }", diff --git a/services/org_groups/src/v2/models/OrgGroupPolicyCreateAttributes.ts b/services/org_groups/src/v2/models/OrgGroupPolicyCreateAttributes.ts index 3bd6ffd21c7f..a808ddbfb250 100644 --- a/services/org_groups/src/v2/models/OrgGroupPolicyCreateAttributes.ts +++ b/services/org_groups/src/v2/models/OrgGroupPolicyCreateAttributes.ts @@ -1,17 +1,28 @@ import { AttributeTypeMap } from "@datadog/datadog-api-client"; +import { OrgGroupPolicyEnforcementTier } from "./OrgGroupPolicyEnforcementTier"; +import { OrgGroupPolicyPolicyType } from "./OrgGroupPolicyPolicyType"; + /** - * 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. */ export class OrgGroupPolicyCreateAttributes { /** * The policy content as key-value pairs. */ "content": { [key: string]: any }; + /** + * 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. + */ + "enforcementTier"?: OrgGroupPolicyEnforcementTier; /** * The name of the policy. */ "policyName": string; + /** + * The type of the policy. Only `org_config` is supported, indicating a policy backed by an organization configuration setting. + */ + "policyType"?: OrgGroupPolicyPolicyType; /** * A container for additional, undeclared properties. * This is a holder for any undeclared properties as specified with @@ -32,11 +43,19 @@ export class OrgGroupPolicyCreateAttributes { type: "{ [key: string]: any; }", required: true, }, + enforcementTier: { + baseName: "enforcement_tier", + type: "OrgGroupPolicyEnforcementTier", + }, policyName: { baseName: "policy_name", type: "string", required: true, }, + policyType: { + baseName: "policy_type", + type: "OrgGroupPolicyPolicyType", + }, additionalProperties: { baseName: "additionalProperties", type: "{ [key: string]: any; }", diff --git a/services/org_groups/src/v2/models/OrgGroupPolicyCreateData.ts b/services/org_groups/src/v2/models/OrgGroupPolicyCreateData.ts index 364ce4fe91b4..083d1cc4e3f0 100644 --- a/services/org_groups/src/v2/models/OrgGroupPolicyCreateData.ts +++ b/services/org_groups/src/v2/models/OrgGroupPolicyCreateData.ts @@ -9,7 +9,7 @@ import { OrgGroupPolicyType } from "./OrgGroupPolicyType"; */ export class OrgGroupPolicyCreateData { /** - * 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. */ "attributes": OrgGroupPolicyCreateAttributes; /** diff --git a/services/org_groups/src/v2/models/OrgGroupPolicyEnforcementTier.ts b/services/org_groups/src/v2/models/OrgGroupPolicyEnforcementTier.ts new file mode 100644 index 000000000000..f04df5109667 --- /dev/null +++ b/services/org_groups/src/v2/models/OrgGroupPolicyEnforcementTier.ts @@ -0,0 +1,13 @@ +import { UnparsedObject } from "@datadog/datadog-api-client"; + +/** + * 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. + */ +export type OrgGroupPolicyEnforcementTier = + | typeof DEFAULT + | typeof ENFORCE + | typeof DELEGATE + | UnparsedObject; +export const DEFAULT = "DEFAULT"; +export const ENFORCE = "ENFORCE"; +export const DELEGATE = "DELEGATE"; diff --git a/services/org_groups/src/v2/models/OrgGroupPolicyOverrideUpdateAttributes.ts b/services/org_groups/src/v2/models/OrgGroupPolicyOverrideUpdateAttributes.ts index b790e66c642e..a70cea9f12eb 100644 --- a/services/org_groups/src/v2/models/OrgGroupPolicyOverrideUpdateAttributes.ts +++ b/services/org_groups/src/v2/models/OrgGroupPolicyOverrideUpdateAttributes.ts @@ -1,7 +1,7 @@ import { AttributeTypeMap } from "@datadog/datadog-api-client"; /** - * 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. */ export class OrgGroupPolicyOverrideUpdateAttributes { /** diff --git a/services/org_groups/src/v2/models/OrgGroupPolicyOverrideUpdateData.ts b/services/org_groups/src/v2/models/OrgGroupPolicyOverrideUpdateData.ts index f6d12b683f0f..a5d46b193816 100644 --- a/services/org_groups/src/v2/models/OrgGroupPolicyOverrideUpdateData.ts +++ b/services/org_groups/src/v2/models/OrgGroupPolicyOverrideUpdateData.ts @@ -8,7 +8,7 @@ import { OrgGroupPolicyOverrideUpdateAttributes } from "./OrgGroupPolicyOverride */ export class OrgGroupPolicyOverrideUpdateData { /** - * 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. */ "attributes": OrgGroupPolicyOverrideUpdateAttributes; /** diff --git a/services/org_groups/src/v2/models/OrgGroupPolicyPolicyType.ts b/services/org_groups/src/v2/models/OrgGroupPolicyPolicyType.ts new file mode 100644 index 000000000000..5140b3612fa8 --- /dev/null +++ b/services/org_groups/src/v2/models/OrgGroupPolicyPolicyType.ts @@ -0,0 +1,7 @@ +import { UnparsedObject } from "@datadog/datadog-api-client"; + +/** + * The type of the policy. Only `org_config` is supported, indicating a policy backed by an organization configuration setting. + */ +export type OrgGroupPolicyPolicyType = typeof ORG_CONFIG | UnparsedObject; +export const ORG_CONFIG = "org_config"; diff --git a/services/org_groups/src/v2/models/OrgGroupPolicyUpdateAttributes.ts b/services/org_groups/src/v2/models/OrgGroupPolicyUpdateAttributes.ts index c107c9016378..5b987abe7353 100644 --- a/services/org_groups/src/v2/models/OrgGroupPolicyUpdateAttributes.ts +++ b/services/org_groups/src/v2/models/OrgGroupPolicyUpdateAttributes.ts @@ -1,5 +1,7 @@ import { AttributeTypeMap } from "@datadog/datadog-api-client"; +import { OrgGroupPolicyEnforcementTier } from "./OrgGroupPolicyEnforcementTier"; + /** * Attributes for updating an org group policy. */ @@ -8,6 +10,10 @@ export class OrgGroupPolicyUpdateAttributes { * The policy content as key-value pairs. */ "content"?: { [key: string]: any }; + /** + * 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. + */ + "enforcementTier"?: OrgGroupPolicyEnforcementTier; /** * A container for additional, undeclared properties. * This is a holder for any undeclared properties as specified with @@ -27,6 +33,10 @@ export class OrgGroupPolicyUpdateAttributes { baseName: "content", type: "{ [key: string]: any; }", }, + enforcementTier: { + baseName: "enforcement_tier", + type: "OrgGroupPolicyEnforcementTier", + }, additionalProperties: { baseName: "additionalProperties", type: "{ [key: string]: any; }", diff --git a/services/org_groups/src/v2/models/TypingInfo.ts b/services/org_groups/src/v2/models/TypingInfo.ts index 059eb5926156..d017627d1f41 100644 --- a/services/org_groups/src/v2/models/TypingInfo.ts +++ b/services/org_groups/src/v2/models/TypingInfo.ts @@ -71,8 +71,10 @@ export const TypingInfo: ModelTypingInfo = { OrgGroupMembershipSortOption: ["name", "-name", "uuid", "-uuid"], OrgGroupMembershipType: ["org_group_memberships"], OrgGroupPolicyConfigType: ["org_group_policy_configs"], + OrgGroupPolicyEnforcementTier: ["DEFAULT", "ENFORCE", "DELEGATE"], OrgGroupPolicyOverrideSortOption: ["id", "-id", "org_uuid", "-org_uuid"], OrgGroupPolicyOverrideType: ["org_group_policy_overrides"], + OrgGroupPolicyPolicyType: ["org_config"], OrgGroupPolicySortOption: ["id", "-id", "name", "-name"], OrgGroupPolicyType: ["org_group_policies"], OrgGroupSortOption: ["name", "-name", "uuid", "-uuid"],