From adef82fd5e831dfc0bdea64917a8129c6e27338c Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Tue, 26 May 2026 07:06:05 +0000 Subject: [PATCH] Regenerate client from commit 8aa938c of spec repo --- .generator/schemas/v2/openapi.yaml | 254 +++++++++ .../GetPermanentRetentionFilter.java | 28 + .../ListPermanentRetentionFilters.java | 26 + .../UpdatePermanentRetentionFilter.java | 46 ++ .../client/v2/api/RumRetentionFiltersApi.java | 524 ++++++++++++++++++ ...RumPermanentRetentionFilterAttributes.java | 227 ++++++++ .../RumPermanentRetentionFilterData.java | 204 +++++++ ...umPermanentRetentionFilterEditability.java | 137 +++++ .../model/RumPermanentRetentionFilterID.java | 62 +++ .../RumPermanentRetentionFilterResponse.java | 138 +++++ .../RumPermanentRetentionFilterType.java | 60 ++ ...manentRetentionFilterUpdateAttributes.java | 148 +++++ ...RumPermanentRetentionFilterUpdateData.java | 219 ++++++++ ...PermanentRetentionFilterUpdateRequest.java | 149 +++++ .../RumPermanentRetentionFiltersResponse.java | 152 +++++ .../v2/api/rum_retention_filters.feature | 50 ++ .../com/datadog/api/client/v2/api/undo.json | 18 + 17 files changed, 2442 insertions(+) create mode 100644 examples/v2/rum-retention-filters/GetPermanentRetentionFilter.java create mode 100644 examples/v2/rum-retention-filters/ListPermanentRetentionFilters.java create mode 100644 examples/v2/rum-retention-filters/UpdatePermanentRetentionFilter.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFilterAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFilterData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFilterEditability.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFilterID.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFilterResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFilterType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFilterUpdateAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFilterUpdateData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFilterUpdateRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFiltersResponse.java diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 3bd4dc4902d..ca854b249eb 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -1496,6 +1496,13 @@ components: required: true schema: type: string + RumPermanentRetentionFilterIDParameter: + description: The identifier of the permanent RUM retention filter. + in: path + name: permanent_rf_id + required: true + schema: + $ref: "#/components/schemas/RumPermanentRetentionFilterID" RumRetentionFilterIDParameter: description: Retention filter ID. in: path @@ -68515,6 +68522,100 @@ components: $ref: "#/components/schemas/RumMetricResponseData" type: array type: object + RumPermanentRetentionFilterAttributes: + description: The attributes of a permanent RUM retention filter. + properties: + cross_product_sampling: + $ref: "#/components/schemas/RumCrossProductSampling" + description: + description: A description of what the filter retains. + example: "All sessions generated by Synthetics are retained at 100%." + type: string + editability: + $ref: "#/components/schemas/RumPermanentRetentionFilterEditability" + name: + description: The display name of the permanent retention filter. + example: "Synthetics Sessions" + type: string + type: object + RumPermanentRetentionFilterData: + description: A permanent RUM retention filter. + properties: + attributes: + $ref: "#/components/schemas/RumPermanentRetentionFilterAttributes" + id: + $ref: "#/components/schemas/RumPermanentRetentionFilterID" + type: + $ref: "#/components/schemas/RumPermanentRetentionFilterType" + type: object + RumPermanentRetentionFilterEditability: + description: Indicates which cross-product fields of a permanent RUM retention filter can be updated. + properties: + trace_editable: + description: Whether the APM trace cross-product configuration of the filter can be updated. + example: true + type: boolean + type: object + RumPermanentRetentionFilterID: + description: The identifier of a permanent RUM retention filter. + enum: + - rum_apm_flat_sampling + - synthetic_sessions + - forced_replay_sessions + example: synthetic_sessions + type: string + x-enum-varnames: ["RUM_APM_FLAT_SAMPLING", "SYNTHETIC_SESSIONS", "FORCED_REPLAY_SESSIONS"] + RumPermanentRetentionFilterResponse: + description: A permanent RUM retention filter object. + properties: + data: + $ref: "#/components/schemas/RumPermanentRetentionFilterData" + type: object + RumPermanentRetentionFilterType: + default: permanent_retention_filters + description: The type of the resource. The value should always be `permanent_retention_filters`. + enum: + - permanent_retention_filters + example: permanent_retention_filters + type: string + x-enum-varnames: ["PERMANENT_RETENTION_FILTERS"] + RumPermanentRetentionFilterUpdateAttributes: + description: The configuration to update on a permanent RUM retention filter. + properties: + cross_product_sampling: + $ref: "#/components/schemas/RumCrossProductSamplingUpdate" + type: object + RumPermanentRetentionFilterUpdateData: + description: The new permanent RUM retention filter configuration to update. + properties: + attributes: + $ref: "#/components/schemas/RumPermanentRetentionFilterUpdateAttributes" + id: + $ref: "#/components/schemas/RumPermanentRetentionFilterID" + type: + $ref: "#/components/schemas/RumPermanentRetentionFilterType" + required: + - id + - type + - attributes + type: object + RumPermanentRetentionFilterUpdateRequest: + description: The permanent RUM retention filter body to update. + properties: + data: + $ref: "#/components/schemas/RumPermanentRetentionFilterUpdateData" + required: + - data + type: object + RumPermanentRetentionFiltersResponse: + description: All permanent RUM retention filters for a RUM application. + properties: + data: + description: A list of permanent RUM retention filters. + items: + $ref: "#/components/schemas/RumPermanentRetentionFilterData" + type: array + type: object RumRetentionFilterAttributes: description: The object describing attributes of a RUM retention filter. properties: @@ -140956,6 +141057,159 @@ paths: tags: - Rum Retention Filters x-codegen-request-body-name: body + /api/v2/rum/applications/{app_id}/retention_filters/permanent: + get: + description: |- + Get the list of permanent RUM retention filters for a RUM application. + Permanent retention filters are predefined filters that cannot be created or deleted. + For each filter, the `editability` block indicates which cross-product fields can be updated. + operationId: ListPermanentRetentionFilters + parameters: + - $ref: "#/components/parameters/RumApplicationIDParameter" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + cross_product_sampling: + trace_enabled: true + trace_sample_rate: 100.0 + description: RUM retains all Synthetics sessions. + editability: + trace_editable: true + name: Synthetics Sessions + id: synthetic_sessions + type: permanent_retention_filters + - attributes: + cross_product_sampling: + trace_enabled: true + trace_sample_rate: 100.0 + description: RUM retains all sessions with forced replays. + editability: + trace_editable: true + name: Forced Replay Sessions + id: forced_replay_sessions + type: permanent_retention_filters + - attributes: + cross_product_sampling: + trace_enabled: true + trace_sample_rate: 100.0 + description: Configures APM trace sampling for RUM sessions using flat sampling. + editability: + trace_editable: false + name: RUM APM Flat Sampling + id: rum_apm_flat_sampling + type: permanent_retention_filters + schema: + $ref: "#/components/schemas/RumPermanentRetentionFiltersResponse" + description: OK + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Get all permanent RUM retention filters + tags: + - Rum Retention Filters + /api/v2/rum/applications/{app_id}/retention_filters/permanent/{permanent_rf_id}: + get: + description: Get a permanent RUM retention filter for a RUM application by its identifier. + operationId: GetPermanentRetentionFilter + parameters: + - $ref: "#/components/parameters/RumApplicationIDParameter" + - $ref: "#/components/parameters/RumPermanentRetentionFilterIDParameter" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + cross_product_sampling: + trace_enabled: true + trace_sample_rate: 75.0 + description: RUM retains all Synthetics sessions. + editability: + trace_editable: true + name: Synthetics Sessions + id: synthetic_sessions + type: permanent_retention_filters + schema: + $ref: "#/components/schemas/RumPermanentRetentionFilterResponse" + description: OK + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Get a permanent RUM retention filter + tags: + - Rum Retention Filters + patch: + description: |- + Update the cross-product sampling configuration of a permanent RUM retention filter for a RUM application. + Only fields marked as editable in the `editability` block of the filter can be updated. + Updating a non-editable field returns a `400` response. + operationId: UpdatePermanentRetentionFilter + parameters: + - $ref: "#/components/parameters/RumApplicationIDParameter" + - $ref: "#/components/parameters/RumPermanentRetentionFilterIDParameter" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + cross_product_sampling: + trace_enabled: true + trace_sample_rate: 50.0 + id: synthetic_sessions + type: permanent_retention_filters + schema: + $ref: "#/components/schemas/RumPermanentRetentionFilterUpdateRequest" + description: New configuration of the permanent RUM retention filter. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + cross_product_sampling: + trace_enabled: true + trace_sample_rate: 50.0 + description: RUM retains all Synthetics sessions. + editability: + trace_editable: true + name: Synthetics Sessions + id: synthetic_sessions + type: permanent_retention_filters + schema: + $ref: "#/components/schemas/RumPermanentRetentionFilterResponse" + description: Updated + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Update a permanent RUM retention filter + tags: + - Rum Retention Filters + x-codegen-request-body-name: body /api/v2/rum/applications/{app_id}/retention_filters/{rf_id}: delete: description: Delete a RUM retention filter for a RUM application. diff --git a/examples/v2/rum-retention-filters/GetPermanentRetentionFilter.java b/examples/v2/rum-retention-filters/GetPermanentRetentionFilter.java new file mode 100644 index 00000000000..3df045c0f6c --- /dev/null +++ b/examples/v2/rum-retention-filters/GetPermanentRetentionFilter.java @@ -0,0 +1,28 @@ +// Get a permanent RUM retention filter returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.RumRetentionFiltersApi; +import com.datadog.api.client.v2.model.RumPermanentRetentionFilterID; +import com.datadog.api.client.v2.model.RumPermanentRetentionFilterResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + RumRetentionFiltersApi apiInstance = new RumRetentionFiltersApi(defaultClient); + + try { + RumPermanentRetentionFilterResponse result = + apiInstance.getPermanentRetentionFilter( + "app_id", RumPermanentRetentionFilterID.SYNTHETIC_SESSIONS); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling RumRetentionFiltersApi#getPermanentRetentionFilter"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/rum-retention-filters/ListPermanentRetentionFilters.java b/examples/v2/rum-retention-filters/ListPermanentRetentionFilters.java new file mode 100644 index 00000000000..af3edd65c2a --- /dev/null +++ b/examples/v2/rum-retention-filters/ListPermanentRetentionFilters.java @@ -0,0 +1,26 @@ +// Get all permanent RUM retention filters returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.RumRetentionFiltersApi; +import com.datadog.api.client.v2.model.RumPermanentRetentionFiltersResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + RumRetentionFiltersApi apiInstance = new RumRetentionFiltersApi(defaultClient); + + try { + RumPermanentRetentionFiltersResponse result = + apiInstance.listPermanentRetentionFilters("app_id"); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling RumRetentionFiltersApi#listPermanentRetentionFilters"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/rum-retention-filters/UpdatePermanentRetentionFilter.java b/examples/v2/rum-retention-filters/UpdatePermanentRetentionFilter.java new file mode 100644 index 00000000000..b0986d532fb --- /dev/null +++ b/examples/v2/rum-retention-filters/UpdatePermanentRetentionFilter.java @@ -0,0 +1,46 @@ +// Update a permanent RUM retention filter returns "Updated" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.RumRetentionFiltersApi; +import com.datadog.api.client.v2.model.RumCrossProductSamplingUpdate; +import com.datadog.api.client.v2.model.RumPermanentRetentionFilterID; +import com.datadog.api.client.v2.model.RumPermanentRetentionFilterResponse; +import com.datadog.api.client.v2.model.RumPermanentRetentionFilterType; +import com.datadog.api.client.v2.model.RumPermanentRetentionFilterUpdateAttributes; +import com.datadog.api.client.v2.model.RumPermanentRetentionFilterUpdateData; +import com.datadog.api.client.v2.model.RumPermanentRetentionFilterUpdateRequest; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + RumRetentionFiltersApi apiInstance = new RumRetentionFiltersApi(defaultClient); + + RumPermanentRetentionFilterUpdateRequest body = + new RumPermanentRetentionFilterUpdateRequest() + .data( + new RumPermanentRetentionFilterUpdateData() + .attributes( + new RumPermanentRetentionFilterUpdateAttributes() + .crossProductSampling( + new RumCrossProductSamplingUpdate() + .traceEnabled(true) + .traceSampleRate(25.0))) + .id(RumPermanentRetentionFilterID.SYNTHETIC_SESSIONS) + .type(RumPermanentRetentionFilterType.PERMANENT_RETENTION_FILTERS)); + + try { + RumPermanentRetentionFilterResponse result = + apiInstance.updatePermanentRetentionFilter( + "app_id", RumPermanentRetentionFilterID.SYNTHETIC_SESSIONS, body); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling RumRetentionFiltersApi#updatePermanentRetentionFilter"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/datadog/api/client/v2/api/RumRetentionFiltersApi.java b/src/main/java/com/datadog/api/client/v2/api/RumRetentionFiltersApi.java index fa060d1bc14..fca9a362421 100644 --- a/src/main/java/com/datadog/api/client/v2/api/RumRetentionFiltersApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/RumRetentionFiltersApi.java @@ -4,6 +4,10 @@ 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.RumPermanentRetentionFilterID; +import com.datadog.api.client.v2.model.RumPermanentRetentionFilterResponse; +import com.datadog.api.client.v2.model.RumPermanentRetentionFilterUpdateRequest; +import com.datadog.api.client.v2.model.RumPermanentRetentionFiltersResponse; import com.datadog.api.client.v2.model.RumRetentionFilterCreateRequest; import com.datadog.api.client.v2.model.RumRetentionFilterResponse; import com.datadog.api.client.v2.model.RumRetentionFilterUpdateRequest; @@ -360,6 +364,177 @@ public CompletableFuture> deleteRetentionFilterWithHttpInfoAsy null); } + /** + * Get a permanent RUM retention filter. + * + *

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

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

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

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

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

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

