diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 52c5ef104a4..ed6c1a55d51 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -1558,6 +1558,20 @@ components: required: true schema: type: string + RumHardcodedRetentionFilterApplicationIDParameter: + description: RUM application ID. + in: path + name: app_id + required: true + schema: + type: string + RumHardcodedRetentionFilterIDParameter: + description: Hardcoded retention filter ID. + in: path + name: rf_id + required: true + schema: + type: string RumMetricIDParameter: description: The name of the rum-based metric. in: path @@ -72837,6 +72851,223 @@ components: minimum: 0 type: number type: object + RumHardcodedCrossProductSampling: + description: Cross-product retention settings for a hardcoded retention filter. + properties: + session_replay_enabled: + description: Indicates whether Session Replay cross-product retention is active. + example: true + type: boolean + session_replay_sample_rate: + description: Percentage (0–100) of retained sessions with an ingested replay whose replay data is kept. + example: 50.0 + format: double + maximum: 100 + minimum: 0 + type: number + trace_enabled: + description: Indicates whether Trace cross-product retention is active. + example: true + type: boolean + trace_sample_rate: + description: Percentage (0–100) of retained sessions with ingested traces whose traces are indexed. + example: 25.0 + format: double + maximum: 100 + minimum: 0 + type: number + type: object + RumHardcodedCrossProductSamplingEditability: + description: Flags indicating which `cross_product_sampling` fields can be updated. Read-only. + properties: + session_replay_sample_rate: + description: |- + If `true`, `cross_product_sampling.session_replay_sample_rate` can be updated on this filter. + example: true + type: boolean + trace_sample_rate: + description: If `true`, `cross_product_sampling.trace_sample_rate` can be updated on this filter. + example: false + type: boolean + type: object + RumHardcodedCrossProductSamplingUpdate: + description: |- + Partial update for cross-product retention of a hardcoded retention filter. + Only fields whose matching flag in `cross_product_sampling_editability` is `true` can be updated. + properties: + session_replay_enabled: + description: Controls whether Session Replay cross-product retention is active. Omit to leave unchanged. + example: true + type: boolean + session_replay_sample_rate: + description: |- + Percentage (0–100) of retained sessions with an ingested replay whose replay data is kept. + Omit to leave unchanged. + example: 50.0 + format: double + maximum: 100 + minimum: 0 + type: number + trace_enabled: + description: Controls whether Trace cross-product retention is active. Omit to leave unchanged. + example: true + type: boolean + trace_sample_rate: + description: |- + Percentage (0–100) of retained sessions with ingested traces whose traces are indexed. + Omit to leave unchanged. + example: 25.0 + format: double + maximum: 100 + minimum: 0 + type: number + type: object + RumHardcodedRetentionFilterAttributes: + description: The attributes of a hardcoded retention filter. + properties: + cross_product_sampling: + $ref: "#/components/schemas/RumHardcodedCrossProductSampling" + cross_product_sampling_editability: + $ref: "#/components/schemas/RumHardcodedCrossProductSamplingEditability" + enabled: + description: Indicates whether the hardcoded retention filter is active. Read-only. + example: true + type: boolean + event_type: + $ref: "#/components/schemas/RumHardcodedRetentionFilterEventType" + name: + description: The name of the hardcoded retention filter. Read-only. + example: Replay sessions + type: string + query: + description: The query string for the hardcoded retention filter. Read-only. + example: "@session.has_replay:true" + type: string + sample_rate: + description: The retention sample rate (0–100) for the hardcoded filter. Read-only. + example: 100.0 + format: double + maximum: 100 + minimum: 0 + type: number + type: object + RumHardcodedRetentionFilterData: + description: A hardcoded retention filter. + properties: + attributes: + $ref: "#/components/schemas/RumHardcodedRetentionFilterAttributes" + id: + description: The ID of the hardcoded retention filter. + example: forced_replay_sessions + type: string + meta: + $ref: "#/components/schemas/RumHardcodedRetentionFilterMeta" + type: + $ref: "#/components/schemas/RumHardcodedRetentionFilterType" + type: object + RumHardcodedRetentionFilterEventType: + description: The type of RUM events the hardcoded filter applies to. Read-only. + enum: + - session + - view + - action + - error + - resource + - long_task + - vital + example: session + type: string + x-enum-varnames: + - SESSION + - VIEW + - ACTION + - ERROR + - RESOURCE + - LONG_TASK + - VITAL + RumHardcodedRetentionFilterMeta: + description: Metadata about the hardcoded retention filter. + properties: + source: + $ref: "#/components/schemas/RumHardcodedRetentionFilterMetaSource" + updated_at: + description: Unix epoch (in milliseconds) of the last update. + example: 1735689600000 + format: int64 + type: integer + updated_by_handle: + description: Handle of the user who last updated the filter. + example: jane.doe@example.com + type: string + type: object + RumHardcodedRetentionFilterMetaSource: + description: The source of the last update to a hardcoded retention filter. + enum: + - default + - ui + - terraform + example: ui + type: string + x-enum-varnames: + - DEFAULT + - UI + - TERRAFORM + RumHardcodedRetentionFilterResponse: + description: A hardcoded retention filter response body. + properties: + data: + $ref: "#/components/schemas/RumHardcodedRetentionFilterData" + type: object + RumHardcodedRetentionFilterType: + default: hardcoded_retention_filters + description: The resource type. The value must be `hardcoded_retention_filters`. + enum: + - hardcoded_retention_filters + example: hardcoded_retention_filters + type: string + x-enum-varnames: + - HARDCODED_RETENTION_FILTERS + RumHardcodedRetentionFilterUpdateAttributes: + description: |- + The attributes of a hardcoded retention filter that can be updated. + Only fields whose matching flag in `cross_product_sampling_editability` is `true` can be modified. + properties: + cross_product_sampling: + $ref: "#/components/schemas/RumHardcodedCrossProductSamplingUpdate" + type: object + RumHardcodedRetentionFilterUpdateData: + description: The hardcoded retention filter properties to update. + properties: + attributes: + $ref: "#/components/schemas/RumHardcodedRetentionFilterUpdateAttributes" + id: + description: The ID of the hardcoded retention filter. Must match the `rf_id` path parameter. + example: forced_replay_sessions + type: string + type: + $ref: "#/components/schemas/RumHardcodedRetentionFilterType" + required: + - id + - type + - attributes + type: object + RumHardcodedRetentionFilterUpdateRequest: + description: The hardcoded retention filter body to update. + properties: + data: + $ref: "#/components/schemas/RumHardcodedRetentionFilterUpdateData" + required: + - data + type: object + RumHardcodedRetentionFiltersResponse: + description: All hardcoded retention filters for a RUM application. + properties: + data: + description: A list of hardcoded retention filters. + items: + $ref: "#/components/schemas/RumHardcodedRetentionFilterData" + type: array + type: object RumMetricCompute: description: The compute rule to compute the rum-based metric. properties: @@ -150164,6 +150395,167 @@ paths: operator: OR permissions: - rum_apps_write + /api/v2/rum/applications/{app_id}/hardcoded_retention_filters: + get: + description: Get the list of hardcoded retention filters for a RUM application. + operationId: ListHardcodedRetentionFilters + parameters: + - $ref: "#/components/parameters/RumHardcodedRetentionFilterApplicationIDParameter" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + cross_product_sampling: + session_replay_enabled: true + session_replay_sample_rate: 50.0 + trace_enabled: true + trace_sample_rate: 25.0 + cross_product_sampling_editability: + session_replay_sample_rate: true + trace_sample_rate: false + enabled: true + event_type: session + name: Replay sessions + query: "@session.has_replay:true" + sample_rate: 100.0 + id: forced_replay_sessions + meta: + source: ui + updated_at: 1735689600000 + updated_by_handle: jane.doe@example.com + type: hardcoded_retention_filters + schema: + $ref: "#/components/schemas/RumHardcodedRetentionFiltersResponse" + description: OK + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Get all hardcoded retention filters + tags: + - RUM Retention Filters Hardcoded + /api/v2/rum/applications/{app_id}/hardcoded_retention_filters/{rf_id}: + get: + description: Get a single hardcoded retention filter for a RUM application. + operationId: GetHardcodedRetentionFilter + parameters: + - $ref: "#/components/parameters/RumHardcodedRetentionFilterApplicationIDParameter" + - $ref: "#/components/parameters/RumHardcodedRetentionFilterIDParameter" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + cross_product_sampling: + session_replay_enabled: true + session_replay_sample_rate: 50.0 + trace_enabled: true + trace_sample_rate: 25.0 + cross_product_sampling_editability: + session_replay_sample_rate: true + trace_sample_rate: false + enabled: true + event_type: session + name: Replay sessions + query: "@session.has_replay:true" + sample_rate: 100.0 + id: forced_replay_sessions + meta: + source: ui + updated_at: 1735689600000 + updated_by_handle: jane.doe@example.com + type: hardcoded_retention_filters + schema: + $ref: "#/components/schemas/RumHardcodedRetentionFilterResponse" + description: OK + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Get a hardcoded retention filter + tags: + - RUM Retention Filters Hardcoded + patch: + description: |- + Update the cross-product sample rates of a hardcoded retention filter for a RUM application. + Only fields whose matching flag in `cross_product_sampling_editability` is `true` can be updated. + Any other field is read-only and cannot be sent in the payload. + Returns the updated hardcoded retention filter when the request is successful. + operationId: UpdateHardcodedRetentionFilter + parameters: + - $ref: "#/components/parameters/RumHardcodedRetentionFilterApplicationIDParameter" + - $ref: "#/components/parameters/RumHardcodedRetentionFilterIDParameter" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + cross_product_sampling: + session_replay_enabled: true + session_replay_sample_rate: 50.0 + id: forced_replay_sessions + type: hardcoded_retention_filters + schema: + $ref: "#/components/schemas/RumHardcodedRetentionFilterUpdateRequest" + description: New cross-product sample rates for the hardcoded retention filter. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + cross_product_sampling: + session_replay_enabled: true + session_replay_sample_rate: 50.0 + trace_enabled: true + trace_sample_rate: 25.0 + cross_product_sampling_editability: + session_replay_sample_rate: true + trace_sample_rate: false + enabled: true + event_type: session + name: Replay sessions + query: "@session.has_replay:true" + sample_rate: 100.0 + id: forced_replay_sessions + meta: + source: ui + updated_at: 1735689600000 + updated_by_handle: jane.doe@example.com + type: hardcoded_retention_filters + schema: + $ref: "#/components/schemas/RumHardcodedRetentionFilterResponse" + description: Updated + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Update a hardcoded retention filter + tags: + - RUM Retention Filters Hardcoded + x-codegen-request-body-name: body /api/v2/rum/applications/{app_id}/relationships/retention_filters: patch: description: |- @@ -175551,6 +175943,9 @@ tags: - description: |- Get insights into the performance of your Real User Monitoring (RUM) applications over HTTP. See the [RUM & Session Replay page](https://docs.datadoghq.com/real_user_monitoring/) for more information name: RUM Insights + - description: |- + Manage hardcoded retention filters through [Manage Applications](https://app.datadoghq.com/rum/list) in RUM. + name: RUM Retention Filters Hardcoded - description: View and manage Reference Tables in your organization. name: Reference Tables - description: |- diff --git a/examples/v2/rum-retention-filters-hardcoded/GetHardcodedRetentionFilter.java b/examples/v2/rum-retention-filters-hardcoded/GetHardcodedRetentionFilter.java new file mode 100644 index 00000000000..1572d20c6f2 --- /dev/null +++ b/examples/v2/rum-retention-filters-hardcoded/GetHardcodedRetentionFilter.java @@ -0,0 +1,28 @@ +// Get a hardcoded retention filter returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.RumRetentionFiltersHardcodedApi; +import com.datadog.api.client.v2.model.RumHardcodedRetentionFilterResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + RumRetentionFiltersHardcodedApi apiInstance = + new RumRetentionFiltersHardcodedApi(defaultClient); + + try { + RumHardcodedRetentionFilterResponse result = + apiInstance.getHardcodedRetentionFilter( + "Example-RUM-Retention-Filters-Hardcoded", "Example-RUM-Retention-Filters-Hardcoded"); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling RumRetentionFiltersHardcodedApi#getHardcodedRetentionFilter"); + 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-hardcoded/ListHardcodedRetentionFilters.java b/examples/v2/rum-retention-filters-hardcoded/ListHardcodedRetentionFilters.java new file mode 100644 index 00000000000..a00d6d4946f --- /dev/null +++ b/examples/v2/rum-retention-filters-hardcoded/ListHardcodedRetentionFilters.java @@ -0,0 +1,27 @@ +// Get all hardcoded retention filters returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.RumRetentionFiltersHardcodedApi; +import com.datadog.api.client.v2.model.RumHardcodedRetentionFiltersResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + RumRetentionFiltersHardcodedApi apiInstance = + new RumRetentionFiltersHardcodedApi(defaultClient); + + try { + RumHardcodedRetentionFiltersResponse result = + apiInstance.listHardcodedRetentionFilters("Example-RUM-Retention-Filters-Hardcoded"); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling RumRetentionFiltersHardcodedApi#listHardcodedRetentionFilters"); + 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-hardcoded/UpdateHardcodedRetentionFilter.java b/examples/v2/rum-retention-filters-hardcoded/UpdateHardcodedRetentionFilter.java new file mode 100644 index 00000000000..56decccf2ce --- /dev/null +++ b/examples/v2/rum-retention-filters-hardcoded/UpdateHardcodedRetentionFilter.java @@ -0,0 +1,48 @@ +// Update a hardcoded retention filter returns "Updated" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.RumRetentionFiltersHardcodedApi; +import com.datadog.api.client.v2.model.RumHardcodedCrossProductSamplingUpdate; +import com.datadog.api.client.v2.model.RumHardcodedRetentionFilterResponse; +import com.datadog.api.client.v2.model.RumHardcodedRetentionFilterType; +import com.datadog.api.client.v2.model.RumHardcodedRetentionFilterUpdateAttributes; +import com.datadog.api.client.v2.model.RumHardcodedRetentionFilterUpdateData; +import com.datadog.api.client.v2.model.RumHardcodedRetentionFilterUpdateRequest; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + RumRetentionFiltersHardcodedApi apiInstance = + new RumRetentionFiltersHardcodedApi(defaultClient); + + RumHardcodedRetentionFilterUpdateRequest body = + new RumHardcodedRetentionFilterUpdateRequest() + .data( + new RumHardcodedRetentionFilterUpdateData() + .id("REPLACE.ME") + .type(RumHardcodedRetentionFilterType.HARDCODED_RETENTION_FILTERS) + .attributes( + new RumHardcodedRetentionFilterUpdateAttributes() + .crossProductSampling( + new RumHardcodedCrossProductSamplingUpdate() + .sessionReplaySampleRate(50.0) + .sessionReplayEnabled(true)))); + + try { + RumHardcodedRetentionFilterResponse result = + apiInstance.updateHardcodedRetentionFilter( + "Example-RUM-Retention-Filters-Hardcoded", + "Example-RUM-Retention-Filters-Hardcoded", + body); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling RumRetentionFiltersHardcodedApi#updateHardcodedRetentionFilter"); + 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/RumRetentionFiltersHardcodedApi.java b/src/main/java/com/datadog/api/client/v2/api/RumRetentionFiltersHardcodedApi.java new file mode 100644 index 00000000000..f7f08539012 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/api/RumRetentionFiltersHardcodedApi.java @@ -0,0 +1,543 @@ +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.RumHardcodedRetentionFilterResponse; +import com.datadog.api.client.v2.model.RumHardcodedRetentionFilterUpdateRequest; +import com.datadog.api.client.v2.model.RumHardcodedRetentionFiltersResponse; +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 RumRetentionFiltersHardcodedApi { + private ApiClient apiClient; + + public RumRetentionFiltersHardcodedApi() { + this(ApiClient.getDefaultApiClient()); + } + + public RumRetentionFiltersHardcodedApi(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 hardcoded retention filter. + * + *

See {@link #getHardcodedRetentionFilterWithHttpInfo}. + * + * @param appId RUM application ID. (required) + * @param rfId Hardcoded retention filter ID. (required) + * @return RumHardcodedRetentionFilterResponse + * @throws ApiException if fails to make API call + */ + public RumHardcodedRetentionFilterResponse getHardcodedRetentionFilter(String appId, String rfId) + throws ApiException { + return getHardcodedRetentionFilterWithHttpInfo(appId, rfId).getData(); + } + + /** + * Get a hardcoded retention filter. + * + *

See {@link #getHardcodedRetentionFilterWithHttpInfoAsync}. + * + * @param appId RUM application ID. (required) + * @param rfId Hardcoded retention filter ID. (required) + * @return CompletableFuture<RumHardcodedRetentionFilterResponse> + */ + public CompletableFuture getHardcodedRetentionFilterAsync( + String appId, String rfId) { + return getHardcodedRetentionFilterWithHttpInfoAsync(appId, rfId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get a single hardcoded retention filter for a RUM application. + * + * @param appId RUM application ID. (required) + * @param rfId Hardcoded retention filter ID. (required) + * @return ApiResponse<RumHardcodedRetentionFilterResponse> + * @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 getHardcodedRetentionFilterWithHttpInfo( + 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 getHardcodedRetentionFilter"); + } + + // verify the required parameter 'rfId' is set + if (rfId == null) { + throw new ApiException( + 400, "Missing the required parameter 'rfId' when calling getHardcodedRetentionFilter"); + } + // create path and map variables + String localVarPath = + "/api/v2/rum/applications/{app_id}/hardcoded_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.RumRetentionFiltersHardcodedApi.getHardcodedRetentionFilter", + 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 hardcoded retention filter. + * + *

See {@link #getHardcodedRetentionFilterWithHttpInfo}. + * + * @param appId RUM application ID. (required) + * @param rfId Hardcoded retention filter ID. (required) + * @return CompletableFuture<ApiResponse<RumHardcodedRetentionFilterResponse>> + */ + public CompletableFuture> + getHardcodedRetentionFilterWithHttpInfoAsync(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 getHardcodedRetentionFilter")); + 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 getHardcodedRetentionFilter")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/rum/applications/{app_id}/hardcoded_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.RumRetentionFiltersHardcodedApi.getHardcodedRetentionFilter", + 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 hardcoded retention filters. + * + *

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

See {@link #listHardcodedRetentionFiltersWithHttpInfoAsync}. + * + * @param appId RUM application ID. (required) + * @return CompletableFuture<RumHardcodedRetentionFiltersResponse> + */ + public CompletableFuture listHardcodedRetentionFiltersAsync( + String appId) { + return listHardcodedRetentionFiltersWithHttpInfoAsync(appId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get the list of hardcoded retention filters for a RUM application. + * + * @param appId RUM application ID. (required) + * @return ApiResponse<RumHardcodedRetentionFiltersResponse> + * @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 + listHardcodedRetentionFiltersWithHttpInfo(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 listHardcodedRetentionFilters"); + } + // create path and map variables + String localVarPath = + "/api/v2/rum/applications/{app_id}/hardcoded_retention_filters" + .replaceAll("\\{" + "app_id" + "\\}", apiClient.escapeString(appId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.RumRetentionFiltersHardcodedApi.listHardcodedRetentionFilters", + 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 hardcoded retention filters. + * + *

See {@link #listHardcodedRetentionFiltersWithHttpInfo}. + * + * @param appId RUM application ID. (required) + * @return CompletableFuture<ApiResponse<RumHardcodedRetentionFiltersResponse>> + */ + public CompletableFuture> + listHardcodedRetentionFiltersWithHttpInfoAsync(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 listHardcodedRetentionFilters")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/rum/applications/{app_id}/hardcoded_retention_filters" + .replaceAll("\\{" + "app_id" + "\\}", apiClient.escapeString(appId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.RumRetentionFiltersHardcodedApi.listHardcodedRetentionFilters", + 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 hardcoded retention filter. + * + *

See {@link #updateHardcodedRetentionFilterWithHttpInfo}. + * + * @param appId RUM application ID. (required) + * @param rfId Hardcoded retention filter ID. (required) + * @param body New cross-product sample rates for the hardcoded retention filter. (required) + * @return RumHardcodedRetentionFilterResponse + * @throws ApiException if fails to make API call + */ + public RumHardcodedRetentionFilterResponse updateHardcodedRetentionFilter( + String appId, String rfId, RumHardcodedRetentionFilterUpdateRequest body) + throws ApiException { + return updateHardcodedRetentionFilterWithHttpInfo(appId, rfId, body).getData(); + } + + /** + * Update a hardcoded retention filter. + * + *

See {@link #updateHardcodedRetentionFilterWithHttpInfoAsync}. + * + * @param appId RUM application ID. (required) + * @param rfId Hardcoded retention filter ID. (required) + * @param body New cross-product sample rates for the hardcoded retention filter. (required) + * @return CompletableFuture<RumHardcodedRetentionFilterResponse> + */ + public CompletableFuture updateHardcodedRetentionFilterAsync( + String appId, String rfId, RumHardcodedRetentionFilterUpdateRequest body) { + return updateHardcodedRetentionFilterWithHttpInfoAsync(appId, rfId, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Update the cross-product sample rates of a hardcoded retention filter for a RUM application. + * Only fields whose matching flag in cross_product_sampling_editability is + * true can be updated. Any other field is read-only and cannot be sent in the payload. + * Returns the updated hardcoded retention filter when the request is successful. + * + * @param appId RUM application ID. (required) + * @param rfId Hardcoded retention filter ID. (required) + * @param body New cross-product sample rates for the hardcoded retention filter. (required) + * @return ApiResponse<RumHardcodedRetentionFilterResponse> + * @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 + updateHardcodedRetentionFilterWithHttpInfo( + String appId, String rfId, RumHardcodedRetentionFilterUpdateRequest 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 updateHardcodedRetentionFilter"); + } + + // verify the required parameter 'rfId' is set + if (rfId == null) { + throw new ApiException( + 400, "Missing the required parameter 'rfId' when calling updateHardcodedRetentionFilter"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling updateHardcodedRetentionFilter"); + } + // create path and map variables + String localVarPath = + "/api/v2/rum/applications/{app_id}/hardcoded_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.RumRetentionFiltersHardcodedApi.updateHardcodedRetentionFilter", + 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 hardcoded retention filter. + * + *

See {@link #updateHardcodedRetentionFilterWithHttpInfo}. + * + * @param appId RUM application ID. (required) + * @param rfId Hardcoded retention filter ID. (required) + * @param body New cross-product sample rates for the hardcoded retention filter. (required) + * @return CompletableFuture<ApiResponse<RumHardcodedRetentionFilterResponse>> + */ + public CompletableFuture> + updateHardcodedRetentionFilterWithHttpInfoAsync( + String appId, String rfId, RumHardcodedRetentionFilterUpdateRequest 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" + + " updateHardcodedRetentionFilter")); + 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 updateHardcodedRetentionFilter")); + 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 updateHardcodedRetentionFilter")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/rum/applications/{app_id}/hardcoded_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.RumRetentionFiltersHardcodedApi.updateHardcodedRetentionFilter", + 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/RumHardcodedCrossProductSampling.java b/src/main/java/com/datadog/api/client/v2/model/RumHardcodedCrossProductSampling.java new file mode 100644 index 00000000000..858a8e314ef --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumHardcodedCrossProductSampling.java @@ -0,0 +1,234 @@ +/* + * 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 hardcoded retention filter. */ +@JsonPropertyOrder({ + RumHardcodedCrossProductSampling.JSON_PROPERTY_SESSION_REPLAY_ENABLED, + RumHardcodedCrossProductSampling.JSON_PROPERTY_SESSION_REPLAY_SAMPLE_RATE, + RumHardcodedCrossProductSampling.JSON_PROPERTY_TRACE_ENABLED, + RumHardcodedCrossProductSampling.JSON_PROPERTY_TRACE_SAMPLE_RATE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RumHardcodedCrossProductSampling { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_SESSION_REPLAY_ENABLED = "session_replay_enabled"; + private Boolean sessionReplayEnabled; + + public static final String JSON_PROPERTY_SESSION_REPLAY_SAMPLE_RATE = + "session_replay_sample_rate"; + private Double sessionReplaySampleRate; + + 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 RumHardcodedCrossProductSampling sessionReplayEnabled(Boolean sessionReplayEnabled) { + this.sessionReplayEnabled = sessionReplayEnabled; + return this; + } + + /** + * Indicates whether Session Replay cross-product retention is active. + * + * @return sessionReplayEnabled + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SESSION_REPLAY_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSessionReplayEnabled() { + return sessionReplayEnabled; + } + + public void setSessionReplayEnabled(Boolean sessionReplayEnabled) { + this.sessionReplayEnabled = sessionReplayEnabled; + } + + public RumHardcodedCrossProductSampling sessionReplaySampleRate(Double sessionReplaySampleRate) { + this.sessionReplaySampleRate = sessionReplaySampleRate; + return this; + } + + /** + * Percentage (0–100) of retained sessions with an ingested replay whose replay data is kept. + * minimum: 0 maximum: 100 + * + * @return sessionReplaySampleRate + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SESSION_REPLAY_SAMPLE_RATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getSessionReplaySampleRate() { + return sessionReplaySampleRate; + } + + public void setSessionReplaySampleRate(Double sessionReplaySampleRate) { + this.sessionReplaySampleRate = sessionReplaySampleRate; + } + + public RumHardcodedCrossProductSampling traceEnabled(Boolean traceEnabled) { + this.traceEnabled = traceEnabled; + return this; + } + + /** + * Indicates whether Trace cross-product retention is active. + * + * @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 RumHardcodedCrossProductSampling 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 RumHardcodedCrossProductSampling + */ + @JsonAnySetter + public RumHardcodedCrossProductSampling 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 RumHardcodedCrossProductSampling object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RumHardcodedCrossProductSampling rumHardcodedCrossProductSampling = + (RumHardcodedCrossProductSampling) o; + return Objects.equals( + this.sessionReplayEnabled, rumHardcodedCrossProductSampling.sessionReplayEnabled) + && Objects.equals( + this.sessionReplaySampleRate, rumHardcodedCrossProductSampling.sessionReplaySampleRate) + && Objects.equals(this.traceEnabled, rumHardcodedCrossProductSampling.traceEnabled) + && Objects.equals(this.traceSampleRate, rumHardcodedCrossProductSampling.traceSampleRate) + && Objects.equals( + this.additionalProperties, rumHardcodedCrossProductSampling.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + sessionReplayEnabled, + sessionReplaySampleRate, + traceEnabled, + traceSampleRate, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RumHardcodedCrossProductSampling {\n"); + sb.append(" sessionReplayEnabled: ") + .append(toIndentedString(sessionReplayEnabled)) + .append("\n"); + sb.append(" sessionReplaySampleRate: ") + .append(toIndentedString(sessionReplaySampleRate)) + .append("\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/RumHardcodedCrossProductSamplingEditability.java b/src/main/java/com/datadog/api/client/v2/model/RumHardcodedCrossProductSamplingEditability.java new file mode 100644 index 00000000000..04e2511214a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumHardcodedCrossProductSamplingEditability.java @@ -0,0 +1,177 @@ +/* + * 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 fields can be updated. Read-only. */ +@JsonPropertyOrder({ + RumHardcodedCrossProductSamplingEditability.JSON_PROPERTY_SESSION_REPLAY_SAMPLE_RATE, + RumHardcodedCrossProductSamplingEditability.JSON_PROPERTY_TRACE_SAMPLE_RATE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RumHardcodedCrossProductSamplingEditability { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_SESSION_REPLAY_SAMPLE_RATE = + "session_replay_sample_rate"; + private Boolean sessionReplaySampleRate; + + public static final String JSON_PROPERTY_TRACE_SAMPLE_RATE = "trace_sample_rate"; + private Boolean traceSampleRate; + + public RumHardcodedCrossProductSamplingEditability sessionReplaySampleRate( + Boolean sessionReplaySampleRate) { + this.sessionReplaySampleRate = sessionReplaySampleRate; + return this; + } + + /** + * If true, cross_product_sampling.session_replay_sample_rate can be + * updated on this filter. + * + * @return sessionReplaySampleRate + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SESSION_REPLAY_SAMPLE_RATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSessionReplaySampleRate() { + return sessionReplaySampleRate; + } + + public void setSessionReplaySampleRate(Boolean sessionReplaySampleRate) { + this.sessionReplaySampleRate = sessionReplaySampleRate; + } + + public RumHardcodedCrossProductSamplingEditability 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 RumHardcodedCrossProductSamplingEditability + */ + @JsonAnySetter + public RumHardcodedCrossProductSamplingEditability 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 RumHardcodedCrossProductSamplingEditability object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RumHardcodedCrossProductSamplingEditability rumHardcodedCrossProductSamplingEditability = + (RumHardcodedCrossProductSamplingEditability) o; + return Objects.equals( + this.sessionReplaySampleRate, + rumHardcodedCrossProductSamplingEditability.sessionReplaySampleRate) + && Objects.equals( + this.traceSampleRate, rumHardcodedCrossProductSamplingEditability.traceSampleRate) + && Objects.equals( + this.additionalProperties, + rumHardcodedCrossProductSamplingEditability.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(sessionReplaySampleRate, traceSampleRate, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RumHardcodedCrossProductSamplingEditability {\n"); + sb.append(" sessionReplaySampleRate: ") + .append(toIndentedString(sessionReplaySampleRate)) + .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/RumHardcodedCrossProductSamplingUpdate.java b/src/main/java/com/datadog/api/client/v2/model/RumHardcodedCrossProductSamplingUpdate.java new file mode 100644 index 00000000000..5bac89da937 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumHardcodedCrossProductSamplingUpdate.java @@ -0,0 +1,241 @@ +/* + * 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 for cross-product retention of a hardcoded retention filter. Only fields whose + * matching flag in cross_product_sampling_editability is true can be + * updated. + */ +@JsonPropertyOrder({ + RumHardcodedCrossProductSamplingUpdate.JSON_PROPERTY_SESSION_REPLAY_ENABLED, + RumHardcodedCrossProductSamplingUpdate.JSON_PROPERTY_SESSION_REPLAY_SAMPLE_RATE, + RumHardcodedCrossProductSamplingUpdate.JSON_PROPERTY_TRACE_ENABLED, + RumHardcodedCrossProductSamplingUpdate.JSON_PROPERTY_TRACE_SAMPLE_RATE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RumHardcodedCrossProductSamplingUpdate { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_SESSION_REPLAY_ENABLED = "session_replay_enabled"; + private Boolean sessionReplayEnabled; + + public static final String JSON_PROPERTY_SESSION_REPLAY_SAMPLE_RATE = + "session_replay_sample_rate"; + private Double sessionReplaySampleRate; + + 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 RumHardcodedCrossProductSamplingUpdate sessionReplayEnabled(Boolean sessionReplayEnabled) { + this.sessionReplayEnabled = sessionReplayEnabled; + return this; + } + + /** + * Controls whether Session Replay cross-product retention is active. Omit to leave unchanged. + * + * @return sessionReplayEnabled + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SESSION_REPLAY_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSessionReplayEnabled() { + return sessionReplayEnabled; + } + + public void setSessionReplayEnabled(Boolean sessionReplayEnabled) { + this.sessionReplayEnabled = sessionReplayEnabled; + } + + public RumHardcodedCrossProductSamplingUpdate sessionReplaySampleRate( + Double sessionReplaySampleRate) { + this.sessionReplaySampleRate = sessionReplaySampleRate; + return this; + } + + /** + * Percentage (0–100) of retained sessions with an ingested replay whose replay data is kept. Omit + * to leave unchanged. minimum: 0 maximum: 100 + * + * @return sessionReplaySampleRate + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SESSION_REPLAY_SAMPLE_RATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getSessionReplaySampleRate() { + return sessionReplaySampleRate; + } + + public void setSessionReplaySampleRate(Double sessionReplaySampleRate) { + this.sessionReplaySampleRate = sessionReplaySampleRate; + } + + public RumHardcodedCrossProductSamplingUpdate traceEnabled(Boolean traceEnabled) { + this.traceEnabled = traceEnabled; + return this; + } + + /** + * Controls whether Trace cross-product retention is active. Omit to leave unchanged. + * + * @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 RumHardcodedCrossProductSamplingUpdate 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. 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 RumHardcodedCrossProductSamplingUpdate + */ + @JsonAnySetter + public RumHardcodedCrossProductSamplingUpdate 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 RumHardcodedCrossProductSamplingUpdate object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RumHardcodedCrossProductSamplingUpdate rumHardcodedCrossProductSamplingUpdate = + (RumHardcodedCrossProductSamplingUpdate) o; + return Objects.equals( + this.sessionReplayEnabled, rumHardcodedCrossProductSamplingUpdate.sessionReplayEnabled) + && Objects.equals( + this.sessionReplaySampleRate, + rumHardcodedCrossProductSamplingUpdate.sessionReplaySampleRate) + && Objects.equals(this.traceEnabled, rumHardcodedCrossProductSamplingUpdate.traceEnabled) + && Objects.equals( + this.traceSampleRate, rumHardcodedCrossProductSamplingUpdate.traceSampleRate) + && Objects.equals( + this.additionalProperties, rumHardcodedCrossProductSamplingUpdate.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + sessionReplayEnabled, + sessionReplaySampleRate, + traceEnabled, + traceSampleRate, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RumHardcodedCrossProductSamplingUpdate {\n"); + sb.append(" sessionReplayEnabled: ") + .append(toIndentedString(sessionReplayEnabled)) + .append("\n"); + sb.append(" sessionReplaySampleRate: ") + .append(toIndentedString(sessionReplaySampleRate)) + .append("\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/RumHardcodedRetentionFilterAttributes.java b/src/main/java/com/datadog/api/client/v2/model/RumHardcodedRetentionFilterAttributes.java new file mode 100644 index 00000000000..ef7c5550f4a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumHardcodedRetentionFilterAttributes.java @@ -0,0 +1,327 @@ +/* + * 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 hardcoded retention filter. */ +@JsonPropertyOrder({ + RumHardcodedRetentionFilterAttributes.JSON_PROPERTY_CROSS_PRODUCT_SAMPLING, + RumHardcodedRetentionFilterAttributes.JSON_PROPERTY_CROSS_PRODUCT_SAMPLING_EDITABILITY, + RumHardcodedRetentionFilterAttributes.JSON_PROPERTY_ENABLED, + RumHardcodedRetentionFilterAttributes.JSON_PROPERTY_EVENT_TYPE, + RumHardcodedRetentionFilterAttributes.JSON_PROPERTY_NAME, + RumHardcodedRetentionFilterAttributes.JSON_PROPERTY_QUERY, + RumHardcodedRetentionFilterAttributes.JSON_PROPERTY_SAMPLE_RATE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RumHardcodedRetentionFilterAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CROSS_PRODUCT_SAMPLING = "cross_product_sampling"; + private RumHardcodedCrossProductSampling crossProductSampling; + + public static final String JSON_PROPERTY_CROSS_PRODUCT_SAMPLING_EDITABILITY = + "cross_product_sampling_editability"; + private RumHardcodedCrossProductSamplingEditability crossProductSamplingEditability; + + public static final String JSON_PROPERTY_ENABLED = "enabled"; + private Boolean enabled; + + public static final String JSON_PROPERTY_EVENT_TYPE = "event_type"; + private RumHardcodedRetentionFilterEventType 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 RumHardcodedRetentionFilterAttributes crossProductSampling( + RumHardcodedCrossProductSampling crossProductSampling) { + this.crossProductSampling = crossProductSampling; + this.unparsed |= crossProductSampling.unparsed; + return this; + } + + /** + * Cross-product retention settings for a hardcoded retention filter. + * + * @return crossProductSampling + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CROSS_PRODUCT_SAMPLING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RumHardcodedCrossProductSampling getCrossProductSampling() { + return crossProductSampling; + } + + public void setCrossProductSampling(RumHardcodedCrossProductSampling crossProductSampling) { + this.crossProductSampling = crossProductSampling; + } + + public RumHardcodedRetentionFilterAttributes crossProductSamplingEditability( + RumHardcodedCrossProductSamplingEditability crossProductSamplingEditability) { + this.crossProductSamplingEditability = crossProductSamplingEditability; + this.unparsed |= crossProductSamplingEditability.unparsed; + return this; + } + + /** + * Flags indicating which cross_product_sampling fields can be updated. Read-only. + * + * @return crossProductSamplingEditability + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CROSS_PRODUCT_SAMPLING_EDITABILITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RumHardcodedCrossProductSamplingEditability getCrossProductSamplingEditability() { + return crossProductSamplingEditability; + } + + public void setCrossProductSamplingEditability( + RumHardcodedCrossProductSamplingEditability crossProductSamplingEditability) { + this.crossProductSamplingEditability = crossProductSamplingEditability; + } + + public RumHardcodedRetentionFilterAttributes enabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Indicates whether the hardcoded 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 RumHardcodedRetentionFilterAttributes eventType( + RumHardcodedRetentionFilterEventType eventType) { + this.eventType = eventType; + this.unparsed |= !eventType.isValid(); + return this; + } + + /** + * The type of RUM events the hardcoded filter applies to. Read-only. + * + * @return eventType + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EVENT_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RumHardcodedRetentionFilterEventType getEventType() { + return eventType; + } + + public void setEventType(RumHardcodedRetentionFilterEventType eventType) { + if (!eventType.isValid()) { + this.unparsed = true; + } + this.eventType = eventType; + } + + public RumHardcodedRetentionFilterAttributes name(String name) { + this.name = name; + return this; + } + + /** + * The name of the hardcoded 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 RumHardcodedRetentionFilterAttributes query(String query) { + this.query = query; + return this; + } + + /** + * The query string for the hardcoded 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 RumHardcodedRetentionFilterAttributes sampleRate(Double sampleRate) { + this.sampleRate = sampleRate; + return this; + } + + /** + * The retention sample rate (0–100) for the hardcoded filter. 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 RumHardcodedRetentionFilterAttributes + */ + @JsonAnySetter + public RumHardcodedRetentionFilterAttributes 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 RumHardcodedRetentionFilterAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RumHardcodedRetentionFilterAttributes rumHardcodedRetentionFilterAttributes = + (RumHardcodedRetentionFilterAttributes) o; + return Objects.equals( + this.crossProductSampling, rumHardcodedRetentionFilterAttributes.crossProductSampling) + && Objects.equals( + this.crossProductSamplingEditability, + rumHardcodedRetentionFilterAttributes.crossProductSamplingEditability) + && Objects.equals(this.enabled, rumHardcodedRetentionFilterAttributes.enabled) + && Objects.equals(this.eventType, rumHardcodedRetentionFilterAttributes.eventType) + && Objects.equals(this.name, rumHardcodedRetentionFilterAttributes.name) + && Objects.equals(this.query, rumHardcodedRetentionFilterAttributes.query) + && Objects.equals(this.sampleRate, rumHardcodedRetentionFilterAttributes.sampleRate) + && Objects.equals( + this.additionalProperties, rumHardcodedRetentionFilterAttributes.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 RumHardcodedRetentionFilterAttributes {\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/RumHardcodedRetentionFilterData.java b/src/main/java/com/datadog/api/client/v2/model/RumHardcodedRetentionFilterData.java new file mode 100644 index 00000000000..4c4aeff553e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumHardcodedRetentionFilterData.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 hardcoded retention filter. */ +@JsonPropertyOrder({ + RumHardcodedRetentionFilterData.JSON_PROPERTY_ATTRIBUTES, + RumHardcodedRetentionFilterData.JSON_PROPERTY_ID, + RumHardcodedRetentionFilterData.JSON_PROPERTY_META, + RumHardcodedRetentionFilterData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RumHardcodedRetentionFilterData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private RumHardcodedRetentionFilterAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_META = "meta"; + private RumHardcodedRetentionFilterMeta meta; + + public static final String JSON_PROPERTY_TYPE = "type"; + private RumHardcodedRetentionFilterType type = + RumHardcodedRetentionFilterType.HARDCODED_RETENTION_FILTERS; + + public RumHardcodedRetentionFilterData attributes( + RumHardcodedRetentionFilterAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * The attributes of a hardcoded retention filter. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RumHardcodedRetentionFilterAttributes getAttributes() { + return attributes; + } + + public void setAttributes(RumHardcodedRetentionFilterAttributes attributes) { + this.attributes = attributes; + } + + public RumHardcodedRetentionFilterData id(String id) { + this.id = id; + return this; + } + + /** + * The ID of the hardcoded retention filter. + * + * @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 RumHardcodedRetentionFilterData meta(RumHardcodedRetentionFilterMeta meta) { + this.meta = meta; + this.unparsed |= meta.unparsed; + return this; + } + + /** + * Metadata about the hardcoded retention filter. + * + * @return meta + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_META) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RumHardcodedRetentionFilterMeta getMeta() { + return meta; + } + + public void setMeta(RumHardcodedRetentionFilterMeta meta) { + this.meta = meta; + } + + public RumHardcodedRetentionFilterData type(RumHardcodedRetentionFilterType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The resource type. The value must be hardcoded_retention_filters. + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RumHardcodedRetentionFilterType getType() { + return type; + } + + public void setType(RumHardcodedRetentionFilterType 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 RumHardcodedRetentionFilterData + */ + @JsonAnySetter + public RumHardcodedRetentionFilterData 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 RumHardcodedRetentionFilterData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RumHardcodedRetentionFilterData rumHardcodedRetentionFilterData = + (RumHardcodedRetentionFilterData) o; + return Objects.equals(this.attributes, rumHardcodedRetentionFilterData.attributes) + && Objects.equals(this.id, rumHardcodedRetentionFilterData.id) + && Objects.equals(this.meta, rumHardcodedRetentionFilterData.meta) + && Objects.equals(this.type, rumHardcodedRetentionFilterData.type) + && Objects.equals( + this.additionalProperties, rumHardcodedRetentionFilterData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, meta, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RumHardcodedRetentionFilterData {\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/RumHardcodedRetentionFilterEventType.java b/src/main/java/com/datadog/api/client/v2/model/RumHardcodedRetentionFilterEventType.java new file mode 100644 index 00000000000..495ea8d3abd --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumHardcodedRetentionFilterEventType.java @@ -0,0 +1,73 @@ +/* + * 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 hardcoded filter applies to. Read-only. */ +@JsonSerialize( + using = + RumHardcodedRetentionFilterEventType.RumHardcodedRetentionFilterEventTypeSerializer.class) +public class RumHardcodedRetentionFilterEventType extends ModelEnum { + + private static final Set allowedValues = + new HashSet( + Arrays.asList("session", "view", "action", "error", "resource", "long_task", "vital")); + + public static final RumHardcodedRetentionFilterEventType SESSION = + new RumHardcodedRetentionFilterEventType("session"); + public static final RumHardcodedRetentionFilterEventType VIEW = + new RumHardcodedRetentionFilterEventType("view"); + public static final RumHardcodedRetentionFilterEventType ACTION = + new RumHardcodedRetentionFilterEventType("action"); + public static final RumHardcodedRetentionFilterEventType ERROR = + new RumHardcodedRetentionFilterEventType("error"); + public static final RumHardcodedRetentionFilterEventType RESOURCE = + new RumHardcodedRetentionFilterEventType("resource"); + public static final RumHardcodedRetentionFilterEventType LONG_TASK = + new RumHardcodedRetentionFilterEventType("long_task"); + public static final RumHardcodedRetentionFilterEventType VITAL = + new RumHardcodedRetentionFilterEventType("vital"); + + RumHardcodedRetentionFilterEventType(String value) { + super(value, allowedValues); + } + + public static class RumHardcodedRetentionFilterEventTypeSerializer + extends StdSerializer { + public RumHardcodedRetentionFilterEventTypeSerializer( + Class t) { + super(t); + } + + public RumHardcodedRetentionFilterEventTypeSerializer() { + this(null); + } + + @Override + public void serialize( + RumHardcodedRetentionFilterEventType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static RumHardcodedRetentionFilterEventType fromValue(String value) { + return new RumHardcodedRetentionFilterEventType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RumHardcodedRetentionFilterMeta.java b/src/main/java/com/datadog/api/client/v2/model/RumHardcodedRetentionFilterMeta.java new file mode 100644 index 00000000000..549a54f3a69 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumHardcodedRetentionFilterMeta.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 hardcoded retention filter. */ +@JsonPropertyOrder({ + RumHardcodedRetentionFilterMeta.JSON_PROPERTY_SOURCE, + RumHardcodedRetentionFilterMeta.JSON_PROPERTY_UPDATED_AT, + RumHardcodedRetentionFilterMeta.JSON_PROPERTY_UPDATED_BY_HANDLE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RumHardcodedRetentionFilterMeta { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_SOURCE = "source"; + private RumHardcodedRetentionFilterMetaSource 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 RumHardcodedRetentionFilterMeta source(RumHardcodedRetentionFilterMetaSource source) { + this.source = source; + this.unparsed |= !source.isValid(); + return this; + } + + /** + * The source of the last update to a hardcoded retention filter. + * + * @return source + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SOURCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RumHardcodedRetentionFilterMetaSource getSource() { + return source; + } + + public void setSource(RumHardcodedRetentionFilterMetaSource source) { + if (!source.isValid()) { + this.unparsed = true; + } + this.source = source; + } + + public RumHardcodedRetentionFilterMeta 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 RumHardcodedRetentionFilterMeta 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 RumHardcodedRetentionFilterMeta + */ + @JsonAnySetter + public RumHardcodedRetentionFilterMeta 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 RumHardcodedRetentionFilterMeta object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RumHardcodedRetentionFilterMeta rumHardcodedRetentionFilterMeta = + (RumHardcodedRetentionFilterMeta) o; + return Objects.equals(this.source, rumHardcodedRetentionFilterMeta.source) + && Objects.equals(this.updatedAt, rumHardcodedRetentionFilterMeta.updatedAt) + && Objects.equals(this.updatedByHandle, rumHardcodedRetentionFilterMeta.updatedByHandle) + && Objects.equals( + this.additionalProperties, rumHardcodedRetentionFilterMeta.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(source, updatedAt, updatedByHandle, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RumHardcodedRetentionFilterMeta {\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/RumHardcodedRetentionFilterMetaSource.java b/src/main/java/com/datadog/api/client/v2/model/RumHardcodedRetentionFilterMetaSource.java new file mode 100644 index 00000000000..7d165c4427b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumHardcodedRetentionFilterMetaSource.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 hardcoded retention filter. */ +@JsonSerialize( + using = + RumHardcodedRetentionFilterMetaSource.RumHardcodedRetentionFilterMetaSourceSerializer.class) +public class RumHardcodedRetentionFilterMetaSource extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("default", "ui", "terraform")); + + public static final RumHardcodedRetentionFilterMetaSource DEFAULT = + new RumHardcodedRetentionFilterMetaSource("default"); + public static final RumHardcodedRetentionFilterMetaSource UI = + new RumHardcodedRetentionFilterMetaSource("ui"); + public static final RumHardcodedRetentionFilterMetaSource TERRAFORM = + new RumHardcodedRetentionFilterMetaSource("terraform"); + + RumHardcodedRetentionFilterMetaSource(String value) { + super(value, allowedValues); + } + + public static class RumHardcodedRetentionFilterMetaSourceSerializer + extends StdSerializer { + public RumHardcodedRetentionFilterMetaSourceSerializer( + Class t) { + super(t); + } + + public RumHardcodedRetentionFilterMetaSourceSerializer() { + this(null); + } + + @Override + public void serialize( + RumHardcodedRetentionFilterMetaSource value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static RumHardcodedRetentionFilterMetaSource fromValue(String value) { + return new RumHardcodedRetentionFilterMetaSource(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RumHardcodedRetentionFilterResponse.java b/src/main/java/com/datadog/api/client/v2/model/RumHardcodedRetentionFilterResponse.java new file mode 100644 index 00000000000..b7dcb3004a4 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumHardcodedRetentionFilterResponse.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 hardcoded retention filter response body. */ +@JsonPropertyOrder({RumHardcodedRetentionFilterResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RumHardcodedRetentionFilterResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private RumHardcodedRetentionFilterData data; + + public RumHardcodedRetentionFilterResponse data(RumHardcodedRetentionFilterData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * A hardcoded retention filter. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RumHardcodedRetentionFilterData getData() { + return data; + } + + public void setData(RumHardcodedRetentionFilterData 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 RumHardcodedRetentionFilterResponse + */ + @JsonAnySetter + public RumHardcodedRetentionFilterResponse 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 RumHardcodedRetentionFilterResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RumHardcodedRetentionFilterResponse rumHardcodedRetentionFilterResponse = + (RumHardcodedRetentionFilterResponse) o; + return Objects.equals(this.data, rumHardcodedRetentionFilterResponse.data) + && Objects.equals( + this.additionalProperties, rumHardcodedRetentionFilterResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RumHardcodedRetentionFilterResponse {\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/RumHardcodedRetentionFilterType.java b/src/main/java/com/datadog/api/client/v2/model/RumHardcodedRetentionFilterType.java new file mode 100644 index 00000000000..699e6960d2c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumHardcodedRetentionFilterType.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 hardcoded_retention_filters. */ +@JsonSerialize( + using = RumHardcodedRetentionFilterType.RumHardcodedRetentionFilterTypeSerializer.class) +public class RumHardcodedRetentionFilterType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("hardcoded_retention_filters")); + + public static final RumHardcodedRetentionFilterType HARDCODED_RETENTION_FILTERS = + new RumHardcodedRetentionFilterType("hardcoded_retention_filters"); + + RumHardcodedRetentionFilterType(String value) { + super(value, allowedValues); + } + + public static class RumHardcodedRetentionFilterTypeSerializer + extends StdSerializer { + public RumHardcodedRetentionFilterTypeSerializer(Class t) { + super(t); + } + + public RumHardcodedRetentionFilterTypeSerializer() { + this(null); + } + + @Override + public void serialize( + RumHardcodedRetentionFilterType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static RumHardcodedRetentionFilterType fromValue(String value) { + return new RumHardcodedRetentionFilterType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RumHardcodedRetentionFilterUpdateAttributes.java b/src/main/java/com/datadog/api/client/v2/model/RumHardcodedRetentionFilterUpdateAttributes.java new file mode 100644 index 00000000000..66fdf46be49 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumHardcodedRetentionFilterUpdateAttributes.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.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * The attributes of a hardcoded retention filter that can be updated. Only fields whose matching + * flag in cross_product_sampling_editability is true can be modified. + */ +@JsonPropertyOrder({ + RumHardcodedRetentionFilterUpdateAttributes.JSON_PROPERTY_CROSS_PRODUCT_SAMPLING +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RumHardcodedRetentionFilterUpdateAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CROSS_PRODUCT_SAMPLING = "cross_product_sampling"; + private RumHardcodedCrossProductSamplingUpdate crossProductSampling; + + public RumHardcodedRetentionFilterUpdateAttributes crossProductSampling( + RumHardcodedCrossProductSamplingUpdate crossProductSampling) { + this.crossProductSampling = crossProductSampling; + this.unparsed |= crossProductSampling.unparsed; + return this; + } + + /** + * Partial update for cross-product retention of a hardcoded retention filter. Only fields whose + * matching flag in cross_product_sampling_editability is true can be + * updated. + * + * @return crossProductSampling + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CROSS_PRODUCT_SAMPLING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RumHardcodedCrossProductSamplingUpdate getCrossProductSampling() { + return crossProductSampling; + } + + public void setCrossProductSampling(RumHardcodedCrossProductSamplingUpdate 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 RumHardcodedRetentionFilterUpdateAttributes + */ + @JsonAnySetter + public RumHardcodedRetentionFilterUpdateAttributes 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 RumHardcodedRetentionFilterUpdateAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RumHardcodedRetentionFilterUpdateAttributes rumHardcodedRetentionFilterUpdateAttributes = + (RumHardcodedRetentionFilterUpdateAttributes) o; + return Objects.equals( + this.crossProductSampling, + rumHardcodedRetentionFilterUpdateAttributes.crossProductSampling) + && Objects.equals( + this.additionalProperties, + rumHardcodedRetentionFilterUpdateAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(crossProductSampling, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RumHardcodedRetentionFilterUpdateAttributes {\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/RumHardcodedRetentionFilterUpdateData.java b/src/main/java/com/datadog/api/client/v2/model/RumHardcodedRetentionFilterUpdateData.java new file mode 100644 index 00000000000..5bb8b6bbf30 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumHardcodedRetentionFilterUpdateData.java @@ -0,0 +1,215 @@ +/* + * 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 hardcoded retention filter properties to update. */ +@JsonPropertyOrder({ + RumHardcodedRetentionFilterUpdateData.JSON_PROPERTY_ATTRIBUTES, + RumHardcodedRetentionFilterUpdateData.JSON_PROPERTY_ID, + RumHardcodedRetentionFilterUpdateData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RumHardcodedRetentionFilterUpdateData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private RumHardcodedRetentionFilterUpdateAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private RumHardcodedRetentionFilterType type = + RumHardcodedRetentionFilterType.HARDCODED_RETENTION_FILTERS; + + public RumHardcodedRetentionFilterUpdateData() {} + + @JsonCreator + public RumHardcodedRetentionFilterUpdateData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + RumHardcodedRetentionFilterUpdateAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + RumHardcodedRetentionFilterType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public RumHardcodedRetentionFilterUpdateData attributes( + RumHardcodedRetentionFilterUpdateAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * The attributes of a hardcoded retention filter that can be updated. Only fields whose matching + * flag in cross_product_sampling_editability is true can be modified. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public RumHardcodedRetentionFilterUpdateAttributes getAttributes() { + return attributes; + } + + public void setAttributes(RumHardcodedRetentionFilterUpdateAttributes attributes) { + this.attributes = attributes; + } + + public RumHardcodedRetentionFilterUpdateData id(String id) { + this.id = id; + return this; + } + + /** + * The ID of the hardcoded retention filter. Must match the rf_id path parameter. + * + * @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 RumHardcodedRetentionFilterUpdateData type(RumHardcodedRetentionFilterType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The resource type. The value must be hardcoded_retention_filters. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public RumHardcodedRetentionFilterType getType() { + return type; + } + + public void setType(RumHardcodedRetentionFilterType 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 RumHardcodedRetentionFilterUpdateData + */ + @JsonAnySetter + public RumHardcodedRetentionFilterUpdateData 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 RumHardcodedRetentionFilterUpdateData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RumHardcodedRetentionFilterUpdateData rumHardcodedRetentionFilterUpdateData = + (RumHardcodedRetentionFilterUpdateData) o; + return Objects.equals(this.attributes, rumHardcodedRetentionFilterUpdateData.attributes) + && Objects.equals(this.id, rumHardcodedRetentionFilterUpdateData.id) + && Objects.equals(this.type, rumHardcodedRetentionFilterUpdateData.type) + && Objects.equals( + this.additionalProperties, rumHardcodedRetentionFilterUpdateData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RumHardcodedRetentionFilterUpdateData {\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/RumHardcodedRetentionFilterUpdateRequest.java b/src/main/java/com/datadog/api/client/v2/model/RumHardcodedRetentionFilterUpdateRequest.java new file mode 100644 index 00000000000..a9246662378 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumHardcodedRetentionFilterUpdateRequest.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 hardcoded retention filter body to update. */ +@JsonPropertyOrder({RumHardcodedRetentionFilterUpdateRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RumHardcodedRetentionFilterUpdateRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private RumHardcodedRetentionFilterUpdateData data; + + public RumHardcodedRetentionFilterUpdateRequest() {} + + @JsonCreator + public RumHardcodedRetentionFilterUpdateRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + RumHardcodedRetentionFilterUpdateData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public RumHardcodedRetentionFilterUpdateRequest data(RumHardcodedRetentionFilterUpdateData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * The hardcoded retention filter properties to update. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public RumHardcodedRetentionFilterUpdateData getData() { + return data; + } + + public void setData(RumHardcodedRetentionFilterUpdateData 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 RumHardcodedRetentionFilterUpdateRequest + */ + @JsonAnySetter + public RumHardcodedRetentionFilterUpdateRequest 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 RumHardcodedRetentionFilterUpdateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RumHardcodedRetentionFilterUpdateRequest rumHardcodedRetentionFilterUpdateRequest = + (RumHardcodedRetentionFilterUpdateRequest) o; + return Objects.equals(this.data, rumHardcodedRetentionFilterUpdateRequest.data) + && Objects.equals( + this.additionalProperties, + rumHardcodedRetentionFilterUpdateRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RumHardcodedRetentionFilterUpdateRequest {\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/RumHardcodedRetentionFiltersResponse.java b/src/main/java/com/datadog/api/client/v2/model/RumHardcodedRetentionFiltersResponse.java new file mode 100644 index 00000000000..dcbc2ec8f0c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumHardcodedRetentionFiltersResponse.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 hardcoded retention filters for a RUM application. */ +@JsonPropertyOrder({RumHardcodedRetentionFiltersResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RumHardcodedRetentionFiltersResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = null; + + public RumHardcodedRetentionFiltersResponse data(List data) { + this.data = data; + for (RumHardcodedRetentionFilterData item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public RumHardcodedRetentionFiltersResponse addDataItem( + RumHardcodedRetentionFilterData dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * A list of hardcoded 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 RumHardcodedRetentionFiltersResponse + */ + @JsonAnySetter + public RumHardcodedRetentionFiltersResponse 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 RumHardcodedRetentionFiltersResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RumHardcodedRetentionFiltersResponse rumHardcodedRetentionFiltersResponse = + (RumHardcodedRetentionFiltersResponse) o; + return Objects.equals(this.data, rumHardcodedRetentionFiltersResponse.data) + && Objects.equals( + this.additionalProperties, rumHardcodedRetentionFiltersResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RumHardcodedRetentionFiltersResponse {\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/com/datadog/api/client/v2/api/rum_hardcoded_retention_filters.feature b/src/test/resources/com/datadog/api/client/v2/api/rum_hardcoded_retention_filters.feature new file mode 100644 index 00000000000..05e942989bf --- /dev/null +++ b/src/test/resources/com/datadog/api/client/v2/api/rum_hardcoded_retention_filters.feature @@ -0,0 +1,59 @@ +@endpoint(rum-hardcoded-retention-filters) @endpoint(rum-hardcoded-retention-filters-v2) +Feature: RUM Retention Filters Hardcoded + Manage hardcoded retention filters through [Manage + Applications](https://app.datadoghq.com/rum/list) in RUM. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "RUMRetentionFiltersHardcoded" API + + @generated @skip @team:DataDog/rum-backend + Scenario: Get a hardcoded retention filter returns "Not Found" response + Given new "GetHardcodedRetentionFilter" request + And request contains "app_id" parameter with value "{{ unique }}" + And request contains "rf_id" parameter with value "{{ unique }}" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/rum-backend + Scenario: Get a hardcoded retention filter returns "OK" response + Given new "GetHardcodedRetentionFilter" request + And request contains "app_id" parameter with value "{{ unique }}" + And request contains "rf_id" parameter with value "{{ unique }}" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/rum-backend + Scenario: Get all hardcoded retention filters returns "OK" response + Given new "ListHardcodedRetentionFilters" request + And request contains "app_id" parameter with value "{{ unique }}" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/rum-backend + Scenario: Update a hardcoded retention filter returns "Bad Request" response + Given new "UpdateHardcodedRetentionFilter" request + And request contains "app_id" parameter with value "{{ unique }}" + And request contains "rf_id" parameter with value "{{ unique }}" + And body with value {"data": {"id": "REPLACE.ME", "type": "hardcoded_retention_filters", "attributes": {"cross_product_sampling": {"session_replay_sample_rate": 50.0}}}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/rum-backend + Scenario: Update a hardcoded retention filter returns "Not Found" response + Given new "UpdateHardcodedRetentionFilter" request + And request contains "app_id" parameter with value "{{ unique }}" + And request contains "rf_id" parameter with value "{{ unique }}" + And body with value {"data": {"id": "REPLACE.ME", "type": "hardcoded_retention_filters", "attributes": {"cross_product_sampling": {"session_replay_sample_rate": 50.0}}}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/rum-backend + Scenario: Update a hardcoded retention filter returns "Updated" response + Given new "UpdateHardcodedRetentionFilter" request + And request contains "app_id" parameter with value "{{ unique }}" + And request contains "rf_id" parameter with value "{{ unique }}" + And body with value {"data": {"id": "REPLACE.ME", "type": "hardcoded_retention_filters", "attributes": {"cross_product_sampling": {"session_replay_sample_rate": 50.0, "session_replay_enabled": true}}}} + When the request is sent + Then the response status is 200 OK diff --git a/src/test/resources/com/datadog/api/client/v2/api/rum_retention_filters_hardcoded.feature b/src/test/resources/com/datadog/api/client/v2/api/rum_retention_filters_hardcoded.feature new file mode 100644 index 00000000000..2ce25e7a3a3 --- /dev/null +++ b/src/test/resources/com/datadog/api/client/v2/api/rum_retention_filters_hardcoded.feature @@ -0,0 +1,59 @@ +@endpoint(rum-retention-filters-hardcoded) @endpoint(rum-retention-filters-hardcoded-v2) +Feature: RUM Retention Filters Hardcoded + Manage hardcoded retention filters through [Manage + Applications](https://app.datadoghq.com/rum/list) in RUM. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "RUMRetentionFiltersHardcoded" API + + @generated @skip @team:DataDog/rum-backend + Scenario: Get a hardcoded retention filter returns "Not Found" response + Given new "GetHardcodedRetentionFilter" request + And request contains "app_id" parameter from "REPLACE.ME" + And request contains "rf_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/rum-backend + Scenario: Get a hardcoded retention filter returns "OK" response + Given new "GetHardcodedRetentionFilter" request + And request contains "app_id" parameter from "REPLACE.ME" + And request contains "rf_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/rum-backend + Scenario: Get all hardcoded retention filters returns "OK" response + Given new "ListHardcodedRetentionFilters" request + And request contains "app_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/rum-backend + Scenario: Update a hardcoded retention filter returns "Bad Request" response + Given new "UpdateHardcodedRetentionFilter" request + And request contains "app_id" parameter from "REPLACE.ME" + And request contains "rf_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"cross_product_sampling": {"session_replay_enabled": true, "session_replay_sample_rate": 50.0, "trace_enabled": true, "trace_sample_rate": 25.0}}, "id": "forced_replay_sessions", "type": "hardcoded_retention_filters"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/rum-backend + Scenario: Update a hardcoded retention filter returns "Not Found" response + Given new "UpdateHardcodedRetentionFilter" request + And request contains "app_id" parameter from "REPLACE.ME" + And request contains "rf_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"cross_product_sampling": {"session_replay_enabled": true, "session_replay_sample_rate": 50.0, "trace_enabled": true, "trace_sample_rate": 25.0}}, "id": "forced_replay_sessions", "type": "hardcoded_retention_filters"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/rum-backend + Scenario: Update a hardcoded retention filter returns "Updated" response + Given new "UpdateHardcodedRetentionFilter" request + And request contains "app_id" parameter from "REPLACE.ME" + And request contains "rf_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"cross_product_sampling": {"session_replay_enabled": true, "session_replay_sample_rate": 50.0, "trace_enabled": true, "trace_sample_rate": 25.0}}, "id": "forced_replay_sessions", "type": "hardcoded_retention_filters"}} + When the request is sent + Then the response status is 200 Updated diff --git a/src/test/resources/com/datadog/api/client/v2/api/undo.json b/src/test/resources/com/datadog/api/client/v2/api/undo.json index f60cf1a2f73..8578b08969a 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 @@ -6030,6 +6030,24 @@ "type": "unsafe" } }, + "ListHardcodedRetentionFilters": { + "tag": "RUM Retention Filters Hardcoded", + "undo": { + "type": "safe" + } + }, + "GetHardcodedRetentionFilter": { + "tag": "RUM Retention Filters Hardcoded", + "undo": { + "type": "safe" + } + }, + "UpdateHardcodedRetentionFilter": { + "tag": "RUM Retention Filters Hardcoded", + "undo": { + "type": "idempotent" + } + }, "OrderRetentionFilters": { "tag": "Rum Retention Filters", "undo": {