diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 25b7d2083191..b2e0e022c91c 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -1558,6 +1558,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 @@ -71551,6 +71558,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 + - synthetics_sessions + - forced_replay_sessions + example: synthetics_sessions + type: string + x-enum-varnames: ["RUM_APM_FLAT_SAMPLING", "SYNTHETICS_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: @@ -146732,6 +146833,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: synthetics_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: synthetics_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: synthetics_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: synthetics_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.ts b/examples/v2/rum-retention-filters/GetPermanentRetentionFilter.ts new file mode 100644 index 000000000000..c8710e25b332 --- /dev/null +++ b/examples/v2/rum-retention-filters/GetPermanentRetentionFilter.ts @@ -0,0 +1,22 @@ +/** + * Get a permanent RUM retention filter returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.RumRetentionFiltersApi(configuration); + +const params: v2.RumRetentionFiltersApiGetPermanentRetentionFilterRequest = { + appId: "app_id", + permanentRfId: "synthetics_sessions", +}; + +apiInstance + .getPermanentRetentionFilter(params) + .then((data: v2.RumPermanentRetentionFilterResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/rum-retention-filters/ListPermanentRetentionFilters.ts b/examples/v2/rum-retention-filters/ListPermanentRetentionFilters.ts new file mode 100644 index 000000000000..cae44aeb88f6 --- /dev/null +++ b/examples/v2/rum-retention-filters/ListPermanentRetentionFilters.ts @@ -0,0 +1,21 @@ +/** + * Get all permanent RUM retention filters returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.RumRetentionFiltersApi(configuration); + +const params: v2.RumRetentionFiltersApiListPermanentRetentionFiltersRequest = { + appId: "app_id", +}; + +apiInstance + .listPermanentRetentionFilters(params) + .then((data: v2.RumPermanentRetentionFiltersResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/rum-retention-filters/UpdatePermanentRetentionFilter.ts b/examples/v2/rum-retention-filters/UpdatePermanentRetentionFilter.ts new file mode 100644 index 000000000000..f1d786aefdf4 --- /dev/null +++ b/examples/v2/rum-retention-filters/UpdatePermanentRetentionFilter.ts @@ -0,0 +1,34 @@ +/** + * Update a permanent RUM retention filter returns "Updated" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.RumRetentionFiltersApi(configuration); + +const params: v2.RumRetentionFiltersApiUpdatePermanentRetentionFilterRequest = { + body: { + data: { + attributes: { + crossProductSampling: { + traceEnabled: true, + traceSampleRate: 25.0, + }, + }, + id: "synthetics_sessions", + type: "permanent_retention_filters", + }, + }, + appId: "app_id", + permanentRfId: "synthetics_sessions", +}; + +apiInstance + .updatePermanentRetentionFilter(params) + .then((data: v2.RumPermanentRetentionFilterResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/features/support/scenarios_model_mapping.ts b/features/support/scenarios_model_mapping.ts index 01b2bbba5e97..07af16e246fd 100644 --- a/features/support/scenarios_model_mapping.ts +++ b/features/support/scenarios_model_mapping.ts @@ -12704,6 +12704,39 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = { }, "operationResponseType": "RumRetentionFilterResponse", }, + "v2.ListPermanentRetentionFilters": { + "appId": { + "type": "string", + "format": "", + }, + "operationResponseType": "RumPermanentRetentionFiltersResponse", + }, + "v2.GetPermanentRetentionFilter": { + "appId": { + "type": "string", + "format": "", + }, + "permanentRfId": { + "type": "RumPermanentRetentionFilterID", + "format": "", + }, + "operationResponseType": "RumPermanentRetentionFilterResponse", + }, + "v2.UpdatePermanentRetentionFilter": { + "appId": { + "type": "string", + "format": "", + }, + "permanentRfId": { + "type": "RumPermanentRetentionFilterID", + "format": "", + }, + "body": { + "type": "RumPermanentRetentionFilterUpdateRequest", + "format": "", + }, + "operationResponseType": "RumPermanentRetentionFilterResponse", + }, "v2.GetRetentionFilter": { "appId": { "type": "string", diff --git a/features/v2/rum_retention_filters.feature b/features/v2/rum_retention_filters.feature index 08d0a42a2538..9c41dcedc0d0 100644 --- a/features/v2/rum_retention_filters.feature +++ b/features/v2/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": "synthetics_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": "synthetics_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": "synthetics_sessions", "type": "permanent_retention_filters"}} + When the request is sent + Then the response status is 200 Updated diff --git a/features/v2/undo.json b/features/v2/undo.json index 71e42bf1b94b..f1a04b48a1aa 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -5875,6 +5875,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": { diff --git a/packages/datadog-api-client-v2/apis/RumRetentionFiltersApi.ts b/packages/datadog-api-client-v2/apis/RumRetentionFiltersApi.ts index f7e2fd1ccc93..b423ecdbe355 100644 --- a/packages/datadog-api-client-v2/apis/RumRetentionFiltersApi.ts +++ b/packages/datadog-api-client-v2/apis/RumRetentionFiltersApi.ts @@ -17,6 +17,10 @@ import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; import { APIErrorResponse } from "../models/APIErrorResponse"; +import { RumPermanentRetentionFilterID } from "../models/RumPermanentRetentionFilterID"; +import { RumPermanentRetentionFilterResponse } from "../models/RumPermanentRetentionFilterResponse"; +import { RumPermanentRetentionFiltersResponse } from "../models/RumPermanentRetentionFiltersResponse"; +import { RumPermanentRetentionFilterUpdateRequest } from "../models/RumPermanentRetentionFilterUpdateRequest"; import { RumRetentionFilterCreateRequest } from "../models/RumRetentionFilterCreateRequest"; import { RumRetentionFilterResponse } from "../models/RumRetentionFilterResponse"; import { RumRetentionFiltersOrderRequest } from "../models/RumRetentionFiltersOrderRequest"; @@ -115,6 +119,48 @@ export class RumRetentionFiltersApiRequestFactory extends BaseAPIRequestFactory return requestContext; } + public async getPermanentRetentionFilter( + appId: string, + permanentRfId: RumPermanentRetentionFilterID, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + // verify required parameter 'appId' is not null or undefined + if (appId === null || appId === undefined) { + throw new RequiredError("appId", "getPermanentRetentionFilter"); + } + + // verify required parameter 'permanentRfId' is not null or undefined + if (permanentRfId === null || permanentRfId === undefined) { + throw new RequiredError("permanentRfId", "getPermanentRetentionFilter"); + } + + // Path Params + const localVarPath = + "/api/v2/rum/applications/{app_id}/retention_filters/permanent/{permanent_rf_id}" + .replace("{app_id}", encodeURIComponent(String(appId))) + .replace( + "{permanent_rf_id}", + encodeURIComponent(String(permanentRfId)) + ); + + // Make Request Context + const requestContext = _config + .getServer("v2.RumRetentionFiltersApi.getPermanentRetentionFilter") + .makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + public async getRetentionFilter( appId: string, rfId: string, @@ -154,6 +200,40 @@ export class RumRetentionFiltersApiRequestFactory extends BaseAPIRequestFactory return requestContext; } + public async listPermanentRetentionFilters( + appId: string, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + // verify required parameter 'appId' is not null or undefined + if (appId === null || appId === undefined) { + throw new RequiredError("appId", "listPermanentRetentionFilters"); + } + + // Path Params + const localVarPath = + "/api/v2/rum/applications/{app_id}/retention_filters/permanent".replace( + "{app_id}", + encodeURIComponent(String(appId)) + ); + + // Make Request Context + const requestContext = _config + .getServer("v2.RumRetentionFiltersApi.listPermanentRetentionFilters") + .makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + public async listRetentionFilters( appId: string, _options?: Configuration @@ -239,6 +319,72 @@ export class RumRetentionFiltersApiRequestFactory extends BaseAPIRequestFactory return requestContext; } + public async updatePermanentRetentionFilter( + appId: string, + permanentRfId: RumPermanentRetentionFilterID, + body: RumPermanentRetentionFilterUpdateRequest, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + // verify required parameter 'appId' is not null or undefined + if (appId === null || appId === undefined) { + throw new RequiredError("appId", "updatePermanentRetentionFilter"); + } + + // verify required parameter 'permanentRfId' is not null or undefined + if (permanentRfId === null || permanentRfId === undefined) { + throw new RequiredError( + "permanentRfId", + "updatePermanentRetentionFilter" + ); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "updatePermanentRetentionFilter"); + } + + // Path Params + const localVarPath = + "/api/v2/rum/applications/{app_id}/retention_filters/permanent/{permanent_rf_id}" + .replace("{app_id}", encodeURIComponent(String(appId))) + .replace( + "{permanent_rf_id}", + encodeURIComponent(String(permanentRfId)) + ); + + // Make Request Context + const requestContext = _config + .getServer("v2.RumRetentionFiltersApi.updatePermanentRetentionFilter") + .makeRequestContext(localVarPath, HttpMethod.PATCH); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json", + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize( + body, + "RumPermanentRetentionFilterUpdateRequest", + "" + ), + contentType + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + public async updateRetentionFilter( appId: string, rfId: string, @@ -410,6 +556,70 @@ export class RumRetentionFiltersApiResponseProcessor { ); } + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to getPermanentRetentionFilter + * @throws ApiException if the response code was not in [200, 299] + */ + public async getPermanentRetentionFilter( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: RumPermanentRetentionFilterResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "RumPermanentRetentionFilterResponse" + ) as RumPermanentRetentionFilterResponse; + return body; + } + if ( + response.httpStatusCode === 403 || + response.httpStatusCode === 404 || + response.httpStatusCode === 429 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: RumPermanentRetentionFilterResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "RumPermanentRetentionFilterResponse", + "" + ) as RumPermanentRetentionFilterResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects @@ -472,6 +682,66 @@ export class RumRetentionFiltersApiResponseProcessor { ); } + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to listPermanentRetentionFilters + * @throws ApiException if the response code was not in [200, 299] + */ + public async listPermanentRetentionFilters( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: RumPermanentRetentionFiltersResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "RumPermanentRetentionFiltersResponse" + ) as RumPermanentRetentionFiltersResponse; + return body; + } + if (response.httpStatusCode === 403 || response.httpStatusCode === 429) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: RumPermanentRetentionFiltersResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "RumPermanentRetentionFiltersResponse", + "" + ) as RumPermanentRetentionFiltersResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects @@ -594,6 +864,71 @@ export class RumRetentionFiltersApiResponseProcessor { ); } + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to updatePermanentRetentionFilter + * @throws ApiException if the response code was not in [200, 299] + */ + public async updatePermanentRetentionFilter( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: RumPermanentRetentionFilterResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "RumPermanentRetentionFilterResponse" + ) as RumPermanentRetentionFilterResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 403 || + response.httpStatusCode === 404 || + response.httpStatusCode === 429 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: RumPermanentRetentionFilterResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "RumPermanentRetentionFilterResponse", + "" + ) as RumPermanentRetentionFilterResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects @@ -684,6 +1019,19 @@ export interface RumRetentionFiltersApiDeleteRetentionFilterRequest { rfId: string; } +export interface RumRetentionFiltersApiGetPermanentRetentionFilterRequest { + /** + * RUM application ID. + * @type string + */ + appId: string; + /** + * The identifier of the permanent RUM retention filter. + * @type RumPermanentRetentionFilterID + */ + permanentRfId: RumPermanentRetentionFilterID; +} + export interface RumRetentionFiltersApiGetRetentionFilterRequest { /** * RUM application ID. @@ -697,6 +1045,14 @@ export interface RumRetentionFiltersApiGetRetentionFilterRequest { rfId: string; } +export interface RumRetentionFiltersApiListPermanentRetentionFiltersRequest { + /** + * RUM application ID. + * @type string + */ + appId: string; +} + export interface RumRetentionFiltersApiListRetentionFiltersRequest { /** * RUM application ID. @@ -718,6 +1074,24 @@ export interface RumRetentionFiltersApiOrderRetentionFiltersRequest { body: RumRetentionFiltersOrderRequest; } +export interface RumRetentionFiltersApiUpdatePermanentRetentionFilterRequest { + /** + * RUM application ID. + * @type string + */ + appId: string; + /** + * The identifier of the permanent RUM retention filter. + * @type RumPermanentRetentionFilterID + */ + permanentRfId: RumPermanentRetentionFilterID; + /** + * New configuration of the permanent RUM retention filter. + * @type RumPermanentRetentionFilterUpdateRequest + */ + body: RumPermanentRetentionFilterUpdateRequest; +} + export interface RumRetentionFiltersApiUpdateRetentionFilterRequest { /** * RUM application ID. @@ -798,6 +1172,31 @@ export class RumRetentionFiltersApi { }); } + /** + * Get a permanent RUM retention filter for a RUM application by its identifier. + * @param param The request object + */ + public getPermanentRetentionFilter( + param: RumRetentionFiltersApiGetPermanentRetentionFilterRequest, + options?: Configuration + ): Promise { + const requestContextPromise = + this.requestFactory.getPermanentRetentionFilter( + param.appId, + param.permanentRfId, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.getPermanentRetentionFilter( + responseContext + ); + }); + }); + } + /** * Get a RUM retention filter for a RUM application. * @param param The request object @@ -820,6 +1219,29 @@ export class RumRetentionFiltersApi { }); } + /** + * 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 param The request object + */ + public listPermanentRetentionFilters( + param: RumRetentionFiltersApiListPermanentRetentionFiltersRequest, + options?: Configuration + ): Promise { + const requestContextPromise = + this.requestFactory.listPermanentRetentionFilters(param.appId, options); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.listPermanentRetentionFilters( + responseContext + ); + }); + }); + } + /** * Get the list of RUM retention filters for a RUM application. * @param param The request object @@ -864,6 +1286,34 @@ export class RumRetentionFiltersApi { }); } + /** + * 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 param The request object + */ + public updatePermanentRetentionFilter( + param: RumRetentionFiltersApiUpdatePermanentRetentionFilterRequest, + options?: Configuration + ): Promise { + const requestContextPromise = + this.requestFactory.updatePermanentRetentionFilter( + param.appId, + param.permanentRfId, + param.body, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.updatePermanentRetentionFilter( + responseContext + ); + }); + }); + } + /** * Update a RUM retention filter for a RUM application. * Returns RUM retention filter objects from the request body when the request is successful. diff --git a/packages/datadog-api-client-v2/index.ts b/packages/datadog-api-client-v2/index.ts index b290fe58d242..3e2e1d5e1def 100644 --- a/packages/datadog-api-client-v2/index.ts +++ b/packages/datadog-api-client-v2/index.ts @@ -1128,9 +1128,12 @@ export { export { RumRetentionFiltersApiCreateRetentionFilterRequest, RumRetentionFiltersApiDeleteRetentionFilterRequest, + RumRetentionFiltersApiGetPermanentRetentionFilterRequest, RumRetentionFiltersApiGetRetentionFilterRequest, + RumRetentionFiltersApiListPermanentRetentionFiltersRequest, RumRetentionFiltersApiListRetentionFiltersRequest, RumRetentionFiltersApiOrderRetentionFiltersRequest, + RumRetentionFiltersApiUpdatePermanentRetentionFilterRequest, RumRetentionFiltersApiUpdateRetentionFilterRequest, RumRetentionFiltersApi, } from "./apis/RumRetentionFiltersApi"; @@ -5975,6 +5978,16 @@ export { RumMetricUpdateAttributes } from "./models/RumMetricUpdateAttributes"; export { RumMetricUpdateCompute } from "./models/RumMetricUpdateCompute"; export { RumMetricUpdateData } from "./models/RumMetricUpdateData"; export { RumMetricUpdateRequest } from "./models/RumMetricUpdateRequest"; +export { RumPermanentRetentionFilterAttributes } from "./models/RumPermanentRetentionFilterAttributes"; +export { RumPermanentRetentionFilterData } from "./models/RumPermanentRetentionFilterData"; +export { RumPermanentRetentionFilterEditability } from "./models/RumPermanentRetentionFilterEditability"; +export { RumPermanentRetentionFilterID } from "./models/RumPermanentRetentionFilterID"; +export { RumPermanentRetentionFilterResponse } from "./models/RumPermanentRetentionFilterResponse"; +export { RumPermanentRetentionFiltersResponse } from "./models/RumPermanentRetentionFiltersResponse"; +export { RumPermanentRetentionFilterType } from "./models/RumPermanentRetentionFilterType"; +export { RumPermanentRetentionFilterUpdateAttributes } from "./models/RumPermanentRetentionFilterUpdateAttributes"; +export { RumPermanentRetentionFilterUpdateData } from "./models/RumPermanentRetentionFilterUpdateData"; +export { RumPermanentRetentionFilterUpdateRequest } from "./models/RumPermanentRetentionFilterUpdateRequest"; export { RUMProductAnalyticsRetentionScale } from "./models/RUMProductAnalyticsRetentionScale"; export { RUMProductAnalyticsRetentionState } from "./models/RUMProductAnalyticsRetentionState"; export { RUMProductScales } from "./models/RUMProductScales"; diff --git a/packages/datadog-api-client-v2/models/ObjectSerializer.ts b/packages/datadog-api-client-v2/models/ObjectSerializer.ts index a09c9a196e52..1ed01ce29e8a 100644 --- a/packages/datadog-api-client-v2/models/ObjectSerializer.ts +++ b/packages/datadog-api-client-v2/models/ObjectSerializer.ts @@ -3391,6 +3391,14 @@ import { RumMetricUpdateCompute } from "./RumMetricUpdateCompute"; import { RumMetricUpdateData } from "./RumMetricUpdateData"; import { RumMetricUpdateRequest } from "./RumMetricUpdateRequest"; import { RumMetricsResponse } from "./RumMetricsResponse"; +import { RumPermanentRetentionFilterAttributes } from "./RumPermanentRetentionFilterAttributes"; +import { RumPermanentRetentionFilterData } from "./RumPermanentRetentionFilterData"; +import { RumPermanentRetentionFilterEditability } from "./RumPermanentRetentionFilterEditability"; +import { RumPermanentRetentionFilterResponse } from "./RumPermanentRetentionFilterResponse"; +import { RumPermanentRetentionFilterUpdateAttributes } from "./RumPermanentRetentionFilterUpdateAttributes"; +import { RumPermanentRetentionFilterUpdateData } from "./RumPermanentRetentionFilterUpdateData"; +import { RumPermanentRetentionFilterUpdateRequest } from "./RumPermanentRetentionFilterUpdateRequest"; +import { RumPermanentRetentionFiltersResponse } from "./RumPermanentRetentionFiltersResponse"; import { RumRetentionFilterAttributes } from "./RumRetentionFilterAttributes"; import { RumRetentionFilterCreateAttributes } from "./RumRetentionFilterCreateAttributes"; import { RumRetentionFilterCreateData } from "./RumRetentionFilterCreateData"; @@ -6409,6 +6417,12 @@ const enumsMap: { [key: string]: any[] } = { ], RumMetricType: ["rum_metrics"], RumMetricUniquenessWhen: ["match", "end"], + RumPermanentRetentionFilterID: [ + "rum_apm_flat_sampling", + "synthetics_sessions", + "forced_replay_sessions", + ], + RumPermanentRetentionFilterType: ["permanent_retention_filters"], RumRetentionFilterEventType: [ "session", "view", @@ -11246,6 +11260,17 @@ const typeMap: { [index: string]: any } = { RumMetricUpdateData: RumMetricUpdateData, RumMetricUpdateRequest: RumMetricUpdateRequest, RumMetricsResponse: RumMetricsResponse, + RumPermanentRetentionFilterAttributes: RumPermanentRetentionFilterAttributes, + RumPermanentRetentionFilterData: RumPermanentRetentionFilterData, + RumPermanentRetentionFilterEditability: + RumPermanentRetentionFilterEditability, + RumPermanentRetentionFilterResponse: RumPermanentRetentionFilterResponse, + RumPermanentRetentionFilterUpdateAttributes: + RumPermanentRetentionFilterUpdateAttributes, + RumPermanentRetentionFilterUpdateData: RumPermanentRetentionFilterUpdateData, + RumPermanentRetentionFilterUpdateRequest: + RumPermanentRetentionFilterUpdateRequest, + RumPermanentRetentionFiltersResponse: RumPermanentRetentionFiltersResponse, RumRetentionFilterAttributes: RumRetentionFilterAttributes, RumRetentionFilterCreateAttributes: RumRetentionFilterCreateAttributes, RumRetentionFilterCreateData: RumRetentionFilterCreateData, diff --git a/packages/datadog-api-client-v2/models/RumPermanentRetentionFilterAttributes.ts b/packages/datadog-api-client-v2/models/RumPermanentRetentionFilterAttributes.ts new file mode 100644 index 000000000000..2fc65365c183 --- /dev/null +++ b/packages/datadog-api-client-v2/models/RumPermanentRetentionFilterAttributes.ts @@ -0,0 +1,78 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { RumCrossProductSampling } from "./RumCrossProductSampling"; +import { RumPermanentRetentionFilterEditability } from "./RumPermanentRetentionFilterEditability"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The attributes of a permanent RUM retention filter. + */ +export class RumPermanentRetentionFilterAttributes { + /** + * The configuration for cross-product retention filters. + */ + "crossProductSampling"?: RumCrossProductSampling; + /** + * A description of what the filter retains. + */ + "description"?: string; + /** + * Indicates which cross-product fields of a permanent RUM retention filter can be updated. + */ + "editability"?: RumPermanentRetentionFilterEditability; + /** + * The display name of the permanent retention filter. + */ + "name"?: string; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + crossProductSampling: { + baseName: "cross_product_sampling", + type: "RumCrossProductSampling", + }, + description: { + baseName: "description", + type: "string", + }, + editability: { + baseName: "editability", + type: "RumPermanentRetentionFilterEditability", + }, + name: { + baseName: "name", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return RumPermanentRetentionFilterAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/RumPermanentRetentionFilterData.ts b/packages/datadog-api-client-v2/models/RumPermanentRetentionFilterData.ts new file mode 100644 index 000000000000..9cab59286b5c --- /dev/null +++ b/packages/datadog-api-client-v2/models/RumPermanentRetentionFilterData.ts @@ -0,0 +1,71 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { RumPermanentRetentionFilterAttributes } from "./RumPermanentRetentionFilterAttributes"; +import { RumPermanentRetentionFilterID } from "./RumPermanentRetentionFilterID"; +import { RumPermanentRetentionFilterType } from "./RumPermanentRetentionFilterType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * A permanent RUM retention filter. + */ +export class RumPermanentRetentionFilterData { + /** + * The attributes of a permanent RUM retention filter. + */ + "attributes"?: RumPermanentRetentionFilterAttributes; + /** + * The identifier of a permanent RUM retention filter. + */ + "id"?: RumPermanentRetentionFilterID; + /** + * The type of the resource. The value should always be `permanent_retention_filters`. + */ + "type"?: RumPermanentRetentionFilterType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "RumPermanentRetentionFilterAttributes", + }, + id: { + baseName: "id", + type: "RumPermanentRetentionFilterID", + }, + type: { + baseName: "type", + type: "RumPermanentRetentionFilterType", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return RumPermanentRetentionFilterData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/RumPermanentRetentionFilterEditability.ts b/packages/datadog-api-client-v2/models/RumPermanentRetentionFilterEditability.ts new file mode 100644 index 000000000000..0fdd18b74f56 --- /dev/null +++ b/packages/datadog-api-client-v2/models/RumPermanentRetentionFilterEditability.ts @@ -0,0 +1,52 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Indicates which cross-product fields of a permanent RUM retention filter can be updated. + */ +export class RumPermanentRetentionFilterEditability { + /** + * Whether the APM trace cross-product configuration of the filter can be updated. + */ + "traceEditable"?: boolean; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + traceEditable: { + baseName: "trace_editable", + type: "boolean", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return RumPermanentRetentionFilterEditability.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/RumPermanentRetentionFilterID.ts b/packages/datadog-api-client-v2/models/RumPermanentRetentionFilterID.ts new file mode 100644 index 000000000000..d533600a5230 --- /dev/null +++ b/packages/datadog-api-client-v2/models/RumPermanentRetentionFilterID.ts @@ -0,0 +1,20 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * The identifier of a permanent RUM retention filter. + */ + +export type RumPermanentRetentionFilterID = + | typeof RUM_APM_FLAT_SAMPLING + | typeof SYNTHETICS_SESSIONS + | typeof FORCED_REPLAY_SESSIONS + | UnparsedObject; +export const RUM_APM_FLAT_SAMPLING = "rum_apm_flat_sampling"; +export const SYNTHETICS_SESSIONS = "synthetics_sessions"; +export const FORCED_REPLAY_SESSIONS = "forced_replay_sessions"; diff --git a/packages/datadog-api-client-v2/models/RumPermanentRetentionFilterResponse.ts b/packages/datadog-api-client-v2/models/RumPermanentRetentionFilterResponse.ts new file mode 100644 index 000000000000..21a45451d9d1 --- /dev/null +++ b/packages/datadog-api-client-v2/models/RumPermanentRetentionFilterResponse.ts @@ -0,0 +1,53 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { RumPermanentRetentionFilterData } from "./RumPermanentRetentionFilterData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * A permanent RUM retention filter object. + */ +export class RumPermanentRetentionFilterResponse { + /** + * A permanent RUM retention filter. + */ + "data"?: RumPermanentRetentionFilterData; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "RumPermanentRetentionFilterData", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return RumPermanentRetentionFilterResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/RumPermanentRetentionFilterType.ts b/packages/datadog-api-client-v2/models/RumPermanentRetentionFilterType.ts new file mode 100644 index 000000000000..cdc12d1f8ba0 --- /dev/null +++ b/packages/datadog-api-client-v2/models/RumPermanentRetentionFilterType.ts @@ -0,0 +1,16 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * The type of the resource. The value should always be `permanent_retention_filters`. + */ + +export type RumPermanentRetentionFilterType = + | typeof PERMANENT_RETENTION_FILTERS + | UnparsedObject; +export const PERMANENT_RETENTION_FILTERS = "permanent_retention_filters"; diff --git a/packages/datadog-api-client-v2/models/RumPermanentRetentionFilterUpdateAttributes.ts b/packages/datadog-api-client-v2/models/RumPermanentRetentionFilterUpdateAttributes.ts new file mode 100644 index 000000000000..03e64da07b9a --- /dev/null +++ b/packages/datadog-api-client-v2/models/RumPermanentRetentionFilterUpdateAttributes.ts @@ -0,0 +1,53 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { RumCrossProductSamplingUpdate } from "./RumCrossProductSamplingUpdate"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The configuration to update on a permanent RUM retention filter. + */ +export class RumPermanentRetentionFilterUpdateAttributes { + /** + * The configuration for cross-product retention filters. All fields are optional for partial updates. + */ + "crossProductSampling"?: RumCrossProductSamplingUpdate; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + crossProductSampling: { + baseName: "cross_product_sampling", + type: "RumCrossProductSamplingUpdate", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return RumPermanentRetentionFilterUpdateAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/RumPermanentRetentionFilterUpdateData.ts b/packages/datadog-api-client-v2/models/RumPermanentRetentionFilterUpdateData.ts new file mode 100644 index 000000000000..6a76a99418fd --- /dev/null +++ b/packages/datadog-api-client-v2/models/RumPermanentRetentionFilterUpdateData.ts @@ -0,0 +1,74 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { RumPermanentRetentionFilterID } from "./RumPermanentRetentionFilterID"; +import { RumPermanentRetentionFilterType } from "./RumPermanentRetentionFilterType"; +import { RumPermanentRetentionFilterUpdateAttributes } from "./RumPermanentRetentionFilterUpdateAttributes"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The new permanent RUM retention filter configuration to update. + */ +export class RumPermanentRetentionFilterUpdateData { + /** + * The configuration to update on a permanent RUM retention filter. + */ + "attributes": RumPermanentRetentionFilterUpdateAttributes; + /** + * The identifier of a permanent RUM retention filter. + */ + "id": RumPermanentRetentionFilterID; + /** + * The type of the resource. The value should always be `permanent_retention_filters`. + */ + "type": RumPermanentRetentionFilterType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "RumPermanentRetentionFilterUpdateAttributes", + required: true, + }, + id: { + baseName: "id", + type: "RumPermanentRetentionFilterID", + required: true, + }, + type: { + baseName: "type", + type: "RumPermanentRetentionFilterType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return RumPermanentRetentionFilterUpdateData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/RumPermanentRetentionFilterUpdateRequest.ts b/packages/datadog-api-client-v2/models/RumPermanentRetentionFilterUpdateRequest.ts new file mode 100644 index 000000000000..b3248898bdde --- /dev/null +++ b/packages/datadog-api-client-v2/models/RumPermanentRetentionFilterUpdateRequest.ts @@ -0,0 +1,54 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { RumPermanentRetentionFilterUpdateData } from "./RumPermanentRetentionFilterUpdateData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The permanent RUM retention filter body to update. + */ +export class RumPermanentRetentionFilterUpdateRequest { + /** + * The new permanent RUM retention filter configuration to update. + */ + "data": RumPermanentRetentionFilterUpdateData; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "RumPermanentRetentionFilterUpdateData", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return RumPermanentRetentionFilterUpdateRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/RumPermanentRetentionFiltersResponse.ts b/packages/datadog-api-client-v2/models/RumPermanentRetentionFiltersResponse.ts new file mode 100644 index 000000000000..7337e712c62e --- /dev/null +++ b/packages/datadog-api-client-v2/models/RumPermanentRetentionFiltersResponse.ts @@ -0,0 +1,53 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { RumPermanentRetentionFilterData } from "./RumPermanentRetentionFilterData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * All permanent RUM retention filters for a RUM application. + */ +export class RumPermanentRetentionFiltersResponse { + /** + * A list of permanent RUM retention filters. + */ + "data"?: Array; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "Array", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return RumPermanentRetentionFiltersResponse.attributeTypeMap; + } + + public constructor() {} +}