See {@link #updatePermanentRetentionFilterWithHttpInfo}. + * + * @param appId RUM application ID. (required) + * @param permanentRfId The identifier of the permanent RUM retention filter. (required) + * @param body New configuration of the permanent RUM retention filter. (required) + * @return RumPermanentRetentionFilterResponse + * @throws ApiException if fails to make API call + */ + public RumPermanentRetentionFilterResponse updatePermanentRetentionFilter( + String appId, + RumPermanentRetentionFilterID permanentRfId, + RumPermanentRetentionFilterUpdateRequest body) + throws ApiException { + return updatePermanentRetentionFilterWithHttpInfo(appId, permanentRfId, body).getData(); + } + + /** + * Update a permanent RUM retention filter. + * + *

See {@link #updatePermanentRetentionFilterWithHttpInfoAsync}. + * + * @param appId RUM application ID. (required) + * @param permanentRfId The identifier of the permanent RUM retention filter. (required) + * @param body New configuration of the permanent RUM retention filter. (required) + * @return CompletableFuture<RumPermanentRetentionFilterResponse> + */ + public CompletableFuture updatePermanentRetentionFilterAsync( + String appId, + RumPermanentRetentionFilterID permanentRfId, + RumPermanentRetentionFilterUpdateRequest body) { + return updatePermanentRetentionFilterWithHttpInfoAsync(appId, permanentRfId, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Update the cross-product sampling configuration of a permanent RUM retention filter for a RUM + * application. Only fields marked as editable in the editability block of the filter + * can be updated. Updating a non-editable field returns a 400 response. + * + * @param appId RUM application ID. (required) + * @param permanentRfId The identifier of the permanent RUM retention filter. (required) + * @param body New configuration of the permanent RUM retention filter. (required) + * @return ApiResponse<RumPermanentRetentionFilterResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 Updated -
400 Bad Request -
403 Not Authorized -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse + updatePermanentRetentionFilterWithHttpInfo( + String appId, + RumPermanentRetentionFilterID permanentRfId, + RumPermanentRetentionFilterUpdateRequest body) + throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'appId' is set + if (appId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'appId' when calling updatePermanentRetentionFilter"); + } + + // verify the required parameter 'permanentRfId' is set + if (permanentRfId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'permanentRfId' when calling" + + " updatePermanentRetentionFilter"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling updatePermanentRetentionFilter"); + } + // create path and map variables + String localVarPath = + "/api/v2/rum/applications/{app_id}/retention_filters/permanent/{permanent_rf_id}" + .replaceAll("\\{" + "app_id" + "\\}", apiClient.escapeString(appId.toString())) + .replaceAll( + "\\{" + "permanent_rf_id" + "\\}", + apiClient.escapeString(permanentRfId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.RumRetentionFiltersApi.updatePermanentRetentionFilter", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Update a permanent RUM retention filter. + * + *

See {@link #updatePermanentRetentionFilterWithHttpInfo}. + * + * @param appId RUM application ID. (required) + * @param permanentRfId The identifier of the permanent RUM retention filter. (required) + * @param body New configuration of the permanent RUM retention filter. (required) + * @return CompletableFuture<ApiResponse<RumPermanentRetentionFilterResponse>> + */ + public CompletableFuture> + updatePermanentRetentionFilterWithHttpInfoAsync( + String appId, + RumPermanentRetentionFilterID permanentRfId, + RumPermanentRetentionFilterUpdateRequest body) { + Object localVarPostBody = body; + + // verify the required parameter 'appId' is set + if (appId == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'appId' when calling" + + " updatePermanentRetentionFilter")); + return result; + } + + // verify the required parameter 'permanentRfId' is set + if (permanentRfId == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'permanentRfId' when calling" + + " updatePermanentRetentionFilter")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'body' when calling updatePermanentRetentionFilter")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/rum/applications/{app_id}/retention_filters/permanent/{permanent_rf_id}" + .replaceAll("\\{" + "app_id" + "\\}", apiClient.escapeString(appId.toString())) + .replaceAll( + "\\{" + "permanent_rf_id" + "\\}", + apiClient.escapeString(permanentRfId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.RumRetentionFiltersApi.updatePermanentRetentionFilter", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + /** * Update a RUM retention filter. * diff --git a/src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFilterAttributes.java b/src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFilterAttributes.java new file mode 100644 index 00000000000..e7080ac500a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFilterAttributes.java @@ -0,0 +1,227 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The attributes of a permanent RUM retention filter. */ +@JsonPropertyOrder({ + RumPermanentRetentionFilterAttributes.JSON_PROPERTY_CROSS_PRODUCT_SAMPLING, + RumPermanentRetentionFilterAttributes.JSON_PROPERTY_DESCRIPTION, + RumPermanentRetentionFilterAttributes.JSON_PROPERTY_EDITABILITY, + RumPermanentRetentionFilterAttributes.JSON_PROPERTY_NAME +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RumPermanentRetentionFilterAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CROSS_PRODUCT_SAMPLING = "cross_product_sampling"; + private RumCrossProductSampling crossProductSampling; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_EDITABILITY = "editability"; + private RumPermanentRetentionFilterEditability editability; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public RumPermanentRetentionFilterAttributes crossProductSampling( + RumCrossProductSampling crossProductSampling) { + this.crossProductSampling = crossProductSampling; + this.unparsed |= crossProductSampling.unparsed; + return this; + } + + /** + * The configuration for cross-product retention filters. + * + * @return crossProductSampling + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CROSS_PRODUCT_SAMPLING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RumCrossProductSampling getCrossProductSampling() { + return crossProductSampling; + } + + public void setCrossProductSampling(RumCrossProductSampling crossProductSampling) { + this.crossProductSampling = crossProductSampling; + } + + public RumPermanentRetentionFilterAttributes description(String description) { + this.description = description; + return this; + } + + /** + * A description of what the filter retains. + * + * @return description + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public RumPermanentRetentionFilterAttributes editability( + RumPermanentRetentionFilterEditability editability) { + this.editability = editability; + this.unparsed |= editability.unparsed; + return this; + } + + /** + * Indicates which cross-product fields of a permanent RUM retention filter can be updated. + * + * @return editability + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EDITABILITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RumPermanentRetentionFilterEditability getEditability() { + return editability; + } + + public void setEditability(RumPermanentRetentionFilterEditability editability) { + this.editability = editability; + } + + public RumPermanentRetentionFilterAttributes name(String name) { + this.name = name; + return this; + } + + /** + * The display name of the permanent retention filter. + * + * @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; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return RumPermanentRetentionFilterAttributes + */ + @JsonAnySetter + public RumPermanentRetentionFilterAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this RumPermanentRetentionFilterAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RumPermanentRetentionFilterAttributes rumPermanentRetentionFilterAttributes = + (RumPermanentRetentionFilterAttributes) o; + return Objects.equals( + this.crossProductSampling, rumPermanentRetentionFilterAttributes.crossProductSampling) + && Objects.equals(this.description, rumPermanentRetentionFilterAttributes.description) + && Objects.equals(this.editability, rumPermanentRetentionFilterAttributes.editability) + && Objects.equals(this.name, rumPermanentRetentionFilterAttributes.name) + && Objects.equals( + this.additionalProperties, rumPermanentRetentionFilterAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(crossProductSampling, description, editability, name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RumPermanentRetentionFilterAttributes {\n"); + sb.append(" crossProductSampling: ") + .append(toIndentedString(crossProductSampling)) + .append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" editability: ").append(toIndentedString(editability)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFilterData.java b/src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFilterData.java new file mode 100644 index 00000000000..7d28f9f29c8 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFilterData.java @@ -0,0 +1,204 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** A permanent RUM retention filter. */ +@JsonPropertyOrder({ + RumPermanentRetentionFilterData.JSON_PROPERTY_ATTRIBUTES, + RumPermanentRetentionFilterData.JSON_PROPERTY_ID, + RumPermanentRetentionFilterData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RumPermanentRetentionFilterData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private RumPermanentRetentionFilterAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private RumPermanentRetentionFilterID id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private RumPermanentRetentionFilterType type = + RumPermanentRetentionFilterType.PERMANENT_RETENTION_FILTERS; + + public RumPermanentRetentionFilterData attributes( + RumPermanentRetentionFilterAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * The attributes of a permanent RUM retention filter. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RumPermanentRetentionFilterAttributes getAttributes() { + return attributes; + } + + public void setAttributes(RumPermanentRetentionFilterAttributes attributes) { + this.attributes = attributes; + } + + public RumPermanentRetentionFilterData id(RumPermanentRetentionFilterID id) { + this.id = id; + this.unparsed |= !id.isValid(); + return this; + } + + /** + * The identifier of a permanent RUM retention filter. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RumPermanentRetentionFilterID getId() { + return id; + } + + public void setId(RumPermanentRetentionFilterID id) { + if (!id.isValid()) { + this.unparsed = true; + } + this.id = id; + } + + public RumPermanentRetentionFilterData type(RumPermanentRetentionFilterType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The type of the resource. The value should always be permanent_retention_filters. + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RumPermanentRetentionFilterType getType() { + return type; + } + + public void setType(RumPermanentRetentionFilterType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return RumPermanentRetentionFilterData + */ + @JsonAnySetter + public RumPermanentRetentionFilterData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this RumPermanentRetentionFilterData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RumPermanentRetentionFilterData rumPermanentRetentionFilterData = + (RumPermanentRetentionFilterData) o; + return Objects.equals(this.attributes, rumPermanentRetentionFilterData.attributes) + && Objects.equals(this.id, rumPermanentRetentionFilterData.id) + && Objects.equals(this.type, rumPermanentRetentionFilterData.type) + && Objects.equals( + this.additionalProperties, rumPermanentRetentionFilterData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RumPermanentRetentionFilterData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" 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/RumPermanentRetentionFilterEditability.java b/src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFilterEditability.java new file mode 100644 index 00000000000..ed7b8ad430c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFilterEditability.java @@ -0,0 +1,137 @@ +/* + * 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; + +/** Indicates which cross-product fields of a permanent RUM retention filter can be updated. */ +@JsonPropertyOrder({RumPermanentRetentionFilterEditability.JSON_PROPERTY_TRACE_EDITABLE}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RumPermanentRetentionFilterEditability { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_TRACE_EDITABLE = "trace_editable"; + private Boolean traceEditable; + + public RumPermanentRetentionFilterEditability traceEditable(Boolean traceEditable) { + this.traceEditable = traceEditable; + return this; + } + + /** + * Whether the APM trace cross-product configuration of the filter can be updated. + * + * @return traceEditable + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TRACE_EDITABLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getTraceEditable() { + return traceEditable; + } + + public void setTraceEditable(Boolean traceEditable) { + this.traceEditable = traceEditable; + } + + /** + * 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 RumPermanentRetentionFilterEditability + */ + @JsonAnySetter + public RumPermanentRetentionFilterEditability 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 RumPermanentRetentionFilterEditability object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RumPermanentRetentionFilterEditability rumPermanentRetentionFilterEditability = + (RumPermanentRetentionFilterEditability) o; + return Objects.equals(this.traceEditable, rumPermanentRetentionFilterEditability.traceEditable) + && Objects.equals( + this.additionalProperties, rumPermanentRetentionFilterEditability.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(traceEditable, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RumPermanentRetentionFilterEditability {\n"); + sb.append(" traceEditable: ").append(toIndentedString(traceEditable)).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/RumPermanentRetentionFilterID.java b/src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFilterID.java new file mode 100644 index 00000000000..c430466fff6 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFilterID.java @@ -0,0 +1,62 @@ +/* + * 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 identifier of a permanent RUM retention filter. */ +@JsonSerialize(using = RumPermanentRetentionFilterID.RumPermanentRetentionFilterIDSerializer.class) +public class RumPermanentRetentionFilterID extends ModelEnum { + + private static final Set allowedValues = + new HashSet( + Arrays.asList("rum_apm_flat_sampling", "synthetic_sessions", "forced_replay_sessions")); + + public static final RumPermanentRetentionFilterID RUM_APM_FLAT_SAMPLING = + new RumPermanentRetentionFilterID("rum_apm_flat_sampling"); + public static final RumPermanentRetentionFilterID SYNTHETIC_SESSIONS = + new RumPermanentRetentionFilterID("synthetic_sessions"); + public static final RumPermanentRetentionFilterID FORCED_REPLAY_SESSIONS = + new RumPermanentRetentionFilterID("forced_replay_sessions"); + + RumPermanentRetentionFilterID(String value) { + super(value, allowedValues); + } + + public static class RumPermanentRetentionFilterIDSerializer + extends StdSerializer { + public RumPermanentRetentionFilterIDSerializer(Class t) { + super(t); + } + + public RumPermanentRetentionFilterIDSerializer() { + this(null); + } + + @Override + public void serialize( + RumPermanentRetentionFilterID value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static RumPermanentRetentionFilterID fromValue(String value) { + return new RumPermanentRetentionFilterID(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFilterResponse.java b/src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFilterResponse.java new file mode 100644 index 00000000000..820082ab9d8 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFilterResponse.java @@ -0,0 +1,138 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** A permanent RUM retention filter object. */ +@JsonPropertyOrder({RumPermanentRetentionFilterResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RumPermanentRetentionFilterResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private RumPermanentRetentionFilterData data; + + public RumPermanentRetentionFilterResponse data(RumPermanentRetentionFilterData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * A permanent RUM retention filter. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RumPermanentRetentionFilterData getData() { + return data; + } + + public void setData(RumPermanentRetentionFilterData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return RumPermanentRetentionFilterResponse + */ + @JsonAnySetter + public RumPermanentRetentionFilterResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this RumPermanentRetentionFilterResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RumPermanentRetentionFilterResponse rumPermanentRetentionFilterResponse = + (RumPermanentRetentionFilterResponse) o; + return Objects.equals(this.data, rumPermanentRetentionFilterResponse.data) + && Objects.equals( + this.additionalProperties, rumPermanentRetentionFilterResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RumPermanentRetentionFilterResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFilterType.java b/src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFilterType.java new file mode 100644 index 00000000000..8d5ec27d681 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFilterType.java @@ -0,0 +1,60 @@ +/* + * 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 the resource. The value should always be permanent_retention_filters. + */ +@JsonSerialize( + using = RumPermanentRetentionFilterType.RumPermanentRetentionFilterTypeSerializer.class) +public class RumPermanentRetentionFilterType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("permanent_retention_filters")); + + public static final RumPermanentRetentionFilterType PERMANENT_RETENTION_FILTERS = + new RumPermanentRetentionFilterType("permanent_retention_filters"); + + RumPermanentRetentionFilterType(String value) { + super(value, allowedValues); + } + + public static class RumPermanentRetentionFilterTypeSerializer + extends StdSerializer { + public RumPermanentRetentionFilterTypeSerializer(Class t) { + super(t); + } + + public RumPermanentRetentionFilterTypeSerializer() { + this(null); + } + + @Override + public void serialize( + RumPermanentRetentionFilterType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static RumPermanentRetentionFilterType fromValue(String value) { + return new RumPermanentRetentionFilterType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFilterUpdateAttributes.java b/src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFilterUpdateAttributes.java new file mode 100644 index 00000000000..6a2a3a1270a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFilterUpdateAttributes.java @@ -0,0 +1,148 @@ +/* + * 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 configuration to update on a permanent RUM retention filter. */ +@JsonPropertyOrder({ + RumPermanentRetentionFilterUpdateAttributes.JSON_PROPERTY_CROSS_PRODUCT_SAMPLING +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RumPermanentRetentionFilterUpdateAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CROSS_PRODUCT_SAMPLING = "cross_product_sampling"; + private RumCrossProductSamplingUpdate crossProductSampling; + + public RumPermanentRetentionFilterUpdateAttributes crossProductSampling( + RumCrossProductSamplingUpdate crossProductSampling) { + this.crossProductSampling = crossProductSampling; + this.unparsed |= crossProductSampling.unparsed; + return this; + } + + /** + * The configuration for cross-product retention filters. All fields are optional for partial + * updates. + * + * @return crossProductSampling + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CROSS_PRODUCT_SAMPLING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RumCrossProductSamplingUpdate getCrossProductSampling() { + return crossProductSampling; + } + + public void setCrossProductSampling(RumCrossProductSamplingUpdate crossProductSampling) { + this.crossProductSampling = crossProductSampling; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return RumPermanentRetentionFilterUpdateAttributes + */ + @JsonAnySetter + public RumPermanentRetentionFilterUpdateAttributes putAdditionalProperty( + String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this RumPermanentRetentionFilterUpdateAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RumPermanentRetentionFilterUpdateAttributes rumPermanentRetentionFilterUpdateAttributes = + (RumPermanentRetentionFilterUpdateAttributes) o; + return Objects.equals( + this.crossProductSampling, + rumPermanentRetentionFilterUpdateAttributes.crossProductSampling) + && Objects.equals( + this.additionalProperties, + rumPermanentRetentionFilterUpdateAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(crossProductSampling, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RumPermanentRetentionFilterUpdateAttributes {\n"); + sb.append(" crossProductSampling: ") + .append(toIndentedString(crossProductSampling)) + .append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFilterUpdateData.java b/src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFilterUpdateData.java new file mode 100644 index 00000000000..23dc866920d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFilterUpdateData.java @@ -0,0 +1,219 @@ +/* + * 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 new permanent RUM retention filter configuration to update. */ +@JsonPropertyOrder({ + RumPermanentRetentionFilterUpdateData.JSON_PROPERTY_ATTRIBUTES, + RumPermanentRetentionFilterUpdateData.JSON_PROPERTY_ID, + RumPermanentRetentionFilterUpdateData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RumPermanentRetentionFilterUpdateData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private RumPermanentRetentionFilterUpdateAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private RumPermanentRetentionFilterID id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private RumPermanentRetentionFilterType type = + RumPermanentRetentionFilterType.PERMANENT_RETENTION_FILTERS; + + public RumPermanentRetentionFilterUpdateData() {} + + @JsonCreator + public RumPermanentRetentionFilterUpdateData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + RumPermanentRetentionFilterUpdateAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) RumPermanentRetentionFilterID id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + RumPermanentRetentionFilterType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.unparsed |= !id.isValid(); + this.type = type; + this.unparsed |= !type.isValid(); + } + + public RumPermanentRetentionFilterUpdateData attributes( + RumPermanentRetentionFilterUpdateAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * The configuration to update on a permanent RUM retention filter. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public RumPermanentRetentionFilterUpdateAttributes getAttributes() { + return attributes; + } + + public void setAttributes(RumPermanentRetentionFilterUpdateAttributes attributes) { + this.attributes = attributes; + } + + public RumPermanentRetentionFilterUpdateData id(RumPermanentRetentionFilterID id) { + this.id = id; + this.unparsed |= !id.isValid(); + return this; + } + + /** + * The identifier of a permanent RUM retention filter. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public RumPermanentRetentionFilterID getId() { + return id; + } + + public void setId(RumPermanentRetentionFilterID id) { + if (!id.isValid()) { + this.unparsed = true; + } + this.id = id; + } + + public RumPermanentRetentionFilterUpdateData type(RumPermanentRetentionFilterType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The type of the resource. The value should always be permanent_retention_filters. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public RumPermanentRetentionFilterType getType() { + return type; + } + + public void setType(RumPermanentRetentionFilterType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return RumPermanentRetentionFilterUpdateData + */ + @JsonAnySetter + public RumPermanentRetentionFilterUpdateData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this RumPermanentRetentionFilterUpdateData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RumPermanentRetentionFilterUpdateData rumPermanentRetentionFilterUpdateData = + (RumPermanentRetentionFilterUpdateData) o; + return Objects.equals(this.attributes, rumPermanentRetentionFilterUpdateData.attributes) + && Objects.equals(this.id, rumPermanentRetentionFilterUpdateData.id) + && Objects.equals(this.type, rumPermanentRetentionFilterUpdateData.type) + && Objects.equals( + this.additionalProperties, rumPermanentRetentionFilterUpdateData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RumPermanentRetentionFilterUpdateData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFilterUpdateRequest.java b/src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFilterUpdateRequest.java new file mode 100644 index 00000000000..8123e863a43 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFilterUpdateRequest.java @@ -0,0 +1,149 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The permanent RUM retention filter body to update. */ +@JsonPropertyOrder({RumPermanentRetentionFilterUpdateRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RumPermanentRetentionFilterUpdateRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private RumPermanentRetentionFilterUpdateData data; + + public RumPermanentRetentionFilterUpdateRequest() {} + + @JsonCreator + public RumPermanentRetentionFilterUpdateRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + RumPermanentRetentionFilterUpdateData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public RumPermanentRetentionFilterUpdateRequest data(RumPermanentRetentionFilterUpdateData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * The new permanent RUM retention filter configuration to update. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public RumPermanentRetentionFilterUpdateData getData() { + return data; + } + + public void setData(RumPermanentRetentionFilterUpdateData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return RumPermanentRetentionFilterUpdateRequest + */ + @JsonAnySetter + public RumPermanentRetentionFilterUpdateRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this RumPermanentRetentionFilterUpdateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RumPermanentRetentionFilterUpdateRequest rumPermanentRetentionFilterUpdateRequest = + (RumPermanentRetentionFilterUpdateRequest) o; + return Objects.equals(this.data, rumPermanentRetentionFilterUpdateRequest.data) + && Objects.equals( + this.additionalProperties, + rumPermanentRetentionFilterUpdateRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RumPermanentRetentionFilterUpdateRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFiltersResponse.java b/src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFiltersResponse.java new file mode 100644 index 00000000000..973d177563f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RumPermanentRetentionFiltersResponse.java @@ -0,0 +1,152 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** All permanent RUM retention filters for a RUM application. */ +@JsonPropertyOrder({RumPermanentRetentionFiltersResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RumPermanentRetentionFiltersResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = null; + + public RumPermanentRetentionFiltersResponse data(List data) { + this.data = data; + for (RumPermanentRetentionFilterData item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public RumPermanentRetentionFiltersResponse addDataItem( + RumPermanentRetentionFilterData dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * A list of permanent RUM retention filters. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return RumPermanentRetentionFiltersResponse + */ + @JsonAnySetter + public RumPermanentRetentionFiltersResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this RumPermanentRetentionFiltersResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RumPermanentRetentionFiltersResponse rumPermanentRetentionFiltersResponse = + (RumPermanentRetentionFiltersResponse) o; + return Objects.equals(this.data, rumPermanentRetentionFiltersResponse.data) + && Objects.equals( + this.additionalProperties, rumPermanentRetentionFiltersResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RumPermanentRetentionFiltersResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/test/resources/com/datadog/api/client/v2/api/rum_retention_filters.feature b/src/test/resources/com/datadog/api/client/v2/api/rum_retention_filters.feature index 08d0a42a253..9029548488c 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/rum_retention_filters.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/rum_retention_filters.feature @@ -70,6 +70,22 @@ Feature: Rum Retention Filters And the response "data.attributes.query" is equal to "custom_query" And the response "data.attributes.sample_rate" is equal to 25 + @generated @skip @team:DataDog/rum-backend + Scenario: Get a permanent RUM retention filter returns "Not Found" response + Given new "GetPermanentRetentionFilter" request + And request contains "app_id" parameter from "REPLACE.ME" + And request contains "permanent_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 permanent RUM retention filter returns "OK" response + Given new "GetPermanentRetentionFilter" request + And request contains "app_id" parameter from "REPLACE.ME" + And request contains "permanent_rf_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @replay-only @team:DataDog/rum-backend Scenario: Get all RUM retention filters returns "OK" response Given new "ListRetentionFilters" request @@ -78,6 +94,13 @@ Feature: Rum Retention Filters Then the response status is 200 OK And the response "data" has length 3 + @generated @skip @team:DataDog/rum-backend + Scenario: Get all permanent RUM retention filters returns "OK" response + Given new "ListPermanentRetentionFilters" request + And request contains "app_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @team:DataDog/rum-backend Scenario: Order RUM retention filters returns "Bad Request" response Given new "OrderRetentionFilters" request @@ -130,3 +153,30 @@ Feature: Rum Retention Filters And the response "data.attributes.enabled" is equal to true And the response "data.attributes.query" is equal to "view_query" And the response "data.attributes.sample_rate" is equal to 100 + + @generated @skip @team:DataDog/rum-backend + Scenario: Update a permanent RUM retention filter returns "Bad Request" response + Given new "UpdatePermanentRetentionFilter" request + And request contains "app_id" parameter from "REPLACE.ME" + And request contains "permanent_rf_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"cross_product_sampling": {"trace_enabled": true, "trace_sample_rate": 25.0}}, "id": "synthetic_sessions", "type": "permanent_retention_filters"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/rum-backend + Scenario: Update a permanent RUM retention filter returns "Not Found" response + Given new "UpdatePermanentRetentionFilter" request + And request contains "app_id" parameter from "REPLACE.ME" + And request contains "permanent_rf_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"cross_product_sampling": {"trace_enabled": true, "trace_sample_rate": 25.0}}, "id": "synthetic_sessions", "type": "permanent_retention_filters"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/rum-backend + Scenario: Update a permanent RUM retention filter returns "Updated" response + Given new "UpdatePermanentRetentionFilter" request + And request contains "app_id" parameter from "REPLACE.ME" + And request contains "permanent_rf_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"cross_product_sampling": {"trace_enabled": true, "trace_sample_rate": 25.0}}, "id": "synthetic_sessions", "type": "permanent_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 c22b1472981..668342d9a14 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 @@ -5703,6 +5703,24 @@ "type": "safe" } }, + "ListPermanentRetentionFilters": { + "tag": "Rum Retention Filters", + "undo": { + "type": "safe" + } + }, + "GetPermanentRetentionFilter": { + "tag": "Rum Retention Filters", + "undo": { + "type": "safe" + } + }, + "UpdatePermanentRetentionFilter": { + "tag": "Rum Retention Filters", + "undo": { + "type": "idempotent" + } + }, "DeleteRetentionFilter": { "tag": "Rum Retention Filters", "undo": {