From 6a18fc90ed49783cde758fea83f64c0b757f4207 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 30 Apr 2026 09:20:48 +0000 Subject: [PATCH] Regenerate client from commit 618c06f of spec repo --- .generator/schemas/v2/openapi.yaml | 297 ++++++++++ .../GetPermanentRetentionFilter.java | 28 + .../ListPermanentRetentionFilters.java | 27 + .../UpdatePermanentRetentionFilter.java | 45 ++ .../api/RumRetentionFiltersPermanentApi.java | 544 ++++++++++++++++++ .../RumPermanentCrossProductSampling.java | 167 ++++++ ...manentCrossProductSamplingEditability.java | 144 +++++ ...umPermanentCrossProductSamplingUpdate.java | 145 +++++ ...RumPermanentRetentionFilterAttributes.java | 329 +++++++++++ .../RumPermanentRetentionFilterData.java | 228 ++++++++ .../RumPermanentRetentionFilterEventType.java | 76 +++ .../RumPermanentRetentionFilterMeta.java | 197 +++++++ ...RumPermanentRetentionFilterMetaSource.java | 66 +++ .../RumPermanentRetentionFilterResponse.java | 138 +++++ .../RumPermanentRetentionFilterType.java | 58 ++ ...manentRetentionFilterUpdateAttributes.java | 149 +++++ ...RumPermanentRetentionFilterUpdateData.java | 214 +++++++ ...PermanentRetentionFilterUpdateRequest.java | 149 +++++ .../RumPermanentRetentionFiltersResponse.java | 152 +++++ ...n_filter_returns_Not_Found_response.freeze | 1 + ...ion_filter_returns_Not_Found_response.json | 28 + ...etention_filter_returns_OK_response.freeze | 1 + ..._retention_filter_returns_OK_response.json | 28 + ...tention_filters_returns_OK_response.freeze | 1 + ...retention_filters_returns_OK_response.json | 28 + ...filter_returns_Bad_Request_response.freeze | 1 + ...n_filter_returns_Bad_Request_response.json | 32 ++ ..._Request_response_for_unknown_rf_id.freeze | 1 + ...ad_Request_response_for_unknown_rf_id.json | 32 ++ ...ion_filter_returns_Updated_response.freeze | 1 + ...ntion_filter_returns_Updated_response.json | 32 ++ .../rum_retention_filters_permanent.feature | 73 +++ .../com/datadog/api/client/v2/api/undo.json | 18 + 33 files changed, 3430 insertions(+) create mode 100644 examples/v2/rum-retention-filters-permanent/GetPermanentRetentionFilter.java create mode 100644 examples/v2/rum-retention-filters-permanent/ListPermanentRetentionFilters.java create mode 100644 examples/v2/rum-retention-filters-permanent/UpdatePermanentRetentionFilter.java create mode 100644 src/main/java/com/datadog/api/client/v2/api/RumRetentionFiltersPermanentApi.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/RumPermanentCrossProductSampling.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/RumPermanentCrossProductSamplingEditability.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/RumPermanentCrossProductSamplingUpdate.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFilterAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFilterData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFilterEventType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFilterMeta.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFilterMetaSource.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFilterResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFilterType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFilterUpdateAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFilterUpdateData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFilterUpdateRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFiltersResponse.java create mode 100644 src/test/resources/cassettes/features/v2/Get_a_permanent_retention_filter_returns_Not_Found_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Get_a_permanent_retention_filter_returns_Not_Found_response.json create mode 100644 src/test/resources/cassettes/features/v2/Get_a_permanent_retention_filter_returns_OK_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Get_a_permanent_retention_filter_returns_OK_response.json create mode 100644 src/test/resources/cassettes/features/v2/Get_all_permanent_retention_filters_returns_OK_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Get_all_permanent_retention_filters_returns_OK_response.json create mode 100644 src/test/resources/cassettes/features/v2/Update_a_permanent_retention_filter_returns_Bad_Request_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Update_a_permanent_retention_filter_returns_Bad_Request_response.json create mode 100644 src/test/resources/cassettes/features/v2/Update_a_permanent_retention_filter_returns_Bad_Request_response_for_unknown_rf_id.freeze create mode 100644 src/test/resources/cassettes/features/v2/Update_a_permanent_retention_filter_returns_Bad_Request_response_for_unknown_rf_id.json create mode 100644 src/test/resources/cassettes/features/v2/Update_a_permanent_retention_filter_returns_Updated_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Update_a_permanent_retention_filter_returns_Updated_response.json create mode 100644 src/test/resources/com/datadog/api/client/v2/api/rum_retention_filters_permanent.feature diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index e5175c1dc60..de92d869f22 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -1350,6 +1350,20 @@ components: required: true schema: type: string + RumPermanentRetentionFilterApplicationIDParameter: + description: RUM application ID. + in: path + name: app_id + required: true + schema: + type: string + RumPermanentRetentionFilterIDParameter: + description: Permanent retention filter ID. + in: path + name: rf_id + required: true + schema: + type: string RumRetentionFilterIDParameter: description: Retention filter ID. in: path @@ -60288,6 +60302,197 @@ components: $ref: "#/components/schemas/RumMetricResponseData" type: array type: object + RumPermanentCrossProductSampling: + description: Cross-product retention settings for a permanent retention filter. + properties: + trace_enabled: + description: Indicates whether Trace cross-product retention is active. Read-only. + 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 + RumPermanentCrossProductSamplingEditability: + description: Flags indicating which `cross_product_sampling` rates can be updated for this filter. Read-only. + properties: + trace_sample_rate: + description: If `true`, `cross_product_sampling.trace_sample_rate` can be updated on this filter. + example: true + type: boolean + type: object + RumPermanentCrossProductSamplingUpdate: + description: |- + Partial update of the cross-product sample rates for a permanent retention filter. + Only rates with a matching `cross_product_sampling_editability` flag set to `true` can be updated. + properties: + trace_sample_rate: + description: |- + Percentage (0–100) of retained sessions (with ingested traces) whose traces are indexed. + Omit to leave unchanged. Rejected if the filter's `cross_product_sampling_editability.trace_sample_rate` is `false`. + example: 25.0 + format: double + maximum: 100 + minimum: 0 + type: number + type: object + RumPermanentRetentionFilterAttributes: + description: The attributes of a permanent retention filter. + properties: + cross_product_sampling: + $ref: "#/components/schemas/RumPermanentCrossProductSampling" + cross_product_sampling_editability: + $ref: "#/components/schemas/RumPermanentCrossProductSamplingEditability" + enabled: + $ref: "#/components/schemas/RumPermanentRetentionFilterEnabled" + event_type: + $ref: "#/components/schemas/RumPermanentRetentionFilterEventType" + name: + $ref: "#/components/schemas/RumPermanentRetentionFilterName" + query: + $ref: "#/components/schemas/RumPermanentRetentionFilterQuery" + sample_rate: + $ref: "#/components/schemas/RumPermanentRetentionFilterSampleRate" + type: object + RumPermanentRetentionFilterData: + description: A permanent retention filter. + properties: + attributes: + $ref: "#/components/schemas/RumPermanentRetentionFilterAttributes" + id: + $ref: "#/components/schemas/RumPermanentRetentionFilterID" + meta: + $ref: "#/components/schemas/RumPermanentRetentionFilterMeta" + type: + $ref: "#/components/schemas/RumPermanentRetentionFilterType" + type: object + RumPermanentRetentionFilterEnabled: + description: Indicates whether the permanent retention filter is active. Read-only. + example: true + type: boolean + RumPermanentRetentionFilterEventType: + description: The type of RUM events the filter applies to. Read-only. + enum: + - session + - view + - action + - error + - resource + - long_task + - vital + - operation + example: "session" + type: string + x-enum-varnames: + - SESSION + - VIEW + - ACTION + - ERROR + - RESOURCE + - LONG_TASK + - VITAL + - OPERATION + RumPermanentRetentionFilterID: + description: Permanent retention filter ID. + example: "4b95d361-f65d-4515-9824-c9aaeba5ac2a" + type: string + RumPermanentRetentionFilterMeta: + description: Metadata about the permanent retention filter. + properties: + source: + $ref: "#/components/schemas/RumPermanentRetentionFilterMetaSource" + 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 + RumPermanentRetentionFilterMetaSource: + description: The source of the last update to a permanent retention filter. + enum: + - default + - ui + - terraform + example: "default" + type: string + x-enum-varnames: + - DEFAULT + - UI + - TERRAFORM + RumPermanentRetentionFilterName: + description: The name of a permanent retention filter. Read-only. + example: "Preconfigured permanent retention filter" + type: string + RumPermanentRetentionFilterQuery: + description: The query string for a permanent retention filter. Read-only. + example: "@type:session" + type: string + RumPermanentRetentionFilterResponse: + description: A permanent retention filter response body. + properties: + data: + $ref: "#/components/schemas/RumPermanentRetentionFilterData" + type: object + RumPermanentRetentionFilterSampleRate: + description: The retention sample rate for a permanent retention filter, from 0 to 100. Read-only. + example: 100.0 + format: double + maximum: 100 + minimum: 0 + type: number + RumPermanentRetentionFilterType: + default: permanent_retention_filters + description: The resource type. The value must be `permanent_retention_filters`. + enum: + - permanent_retention_filters + example: permanent_retention_filters + type: string + x-enum-varnames: ["PERMANENT_RETENTION_FILTERS"] + RumPermanentRetentionFilterUpdateAttributes: + description: The attributes of a permanent retention filter that can be updated. + properties: + cross_product_sampling: + $ref: "#/components/schemas/RumPermanentCrossProductSamplingUpdate" + type: object + RumPermanentRetentionFilterUpdateData: + description: The permanent retention filter properties to update. + properties: + attributes: + $ref: "#/components/schemas/RumPermanentRetentionFilterUpdateAttributes" + id: + $ref: "#/components/schemas/RumPermanentRetentionFilterID" + type: + $ref: "#/components/schemas/RumPermanentRetentionFilterType" + required: + - id + - type + - attributes + type: object + RumPermanentRetentionFilterUpdateRequest: + description: The permanent retention filter body to update. + properties: + data: + $ref: "#/components/schemas/RumPermanentRetentionFilterUpdateData" + required: + - data + type: object + RumPermanentRetentionFiltersResponse: + description: All permanent retention filters for a RUM application. + properties: + data: + description: A list of RUM permanent retention filters. + items: + $ref: "#/components/schemas/RumPermanentRetentionFilterData" + type: array + type: object RumRetentionFilterAttributes: description: The object describing attributes of a RUM retention filter. properties: @@ -117003,6 +117208,95 @@ paths: operator: OR permissions: - rum_apps_write + /api/v2/rum/applications/{app_id}/permanent_retention_filters: + get: + description: Get the list of permanent retention filters for a RUM application. + operationId: ListPermanentRetentionFilters + parameters: + - $ref: "#/components/parameters/RumPermanentRetentionFilterApplicationIDParameter" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/RumPermanentRetentionFiltersResponse" + description: OK + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Get all permanent retention filters + tags: + - Rum Retention Filters Permanent + /api/v2/rum/applications/{app_id}/permanent_retention_filters/{rf_id}: + get: + description: Get a single permanent retention filter for a RUM application. + operationId: GetPermanentRetentionFilter + parameters: + - $ref: "#/components/parameters/RumPermanentRetentionFilterApplicationIDParameter" + - $ref: "#/components/parameters/RumPermanentRetentionFilterIDParameter" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/RumPermanentRetentionFilterResponse" + description: OK + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Get a permanent retention filter + tags: + - Rum Retention Filters Permanent + patch: + description: |- + Update the cross-product sample rates of a permanent retention filter for a RUM application. + Only `cross_product_sampling.trace_sample_rate` can be updated, + and only when the matching flag in `cross_product_sampling_editability` is `true` on the filter. + Any other field is read-only and cannot be sent in the payload. + Returns the updated permanent retention filter when the request is successful. + operationId: UpdatePermanentRetentionFilter + parameters: + - $ref: "#/components/parameters/RumPermanentRetentionFilterApplicationIDParameter" + - $ref: "#/components/parameters/RumPermanentRetentionFilterIDParameter" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + cross_product_sampling: + trace_sample_rate: 25.0 + id: 4b95d361-f65d-4515-9824-c9aaeba5ac2a + type: permanent_retention_filters + schema: + $ref: "#/components/schemas/RumPermanentRetentionFilterUpdateRequest" + description: New cross-product sample rates for the permanent retention filter. + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/RumPermanentRetentionFilterResponse" + 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 permanent retention filter + tags: + - Rum Retention Filters Permanent + x-codegen-request-body-name: body /api/v2/rum/applications/{app_id}/relationships/retention_filters: patch: description: |- @@ -135183,6 +135477,9 @@ tags: - description: |- Manage retention filters through [Manage Applications](https://app.datadoghq.com/rum/list) of RUM for your organization. name: Rum Retention Filters + - description: |- + Manage permanent retention filters through [Manage Applications](https://app.datadoghq.com/rum/list) in RUM for your organization. + name: Rum Retention Filters Permanent - description: |- API to create and update scorecard rules and outcomes. See [Scorecards](https://docs.datadoghq.com/service_catalog/scorecards) for more information. name: Scorecards diff --git a/examples/v2/rum-retention-filters-permanent/GetPermanentRetentionFilter.java b/examples/v2/rum-retention-filters-permanent/GetPermanentRetentionFilter.java new file mode 100644 index 00000000000..00d4cf91182 --- /dev/null +++ b/examples/v2/rum-retention-filters-permanent/GetPermanentRetentionFilter.java @@ -0,0 +1,28 @@ +// Get a permanent retention filter returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.RumRetentionFiltersPermanentApi; +import com.datadog.api.client.v2.model.RumPermanentRetentionFilterResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + RumRetentionFiltersPermanentApi apiInstance = + new RumRetentionFiltersPermanentApi(defaultClient); + + try { + RumPermanentRetentionFilterResponse result = + apiInstance.getPermanentRetentionFilter( + "a33671aa-24fd-4dcd-ba4b-5bbdbafe7690", "default_synthetics"); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling RumRetentionFiltersPermanentApi#getPermanentRetentionFilter"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/rum-retention-filters-permanent/ListPermanentRetentionFilters.java b/examples/v2/rum-retention-filters-permanent/ListPermanentRetentionFilters.java new file mode 100644 index 00000000000..3328ea11afe --- /dev/null +++ b/examples/v2/rum-retention-filters-permanent/ListPermanentRetentionFilters.java @@ -0,0 +1,27 @@ +// Get all permanent retention filters returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.RumRetentionFiltersPermanentApi; +import com.datadog.api.client.v2.model.RumPermanentRetentionFiltersResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + RumRetentionFiltersPermanentApi apiInstance = + new RumRetentionFiltersPermanentApi(defaultClient); + + try { + RumPermanentRetentionFiltersResponse result = + apiInstance.listPermanentRetentionFilters("1d4b9c34-7ac4-423a-91cf-9902d926e9b3"); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling RumRetentionFiltersPermanentApi#listPermanentRetentionFilters"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/rum-retention-filters-permanent/UpdatePermanentRetentionFilter.java b/examples/v2/rum-retention-filters-permanent/UpdatePermanentRetentionFilter.java new file mode 100644 index 00000000000..9c198cfb55b --- /dev/null +++ b/examples/v2/rum-retention-filters-permanent/UpdatePermanentRetentionFilter.java @@ -0,0 +1,45 @@ +// Update a permanent retention filter returns "Updated" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.RumRetentionFiltersPermanentApi; +import com.datadog.api.client.v2.model.RumPermanentCrossProductSamplingUpdate; +import com.datadog.api.client.v2.model.RumPermanentRetentionFilterResponse; +import com.datadog.api.client.v2.model.RumPermanentRetentionFilterType; +import com.datadog.api.client.v2.model.RumPermanentRetentionFilterUpdateAttributes; +import com.datadog.api.client.v2.model.RumPermanentRetentionFilterUpdateData; +import com.datadog.api.client.v2.model.RumPermanentRetentionFilterUpdateRequest; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + RumRetentionFiltersPermanentApi apiInstance = + new RumRetentionFiltersPermanentApi(defaultClient); + + RumPermanentRetentionFilterUpdateRequest body = + new RumPermanentRetentionFilterUpdateRequest() + .data( + new RumPermanentRetentionFilterUpdateData() + .id("default_replays") + .type(RumPermanentRetentionFilterType.PERMANENT_RETENTION_FILTERS) + .attributes( + new RumPermanentRetentionFilterUpdateAttributes() + .crossProductSampling( + new RumPermanentCrossProductSamplingUpdate() + .traceSampleRate(100.0)))); + + try { + RumPermanentRetentionFilterResponse result = + apiInstance.updatePermanentRetentionFilter( + "a33671aa-24fd-4dcd-ba4b-5bbdbafe7690", "default_replays", body); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling RumRetentionFiltersPermanentApi#updatePermanentRetentionFilter"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/datadog/api/client/v2/api/RumRetentionFiltersPermanentApi.java b/src/main/java/com/datadog/api/client/v2/api/RumRetentionFiltersPermanentApi.java new file mode 100644 index 00000000000..80b7f376e78 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/api/RumRetentionFiltersPermanentApi.java @@ -0,0 +1,544 @@ +package com.datadog.api.client.v2.api; + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.ApiResponse; +import com.datadog.api.client.Pair; +import com.datadog.api.client.v2.model.RumPermanentRetentionFilterResponse; +import com.datadog.api.client.v2.model.RumPermanentRetentionFilterUpdateRequest; +import com.datadog.api.client.v2.model.RumPermanentRetentionFiltersResponse; +import jakarta.ws.rs.client.Invocation; +import jakarta.ws.rs.core.GenericType; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.CompletableFuture; + +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RumRetentionFiltersPermanentApi { + private ApiClient apiClient; + + public RumRetentionFiltersPermanentApi() { + this(ApiClient.getDefaultApiClient()); + } + + public RumRetentionFiltersPermanentApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Get the API client. + * + * @return API client + */ + public ApiClient getApiClient() { + return apiClient; + } + + /** + * Set the API client. + * + * @param apiClient an instance of API client + */ + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Get a permanent retention filter. + * + *

