From 1c9eaaf30b70fcf02842cb0f1443b25a53dc2312 Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Wed, 22 Apr 2026 15:32:03 +0000 Subject: [PATCH 1/2] Add GET OrgGroupPolicy and OrgGroupPolicyOverride, Add policy_type/enforcement_tier fields, Remove enforced_at field (#3973) Co-authored-by: ci.datadog-api-spec --- .generator/schemas/v2/openapi.yaml | 316 +++++++++++++++--- api/datadog/configuration.go | 2 + api/datadogV2/api_org_groups.go | 194 ++++++++++- api/datadogV2/api_security_monitoring.go | 9 +- api/datadogV2/doc.go | 2 + .../model_org_group_policy_attributes.go | 100 ++++-- ...odel_org_group_policy_create_attributes.go | 100 +++++- .../model_org_group_policy_create_data.go | 2 +- ...model_org_group_policy_enforcement_tier.go | 68 ++++ ...group_policy_override_update_attributes.go | 2 +- ...l_org_group_policy_override_update_data.go | 2 +- .../model_org_group_policy_policy_type.go | 64 ++++ ...odel_org_group_policy_update_attributes.go | 53 ++- ...rity_monitoring_content_pack_activation.go | 2 +- ...itoring_content_pack_integration_status.go | 2 +- ...onitoring_content_pack_state_attributes.go | 13 +- ...rity_monitoring_content_pack_state_meta.go | 2 +- ...security_monitoring_content_pack_status.go | 2 +- ...onitoring_content_pack_timestamp_bucket.go | 2 +- .../model_security_monitoring_sku.go | 2 +- .../BulkUpdateOrgGroupMemberships.go | 2 +- .../v2/org-groups/CreateOrgGroupPolicy.go | 4 +- .../CreateOrgGroupPolicyOverride.go | 2 +- examples/v2/org-groups/GetOrgGroupPolicy.go | 31 ++ .../org-groups/GetOrgGroupPolicyOverride.go | 31 ++ .../v2/org-groups/UpdateOrgGroupPolicy.go | 1 + .../UpdateOrgGroupPolicyOverride.go | 2 +- .../scenarios/features/v2/org_groups.feature | 78 ++++- tests/scenarios/features/v2/undo.json | 12 + 29 files changed, 983 insertions(+), 119 deletions(-) create mode 100644 api/datadogV2/model_org_group_policy_enforcement_tier.go create mode 100644 api/datadogV2/model_org_group_policy_policy_type.go create mode 100644 examples/v2/org-groups/GetOrgGroupPolicy.go create mode 100644 examples/v2/org-groups/GetOrgGroupPolicyOverride.go diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 2994c0bb30b..30596739d0f 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. @@ -62654,19 +62686,23 @@ components: - DONE - TIMEOUT SecurityMonitoringContentPackActivation: - description: The activation status of a content pack + description: The activation status of a content pack. enum: - never_activated - activated - deactivated example: activated type: string + x-enum-descriptions: + - Pack has never been activated for this organization. + - Pack is currently activated. + - Pack was previously activated but has since been deactivated. x-enum-varnames: - NEVER_ACTIVATED - ACTIVATED - DEACTIVATED SecurityMonitoringContentPackIntegrationStatus: - description: The installation status of the related integration + description: The installation status of the related integration. enum: - installed - available @@ -62675,6 +62711,12 @@ components: - error example: installed type: string + x-enum-descriptions: + - Integration is fully installed. + - Integration exists in the catalog but is not installed. + - Integration is only partially configured. + - Integration detected (for example, logs are flowing) but not explicitly installed. + - Integration is in an error state. x-enum-varnames: - INSTALLED - AVAILABLE @@ -62691,7 +62733,9 @@ components: cp_activation: $ref: "#/components/schemas/SecurityMonitoringContentPackActivation" filters_configured_for_logs: - description: Whether filters (Security Filters or Index Query depending on the pricing model) are configured for logs + description: |- + Whether filters (Security Filters or Index Query depending on the pricing model) are + present and correctly configured to route logs into Cloud SIEM. example: true type: boolean integration_installed_status: @@ -62699,7 +62743,7 @@ components: logs_last_collected: $ref: "#/components/schemas/SecurityMonitoringContentPackTimestampBucket" logs_seen_from_any_index: - description: Whether logs have been seen from any index + description: Whether logs for this content pack have been seen in any Datadog index within the last 72 hours. example: true type: boolean state: @@ -62764,7 +62808,7 @@ components: - meta type: object SecurityMonitoringContentPackStatus: - description: The current status of a content pack + description: The current operational status of a content pack. enum: - install - activate @@ -62774,6 +62818,13 @@ components: - broken example: active type: string + x-enum-descriptions: + - Not activated; no logs detected in the last 72 hours. + - Not activated; logs are flowing into a Datadog index but not yet routed through Cloud SIEM. + - Activated; awaiting first log ingestion. + - Activated; logs received within the last 24 hours. + - Activated; integration not installed or logs last seen 24 to 72 hours ago. + - Activated; no logs for over 72 hours, filter missing, or Cloud SIEM index incorrectly ordered. x-enum-varnames: - INSTALL - ACTIVATE @@ -62782,7 +62833,7 @@ components: - WARNING - BROKEN SecurityMonitoringContentPackTimestampBucket: - description: Timestamp bucket indicating when logs were last collected + description: Timestamp bucket indicating when logs were last collected. enum: - not_seen - within_24_hours @@ -62791,6 +62842,12 @@ components: - over_30d example: within_24_hours type: string + x-enum-descriptions: + - No logs observed. + - Logs received within the last 24 hours. + - Logs last seen 24 to 72 hours ago. + - Logs last seen 3 to 30 days ago. + - Logs last seen more than 30 days ago. x-enum-varnames: - NOT_SEEN - WITHIN_24_HOURS @@ -63881,7 +63938,7 @@ components: - $ref: "#/components/schemas/SecurityMonitoringSignalRulePayload" - $ref: "#/components/schemas/CloudConfigurationRulePayload" SecurityMonitoringSKU: - description: The SIEM pricing model (SKU) for the organization + description: The Cloud SIEM pricing model (SKU) for the organization. enum: - per_gb_analyzed - per_event_in_siem_index_2023 @@ -108264,7 +108321,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: @@ -108322,7 +108379,7 @@ paths: data: attributes: orgs: - - org_site: "datadoghq.com" + - org_site: "us1" org_uuid: "c3d4e5f6-a7b8-9012-cdef-012345678901" relationships: source_org_group: @@ -108349,7 +108406,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: @@ -108414,7 +108471,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: @@ -108495,7 +108552,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: @@ -108563,9 +108620,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: @@ -108621,7 +108679,9 @@ paths: attributes: content: value: "UTC" + enforcement_tier: "DEFAULT" policy_name: "monitor_timezone" + policy_type: "org_config" relationships: org_group: data: @@ -108642,9 +108702,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: @@ -108734,8 +108795,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" @@ -108749,6 +108875,7 @@ paths: attributes: content: value: "US/Eastern" + enforcement_tier: "ENFORCE" id: "1a2b3c4d-5e6f-7890-abcd-ef0123456789" type: org_group_policies schema: @@ -108765,9 +108892,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: @@ -108881,7 +109009,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: @@ -108940,7 +109068,7 @@ paths: value: data: attributes: - org_site: "datadoghq.com" + org_site: "us1" org_uuid: "c3d4e5f6-a7b8-9012-cdef-012345678901" relationships: org_group: @@ -108966,7 +109094,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: @@ -109061,6 +109189,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 @@ -109074,7 +109269,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 @@ -109092,7 +109287,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: @@ -109164,7 +109359,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 @@ -109231,7 +109426,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 @@ -109334,7 +109529,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 @@ -109407,7 +109602,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 @@ -118804,9 +118999,8 @@ paths: /api/v2/security_monitoring/content_packs/states: get: description: |- - Get the activation and configuration states for all security monitoring content packs. - This endpoint returns status information about each content pack including activation state, - integration status, and log collection status. + Get the activation state, integration status, and log collection status + for all Cloud SIEM content packs. operationId: GetContentPacksStates responses: "200": @@ -118829,21 +119023,31 @@ paths: description: Not Found "429": $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_monitoring_filters_read summary: Get content pack states tags: - Security Monitoring + "x-permission": + operator: OR + permissions: + - security_monitoring_filters_read + - logs_read_index_data 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/). /api/v2/security_monitoring/content_packs/{content_pack_id}/activate: put: description: |- - Activate a security monitoring content pack. This operation configures the necessary + Activate a Cloud SIEM content pack. This operation configures the necessary log filters or security filters depending on the pricing model and updates the content pack activation state. operationId: ActivateContentPack parameters: - - description: The ID of the content pack to activate. + - description: The ID of the content pack to activate (for example, `aws-cloudtrail`). in: path name: content_pack_id required: true @@ -118867,20 +119071,30 @@ paths: description: Not Found "429": $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_monitoring_filters_write summary: Activate content pack tags: - Security Monitoring + "x-permission": + operator: OR + permissions: + - security_monitoring_filters_write + - logs_modify_indexes 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/). /api/v2/security_monitoring/content_packs/{content_pack_id}/deactivate: put: description: |- - Deactivate a security monitoring content pack. This operation removes the content pack's + Deactivate a Cloud SIEM content pack. This operation removes the content pack's configuration from log filters or security filters and updates the content pack activation state. operationId: DeactivateContentPack parameters: - - description: The ID of the content pack to deactivate. + - description: The ID of the content pack to deactivate (for example, `aws-cloudtrail`). in: path name: content_pack_id required: true @@ -118904,9 +119118,19 @@ paths: description: Not Found "429": $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_monitoring_filters_write summary: Deactivate content pack tags: - Security Monitoring + "x-permission": + operator: OR + permissions: + - security_monitoring_filters_write + - logs_modify_indexes 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/). diff --git a/api/datadog/configuration.go b/api/datadog/configuration.go index 31a81e73467..33bdb3dcfbe 100644 --- a/api/datadog/configuration.go +++ b/api/datadog/configuration.go @@ -874,6 +874,8 @@ func NewConfiguration() *Configuration { "v2.DeleteOrgGroupPolicyOverride": false, "v2.GetOrgGroup": false, "v2.GetOrgGroupMembership": false, + "v2.GetOrgGroupPolicy": false, + "v2.GetOrgGroupPolicyOverride": false, "v2.ListOrgGroupMemberships": false, "v2.ListOrgGroupPolicies": false, "v2.ListOrgGroupPolicyConfigs": false, diff --git a/api/datadogV2/api_org_groups.go b/api/datadogV2/api_org_groups.go index c9cf0509896..94c720f3116 100644 --- a/api/datadogV2/api_org_groups.go +++ b/api/datadogV2/api_org_groups.go @@ -860,6 +860,198 @@ func (a *OrgGroupsApi) GetOrgGroupMembership(ctx _context.Context, orgGroupMembe return localVarReturnValue, localVarHTTPResponse, nil } +// GetOrgGroupPolicy Get an org group policy. +// Get a specific organization group policy by its ID. +func (a *OrgGroupsApi) GetOrgGroupPolicy(ctx _context.Context, orgGroupPolicyId uuid.UUID) (OrgGroupPolicyResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue OrgGroupPolicyResponse + ) + + operationId := "v2.GetOrgGroupPolicy" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.OrgGroupsApi.GetOrgGroupPolicy") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/org_group_policies/{org_group_policy_id}" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{org_group_policy_id}", _neturl.PathEscape(datadog.ParameterToString(orgGroupPolicyId, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Accept"] = "application/json" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// GetOrgGroupPolicyOverride Get an org group policy override. +// Get a specific organization group policy override by its ID. +func (a *OrgGroupsApi) GetOrgGroupPolicyOverride(ctx _context.Context, orgGroupPolicyOverrideId uuid.UUID) (OrgGroupPolicyOverrideResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue OrgGroupPolicyOverrideResponse + ) + + operationId := "v2.GetOrgGroupPolicyOverride" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.OrgGroupsApi.GetOrgGroupPolicyOverride") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/org_group_policy_overrides/{org_group_policy_override_id}" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{org_group_policy_override_id}", _neturl.PathEscape(datadog.ParameterToString(orgGroupPolicyOverrideId, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Accept"] = "application/json" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + // ListOrgGroupMembershipsOptionalParameters holds optional parameters for ListOrgGroupMemberships. type ListOrgGroupMembershipsOptionalParameters struct { FilterOrgGroupId *uuid.UUID @@ -1778,7 +1970,7 @@ func (a *OrgGroupsApi) UpdateOrgGroupMembership(ctx _context.Context, orgGroupMe } // UpdateOrgGroupPolicy Update an org group policy. -// Update the content of an existing organization group policy. +// Update an existing organization group policy. func (a *OrgGroupsApi) UpdateOrgGroupPolicy(ctx _context.Context, orgGroupPolicyId uuid.UUID, body OrgGroupPolicyUpdateRequest) (OrgGroupPolicyResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPatch diff --git a/api/datadogV2/api_security_monitoring.go b/api/datadogV2/api_security_monitoring.go index 1955be167ba..d0fcf5e6674 100644 --- a/api/datadogV2/api_security_monitoring.go +++ b/api/datadogV2/api_security_monitoring.go @@ -21,7 +21,7 @@ import ( type SecurityMonitoringApi datadog.Service // ActivateContentPack Activate content pack. -// Activate a security monitoring content pack. This operation configures the necessary +// Activate a Cloud SIEM content pack. This operation configures the necessary // log filters or security filters depending on the pricing model and updates the content // pack activation state. func (a *SecurityMonitoringApi) ActivateContentPack(ctx _context.Context, contentPackId string) (*_nethttp.Response, error) { @@ -1844,7 +1844,7 @@ func (a *SecurityMonitoringApi) CreateVulnerabilityNotificationRule(ctx _context } // DeactivateContentPack Deactivate content pack. -// Deactivate a security monitoring content pack. This operation removes the content pack's +// Deactivate a Cloud SIEM content pack. This operation removes the content pack's // configuration from log filters or security filters and updates the content pack activation state. func (a *SecurityMonitoringApi) DeactivateContentPack(ctx _context.Context, contentPackId string) (*_nethttp.Response, error) { var ( @@ -2989,9 +2989,8 @@ func (a *SecurityMonitoringApi) ExportSecurityMonitoringTerraformResource(ctx _c } // GetContentPacksStates Get content pack states. -// Get the activation and configuration states for all security monitoring content packs. -// This endpoint returns status information about each content pack including activation state, -// integration status, and log collection status. +// Get the activation state, integration status, and log collection status +// for all Cloud SIEM content packs. func (a *SecurityMonitoringApi) GetContentPacksStates(ctx _context.Context) (SecurityMonitoringContentPackStatesResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet diff --git a/api/datadogV2/doc.go b/api/datadogV2/doc.go index fc087c10d58..7fe758c9360 100644 --- a/api/datadogV2/doc.go +++ b/api/datadogV2/doc.go @@ -619,6 +619,8 @@ // - [OrgGroupsApi.DeleteOrgGroupPolicyOverride] // - [OrgGroupsApi.GetOrgGroup] // - [OrgGroupsApi.GetOrgGroupMembership] +// - [OrgGroupsApi.GetOrgGroupPolicy] +// - [OrgGroupsApi.GetOrgGroupPolicyOverride] // - [OrgGroupsApi.ListOrgGroupMemberships] // - [OrgGroupsApi.ListOrgGroupPolicies] // - [OrgGroupsApi.ListOrgGroupPolicyConfigs] diff --git a/api/datadogV2/model_org_group_policy_attributes.go b/api/datadogV2/model_org_group_policy_attributes.go index 7e8dbbd5985..991bcf818bf 100644 --- a/api/datadogV2/model_org_group_policy_attributes.go +++ b/api/datadogV2/model_org_group_policy_attributes.go @@ -15,12 +15,14 @@ import ( type OrgGroupPolicyAttributes struct { // The policy content as key-value pairs. Content map[string]interface{} `json:"content,omitempty"` - // Timestamp when the policy was enforced. - EnforcedAt time.Time `json:"enforced_at"` + // 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 `json:"enforcement_tier"` // Timestamp when the policy was last modified. ModifiedAt time.Time `json:"modified_at"` // The name of the policy. PolicyName string `json:"policy_name"` + // The type of the policy. Only `org_config` is supported, indicating a policy backed by an organization configuration setting. + PolicyType OrgGroupPolicyPolicyType `json:"policy_type"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` @@ -30,11 +32,12 @@ type OrgGroupPolicyAttributes struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed. -func NewOrgGroupPolicyAttributes(enforcedAt time.Time, modifiedAt time.Time, policyName string) *OrgGroupPolicyAttributes { +func NewOrgGroupPolicyAttributes(enforcementTier OrgGroupPolicyEnforcementTier, modifiedAt time.Time, policyName string, policyType OrgGroupPolicyPolicyType) *OrgGroupPolicyAttributes { this := OrgGroupPolicyAttributes{} - this.EnforcedAt = enforcedAt + this.EnforcementTier = enforcementTier this.ModifiedAt = modifiedAt this.PolicyName = policyName + this.PolicyType = policyType return &this } @@ -43,6 +46,10 @@ func NewOrgGroupPolicyAttributes(enforcedAt time.Time, modifiedAt time.Time, pol // but it doesn't guarantee that properties required by API are set. func NewOrgGroupPolicyAttributesWithDefaults() *OrgGroupPolicyAttributes { this := OrgGroupPolicyAttributes{} + var enforcementTier OrgGroupPolicyEnforcementTier = ORGGROUPPOLICYENFORCEMENTTIER_DEFAULT + this.EnforcementTier = enforcementTier + var policyType OrgGroupPolicyPolicyType = ORGGROUPPOLICYPOLICYTYPE_ORG_CONFIG + this.PolicyType = policyType return &this } @@ -74,27 +81,27 @@ func (o *OrgGroupPolicyAttributes) SetContent(v map[string]interface{}) { o.Content = v } -// GetEnforcedAt returns the EnforcedAt field value. -func (o *OrgGroupPolicyAttributes) GetEnforcedAt() time.Time { +// GetEnforcementTier returns the EnforcementTier field value. +func (o *OrgGroupPolicyAttributes) GetEnforcementTier() OrgGroupPolicyEnforcementTier { if o == nil { - var ret time.Time + var ret OrgGroupPolicyEnforcementTier return ret } - return o.EnforcedAt + return o.EnforcementTier } -// GetEnforcedAtOk returns a tuple with the EnforcedAt field value +// GetEnforcementTierOk returns a tuple with the EnforcementTier field value // and a boolean to check if the value has been set. -func (o *OrgGroupPolicyAttributes) GetEnforcedAtOk() (*time.Time, bool) { +func (o *OrgGroupPolicyAttributes) GetEnforcementTierOk() (*OrgGroupPolicyEnforcementTier, bool) { if o == nil { return nil, false } - return &o.EnforcedAt, true + return &o.EnforcementTier, true } -// SetEnforcedAt sets field value. -func (o *OrgGroupPolicyAttributes) SetEnforcedAt(v time.Time) { - o.EnforcedAt = v +// SetEnforcementTier sets field value. +func (o *OrgGroupPolicyAttributes) SetEnforcementTier(v OrgGroupPolicyEnforcementTier) { + o.EnforcementTier = v } // GetModifiedAt returns the ModifiedAt field value. @@ -143,6 +150,29 @@ func (o *OrgGroupPolicyAttributes) SetPolicyName(v string) { o.PolicyName = v } +// GetPolicyType returns the PolicyType field value. +func (o *OrgGroupPolicyAttributes) GetPolicyType() OrgGroupPolicyPolicyType { + if o == nil { + var ret OrgGroupPolicyPolicyType + return ret + } + return o.PolicyType +} + +// GetPolicyTypeOk returns a tuple with the PolicyType field value +// and a boolean to check if the value has been set. +func (o *OrgGroupPolicyAttributes) GetPolicyTypeOk() (*OrgGroupPolicyPolicyType, bool) { + if o == nil { + return nil, false + } + return &o.PolicyType, true +} + +// SetPolicyType sets field value. +func (o *OrgGroupPolicyAttributes) SetPolicyType(v OrgGroupPolicyPolicyType) { + o.PolicyType = v +} + // MarshalJSON serializes the struct using spec logic. func (o OrgGroupPolicyAttributes) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -152,17 +182,14 @@ func (o OrgGroupPolicyAttributes) MarshalJSON() ([]byte, error) { if o.Content != nil { toSerialize["content"] = o.Content } - if o.EnforcedAt.Nanosecond() == 0 { - toSerialize["enforced_at"] = o.EnforcedAt.Format("2006-01-02T15:04:05Z07:00") - } else { - toSerialize["enforced_at"] = o.EnforcedAt.Format("2006-01-02T15:04:05.000Z07:00") - } + toSerialize["enforcement_tier"] = o.EnforcementTier if o.ModifiedAt.Nanosecond() == 0 { toSerialize["modified_at"] = o.ModifiedAt.Format("2006-01-02T15:04:05Z07:00") } else { toSerialize["modified_at"] = o.ModifiedAt.Format("2006-01-02T15:04:05.000Z07:00") } toSerialize["policy_name"] = o.PolicyName + toSerialize["policy_type"] = o.PolicyType for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -173,16 +200,17 @@ func (o OrgGroupPolicyAttributes) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *OrgGroupPolicyAttributes) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Content map[string]interface{} `json:"content,omitempty"` - EnforcedAt *time.Time `json:"enforced_at"` - ModifiedAt *time.Time `json:"modified_at"` - PolicyName *string `json:"policy_name"` + Content map[string]interface{} `json:"content,omitempty"` + EnforcementTier *OrgGroupPolicyEnforcementTier `json:"enforcement_tier"` + ModifiedAt *time.Time `json:"modified_at"` + PolicyName *string `json:"policy_name"` + PolicyType *OrgGroupPolicyPolicyType `json:"policy_type"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { return datadog.Unmarshal(bytes, &o.UnparsedObject) } - if all.EnforcedAt == nil { - return fmt.Errorf("required field enforced_at missing") + if all.EnforcementTier == nil { + return fmt.Errorf("required field enforcement_tier missing") } if all.ModifiedAt == nil { return fmt.Errorf("required field modified_at missing") @@ -190,20 +218,38 @@ func (o *OrgGroupPolicyAttributes) UnmarshalJSON(bytes []byte) (err error) { if all.PolicyName == nil { return fmt.Errorf("required field policy_name missing") } + if all.PolicyType == nil { + return fmt.Errorf("required field policy_type missing") + } additionalProperties := make(map[string]interface{}) if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"content", "enforced_at", "modified_at", "policy_name"}) + datadog.DeleteKeys(additionalProperties, &[]string{"content", "enforcement_tier", "modified_at", "policy_name", "policy_type"}) } else { return err } + + hasInvalidField := false o.Content = all.Content - o.EnforcedAt = *all.EnforcedAt + if !all.EnforcementTier.IsValid() { + hasInvalidField = true + } else { + o.EnforcementTier = *all.EnforcementTier + } o.ModifiedAt = *all.ModifiedAt o.PolicyName = *all.PolicyName + if !all.PolicyType.IsValid() { + hasInvalidField = true + } else { + o.PolicyType = *all.PolicyType + } if len(additionalProperties) > 0 { o.AdditionalProperties = additionalProperties } + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + return nil } diff --git a/api/datadogV2/model_org_group_policy_create_attributes.go b/api/datadogV2/model_org_group_policy_create_attributes.go index 750d72688b7..6abfed21957 100644 --- a/api/datadogV2/model_org_group_policy_create_attributes.go +++ b/api/datadogV2/model_org_group_policy_create_attributes.go @@ -10,12 +10,16 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// OrgGroupPolicyCreateAttributes Attributes for creating an org group policy. +// OrgGroupPolicyCreateAttributes Attributes for creating an org group policy. If `policy_type` or `enforcement_tier` are not provided, they default to `org_config` and `DEFAULT` respectively. type OrgGroupPolicyCreateAttributes struct { // The policy content as key-value pairs. Content map[string]interface{} `json:"content"` + // 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 `json:"enforcement_tier,omitempty"` // The name of the policy. PolicyName string `json:"policy_name"` + // The type of the policy. Only `org_config` is supported, indicating a policy backed by an organization configuration setting. + PolicyType *OrgGroupPolicyPolicyType `json:"policy_type,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` @@ -28,7 +32,11 @@ type OrgGroupPolicyCreateAttributes struct { func NewOrgGroupPolicyCreateAttributes(content map[string]interface{}, policyName string) *OrgGroupPolicyCreateAttributes { this := OrgGroupPolicyCreateAttributes{} this.Content = content + var enforcementTier OrgGroupPolicyEnforcementTier = ORGGROUPPOLICYENFORCEMENTTIER_DEFAULT + this.EnforcementTier = &enforcementTier this.PolicyName = policyName + var policyType OrgGroupPolicyPolicyType = ORGGROUPPOLICYPOLICYTYPE_ORG_CONFIG + this.PolicyType = &policyType return &this } @@ -37,6 +45,10 @@ func NewOrgGroupPolicyCreateAttributes(content map[string]interface{}, policyNam // but it doesn't guarantee that properties required by API are set. func NewOrgGroupPolicyCreateAttributesWithDefaults() *OrgGroupPolicyCreateAttributes { this := OrgGroupPolicyCreateAttributes{} + var enforcementTier OrgGroupPolicyEnforcementTier = ORGGROUPPOLICYENFORCEMENTTIER_DEFAULT + this.EnforcementTier = &enforcementTier + var policyType OrgGroupPolicyPolicyType = ORGGROUPPOLICYPOLICYTYPE_ORG_CONFIG + this.PolicyType = &policyType return &this } @@ -63,6 +75,34 @@ func (o *OrgGroupPolicyCreateAttributes) SetContent(v map[string]interface{}) { o.Content = v } +// GetEnforcementTier returns the EnforcementTier field value if set, zero value otherwise. +func (o *OrgGroupPolicyCreateAttributes) GetEnforcementTier() OrgGroupPolicyEnforcementTier { + if o == nil || o.EnforcementTier == nil { + var ret OrgGroupPolicyEnforcementTier + return ret + } + return *o.EnforcementTier +} + +// GetEnforcementTierOk returns a tuple with the EnforcementTier field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrgGroupPolicyCreateAttributes) GetEnforcementTierOk() (*OrgGroupPolicyEnforcementTier, bool) { + if o == nil || o.EnforcementTier == nil { + return nil, false + } + return o.EnforcementTier, true +} + +// HasEnforcementTier returns a boolean if a field has been set. +func (o *OrgGroupPolicyCreateAttributes) HasEnforcementTier() bool { + return o != nil && o.EnforcementTier != nil +} + +// SetEnforcementTier gets a reference to the given OrgGroupPolicyEnforcementTier and assigns it to the EnforcementTier field. +func (o *OrgGroupPolicyCreateAttributes) SetEnforcementTier(v OrgGroupPolicyEnforcementTier) { + o.EnforcementTier = &v +} + // GetPolicyName returns the PolicyName field value. func (o *OrgGroupPolicyCreateAttributes) GetPolicyName() string { if o == nil { @@ -86,6 +126,34 @@ func (o *OrgGroupPolicyCreateAttributes) SetPolicyName(v string) { o.PolicyName = v } +// GetPolicyType returns the PolicyType field value if set, zero value otherwise. +func (o *OrgGroupPolicyCreateAttributes) GetPolicyType() OrgGroupPolicyPolicyType { + if o == nil || o.PolicyType == nil { + var ret OrgGroupPolicyPolicyType + return ret + } + return *o.PolicyType +} + +// GetPolicyTypeOk returns a tuple with the PolicyType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrgGroupPolicyCreateAttributes) GetPolicyTypeOk() (*OrgGroupPolicyPolicyType, bool) { + if o == nil || o.PolicyType == nil { + return nil, false + } + return o.PolicyType, true +} + +// HasPolicyType returns a boolean if a field has been set. +func (o *OrgGroupPolicyCreateAttributes) HasPolicyType() bool { + return o != nil && o.PolicyType != nil +} + +// SetPolicyType gets a reference to the given OrgGroupPolicyPolicyType and assigns it to the PolicyType field. +func (o *OrgGroupPolicyCreateAttributes) SetPolicyType(v OrgGroupPolicyPolicyType) { + o.PolicyType = &v +} + // MarshalJSON serializes the struct using spec logic. func (o OrgGroupPolicyCreateAttributes) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -93,7 +161,13 @@ func (o OrgGroupPolicyCreateAttributes) MarshalJSON() ([]byte, error) { return datadog.Marshal(o.UnparsedObject) } toSerialize["content"] = o.Content + if o.EnforcementTier != nil { + toSerialize["enforcement_tier"] = o.EnforcementTier + } toSerialize["policy_name"] = o.PolicyName + if o.PolicyType != nil { + toSerialize["policy_type"] = o.PolicyType + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -104,8 +178,10 @@ func (o OrgGroupPolicyCreateAttributes) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *OrgGroupPolicyCreateAttributes) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Content *map[string]interface{} `json:"content"` - PolicyName *string `json:"policy_name"` + Content *map[string]interface{} `json:"content"` + EnforcementTier *OrgGroupPolicyEnforcementTier `json:"enforcement_tier,omitempty"` + PolicyName *string `json:"policy_name"` + PolicyType *OrgGroupPolicyPolicyType `json:"policy_type,omitempty"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { return datadog.Unmarshal(bytes, &o.UnparsedObject) @@ -118,16 +194,32 @@ func (o *OrgGroupPolicyCreateAttributes) UnmarshalJSON(bytes []byte) (err error) } additionalProperties := make(map[string]interface{}) if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"content", "policy_name"}) + datadog.DeleteKeys(additionalProperties, &[]string{"content", "enforcement_tier", "policy_name", "policy_type"}) } else { return err } + + hasInvalidField := false o.Content = *all.Content + if all.EnforcementTier != nil && !all.EnforcementTier.IsValid() { + hasInvalidField = true + } else { + o.EnforcementTier = all.EnforcementTier + } o.PolicyName = *all.PolicyName + if all.PolicyType != nil && !all.PolicyType.IsValid() { + hasInvalidField = true + } else { + o.PolicyType = all.PolicyType + } if len(additionalProperties) > 0 { o.AdditionalProperties = additionalProperties } + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + return nil } diff --git a/api/datadogV2/model_org_group_policy_create_data.go b/api/datadogV2/model_org_group_policy_create_data.go index 17c95127d1c..0cacd6cdb3f 100644 --- a/api/datadogV2/model_org_group_policy_create_data.go +++ b/api/datadogV2/model_org_group_policy_create_data.go @@ -12,7 +12,7 @@ import ( // OrgGroupPolicyCreateData Data for creating an org group policy. type OrgGroupPolicyCreateData struct { - // 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 `json:"attributes"` // Relationships for creating a policy. Relationships OrgGroupPolicyCreateRelationships `json:"relationships"` diff --git a/api/datadogV2/model_org_group_policy_enforcement_tier.go b/api/datadogV2/model_org_group_policy_enforcement_tier.go new file mode 100644 index 00000000000..be22bd23928 --- /dev/null +++ b/api/datadogV2/model_org_group_policy_enforcement_tier.go @@ -0,0 +1,68 @@ +// 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 datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// OrgGroupPolicyEnforcementTier 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. +type OrgGroupPolicyEnforcementTier string + +// List of OrgGroupPolicyEnforcementTier. +const ( + ORGGROUPPOLICYENFORCEMENTTIER_DEFAULT OrgGroupPolicyEnforcementTier = "DEFAULT" + ORGGROUPPOLICYENFORCEMENTTIER_ENFORCE OrgGroupPolicyEnforcementTier = "ENFORCE" + ORGGROUPPOLICYENFORCEMENTTIER_DELEGATE OrgGroupPolicyEnforcementTier = "DELEGATE" +) + +var allowedOrgGroupPolicyEnforcementTierEnumValues = []OrgGroupPolicyEnforcementTier{ + ORGGROUPPOLICYENFORCEMENTTIER_DEFAULT, + ORGGROUPPOLICYENFORCEMENTTIER_ENFORCE, + ORGGROUPPOLICYENFORCEMENTTIER_DELEGATE, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *OrgGroupPolicyEnforcementTier) GetAllowedValues() []OrgGroupPolicyEnforcementTier { + return allowedOrgGroupPolicyEnforcementTierEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *OrgGroupPolicyEnforcementTier) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = OrgGroupPolicyEnforcementTier(value) + return nil +} + +// NewOrgGroupPolicyEnforcementTierFromValue returns a pointer to a valid OrgGroupPolicyEnforcementTier +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewOrgGroupPolicyEnforcementTierFromValue(v string) (*OrgGroupPolicyEnforcementTier, error) { + ev := OrgGroupPolicyEnforcementTier(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for OrgGroupPolicyEnforcementTier: valid values are %v", v, allowedOrgGroupPolicyEnforcementTierEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v OrgGroupPolicyEnforcementTier) IsValid() bool { + for _, existing := range allowedOrgGroupPolicyEnforcementTierEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to OrgGroupPolicyEnforcementTier value. +func (v OrgGroupPolicyEnforcementTier) Ptr() *OrgGroupPolicyEnforcementTier { + return &v +} diff --git a/api/datadogV2/model_org_group_policy_override_update_attributes.go b/api/datadogV2/model_org_group_policy_override_update_attributes.go index 79826362c25..13c1f39dca8 100644 --- a/api/datadogV2/model_org_group_policy_override_update_attributes.go +++ b/api/datadogV2/model_org_group_policy_override_update_attributes.go @@ -12,7 +12,7 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// OrgGroupPolicyOverrideUpdateAttributes Attributes for updating a policy override. +// OrgGroupPolicyOverrideUpdateAttributes Attributes for updating a policy override. The `org_uuid` and `org_site` fields must match the existing override and cannot be changed. type OrgGroupPolicyOverrideUpdateAttributes struct { // The site of the organization. OrgSite string `json:"org_site"` diff --git a/api/datadogV2/model_org_group_policy_override_update_data.go b/api/datadogV2/model_org_group_policy_override_update_data.go index 387cda78190..a3d2667eb71 100644 --- a/api/datadogV2/model_org_group_policy_override_update_data.go +++ b/api/datadogV2/model_org_group_policy_override_update_data.go @@ -14,7 +14,7 @@ import ( // OrgGroupPolicyOverrideUpdateData Data for updating a policy override. type OrgGroupPolicyOverrideUpdateData struct { - // 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 `json:"attributes"` // The ID of the policy override. Id uuid.UUID `json:"id"` diff --git a/api/datadogV2/model_org_group_policy_policy_type.go b/api/datadogV2/model_org_group_policy_policy_type.go new file mode 100644 index 00000000000..347d0a4038c --- /dev/null +++ b/api/datadogV2/model_org_group_policy_policy_type.go @@ -0,0 +1,64 @@ +// 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 datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// OrgGroupPolicyPolicyType The type of the policy. Only `org_config` is supported, indicating a policy backed by an organization configuration setting. +type OrgGroupPolicyPolicyType string + +// List of OrgGroupPolicyPolicyType. +const ( + ORGGROUPPOLICYPOLICYTYPE_ORG_CONFIG OrgGroupPolicyPolicyType = "org_config" +) + +var allowedOrgGroupPolicyPolicyTypeEnumValues = []OrgGroupPolicyPolicyType{ + ORGGROUPPOLICYPOLICYTYPE_ORG_CONFIG, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *OrgGroupPolicyPolicyType) GetAllowedValues() []OrgGroupPolicyPolicyType { + return allowedOrgGroupPolicyPolicyTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *OrgGroupPolicyPolicyType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = OrgGroupPolicyPolicyType(value) + return nil +} + +// NewOrgGroupPolicyPolicyTypeFromValue returns a pointer to a valid OrgGroupPolicyPolicyType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewOrgGroupPolicyPolicyTypeFromValue(v string) (*OrgGroupPolicyPolicyType, error) { + ev := OrgGroupPolicyPolicyType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for OrgGroupPolicyPolicyType: valid values are %v", v, allowedOrgGroupPolicyPolicyTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v OrgGroupPolicyPolicyType) IsValid() bool { + for _, existing := range allowedOrgGroupPolicyPolicyTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to OrgGroupPolicyPolicyType value. +func (v OrgGroupPolicyPolicyType) Ptr() *OrgGroupPolicyPolicyType { + return &v +} diff --git a/api/datadogV2/model_org_group_policy_update_attributes.go b/api/datadogV2/model_org_group_policy_update_attributes.go index 834e6e129f7..7435909b3d5 100644 --- a/api/datadogV2/model_org_group_policy_update_attributes.go +++ b/api/datadogV2/model_org_group_policy_update_attributes.go @@ -12,6 +12,8 @@ import ( type OrgGroupPolicyUpdateAttributes struct { // The policy content as key-value pairs. Content map[string]interface{} `json:"content,omitempty"` + // 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 `json:"enforcement_tier,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` @@ -23,6 +25,8 @@ type OrgGroupPolicyUpdateAttributes struct { // will change when the set of required properties is changed. func NewOrgGroupPolicyUpdateAttributes() *OrgGroupPolicyUpdateAttributes { this := OrgGroupPolicyUpdateAttributes{} + var enforcementTier OrgGroupPolicyEnforcementTier = ORGGROUPPOLICYENFORCEMENTTIER_DEFAULT + this.EnforcementTier = &enforcementTier return &this } @@ -31,6 +35,8 @@ func NewOrgGroupPolicyUpdateAttributes() *OrgGroupPolicyUpdateAttributes { // but it doesn't guarantee that properties required by API are set. func NewOrgGroupPolicyUpdateAttributesWithDefaults() *OrgGroupPolicyUpdateAttributes { this := OrgGroupPolicyUpdateAttributes{} + var enforcementTier OrgGroupPolicyEnforcementTier = ORGGROUPPOLICYENFORCEMENTTIER_DEFAULT + this.EnforcementTier = &enforcementTier return &this } @@ -62,6 +68,34 @@ func (o *OrgGroupPolicyUpdateAttributes) SetContent(v map[string]interface{}) { o.Content = v } +// GetEnforcementTier returns the EnforcementTier field value if set, zero value otherwise. +func (o *OrgGroupPolicyUpdateAttributes) GetEnforcementTier() OrgGroupPolicyEnforcementTier { + if o == nil || o.EnforcementTier == nil { + var ret OrgGroupPolicyEnforcementTier + return ret + } + return *o.EnforcementTier +} + +// GetEnforcementTierOk returns a tuple with the EnforcementTier field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrgGroupPolicyUpdateAttributes) GetEnforcementTierOk() (*OrgGroupPolicyEnforcementTier, bool) { + if o == nil || o.EnforcementTier == nil { + return nil, false + } + return o.EnforcementTier, true +} + +// HasEnforcementTier returns a boolean if a field has been set. +func (o *OrgGroupPolicyUpdateAttributes) HasEnforcementTier() bool { + return o != nil && o.EnforcementTier != nil +} + +// SetEnforcementTier gets a reference to the given OrgGroupPolicyEnforcementTier and assigns it to the EnforcementTier field. +func (o *OrgGroupPolicyUpdateAttributes) SetEnforcementTier(v OrgGroupPolicyEnforcementTier) { + o.EnforcementTier = &v +} + // MarshalJSON serializes the struct using spec logic. func (o OrgGroupPolicyUpdateAttributes) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} @@ -71,6 +105,9 @@ func (o OrgGroupPolicyUpdateAttributes) MarshalJSON() ([]byte, error) { if o.Content != nil { toSerialize["content"] = o.Content } + if o.EnforcementTier != nil { + toSerialize["enforcement_tier"] = o.EnforcementTier + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -81,22 +118,34 @@ func (o OrgGroupPolicyUpdateAttributes) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *OrgGroupPolicyUpdateAttributes) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Content map[string]interface{} `json:"content,omitempty"` + Content map[string]interface{} `json:"content,omitempty"` + EnforcementTier *OrgGroupPolicyEnforcementTier `json:"enforcement_tier,omitempty"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { return datadog.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"content"}) + datadog.DeleteKeys(additionalProperties, &[]string{"content", "enforcement_tier"}) } else { return err } + + hasInvalidField := false o.Content = all.Content + if all.EnforcementTier != nil && !all.EnforcementTier.IsValid() { + hasInvalidField = true + } else { + o.EnforcementTier = all.EnforcementTier + } if len(additionalProperties) > 0 { o.AdditionalProperties = additionalProperties } + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + return nil } diff --git a/api/datadogV2/model_security_monitoring_content_pack_activation.go b/api/datadogV2/model_security_monitoring_content_pack_activation.go index 673d8e2ba50..e70f331478d 100644 --- a/api/datadogV2/model_security_monitoring_content_pack_activation.go +++ b/api/datadogV2/model_security_monitoring_content_pack_activation.go @@ -10,7 +10,7 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// SecurityMonitoringContentPackActivation The activation status of a content pack +// SecurityMonitoringContentPackActivation The activation status of a content pack. type SecurityMonitoringContentPackActivation string // List of SecurityMonitoringContentPackActivation. diff --git a/api/datadogV2/model_security_monitoring_content_pack_integration_status.go b/api/datadogV2/model_security_monitoring_content_pack_integration_status.go index d7c5f09baec..1b4ea318a38 100644 --- a/api/datadogV2/model_security_monitoring_content_pack_integration_status.go +++ b/api/datadogV2/model_security_monitoring_content_pack_integration_status.go @@ -10,7 +10,7 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// SecurityMonitoringContentPackIntegrationStatus The installation status of the related integration +// SecurityMonitoringContentPackIntegrationStatus The installation status of the related integration. type SecurityMonitoringContentPackIntegrationStatus string // List of SecurityMonitoringContentPackIntegrationStatus. diff --git a/api/datadogV2/model_security_monitoring_content_pack_state_attributes.go b/api/datadogV2/model_security_monitoring_content_pack_state_attributes.go index 7d001030df4..36e01cd2669 100644 --- a/api/datadogV2/model_security_monitoring_content_pack_state_attributes.go +++ b/api/datadogV2/model_security_monitoring_content_pack_state_attributes.go @@ -14,17 +14,18 @@ import ( type SecurityMonitoringContentPackStateAttributes struct { // Whether the cloud SIEM index configuration is incorrect (only applies to certain pricing models) CloudSiemIndexIncorrect bool `json:"cloud_siem_index_incorrect"` - // The activation status of a content pack + // The activation status of a content pack. CpActivation SecurityMonitoringContentPackActivation `json:"cp_activation"` - // Whether filters (Security Filters or Index Query depending on the pricing model) are configured for logs + // Whether filters (Security Filters or Index Query depending on the pricing model) are + // present and correctly configured to route logs into Cloud SIEM. FiltersConfiguredForLogs bool `json:"filters_configured_for_logs"` - // The installation status of the related integration + // The installation status of the related integration. IntegrationInstalledStatus *SecurityMonitoringContentPackIntegrationStatus `json:"integration_installed_status,omitempty"` - // Timestamp bucket indicating when logs were last collected + // Timestamp bucket indicating when logs were last collected. LogsLastCollected SecurityMonitoringContentPackTimestampBucket `json:"logs_last_collected"` - // Whether logs have been seen from any index + // Whether logs for this content pack have been seen in any Datadog index within the last 72 hours. LogsSeenFromAnyIndex bool `json:"logs_seen_from_any_index"` - // The current status of a content pack + // The current operational status of a content pack. State SecurityMonitoringContentPackStatus `json:"state"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` diff --git a/api/datadogV2/model_security_monitoring_content_pack_state_meta.go b/api/datadogV2/model_security_monitoring_content_pack_state_meta.go index dace8bc6df1..1bff5e8ac5f 100644 --- a/api/datadogV2/model_security_monitoring_content_pack_state_meta.go +++ b/api/datadogV2/model_security_monitoring_content_pack_state_meta.go @@ -14,7 +14,7 @@ import ( type SecurityMonitoringContentPackStateMeta struct { // Whether the cloud SIEM index configuration is incorrect at the organization level CloudSiemIndexIncorrect bool `json:"cloud_siem_index_incorrect"` - // The SIEM pricing model (SKU) for the organization + // The Cloud SIEM pricing model (SKU) for the organization. Sku SecurityMonitoringSKU `json:"sku"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` diff --git a/api/datadogV2/model_security_monitoring_content_pack_status.go b/api/datadogV2/model_security_monitoring_content_pack_status.go index 6f335fe55da..850ff7bc235 100644 --- a/api/datadogV2/model_security_monitoring_content_pack_status.go +++ b/api/datadogV2/model_security_monitoring_content_pack_status.go @@ -10,7 +10,7 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// SecurityMonitoringContentPackStatus The current status of a content pack +// SecurityMonitoringContentPackStatus The current operational status of a content pack. type SecurityMonitoringContentPackStatus string // List of SecurityMonitoringContentPackStatus. diff --git a/api/datadogV2/model_security_monitoring_content_pack_timestamp_bucket.go b/api/datadogV2/model_security_monitoring_content_pack_timestamp_bucket.go index a3add18c230..bb2975dde6c 100644 --- a/api/datadogV2/model_security_monitoring_content_pack_timestamp_bucket.go +++ b/api/datadogV2/model_security_monitoring_content_pack_timestamp_bucket.go @@ -10,7 +10,7 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// SecurityMonitoringContentPackTimestampBucket Timestamp bucket indicating when logs were last collected +// SecurityMonitoringContentPackTimestampBucket Timestamp bucket indicating when logs were last collected. type SecurityMonitoringContentPackTimestampBucket string // List of SecurityMonitoringContentPackTimestampBucket. diff --git a/api/datadogV2/model_security_monitoring_sku.go b/api/datadogV2/model_security_monitoring_sku.go index 0db8c66d549..24e83bbce3f 100644 --- a/api/datadogV2/model_security_monitoring_sku.go +++ b/api/datadogV2/model_security_monitoring_sku.go @@ -10,7 +10,7 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// SecurityMonitoringSKU The SIEM pricing model (SKU) for the organization +// SecurityMonitoringSKU The Cloud SIEM pricing model (SKU) for the organization. type SecurityMonitoringSKU string // List of SecurityMonitoringSKU. diff --git a/examples/v2/org-groups/BulkUpdateOrgGroupMemberships.go b/examples/v2/org-groups/BulkUpdateOrgGroupMemberships.go index 6dce74c1774..10a0c578460 100644 --- a/examples/v2/org-groups/BulkUpdateOrgGroupMemberships.go +++ b/examples/v2/org-groups/BulkUpdateOrgGroupMemberships.go @@ -19,7 +19,7 @@ func main() { Attributes: datadogV2.OrgGroupMembershipBulkUpdateAttributes{ Orgs: []datadogV2.GlobalOrgIdentifier{ { - OrgSite: "datadoghq.com", + OrgSite: "us1", OrgUuid: uuid.MustParse("c3d4e5f6-a7b8-9012-cdef-012345678901"), }, }, diff --git a/examples/v2/org-groups/CreateOrgGroupPolicy.go b/examples/v2/org-groups/CreateOrgGroupPolicy.go index 0636dd5fc10..629d0a7b6d1 100644 --- a/examples/v2/org-groups/CreateOrgGroupPolicy.go +++ b/examples/v2/org-groups/CreateOrgGroupPolicy.go @@ -20,7 +20,9 @@ func main() { Content: map[string]interface{}{ "value": "UTC", }, - PolicyName: "monitor_timezone", + EnforcementTier: datadogV2.ORGGROUPPOLICYENFORCEMENTTIER_DEFAULT.Ptr(), + PolicyName: "monitor_timezone", + PolicyType: datadogV2.ORGGROUPPOLICYPOLICYTYPE_ORG_CONFIG.Ptr(), }, Relationships: datadogV2.OrgGroupPolicyCreateRelationships{ OrgGroup: datadogV2.OrgGroupRelationshipToOne{ diff --git a/examples/v2/org-groups/CreateOrgGroupPolicyOverride.go b/examples/v2/org-groups/CreateOrgGroupPolicyOverride.go index 025656732b4..3c11e16ba52 100644 --- a/examples/v2/org-groups/CreateOrgGroupPolicyOverride.go +++ b/examples/v2/org-groups/CreateOrgGroupPolicyOverride.go @@ -17,7 +17,7 @@ func main() { body := datadogV2.OrgGroupPolicyOverrideCreateRequest{ Data: datadogV2.OrgGroupPolicyOverrideCreateData{ Attributes: datadogV2.OrgGroupPolicyOverrideCreateAttributes{ - OrgSite: "datadoghq.com", + OrgSite: "us1", OrgUuid: uuid.MustParse("c3d4e5f6-a7b8-9012-cdef-012345678901"), }, Relationships: datadogV2.OrgGroupPolicyOverrideCreateRelationships{ diff --git a/examples/v2/org-groups/GetOrgGroupPolicy.go b/examples/v2/org-groups/GetOrgGroupPolicy.go new file mode 100644 index 00000000000..93bcc2447ec --- /dev/null +++ b/examples/v2/org-groups/GetOrgGroupPolicy.go @@ -0,0 +1,31 @@ +// Get an org group policy returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" + "github.com/google/uuid" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.GetOrgGroupPolicy", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewOrgGroupsApi(apiClient) + resp, r, err := api.GetOrgGroupPolicy(ctx, uuid.MustParse("1a2b3c4d-5e6f-7890-abcd-ef0123456789")) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `OrgGroupsApi.GetOrgGroupPolicy`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `OrgGroupsApi.GetOrgGroupPolicy`:\n%s\n", responseContent) +} diff --git a/examples/v2/org-groups/GetOrgGroupPolicyOverride.go b/examples/v2/org-groups/GetOrgGroupPolicyOverride.go new file mode 100644 index 00000000000..f97bb267ba4 --- /dev/null +++ b/examples/v2/org-groups/GetOrgGroupPolicyOverride.go @@ -0,0 +1,31 @@ +// Get an org group policy override returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" + "github.com/google/uuid" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.GetOrgGroupPolicyOverride", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewOrgGroupsApi(apiClient) + resp, r, err := api.GetOrgGroupPolicyOverride(ctx, uuid.MustParse("9f8e7d6c-5b4a-3210-fedc-ba0987654321")) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `OrgGroupsApi.GetOrgGroupPolicyOverride`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `OrgGroupsApi.GetOrgGroupPolicyOverride`:\n%s\n", responseContent) +} diff --git a/examples/v2/org-groups/UpdateOrgGroupPolicy.go b/examples/v2/org-groups/UpdateOrgGroupPolicy.go index 07ae331e69a..8e368f5dbce 100644 --- a/examples/v2/org-groups/UpdateOrgGroupPolicy.go +++ b/examples/v2/org-groups/UpdateOrgGroupPolicy.go @@ -20,6 +20,7 @@ func main() { Content: map[string]interface{}{ "value": "UTC", }, + EnforcementTier: datadogV2.ORGGROUPPOLICYENFORCEMENTTIER_DEFAULT.Ptr(), }, Id: uuid.MustParse("1a2b3c4d-5e6f-7890-abcd-ef0123456789"), Type: datadogV2.ORGGROUPPOLICYTYPE_ORG_GROUP_POLICIES, diff --git a/examples/v2/org-groups/UpdateOrgGroupPolicyOverride.go b/examples/v2/org-groups/UpdateOrgGroupPolicyOverride.go index 1f8bbeef01b..3d43d9b4856 100644 --- a/examples/v2/org-groups/UpdateOrgGroupPolicyOverride.go +++ b/examples/v2/org-groups/UpdateOrgGroupPolicyOverride.go @@ -17,7 +17,7 @@ func main() { body := datadogV2.OrgGroupPolicyOverrideUpdateRequest{ Data: datadogV2.OrgGroupPolicyOverrideUpdateData{ Attributes: datadogV2.OrgGroupPolicyOverrideUpdateAttributes{ - OrgSite: "datadoghq.com", + OrgSite: "us1", OrgUuid: uuid.MustParse("c3d4e5f6-a7b8-9012-cdef-012345678901"), }, Id: uuid.MustParse("9f8e7d6c-5b4a-3210-fedc-ba0987654321"), diff --git a/tests/scenarios/features/v2/org_groups.feature b/tests/scenarios/features/v2/org_groups.feature index 73cce63cd8e..b8c5fe1b61d 100644 --- a/tests/scenarios/features/v2/org_groups.feature +++ b/tests/scenarios/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/tests/scenarios/features/v2/undo.json b/tests/scenarios/features/v2/undo.json index 31f26b91091..9152f6b2278 100644 --- a/tests/scenarios/features/v2/undo.json +++ b/tests/scenarios/features/v2/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": { From d78eefe7e66770eadf1806ad6fb18c7724d59f83 Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Wed, 22 Apr 2026 16:33:44 +0000 Subject: [PATCH 2/2] Rename pat_uuid to pat_id and remove alias field from PAT spec (#3969) Co-authored-by: ci.datadog-api-spec --- .generator/schemas/v2/openapi.yaml | 22 ++++------- api/datadogV2/api_key_management.go | 18 ++++----- api/datadogV2/api_service_accounts.go | 18 ++++----- ...l_full_personal_access_token_attributes.go | 37 +------------------ .../model_personal_access_token_attributes.go | 37 +------------------ api/datadogV2/model_user_attributes.go | 37 ++++++++++++++++++- ...ce_account_returns_Created_response.freeze | 2 +- ...vice_account_returns_Created_response.yaml | 14 +++---- ...service_account_returns_OK_response.freeze | 2 +- ...a_service_account_returns_OK_response.yaml | 18 ++++----- ...service_account_returns_OK_response.freeze | 2 +- ...a_service_account_returns_OK_response.yaml | 12 +++--- ...account_returns_No_Content_response.freeze | 2 +- ...e_account_returns_No_Content_response.yaml | 16 ++++---- ...service_account_returns_OK_response.freeze | 2 +- ...a_service_account_returns_OK_response.yaml | 20 +++++----- .../features/v2/key_management.feature | 14 +++---- .../features/v2/service_accounts.feature | 14 +++---- tests/scenarios/features/v2/undo.json | 4 +- 19 files changed, 126 insertions(+), 165 deletions(-) diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 30596739d0f..5861fba12e8 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -1140,9 +1140,9 @@ components: schema: type: string PersonalAccessTokenID: - description: The UUID of the personal access token. + description: The ID of the personal access token. in: path - name: pat_uuid + name: pat_id required: true schema: example: "00000000-0000-1234-0000-000000000000" @@ -29180,11 +29180,6 @@ components: FullPersonalAccessTokenAttributes: description: Attributes of a full personal access token, including the token key. properties: - alias: - description: The alias (short identifier) of the personal access token. - example: "2H9MCNMBM8FQjQ16YucXkX" - readOnly: true - type: string created_at: description: Creation date of the personal access token. example: "2024-01-01T00:00:00+00:00" @@ -53447,11 +53442,6 @@ components: PersonalAccessTokenAttributes: description: Attributes of a personal access token. properties: - alias: - description: The alias (short identifier) of the personal access token. - example: "2H9MCNMBM8FQjQ16YucXkX" - readOnly: true - type: string created_at: description: Creation date of the personal access token. example: "2024-01-01T00:00:00+00:00" @@ -77997,6 +77987,10 @@ components: description: Title of the user. nullable: true type: string + uuid: + description: UUID of the user. + readOnly: true + type: string verified: description: Whether the user is verified. type: boolean @@ -109770,7 +109764,7 @@ paths: operator: OR permissions: - user_app_keys - /api/v2/personal_access_tokens/{pat_uuid}: + /api/v2/personal_access_tokens/{pat_id}: delete: description: Revoke a specific personal access token. operationId: RevokePersonalAccessToken @@ -121349,7 +121343,7 @@ paths: operator: OR permissions: - service_account_write - /api/v2/service_accounts/{service_account_id}/access_tokens/{pat_uuid}: + /api/v2/service_accounts/{service_account_id}/access_tokens/{pat_id}: delete: description: Revoke a specific access token for a service account. operationId: RevokeServiceAccountAccessToken diff --git a/api/datadogV2/api_key_management.go b/api/datadogV2/api_key_management.go index af65ee57388..aa913b42fb0 100644 --- a/api/datadogV2/api_key_management.go +++ b/api/datadogV2/api_key_management.go @@ -753,7 +753,7 @@ func (a *KeyManagementApi) GetCurrentUserApplicationKey(ctx _context.Context, ap // GetPersonalAccessToken Get a personal access token. // Get a specific personal access token by its UUID. -func (a *KeyManagementApi) GetPersonalAccessToken(ctx _context.Context, patUuid string) (PersonalAccessTokenResponse, *_nethttp.Response, error) { +func (a *KeyManagementApi) GetPersonalAccessToken(ctx _context.Context, patId string) (PersonalAccessTokenResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -765,8 +765,8 @@ func (a *KeyManagementApi) GetPersonalAccessToken(ctx _context.Context, patUuid return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/personal_access_tokens/{pat_uuid}" - localVarPath = datadog.ReplacePathParameter(localVarPath, "{pat_uuid}", _neturl.PathEscape(datadog.ParameterToString(patUuid, ""))) + localVarPath := localBasePath + "/api/v2/personal_access_tokens/{pat_id}" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{pat_id}", _neturl.PathEscape(datadog.ParameterToString(patId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -1519,7 +1519,7 @@ func (a *KeyManagementApi) ListPersonalAccessTokens(ctx _context.Context, o ...L // RevokePersonalAccessToken Revoke a personal access token. // Revoke a specific personal access token. -func (a *KeyManagementApi) RevokePersonalAccessToken(ctx _context.Context, patUuid string) (*_nethttp.Response, error) { +func (a *KeyManagementApi) RevokePersonalAccessToken(ctx _context.Context, patId string) (*_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} @@ -1530,8 +1530,8 @@ func (a *KeyManagementApi) RevokePersonalAccessToken(ctx _context.Context, patUu return nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/personal_access_tokens/{pat_uuid}" - localVarPath = datadog.ReplacePathParameter(localVarPath, "{pat_uuid}", _neturl.PathEscape(datadog.ParameterToString(patUuid, ""))) + localVarPath := localBasePath + "/api/v2/personal_access_tokens/{pat_id}" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{pat_id}", _neturl.PathEscape(datadog.ParameterToString(patId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -1831,7 +1831,7 @@ func (a *KeyManagementApi) UpdateCurrentUserApplicationKey(ctx _context.Context, // UpdatePersonalAccessToken Update a personal access token. // Update a specific personal access token. -func (a *KeyManagementApi) UpdatePersonalAccessToken(ctx _context.Context, patUuid string, body PersonalAccessTokenUpdateRequest) (PersonalAccessTokenResponse, *_nethttp.Response, error) { +func (a *KeyManagementApi) UpdatePersonalAccessToken(ctx _context.Context, patId string, body PersonalAccessTokenUpdateRequest) (PersonalAccessTokenResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPatch localVarPostBody interface{} @@ -1843,8 +1843,8 @@ func (a *KeyManagementApi) UpdatePersonalAccessToken(ctx _context.Context, patUu return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/personal_access_tokens/{pat_uuid}" - localVarPath = datadog.ReplacePathParameter(localVarPath, "{pat_uuid}", _neturl.PathEscape(datadog.ParameterToString(patUuid, ""))) + localVarPath := localBasePath + "/api/v2/personal_access_tokens/{pat_id}" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{pat_id}", _neturl.PathEscape(datadog.ParameterToString(patId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} diff --git a/api/datadogV2/api_service_accounts.go b/api/datadogV2/api_service_accounts.go index 587e515d7e2..5f906e6e80d 100644 --- a/api/datadogV2/api_service_accounts.go +++ b/api/datadogV2/api_service_accounts.go @@ -328,7 +328,7 @@ func (a *ServiceAccountsApi) DeleteServiceAccountApplicationKey(ctx _context.Con // GetServiceAccountAccessToken Get an access token for a service account. // Get a specific access token for a service account by its UUID. -func (a *ServiceAccountsApi) GetServiceAccountAccessToken(ctx _context.Context, serviceAccountId string, patUuid string) (PersonalAccessTokenResponse, *_nethttp.Response, error) { +func (a *ServiceAccountsApi) GetServiceAccountAccessToken(ctx _context.Context, serviceAccountId string, patId string) (PersonalAccessTokenResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} @@ -340,9 +340,9 @@ func (a *ServiceAccountsApi) GetServiceAccountAccessToken(ctx _context.Context, return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/service_accounts/{service_account_id}/access_tokens/{pat_uuid}" + localVarPath := localBasePath + "/api/v2/service_accounts/{service_account_id}/access_tokens/{pat_id}" localVarPath = datadog.ReplacePathParameter(localVarPath, "{service_account_id}", _neturl.PathEscape(datadog.ParameterToString(serviceAccountId, ""))) - localVarPath = datadog.ReplacePathParameter(localVarPath, "{pat_uuid}", _neturl.PathEscape(datadog.ParameterToString(patUuid, ""))) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{pat_id}", _neturl.PathEscape(datadog.ParameterToString(patId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -778,7 +778,7 @@ func (a *ServiceAccountsApi) ListServiceAccountApplicationKeys(ctx _context.Cont // RevokeServiceAccountAccessToken Revoke an access token for a service account. // Revoke a specific access token for a service account. -func (a *ServiceAccountsApi) RevokeServiceAccountAccessToken(ctx _context.Context, serviceAccountId string, patUuid string) (*_nethttp.Response, error) { +func (a *ServiceAccountsApi) RevokeServiceAccountAccessToken(ctx _context.Context, serviceAccountId string, patId string) (*_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodDelete localVarPostBody interface{} @@ -789,9 +789,9 @@ func (a *ServiceAccountsApi) RevokeServiceAccountAccessToken(ctx _context.Contex return nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/service_accounts/{service_account_id}/access_tokens/{pat_uuid}" + localVarPath := localBasePath + "/api/v2/service_accounts/{service_account_id}/access_tokens/{pat_id}" localVarPath = datadog.ReplacePathParameter(localVarPath, "{service_account_id}", _neturl.PathEscape(datadog.ParameterToString(serviceAccountId, ""))) - localVarPath = datadog.ReplacePathParameter(localVarPath, "{pat_uuid}", _neturl.PathEscape(datadog.ParameterToString(patUuid, ""))) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{pat_id}", _neturl.PathEscape(datadog.ParameterToString(patId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} @@ -847,7 +847,7 @@ func (a *ServiceAccountsApi) RevokeServiceAccountAccessToken(ctx _context.Contex // UpdateServiceAccountAccessToken Update an access token for a service account. // Update a specific access token for a service account. -func (a *ServiceAccountsApi) UpdateServiceAccountAccessToken(ctx _context.Context, serviceAccountId string, patUuid string, body PersonalAccessTokenUpdateRequest) (PersonalAccessTokenResponse, *_nethttp.Response, error) { +func (a *ServiceAccountsApi) UpdateServiceAccountAccessToken(ctx _context.Context, serviceAccountId string, patId string, body PersonalAccessTokenUpdateRequest) (PersonalAccessTokenResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodPatch localVarPostBody interface{} @@ -859,9 +859,9 @@ func (a *ServiceAccountsApi) UpdateServiceAccountAccessToken(ctx _context.Contex return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/api/v2/service_accounts/{service_account_id}/access_tokens/{pat_uuid}" + localVarPath := localBasePath + "/api/v2/service_accounts/{service_account_id}/access_tokens/{pat_id}" localVarPath = datadog.ReplacePathParameter(localVarPath, "{service_account_id}", _neturl.PathEscape(datadog.ParameterToString(serviceAccountId, ""))) - localVarPath = datadog.ReplacePathParameter(localVarPath, "{pat_uuid}", _neturl.PathEscape(datadog.ParameterToString(patUuid, ""))) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{pat_id}", _neturl.PathEscape(datadog.ParameterToString(patId, ""))) localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} diff --git a/api/datadogV2/model_full_personal_access_token_attributes.go b/api/datadogV2/model_full_personal_access_token_attributes.go index 8a6279eed6b..e3c1b041de3 100644 --- a/api/datadogV2/model_full_personal_access_token_attributes.go +++ b/api/datadogV2/model_full_personal_access_token_attributes.go @@ -12,8 +12,6 @@ import ( // FullPersonalAccessTokenAttributes Attributes of a full personal access token, including the token key. type FullPersonalAccessTokenAttributes struct { - // The alias (short identifier) of the personal access token. - Alias *string `json:"alias,omitempty"` // Creation date of the personal access token. CreatedAt *time.Time `json:"created_at,omitempty"` // Expiration date of the personal access token. @@ -48,34 +46,6 @@ func NewFullPersonalAccessTokenAttributesWithDefaults() *FullPersonalAccessToken return &this } -// GetAlias returns the Alias field value if set, zero value otherwise. -func (o *FullPersonalAccessTokenAttributes) GetAlias() string { - if o == nil || o.Alias == nil { - var ret string - return ret - } - return *o.Alias -} - -// GetAliasOk returns a tuple with the Alias field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *FullPersonalAccessTokenAttributes) GetAliasOk() (*string, bool) { - if o == nil || o.Alias == nil { - return nil, false - } - return o.Alias, true -} - -// HasAlias returns a boolean if a field has been set. -func (o *FullPersonalAccessTokenAttributes) HasAlias() bool { - return o != nil && o.Alias != nil -} - -// SetAlias gets a reference to the given string and assigns it to the Alias field. -func (o *FullPersonalAccessTokenAttributes) SetAlias(v string) { - o.Alias = &v -} - // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. func (o *FullPersonalAccessTokenAttributes) GetCreatedAt() time.Time { if o == nil || o.CreatedAt == nil { @@ -261,9 +231,6 @@ func (o FullPersonalAccessTokenAttributes) MarshalJSON() ([]byte, error) { if o.UnparsedObject != nil { return datadog.Marshal(o.UnparsedObject) } - if o.Alias != nil { - toSerialize["alias"] = o.Alias - } if o.CreatedAt != nil { if o.CreatedAt.Nanosecond() == 0 { toSerialize["created_at"] = o.CreatedAt.Format("2006-01-02T15:04:05Z07:00") @@ -296,7 +263,6 @@ func (o FullPersonalAccessTokenAttributes) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *FullPersonalAccessTokenAttributes) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Alias *string `json:"alias,omitempty"` CreatedAt *time.Time `json:"created_at,omitempty"` ExpiresAt datadog.NullableTime `json:"expires_at,omitempty"` Key *string `json:"key,omitempty"` @@ -309,11 +275,10 @@ func (o *FullPersonalAccessTokenAttributes) UnmarshalJSON(bytes []byte) (err err } additionalProperties := make(map[string]interface{}) if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"alias", "created_at", "expires_at", "key", "name", "public_portion", "scopes"}) + datadog.DeleteKeys(additionalProperties, &[]string{"created_at", "expires_at", "key", "name", "public_portion", "scopes"}) } else { return err } - o.Alias = all.Alias o.CreatedAt = all.CreatedAt o.ExpiresAt = all.ExpiresAt o.Key = all.Key diff --git a/api/datadogV2/model_personal_access_token_attributes.go b/api/datadogV2/model_personal_access_token_attributes.go index e0177090627..cbc6c6a5765 100644 --- a/api/datadogV2/model_personal_access_token_attributes.go +++ b/api/datadogV2/model_personal_access_token_attributes.go @@ -12,8 +12,6 @@ import ( // PersonalAccessTokenAttributes Attributes of a personal access token. type PersonalAccessTokenAttributes struct { - // The alias (short identifier) of the personal access token. - Alias *string `json:"alias,omitempty"` // Creation date of the personal access token. CreatedAt *time.Time `json:"created_at,omitempty"` // Expiration date of the personal access token. @@ -50,34 +48,6 @@ func NewPersonalAccessTokenAttributesWithDefaults() *PersonalAccessTokenAttribut return &this } -// GetAlias returns the Alias field value if set, zero value otherwise. -func (o *PersonalAccessTokenAttributes) GetAlias() string { - if o == nil || o.Alias == nil { - var ret string - return ret - } - return *o.Alias -} - -// GetAliasOk returns a tuple with the Alias field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PersonalAccessTokenAttributes) GetAliasOk() (*string, bool) { - if o == nil || o.Alias == nil { - return nil, false - } - return o.Alias, true -} - -// HasAlias returns a boolean if a field has been set. -func (o *PersonalAccessTokenAttributes) HasAlias() bool { - return o != nil && o.Alias != nil -} - -// SetAlias gets a reference to the given string and assigns it to the Alias field. -func (o *PersonalAccessTokenAttributes) SetAlias(v string) { - o.Alias = &v -} - // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. func (o *PersonalAccessTokenAttributes) GetCreatedAt() time.Time { if o == nil || o.CreatedAt == nil { @@ -313,9 +283,6 @@ func (o PersonalAccessTokenAttributes) MarshalJSON() ([]byte, error) { if o.UnparsedObject != nil { return datadog.Marshal(o.UnparsedObject) } - if o.Alias != nil { - toSerialize["alias"] = o.Alias - } if o.CreatedAt != nil { if o.CreatedAt.Nanosecond() == 0 { toSerialize["created_at"] = o.CreatedAt.Format("2006-01-02T15:04:05Z07:00") @@ -351,7 +318,6 @@ func (o PersonalAccessTokenAttributes) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *PersonalAccessTokenAttributes) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Alias *string `json:"alias,omitempty"` CreatedAt *time.Time `json:"created_at,omitempty"` ExpiresAt datadog.NullableTime `json:"expires_at,omitempty"` LastUsedAt datadog.NullableTime `json:"last_used_at,omitempty"` @@ -365,11 +331,10 @@ func (o *PersonalAccessTokenAttributes) UnmarshalJSON(bytes []byte) (err error) } additionalProperties := make(map[string]interface{}) if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"alias", "created_at", "expires_at", "last_used_at", "modified_at", "name", "public_portion", "scopes"}) + datadog.DeleteKeys(additionalProperties, &[]string{"created_at", "expires_at", "last_used_at", "modified_at", "name", "public_portion", "scopes"}) } else { return err } - o.Alias = all.Alias o.CreatedAt = all.CreatedAt o.ExpiresAt = all.ExpiresAt o.LastUsedAt = all.LastUsedAt diff --git a/api/datadogV2/model_user_attributes.go b/api/datadogV2/model_user_attributes.go index bf1de98afac..ca100381561 100644 --- a/api/datadogV2/model_user_attributes.go +++ b/api/datadogV2/model_user_attributes.go @@ -36,6 +36,8 @@ type UserAttributes struct { Status *string `json:"status,omitempty"` // Title of the user. Title datadog.NullableString `json:"title,omitempty"` + // UUID of the user. + Uuid *string `json:"uuid,omitempty"` // Whether the user is verified. Verified *bool `json:"verified,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct @@ -429,6 +431,34 @@ func (o *UserAttributes) UnsetTitle() { o.Title.Unset() } +// GetUuid returns the Uuid field value if set, zero value otherwise. +func (o *UserAttributes) GetUuid() string { + if o == nil || o.Uuid == nil { + var ret string + return ret + } + return *o.Uuid +} + +// GetUuidOk returns a tuple with the Uuid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserAttributes) GetUuidOk() (*string, bool) { + if o == nil || o.Uuid == nil { + return nil, false + } + return o.Uuid, true +} + +// HasUuid returns a boolean if a field has been set. +func (o *UserAttributes) HasUuid() bool { + return o != nil && o.Uuid != nil +} + +// SetUuid gets a reference to the given string and assigns it to the Uuid field. +func (o *UserAttributes) SetUuid(v string) { + o.Uuid = &v +} + // GetVerified returns the Verified field value if set, zero value otherwise. func (o *UserAttributes) GetVerified() bool { if o == nil || o.Verified == nil { @@ -507,6 +537,9 @@ func (o UserAttributes) MarshalJSON() ([]byte, error) { if o.Title.IsSet() { toSerialize["title"] = o.Title.Get() } + if o.Uuid != nil { + toSerialize["uuid"] = o.Uuid + } if o.Verified != nil { toSerialize["verified"] = o.Verified } @@ -532,6 +565,7 @@ func (o *UserAttributes) UnmarshalJSON(bytes []byte) (err error) { ServiceAccount *bool `json:"service_account,omitempty"` Status *string `json:"status,omitempty"` Title datadog.NullableString `json:"title,omitempty"` + Uuid *string `json:"uuid,omitempty"` Verified *bool `json:"verified,omitempty"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { @@ -539,7 +573,7 @@ func (o *UserAttributes) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"created_at", "disabled", "email", "handle", "icon", "last_login_time", "mfa_enabled", "modified_at", "name", "service_account", "status", "title", "verified"}) + datadog.DeleteKeys(additionalProperties, &[]string{"created_at", "disabled", "email", "handle", "icon", "last_login_time", "mfa_enabled", "modified_at", "name", "service_account", "status", "title", "uuid", "verified"}) } else { return err } @@ -555,6 +589,7 @@ func (o *UserAttributes) UnmarshalJSON(bytes []byte) (err error) { o.ServiceAccount = all.ServiceAccount o.Status = all.Status o.Title = all.Title + o.Uuid = all.Uuid o.Verified = all.Verified if len(additionalProperties) > 0 { diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Create_an_access_token_for_a_service_account_returns_Created_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Create_an_access_token_for_a_service_account_returns_Created_response.freeze index b457d0ec92c..7ccf87f4bd5 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Create_an_access_token_for_a_service_account_returns_Created_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Create_an_access_token_for_a_service_account_returns_Created_response.freeze @@ -1 +1 @@ -2026-04-03T21:02:56.793Z \ No newline at end of file +2026-04-16T20:03:06.304Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Create_an_access_token_for_a_service_account_returns_Created_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Create_an_access_token_for_a_service_account_returns_Created_response.yaml index 6d2f1538644..724b272974c 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Create_an_access_token_for_a_service_account_returns_Created_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Create_an_access_token_for_a_service_account_returns_Created_response.yaml @@ -1,7 +1,7 @@ interactions: - request: body: | - {"data":{"attributes":{"email":"Test-Create_an_access_token_for_a_service_account_returns_Created_response-1775250176@datadoghq.com","service_account":true,"title":"user title"},"type":"users"}} + {"data":{"attributes":{"email":"Test-Create_an_access_token_for_a_service_account_returns_Created_response-1776369786@datadoghq.com","service_account":true,"title":"user title"},"type":"users"}} form: {} headers: Accept: @@ -12,7 +12,7 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/service_accounts response: - body: '{"data":{"type":"users","id":"7d5e5ea9-2fa0-11f1-991f-62f4bfc595d0","attributes":{"name":null,"handle":"7d5e5ea9-2fa0-11f1-991f-62f4bfc595d0","created_at":"2026-04-03T21:02:56.980609+00:00","modified_at":"2026-04-03T21:02:56.980609+00:00","email":"test-create_an_access_token_for_a_service_account_returns_created_response-1775250176@datadoghq.com","icon":"https://secure.gravatar.com/avatar/1a703b50769c96d7b84a5470f474ef74?s=48&d=retro","title":"user + body: '{"data":{"type":"users","id":"498cce13-39cf-11f1-9928-be1871753dee","attributes":{"uuid":"498cce13-39cf-11f1-9928-be1871753dee","name":null,"handle":"498cce13-39cf-11f1-9928-be1871753dee","created_at":"2026-04-16T20:03:08.017467+00:00","modified_at":"2026-04-16T20:03:08.017467+00:00","email":"test-create_an_access_token_for_a_service_account_returns_created_response-1776369786@datadoghq.com","icon":"https://secure.gravatar.com/avatar/ed167ebfacd06c99ea70d4c121f5a7f1?s=48&d=retro","title":"user title","verified":true,"service_account":true,"disabled":false,"allowed_login_methods":[],"status":"Active","last_login_time":null},"relationships":{"roles":{"data":[]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}} ' @@ -24,7 +24,7 @@ interactions: status: 201 Created - request: body: | - {"data":{"attributes":{"name":"Test-Create_an_access_token_for_a_service_account_returns_Created_response-1775250176","scopes":["dashboards_read"]},"type":"personal_access_tokens"}} + {"data":{"attributes":{"name":"Test-Create_an_access_token_for_a_service_account_returns_Created_response-1776369786","scopes":["dashboards_read"]},"type":"personal_access_tokens"}} form: {} headers: Accept: @@ -33,9 +33,9 @@ interactions: - application/json id: 1 method: POST - url: https://api.datadoghq.com/api/v2/service_accounts/7d5e5ea9-2fa0-11f1-991f-62f4bfc595d0/access_tokens + url: https://api.datadoghq.com/api/v2/service_accounts/498cce13-39cf-11f1-9928-be1871753dee/access_tokens response: - body: '{"data":{"id":"6f2491f5-8c3f-45a3-962a-5f769b95e806","type":"personal_access_tokens","attributes":{"alias":"3NirNJ5Y2qB4Fmac8B4wnm","created_at":"2026-04-03T21:02:57.288351972Z","expires_at":null,"key":"xxxxx_xxxxxxxxxxxxxxxxxxxxxx_xxxxxxxxxxxxXxxxxxxxxxxxxxxxxxxxxxxx","name":"Test-Create_an_access_token_for_a_service_account_returns_Created_response-1775250176","public_portion":"3NirNJ5Y2qB4Fmac8B4wnm","scopes":["dashboards_read"]},"relationships":{"owned_by":{"data":{"id":"7d5e5ea9-2fa0-11f1-991f-62f4bfc595d0","type":"users"}}}}}' + body: '{"data":{"id":"88337232-8552-4495-987c-1cfed567d461","type":"personal_access_tokens","attributes":{"created_at":"2026-04-16T20:03:08.381725456Z","expires_at":null,"key":"xxxxx_xxxxxxxxxxxxxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","name":"Test-Create_an_access_token_for_a_service_account_returns_Created_response-1776369786","public_portion":"ddpat_490SyfYQqhqnr008BTjQWn","scopes":["dashboards_read"]},"relationships":{"owned_by":{"data":{"id":"498cce13-39cf-11f1-9928-be1871753dee","type":"users"}}}}}' code: 201 duration: 0ms headers: @@ -50,7 +50,7 @@ interactions: - '*/*' id: 2 method: DELETE - url: https://api.datadoghq.com/api/v2/service_accounts/7d5e5ea9-2fa0-11f1-991f-62f4bfc595d0/access_tokens/6f2491f5-8c3f-45a3-962a-5f769b95e806 + url: https://api.datadoghq.com/api/v2/service_accounts/498cce13-39cf-11f1-9928-be1871753dee/access_tokens/88337232-8552-4495-987c-1cfed567d461 response: body: '' code: 204 @@ -65,7 +65,7 @@ interactions: - '*/*' id: 3 method: DELETE - url: https://api.datadoghq.com/api/v2/users/7d5e5ea9-2fa0-11f1-991f-62f4bfc595d0 + url: https://api.datadoghq.com/api/v2/users/498cce13-39cf-11f1-9928-be1871753dee response: body: '' code: 204 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Get_an_access_token_for_a_service_account_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Get_an_access_token_for_a_service_account_returns_OK_response.freeze index 55c4828532c..767a9f9c250 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Get_an_access_token_for_a_service_account_returns_OK_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Get_an_access_token_for_a_service_account_returns_OK_response.freeze @@ -1 +1 @@ -2026-04-03T21:03:03.500Z \ No newline at end of file +2026-04-16T20:03:09.123Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Get_an_access_token_for_a_service_account_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Get_an_access_token_for_a_service_account_returns_OK_response.yaml index 436e00a25c0..73e2532377d 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Get_an_access_token_for_a_service_account_returns_OK_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Get_an_access_token_for_a_service_account_returns_OK_response.yaml @@ -1,7 +1,7 @@ interactions: - request: body: | - {"data":{"attributes":{"email":"Test-Get_an_access_token_for_a_service_account_returns_OK_response-1775250183@datadoghq.com","service_account":true,"title":"user title"},"type":"users"}} + {"data":{"attributes":{"email":"Test-Get_an_access_token_for_a_service_account_returns_OK_response-1776369789@datadoghq.com","service_account":true,"title":"user title"},"type":"users"}} form: {} headers: Accept: @@ -12,7 +12,7 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/service_accounts response: - body: '{"data":{"type":"users","id":"8161ef90-2fa0-11f1-991f-62f4bfc595d0","attributes":{"name":null,"handle":"8161ef90-2fa0-11f1-991f-62f4bfc595d0","created_at":"2026-04-03T21:03:03.714879+00:00","modified_at":"2026-04-03T21:03:03.714879+00:00","email":"test-get_an_access_token_for_a_service_account_returns_ok_response-1775250183@datadoghq.com","icon":"https://secure.gravatar.com/avatar/bb3c6df0d99066bbe05cf7dff99b5561?s=48&d=retro","title":"user + body: '{"data":{"type":"users","id":"4a56376d-39cf-11f1-9a29-2eb65349fc01","attributes":{"uuid":"4a56376d-39cf-11f1-9a29-2eb65349fc01","name":null,"handle":"4a56376d-39cf-11f1-9a29-2eb65349fc01","created_at":"2026-04-16T20:03:09.337439+00:00","modified_at":"2026-04-16T20:03:09.337439+00:00","email":"test-get_an_access_token_for_a_service_account_returns_ok_response-1776369789@datadoghq.com","icon":"https://secure.gravatar.com/avatar/7473377b9dced0689feddb50f5d82d29?s=48&d=retro","title":"user title","verified":true,"service_account":true,"disabled":false,"allowed_login_methods":[],"status":"Active","last_login_time":null},"relationships":{"roles":{"data":[]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}} ' @@ -24,7 +24,7 @@ interactions: status: 201 Created - request: body: | - {"data":{"attributes":{"name":"Test-Get_an_access_token_for_a_service_account_returns_OK_response-1775250183","scopes":["dashboards_read"]},"type":"personal_access_tokens"}} + {"data":{"attributes":{"name":"Test-Get_an_access_token_for_a_service_account_returns_OK_response-1776369789","scopes":["dashboards_read"]},"type":"personal_access_tokens"}} form: {} headers: Accept: @@ -33,9 +33,9 @@ interactions: - application/json id: 1 method: POST - url: https://api.datadoghq.com/api/v2/service_accounts/8161ef90-2fa0-11f1-991f-62f4bfc595d0/access_tokens + url: https://api.datadoghq.com/api/v2/service_accounts/4a56376d-39cf-11f1-9a29-2eb65349fc01/access_tokens response: - body: '{"data":{"id":"f2362958-1e67-414b-985d-d3196afd9315","type":"personal_access_tokens","attributes":{"alias":"7N2tUOwxIjSF8QziOBIpVd","created_at":"2026-04-03T21:03:04.002376467Z","expires_at":null,"key":"xxxxx_xxxxxxxxxxxxxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","name":"Test-Get_an_access_token_for_a_service_account_returns_OK_response-1775250183","public_portion":"7N2tUOwxIjSF8QziOBIpVd","scopes":["dashboards_read"]},"relationships":{"owned_by":{"data":{"id":"8161ef90-2fa0-11f1-991f-62f4bfc595d0","type":"users"}}}}}' + body: '{"data":{"id":"b84d8c2c-b88c-4f72-82ef-fc09dddd1153","type":"personal_access_tokens","attributes":{"created_at":"2026-04-16T20:03:09.695802251Z","expires_at":null,"key":"xxxxx_xxxxxxxxxxxxxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","name":"Test-Get_an_access_token_for_a_service_account_returns_OK_response-1776369789","public_portion":"ddpat_5bm1hhcTKQzH22hPiJgkEN","scopes":["dashboards_read"]},"relationships":{"owned_by":{"data":{"id":"4a56376d-39cf-11f1-9a29-2eb65349fc01","type":"users"}}}}}' code: 201 duration: 0ms headers: @@ -50,9 +50,9 @@ interactions: - application/json id: 2 method: GET - url: https://api.datadoghq.com/api/v2/service_accounts/8161ef90-2fa0-11f1-991f-62f4bfc595d0/access_tokens/f2362958-1e67-414b-985d-d3196afd9315 + url: https://api.datadoghq.com/api/v2/service_accounts/4a56376d-39cf-11f1-9a29-2eb65349fc01/access_tokens/b84d8c2c-b88c-4f72-82ef-fc09dddd1153 response: - body: '{"data":{"id":"f2362958-1e67-414b-985d-d3196afd9315","type":"personal_access_tokens","attributes":{"alias":"7N2tUOwxIjSF8QziOBIpVd","created_at":"2026-04-03T21:03:04.002376Z","expires_at":null,"last_used_at":null,"name":"Test-Get_an_access_token_for_a_service_account_returns_OK_response-1775250183","public_portion":"7N2tUOwxIjSF8QziOBIpVd","scopes":["dashboards_read"]},"relationships":{"owned_by":{"data":{"id":"8161ef90-2fa0-11f1-991f-62f4bfc595d0","type":"users"}}}}}' + body: '{"data":{"id":"b84d8c2c-b88c-4f72-82ef-fc09dddd1153","type":"personal_access_tokens","attributes":{"created_at":"2026-04-16T20:03:09.695802Z","expires_at":null,"last_used_at":null,"name":"Test-Get_an_access_token_for_a_service_account_returns_OK_response-1776369789","public_portion":"ddpat_5bm1hhcTKQzH22hPiJgkEN","scopes":["dashboards_read"]},"relationships":{"owned_by":{"data":{"id":"4a56376d-39cf-11f1-9a29-2eb65349fc01","type":"users"}}}}}' code: 200 duration: 0ms headers: @@ -67,7 +67,7 @@ interactions: - '*/*' id: 3 method: DELETE - url: https://api.datadoghq.com/api/v2/service_accounts/8161ef90-2fa0-11f1-991f-62f4bfc595d0/access_tokens/f2362958-1e67-414b-985d-d3196afd9315 + url: https://api.datadoghq.com/api/v2/service_accounts/4a56376d-39cf-11f1-9a29-2eb65349fc01/access_tokens/b84d8c2c-b88c-4f72-82ef-fc09dddd1153 response: body: '' code: 204 @@ -82,7 +82,7 @@ interactions: - '*/*' id: 4 method: DELETE - url: https://api.datadoghq.com/api/v2/users/8161ef90-2fa0-11f1-991f-62f4bfc595d0 + url: https://api.datadoghq.com/api/v2/users/4a56376d-39cf-11f1-9a29-2eb65349fc01 response: body: '' code: 204 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_List_access_tokens_for_a_service_account_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_List_access_tokens_for_a_service_account_returns_OK_response.freeze index 6234af8a3e4..db15643c3b7 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_List_access_tokens_for_a_service_account_returns_OK_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_List_access_tokens_for_a_service_account_returns_OK_response.freeze @@ -1 +1 @@ -2026-04-03T21:03:09.026Z \ No newline at end of file +2026-04-16T20:03:10.610Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_List_access_tokens_for_a_service_account_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_List_access_tokens_for_a_service_account_returns_OK_response.yaml index 499e160a9bc..2efdce4ef32 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_List_access_tokens_for_a_service_account_returns_OK_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_List_access_tokens_for_a_service_account_returns_OK_response.yaml @@ -1,7 +1,7 @@ interactions: - request: body: | - {"data":{"attributes":{"email":"Test-List_access_tokens_for_a_service_account_returns_OK_response-1775250189@datadoghq.com","service_account":true,"title":"user title"},"type":"users"}} + {"data":{"attributes":{"email":"Test-List_access_tokens_for_a_service_account_returns_OK_response-1776369790@datadoghq.com","service_account":true,"title":"user title"},"type":"users"}} form: {} headers: Accept: @@ -12,8 +12,10 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/service_accounts response: - body: '{"data":{"type":"users","id":"84a7b33b-2fa0-11f1-96b6-7a9b8860a1d7","attributes":{"name":null,"handle":"84a7b33b-2fa0-11f1-96b6-7a9b8860a1d7","created_at":"2026-04-03T21:03:09.205232+00:00","modified_at":"2026-04-03T21:03:09.205232+00:00","email":"test-list_access_tokens_for_a_service_account_returns_ok_response-1775250189@datadoghq.com","icon":"https://secure.gravatar.com/avatar/816e106f74328dd4c20e98c116a9edeb?s=48&d=retro","title":"user - title","verified":true,"service_account":true,"disabled":false,"allowed_login_methods":[],"status":"Active","last_login_time":null},"relationships":{"roles":{"data":[]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}}' + body: '{"data":{"type":"users","id":"4b3b0a2c-39cf-11f1-bf73-ce6d1c25b9b4","attributes":{"uuid":"4b3b0a2c-39cf-11f1-bf73-ce6d1c25b9b4","name":null,"handle":"4b3b0a2c-39cf-11f1-bf73-ce6d1c25b9b4","created_at":"2026-04-16T20:03:10.837056+00:00","modified_at":"2026-04-16T20:03:10.837056+00:00","email":"test-list_access_tokens_for_a_service_account_returns_ok_response-1776369790@datadoghq.com","icon":"https://secure.gravatar.com/avatar/0a5772e4c2381e3c1061e55142e2281a?s=48&d=retro","title":"user + title","verified":true,"service_account":true,"disabled":false,"allowed_login_methods":[],"status":"Active","last_login_time":null},"relationships":{"roles":{"data":[]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}} + + ' code: 201 duration: 0ms headers: @@ -28,7 +30,7 @@ interactions: - application/json id: 1 method: GET - url: https://api.datadoghq.com/api/v2/service_accounts/84a7b33b-2fa0-11f1-96b6-7a9b8860a1d7/access_tokens + url: https://api.datadoghq.com/api/v2/service_accounts/4b3b0a2c-39cf-11f1-bf73-ce6d1c25b9b4/access_tokens response: body: '{"data":[],"meta":{"page":{"total_filtered_count":0}}}' code: 200 @@ -45,7 +47,7 @@ interactions: - '*/*' id: 2 method: DELETE - url: https://api.datadoghq.com/api/v2/users/84a7b33b-2fa0-11f1-96b6-7a9b8860a1d7 + url: https://api.datadoghq.com/api/v2/users/4b3b0a2c-39cf-11f1-bf73-ce6d1c25b9b4 response: body: '' code: 204 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Revoke_an_access_token_for_a_service_account_returns_No_Content_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Revoke_an_access_token_for_a_service_account_returns_No_Content_response.freeze index fa38ba91a95..4a8602fd913 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Revoke_an_access_token_for_a_service_account_returns_No_Content_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Revoke_an_access_token_for_a_service_account_returns_No_Content_response.freeze @@ -1 +1 @@ -2026-04-03T21:03:10.520Z \ No newline at end of file +2026-04-16T20:03:12.932Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Revoke_an_access_token_for_a_service_account_returns_No_Content_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Revoke_an_access_token_for_a_service_account_returns_No_Content_response.yaml index bd62e41dca8..61c4a96697a 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Revoke_an_access_token_for_a_service_account_returns_No_Content_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Revoke_an_access_token_for_a_service_account_returns_No_Content_response.yaml @@ -1,7 +1,7 @@ interactions: - request: body: | - {"data":{"attributes":{"email":"Test-Revoke_an_access_token_for_a_service_account_returns_No_Content_response-1775250190@datadoghq.com","service_account":true,"title":"user title"},"type":"users"}} + {"data":{"attributes":{"email":"Test-Revoke_an_access_token_for_a_service_account_returns_No_Content_response-1776369792@datadoghq.com","service_account":true,"title":"user title"},"type":"users"}} form: {} headers: Accept: @@ -12,7 +12,7 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/service_accounts response: - body: '{"data":{"type":"users","id":"860878b5-2fa0-11f1-991f-62f4bfc595d0","attributes":{"name":null,"handle":"860878b5-2fa0-11f1-991f-62f4bfc595d0","created_at":"2026-04-03T21:03:11.517157+00:00","modified_at":"2026-04-03T21:03:11.517157+00:00","email":"test-revoke_an_access_token_for_a_service_account_returns_no_content_response-1775250190@datadoghq.com","icon":"https://secure.gravatar.com/avatar/7d18813f3cbc71a5e46b1184fc3ad8fb?s=48&d=retro","title":"user + body: '{"data":{"type":"users","id":"4c99fbee-39cf-11f1-beb2-cad70c641dfa","attributes":{"uuid":"4c99fbee-39cf-11f1-beb2-cad70c641dfa","name":null,"handle":"4c99fbee-39cf-11f1-beb2-cad70c641dfa","created_at":"2026-04-16T20:03:13.136998+00:00","modified_at":"2026-04-16T20:03:13.136998+00:00","email":"test-revoke_an_access_token_for_a_service_account_returns_no_content_response-1776369792@datadoghq.com","icon":"https://secure.gravatar.com/avatar/7586d09a6a08e32a963f425a34463a4d?s=48&d=retro","title":"user title","verified":true,"service_account":true,"disabled":false,"allowed_login_methods":[],"status":"Active","last_login_time":null},"relationships":{"roles":{"data":[]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}} ' @@ -24,7 +24,7 @@ interactions: status: 201 Created - request: body: | - {"data":{"attributes":{"name":"Test-Revoke_an_access_token_for_a_service_account_returns_No_Content_response-1775250190","scopes":["dashboards_read"]},"type":"personal_access_tokens"}} + {"data":{"attributes":{"name":"Test-Revoke_an_access_token_for_a_service_account_returns_No_Content_response-1776369792","scopes":["dashboards_read"]},"type":"personal_access_tokens"}} form: {} headers: Accept: @@ -33,9 +33,9 @@ interactions: - application/json id: 1 method: POST - url: https://api.datadoghq.com/api/v2/service_accounts/860878b5-2fa0-11f1-991f-62f4bfc595d0/access_tokens + url: https://api.datadoghq.com/api/v2/service_accounts/4c99fbee-39cf-11f1-beb2-cad70c641dfa/access_tokens response: - body: '{"data":{"id":"7346d75b-83f3-48ba-9186-899fc80bce16","type":"personal_access_tokens","attributes":{"alias":"3VWUVmuRsjFIKue2Uq9ii6","created_at":"2026-04-03T21:03:11.782016283Z","expires_at":null,"key":"xxxxx_xxxxxxxxxxxxxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","name":"Test-Revoke_an_access_token_for_a_service_account_returns_No_Content_response-1775250190","public_portion":"3VWUVmuRsjFIKue2Uq9ii6","scopes":["dashboards_read"]},"relationships":{"owned_by":{"data":{"id":"860878b5-2fa0-11f1-991f-62f4bfc595d0","type":"users"}}}}}' + body: '{"data":{"id":"a5b5e3c3-2b58-448b-a1b1-5c97f16837a6","type":"personal_access_tokens","attributes":{"created_at":"2026-04-16T20:03:13.505344652Z","expires_at":null,"key":"xxxxx_xxxxxxxxxxxxxxxxxxxxxx_xxxxxxxxxXxxxxxxxxxxxxxxxxxxxxxxxxxx","name":"Test-Revoke_an_access_token_for_a_service_account_returns_No_Content_response-1776369792","public_portion":"ddpat_52grBIAi4zKGY0uxhjLVVW","scopes":["dashboards_read"]},"relationships":{"owned_by":{"data":{"id":"4c99fbee-39cf-11f1-beb2-cad70c641dfa","type":"users"}}}}}' code: 201 duration: 0ms headers: @@ -50,7 +50,7 @@ interactions: - '*/*' id: 2 method: DELETE - url: https://api.datadoghq.com/api/v2/service_accounts/860878b5-2fa0-11f1-991f-62f4bfc595d0/access_tokens/7346d75b-83f3-48ba-9186-899fc80bce16 + url: https://api.datadoghq.com/api/v2/service_accounts/4c99fbee-39cf-11f1-beb2-cad70c641dfa/access_tokens/a5b5e3c3-2b58-448b-a1b1-5c97f16837a6 response: body: '' code: 204 @@ -65,7 +65,7 @@ interactions: - '*/*' id: 3 method: DELETE - url: https://api.datadoghq.com/api/v2/service_accounts/860878b5-2fa0-11f1-991f-62f4bfc595d0/access_tokens/7346d75b-83f3-48ba-9186-899fc80bce16 + url: https://api.datadoghq.com/api/v2/service_accounts/4c99fbee-39cf-11f1-beb2-cad70c641dfa/access_tokens/a5b5e3c3-2b58-448b-a1b1-5c97f16837a6 response: body: '' code: 204 @@ -80,7 +80,7 @@ interactions: - '*/*' id: 4 method: DELETE - url: https://api.datadoghq.com/api/v2/users/860878b5-2fa0-11f1-991f-62f4bfc595d0 + url: https://api.datadoghq.com/api/v2/users/4c99fbee-39cf-11f1-beb2-cad70c641dfa response: body: '' code: 204 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Update_an_access_token_for_a_service_account_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Update_an_access_token_for_a_service_account_returns_OK_response.freeze index 6a894d59da1..58278ff6c0f 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Update_an_access_token_for_a_service_account_returns_OK_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Update_an_access_token_for_a_service_account_returns_OK_response.freeze @@ -1 +1 @@ -2026-04-03T21:03:12.499Z \ No newline at end of file +2026-04-16T20:03:14.527Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Update_an_access_token_for_a_service_account_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Update_an_access_token_for_a_service_account_returns_OK_response.yaml index 863ff33c1b9..076b078d281 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Update_an_access_token_for_a_service_account_returns_OK_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Service_Accounts/Scenario_Update_an_access_token_for_a_service_account_returns_OK_response.yaml @@ -1,7 +1,7 @@ interactions: - request: body: | - {"data":{"attributes":{"email":"Test-Update_an_access_token_for_a_service_account_returns_OK_response-1775250192@datadoghq.com","service_account":true,"title":"user title"},"type":"users"}} + {"data":{"attributes":{"email":"Test-Update_an_access_token_for_a_service_account_returns_OK_response-1776369794@datadoghq.com","service_account":true,"title":"user title"},"type":"users"}} form: {} headers: Accept: @@ -12,7 +12,7 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/service_accounts response: - body: '{"data":{"type":"users","id":"86bdf0d7-2fa0-11f1-991f-62f4bfc595d0","attributes":{"name":null,"handle":"86bdf0d7-2fa0-11f1-991f-62f4bfc595d0","created_at":"2026-04-03T21:03:12.706435+00:00","modified_at":"2026-04-03T21:03:12.706435+00:00","email":"test-update_an_access_token_for_a_service_account_returns_ok_response-1775250192@datadoghq.com","icon":"https://secure.gravatar.com/avatar/8ef25c203ebdbe5e11acb74bd99ba7da?s=48&d=retro","title":"user + body: '{"data":{"type":"users","id":"4d8efdef-39cf-11f1-bf73-ce6d1c25b9b4","attributes":{"uuid":"4d8efdef-39cf-11f1-bf73-ce6d1c25b9b4","name":null,"handle":"4d8efdef-39cf-11f1-bf73-ce6d1c25b9b4","created_at":"2026-04-16T20:03:14.742691+00:00","modified_at":"2026-04-16T20:03:14.742691+00:00","email":"test-update_an_access_token_for_a_service_account_returns_ok_response-1776369794@datadoghq.com","icon":"https://secure.gravatar.com/avatar/05aacae415f13819561258b03c973881?s=48&d=retro","title":"user title","verified":true,"service_account":true,"disabled":false,"allowed_login_methods":[],"status":"Active","last_login_time":null},"relationships":{"roles":{"data":[]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}} ' @@ -24,7 +24,7 @@ interactions: status: 201 Created - request: body: | - {"data":{"attributes":{"name":"Test-Update_an_access_token_for_a_service_account_returns_OK_response-1775250192","scopes":["dashboards_read"]},"type":"personal_access_tokens"}} + {"data":{"attributes":{"name":"Test-Update_an_access_token_for_a_service_account_returns_OK_response-1776369794","scopes":["dashboards_read"]},"type":"personal_access_tokens"}} form: {} headers: Accept: @@ -33,9 +33,9 @@ interactions: - application/json id: 1 method: POST - url: https://api.datadoghq.com/api/v2/service_accounts/86bdf0d7-2fa0-11f1-991f-62f4bfc595d0/access_tokens + url: https://api.datadoghq.com/api/v2/service_accounts/4d8efdef-39cf-11f1-bf73-ce6d1c25b9b4/access_tokens response: - body: '{"data":{"id":"9a7d27cc-4969-4a57-990c-03c23a9f2adc","type":"personal_access_tokens","attributes":{"alias":"4hW0tyOpjf5Dj84mZaXqwe","created_at":"2026-04-03T21:03:12.978132411Z","expires_at":null,"key":"xxxxx_xxxxxxxxxxxxxxxxxxXxxx_xxxxxXxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","name":"Test-Update_an_access_token_for_a_service_account_returns_OK_response-1775250192","public_portion":"4hW0tyOpjf5Dj84mZaXqwe","scopes":["dashboards_read"]},"relationships":{"owned_by":{"data":{"id":"86bdf0d7-2fa0-11f1-991f-62f4bfc595d0","type":"users"}}}}}' + body: '{"data":{"id":"eafa3dd9-430d-4075-a183-63171c7f3de5","type":"personal_access_tokens","attributes":{"created_at":"2026-04-16T20:03:15.138533237Z","expires_at":null,"key":"xxxxx_xxxxxxxxxxxxxxxxxxxxxx_xxxxxxxxxxxxxxxXxxxxxxxxxxxxxxxxxxxx","name":"Test-Update_an_access_token_for_a_service_account_returns_OK_response-1776369794","public_portion":"ddpat_79OZ2nUHcB3McO399ZaVVt","scopes":["dashboards_read"]},"relationships":{"owned_by":{"data":{"id":"4d8efdef-39cf-11f1-bf73-ce6d1c25b9b4","type":"users"}}}}}' code: 201 duration: 0ms headers: @@ -44,7 +44,7 @@ interactions: status: 201 Created - request: body: | - {"data":{"attributes":{"name":"Test-Update_an_access_token_for_a_service_account_returns_OK_response-1775250192-updated"},"id":"9a7d27cc-4969-4a57-990c-03c23a9f2adc","type":"personal_access_tokens"}} + {"data":{"attributes":{"name":"Test-Update_an_access_token_for_a_service_account_returns_OK_response-1776369794-updated"},"id":"eafa3dd9-430d-4075-a183-63171c7f3de5","type":"personal_access_tokens"}} form: {} headers: Accept: @@ -53,9 +53,9 @@ interactions: - application/json id: 2 method: PATCH - url: https://api.datadoghq.com/api/v2/service_accounts/86bdf0d7-2fa0-11f1-991f-62f4bfc595d0/access_tokens/9a7d27cc-4969-4a57-990c-03c23a9f2adc + url: https://api.datadoghq.com/api/v2/service_accounts/4d8efdef-39cf-11f1-bf73-ce6d1c25b9b4/access_tokens/eafa3dd9-430d-4075-a183-63171c7f3de5 response: - body: '{"data":{"id":"9a7d27cc-4969-4a57-990c-03c23a9f2adc","type":"personal_access_tokens","attributes":{"alias":"4hW0tyOpjf5Dj84mZaXqwe","created_at":"2026-04-03T21:03:12.978132Z","expires_at":null,"last_used_at":null,"modified_at":"2026-04-03T21:03:13.152078Z","name":"Test-Update_an_access_token_for_a_service_account_returns_OK_response-1775250192-updated","public_portion":"4hW0tyOpjf5Dj84mZaXqwe","scopes":["dashboards_read"]},"relationships":{"owned_by":{"data":{"id":"86bdf0d7-2fa0-11f1-991f-62f4bfc595d0","type":"users"}}}}}' + body: '{"data":{"id":"eafa3dd9-430d-4075-a183-63171c7f3de5","type":"personal_access_tokens","attributes":{"created_at":"2026-04-16T20:03:15.138533Z","expires_at":null,"last_used_at":null,"modified_at":"2026-04-16T20:03:15.375809Z","name":"Test-Update_an_access_token_for_a_service_account_returns_OK_response-1776369794-updated","public_portion":"ddpat_79OZ2nUHcB3McO399ZaVVt","scopes":["dashboards_read"]},"relationships":{"owned_by":{"data":{"id":"4d8efdef-39cf-11f1-bf73-ce6d1c25b9b4","type":"users"}}}}}' code: 200 duration: 0ms headers: @@ -70,7 +70,7 @@ interactions: - '*/*' id: 3 method: DELETE - url: https://api.datadoghq.com/api/v2/service_accounts/86bdf0d7-2fa0-11f1-991f-62f4bfc595d0/access_tokens/9a7d27cc-4969-4a57-990c-03c23a9f2adc + url: https://api.datadoghq.com/api/v2/service_accounts/4d8efdef-39cf-11f1-bf73-ce6d1c25b9b4/access_tokens/eafa3dd9-430d-4075-a183-63171c7f3de5 response: body: '' code: 204 @@ -85,7 +85,7 @@ interactions: - '*/*' id: 4 method: DELETE - url: https://api.datadoghq.com/api/v2/users/86bdf0d7-2fa0-11f1-991f-62f4bfc595d0 + url: https://api.datadoghq.com/api/v2/users/4d8efdef-39cf-11f1-bf73-ce6d1c25b9b4 response: body: '' code: 204 diff --git a/tests/scenarios/features/v2/key_management.feature b/tests/scenarios/features/v2/key_management.feature index 6c464845562..365c53ed7c2 100644 --- a/tests/scenarios/features/v2/key_management.feature +++ b/tests/scenarios/features/v2/key_management.feature @@ -221,7 +221,7 @@ Feature: Key Management @generated @skip @team:DataDog/credentials-management Scenario: Get a personal access token returns "Not Found" response Given new "GetPersonalAccessToken" request - And request contains "pat_uuid" parameter from "REPLACE.ME" + And request contains "pat_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 404 Not Found @@ -229,7 +229,7 @@ Feature: Key Management Scenario: Get a personal access token returns "OK" response Given there is a valid "personal_access_token" in the system And new "GetPersonalAccessToken" request - And request contains "pat_uuid" parameter from "personal_access_token.data.id" + And request contains "pat_id" parameter from "personal_access_token.data.id" When the request is sent Then the response status is 200 OK And the response "data.type" is equal to "personal_access_tokens" @@ -355,21 +355,21 @@ Feature: Key Management Scenario: Revoke a personal access token returns "No Content" response Given there is a valid "personal_access_token" in the system And new "RevokePersonalAccessToken" request - And request contains "pat_uuid" parameter from "personal_access_token.data.id" + And request contains "pat_id" parameter from "personal_access_token.data.id" When the request is sent Then the response status is 204 No Content @generated @skip @team:DataDog/credentials-management Scenario: Revoke a personal access token returns "Not Found" response Given new "RevokePersonalAccessToken" request - And request contains "pat_uuid" parameter from "REPLACE.ME" + And request contains "pat_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 404 Not Found @generated @skip @team:DataDog/credentials-management Scenario: Update a personal access token returns "Bad Request" response Given new "UpdatePersonalAccessToken" request - And request contains "pat_uuid" parameter from "REPLACE.ME" + And request contains "pat_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"name": "Updated Personal Access Token", "scopes": ["dashboards_read", "dashboards_write"]}, "id": "00112233-4455-6677-8899-aabbccddeeff", "type": "personal_access_tokens"}} When the request is sent Then the response status is 400 Bad Request @@ -377,7 +377,7 @@ Feature: Key Management @generated @skip @team:DataDog/credentials-management Scenario: Update a personal access token returns "Not Found" response Given new "UpdatePersonalAccessToken" request - And request contains "pat_uuid" parameter from "REPLACE.ME" + And request contains "pat_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"name": "Updated Personal Access Token", "scopes": ["dashboards_read", "dashboards_write"]}, "id": "00112233-4455-6677-8899-aabbccddeeff", "type": "personal_access_tokens"}} When the request is sent Then the response status is 404 Not Found @@ -386,7 +386,7 @@ Feature: Key Management Scenario: Update a personal access token returns "OK" response Given there is a valid "personal_access_token" in the system And new "UpdatePersonalAccessToken" request - And request contains "pat_uuid" parameter from "personal_access_token.data.id" + And request contains "pat_id" parameter from "personal_access_token.data.id" And body with value {"data": {"type": "personal_access_tokens", "id": "{{ personal_access_token.data.id }}", "attributes": {"name": "{{ unique }}-updated"}}} When the request is sent Then the response status is 200 OK diff --git a/tests/scenarios/features/v2/service_accounts.feature b/tests/scenarios/features/v2/service_accounts.feature index 25744abc832..fa8c81440e2 100644 --- a/tests/scenarios/features/v2/service_accounts.feature +++ b/tests/scenarios/features/v2/service_accounts.feature @@ -142,7 +142,7 @@ Feature: Service Accounts Scenario: Get an access token for a service account returns "Not Found" response Given new "GetServiceAccountAccessToken" request And request contains "service_account_id" parameter from "REPLACE.ME" - And request contains "pat_uuid" parameter from "REPLACE.ME" + And request contains "pat_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 404 Not Found @@ -152,7 +152,7 @@ Feature: Service Accounts And there is a valid "service_account_access_token" for "service_account_user" And new "GetServiceAccountAccessToken" request And request contains "service_account_id" parameter from "service_account_user.data.id" - And request contains "pat_uuid" parameter from "service_account_access_token.data.id" + And request contains "pat_id" parameter from "service_account_access_token.data.id" When the request is sent Then the response status is 200 OK And the response "data.attributes.name" has the same value as "service_account_access_token.data.attributes.name" @@ -232,7 +232,7 @@ Feature: Service Accounts And there is a valid "service_account_access_token" for "service_account_user" And new "RevokeServiceAccountAccessToken" request And request contains "service_account_id" parameter from "service_account_user.data.id" - And request contains "pat_uuid" parameter from "service_account_access_token.data.id" + And request contains "pat_id" parameter from "service_account_access_token.data.id" When the request is sent Then the response status is 204 No Content @@ -240,7 +240,7 @@ Feature: Service Accounts Scenario: Revoke an access token for a service account returns "Not Found" response Given new "RevokeServiceAccountAccessToken" request And request contains "service_account_id" parameter from "REPLACE.ME" - And request contains "pat_uuid" parameter from "REPLACE.ME" + And request contains "pat_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 404 Not Found @@ -248,7 +248,7 @@ Feature: Service Accounts Scenario: Update an access token for a service account returns "Bad Request" response Given new "UpdateServiceAccountAccessToken" request And request contains "service_account_id" parameter from "REPLACE.ME" - And request contains "pat_uuid" parameter from "REPLACE.ME" + And request contains "pat_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"name": "Updated Personal Access Token", "scopes": ["dashboards_read", "dashboards_write"]}, "id": "00112233-4455-6677-8899-aabbccddeeff", "type": "personal_access_tokens"}} When the request is sent Then the response status is 400 Bad Request @@ -257,7 +257,7 @@ Feature: Service Accounts Scenario: Update an access token for a service account returns "Not Found" response Given new "UpdateServiceAccountAccessToken" request And request contains "service_account_id" parameter from "REPLACE.ME" - And request contains "pat_uuid" parameter from "REPLACE.ME" + And request contains "pat_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"name": "Updated Personal Access Token", "scopes": ["dashboards_read", "dashboards_write"]}, "id": "00112233-4455-6677-8899-aabbccddeeff", "type": "personal_access_tokens"}} When the request is sent Then the response status is 404 Not Found @@ -268,7 +268,7 @@ Feature: Service Accounts And there is a valid "service_account_access_token" for "service_account_user" And new "UpdateServiceAccountAccessToken" request And request contains "service_account_id" parameter from "service_account_user.data.id" - And request contains "pat_uuid" parameter from "service_account_access_token.data.id" + And request contains "pat_id" parameter from "service_account_access_token.data.id" And body with value {"data": {"id": "{{ service_account_access_token.data.id }}", "type": "personal_access_tokens", "attributes": {"name": "{{ service_account_access_token.data.attributes.name }}-updated"}}} When the request is sent Then the response status is 200 OK diff --git a/tests/scenarios/features/v2/undo.json b/tests/scenarios/features/v2/undo.json index 9152f6b2278..994abc25242 100644 --- a/tests/scenarios/features/v2/undo.json +++ b/tests/scenarios/features/v2/undo.json @@ -4330,7 +4330,7 @@ "operationId": "RevokePersonalAccessToken", "parameters": [ { - "name": "pat_uuid", + "name": "pat_id", "source": "data.id" } ], @@ -5895,7 +5895,7 @@ "source": "data.relationships.owned_by.data.id" }, { - "name": "pat_uuid", + "name": "pat_id", "source": "data.id" } ],