From f913a7072095a474c3b11b75cc99e6bbb2df1aff Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Mon, 15 Jun 2026 09:03:17 +0000 Subject: [PATCH 1/2] Regenerate client from commit f8f89b6 of spec repo (#3481) Co-authored-by: ci.datadog-api-spec --- .generator/schemas/v2/openapi.yaml | 578 ++++++------------ .../GetHardcodedRetentionFilter.rb | 5 - .../ListHardcodedRetentionFilters.rb | 5 - .../UpdateHardcodedRetentionFilter.rb | 18 - features/scenarios_model_mapping.rb | 18 +- .../rum_hardcoded_retention_filters.feature | 59 -- .../rum_retention_filters_hardcoded.feature | 59 -- features/v2/undo.json | 18 - lib/datadog_api_client/configuration.rb | 2 + lib/datadog_api_client/inflector.rb | 23 +- .../v2/api/data_observability_api.rb | 168 +++++ .../rum_retention_filters_hardcoded_api.rb | 241 -------- ... data_observability_monitor_run_status.rb} | 12 +- ...=> data_observability_monitor_run_type.rb} | 6 +- ...ervability_monitor_run_status_response.rb} | 30 +- ...monitor_run_status_response_attributes.rb} | 60 +- ...ility_monitor_run_status_response_data.rb} | 17 +- .../rum_hardcoded_cross_product_sampling.rb | 172 ------ ...oded_cross_product_sampling_editability.rb | 115 ---- ...hardcoded_cross_product_sampling_update.rb | 175 ------ ...m_hardcoded_retention_filter_attributes.rb | 187 ------ ...m_hardcoded_retention_filter_event_type.rb | 32 - ...oded_retention_filter_update_attributes.rb | 107 ---- ...um_hardcoded_retention_filters_response.rb | 107 ---- ...un_data_observability_monitor_response.rb} | 10 +- ...ta_observability_monitor_response_data.rb} | 67 +- 26 files changed, 486 insertions(+), 1805 deletions(-) delete mode 100644 examples/v2/rum-retention-filters-hardcoded/GetHardcodedRetentionFilter.rb delete mode 100644 examples/v2/rum-retention-filters-hardcoded/ListHardcodedRetentionFilters.rb delete mode 100644 examples/v2/rum-retention-filters-hardcoded/UpdateHardcodedRetentionFilter.rb delete mode 100644 features/v2/rum_hardcoded_retention_filters.feature delete mode 100644 features/v2/rum_retention_filters_hardcoded.feature create mode 100644 lib/datadog_api_client/v2/api/data_observability_api.rb delete mode 100644 lib/datadog_api_client/v2/api/rum_retention_filters_hardcoded_api.rb rename lib/datadog_api_client/v2/models/{rum_hardcoded_retention_filter_meta_source.rb => data_observability_monitor_run_status.rb} (71%) rename lib/datadog_api_client/v2/models/{rum_hardcoded_retention_filter_type.rb => data_observability_monitor_run_type.rb} (75%) rename lib/datadog_api_client/v2/models/{rum_hardcoded_retention_filter_response.rb => get_data_observability_monitor_run_status_response.rb} (75%) rename lib/datadog_api_client/v2/models/{rum_hardcoded_retention_filter_meta.rb => get_data_observability_monitor_run_status_response_attributes.rb} (64%) rename lib/datadog_api_client/v2/models/{rum_hardcoded_retention_filter_update_data.rb => get_data_observability_monitor_run_status_response_data.rb} (86%) delete mode 100644 lib/datadog_api_client/v2/models/rum_hardcoded_cross_product_sampling.rb delete mode 100644 lib/datadog_api_client/v2/models/rum_hardcoded_cross_product_sampling_editability.rb delete mode 100644 lib/datadog_api_client/v2/models/rum_hardcoded_cross_product_sampling_update.rb delete mode 100644 lib/datadog_api_client/v2/models/rum_hardcoded_retention_filter_attributes.rb delete mode 100644 lib/datadog_api_client/v2/models/rum_hardcoded_retention_filter_event_type.rb delete mode 100644 lib/datadog_api_client/v2/models/rum_hardcoded_retention_filter_update_attributes.rb delete mode 100644 lib/datadog_api_client/v2/models/rum_hardcoded_retention_filters_response.rb rename lib/datadog_api_client/v2/models/{rum_hardcoded_retention_filter_update_request.rb => run_data_observability_monitor_response.rb} (90%) rename lib/datadog_api_client/v2/models/{rum_hardcoded_retention_filter_data.rb => run_data_observability_monitor_response_data.rb} (69%) diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index f5b3f3929801..be28ab3e9579 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -1557,20 +1557,6 @@ components: required: true schema: type: string - RumHardcodedRetentionFilterApplicationIDParameter: - description: RUM application ID. - in: path - name: app_id - required: true - schema: - type: string - RumHardcodedRetentionFilterIDParameter: - description: Hardcoded retention filter ID. - in: path - name: rf_id - required: true - schema: - type: string RumMetricIDParameter: description: The name of the RUM-based metric. in: path @@ -28735,6 +28721,31 @@ components: - bucket_name - bucket_region type: object + DataObservabilityMonitorRunStatus: + description: The status of a data observability monitor run. + enum: + - pending + - ok + - warn + - alert + - error + example: pending + type: string + x-enum-varnames: + - PENDING + - OK + - WARN + - ALERT + - ERROR + DataObservabilityMonitorRunType: + default: monitor_run + description: The JSON:API resource type for a data observability monitor run. + enum: + - monitor_run + example: monitor_run + type: string + x-enum-varnames: + - MONITOR_RUN DataRelationshipsTeams: description: Associates teams with this schedule in a data structure. properties: @@ -39045,6 +39056,42 @@ components: meta: $ref: "#/components/schemas/DataDeletionResponseMeta" type: object + GetDataObservabilityMonitorRunStatusResponse: + description: The response for getting the status of a data observability monitor run. + properties: + data: + $ref: "#/components/schemas/GetDataObservabilityMonitorRunStatusResponseData" + required: + - data + type: object + GetDataObservabilityMonitorRunStatusResponseAttributes: + description: The attributes of a data observability monitor run status response. + properties: + error_message: + description: Error message describing why the monitor run failed. Only present when status is error. + example: "run completed but produced no metric data" + type: string + status: + $ref: "#/components/schemas/DataObservabilityMonitorRunStatus" + required: + - status + type: object + GetDataObservabilityMonitorRunStatusResponseData: + description: The data object for a data observability monitor run status response. + properties: + attributes: + $ref: "#/components/schemas/GetDataObservabilityMonitorRunStatusResponseAttributes" + id: + description: The unique identifier of the monitor run. + example: "abc123def456" + type: string + type: + $ref: "#/components/schemas/DataObservabilityMonitorRunType" + required: + - id + - type + - attributes + type: object GetDeviceAttributes: description: The device attributes properties: @@ -76983,223 +77030,6 @@ components: minimum: 0 type: number type: object - RumHardcodedCrossProductSampling: - description: Cross-product retention settings for a hardcoded retention filter. - properties: - session_replay_enabled: - description: Indicates whether Session Replay cross-product retention is active. - example: true - type: boolean - session_replay_sample_rate: - description: Percentage (0–100) of retained sessions with an ingested replay whose replay data is kept. - example: 50.0 - format: double - maximum: 100 - minimum: 0 - type: number - trace_enabled: - description: Indicates whether Trace cross-product retention is active. - example: true - type: boolean - trace_sample_rate: - description: Percentage (0–100) of retained sessions with ingested traces whose traces are indexed. - example: 25.0 - format: double - maximum: 100 - minimum: 0 - type: number - type: object - RumHardcodedCrossProductSamplingEditability: - description: Flags indicating which `cross_product_sampling` fields can be updated. Read-only. - properties: - session_replay_sample_rate: - description: |- - If `true`, `cross_product_sampling.session_replay_sample_rate` can be updated on this filter. - example: true - type: boolean - trace_sample_rate: - description: If `true`, `cross_product_sampling.trace_sample_rate` can be updated on this filter. - example: false - type: boolean - type: object - RumHardcodedCrossProductSamplingUpdate: - description: |- - Partial update for cross-product retention of a hardcoded retention filter. - Only fields whose matching flag in `cross_product_sampling_editability` is `true` can be updated. - properties: - session_replay_enabled: - description: Controls whether Session Replay cross-product retention is active. Omit to leave unchanged. - example: true - type: boolean - session_replay_sample_rate: - description: |- - Percentage (0–100) of retained sessions with an ingested replay whose replay data is kept. - Omit to leave unchanged. - example: 50.0 - format: double - maximum: 100 - minimum: 0 - type: number - trace_enabled: - description: Controls whether Trace cross-product retention is active. Omit to leave unchanged. - example: true - type: boolean - trace_sample_rate: - description: |- - Percentage (0–100) of retained sessions with ingested traces whose traces are indexed. - Omit to leave unchanged. - example: 25.0 - format: double - maximum: 100 - minimum: 0 - type: number - type: object - RumHardcodedRetentionFilterAttributes: - description: The attributes of a hardcoded retention filter. - properties: - cross_product_sampling: - $ref: "#/components/schemas/RumHardcodedCrossProductSampling" - cross_product_sampling_editability: - $ref: "#/components/schemas/RumHardcodedCrossProductSamplingEditability" - enabled: - description: Indicates whether the hardcoded retention filter is active. Read-only. - example: true - type: boolean - event_type: - $ref: "#/components/schemas/RumHardcodedRetentionFilterEventType" - name: - description: The name of the hardcoded retention filter. Read-only. - example: Replay sessions - type: string - query: - description: The query string for the hardcoded retention filter. Read-only. - example: "@session.has_replay:true" - type: string - sample_rate: - description: The retention sample rate (0–100) for the hardcoded filter. Read-only. - example: 100.0 - format: double - maximum: 100 - minimum: 0 - type: number - type: object - RumHardcodedRetentionFilterData: - description: A hardcoded retention filter. - properties: - attributes: - $ref: "#/components/schemas/RumHardcodedRetentionFilterAttributes" - id: - description: The ID of the hardcoded retention filter. - example: forced_replay_sessions - type: string - meta: - $ref: "#/components/schemas/RumHardcodedRetentionFilterMeta" - type: - $ref: "#/components/schemas/RumHardcodedRetentionFilterType" - type: object - RumHardcodedRetentionFilterEventType: - description: The type of RUM events the hardcoded filter applies to. Read-only. - enum: - - session - - view - - action - - error - - resource - - long_task - - vital - example: session - type: string - x-enum-varnames: - - SESSION - - VIEW - - ACTION - - ERROR - - RESOURCE - - LONG_TASK - - VITAL - RumHardcodedRetentionFilterMeta: - description: Metadata about the hardcoded retention filter. - properties: - source: - $ref: "#/components/schemas/RumHardcodedRetentionFilterMetaSource" - updated_at: - description: Unix epoch (in milliseconds) of the last update. - example: 1735689600000 - format: int64 - type: integer - updated_by_handle: - description: Handle of the user who last updated the filter. - example: jane.doe@example.com - type: string - type: object - RumHardcodedRetentionFilterMetaSource: - description: The source of the last update to a hardcoded retention filter. - enum: - - default - - ui - - terraform - example: ui - type: string - x-enum-varnames: - - DEFAULT - - UI - - TERRAFORM - RumHardcodedRetentionFilterResponse: - description: A hardcoded retention filter response body. - properties: - data: - $ref: "#/components/schemas/RumHardcodedRetentionFilterData" - type: object - RumHardcodedRetentionFilterType: - default: hardcoded_retention_filters - description: The resource type. The value must be `hardcoded_retention_filters`. - enum: - - hardcoded_retention_filters - example: hardcoded_retention_filters - type: string - x-enum-varnames: - - HARDCODED_RETENTION_FILTERS - RumHardcodedRetentionFilterUpdateAttributes: - description: |- - The attributes of a hardcoded retention filter that can be updated. - Only fields whose matching flag in `cross_product_sampling_editability` is `true` can be modified. - properties: - cross_product_sampling: - $ref: "#/components/schemas/RumHardcodedCrossProductSamplingUpdate" - type: object - RumHardcodedRetentionFilterUpdateData: - description: The hardcoded retention filter properties to update. - properties: - attributes: - $ref: "#/components/schemas/RumHardcodedRetentionFilterUpdateAttributes" - id: - description: The ID of the hardcoded retention filter. Must match the `rf_id` path parameter. - example: forced_replay_sessions - type: string - type: - $ref: "#/components/schemas/RumHardcodedRetentionFilterType" - required: - - id - - type - - attributes - type: object - RumHardcodedRetentionFilterUpdateRequest: - description: The hardcoded retention filter body to update. - properties: - data: - $ref: "#/components/schemas/RumHardcodedRetentionFilterUpdateData" - required: - - data - type: object - RumHardcodedRetentionFiltersResponse: - description: All hardcoded retention filters for a RUM application. - properties: - data: - description: A list of hardcoded retention filters. - items: - $ref: "#/components/schemas/RumHardcodedRetentionFilterData" - type: array - type: object RumMetricCompute: description: The compute rule to compute the RUM-based metric. properties: @@ -77898,6 +77728,27 @@ components: $ref: "#/components/schemas/RumRetentionFilterData" type: array type: object + RunDataObservabilityMonitorResponse: + description: The response returned when a data observability monitor run is triggered. + properties: + data: + $ref: "#/components/schemas/RunDataObservabilityMonitorResponseData" + required: + - data + type: object + RunDataObservabilityMonitorResponseData: + description: The data object returned when a data observability monitor run is triggered. + properties: + id: + description: The unique identifier of the monitor run. + example: "abc123def456" + type: string + type: + $ref: "#/components/schemas/DataObservabilityMonitorRunType" + required: + - id + - type + type: object RunHistoricalJobRequest: description: Run a historical job request. properties: @@ -124777,6 +124628,105 @@ 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/). + /api/v2/data-observability/monitors/runs/{run_id}/status: + get: + description: Retrieves the current status of a data observability monitor run. Poll this endpoint after triggering a run to determine when evaluation is complete. + operationId: GetDataObservabilityMonitorRunStatus + parameters: + - description: The ID of the monitor run to retrieve status for. + example: "abc123def456" + in: path + name: run_id + required: true + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + status: ok + id: "abc123def456" + type: monitor_run + schema: + $ref: "#/components/schemas/GetDataObservabilityMonitorRunStatusResponse" + description: OK + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - data_observability_monitors_write + - monitors_write + summary: Get data observability monitor run status + tags: + - Data Observability + 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/data-observability/monitors/{monitor_id}/run: + post: + description: Manually triggers a run for a data observability monitor. Only monitors that are not scheduled (manually-runnable) can be triggered this way. + operationId: RunDataObservabilityMonitor + parameters: + - description: The ID of the data observability monitor to run. + example: 12345 + in: path + name: monitor_id + required: true + schema: + format: int64 + type: integer + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + id: "abc123def456" + type: monitor_run + schema: + $ref: "#/components/schemas/RunDataObservabilityMonitorResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - data_observability_monitors_write + - monitors_write + summary: Run a data observability monitor + tags: + - Data Observability + 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/datasets: get: description: Get all datasets that have been configured for an organization. @@ -159851,167 +159801,6 @@ paths: operator: OR permissions: - rum_apps_write - /api/v2/rum/applications/{app_id}/hardcoded_retention_filters: - get: - description: Get the list of hardcoded retention filters for a RUM application. - operationId: ListHardcodedRetentionFilters - parameters: - - $ref: "#/components/parameters/RumHardcodedRetentionFilterApplicationIDParameter" - responses: - "200": - content: - application/json: - examples: - default: - value: - data: - - attributes: - cross_product_sampling: - session_replay_enabled: true - session_replay_sample_rate: 50.0 - trace_enabled: true - trace_sample_rate: 25.0 - cross_product_sampling_editability: - session_replay_sample_rate: true - trace_sample_rate: false - enabled: true - event_type: session - name: Replay sessions - query: "@session.has_replay:true" - sample_rate: 100.0 - id: forced_replay_sessions - meta: - source: ui - updated_at: 1735689600000 - updated_by_handle: jane.doe@example.com - type: hardcoded_retention_filters - schema: - $ref: "#/components/schemas/RumHardcodedRetentionFiltersResponse" - description: OK - "403": - $ref: "#/components/responses/NotAuthorizedResponse" - "429": - $ref: "#/components/responses/TooManyRequestsResponse" - summary: Get all hardcoded retention filters - tags: - - RUM Retention Filters Hardcoded - /api/v2/rum/applications/{app_id}/hardcoded_retention_filters/{rf_id}: - get: - description: Get a single hardcoded retention filter for a RUM application. - operationId: GetHardcodedRetentionFilter - parameters: - - $ref: "#/components/parameters/RumHardcodedRetentionFilterApplicationIDParameter" - - $ref: "#/components/parameters/RumHardcodedRetentionFilterIDParameter" - responses: - "200": - content: - application/json: - examples: - default: - value: - data: - attributes: - cross_product_sampling: - session_replay_enabled: true - session_replay_sample_rate: 50.0 - trace_enabled: true - trace_sample_rate: 25.0 - cross_product_sampling_editability: - session_replay_sample_rate: true - trace_sample_rate: false - enabled: true - event_type: session - name: Replay sessions - query: "@session.has_replay:true" - sample_rate: 100.0 - id: forced_replay_sessions - meta: - source: ui - updated_at: 1735689600000 - updated_by_handle: jane.doe@example.com - type: hardcoded_retention_filters - schema: - $ref: "#/components/schemas/RumHardcodedRetentionFilterResponse" - description: OK - "403": - $ref: "#/components/responses/NotAuthorizedResponse" - "404": - $ref: "#/components/responses/NotFoundResponse" - "429": - $ref: "#/components/responses/TooManyRequestsResponse" - summary: Get a hardcoded retention filter - tags: - - RUM Retention Filters Hardcoded - patch: - description: |- - Update the cross-product sample rates of a hardcoded retention filter for a RUM application. - Only fields whose matching flag in `cross_product_sampling_editability` is `true` can be updated. - Any other field is read-only and cannot be sent in the payload. - Returns the updated hardcoded retention filter when the request is successful. - operationId: UpdateHardcodedRetentionFilter - parameters: - - $ref: "#/components/parameters/RumHardcodedRetentionFilterApplicationIDParameter" - - $ref: "#/components/parameters/RumHardcodedRetentionFilterIDParameter" - requestBody: - content: - application/json: - examples: - default: - value: - data: - attributes: - cross_product_sampling: - session_replay_enabled: true - session_replay_sample_rate: 50.0 - id: forced_replay_sessions - type: hardcoded_retention_filters - schema: - $ref: "#/components/schemas/RumHardcodedRetentionFilterUpdateRequest" - description: New cross-product sample rates for the hardcoded retention filter. - required: true - responses: - "200": - content: - application/json: - examples: - default: - value: - data: - attributes: - cross_product_sampling: - session_replay_enabled: true - session_replay_sample_rate: 50.0 - trace_enabled: true - trace_sample_rate: 25.0 - cross_product_sampling_editability: - session_replay_sample_rate: true - trace_sample_rate: false - enabled: true - event_type: session - name: Replay sessions - query: "@session.has_replay:true" - sample_rate: 100.0 - id: forced_replay_sessions - meta: - source: ui - updated_at: 1735689600000 - updated_by_handle: jane.doe@example.com - type: hardcoded_retention_filters - schema: - $ref: "#/components/schemas/RumHardcodedRetentionFilterResponse" - description: Updated - "400": - $ref: "#/components/responses/BadRequestResponse" - "403": - $ref: "#/components/responses/NotAuthorizedResponse" - "404": - $ref: "#/components/responses/NotFoundResponse" - "429": - $ref: "#/components/responses/TooManyRequestsResponse" - summary: Update a hardcoded retention filter - tags: - - RUM Retention Filters Hardcoded - x-codegen-request-body-name: body /api/v2/rum/applications/{app_id}/relationships/retention_filters: patch: description: |- @@ -186518,6 +186307,8 @@ tags: - description: |- The Data Deletion API allows the user to target and delete data from the allowed products. It's currently enabled for Logs and RUM and depends on `logs_delete_data` and `rum_delete_data` permissions respectively. name: Data Deletion + - description: Manage and run data observability monitors. + name: Data Observability - description: |- Data Access Controls in Datadog is a feature that allows administrators and access managers to regulate access to sensitive data. By defining Restricted Datasets, you can ensure that only specific teams or roles can @@ -186786,9 +186577,6 @@ tags: - description: |- Get insights into the performance of your Real User Monitoring (RUM) applications over HTTP. See the [RUM & Session Replay page](https://docs.datadoghq.com/real_user_monitoring/) for more information name: RUM Insights - - description: |- - Manage hardcoded retention filters through [Manage Applications](https://app.datadoghq.com/rum/list) in RUM. - name: RUM Retention Filters Hardcoded - description: View and manage Reference Tables in your organization. name: Reference Tables - description: |- diff --git a/examples/v2/rum-retention-filters-hardcoded/GetHardcodedRetentionFilter.rb b/examples/v2/rum-retention-filters-hardcoded/GetHardcodedRetentionFilter.rb deleted file mode 100644 index f8aabcac01ee..000000000000 --- a/examples/v2/rum-retention-filters-hardcoded/GetHardcodedRetentionFilter.rb +++ /dev/null @@ -1,5 +0,0 @@ -# Get a hardcoded retention filter returns "OK" response - -require "datadog_api_client" -api_instance = DatadogAPIClient::V2::RUMRetentionFiltersHardcodedAPI.new -p api_instance.get_hardcoded_retention_filter("Example-RUM-Retention-Filters-Hardcoded", "Example-RUM-Retention-Filters-Hardcoded") diff --git a/examples/v2/rum-retention-filters-hardcoded/ListHardcodedRetentionFilters.rb b/examples/v2/rum-retention-filters-hardcoded/ListHardcodedRetentionFilters.rb deleted file mode 100644 index cda1c71a3586..000000000000 --- a/examples/v2/rum-retention-filters-hardcoded/ListHardcodedRetentionFilters.rb +++ /dev/null @@ -1,5 +0,0 @@ -# Get all hardcoded retention filters returns "OK" response - -require "datadog_api_client" -api_instance = DatadogAPIClient::V2::RUMRetentionFiltersHardcodedAPI.new -p api_instance.list_hardcoded_retention_filters("Example-RUM-Retention-Filters-Hardcoded") diff --git a/examples/v2/rum-retention-filters-hardcoded/UpdateHardcodedRetentionFilter.rb b/examples/v2/rum-retention-filters-hardcoded/UpdateHardcodedRetentionFilter.rb deleted file mode 100644 index 06738f8b79b7..000000000000 --- a/examples/v2/rum-retention-filters-hardcoded/UpdateHardcodedRetentionFilter.rb +++ /dev/null @@ -1,18 +0,0 @@ -# Update a hardcoded retention filter returns "Updated" response - -require "datadog_api_client" -api_instance = DatadogAPIClient::V2::RUMRetentionFiltersHardcodedAPI.new - -body = DatadogAPIClient::V2::RumHardcodedRetentionFilterUpdateRequest.new({ - data: DatadogAPIClient::V2::RumHardcodedRetentionFilterUpdateData.new({ - id: "REPLACE.ME", - type: DatadogAPIClient::V2::RumHardcodedRetentionFilterType::HARDCODED_RETENTION_FILTERS, - attributes: DatadogAPIClient::V2::RumHardcodedRetentionFilterUpdateAttributes.new({ - cross_product_sampling: DatadogAPIClient::V2::RumHardcodedCrossProductSamplingUpdate.new({ - session_replay_sample_rate: 50.0, - session_replay_enabled: true, - }), - }), - }), -}) -p api_instance.update_hardcoded_retention_filter("Example-RUM-Retention-Filters-Hardcoded", "Example-RUM-Retention-Filters-Hardcoded", body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 284bf98b6920..7ca6aaafe626 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -2947,6 +2947,12 @@ "v2.GetDashboardUsage" => { "dashboard_id" => "String", }, + "v2.GetDataObservabilityMonitorRunStatus" => { + "run_id" => "String", + }, + "v2.RunDataObservabilityMonitor" => { + "monitor_id" => "Integer", + }, "v2.CreateDataset" => { "body" => "DatasetCreateRequest", }, @@ -4856,18 +4862,6 @@ "v2.GetServiceRepositoryInfo" => { "body" => "ServiceRepositoryInfoRequest", }, - "v2.ListHardcodedRetentionFilters" => { - "app_id" => "String", - }, - "v2.GetHardcodedRetentionFilter" => { - "app_id" => "String", - "rf_id" => "String", - }, - "v2.UpdateHardcodedRetentionFilter" => { - "app_id" => "String", - "rf_id" => "String", - "body" => "RumHardcodedRetentionFilterUpdateRequest", - }, "v2.OrderRetentionFilters" => { "app_id" => "String", "body" => "RumRetentionFiltersOrderRequest", diff --git a/features/v2/rum_hardcoded_retention_filters.feature b/features/v2/rum_hardcoded_retention_filters.feature deleted file mode 100644 index 05e942989bf1..000000000000 --- a/features/v2/rum_hardcoded_retention_filters.feature +++ /dev/null @@ -1,59 +0,0 @@ -@endpoint(rum-hardcoded-retention-filters) @endpoint(rum-hardcoded-retention-filters-v2) -Feature: RUM Retention Filters Hardcoded - Manage hardcoded retention filters through [Manage - Applications](https://app.datadoghq.com/rum/list) in RUM. - - Background: - Given a valid "apiKeyAuth" key in the system - And a valid "appKeyAuth" key in the system - And an instance of "RUMRetentionFiltersHardcoded" API - - @generated @skip @team:DataDog/rum-backend - Scenario: Get a hardcoded retention filter returns "Not Found" response - Given new "GetHardcodedRetentionFilter" request - And request contains "app_id" parameter with value "{{ unique }}" - And request contains "rf_id" parameter with value "{{ unique }}" - When the request is sent - Then the response status is 404 Not Found - - @generated @skip @team:DataDog/rum-backend - Scenario: Get a hardcoded retention filter returns "OK" response - Given new "GetHardcodedRetentionFilter" request - And request contains "app_id" parameter with value "{{ unique }}" - And request contains "rf_id" parameter with value "{{ unique }}" - When the request is sent - Then the response status is 200 OK - - @generated @skip @team:DataDog/rum-backend - Scenario: Get all hardcoded retention filters returns "OK" response - Given new "ListHardcodedRetentionFilters" request - And request contains "app_id" parameter with value "{{ unique }}" - When the request is sent - Then the response status is 200 OK - - @generated @skip @team:DataDog/rum-backend - Scenario: Update a hardcoded retention filter returns "Bad Request" response - Given new "UpdateHardcodedRetentionFilter" request - And request contains "app_id" parameter with value "{{ unique }}" - And request contains "rf_id" parameter with value "{{ unique }}" - And body with value {"data": {"id": "REPLACE.ME", "type": "hardcoded_retention_filters", "attributes": {"cross_product_sampling": {"session_replay_sample_rate": 50.0}}}} - When the request is sent - Then the response status is 400 Bad Request - - @generated @skip @team:DataDog/rum-backend - Scenario: Update a hardcoded retention filter returns "Not Found" response - Given new "UpdateHardcodedRetentionFilter" request - And request contains "app_id" parameter with value "{{ unique }}" - And request contains "rf_id" parameter with value "{{ unique }}" - And body with value {"data": {"id": "REPLACE.ME", "type": "hardcoded_retention_filters", "attributes": {"cross_product_sampling": {"session_replay_sample_rate": 50.0}}}} - When the request is sent - Then the response status is 404 Not Found - - @generated @skip @team:DataDog/rum-backend - Scenario: Update a hardcoded retention filter returns "Updated" response - Given new "UpdateHardcodedRetentionFilter" request - And request contains "app_id" parameter with value "{{ unique }}" - And request contains "rf_id" parameter with value "{{ unique }}" - And body with value {"data": {"id": "REPLACE.ME", "type": "hardcoded_retention_filters", "attributes": {"cross_product_sampling": {"session_replay_sample_rate": 50.0, "session_replay_enabled": true}}}} - When the request is sent - Then the response status is 200 OK diff --git a/features/v2/rum_retention_filters_hardcoded.feature b/features/v2/rum_retention_filters_hardcoded.feature deleted file mode 100644 index 2ce25e7a3a3e..000000000000 --- a/features/v2/rum_retention_filters_hardcoded.feature +++ /dev/null @@ -1,59 +0,0 @@ -@endpoint(rum-retention-filters-hardcoded) @endpoint(rum-retention-filters-hardcoded-v2) -Feature: RUM Retention Filters Hardcoded - Manage hardcoded retention filters through [Manage - Applications](https://app.datadoghq.com/rum/list) in RUM. - - Background: - Given a valid "apiKeyAuth" key in the system - And a valid "appKeyAuth" key in the system - And an instance of "RUMRetentionFiltersHardcoded" API - - @generated @skip @team:DataDog/rum-backend - Scenario: Get a hardcoded retention filter returns "Not Found" response - Given new "GetHardcodedRetentionFilter" request - And request contains "app_id" parameter from "REPLACE.ME" - And request contains "rf_id" parameter from "REPLACE.ME" - When the request is sent - Then the response status is 404 Not Found - - @generated @skip @team:DataDog/rum-backend - Scenario: Get a hardcoded retention filter returns "OK" response - Given new "GetHardcodedRetentionFilter" request - And request contains "app_id" parameter from "REPLACE.ME" - And request contains "rf_id" parameter from "REPLACE.ME" - When the request is sent - Then the response status is 200 OK - - @generated @skip @team:DataDog/rum-backend - Scenario: Get all hardcoded retention filters returns "OK" response - Given new "ListHardcodedRetentionFilters" request - And request contains "app_id" parameter from "REPLACE.ME" - When the request is sent - Then the response status is 200 OK - - @generated @skip @team:DataDog/rum-backend - Scenario: Update a hardcoded retention filter returns "Bad Request" response - Given new "UpdateHardcodedRetentionFilter" request - And request contains "app_id" parameter from "REPLACE.ME" - And request contains "rf_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"cross_product_sampling": {"session_replay_enabled": true, "session_replay_sample_rate": 50.0, "trace_enabled": true, "trace_sample_rate": 25.0}}, "id": "forced_replay_sessions", "type": "hardcoded_retention_filters"}} - When the request is sent - Then the response status is 400 Bad Request - - @generated @skip @team:DataDog/rum-backend - Scenario: Update a hardcoded retention filter returns "Not Found" response - Given new "UpdateHardcodedRetentionFilter" request - And request contains "app_id" parameter from "REPLACE.ME" - And request contains "rf_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"cross_product_sampling": {"session_replay_enabled": true, "session_replay_sample_rate": 50.0, "trace_enabled": true, "trace_sample_rate": 25.0}}, "id": "forced_replay_sessions", "type": "hardcoded_retention_filters"}} - When the request is sent - Then the response status is 404 Not Found - - @generated @skip @team:DataDog/rum-backend - Scenario: Update a hardcoded retention filter returns "Updated" response - Given new "UpdateHardcodedRetentionFilter" request - And request contains "app_id" parameter from "REPLACE.ME" - And request contains "rf_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"cross_product_sampling": {"session_replay_enabled": true, "session_replay_sample_rate": 50.0, "trace_enabled": true, "trace_sample_rate": 25.0}}, "id": "forced_replay_sessions", "type": "hardcoded_retention_filters"}} - When the request is sent - Then the response status is 200 Updated diff --git a/features/v2/undo.json b/features/v2/undo.json index 54f20db64607..b047963c2ada 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -6419,24 +6419,6 @@ "type": "unsafe" } }, - "ListHardcodedRetentionFilters": { - "tag": "RUM Retention Filters Hardcoded", - "undo": { - "type": "safe" - } - }, - "GetHardcodedRetentionFilter": { - "tag": "RUM Retention Filters Hardcoded", - "undo": { - "type": "safe" - } - }, - "UpdateHardcodedRetentionFilter": { - "tag": "RUM Retention Filters Hardcoded", - "undo": { - "type": "idempotent" - } - }, "OrderRetentionFilters": { "tag": "Rum Retention Filters", "undo": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index 1810246766cc..420e3d7afb11 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -424,6 +424,8 @@ def initialize "v2.update_dashboard_secure_embed": false, "v2.get_dashboard_usage": false, "v2.list_dashboards_usage": false, + "v2.get_data_observability_monitor_run_status": false, + "v2.run_data_observability_monitor": false, "v2.create_dataset": false, "v2.delete_dataset": false, "v2.get_all_datasets": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 3f257b7d4490..8aa6ae1fcc0c 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -2703,6 +2703,8 @@ def overrides "v2.datadog_integration_type" => "DatadogIntegrationType", "v2.datadog_integration_update" => "DatadogIntegrationUpdate", "v2.data_export_config" => "DataExportConfig", + "v2.data_observability_monitor_run_status" => "DataObservabilityMonitorRunStatus", + "v2.data_observability_monitor_run_type" => "DataObservabilityMonitorRunType", "v2.data_relationships_teams" => "DataRelationshipsTeams", "v2.data_relationships_teams_data_items" => "DataRelationshipsTeamsDataItems", "v2.data_relationships_teams_data_items_type" => "DataRelationshipsTeamsDataItemsType", @@ -3377,6 +3379,9 @@ def overrides "v2.get_blueprints_response" => "GetBlueprintsResponse", "v2.get_custom_framework_response" => "GetCustomFrameworkResponse", "v2.get_data_deletions_response_body" => "GetDataDeletionsResponseBody", + "v2.get_data_observability_monitor_run_status_response" => "GetDataObservabilityMonitorRunStatusResponse", + "v2.get_data_observability_monitor_run_status_response_attributes" => "GetDataObservabilityMonitorRunStatusResponseAttributes", + "v2.get_data_observability_monitor_run_status_response_data" => "GetDataObservabilityMonitorRunStatusResponseData", "v2.get_device_attributes" => "GetDeviceAttributes", "v2.get_device_data" => "GetDeviceData", "v2.get_device_response" => "GetDeviceResponse", @@ -5811,20 +5816,6 @@ def overrides "v2.rum_group_by_histogram" => "RUMGroupByHistogram", "v2.rum_group_by_missing" => "RUMGroupByMissing", "v2.rum_group_by_total" => "RUMGroupByTotal", - "v2.rum_hardcoded_cross_product_sampling" => "RumHardcodedCrossProductSampling", - "v2.rum_hardcoded_cross_product_sampling_editability" => "RumHardcodedCrossProductSamplingEditability", - "v2.rum_hardcoded_cross_product_sampling_update" => "RumHardcodedCrossProductSamplingUpdate", - "v2.rum_hardcoded_retention_filter_attributes" => "RumHardcodedRetentionFilterAttributes", - "v2.rum_hardcoded_retention_filter_data" => "RumHardcodedRetentionFilterData", - "v2.rum_hardcoded_retention_filter_event_type" => "RumHardcodedRetentionFilterEventType", - "v2.rum_hardcoded_retention_filter_meta" => "RumHardcodedRetentionFilterMeta", - "v2.rum_hardcoded_retention_filter_meta_source" => "RumHardcodedRetentionFilterMetaSource", - "v2.rum_hardcoded_retention_filter_response" => "RumHardcodedRetentionFilterResponse", - "v2.rum_hardcoded_retention_filters_response" => "RumHardcodedRetentionFiltersResponse", - "v2.rum_hardcoded_retention_filter_type" => "RumHardcodedRetentionFilterType", - "v2.rum_hardcoded_retention_filter_update_attributes" => "RumHardcodedRetentionFilterUpdateAttributes", - "v2.rum_hardcoded_retention_filter_update_data" => "RumHardcodedRetentionFilterUpdateData", - "v2.rum_hardcoded_retention_filter_update_request" => "RumHardcodedRetentionFilterUpdateRequest", "v2.rum_metric_compute" => "RumMetricCompute", "v2.rum_metric_compute_aggregation_type" => "RumMetricComputeAggregationType", "v2.rum_metric_create_attributes" => "RumMetricCreateAttributes", @@ -5900,6 +5891,8 @@ def overrides "v2.rum_sort" => "RUMSort", "v2.rum_sort_order" => "RUMSortOrder", "v2.rum_warning" => "RUMWarning", + "v2.run_data_observability_monitor_response" => "RunDataObservabilityMonitorResponse", + "v2.run_data_observability_monitor_response_data" => "RunDataObservabilityMonitorResponseData", "v2.run_historical_job_request" => "RunHistoricalJobRequest", "v2.run_historical_job_request_attributes" => "RunHistoricalJobRequestAttributes", "v2.run_historical_job_request_data" => "RunHistoricalJobRequestData", @@ -7672,6 +7665,7 @@ def overrides "v2.dashboard_sharing_api" => "DashboardSharingAPI", "v2.dashboards_api" => "DashboardsAPI", "v2.data_deletion_api" => "DataDeletionAPI", + "v2.data_observability_api" => "DataObservabilityAPI", "v2.datasets_api" => "DatasetsAPI", "v2.deployment_gates_api" => "DeploymentGatesAPI", "v2.domain_allowlist_api" => "DomainAllowlistAPI", @@ -7732,7 +7726,6 @@ def overrides "v2.rum_replay_sessions_api" => "RumReplaySessionsAPI", "v2.rum_replay_viewership_api" => "RumReplayViewershipAPI", "v2.rum_retention_filters_api" => "RumRetentionFiltersAPI", - "v2.rum_retention_filters_hardcoded_api" => "RUMRetentionFiltersHardcodedAPI", "v2.salesforce_integration_api" => "SalesforceIntegrationAPI", "v2.scorecards_api" => "ScorecardsAPI", "v2.seats_api" => "SeatsAPI", diff --git a/lib/datadog_api_client/v2/api/data_observability_api.rb b/lib/datadog_api_client/v2/api/data_observability_api.rb new file mode 100644 index 000000000000..0cae2b23ef9c --- /dev/null +++ b/lib/datadog_api_client/v2/api/data_observability_api.rb @@ -0,0 +1,168 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'cgi' + +module DatadogAPIClient::V2 + class DataObservabilityAPI + attr_accessor :api_client + + def initialize(api_client = DatadogAPIClient::APIClient.default) + @api_client = api_client + end + + # Get data observability monitor run status. + # + # @see #get_data_observability_monitor_run_status_with_http_info + def get_data_observability_monitor_run_status(run_id, opts = {}) + data, _status_code, _headers = get_data_observability_monitor_run_status_with_http_info(run_id, opts) + data + end + + # Get data observability monitor run status. + # + # Retrieves the current status of a data observability monitor run. Poll this endpoint after triggering a run to determine when evaluation is complete. + # + # @param run_id [String] The ID of the monitor run to retrieve status for. + # @param opts [Hash] the optional parameters + # @return [Array<(GetDataObservabilityMonitorRunStatusResponse, Integer, Hash)>] GetDataObservabilityMonitorRunStatusResponse data, response status code and response headers + def get_data_observability_monitor_run_status_with_http_info(run_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_data_observability_monitor_run_status".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_data_observability_monitor_run_status") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_data_observability_monitor_run_status")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: DataObservabilityAPI.get_data_observability_monitor_run_status ...' + end + # verify the required parameter 'run_id' is set + if @api_client.config.client_side_validation && run_id.nil? + fail ArgumentError, "Missing the required parameter 'run_id' when calling DataObservabilityAPI.get_data_observability_monitor_run_status" + end + # resource path + local_var_path = '/api/v2/data-observability/monitors/runs/{run_id}/status'.sub('{run_id}', CGI.escape(run_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'GetDataObservabilityMonitorRunStatusResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :get_data_observability_monitor_run_status, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: DataObservabilityAPI#get_data_observability_monitor_run_status\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Run a data observability monitor. + # + # @see #run_data_observability_monitor_with_http_info + def run_data_observability_monitor(monitor_id, opts = {}) + data, _status_code, _headers = run_data_observability_monitor_with_http_info(monitor_id, opts) + data + end + + # Run a data observability monitor. + # + # Manually triggers a run for a data observability monitor. Only monitors that are not scheduled (manually-runnable) can be triggered this way. + # + # @param monitor_id [Integer] The ID of the data observability monitor to run. + # @param opts [Hash] the optional parameters + # @return [Array<(RunDataObservabilityMonitorResponse, Integer, Hash)>] RunDataObservabilityMonitorResponse data, response status code and response headers + def run_data_observability_monitor_with_http_info(monitor_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.run_data_observability_monitor".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.run_data_observability_monitor") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.run_data_observability_monitor")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: DataObservabilityAPI.run_data_observability_monitor ...' + end + # verify the required parameter 'monitor_id' is set + if @api_client.config.client_side_validation && monitor_id.nil? + fail ArgumentError, "Missing the required parameter 'monitor_id' when calling DataObservabilityAPI.run_data_observability_monitor" + end + # resource path + local_var_path = '/api/v2/data-observability/monitors/{monitor_id}/run'.sub('{monitor_id}', CGI.escape(monitor_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'RunDataObservabilityMonitorResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :run_data_observability_monitor, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: DataObservabilityAPI#run_data_observability_monitor\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/datadog_api_client/v2/api/rum_retention_filters_hardcoded_api.rb b/lib/datadog_api_client/v2/api/rum_retention_filters_hardcoded_api.rb deleted file mode 100644 index 0a2cb5a23851..000000000000 --- a/lib/datadog_api_client/v2/api/rum_retention_filters_hardcoded_api.rb +++ /dev/null @@ -1,241 +0,0 @@ -=begin -#Datadog API V2 Collection - -#Collection of all Datadog Public endpoints. - -The version of the OpenAPI document: 1.0 -Contact: support@datadoghq.com -Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator - - 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 2020-Present Datadog, Inc. - -=end - -require 'cgi' - -module DatadogAPIClient::V2 - class RUMRetentionFiltersHardcodedAPI - attr_accessor :api_client - - def initialize(api_client = DatadogAPIClient::APIClient.default) - @api_client = api_client - end - - # Get a hardcoded retention filter. - # - # @see #get_hardcoded_retention_filter_with_http_info - def get_hardcoded_retention_filter(app_id, rf_id, opts = {}) - data, _status_code, _headers = get_hardcoded_retention_filter_with_http_info(app_id, rf_id, opts) - data - end - - # Get a hardcoded retention filter. - # - # Get a single hardcoded retention filter for a RUM application. - # - # @param app_id [String] RUM application ID. - # @param rf_id [String] Hardcoded retention filter ID. - # @param opts [Hash] the optional parameters - # @return [Array<(RumHardcodedRetentionFilterResponse, Integer, Hash)>] RumHardcodedRetentionFilterResponse data, response status code and response headers - def get_hardcoded_retention_filter_with_http_info(app_id, rf_id, opts = {}) - - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: RUMRetentionFiltersHardcodedAPI.get_hardcoded_retention_filter ...' - end - # verify the required parameter 'app_id' is set - if @api_client.config.client_side_validation && app_id.nil? - fail ArgumentError, "Missing the required parameter 'app_id' when calling RUMRetentionFiltersHardcodedAPI.get_hardcoded_retention_filter" - end - # verify the required parameter 'rf_id' is set - if @api_client.config.client_side_validation && rf_id.nil? - fail ArgumentError, "Missing the required parameter 'rf_id' when calling RUMRetentionFiltersHardcodedAPI.get_hardcoded_retention_filter" - end - # resource path - local_var_path = '/api/v2/rum/applications/{app_id}/hardcoded_retention_filters/{rf_id}'.sub('{app_id}', CGI.escape(app_id.to_s).gsub('%2F', '/')).sub('{rf_id}', CGI.escape(rf_id.to_s).gsub('%2F', '/')) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] - - # return_type - return_type = opts[:debug_return_type] || 'RumHardcodedRetentionFilterResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] - - new_options = opts.merge( - :operation => :get_hardcoded_retention_filter, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type, - :api_version => "V2" - ) - - data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: RUMRetentionFiltersHardcodedAPI#get_hardcoded_retention_filter\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Get all hardcoded retention filters. - # - # @see #list_hardcoded_retention_filters_with_http_info - def list_hardcoded_retention_filters(app_id, opts = {}) - data, _status_code, _headers = list_hardcoded_retention_filters_with_http_info(app_id, opts) - data - end - - # Get all hardcoded retention filters. - # - # Get the list of hardcoded retention filters for a RUM application. - # - # @param app_id [String] RUM application ID. - # @param opts [Hash] the optional parameters - # @return [Array<(RumHardcodedRetentionFiltersResponse, Integer, Hash)>] RumHardcodedRetentionFiltersResponse data, response status code and response headers - def list_hardcoded_retention_filters_with_http_info(app_id, opts = {}) - - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: RUMRetentionFiltersHardcodedAPI.list_hardcoded_retention_filters ...' - end - # verify the required parameter 'app_id' is set - if @api_client.config.client_side_validation && app_id.nil? - fail ArgumentError, "Missing the required parameter 'app_id' when calling RUMRetentionFiltersHardcodedAPI.list_hardcoded_retention_filters" - end - # resource path - local_var_path = '/api/v2/rum/applications/{app_id}/hardcoded_retention_filters'.sub('{app_id}', CGI.escape(app_id.to_s).gsub('%2F', '/')) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] - - # return_type - return_type = opts[:debug_return_type] || 'RumHardcodedRetentionFiltersResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] - - new_options = opts.merge( - :operation => :list_hardcoded_retention_filters, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type, - :api_version => "V2" - ) - - data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: RUMRetentionFiltersHardcodedAPI#list_hardcoded_retention_filters\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Update a hardcoded retention filter. - # - # @see #update_hardcoded_retention_filter_with_http_info - def update_hardcoded_retention_filter(app_id, rf_id, body, opts = {}) - data, _status_code, _headers = update_hardcoded_retention_filter_with_http_info(app_id, rf_id, body, opts) - data - end - - # Update a hardcoded retention filter. - # - # Update the cross-product sample rates of a hardcoded retention filter for a RUM application. - # Only fields whose matching flag in `cross_product_sampling_editability` is `true` can be updated. - # Any other field is read-only and cannot be sent in the payload. - # Returns the updated hardcoded retention filter when the request is successful. - # - # @param app_id [String] RUM application ID. - # @param rf_id [String] Hardcoded retention filter ID. - # @param body [RumHardcodedRetentionFilterUpdateRequest] New cross-product sample rates for the hardcoded retention filter. - # @param opts [Hash] the optional parameters - # @return [Array<(RumHardcodedRetentionFilterResponse, Integer, Hash)>] RumHardcodedRetentionFilterResponse data, response status code and response headers - def update_hardcoded_retention_filter_with_http_info(app_id, rf_id, body, opts = {}) - - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: RUMRetentionFiltersHardcodedAPI.update_hardcoded_retention_filter ...' - end - # verify the required parameter 'app_id' is set - if @api_client.config.client_side_validation && app_id.nil? - fail ArgumentError, "Missing the required parameter 'app_id' when calling RUMRetentionFiltersHardcodedAPI.update_hardcoded_retention_filter" - end - # verify the required parameter 'rf_id' is set - if @api_client.config.client_side_validation && rf_id.nil? - fail ArgumentError, "Missing the required parameter 'rf_id' when calling RUMRetentionFiltersHardcodedAPI.update_hardcoded_retention_filter" - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling RUMRetentionFiltersHardcodedAPI.update_hardcoded_retention_filter" - end - # resource path - local_var_path = '/api/v2/rum/applications/{app_id}/hardcoded_retention_filters/{rf_id}'.sub('{app_id}', CGI.escape(app_id.to_s).gsub('%2F', '/')).sub('{rf_id}', CGI.escape(rf_id.to_s).gsub('%2F', '/')) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(body) - - # return_type - return_type = opts[:debug_return_type] || 'RumHardcodedRetentionFilterResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] - - new_options = opts.merge( - :operation => :update_hardcoded_retention_filter, - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type, - :api_version => "V2" - ) - - data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: RUMRetentionFiltersHardcodedAPI#update_hardcoded_retention_filter\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - end -end diff --git a/lib/datadog_api_client/v2/models/rum_hardcoded_retention_filter_meta_source.rb b/lib/datadog_api_client/v2/models/data_observability_monitor_run_status.rb similarity index 71% rename from lib/datadog_api_client/v2/models/rum_hardcoded_retention_filter_meta_source.rb rename to lib/datadog_api_client/v2/models/data_observability_monitor_run_status.rb index 5886605fe183..41df54e1f81b 100644 --- a/lib/datadog_api_client/v2/models/rum_hardcoded_retention_filter_meta_source.rb +++ b/lib/datadog_api_client/v2/models/data_observability_monitor_run_status.rb @@ -17,12 +17,14 @@ require 'time' module DatadogAPIClient::V2 - # The source of the last update to a hardcoded retention filter. - class RumHardcodedRetentionFilterMetaSource + # The status of a data observability monitor run. + class DataObservabilityMonitorRunStatus include BaseEnumModel - DEFAULT = "default".freeze - UI = "ui".freeze - TERRAFORM = "terraform".freeze + PENDING = "pending".freeze + OK = "ok".freeze + WARN = "warn".freeze + ALERT = "alert".freeze + ERROR = "error".freeze end end diff --git a/lib/datadog_api_client/v2/models/rum_hardcoded_retention_filter_type.rb b/lib/datadog_api_client/v2/models/data_observability_monitor_run_type.rb similarity index 75% rename from lib/datadog_api_client/v2/models/rum_hardcoded_retention_filter_type.rb rename to lib/datadog_api_client/v2/models/data_observability_monitor_run_type.rb index 945a9466cb6c..d1536cf36009 100644 --- a/lib/datadog_api_client/v2/models/rum_hardcoded_retention_filter_type.rb +++ b/lib/datadog_api_client/v2/models/data_observability_monitor_run_type.rb @@ -17,10 +17,10 @@ require 'time' module DatadogAPIClient::V2 - # The resource type. The value must be `hardcoded_retention_filters`. - class RumHardcodedRetentionFilterType + # The JSON:API resource type for a data observability monitor run. + class DataObservabilityMonitorRunType include BaseEnumModel - HARDCODED_RETENTION_FILTERS = "hardcoded_retention_filters".freeze + MONITOR_RUN = "monitor_run".freeze end end diff --git a/lib/datadog_api_client/v2/models/rum_hardcoded_retention_filter_response.rb b/lib/datadog_api_client/v2/models/get_data_observability_monitor_run_status_response.rb similarity index 75% rename from lib/datadog_api_client/v2/models/rum_hardcoded_retention_filter_response.rb rename to lib/datadog_api_client/v2/models/get_data_observability_monitor_run_status_response.rb index 97040bbd6b2e..6d8b0d07295f 100644 --- a/lib/datadog_api_client/v2/models/rum_hardcoded_retention_filter_response.rb +++ b/lib/datadog_api_client/v2/models/get_data_observability_monitor_run_status_response.rb @@ -17,12 +17,12 @@ require 'time' module DatadogAPIClient::V2 - # A hardcoded retention filter response body. - class RumHardcodedRetentionFilterResponse + # The response for getting the status of a data observability monitor run. + class GetDataObservabilityMonitorRunStatusResponse include BaseGenericModel - # A hardcoded retention filter. - attr_accessor :data + # The data object for a data observability monitor run status response. + attr_reader :data attr_accessor :additional_properties @@ -38,7 +38,7 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'data' => :'RumHardcodedRetentionFilterData' + :'data' => :'GetDataObservabilityMonitorRunStatusResponseData' } end @@ -47,7 +47,7 @@ def self.openapi_types # @!visibility private def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::RumHardcodedRetentionFilterResponse` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::GetDataObservabilityMonitorRunStatusResponse` initialize method" end self.additional_properties = {} @@ -65,6 +65,24 @@ def initialize(attributes = {}) end end + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + # Returns the object in the form of hash, with additionalProperties support. # @return [Hash] Returns the object in the form of hash # @!visibility private diff --git a/lib/datadog_api_client/v2/models/rum_hardcoded_retention_filter_meta.rb b/lib/datadog_api_client/v2/models/get_data_observability_monitor_run_status_response_attributes.rb similarity index 64% rename from lib/datadog_api_client/v2/models/rum_hardcoded_retention_filter_meta.rb rename to lib/datadog_api_client/v2/models/get_data_observability_monitor_run_status_response_attributes.rb index 1ac0f4b7d99d..f67a23fcb326 100644 --- a/lib/datadog_api_client/v2/models/rum_hardcoded_retention_filter_meta.rb +++ b/lib/datadog_api_client/v2/models/get_data_observability_monitor_run_status_response_attributes.rb @@ -17,18 +17,15 @@ require 'time' module DatadogAPIClient::V2 - # Metadata about the hardcoded retention filter. - class RumHardcodedRetentionFilterMeta + # The attributes of a data observability monitor run status response. + class GetDataObservabilityMonitorRunStatusResponseAttributes include BaseGenericModel - # The source of the last update to a hardcoded retention filter. - attr_accessor :source + # Error message describing why the monitor run failed. Only present when status is error. + attr_accessor :error_message - # Unix epoch (in milliseconds) of the last update. - attr_accessor :updated_at - - # Handle of the user who last updated the filter. - attr_accessor :updated_by_handle + # The status of a data observability monitor run. + attr_reader :status attr_accessor :additional_properties @@ -36,9 +33,8 @@ class RumHardcodedRetentionFilterMeta # @!visibility private def self.attribute_map { - :'source' => :'source', - :'updated_at' => :'updated_at', - :'updated_by_handle' => :'updated_by_handle' + :'error_message' => :'error_message', + :'status' => :'status' } end @@ -46,9 +42,8 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'source' => :'RumHardcodedRetentionFilterMetaSource', - :'updated_at' => :'Integer', - :'updated_by_handle' => :'String' + :'error_message' => :'String', + :'status' => :'DataObservabilityMonitorRunStatus' } end @@ -57,7 +52,7 @@ def self.openapi_types # @!visibility private def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::RumHardcodedRetentionFilterMeta` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::GetDataObservabilityMonitorRunStatusResponseAttributes` initialize method" end self.additional_properties = {} @@ -70,17 +65,31 @@ def initialize(attributes = {}) end } - if attributes.key?(:'source') - self.source = attributes[:'source'] + if attributes.key?(:'error_message') + self.error_message = attributes[:'error_message'] end - if attributes.key?(:'updated_at') - self.updated_at = attributes[:'updated_at'] + if attributes.key?(:'status') + self.status = attributes[:'status'] end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @status.nil? + true + end - if attributes.key?(:'updated_by_handle') - self.updated_by_handle = attributes[:'updated_by_handle'] + # Custom attribute writer method with validation + # @param status [Object] Object to be assigned + # @!visibility private + def status=(status) + if status.nil? + fail ArgumentError, 'invalid value for "status", status cannot be nil.' end + @status = status end # Returns the object in the form of hash, with additionalProperties support. @@ -109,9 +118,8 @@ def to_hash def ==(o) return true if self.equal?(o) self.class == o.class && - source == o.source && - updated_at == o.updated_at && - updated_by_handle == o.updated_by_handle && + error_message == o.error_message && + status == o.status && additional_properties == o.additional_properties end @@ -119,7 +127,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [source, updated_at, updated_by_handle, additional_properties].hash + [error_message, status, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/rum_hardcoded_retention_filter_update_data.rb b/lib/datadog_api_client/v2/models/get_data_observability_monitor_run_status_response_data.rb similarity index 86% rename from lib/datadog_api_client/v2/models/rum_hardcoded_retention_filter_update_data.rb rename to lib/datadog_api_client/v2/models/get_data_observability_monitor_run_status_response_data.rb index 9d02f8ff3e5d..a80d427d8133 100644 --- a/lib/datadog_api_client/v2/models/rum_hardcoded_retention_filter_update_data.rb +++ b/lib/datadog_api_client/v2/models/get_data_observability_monitor_run_status_response_data.rb @@ -17,18 +17,17 @@ require 'time' module DatadogAPIClient::V2 - # The hardcoded retention filter properties to update. - class RumHardcodedRetentionFilterUpdateData + # The data object for a data observability monitor run status response. + class GetDataObservabilityMonitorRunStatusResponseData include BaseGenericModel - # The attributes of a hardcoded retention filter that can be updated. - # Only fields whose matching flag in `cross_product_sampling_editability` is `true` can be modified. + # The attributes of a data observability monitor run status response. attr_reader :attributes - # The ID of the hardcoded retention filter. Must match the `rf_id` path parameter. + # The unique identifier of the monitor run. attr_reader :id - # The resource type. The value must be `hardcoded_retention_filters`. + # The JSON:API resource type for a data observability monitor run. attr_reader :type attr_accessor :additional_properties @@ -47,9 +46,9 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'attributes' => :'RumHardcodedRetentionFilterUpdateAttributes', + :'attributes' => :'GetDataObservabilityMonitorRunStatusResponseAttributes', :'id' => :'String', - :'type' => :'RumHardcodedRetentionFilterType' + :'type' => :'DataObservabilityMonitorRunType' } end @@ -58,7 +57,7 @@ def self.openapi_types # @!visibility private def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::RumHardcodedRetentionFilterUpdateData` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::GetDataObservabilityMonitorRunStatusResponseData` initialize method" end self.additional_properties = {} diff --git a/lib/datadog_api_client/v2/models/rum_hardcoded_cross_product_sampling.rb b/lib/datadog_api_client/v2/models/rum_hardcoded_cross_product_sampling.rb deleted file mode 100644 index 7564e1612209..000000000000 --- a/lib/datadog_api_client/v2/models/rum_hardcoded_cross_product_sampling.rb +++ /dev/null @@ -1,172 +0,0 @@ -=begin -#Datadog API V2 Collection - -#Collection of all Datadog Public endpoints. - -The version of the OpenAPI document: 1.0 -Contact: support@datadoghq.com -Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator - - 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 2020-Present Datadog, Inc. - -=end - -require 'date' -require 'time' - -module DatadogAPIClient::V2 - # Cross-product retention settings for a hardcoded retention filter. - class RumHardcodedCrossProductSampling - include BaseGenericModel - - # Indicates whether Session Replay cross-product retention is active. - attr_accessor :session_replay_enabled - - # Percentage (0–100) of retained sessions with an ingested replay whose replay data is kept. - attr_reader :session_replay_sample_rate - - # Indicates whether Trace cross-product retention is active. - attr_accessor :trace_enabled - - # Percentage (0–100) of retained sessions with ingested traces whose traces are indexed. - attr_reader :trace_sample_rate - - attr_accessor :additional_properties - - # Attribute mapping from ruby-style variable name to JSON key. - # @!visibility private - def self.attribute_map - { - :'session_replay_enabled' => :'session_replay_enabled', - :'session_replay_sample_rate' => :'session_replay_sample_rate', - :'trace_enabled' => :'trace_enabled', - :'trace_sample_rate' => :'trace_sample_rate' - } - end - - # Attribute type mapping. - # @!visibility private - def self.openapi_types - { - :'session_replay_enabled' => :'Boolean', - :'session_replay_sample_rate' => :'Float', - :'trace_enabled' => :'Boolean', - :'trace_sample_rate' => :'Float' - } - end - - # Initializes the object - # @param attributes [Hash] Model attributes in the form of hash - # @!visibility private - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::RumHardcodedCrossProductSampling` initialize method" - end - - self.additional_properties = {} - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - self.additional_properties[k.to_sym] = v - else - h[k.to_sym] = v - end - } - - if attributes.key?(:'session_replay_enabled') - self.session_replay_enabled = attributes[:'session_replay_enabled'] - end - - if attributes.key?(:'session_replay_sample_rate') - self.session_replay_sample_rate = attributes[:'session_replay_sample_rate'] - end - - if attributes.key?(:'trace_enabled') - self.trace_enabled = attributes[:'trace_enabled'] - end - - if attributes.key?(:'trace_sample_rate') - self.trace_sample_rate = attributes[:'trace_sample_rate'] - end - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - # @!visibility private - def valid? - return false if !@session_replay_sample_rate.nil? && @session_replay_sample_rate > 100 - return false if !@session_replay_sample_rate.nil? && @session_replay_sample_rate < 0 - return false if !@trace_sample_rate.nil? && @trace_sample_rate > 100 - return false if !@trace_sample_rate.nil? && @trace_sample_rate < 0 - true - end - - # Custom attribute writer method with validation - # @param session_replay_sample_rate [Object] Object to be assigned - # @!visibility private - def session_replay_sample_rate=(session_replay_sample_rate) - if !session_replay_sample_rate.nil? && session_replay_sample_rate > 100 - fail ArgumentError, 'invalid value for "session_replay_sample_rate", must be smaller than or equal to 100.' - end - if !session_replay_sample_rate.nil? && session_replay_sample_rate < 0 - fail ArgumentError, 'invalid value for "session_replay_sample_rate", must be greater than or equal to 0.' - end - @session_replay_sample_rate = session_replay_sample_rate - end - - # Custom attribute writer method with validation - # @param trace_sample_rate [Object] Object to be assigned - # @!visibility private - def trace_sample_rate=(trace_sample_rate) - if !trace_sample_rate.nil? && trace_sample_rate > 100 - fail ArgumentError, 'invalid value for "trace_sample_rate", must be smaller than or equal to 100.' - end - if !trace_sample_rate.nil? && trace_sample_rate < 0 - fail ArgumentError, 'invalid value for "trace_sample_rate", must be greater than or equal to 0.' - end - @trace_sample_rate = trace_sample_rate - end - - # Returns the object in the form of hash, with additionalProperties support. - # @return [Hash] Returns the object in the form of hash - # @!visibility private - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - self.additional_properties.each_pair do |attr, value| - hash[attr] = value - end - hash - end - - # Checks equality by comparing each attribute. - # @param o [Object] Object to be compared - # @!visibility private - def ==(o) - return true if self.equal?(o) - self.class == o.class && - session_replay_enabled == o.session_replay_enabled && - session_replay_sample_rate == o.session_replay_sample_rate && - trace_enabled == o.trace_enabled && - trace_sample_rate == o.trace_sample_rate && - additional_properties == o.additional_properties - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - # @!visibility private - def hash - [session_replay_enabled, session_replay_sample_rate, trace_enabled, trace_sample_rate, additional_properties].hash - end - end -end diff --git a/lib/datadog_api_client/v2/models/rum_hardcoded_cross_product_sampling_editability.rb b/lib/datadog_api_client/v2/models/rum_hardcoded_cross_product_sampling_editability.rb deleted file mode 100644 index f2c412691e37..000000000000 --- a/lib/datadog_api_client/v2/models/rum_hardcoded_cross_product_sampling_editability.rb +++ /dev/null @@ -1,115 +0,0 @@ -=begin -#Datadog API V2 Collection - -#Collection of all Datadog Public endpoints. - -The version of the OpenAPI document: 1.0 -Contact: support@datadoghq.com -Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator - - 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 2020-Present Datadog, Inc. - -=end - -require 'date' -require 'time' - -module DatadogAPIClient::V2 - # Flags indicating which `cross_product_sampling` fields can be updated. Read-only. - class RumHardcodedCrossProductSamplingEditability - include BaseGenericModel - - # If `true`, `cross_product_sampling.session_replay_sample_rate` can be updated on this filter. - attr_accessor :session_replay_sample_rate - - # If `true`, `cross_product_sampling.trace_sample_rate` can be updated on this filter. - attr_accessor :trace_sample_rate - - attr_accessor :additional_properties - - # Attribute mapping from ruby-style variable name to JSON key. - # @!visibility private - def self.attribute_map - { - :'session_replay_sample_rate' => :'session_replay_sample_rate', - :'trace_sample_rate' => :'trace_sample_rate' - } - end - - # Attribute type mapping. - # @!visibility private - def self.openapi_types - { - :'session_replay_sample_rate' => :'Boolean', - :'trace_sample_rate' => :'Boolean' - } - end - - # Initializes the object - # @param attributes [Hash] Model attributes in the form of hash - # @!visibility private - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::RumHardcodedCrossProductSamplingEditability` initialize method" - end - - self.additional_properties = {} - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - self.additional_properties[k.to_sym] = v - else - h[k.to_sym] = v - end - } - - if attributes.key?(:'session_replay_sample_rate') - self.session_replay_sample_rate = attributes[:'session_replay_sample_rate'] - end - - if attributes.key?(:'trace_sample_rate') - self.trace_sample_rate = attributes[:'trace_sample_rate'] - end - end - - # Returns the object in the form of hash, with additionalProperties support. - # @return [Hash] Returns the object in the form of hash - # @!visibility private - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - self.additional_properties.each_pair do |attr, value| - hash[attr] = value - end - hash - end - - # Checks equality by comparing each attribute. - # @param o [Object] Object to be compared - # @!visibility private - def ==(o) - return true if self.equal?(o) - self.class == o.class && - session_replay_sample_rate == o.session_replay_sample_rate && - trace_sample_rate == o.trace_sample_rate && - additional_properties == o.additional_properties - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - # @!visibility private - def hash - [session_replay_sample_rate, trace_sample_rate, additional_properties].hash - end - end -end diff --git a/lib/datadog_api_client/v2/models/rum_hardcoded_cross_product_sampling_update.rb b/lib/datadog_api_client/v2/models/rum_hardcoded_cross_product_sampling_update.rb deleted file mode 100644 index 82f02744a8c1..000000000000 --- a/lib/datadog_api_client/v2/models/rum_hardcoded_cross_product_sampling_update.rb +++ /dev/null @@ -1,175 +0,0 @@ -=begin -#Datadog API V2 Collection - -#Collection of all Datadog Public endpoints. - -The version of the OpenAPI document: 1.0 -Contact: support@datadoghq.com -Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator - - 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 2020-Present Datadog, Inc. - -=end - -require 'date' -require 'time' - -module DatadogAPIClient::V2 - # Partial update for cross-product retention of a hardcoded retention filter. - # Only fields whose matching flag in `cross_product_sampling_editability` is `true` can be updated. - class RumHardcodedCrossProductSamplingUpdate - include BaseGenericModel - - # Controls whether Session Replay cross-product retention is active. Omit to leave unchanged. - attr_accessor :session_replay_enabled - - # Percentage (0–100) of retained sessions with an ingested replay whose replay data is kept. - # Omit to leave unchanged. - attr_reader :session_replay_sample_rate - - # Controls whether Trace cross-product retention is active. Omit to leave unchanged. - attr_accessor :trace_enabled - - # Percentage (0–100) of retained sessions with ingested traces whose traces are indexed. - # Omit to leave unchanged. - attr_reader :trace_sample_rate - - attr_accessor :additional_properties - - # Attribute mapping from ruby-style variable name to JSON key. - # @!visibility private - def self.attribute_map - { - :'session_replay_enabled' => :'session_replay_enabled', - :'session_replay_sample_rate' => :'session_replay_sample_rate', - :'trace_enabled' => :'trace_enabled', - :'trace_sample_rate' => :'trace_sample_rate' - } - end - - # Attribute type mapping. - # @!visibility private - def self.openapi_types - { - :'session_replay_enabled' => :'Boolean', - :'session_replay_sample_rate' => :'Float', - :'trace_enabled' => :'Boolean', - :'trace_sample_rate' => :'Float' - } - end - - # Initializes the object - # @param attributes [Hash] Model attributes in the form of hash - # @!visibility private - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::RumHardcodedCrossProductSamplingUpdate` initialize method" - end - - self.additional_properties = {} - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - self.additional_properties[k.to_sym] = v - else - h[k.to_sym] = v - end - } - - if attributes.key?(:'session_replay_enabled') - self.session_replay_enabled = attributes[:'session_replay_enabled'] - end - - if attributes.key?(:'session_replay_sample_rate') - self.session_replay_sample_rate = attributes[:'session_replay_sample_rate'] - end - - if attributes.key?(:'trace_enabled') - self.trace_enabled = attributes[:'trace_enabled'] - end - - if attributes.key?(:'trace_sample_rate') - self.trace_sample_rate = attributes[:'trace_sample_rate'] - end - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - # @!visibility private - def valid? - return false if !@session_replay_sample_rate.nil? && @session_replay_sample_rate > 100 - return false if !@session_replay_sample_rate.nil? && @session_replay_sample_rate < 0 - return false if !@trace_sample_rate.nil? && @trace_sample_rate > 100 - return false if !@trace_sample_rate.nil? && @trace_sample_rate < 0 - true - end - - # Custom attribute writer method with validation - # @param session_replay_sample_rate [Object] Object to be assigned - # @!visibility private - def session_replay_sample_rate=(session_replay_sample_rate) - if !session_replay_sample_rate.nil? && session_replay_sample_rate > 100 - fail ArgumentError, 'invalid value for "session_replay_sample_rate", must be smaller than or equal to 100.' - end - if !session_replay_sample_rate.nil? && session_replay_sample_rate < 0 - fail ArgumentError, 'invalid value for "session_replay_sample_rate", must be greater than or equal to 0.' - end - @session_replay_sample_rate = session_replay_sample_rate - end - - # Custom attribute writer method with validation - # @param trace_sample_rate [Object] Object to be assigned - # @!visibility private - def trace_sample_rate=(trace_sample_rate) - if !trace_sample_rate.nil? && trace_sample_rate > 100 - fail ArgumentError, 'invalid value for "trace_sample_rate", must be smaller than or equal to 100.' - end - if !trace_sample_rate.nil? && trace_sample_rate < 0 - fail ArgumentError, 'invalid value for "trace_sample_rate", must be greater than or equal to 0.' - end - @trace_sample_rate = trace_sample_rate - end - - # Returns the object in the form of hash, with additionalProperties support. - # @return [Hash] Returns the object in the form of hash - # @!visibility private - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - self.additional_properties.each_pair do |attr, value| - hash[attr] = value - end - hash - end - - # Checks equality by comparing each attribute. - # @param o [Object] Object to be compared - # @!visibility private - def ==(o) - return true if self.equal?(o) - self.class == o.class && - session_replay_enabled == o.session_replay_enabled && - session_replay_sample_rate == o.session_replay_sample_rate && - trace_enabled == o.trace_enabled && - trace_sample_rate == o.trace_sample_rate && - additional_properties == o.additional_properties - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - # @!visibility private - def hash - [session_replay_enabled, session_replay_sample_rate, trace_enabled, trace_sample_rate, additional_properties].hash - end - end -end diff --git a/lib/datadog_api_client/v2/models/rum_hardcoded_retention_filter_attributes.rb b/lib/datadog_api_client/v2/models/rum_hardcoded_retention_filter_attributes.rb deleted file mode 100644 index 536ad0155a86..000000000000 --- a/lib/datadog_api_client/v2/models/rum_hardcoded_retention_filter_attributes.rb +++ /dev/null @@ -1,187 +0,0 @@ -=begin -#Datadog API V2 Collection - -#Collection of all Datadog Public endpoints. - -The version of the OpenAPI document: 1.0 -Contact: support@datadoghq.com -Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator - - 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 2020-Present Datadog, Inc. - -=end - -require 'date' -require 'time' - -module DatadogAPIClient::V2 - # The attributes of a hardcoded retention filter. - class RumHardcodedRetentionFilterAttributes - include BaseGenericModel - - # Cross-product retention settings for a hardcoded retention filter. - attr_accessor :cross_product_sampling - - # Flags indicating which `cross_product_sampling` fields can be updated. Read-only. - attr_accessor :cross_product_sampling_editability - - # Indicates whether the hardcoded retention filter is active. Read-only. - attr_accessor :enabled - - # The type of RUM events the hardcoded filter applies to. Read-only. - attr_accessor :event_type - - # The name of the hardcoded retention filter. Read-only. - attr_accessor :name - - # The query string for the hardcoded retention filter. Read-only. - attr_accessor :query - - # The retention sample rate (0–100) for the hardcoded filter. Read-only. - attr_reader :sample_rate - - attr_accessor :additional_properties - - # Attribute mapping from ruby-style variable name to JSON key. - # @!visibility private - def self.attribute_map - { - :'cross_product_sampling' => :'cross_product_sampling', - :'cross_product_sampling_editability' => :'cross_product_sampling_editability', - :'enabled' => :'enabled', - :'event_type' => :'event_type', - :'name' => :'name', - :'query' => :'query', - :'sample_rate' => :'sample_rate' - } - end - - # Attribute type mapping. - # @!visibility private - def self.openapi_types - { - :'cross_product_sampling' => :'RumHardcodedCrossProductSampling', - :'cross_product_sampling_editability' => :'RumHardcodedCrossProductSamplingEditability', - :'enabled' => :'Boolean', - :'event_type' => :'RumHardcodedRetentionFilterEventType', - :'name' => :'String', - :'query' => :'String', - :'sample_rate' => :'Float' - } - end - - # Initializes the object - # @param attributes [Hash] Model attributes in the form of hash - # @!visibility private - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::RumHardcodedRetentionFilterAttributes` initialize method" - end - - self.additional_properties = {} - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - self.additional_properties[k.to_sym] = v - else - h[k.to_sym] = v - end - } - - if attributes.key?(:'cross_product_sampling') - self.cross_product_sampling = attributes[:'cross_product_sampling'] - end - - if attributes.key?(:'cross_product_sampling_editability') - self.cross_product_sampling_editability = attributes[:'cross_product_sampling_editability'] - end - - if attributes.key?(:'enabled') - self.enabled = attributes[:'enabled'] - end - - if attributes.key?(:'event_type') - self.event_type = attributes[:'event_type'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'query') - self.query = attributes[:'query'] - end - - if attributes.key?(:'sample_rate') - self.sample_rate = attributes[:'sample_rate'] - end - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - # @!visibility private - def valid? - return false if !@sample_rate.nil? && @sample_rate > 100 - return false if !@sample_rate.nil? && @sample_rate < 0 - true - end - - # Custom attribute writer method with validation - # @param sample_rate [Object] Object to be assigned - # @!visibility private - def sample_rate=(sample_rate) - if !sample_rate.nil? && sample_rate > 100 - fail ArgumentError, 'invalid value for "sample_rate", must be smaller than or equal to 100.' - end - if !sample_rate.nil? && sample_rate < 0 - fail ArgumentError, 'invalid value for "sample_rate", must be greater than or equal to 0.' - end - @sample_rate = sample_rate - end - - # Returns the object in the form of hash, with additionalProperties support. - # @return [Hash] Returns the object in the form of hash - # @!visibility private - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - self.additional_properties.each_pair do |attr, value| - hash[attr] = value - end - hash - end - - # Checks equality by comparing each attribute. - # @param o [Object] Object to be compared - # @!visibility private - def ==(o) - return true if self.equal?(o) - self.class == o.class && - cross_product_sampling == o.cross_product_sampling && - cross_product_sampling_editability == o.cross_product_sampling_editability && - enabled == o.enabled && - event_type == o.event_type && - name == o.name && - query == o.query && - sample_rate == o.sample_rate && - additional_properties == o.additional_properties - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - # @!visibility private - def hash - [cross_product_sampling, cross_product_sampling_editability, enabled, event_type, name, query, sample_rate, additional_properties].hash - end - end -end diff --git a/lib/datadog_api_client/v2/models/rum_hardcoded_retention_filter_event_type.rb b/lib/datadog_api_client/v2/models/rum_hardcoded_retention_filter_event_type.rb deleted file mode 100644 index e3ff7f3679b0..000000000000 --- a/lib/datadog_api_client/v2/models/rum_hardcoded_retention_filter_event_type.rb +++ /dev/null @@ -1,32 +0,0 @@ -=begin -#Datadog API V2 Collection - -#Collection of all Datadog Public endpoints. - -The version of the OpenAPI document: 1.0 -Contact: support@datadoghq.com -Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator - - 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 2020-Present Datadog, Inc. - -=end - -require 'date' -require 'time' - -module DatadogAPIClient::V2 - # The type of RUM events the hardcoded filter applies to. Read-only. - class RumHardcodedRetentionFilterEventType - include BaseEnumModel - - SESSION = "session".freeze - VIEW = "view".freeze - ACTION = "action".freeze - ERROR = "error".freeze - RESOURCE = "resource".freeze - LONG_TASK = "long_task".freeze - VITAL = "vital".freeze - end -end diff --git a/lib/datadog_api_client/v2/models/rum_hardcoded_retention_filter_update_attributes.rb b/lib/datadog_api_client/v2/models/rum_hardcoded_retention_filter_update_attributes.rb deleted file mode 100644 index 60bbfa2a5842..000000000000 --- a/lib/datadog_api_client/v2/models/rum_hardcoded_retention_filter_update_attributes.rb +++ /dev/null @@ -1,107 +0,0 @@ -=begin -#Datadog API V2 Collection - -#Collection of all Datadog Public endpoints. - -The version of the OpenAPI document: 1.0 -Contact: support@datadoghq.com -Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator - - 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 2020-Present Datadog, Inc. - -=end - -require 'date' -require 'time' - -module DatadogAPIClient::V2 - # The attributes of a hardcoded retention filter that can be updated. - # Only fields whose matching flag in `cross_product_sampling_editability` is `true` can be modified. - class RumHardcodedRetentionFilterUpdateAttributes - include BaseGenericModel - - # Partial update for cross-product retention of a hardcoded retention filter. - # Only fields whose matching flag in `cross_product_sampling_editability` is `true` can be updated. - attr_accessor :cross_product_sampling - - attr_accessor :additional_properties - - # Attribute mapping from ruby-style variable name to JSON key. - # @!visibility private - def self.attribute_map - { - :'cross_product_sampling' => :'cross_product_sampling' - } - end - - # Attribute type mapping. - # @!visibility private - def self.openapi_types - { - :'cross_product_sampling' => :'RumHardcodedCrossProductSamplingUpdate' - } - end - - # Initializes the object - # @param attributes [Hash] Model attributes in the form of hash - # @!visibility private - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::RumHardcodedRetentionFilterUpdateAttributes` initialize method" - end - - self.additional_properties = {} - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - self.additional_properties[k.to_sym] = v - else - h[k.to_sym] = v - end - } - - if attributes.key?(:'cross_product_sampling') - self.cross_product_sampling = attributes[:'cross_product_sampling'] - end - end - - # Returns the object in the form of hash, with additionalProperties support. - # @return [Hash] Returns the object in the form of hash - # @!visibility private - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - self.additional_properties.each_pair do |attr, value| - hash[attr] = value - end - hash - end - - # Checks equality by comparing each attribute. - # @param o [Object] Object to be compared - # @!visibility private - def ==(o) - return true if self.equal?(o) - self.class == o.class && - cross_product_sampling == o.cross_product_sampling && - additional_properties == o.additional_properties - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - # @!visibility private - def hash - [cross_product_sampling, additional_properties].hash - end - end -end diff --git a/lib/datadog_api_client/v2/models/rum_hardcoded_retention_filters_response.rb b/lib/datadog_api_client/v2/models/rum_hardcoded_retention_filters_response.rb deleted file mode 100644 index a8ac6ace6f97..000000000000 --- a/lib/datadog_api_client/v2/models/rum_hardcoded_retention_filters_response.rb +++ /dev/null @@ -1,107 +0,0 @@ -=begin -#Datadog API V2 Collection - -#Collection of all Datadog Public endpoints. - -The version of the OpenAPI document: 1.0 -Contact: support@datadoghq.com -Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator - - 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 2020-Present Datadog, Inc. - -=end - -require 'date' -require 'time' - -module DatadogAPIClient::V2 - # All hardcoded retention filters for a RUM application. - class RumHardcodedRetentionFiltersResponse - include BaseGenericModel - - # A list of hardcoded retention filters. - attr_accessor :data - - attr_accessor :additional_properties - - # Attribute mapping from ruby-style variable name to JSON key. - # @!visibility private - def self.attribute_map - { - :'data' => :'data' - } - end - - # Attribute type mapping. - # @!visibility private - def self.openapi_types - { - :'data' => :'Array' - } - end - - # Initializes the object - # @param attributes [Hash] Model attributes in the form of hash - # @!visibility private - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::RumHardcodedRetentionFiltersResponse` initialize method" - end - - self.additional_properties = {} - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - self.additional_properties[k.to_sym] = v - else - h[k.to_sym] = v - end - } - - if attributes.key?(:'data') - if (value = attributes[:'data']).is_a?(Array) - self.data = value - end - end - end - - # Returns the object in the form of hash, with additionalProperties support. - # @return [Hash] Returns the object in the form of hash - # @!visibility private - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - self.additional_properties.each_pair do |attr, value| - hash[attr] = value - end - hash - end - - # Checks equality by comparing each attribute. - # @param o [Object] Object to be compared - # @!visibility private - def ==(o) - return true if self.equal?(o) - self.class == o.class && - data == o.data && - additional_properties == o.additional_properties - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - # @!visibility private - def hash - [data, additional_properties].hash - end - end -end diff --git a/lib/datadog_api_client/v2/models/rum_hardcoded_retention_filter_update_request.rb b/lib/datadog_api_client/v2/models/run_data_observability_monitor_response.rb similarity index 90% rename from lib/datadog_api_client/v2/models/rum_hardcoded_retention_filter_update_request.rb rename to lib/datadog_api_client/v2/models/run_data_observability_monitor_response.rb index bd36cf7bb89f..38a8ef8023eb 100644 --- a/lib/datadog_api_client/v2/models/rum_hardcoded_retention_filter_update_request.rb +++ b/lib/datadog_api_client/v2/models/run_data_observability_monitor_response.rb @@ -17,11 +17,11 @@ require 'time' module DatadogAPIClient::V2 - # The hardcoded retention filter body to update. - class RumHardcodedRetentionFilterUpdateRequest + # The response returned when a data observability monitor run is triggered. + class RunDataObservabilityMonitorResponse include BaseGenericModel - # The hardcoded retention filter properties to update. + # The data object returned when a data observability monitor run is triggered. attr_reader :data attr_accessor :additional_properties @@ -38,7 +38,7 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'data' => :'RumHardcodedRetentionFilterUpdateData' + :'data' => :'RunDataObservabilityMonitorResponseData' } end @@ -47,7 +47,7 @@ def self.openapi_types # @!visibility private def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::RumHardcodedRetentionFilterUpdateRequest` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::RunDataObservabilityMonitorResponse` initialize method" end self.additional_properties = {} diff --git a/lib/datadog_api_client/v2/models/rum_hardcoded_retention_filter_data.rb b/lib/datadog_api_client/v2/models/run_data_observability_monitor_response_data.rb similarity index 69% rename from lib/datadog_api_client/v2/models/rum_hardcoded_retention_filter_data.rb rename to lib/datadog_api_client/v2/models/run_data_observability_monitor_response_data.rb index 248be0a2e57d..e5705cd71b62 100644 --- a/lib/datadog_api_client/v2/models/rum_hardcoded_retention_filter_data.rb +++ b/lib/datadog_api_client/v2/models/run_data_observability_monitor_response_data.rb @@ -17,21 +17,15 @@ require 'time' module DatadogAPIClient::V2 - # A hardcoded retention filter. - class RumHardcodedRetentionFilterData + # The data object returned when a data observability monitor run is triggered. + class RunDataObservabilityMonitorResponseData include BaseGenericModel - # The attributes of a hardcoded retention filter. - attr_accessor :attributes + # The unique identifier of the monitor run. + attr_reader :id - # The ID of the hardcoded retention filter. - attr_accessor :id - - # Metadata about the hardcoded retention filter. - attr_accessor :meta - - # The resource type. The value must be `hardcoded_retention_filters`. - attr_accessor :type + # The JSON:API resource type for a data observability monitor run. + attr_reader :type attr_accessor :additional_properties @@ -39,9 +33,7 @@ class RumHardcodedRetentionFilterData # @!visibility private def self.attribute_map { - :'attributes' => :'attributes', :'id' => :'id', - :'meta' => :'meta', :'type' => :'type' } end @@ -50,10 +42,8 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'attributes' => :'RumHardcodedRetentionFilterAttributes', :'id' => :'String', - :'meta' => :'RumHardcodedRetentionFilterMeta', - :'type' => :'RumHardcodedRetentionFilterType' + :'type' => :'DataObservabilityMonitorRunType' } end @@ -62,7 +52,7 @@ def self.openapi_types # @!visibility private def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::RumHardcodedRetentionFilterData` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::RunDataObservabilityMonitorResponseData` initialize method" end self.additional_properties = {} @@ -75,23 +65,44 @@ def initialize(attributes = {}) end } - if attributes.key?(:'attributes') - self.attributes = attributes[:'attributes'] - end - if attributes.key?(:'id') self.id = attributes[:'id'] end - if attributes.key?(:'meta') - self.meta = attributes[:'meta'] - end - if attributes.key?(:'type') self.type = attributes[:'type'] end end + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + # Returns the object in the form of hash, with additionalProperties support. # @return [Hash] Returns the object in the form of hash # @!visibility private @@ -118,9 +129,7 @@ def to_hash def ==(o) return true if self.equal?(o) self.class == o.class && - attributes == o.attributes && id == o.id && - meta == o.meta && type == o.type && additional_properties == o.additional_properties end @@ -129,7 +138,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [attributes, id, meta, type, additional_properties].hash + [id, type, additional_properties].hash end end end From 86f88adbd76d253363232b09900e17ff422d26e4 Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Mon, 15 Jun 2026 09:39:40 +0000 Subject: [PATCH 2/2] Regenerate client from commit 71a3f57 of spec repo (#3480) Co-authored-by: ci.datadog-api-spec --- .generator/schemas/v2/openapi.yaml | 63 +++++++++++++ ...l-version-returns-Conflict-response.frozen | 1 + ...ical-version-returns-Conflict-response.yml | 86 ++++++++++++++++++ ...-version-returns-Not-Found-response.frozen | 1 + ...cal-version-returns-Not-Found-response.yml | 62 +++++++++++++ ...torical-version-returns-OK-response.frozen | 1 + ...historical-version-returns-OK-response.yml | 88 +++++++++++++++++++ .../RestoreSecurityMonitoringRule.rb | 11 +++ features/scenarios_model_mapping.rb | 4 + features/v2/given.json | 16 ++++ features/v2/security_monitoring.feature | 42 +++++++++ features/v2/undo.json | 6 ++ lib/datadog_api_client/configuration.rb | 1 + .../v2/api/security_monitoring_api.rb | 78 ++++++++++++++++ 14 files changed, 460 insertions(+) create mode 100644 cassettes/features/v2/security_monitoring/Restore-a-rule-to-a-historical-version-returns-Conflict-response.frozen create mode 100644 cassettes/features/v2/security_monitoring/Restore-a-rule-to-a-historical-version-returns-Conflict-response.yml create mode 100644 cassettes/features/v2/security_monitoring/Restore-a-rule-to-a-historical-version-returns-Not-Found-response.frozen create mode 100644 cassettes/features/v2/security_monitoring/Restore-a-rule-to-a-historical-version-returns-Not-Found-response.yml create mode 100644 cassettes/features/v2/security_monitoring/Restore-a-rule-to-a-historical-version-returns-OK-response.frozen create mode 100644 cassettes/features/v2/security_monitoring/Restore-a-rule-to-a-historical-version-returns-OK-response.yml create mode 100644 examples/v2/security-monitoring/RestoreSecurityMonitoringRule.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index be28ab3e9579..f0ec343a75eb 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -1685,6 +1685,15 @@ components: required: true schema: type: string + SecurityMonitoringRuleVersion: + description: The historical version number of the rule. + in: path + name: version + required: true + schema: + example: 1 + format: int64 + type: integer SecurityMonitoringSuppressionID: description: The ID of the suppression rule in: path @@ -169520,6 +169529,60 @@ paths: operator: OR permissions: - security_monitoring_rules_read + /api/v2/security_monitoring/rules/{rule_id}/restore/{version}: + post: + description: |- + Restores a custom detection rule to a previously saved historical version. + Only custom rules can be restored. Default and partner rules return 400. + The restore creates a new version entry; it does not overwrite history. + operationId: RestoreSecurityMonitoringRule + parameters: + - $ref: "#/components/parameters/SecurityMonitoringRuleID" + - $ref: "#/components/parameters/SecurityMonitoringRuleVersion" + responses: + "200": + content: + "application/json": + examples: + default: + value: + cases: + - condition: "a > 0" + name: "" + notifications: [] + status: info + id: abc-123 + isEnabled: true + message: Test rule + name: My security monitoring rule. + tags: [] + type: log_detection + schema: + $ref: "#/components/schemas/SecurityMonitoringRuleResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "409": + $ref: "#/components/responses/ConflictResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_monitoring_rules_write + summary: Restore a rule to a historical version + tags: ["Security Monitoring"] + "x-permission": + operator: OR + permissions: + - security_monitoring_rules_write + x-unstable: |- + **Note**: This endpoint is in beta and may be subject to changes. /api/v2/security_monitoring/rules/{rule_id}/test: post: description: |- diff --git a/cassettes/features/v2/security_monitoring/Restore-a-rule-to-a-historical-version-returns-Conflict-response.frozen b/cassettes/features/v2/security_monitoring/Restore-a-rule-to-a-historical-version-returns-Conflict-response.frozen new file mode 100644 index 000000000000..86182034b5e4 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Restore-a-rule-to-a-historical-version-returns-Conflict-response.frozen @@ -0,0 +1 @@ +2026-06-12T09:57:22.725Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Restore-a-rule-to-a-historical-version-returns-Conflict-response.yml b/cassettes/features/v2/security_monitoring/Restore-a-rule-to-a-historical-version-returns-Conflict-response.yml new file mode 100644 index 000000000000..4a0dbc21f2b5 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Restore-a-rule-to-a-historical-version-returns-Conflict-response.yml @@ -0,0 +1,86 @@ +http_interactions: +- recorded_at: Fri, 12 Jun 2026 09:57:22 GMT + request: + body: + encoding: UTF-8 + string: '{"cases":[{"condition":"a > 0","name":"","notifications":[],"status":"info"}],"filters":[],"isEnabled":true,"message":"Test + rule","name":"Test-Restore_a_rule_to_a_historical_version_returns_Conflict_response-1781258242","options":{"evaluationWindow":900,"keepAlive":3600,"maxSignalDuration":86400},"queries":[{"aggregation":"count","distinctFields":[],"groupByFields":[],"metrics":[],"query":"@test:true"}],"tags":[],"type":"log_detection"}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security_monitoring/rules + response: + body: + encoding: UTF-8 + string: '{"name":"Test-Restore_a_rule_to_a_historical_version_returns_Conflict_response-1781258242","createdAt":1781258244898,"isDefault":false,"isPartner":false,"isEnabled":true,"isBeta":false,"isDeleted":false,"isDeprecated":false,"queries":[{"query":"@test:true","groupByFields":[],"hasOptionalGroupByFields":false,"distinctFields":[],"aggregation":"count","name":"","dataSource":"logs"}],"options":{"evaluationWindow":900,"detectionMethod":"threshold","maxSignalDuration":86400,"keepAlive":3600},"cases":[{"name":"","status":"info","notifications":[],"condition":"a + \u003e 0"}],"message":"Test rule","tags":[],"hasExtendedTitle":false,"type":"log_detection","filters":[],"version":1,"id":"xrz-jfq-dfm","blocking":false,"metadata":{"entities":null,"sources":null},"creationAuthorId":2320499,"creator":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"updater":{"handle":"","name":""}}' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +- recorded_at: Fri, 12 Jun 2026 09:57:22 GMT + request: + body: + encoding: UTF-8 + string: '{"cases":[{"condition":"a > 0","name":"","notifications":[],"status":"info"}],"filters":[],"isEnabled":true,"message":"Test + rule updated","name":"Test-Restore_a_rule_to_a_historical_version_returns_Conflict_response-1781258242-updated","options":{"evaluationWindow":900,"keepAlive":3600,"maxSignalDuration":86400},"queries":[{"aggregation":"count","distinctFields":[],"groupByFields":[],"metrics":[],"query":"@test:true"}],"tags":[]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PUT + uri: https://api.datadoghq.com/api/v2/security_monitoring/rules/xrz-jfq-dfm + response: + body: + encoding: UTF-8 + string: '{"name":"Test-Restore_a_rule_to_a_historical_version_returns_Conflict_response-1781258242-updated","isEnabled":true,"queries":[{"query":"@test:true","groupByFields":[],"hasOptionalGroupByFields":false,"distinctFields":[],"aggregation":"count","name":"","dataSource":"logs"}],"options":{"evaluationWindow":900,"detectionMethod":"threshold","maxSignalDuration":86400,"keepAlive":3600},"cases":[{"name":"","status":"info","notifications":[],"condition":"a + \u003e 0"}],"message":"Test rule updated","tags":[],"hasExtendedTitle":false,"type":"log_detection","filters":[],"id":"xrz-jfq-dfm","version":2,"createdAt":1781258244898,"creationAuthorId":2320499,"updateAuthorId":2320499,"updatedAt":1781258245104,"isDefault":false,"blocking":false,"isBeta":false,"isDeleted":false,"isDeprecated":false,"metadata":{"entities":null,"sources":null}}' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +- recorded_at: Fri, 12 Jun 2026 09:57:22 GMT + request: + body: null + headers: + Accept: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security_monitoring/rules/xrz-jfq-dfm/restore/2 + response: + body: + encoding: UTF-8 + string: '{"error":{"code":"AlreadyExists","message":"Cannot restore: target + version is the current version."}}' + headers: + Content-Type: + - application/json + status: + code: 409 + message: Conflict +- recorded_at: Fri, 12 Jun 2026 09:57:22 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security_monitoring/rules/xrz-jfq-dfm + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Restore-a-rule-to-a-historical-version-returns-Not-Found-response.frozen b/cassettes/features/v2/security_monitoring/Restore-a-rule-to-a-historical-version-returns-Not-Found-response.frozen new file mode 100644 index 000000000000..d762af22af1d --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Restore-a-rule-to-a-historical-version-returns-Not-Found-response.frozen @@ -0,0 +1 @@ +2026-06-12T08:39:41.348Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Restore-a-rule-to-a-historical-version-returns-Not-Found-response.yml b/cassettes/features/v2/security_monitoring/Restore-a-rule-to-a-historical-version-returns-Not-Found-response.yml new file mode 100644 index 000000000000..1f562430e566 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Restore-a-rule-to-a-historical-version-returns-Not-Found-response.yml @@ -0,0 +1,62 @@ +http_interactions: +- recorded_at: Fri, 12 Jun 2026 08:39:41 GMT + request: + body: + encoding: UTF-8 + string: '{"cases":[{"condition":"a > 0","name":"","notifications":[],"status":"info"}],"filters":[],"isEnabled":true,"message":"Test + rule","name":"Test-Restore_a_rule_to_a_historical_version_returns_Not_Found_response-1781253581","options":{"evaluationWindow":900,"keepAlive":3600,"maxSignalDuration":86400},"queries":[{"aggregation":"count","distinctFields":[],"groupByFields":[],"metrics":[],"query":"@test:true"}],"tags":[],"type":"log_detection"}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security_monitoring/rules + response: + body: + encoding: UTF-8 + string: '{"name":"Test-Restore_a_rule_to_a_historical_version_returns_Not_Found_response-1781253581","createdAt":1781253581645,"isDefault":false,"isPartner":false,"isEnabled":true,"isBeta":false,"isDeleted":false,"isDeprecated":false,"queries":[{"query":"@test:true","groupByFields":[],"hasOptionalGroupByFields":false,"distinctFields":[],"aggregation":"count","name":"","dataSource":"logs"}],"options":{"evaluationWindow":900,"detectionMethod":"threshold","maxSignalDuration":86400,"keepAlive":3600},"cases":[{"name":"","status":"info","notifications":[],"condition":"a + \u003e 0"}],"message":"Test rule","tags":[],"hasExtendedTitle":false,"type":"log_detection","filters":[],"version":1,"id":"uig-ynq-xlh","blocking":false,"metadata":{"entities":null,"sources":null},"creationAuthorId":2320499,"creator":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"updater":{"handle":"","name":""}}' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +- recorded_at: Fri, 12 Jun 2026 08:39:41 GMT + request: + body: null + headers: + Accept: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security_monitoring/rules/uig-ynq-xlh/restore/9999 + response: + body: + encoding: UTF-8 + string: '{"error":{"code":"NotFound","message":"Threat detection rule not found: + uig-ynq-xlh, version=9999"}}' + headers: + Content-Type: + - application/json + status: + code: 404 + message: Not Found +- recorded_at: Fri, 12 Jun 2026 08:39:41 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security_monitoring/rules/uig-ynq-xlh + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Restore-a-rule-to-a-historical-version-returns-OK-response.frozen b/cassettes/features/v2/security_monitoring/Restore-a-rule-to-a-historical-version-returns-OK-response.frozen new file mode 100644 index 000000000000..47bbb311c970 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Restore-a-rule-to-a-historical-version-returns-OK-response.frozen @@ -0,0 +1 @@ +2026-06-12T09:57:25.549Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Restore-a-rule-to-a-historical-version-returns-OK-response.yml b/cassettes/features/v2/security_monitoring/Restore-a-rule-to-a-historical-version-returns-OK-response.yml new file mode 100644 index 000000000000..bebba3373851 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Restore-a-rule-to-a-historical-version-returns-OK-response.yml @@ -0,0 +1,88 @@ +http_interactions: +- recorded_at: Fri, 12 Jun 2026 09:57:25 GMT + request: + body: + encoding: UTF-8 + string: '{"cases":[{"condition":"a > 0","name":"","notifications":[],"status":"info"}],"filters":[],"isEnabled":true,"message":"Test + rule","name":"Test-Restore_a_rule_to_a_historical_version_returns_OK_response-1781258245","options":{"evaluationWindow":900,"keepAlive":3600,"maxSignalDuration":86400},"queries":[{"aggregation":"count","distinctFields":[],"groupByFields":[],"metrics":[],"query":"@test:true"}],"tags":[],"type":"log_detection"}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security_monitoring/rules + response: + body: + encoding: UTF-8 + string: '{"name":"Test-Restore_a_rule_to_a_historical_version_returns_OK_response-1781258245","createdAt":1781258245670,"isDefault":false,"isPartner":false,"isEnabled":true,"isBeta":false,"isDeleted":false,"isDeprecated":false,"queries":[{"query":"@test:true","groupByFields":[],"hasOptionalGroupByFields":false,"distinctFields":[],"aggregation":"count","name":"","dataSource":"logs"}],"options":{"evaluationWindow":900,"detectionMethod":"threshold","maxSignalDuration":86400,"keepAlive":3600},"cases":[{"name":"","status":"info","notifications":[],"condition":"a + \u003e 0"}],"message":"Test rule","tags":[],"hasExtendedTitle":false,"type":"log_detection","filters":[],"version":1,"id":"7sm-pyl-xzv","blocking":false,"metadata":{"entities":null,"sources":null},"creationAuthorId":2320499,"creator":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"updater":{"handle":"","name":""}}' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +- recorded_at: Fri, 12 Jun 2026 09:57:25 GMT + request: + body: + encoding: UTF-8 + string: '{"cases":[{"condition":"a > 0","name":"","notifications":[],"status":"info"}],"filters":[],"isEnabled":true,"message":"Test + rule updated","name":"Test-Restore_a_rule_to_a_historical_version_returns_OK_response-1781258245-updated","options":{"evaluationWindow":900,"keepAlive":3600,"maxSignalDuration":86400},"queries":[{"aggregation":"count","distinctFields":[],"groupByFields":[],"metrics":[],"query":"@test:true"}],"tags":[]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PUT + uri: https://api.datadoghq.com/api/v2/security_monitoring/rules/7sm-pyl-xzv + response: + body: + encoding: UTF-8 + string: '{"name":"Test-Restore_a_rule_to_a_historical_version_returns_OK_response-1781258245-updated","isEnabled":true,"queries":[{"query":"@test:true","groupByFields":[],"hasOptionalGroupByFields":false,"distinctFields":[],"aggregation":"count","name":"","dataSource":"logs"}],"options":{"evaluationWindow":900,"detectionMethod":"threshold","maxSignalDuration":86400,"keepAlive":3600},"cases":[{"name":"","status":"info","notifications":[],"condition":"a + \u003e 0"}],"message":"Test rule updated","tags":[],"hasExtendedTitle":false,"type":"log_detection","filters":[],"id":"7sm-pyl-xzv","version":2,"createdAt":1781258245670,"creationAuthorId":2320499,"updateAuthorId":2320499,"updatedAt":1781258245844,"isDefault":false,"blocking":false,"isBeta":false,"isDeleted":false,"isDeprecated":false,"metadata":{"entities":null,"sources":null}}' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +- recorded_at: Fri, 12 Jun 2026 09:57:25 GMT + request: + body: null + headers: + Accept: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security_monitoring/rules/7sm-pyl-xzv/restore/1 + response: + body: + encoding: UTF-8 + string: '{"name":"Test-Restore_a_rule_to_a_historical_version_returns_OK_response-1781258245","createdAt":1781258245670,"isDefault":false,"isPartner":false,"isEnabled":true,"isBeta":false,"isDeleted":false,"isDeprecated":false,"queries":[{"query":"@test:true","groupByFields":[],"hasOptionalGroupByFields":false,"distinctFields":[],"aggregation":"count","name":"","dataSource":"logs"}],"options":{"evaluationWindow":900,"detectionMethod":"threshold","maxSignalDuration":86400,"keepAlive":3600},"cases":[{"name":"","status":"info","notifications":[],"condition":"a + \u003e 0"}],"message":"Test rule","tags":[],"hasExtendedTitle":false,"type":"log_detection","filters":[],"version":3,"id":"7sm-pyl-xzv","updatedAt":1781258246099,"blocking":false,"metadata":{"entities":null,"sources":null},"creationAuthorId":2320499,"updateAuthorId":2320499,"creator":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"updater":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"}}' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +- recorded_at: Fri, 12 Jun 2026 09:57:25 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security_monitoring/rules/7sm-pyl-xzv + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/examples/v2/security-monitoring/RestoreSecurityMonitoringRule.rb b/examples/v2/security-monitoring/RestoreSecurityMonitoringRule.rb new file mode 100644 index 000000000000..694fe6199cd2 --- /dev/null +++ b/examples/v2/security-monitoring/RestoreSecurityMonitoringRule.rb @@ -0,0 +1,11 @@ +# Restore a rule to a historical version returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.restore_security_monitoring_rule".to_sym] = true +end +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +# there is a valid "security_rule" in the system +SECURITY_RULE_ID = ENV["SECURITY_RULE_ID"] +p api_instance.restore_security_monitoring_rule(SECURITY_RULE_ID, 1) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 7ca6aaafe626..56cf48548420 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -2352,6 +2352,10 @@ "v2.ConvertExistingSecurityMonitoringRule" => { "rule_id" => "String", }, + "v2.RestoreSecurityMonitoringRule" => { + "rule_id" => "String", + "version" => "Integer", + }, "v2.TestExistingSecurityMonitoringRule" => { "rule_id" => "String", "body" => "SecurityMonitoringRuleTestRequest", diff --git a/features/v2/given.json b/features/v2/given.json index fb03c29c0572..f5ce3365dabd 100644 --- a/features/v2/given.json +++ b/features/v2/given.json @@ -1422,6 +1422,22 @@ "tag": "Security Monitoring", "operationId": "CreateSecurityMonitoringRule" }, + { + "parameters": [ + { + "name": "rule_id", + "source": "security_rule.id" + }, + { + "name": "body", + "value": "{\n \"name\": \"{{ unique }}-updated\",\n \"queries\": [{\n \"query\": \"@test:true\",\n \"aggregation\": \"count\",\n \"groupByFields\": [],\n \"distinctFields\": [],\n \"metrics\": []\n }],\n \"filters\": [],\n \"cases\": [{\n \"name\": \"\",\n \"status\": \"info\",\n \"condition\": \"a > 0\",\n \"notifications\": []\n }],\n \"options\": {\n \"evaluationWindow\": 900,\n \"keepAlive\": 3600,\n \"maxSignalDuration\": 86400\n },\n \"message\": \"Test rule updated\",\n \"tags\": [],\n \"isEnabled\": true\n}" + } + ], + "step": "there is a valid \"security_rule_updated\" in the system", + "key": "security_rule_updated", + "tag": "Security Monitoring", + "operationId": "UpdateSecurityMonitoringRule" + }, { "step": "a valid \"configuration\" in the system", "key": "configuration", diff --git a/features/v2/security_monitoring.feature b/features/v2/security_monitoring.feature index eb583c92cd36..d6ec475edf25 100644 --- a/features/v2/security_monitoring.feature +++ b/features/v2/security_monitoring.feature @@ -2532,6 +2532,48 @@ Feature: Security Monitoring When the request is sent Then the response status is 422 The server cannot process the request because it contains invalid data. + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Restore a rule to a historical version returns "Bad Request" response + Given operation "RestoreSecurityMonitoringRule" enabled + And new "RestoreSecurityMonitoringRule" request + And request contains "rule_id" parameter from "REPLACE.ME" + And request contains "version" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/k9-cloud-siem + Scenario: Restore a rule to a historical version returns "Conflict" response + Given operation "RestoreSecurityMonitoringRule" enabled + And there is a valid "security_rule" in the system + And there is a valid "security_rule_updated" in the system + And new "RestoreSecurityMonitoringRule" request + And request contains "rule_id" parameter from "security_rule.id" + And request contains "version" parameter with value 2 + When the request is sent + Then the response status is 409 Conflict + + @team:DataDog/k9-cloud-siem + Scenario: Restore a rule to a historical version returns "Not Found" response + Given operation "RestoreSecurityMonitoringRule" enabled + And there is a valid "security_rule" in the system + And new "RestoreSecurityMonitoringRule" request + And request contains "rule_id" parameter from "security_rule.id" + And request contains "version" parameter with value 9999 + When the request is sent + Then the response status is 404 Not Found + + @skip-validation @team:DataDog/k9-cloud-siem + Scenario: Restore a rule to a historical version returns "OK" response + Given operation "RestoreSecurityMonitoringRule" enabled + And there is a valid "security_rule" in the system + And there is a valid "security_rule_updated" in the system + And new "RestoreSecurityMonitoringRule" request + And request contains "rule_id" parameter from "security_rule.id" + And request contains "version" parameter with value 1 + When the request is sent + Then the response status is 200 OK + And the response "id" has the same value as "security_rule.id" + @generated @skip @team:DataDog/k9-vm-ast Scenario: Returns a list of Secrets rules returns "OK" response Given operation "GetSecretsRules" enabled diff --git a/features/v2/undo.json b/features/v2/undo.json index b047963c2ada..9815532a5b76 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -7439,6 +7439,12 @@ "type": "idempotent" } }, + "RestoreSecurityMonitoringRule": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, "TestExistingSecurityMonitoringRule": { "tag": "Security Monitoring", "undo": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index 420e3d7afb11..f4f45badfe7e 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -378,6 +378,7 @@ def initialize "v2.list_vulnerabilities": false, "v2.list_vulnerable_assets": false, "v2.mute_findings": false, + "v2.restore_security_monitoring_rule": false, "v2.run_historical_job": false, "v2.search_security_monitoring_histsignals": false, "v2.update_findings_assignee": false, diff --git a/lib/datadog_api_client/v2/api/security_monitoring_api.rb b/lib/datadog_api_client/v2/api/security_monitoring_api.rb index aa1c85a6039a..d6fe73607a18 100644 --- a/lib/datadog_api_client/v2/api/security_monitoring_api.rb +++ b/lib/datadog_api_client/v2/api/security_monitoring_api.rb @@ -8504,6 +8504,84 @@ def patch_vulnerability_notification_rule_with_http_info(id, body, opts = {}) return data, status_code, headers end + # Restore a rule to a historical version. + # + # @see #restore_security_monitoring_rule_with_http_info + def restore_security_monitoring_rule(rule_id, version, opts = {}) + data, _status_code, _headers = restore_security_monitoring_rule_with_http_info(rule_id, version, opts) + data + end + + # Restore a rule to a historical version. + # + # Restores a custom detection rule to a previously saved historical version. + # Only custom rules can be restored. Default and partner rules return 400. + # The restore creates a new version entry; it does not overwrite history. + # + # @param rule_id [String] The ID of the rule. + # @param version [Integer] The historical version number of the rule. + # @param opts [Hash] the optional parameters + # @return [Array<(SecurityMonitoringRuleResponse, Integer, Hash)>] SecurityMonitoringRuleResponse data, response status code and response headers + def restore_security_monitoring_rule_with_http_info(rule_id, version, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.restore_security_monitoring_rule".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.restore_security_monitoring_rule") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.restore_security_monitoring_rule")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.restore_security_monitoring_rule ...' + end + # verify the required parameter 'rule_id' is set + if @api_client.config.client_side_validation && rule_id.nil? + fail ArgumentError, "Missing the required parameter 'rule_id' when calling SecurityMonitoringAPI.restore_security_monitoring_rule" + end + # verify the required parameter 'version' is set + if @api_client.config.client_side_validation && version.nil? + fail ArgumentError, "Missing the required parameter 'version' when calling SecurityMonitoringAPI.restore_security_monitoring_rule" + end + # resource path + local_var_path = '/api/v2/security_monitoring/rules/{rule_id}/restore/{version}'.sub('{rule_id}', CGI.escape(rule_id.to_s).gsub('%2F', '/')).sub('{version}', CGI.escape(version.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'SecurityMonitoringRuleResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :restore_security_monitoring_rule, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#restore_security_monitoring_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Run a historical job. # # @see #run_historical_job_with_http_info