See {@link #getPermanentRetentionFilterWithHttpInfo}. + * + * @param appId RUM application ID. (required) + * @param rfId Permanent retention filter ID. (required) + * @return RumPermanentRetentionFilterResponse + * @throws ApiException if fails to make API call + */ + public RumPermanentRetentionFilterResponse getPermanentRetentionFilter(String appId, String rfId) + throws ApiException { + return getPermanentRetentionFilterWithHttpInfo(appId, rfId).getData(); + } + + /** + * Get a permanent retention filter. + * + *

See {@link #getPermanentRetentionFilterWithHttpInfoAsync}. + * + * @param appId RUM application ID. (required) + * @param rfId Permanent retention filter ID. (required) + * @return CompletableFuture<RumPermanentRetentionFilterResponse> + */ + public CompletableFuture getPermanentRetentionFilterAsync( + String appId, String rfId) { + return getPermanentRetentionFilterWithHttpInfoAsync(appId, rfId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get a single permanent retention filter for a RUM application. + * + * @param appId RUM application ID. (required) + * @param rfId Permanent retention filter ID. (required) + * @return ApiResponse<RumPermanentRetentionFilterResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
403 Not Authorized -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse getPermanentRetentionFilterWithHttpInfo( + String appId, String rfId) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'appId' is set + if (appId == null) { + throw new ApiException( + 400, "Missing the required parameter 'appId' when calling getPermanentRetentionFilter"); + } + + // verify the required parameter 'rfId' is set + if (rfId == null) { + throw new ApiException( + 400, "Missing the required parameter 'rfId' when calling getPermanentRetentionFilter"); + } + // create path and map variables + String localVarPath = + "/api/v2/rum/applications/{app_id}/permanent_retention_filters/{rf_id}" + .replaceAll("\\{" + "app_id" + "\\}", apiClient.escapeString(appId.toString())) + .replaceAll("\\{" + "rf_id" + "\\}", apiClient.escapeString(rfId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.RumRetentionFiltersPermanentApi.getPermanentRetentionFilter", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get a permanent retention filter. + * + *

See {@link #getPermanentRetentionFilterWithHttpInfo}. + * + * @param appId RUM application ID. (required) + * @param rfId Permanent retention filter ID. (required) + * @return CompletableFuture<ApiResponse<RumPermanentRetentionFilterResponse>> + */ + public CompletableFuture> + getPermanentRetentionFilterWithHttpInfoAsync(String appId, String rfId) { + Object localVarPostBody = null; + + // verify the required parameter 'appId' is set + if (appId == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'appId' when calling getPermanentRetentionFilter")); + return result; + } + + // verify the required parameter 'rfId' is set + if (rfId == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'rfId' when calling getPermanentRetentionFilter")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/rum/applications/{app_id}/permanent_retention_filters/{rf_id}" + .replaceAll("\\{" + "app_id" + "\\}", apiClient.escapeString(appId.toString())) + .replaceAll("\\{" + "rf_id" + "\\}", apiClient.escapeString(rfId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.RumRetentionFiltersPermanentApi.getPermanentRetentionFilter", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get all permanent retention filters. + * + *

See {@link #listPermanentRetentionFiltersWithHttpInfo}. + * + * @param appId RUM application ID. (required) + * @return RumPermanentRetentionFiltersResponse + * @throws ApiException if fails to make API call + */ + public RumPermanentRetentionFiltersResponse listPermanentRetentionFilters(String appId) + throws ApiException { + return listPermanentRetentionFiltersWithHttpInfo(appId).getData(); + } + + /** + * Get all permanent retention filters. + * + *

See {@link #listPermanentRetentionFiltersWithHttpInfoAsync}. + * + * @param appId RUM application ID. (required) + * @return CompletableFuture<RumPermanentRetentionFiltersResponse> + */ + public CompletableFuture listPermanentRetentionFiltersAsync( + String appId) { + return listPermanentRetentionFiltersWithHttpInfoAsync(appId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get the list of permanent retention filters for a RUM application. + * + * @param appId RUM application ID. (required) + * @return ApiResponse<RumPermanentRetentionFiltersResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
403 Not Authorized -
429 Too many requests -
+ */ + public ApiResponse + listPermanentRetentionFiltersWithHttpInfo(String appId) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'appId' is set + if (appId == null) { + throw new ApiException( + 400, "Missing the required parameter 'appId' when calling listPermanentRetentionFilters"); + } + // create path and map variables + String localVarPath = + "/api/v2/rum/applications/{app_id}/permanent_retention_filters" + .replaceAll("\\{" + "app_id" + "\\}", apiClient.escapeString(appId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.RumRetentionFiltersPermanentApi.listPermanentRetentionFilters", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get all permanent retention filters. + * + *

See {@link #listPermanentRetentionFiltersWithHttpInfo}. + * + * @param appId RUM application ID. (required) + * @return CompletableFuture<ApiResponse<RumPermanentRetentionFiltersResponse>> + */ + public CompletableFuture> + listPermanentRetentionFiltersWithHttpInfoAsync(String appId) { + Object localVarPostBody = null; + + // verify the required parameter 'appId' is set + if (appId == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'appId' when calling listPermanentRetentionFilters")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/rum/applications/{app_id}/permanent_retention_filters" + .replaceAll("\\{" + "app_id" + "\\}", apiClient.escapeString(appId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.RumRetentionFiltersPermanentApi.listPermanentRetentionFilters", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Update a permanent retention filter. + * + *

See {@link #updatePermanentRetentionFilterWithHttpInfo}. + * + * @param appId RUM application ID. (required) + * @param rfId Permanent retention filter ID. (required) + * @param body New cross-product sample rates for the permanent retention filter. (required) + * @return RumPermanentRetentionFilterResponse + * @throws ApiException if fails to make API call + */ + public RumPermanentRetentionFilterResponse updatePermanentRetentionFilter( + String appId, String rfId, RumPermanentRetentionFilterUpdateRequest body) + throws ApiException { + return updatePermanentRetentionFilterWithHttpInfo(appId, rfId, body).getData(); + } + + /** + * Update a permanent retention filter. + * + *

See {@link #updatePermanentRetentionFilterWithHttpInfoAsync}. + * + * @param appId RUM application ID. (required) + * @param rfId Permanent retention filter ID. (required) + * @param body New cross-product sample rates for the permanent retention filter. (required) + * @return CompletableFuture<RumPermanentRetentionFilterResponse> + */ + public CompletableFuture updatePermanentRetentionFilterAsync( + String appId, String rfId, RumPermanentRetentionFilterUpdateRequest body) { + return updatePermanentRetentionFilterWithHttpInfoAsync(appId, rfId, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Update the cross-product sample rates of a permanent retention filter for a RUM application. + * Only cross_product_sampling.trace_sample_rate can be updated, and only when the + * matching flag in cross_product_sampling_editability is true on the + * filter. Any other field is read-only and cannot be sent in the payload. Returns the updated + * permanent retention filter when the request is successful. + * + * @param appId RUM application ID. (required) + * @param rfId Permanent retention filter ID. (required) + * @param body New cross-product sample rates for the permanent retention filter. (required) + * @return ApiResponse<RumPermanentRetentionFilterResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 Updated -
400 Bad Request -
403 Not Authorized -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse + updatePermanentRetentionFilterWithHttpInfo( + String appId, String rfId, RumPermanentRetentionFilterUpdateRequest body) + throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'appId' is set + if (appId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'appId' when calling updatePermanentRetentionFilter"); + } + + // verify the required parameter 'rfId' is set + if (rfId == null) { + throw new ApiException( + 400, "Missing the required parameter 'rfId' when calling updatePermanentRetentionFilter"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling updatePermanentRetentionFilter"); + } + // create path and map variables + String localVarPath = + "/api/v2/rum/applications/{app_id}/permanent_retention_filters/{rf_id}" + .replaceAll("\\{" + "app_id" + "\\}", apiClient.escapeString(appId.toString())) + .replaceAll("\\{" + "rf_id" + "\\}", apiClient.escapeString(rfId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.RumRetentionFiltersPermanentApi.updatePermanentRetentionFilter", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Update a permanent retention filter. + * + *

See {@link #updatePermanentRetentionFilterWithHttpInfo}. + * + * @param appId RUM application ID. (required) + * @param rfId Permanent retention filter ID. (required) + * @param body New cross-product sample rates for the permanent retention filter. (required) + * @return CompletableFuture<ApiResponse<RumPermanentRetentionFilterResponse>> + */ + public CompletableFuture> + updatePermanentRetentionFilterWithHttpInfoAsync( + String appId, String rfId, RumPermanentRetentionFilterUpdateRequest body) { + Object localVarPostBody = body; + + // verify the required parameter 'appId' is set + if (appId == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'appId' when calling" + + " updatePermanentRetentionFilter")); + return result; + } + + // verify the required parameter 'rfId' is set + if (rfId == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'rfId' when calling updatePermanentRetentionFilter")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'body' when calling updatePermanentRetentionFilter")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/rum/applications/{app_id}/permanent_retention_filters/{rf_id}" + .replaceAll("\\{" + "app_id" + "\\}", apiClient.escapeString(appId.toString())) + .replaceAll("\\{" + "rf_id" + "\\}", apiClient.escapeString(rfId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.RumRetentionFiltersPermanentApi.updatePermanentRetentionFilter", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RumPermanentCrossProductSampling.java b/src/main/java/com/datadog/api/client/v2/model/RumPermanentCrossProductSampling.java new file mode 100644 index 00000000000..a66297692f9 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumPermanentCrossProductSampling.java @@ -0,0 +1,167 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Cross-product retention settings for a permanent retention filter. */ +@JsonPropertyOrder({ + RumPermanentCrossProductSampling.JSON_PROPERTY_TRACE_ENABLED, + RumPermanentCrossProductSampling.JSON_PROPERTY_TRACE_SAMPLE_RATE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RumPermanentCrossProductSampling { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_TRACE_ENABLED = "trace_enabled"; + private Boolean traceEnabled; + + public static final String JSON_PROPERTY_TRACE_SAMPLE_RATE = "trace_sample_rate"; + private Double traceSampleRate; + + public RumPermanentCrossProductSampling traceEnabled(Boolean traceEnabled) { + this.traceEnabled = traceEnabled; + return this; + } + + /** + * Indicates whether Trace cross-product retention is active. Read-only. + * + * @return traceEnabled + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TRACE_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getTraceEnabled() { + return traceEnabled; + } + + public void setTraceEnabled(Boolean traceEnabled) { + this.traceEnabled = traceEnabled; + } + + public RumPermanentCrossProductSampling traceSampleRate(Double traceSampleRate) { + this.traceSampleRate = traceSampleRate; + return this; + } + + /** + * Percentage (0–100) of retained sessions (with ingested traces) whose traces are indexed. + * minimum: 0 maximum: 100 + * + * @return traceSampleRate + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TRACE_SAMPLE_RATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getTraceSampleRate() { + return traceSampleRate; + } + + public void setTraceSampleRate(Double traceSampleRate) { + this.traceSampleRate = traceSampleRate; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return RumPermanentCrossProductSampling + */ + @JsonAnySetter + public RumPermanentCrossProductSampling putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this RumPermanentCrossProductSampling object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RumPermanentCrossProductSampling rumPermanentCrossProductSampling = + (RumPermanentCrossProductSampling) o; + return Objects.equals(this.traceEnabled, rumPermanentCrossProductSampling.traceEnabled) + && Objects.equals(this.traceSampleRate, rumPermanentCrossProductSampling.traceSampleRate) + && Objects.equals( + this.additionalProperties, rumPermanentCrossProductSampling.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(traceEnabled, traceSampleRate, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RumPermanentCrossProductSampling {\n"); + sb.append(" traceEnabled: ").append(toIndentedString(traceEnabled)).append("\n"); + sb.append(" traceSampleRate: ").append(toIndentedString(traceSampleRate)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RumPermanentCrossProductSamplingEditability.java b/src/main/java/com/datadog/api/client/v2/model/RumPermanentCrossProductSamplingEditability.java new file mode 100644 index 00000000000..f09a2f29ae0 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumPermanentCrossProductSamplingEditability.java @@ -0,0 +1,144 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * Flags indicating which cross_product_sampling rates can be updated for this filter. + * Read-only. + */ +@JsonPropertyOrder({RumPermanentCrossProductSamplingEditability.JSON_PROPERTY_TRACE_SAMPLE_RATE}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RumPermanentCrossProductSamplingEditability { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_TRACE_SAMPLE_RATE = "trace_sample_rate"; + private Boolean traceSampleRate; + + public RumPermanentCrossProductSamplingEditability traceSampleRate(Boolean traceSampleRate) { + this.traceSampleRate = traceSampleRate; + return this; + } + + /** + * If true, cross_product_sampling.trace_sample_rate can be updated on + * this filter. + * + * @return traceSampleRate + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TRACE_SAMPLE_RATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getTraceSampleRate() { + return traceSampleRate; + } + + public void setTraceSampleRate(Boolean traceSampleRate) { + this.traceSampleRate = traceSampleRate; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return RumPermanentCrossProductSamplingEditability + */ + @JsonAnySetter + public RumPermanentCrossProductSamplingEditability putAdditionalProperty( + String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this RumPermanentCrossProductSamplingEditability object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RumPermanentCrossProductSamplingEditability rumPermanentCrossProductSamplingEditability = + (RumPermanentCrossProductSamplingEditability) o; + return Objects.equals( + this.traceSampleRate, rumPermanentCrossProductSamplingEditability.traceSampleRate) + && Objects.equals( + this.additionalProperties, + rumPermanentCrossProductSamplingEditability.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(traceSampleRate, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RumPermanentCrossProductSamplingEditability {\n"); + sb.append(" traceSampleRate: ").append(toIndentedString(traceSampleRate)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RumPermanentCrossProductSamplingUpdate.java b/src/main/java/com/datadog/api/client/v2/model/RumPermanentCrossProductSamplingUpdate.java new file mode 100644 index 00000000000..b94522e2bd7 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumPermanentCrossProductSamplingUpdate.java @@ -0,0 +1,145 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * Partial update of the cross-product sample rates for a permanent retention filter. Only rates + * with a matching cross_product_sampling_editability flag set to true can + * be updated. + */ +@JsonPropertyOrder({RumPermanentCrossProductSamplingUpdate.JSON_PROPERTY_TRACE_SAMPLE_RATE}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RumPermanentCrossProductSamplingUpdate { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_TRACE_SAMPLE_RATE = "trace_sample_rate"; + private Double traceSampleRate; + + public RumPermanentCrossProductSamplingUpdate traceSampleRate(Double traceSampleRate) { + this.traceSampleRate = traceSampleRate; + return this; + } + + /** + * Percentage (0–100) of retained sessions (with ingested traces) whose traces are indexed. Omit + * to leave unchanged. Rejected if the filter's + * cross_product_sampling_editability.trace_sample_rate is false. minimum: 0 + * maximum: 100 + * + * @return traceSampleRate + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TRACE_SAMPLE_RATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getTraceSampleRate() { + return traceSampleRate; + } + + public void setTraceSampleRate(Double traceSampleRate) { + this.traceSampleRate = traceSampleRate; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return RumPermanentCrossProductSamplingUpdate + */ + @JsonAnySetter + public RumPermanentCrossProductSamplingUpdate putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this RumPermanentCrossProductSamplingUpdate object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RumPermanentCrossProductSamplingUpdate rumPermanentCrossProductSamplingUpdate = + (RumPermanentCrossProductSamplingUpdate) o; + return Objects.equals( + this.traceSampleRate, rumPermanentCrossProductSamplingUpdate.traceSampleRate) + && Objects.equals( + this.additionalProperties, rumPermanentCrossProductSamplingUpdate.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(traceSampleRate, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RumPermanentCrossProductSamplingUpdate {\n"); + sb.append(" traceSampleRate: ").append(toIndentedString(traceSampleRate)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFilterAttributes.java b/src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFilterAttributes.java new file mode 100644 index 00000000000..533ce3124d2 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFilterAttributes.java @@ -0,0 +1,329 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The attributes of a permanent retention filter. */ +@JsonPropertyOrder({ + RumPermanentRetentionFilterAttributes.JSON_PROPERTY_CROSS_PRODUCT_SAMPLING, + RumPermanentRetentionFilterAttributes.JSON_PROPERTY_CROSS_PRODUCT_SAMPLING_EDITABILITY, + RumPermanentRetentionFilterAttributes.JSON_PROPERTY_ENABLED, + RumPermanentRetentionFilterAttributes.JSON_PROPERTY_EVENT_TYPE, + RumPermanentRetentionFilterAttributes.JSON_PROPERTY_NAME, + RumPermanentRetentionFilterAttributes.JSON_PROPERTY_QUERY, + RumPermanentRetentionFilterAttributes.JSON_PROPERTY_SAMPLE_RATE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RumPermanentRetentionFilterAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CROSS_PRODUCT_SAMPLING = "cross_product_sampling"; + private RumPermanentCrossProductSampling crossProductSampling; + + public static final String JSON_PROPERTY_CROSS_PRODUCT_SAMPLING_EDITABILITY = + "cross_product_sampling_editability"; + private RumPermanentCrossProductSamplingEditability crossProductSamplingEditability; + + public static final String JSON_PROPERTY_ENABLED = "enabled"; + private Boolean enabled; + + public static final String JSON_PROPERTY_EVENT_TYPE = "event_type"; + private RumPermanentRetentionFilterEventType eventType; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_QUERY = "query"; + private String query; + + public static final String JSON_PROPERTY_SAMPLE_RATE = "sample_rate"; + private Double sampleRate; + + public RumPermanentRetentionFilterAttributes crossProductSampling( + RumPermanentCrossProductSampling crossProductSampling) { + this.crossProductSampling = crossProductSampling; + this.unparsed |= crossProductSampling.unparsed; + return this; + } + + /** + * Cross-product retention settings for a permanent retention filter. + * + * @return crossProductSampling + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CROSS_PRODUCT_SAMPLING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RumPermanentCrossProductSampling getCrossProductSampling() { + return crossProductSampling; + } + + public void setCrossProductSampling(RumPermanentCrossProductSampling crossProductSampling) { + this.crossProductSampling = crossProductSampling; + } + + public RumPermanentRetentionFilterAttributes crossProductSamplingEditability( + RumPermanentCrossProductSamplingEditability crossProductSamplingEditability) { + this.crossProductSamplingEditability = crossProductSamplingEditability; + this.unparsed |= crossProductSamplingEditability.unparsed; + return this; + } + + /** + * Flags indicating which cross_product_sampling rates can be updated for this + * filter. Read-only. + * + * @return crossProductSamplingEditability + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CROSS_PRODUCT_SAMPLING_EDITABILITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RumPermanentCrossProductSamplingEditability getCrossProductSamplingEditability() { + return crossProductSamplingEditability; + } + + public void setCrossProductSamplingEditability( + RumPermanentCrossProductSamplingEditability crossProductSamplingEditability) { + this.crossProductSamplingEditability = crossProductSamplingEditability; + } + + public RumPermanentRetentionFilterAttributes enabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Indicates whether the permanent retention filter is active. Read-only. + * + * @return enabled + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public RumPermanentRetentionFilterAttributes eventType( + RumPermanentRetentionFilterEventType eventType) { + this.eventType = eventType; + this.unparsed |= !eventType.isValid(); + return this; + } + + /** + * The type of RUM events the filter applies to. Read-only. + * + * @return eventType + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EVENT_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RumPermanentRetentionFilterEventType getEventType() { + return eventType; + } + + public void setEventType(RumPermanentRetentionFilterEventType eventType) { + if (!eventType.isValid()) { + this.unparsed = true; + } + this.eventType = eventType; + } + + public RumPermanentRetentionFilterAttributes name(String name) { + this.name = name; + return this; + } + + /** + * The name of a permanent retention filter. Read-only. + * + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public RumPermanentRetentionFilterAttributes query(String query) { + this.query = query; + return this; + } + + /** + * The query string for a permanent retention filter. Read-only. + * + * @return query + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_QUERY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getQuery() { + return query; + } + + public void setQuery(String query) { + this.query = query; + } + + public RumPermanentRetentionFilterAttributes sampleRate(Double sampleRate) { + this.sampleRate = sampleRate; + return this; + } + + /** + * The retention sample rate for a permanent retention filter, from 0 to 100. Read-only. minimum: + * 0 maximum: 100 + * + * @return sampleRate + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SAMPLE_RATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getSampleRate() { + return sampleRate; + } + + public void setSampleRate(Double sampleRate) { + this.sampleRate = sampleRate; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return RumPermanentRetentionFilterAttributes + */ + @JsonAnySetter + public RumPermanentRetentionFilterAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this RumPermanentRetentionFilterAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RumPermanentRetentionFilterAttributes rumPermanentRetentionFilterAttributes = + (RumPermanentRetentionFilterAttributes) o; + return Objects.equals( + this.crossProductSampling, rumPermanentRetentionFilterAttributes.crossProductSampling) + && Objects.equals( + this.crossProductSamplingEditability, + rumPermanentRetentionFilterAttributes.crossProductSamplingEditability) + && Objects.equals(this.enabled, rumPermanentRetentionFilterAttributes.enabled) + && Objects.equals(this.eventType, rumPermanentRetentionFilterAttributes.eventType) + && Objects.equals(this.name, rumPermanentRetentionFilterAttributes.name) + && Objects.equals(this.query, rumPermanentRetentionFilterAttributes.query) + && Objects.equals(this.sampleRate, rumPermanentRetentionFilterAttributes.sampleRate) + && Objects.equals( + this.additionalProperties, rumPermanentRetentionFilterAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + crossProductSampling, + crossProductSamplingEditability, + enabled, + eventType, + name, + query, + sampleRate, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RumPermanentRetentionFilterAttributes {\n"); + sb.append(" crossProductSampling: ") + .append(toIndentedString(crossProductSampling)) + .append("\n"); + sb.append(" crossProductSamplingEditability: ") + .append(toIndentedString(crossProductSamplingEditability)) + .append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" eventType: ").append(toIndentedString(eventType)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" query: ").append(toIndentedString(query)).append("\n"); + sb.append(" sampleRate: ").append(toIndentedString(sampleRate)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFilterData.java b/src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFilterData.java new file mode 100644 index 00000000000..f6fb0bf8cb5 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFilterData.java @@ -0,0 +1,228 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** A permanent retention filter. */ +@JsonPropertyOrder({ + RumPermanentRetentionFilterData.JSON_PROPERTY_ATTRIBUTES, + RumPermanentRetentionFilterData.JSON_PROPERTY_ID, + RumPermanentRetentionFilterData.JSON_PROPERTY_META, + RumPermanentRetentionFilterData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RumPermanentRetentionFilterData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private RumPermanentRetentionFilterAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_META = "meta"; + private RumPermanentRetentionFilterMeta meta; + + public static final String JSON_PROPERTY_TYPE = "type"; + private RumPermanentRetentionFilterType type = + RumPermanentRetentionFilterType.PERMANENT_RETENTION_FILTERS; + + public RumPermanentRetentionFilterData attributes( + RumPermanentRetentionFilterAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * The attributes of a permanent retention filter. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RumPermanentRetentionFilterAttributes getAttributes() { + return attributes; + } + + public void setAttributes(RumPermanentRetentionFilterAttributes attributes) { + this.attributes = attributes; + } + + public RumPermanentRetentionFilterData id(String id) { + this.id = id; + return this; + } + + /** + * Permanent retention filter ID. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public RumPermanentRetentionFilterData meta(RumPermanentRetentionFilterMeta meta) { + this.meta = meta; + this.unparsed |= meta.unparsed; + return this; + } + + /** + * Metadata about the permanent retention filter. + * + * @return meta + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_META) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RumPermanentRetentionFilterMeta getMeta() { + return meta; + } + + public void setMeta(RumPermanentRetentionFilterMeta meta) { + this.meta = meta; + } + + public RumPermanentRetentionFilterData type(RumPermanentRetentionFilterType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The resource type. The value must be permanent_retention_filters. + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RumPermanentRetentionFilterType getType() { + return type; + } + + public void setType(RumPermanentRetentionFilterType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return RumPermanentRetentionFilterData + */ + @JsonAnySetter + public RumPermanentRetentionFilterData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this RumPermanentRetentionFilterData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RumPermanentRetentionFilterData rumPermanentRetentionFilterData = + (RumPermanentRetentionFilterData) o; + return Objects.equals(this.attributes, rumPermanentRetentionFilterData.attributes) + && Objects.equals(this.id, rumPermanentRetentionFilterData.id) + && Objects.equals(this.meta, rumPermanentRetentionFilterData.meta) + && Objects.equals(this.type, rumPermanentRetentionFilterData.type) + && Objects.equals( + this.additionalProperties, rumPermanentRetentionFilterData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, meta, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RumPermanentRetentionFilterData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" meta: ").append(toIndentedString(meta)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFilterEventType.java b/src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFilterEventType.java new file mode 100644 index 00000000000..1d8feaf6e1f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFilterEventType.java @@ -0,0 +1,76 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The type of RUM events the filter applies to. Read-only. */ +@JsonSerialize( + using = + RumPermanentRetentionFilterEventType.RumPermanentRetentionFilterEventTypeSerializer.class) +public class RumPermanentRetentionFilterEventType extends ModelEnum { + + private static final Set allowedValues = + new HashSet( + Arrays.asList( + "session", "view", "action", "error", "resource", "long_task", "vital", "operation")); + + public static final RumPermanentRetentionFilterEventType SESSION = + new RumPermanentRetentionFilterEventType("session"); + public static final RumPermanentRetentionFilterEventType VIEW = + new RumPermanentRetentionFilterEventType("view"); + public static final RumPermanentRetentionFilterEventType ACTION = + new RumPermanentRetentionFilterEventType("action"); + public static final RumPermanentRetentionFilterEventType ERROR = + new RumPermanentRetentionFilterEventType("error"); + public static final RumPermanentRetentionFilterEventType RESOURCE = + new RumPermanentRetentionFilterEventType("resource"); + public static final RumPermanentRetentionFilterEventType LONG_TASK = + new RumPermanentRetentionFilterEventType("long_task"); + public static final RumPermanentRetentionFilterEventType VITAL = + new RumPermanentRetentionFilterEventType("vital"); + public static final RumPermanentRetentionFilterEventType OPERATION = + new RumPermanentRetentionFilterEventType("operation"); + + RumPermanentRetentionFilterEventType(String value) { + super(value, allowedValues); + } + + public static class RumPermanentRetentionFilterEventTypeSerializer + extends StdSerializer { + public RumPermanentRetentionFilterEventTypeSerializer( + Class t) { + super(t); + } + + public RumPermanentRetentionFilterEventTypeSerializer() { + this(null); + } + + @Override + public void serialize( + RumPermanentRetentionFilterEventType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static RumPermanentRetentionFilterEventType fromValue(String value) { + return new RumPermanentRetentionFilterEventType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFilterMeta.java b/src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFilterMeta.java new file mode 100644 index 00000000000..61cfc439db8 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFilterMeta.java @@ -0,0 +1,197 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Metadata about the permanent retention filter. */ +@JsonPropertyOrder({ + RumPermanentRetentionFilterMeta.JSON_PROPERTY_SOURCE, + RumPermanentRetentionFilterMeta.JSON_PROPERTY_UPDATED_AT, + RumPermanentRetentionFilterMeta.JSON_PROPERTY_UPDATED_BY_HANDLE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RumPermanentRetentionFilterMeta { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_SOURCE = "source"; + private RumPermanentRetentionFilterMetaSource source; + + public static final String JSON_PROPERTY_UPDATED_AT = "updated_at"; + private Long updatedAt; + + public static final String JSON_PROPERTY_UPDATED_BY_HANDLE = "updated_by_handle"; + private String updatedByHandle; + + public RumPermanentRetentionFilterMeta source(RumPermanentRetentionFilterMetaSource source) { + this.source = source; + this.unparsed |= !source.isValid(); + return this; + } + + /** + * The source of the last update to a permanent retention filter. + * + * @return source + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SOURCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RumPermanentRetentionFilterMetaSource getSource() { + return source; + } + + public void setSource(RumPermanentRetentionFilterMetaSource source) { + if (!source.isValid()) { + this.unparsed = true; + } + this.source = source; + } + + public RumPermanentRetentionFilterMeta updatedAt(Long updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * Unix epoch (in milliseconds) of the last update. + * + * @return updatedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UPDATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(Long updatedAt) { + this.updatedAt = updatedAt; + } + + public RumPermanentRetentionFilterMeta updatedByHandle(String updatedByHandle) { + this.updatedByHandle = updatedByHandle; + return this; + } + + /** + * Handle of the user who last updated the filter. + * + * @return updatedByHandle + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UPDATED_BY_HANDLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUpdatedByHandle() { + return updatedByHandle; + } + + public void setUpdatedByHandle(String updatedByHandle) { + this.updatedByHandle = updatedByHandle; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return RumPermanentRetentionFilterMeta + */ + @JsonAnySetter + public RumPermanentRetentionFilterMeta putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this RumPermanentRetentionFilterMeta object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RumPermanentRetentionFilterMeta rumPermanentRetentionFilterMeta = + (RumPermanentRetentionFilterMeta) o; + return Objects.equals(this.source, rumPermanentRetentionFilterMeta.source) + && Objects.equals(this.updatedAt, rumPermanentRetentionFilterMeta.updatedAt) + && Objects.equals(this.updatedByHandle, rumPermanentRetentionFilterMeta.updatedByHandle) + && Objects.equals( + this.additionalProperties, rumPermanentRetentionFilterMeta.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(source, updatedAt, updatedByHandle, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RumPermanentRetentionFilterMeta {\n"); + sb.append(" source: ").append(toIndentedString(source)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" updatedByHandle: ").append(toIndentedString(updatedByHandle)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFilterMetaSource.java b/src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFilterMetaSource.java new file mode 100644 index 00000000000..64bd0bb5dc9 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFilterMetaSource.java @@ -0,0 +1,66 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The source of the last update to a permanent retention filter. */ +@JsonSerialize( + using = + RumPermanentRetentionFilterMetaSource.RumPermanentRetentionFilterMetaSourceSerializer.class) +public class RumPermanentRetentionFilterMetaSource extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("default", "ui", "terraform")); + + public static final RumPermanentRetentionFilterMetaSource DEFAULT = + new RumPermanentRetentionFilterMetaSource("default"); + public static final RumPermanentRetentionFilterMetaSource UI = + new RumPermanentRetentionFilterMetaSource("ui"); + public static final RumPermanentRetentionFilterMetaSource TERRAFORM = + new RumPermanentRetentionFilterMetaSource("terraform"); + + RumPermanentRetentionFilterMetaSource(String value) { + super(value, allowedValues); + } + + public static class RumPermanentRetentionFilterMetaSourceSerializer + extends StdSerializer { + public RumPermanentRetentionFilterMetaSourceSerializer( + Class t) { + super(t); + } + + public RumPermanentRetentionFilterMetaSourceSerializer() { + this(null); + } + + @Override + public void serialize( + RumPermanentRetentionFilterMetaSource value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static RumPermanentRetentionFilterMetaSource fromValue(String value) { + return new RumPermanentRetentionFilterMetaSource(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFilterResponse.java b/src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFilterResponse.java new file mode 100644 index 00000000000..d939992fe90 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFilterResponse.java @@ -0,0 +1,138 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** A permanent retention filter response body. */ +@JsonPropertyOrder({RumPermanentRetentionFilterResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RumPermanentRetentionFilterResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private RumPermanentRetentionFilterData data; + + public RumPermanentRetentionFilterResponse data(RumPermanentRetentionFilterData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * A permanent retention filter. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RumPermanentRetentionFilterData getData() { + return data; + } + + public void setData(RumPermanentRetentionFilterData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return RumPermanentRetentionFilterResponse + */ + @JsonAnySetter + public RumPermanentRetentionFilterResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this RumPermanentRetentionFilterResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RumPermanentRetentionFilterResponse rumPermanentRetentionFilterResponse = + (RumPermanentRetentionFilterResponse) o; + return Objects.equals(this.data, rumPermanentRetentionFilterResponse.data) + && Objects.equals( + this.additionalProperties, rumPermanentRetentionFilterResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RumPermanentRetentionFilterResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFilterType.java b/src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFilterType.java new file mode 100644 index 00000000000..f366fa71f12 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFilterType.java @@ -0,0 +1,58 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The resource type. The value must be permanent_retention_filters. */ +@JsonSerialize( + using = RumPermanentRetentionFilterType.RumPermanentRetentionFilterTypeSerializer.class) +public class RumPermanentRetentionFilterType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("permanent_retention_filters")); + + public static final RumPermanentRetentionFilterType PERMANENT_RETENTION_FILTERS = + new RumPermanentRetentionFilterType("permanent_retention_filters"); + + RumPermanentRetentionFilterType(String value) { + super(value, allowedValues); + } + + public static class RumPermanentRetentionFilterTypeSerializer + extends StdSerializer { + public RumPermanentRetentionFilterTypeSerializer(Class t) { + super(t); + } + + public RumPermanentRetentionFilterTypeSerializer() { + this(null); + } + + @Override + public void serialize( + RumPermanentRetentionFilterType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static RumPermanentRetentionFilterType fromValue(String value) { + return new RumPermanentRetentionFilterType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFilterUpdateAttributes.java b/src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFilterUpdateAttributes.java new file mode 100644 index 00000000000..78fa6eee703 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFilterUpdateAttributes.java @@ -0,0 +1,149 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The attributes of a permanent retention filter that can be updated. */ +@JsonPropertyOrder({ + RumPermanentRetentionFilterUpdateAttributes.JSON_PROPERTY_CROSS_PRODUCT_SAMPLING +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RumPermanentRetentionFilterUpdateAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CROSS_PRODUCT_SAMPLING = "cross_product_sampling"; + private RumPermanentCrossProductSamplingUpdate crossProductSampling; + + public RumPermanentRetentionFilterUpdateAttributes crossProductSampling( + RumPermanentCrossProductSamplingUpdate crossProductSampling) { + this.crossProductSampling = crossProductSampling; + this.unparsed |= crossProductSampling.unparsed; + return this; + } + + /** + * Partial update of the cross-product sample rates for a permanent retention filter. Only rates + * with a matching cross_product_sampling_editability flag set to true + * can be updated. + * + * @return crossProductSampling + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CROSS_PRODUCT_SAMPLING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RumPermanentCrossProductSamplingUpdate getCrossProductSampling() { + return crossProductSampling; + } + + public void setCrossProductSampling(RumPermanentCrossProductSamplingUpdate crossProductSampling) { + this.crossProductSampling = crossProductSampling; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return RumPermanentRetentionFilterUpdateAttributes + */ + @JsonAnySetter + public RumPermanentRetentionFilterUpdateAttributes putAdditionalProperty( + String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this RumPermanentRetentionFilterUpdateAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RumPermanentRetentionFilterUpdateAttributes rumPermanentRetentionFilterUpdateAttributes = + (RumPermanentRetentionFilterUpdateAttributes) o; + return Objects.equals( + this.crossProductSampling, + rumPermanentRetentionFilterUpdateAttributes.crossProductSampling) + && Objects.equals( + this.additionalProperties, + rumPermanentRetentionFilterUpdateAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(crossProductSampling, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RumPermanentRetentionFilterUpdateAttributes {\n"); + sb.append(" crossProductSampling: ") + .append(toIndentedString(crossProductSampling)) + .append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFilterUpdateData.java b/src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFilterUpdateData.java new file mode 100644 index 00000000000..967c98254a8 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFilterUpdateData.java @@ -0,0 +1,214 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The permanent retention filter properties to update. */ +@JsonPropertyOrder({ + RumPermanentRetentionFilterUpdateData.JSON_PROPERTY_ATTRIBUTES, + RumPermanentRetentionFilterUpdateData.JSON_PROPERTY_ID, + RumPermanentRetentionFilterUpdateData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RumPermanentRetentionFilterUpdateData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private RumPermanentRetentionFilterUpdateAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private RumPermanentRetentionFilterType type = + RumPermanentRetentionFilterType.PERMANENT_RETENTION_FILTERS; + + public RumPermanentRetentionFilterUpdateData() {} + + @JsonCreator + public RumPermanentRetentionFilterUpdateData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + RumPermanentRetentionFilterUpdateAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + RumPermanentRetentionFilterType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public RumPermanentRetentionFilterUpdateData attributes( + RumPermanentRetentionFilterUpdateAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * The attributes of a permanent retention filter that can be updated. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public RumPermanentRetentionFilterUpdateAttributes getAttributes() { + return attributes; + } + + public void setAttributes(RumPermanentRetentionFilterUpdateAttributes attributes) { + this.attributes = attributes; + } + + public RumPermanentRetentionFilterUpdateData id(String id) { + this.id = id; + return this; + } + + /** + * Permanent retention filter ID. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public RumPermanentRetentionFilterUpdateData type(RumPermanentRetentionFilterType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The resource type. The value must be permanent_retention_filters. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public RumPermanentRetentionFilterType getType() { + return type; + } + + public void setType(RumPermanentRetentionFilterType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return RumPermanentRetentionFilterUpdateData + */ + @JsonAnySetter + public RumPermanentRetentionFilterUpdateData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this RumPermanentRetentionFilterUpdateData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RumPermanentRetentionFilterUpdateData rumPermanentRetentionFilterUpdateData = + (RumPermanentRetentionFilterUpdateData) o; + return Objects.equals(this.attributes, rumPermanentRetentionFilterUpdateData.attributes) + && Objects.equals(this.id, rumPermanentRetentionFilterUpdateData.id) + && Objects.equals(this.type, rumPermanentRetentionFilterUpdateData.type) + && Objects.equals( + this.additionalProperties, rumPermanentRetentionFilterUpdateData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RumPermanentRetentionFilterUpdateData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFilterUpdateRequest.java b/src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFilterUpdateRequest.java new file mode 100644 index 00000000000..a63b45bcc6a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFilterUpdateRequest.java @@ -0,0 +1,149 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The permanent retention filter body to update. */ +@JsonPropertyOrder({RumPermanentRetentionFilterUpdateRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RumPermanentRetentionFilterUpdateRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private RumPermanentRetentionFilterUpdateData data; + + public RumPermanentRetentionFilterUpdateRequest() {} + + @JsonCreator + public RumPermanentRetentionFilterUpdateRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + RumPermanentRetentionFilterUpdateData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public RumPermanentRetentionFilterUpdateRequest data(RumPermanentRetentionFilterUpdateData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * The permanent retention filter properties to update. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public RumPermanentRetentionFilterUpdateData getData() { + return data; + } + + public void setData(RumPermanentRetentionFilterUpdateData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return RumPermanentRetentionFilterUpdateRequest + */ + @JsonAnySetter + public RumPermanentRetentionFilterUpdateRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this RumPermanentRetentionFilterUpdateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RumPermanentRetentionFilterUpdateRequest rumPermanentRetentionFilterUpdateRequest = + (RumPermanentRetentionFilterUpdateRequest) o; + return Objects.equals(this.data, rumPermanentRetentionFilterUpdateRequest.data) + && Objects.equals( + this.additionalProperties, + rumPermanentRetentionFilterUpdateRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RumPermanentRetentionFilterUpdateRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFiltersResponse.java b/src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFiltersResponse.java new file mode 100644 index 00000000000..719324da138 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFiltersResponse.java @@ -0,0 +1,152 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** All permanent retention filters for a RUM application. */ +@JsonPropertyOrder({RumPermanentRetentionFiltersResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RumPermanentRetentionFiltersResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = null; + + public RumPermanentRetentionFiltersResponse data(List data) { + this.data = data; + for (RumPermanentRetentionFilterData item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public RumPermanentRetentionFiltersResponse addDataItem( + RumPermanentRetentionFilterData dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * A list of RUM permanent retention filters. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return RumPermanentRetentionFiltersResponse + */ + @JsonAnySetter + public RumPermanentRetentionFiltersResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this RumPermanentRetentionFiltersResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RumPermanentRetentionFiltersResponse rumPermanentRetentionFiltersResponse = + (RumPermanentRetentionFiltersResponse) o; + return Objects.equals(this.data, rumPermanentRetentionFiltersResponse.data) + && Objects.equals( + this.additionalProperties, rumPermanentRetentionFiltersResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RumPermanentRetentionFiltersResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/test/resources/cassettes/features/v2/Get_a_permanent_retention_filter_returns_Not_Found_response.freeze b/src/test/resources/cassettes/features/v2/Get_a_permanent_retention_filter_returns_Not_Found_response.freeze new file mode 100644 index 00000000000..ab3d12765e5 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_a_permanent_retention_filter_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2026-04-29T17:04:30.542Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_a_permanent_retention_filter_returns_Not_Found_response.json b/src/test/resources/cassettes/features/v2/Get_a_permanent_retention_filter_returns_Not_Found_response.json new file mode 100644 index 00000000000..1c5a2939170 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_a_permanent_retention_filter_returns_Not_Found_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/rum/applications/a33671aa-24fd-4dcd-ba4b-5bbdbafe7690/permanent_retention_filters/Test-Get_a_permanent_retention_filter_returns_Not_Found_response-1777482270", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"404\",\"title\":\"Not Found\",\"detail\":\"rpc error: code = NotFound desc = NotFound: This hardcoded retention filter does not exist\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "6dca69ba-6164-e997-a3e7-8bd26d3ace4b" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_a_permanent_retention_filter_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Get_a_permanent_retention_filter_returns_OK_response.freeze new file mode 100644 index 00000000000..ab3d12765e5 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_a_permanent_retention_filter_returns_OK_response.freeze @@ -0,0 +1 @@ +2026-04-29T17:04:30.542Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_a_permanent_retention_filter_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Get_a_permanent_retention_filter_returns_OK_response.json new file mode 100644 index 00000000000..1207dd33fd4 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_a_permanent_retention_filter_returns_OK_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/rum/applications/a33671aa-24fd-4dcd-ba4b-5bbdbafe7690/permanent_retention_filters/default_synthetics", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"default_synthetics\",\"type\":\"permanent_retention_filters\",\"attributes\":{\"name\":\"Default Synthetics\",\"event_type\":\"session\",\"query\":\"@type:browser\",\"sample_rate\":100,\"enabled\":true,\"cross_product_sampling\":{\"trace_sample_rate\":100},\"cross_product_sampling_editability\":{\"trace_sample_rate\":true}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "d940ee6b-2762-c823-2e76-a39ec679dd35" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_all_permanent_retention_filters_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Get_all_permanent_retention_filters_returns_OK_response.freeze new file mode 100644 index 00000000000..ab3d12765e5 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_all_permanent_retention_filters_returns_OK_response.freeze @@ -0,0 +1 @@ +2026-04-29T17:04:30.542Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_all_permanent_retention_filters_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Get_all_permanent_retention_filters_returns_OK_response.json new file mode 100644 index 00000000000..f21c39f8c7d --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_all_permanent_retention_filters_returns_OK_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/rum/applications/1d4b9c34-7ac4-423a-91cf-9902d926e9b3/permanent_retention_filters", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":[{\"id\":\"default_synthetics\",\"type\":\"permanent_retention_filters\",\"attributes\":{\"name\":\"Default Synthetics\",\"event_type\":\"session\",\"query\":\"@type:browser\",\"sample_rate\":100,\"enabled\":true,\"cross_product_sampling\":{\"trace_sample_rate\":100},\"cross_product_sampling_editability\":{\"trace_sample_rate\":true}}},{\"id\":\"default_replays\",\"type\":\"permanent_retention_filters\",\"attributes\":{\"name\":\"Default Replays\",\"event_type\":\"session\",\"query\":\"@has_replay:true\",\"sample_rate\":100,\"enabled\":true,\"cross_product_sampling\":{\"trace_sample_rate\":100},\"cross_product_sampling_editability\":{\"trace_sample_rate\":true}}}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "b76a680d-a5df-0694-374c-3c9ae73fac1e" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_a_permanent_retention_filter_returns_Bad_Request_response.freeze b/src/test/resources/cassettes/features/v2/Update_a_permanent_retention_filter_returns_Bad_Request_response.freeze new file mode 100644 index 00000000000..e16b1284f48 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_a_permanent_retention_filter_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2026-04-29T17:04:32.471Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_a_permanent_retention_filter_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Update_a_permanent_retention_filter_returns_Bad_Request_response.json new file mode 100644 index 00000000000..6406407bc1c --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_a_permanent_retention_filter_returns_Bad_Request_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"cross_product_sampling\":{\"trace_sample_rate\":25}},\"id\":\"Test-Update_a_permanent_retention_filter_returns_Bad_Request_response-1777482272\",\"type\":\"invalid_type\"}}" + }, + "headers": {}, + "method": "PATCH", + "path": "/api/v2/rum/applications/a33671aa-24fd-4dcd-ba4b-5bbdbafe7690/permanent_retention_filters/Test-Update_a_permanent_retention_filter_returns_Bad_Request_response-1777482272", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"400\",\"title\":\"Bad Request\",\"detail\":\"got type \\\"invalid_type\\\" expected one of \\\"permanent_retention_filters\\\"\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "37e84948-262a-f252-9db6-76cdb8a57322" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_a_permanent_retention_filter_returns_Bad_Request_response_for_unknown_rf_id.freeze b/src/test/resources/cassettes/features/v2/Update_a_permanent_retention_filter_returns_Bad_Request_response_for_unknown_rf_id.freeze new file mode 100644 index 00000000000..cd6c745907e --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_a_permanent_retention_filter_returns_Bad_Request_response_for_unknown_rf_id.freeze @@ -0,0 +1 @@ +2026-04-29T17:04:32.786Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_a_permanent_retention_filter_returns_Bad_Request_response_for_unknown_rf_id.json b/src/test/resources/cassettes/features/v2/Update_a_permanent_retention_filter_returns_Bad_Request_response_for_unknown_rf_id.json new file mode 100644 index 00000000000..5f564b02e0c --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_a_permanent_retention_filter_returns_Bad_Request_response_for_unknown_rf_id.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"cross_product_sampling\":{\"trace_sample_rate\":25}},\"id\":\"Test-Update_a_permanent_retention_filter_returns_Bad_Request_response_for_unknown_rf_id-1777482272\",\"type\":\"permanent_retention_filters\"}}" + }, + "headers": {}, + "method": "PATCH", + "path": "/api/v2/rum/applications/a33671aa-24fd-4dcd-ba4b-5bbdbafe7690/permanent_retention_filters/Test-Update_a_permanent_retention_filter_returns_Bad_Request_response_for_unknown_rf_id-1777482272", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"404\",\"title\":\"Not Found\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "4df7334d-6c0f-b3ed-12b2-19f75362fa32" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_a_permanent_retention_filter_returns_Updated_response.freeze b/src/test/resources/cassettes/features/v2/Update_a_permanent_retention_filter_returns_Updated_response.freeze new file mode 100644 index 00000000000..ab3d12765e5 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_a_permanent_retention_filter_returns_Updated_response.freeze @@ -0,0 +1 @@ +2026-04-29T17:04:30.542Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_a_permanent_retention_filter_returns_Updated_response.json b/src/test/resources/cassettes/features/v2/Update_a_permanent_retention_filter_returns_Updated_response.json new file mode 100644 index 00000000000..df636a04518 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_a_permanent_retention_filter_returns_Updated_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"cross_product_sampling\":{\"trace_sample_rate\":100}},\"id\":\"default_replays\",\"type\":\"permanent_retention_filters\"}}" + }, + "headers": {}, + "method": "PATCH", + "path": "/api/v2/rum/applications/a33671aa-24fd-4dcd-ba4b-5bbdbafe7690/permanent_retention_filters/default_replays", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"default_replays\",\"type\":\"permanent_retention_filters\",\"attributes\":{\"name\":\"Default Replays\",\"event_type\":\"session\",\"query\":\"@has_replay:true\",\"sample_rate\":100,\"enabled\":true,\"cross_product_sampling\":{\"trace_sample_rate\":100},\"cross_product_sampling_editability\":{\"trace_sample_rate\":true}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "55f884a5-639a-2b80-8d90-c5f91bdc9e3b" + } +] \ No newline at end of file diff --git a/src/test/resources/com/datadog/api/client/v2/api/rum_retention_filters_permanent.feature b/src/test/resources/com/datadog/api/client/v2/api/rum_retention_filters_permanent.feature new file mode 100644 index 00000000000..6f1f90d7e05 --- /dev/null +++ b/src/test/resources/com/datadog/api/client/v2/api/rum_retention_filters_permanent.feature @@ -0,0 +1,73 @@ +@endpoint(rum-retention-filters-permanent) @endpoint(rum-retention-filters-permanent-v2) +Feature: Rum Retention Filters Permanent + Manage permanent retention filters through [Manage + Applications](https://app.datadoghq.com/rum/list) in RUM for your + organization. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "RumRetentionFiltersPermanent" API + + @team:DataDog/rum-backend + Scenario: Get a permanent retention filter returns "Not Found" response + Given new "GetPermanentRetentionFilter" request + And request contains "app_id" parameter with value "a33671aa-24fd-4dcd-ba4b-5bbdbafe7690" + And request contains "rf_id" parameter with value "{{ unique }}" + When the request is sent + Then the response status is 404 Not Found + + @replay-only @team:DataDog/rum-backend + Scenario: Get a permanent retention filter returns "OK" response + Given new "GetPermanentRetentionFilter" request + And request contains "app_id" parameter with value "a33671aa-24fd-4dcd-ba4b-5bbdbafe7690" + And request contains "rf_id" parameter with value "default_synthetics" + When the request is sent + Then the response status is 200 OK + And the response "data.id" is equal to "default_synthetics" + And the response "data.type" is equal to "permanent_retention_filters" + + @replay-only @team:DataDog/rum-backend + Scenario: Get all permanent retention filters returns "OK" response + Given new "ListPermanentRetentionFilters" request + And request contains "app_id" parameter with value "1d4b9c34-7ac4-423a-91cf-9902d926e9b3" + When the request is sent + Then the response status is 200 OK + + @team:DataDog/rum-backend + Scenario: Update a permanent retention filter returns "Bad Request" response + Given new "UpdatePermanentRetentionFilter" request + And request contains "app_id" parameter with value "a33671aa-24fd-4dcd-ba4b-5bbdbafe7690" + And request contains "rf_id" parameter with value "{{ unique }}" + And body with value {"data":{"id":"{{ unique }}","type":"invalid_type","attributes":{"cross_product_sampling":{"trace_sample_rate":25}}}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/rum-backend + Scenario: Update a permanent retention filter returns "Bad Request" response for unknown rf_id + Given new "UpdatePermanentRetentionFilter" request + And request contains "app_id" parameter with value "a33671aa-24fd-4dcd-ba4b-5bbdbafe7690" + And request contains "rf_id" parameter with value "{{ unique }}" + And body with value {"data":{"id":"{{ unique }}","type":"permanent_retention_filters","attributes":{"cross_product_sampling":{"trace_sample_rate":25}}}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/rum-backend + Scenario: Update a permanent retention filter returns "Not Found" response + Given new "UpdatePermanentRetentionFilter" 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": {"trace_sample_rate": 25.0}}, "id": "4b95d361-f65d-4515-9824-c9aaeba5ac2a", "type": "permanent_retention_filters"}} + When the request is sent + Then the response status is 404 Not Found + + @replay-only @team:DataDog/rum-backend + Scenario: Update a permanent retention filter returns "Updated" response + Given new "UpdatePermanentRetentionFilter" request + And request contains "app_id" parameter with value "a33671aa-24fd-4dcd-ba4b-5bbdbafe7690" + And request contains "rf_id" parameter with value "default_replays" + And body with value {"data":{"id":"default_replays","type":"permanent_retention_filters","attributes":{"cross_product_sampling":{"trace_sample_rate":100}}}} + When the request is sent + Then the response status is 200 Updated + And the response "data.id" is equal to "default_replays" + And the response "data.type" is equal to "permanent_retention_filters" diff --git a/src/test/resources/com/datadog/api/client/v2/api/undo.json b/src/test/resources/com/datadog/api/client/v2/api/undo.json index f606e4a8658..cda95dcc96b 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/undo.json +++ b/src/test/resources/com/datadog/api/client/v2/api/undo.json @@ -4940,6 +4940,24 @@ "type": "unsafe" } }, + "ListPermanentRetentionFilters": { + "tag": "Rum Retention Filters Permanent", + "undo": { + "type": "safe" + } + }, + "GetPermanentRetentionFilter": { + "tag": "Rum Retention Filters Permanent", + "undo": { + "type": "safe" + } + }, + "UpdatePermanentRetentionFilter": { + "tag": "Rum Retention Filters Permanent", + "undo": { + "type": "idempotent" + } + }, "OrderRetentionFilters": { "tag": "Rum Retention Filters", "undo": {