diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 9b5a962d1755..3a9854f2a8d2 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -1767,6 +1767,20 @@ components: required: true schema: type: string + RumExclusionFilterApplicationIDParameter: + description: RUM application ID. + in: path + name: app_id + required: true + schema: + type: string + RumExclusionFilterIDParameter: + description: Exclusion filter ID. + in: path + name: ef_id + required: true + schema: + type: string RumMetricIDParameter: description: The name of the RUM-based metric. in: path @@ -2239,6 +2253,12 @@ components: schema: $ref: "#/components/schemas/APIErrorResponse" description: Failed Precondition + RumExclusionFilterMethodNotAllowedResponse: + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Method Not Allowed SpansBadRequestResponse: content: application/json: @@ -91984,6 +92004,185 @@ components: minimum: 0 type: number type: object + RumExclusionFilterAttributes: + description: The attributes of an exclusion filter. + properties: + enabled: + $ref: "#/components/schemas/RumExclusionFilterEnabled" + event_type: + $ref: "#/components/schemas/RumExclusionFilterEventType" + name: + $ref: "#/components/schemas/RumExclusionFilterName" + query: + $ref: "#/components/schemas/RumExclusionFilterQuery" + type: object + RumExclusionFilterCreateAttributes: + description: The attributes of an exclusion filter to create. + properties: + enabled: + description: Whether the exclusion filter is active. Defaults to `true`. + example: true + type: boolean + event_type: + $ref: "#/components/schemas/RumExclusionFilterEventType" + name: + $ref: "#/components/schemas/RumExclusionFilterName" + query: + $ref: "#/components/schemas/RumExclusionFilterQuery" + required: + - name + type: object + RumExclusionFilterCreateData: + description: The new exclusion filter properties to create. + properties: + attributes: + $ref: "#/components/schemas/RumExclusionFilterCreateAttributes" + type: + $ref: "#/components/schemas/RumExclusionFilterType" + required: + - type + - attributes + type: object + RumExclusionFilterCreateRequest: + description: The exclusion filter body to create. + properties: + data: + $ref: "#/components/schemas/RumExclusionFilterCreateData" + required: + - data + type: object + RumExclusionFilterData: + description: An exclusion filter. + properties: + attributes: + $ref: "#/components/schemas/RumExclusionFilterAttributes" + id: + description: The ID of the exclusion filter. + example: "051601eb-54a0-abc0-03f9-cc02efa18892" + type: string + meta: + $ref: "#/components/schemas/RumExclusionFilterMeta" + type: + $ref: "#/components/schemas/RumExclusionFilterType" + required: + - id + - type + type: object + RumExclusionFilterEnabled: + description: Whether the exclusion filter is active. + example: true + type: boolean + RumExclusionFilterEventType: + description: The type of RUM events to filter on. + enum: + - session + - view + - action + - error + - resource + - long_task + - vital + example: error + type: string + x-enum-varnames: + - SESSION + - VIEW + - ACTION + - ERROR + - RESOURCE + - LONG_TASK + - VITAL + RumExclusionFilterMeta: + description: Metadata about the exclusion filter. + properties: + enabled_at: + description: Unix epoch (in milliseconds) when the exclusion filter was last enabled. + example: 1735689600000 + format: int64 + type: integer + updated_at: + description: Unix epoch (in milliseconds) of the last update. + example: 1735689600000 + format: int64 + type: integer + updated_by_handle: + description: Handle of the user who last updated the exclusion filter. + example: jane.doe@example.com + type: string + type: object + RumExclusionFilterName: + description: The name of the exclusion filter. + example: Exclude noisy browser extension errors + type: string + RumExclusionFilterQuery: + description: |- + Additional query used to further restrict which RUM events are excluded. + Combined with `event_type` when both are provided. + example: "@error.message:*extension*" + type: string + RumExclusionFilterResponse: + description: An exclusion filter response body. + properties: + data: + $ref: "#/components/schemas/RumExclusionFilterData" + type: object + RumExclusionFilterType: + default: exclusion_filters + description: The resource type. The value must be `exclusion_filters`. + enum: + - exclusion_filters + example: exclusion_filters + type: string + x-enum-varnames: + - EXCLUSION_FILTERS + RumExclusionFilterUpdateAttributes: + description: |- + The attributes of an exclusion filter that can be updated. + For the built-in Error Tracking exclusion filter, only `enabled` can be set; + `name`, `event_type`, and `query` must be omitted. + properties: + enabled: + $ref: "#/components/schemas/RumExclusionFilterEnabled" + event_type: + $ref: "#/components/schemas/RumExclusionFilterEventType" + name: + $ref: "#/components/schemas/RumExclusionFilterName" + query: + $ref: "#/components/schemas/RumExclusionFilterQuery" + type: object + RumExclusionFilterUpdateData: + description: The exclusion filter properties to update. + properties: + attributes: + $ref: "#/components/schemas/RumExclusionFilterUpdateAttributes" + id: + description: The ID of the exclusion filter. Must match the `ef_id` path parameter. + example: "051601eb-54a0-abc0-03f9-cc02efa18892" + type: string + type: + $ref: "#/components/schemas/RumExclusionFilterType" + required: + - id + - type + - attributes + type: object + RumExclusionFilterUpdateRequest: + description: The exclusion filter body to update. + properties: + data: + $ref: "#/components/schemas/RumExclusionFilterUpdateData" + required: + - data + type: object + RumExclusionFiltersResponse: + description: All exclusion filters for a RUM application. + properties: + data: + description: A list of exclusion filters. + items: + $ref: "#/components/schemas/RumExclusionFilterData" + type: array + type: object RumMetricCompute: description: The compute rule to compute the RUM-based metric. properties: @@ -186626,6 +186825,248 @@ paths: tags: - Rum Retention Filters x-codegen-request-body-name: body + /api/v2/rum/applications/{app_id}/retention_filters/exclusion: + get: + description: |- + Get the list of exclusion filters for a RUM application. + The built-in Error Tracking exclusion filter (`error_tracking_exclusion_filter`) is always returned first. + operationId: ListExclusionFilters + parameters: + - $ref: "#/components/parameters/RumExclusionFilterApplicationIDParameter" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + enabled: true + name: Ignored / Excluded errors from Error Tracking + id: error_tracking_exclusion_filter + meta: + enabled_at: 1735689600000 + updated_at: 1735689600000 + updated_by_handle: jane.doe@example.com + type: exclusion_filters + - attributes: + enabled: true + event_type: error + name: Exclude noisy browser extension errors + query: "@error.message:*extension*" + id: "051601eb-54a0-abc0-03f9-cc02efa18892" + meta: + enabled_at: 1735689600000 + updated_at: 1735689600000 + updated_by_handle: jane.doe@example.com + type: exclusion_filters + schema: + $ref: "#/components/schemas/RumExclusionFiltersResponse" + description: OK + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Get all RUM exclusion filters + tags: + - Rum Retention Filters + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + post: + description: |- + Create an exclusion filter for a RUM application. + Returns the created exclusion filter when the request is successful. + operationId: CreateExclusionFilter + parameters: + - $ref: "#/components/parameters/RumExclusionFilterApplicationIDParameter" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + enabled: true + event_type: error + name: Exclude noisy browser extension errors + query: "@error.message:*extension*" + type: exclusion_filters + schema: + $ref: "#/components/schemas/RumExclusionFilterCreateRequest" + description: The definition of the new RUM exclusion filter. + required: true + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + attributes: + enabled: true + event_type: error + name: Exclude noisy browser extension errors + query: "@error.message:*extension*" + id: "051601eb-54a0-abc0-03f9-cc02efa18892" + meta: + enabled_at: 1735689600000 + updated_at: 1735689600000 + updated_by_handle: jane.doe@example.com + type: exclusion_filters + schema: + $ref: "#/components/schemas/RumExclusionFilterResponse" + description: Created + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Create a RUM exclusion filter + tags: + - Rum Retention Filters + x-codegen-request-body-name: body + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/rum/applications/{app_id}/retention_filters/exclusion/{ef_id}: + delete: + description: |- + Delete an exclusion filter for a RUM application. + The built-in Error Tracking exclusion filter (`error_tracking_exclusion_filter`) cannot be deleted; + attempting to do so returns a `405 Method Not Allowed` response. + operationId: DeleteExclusionFilter + parameters: + - $ref: "#/components/parameters/RumExclusionFilterApplicationIDParameter" + - $ref: "#/components/parameters/RumExclusionFilterIDParameter" + responses: + "204": + description: No Content + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "405": + $ref: "#/components/responses/RumExclusionFilterMethodNotAllowedResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Delete a RUM exclusion filter + tags: + - Rum Retention Filters + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + get: + description: Get a single exclusion filter for a RUM application. + operationId: GetExclusionFilter + parameters: + - $ref: "#/components/parameters/RumExclusionFilterApplicationIDParameter" + - $ref: "#/components/parameters/RumExclusionFilterIDParameter" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + enabled: true + event_type: error + name: Exclude noisy browser extension errors + query: "@error.message:*extension*" + id: "051601eb-54a0-abc0-03f9-cc02efa18892" + meta: + enabled_at: 1735689600000 + updated_at: 1735689600000 + updated_by_handle: jane.doe@example.com + type: exclusion_filters + schema: + $ref: "#/components/schemas/RumExclusionFilterResponse" + description: OK + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Get a RUM exclusion filter + tags: + - Rum Retention Filters + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + patch: + description: |- + Update an exclusion filter for a RUM application. + For the built-in Error Tracking exclusion filter (`error_tracking_exclusion_filter`), only `enabled` can be + updated; `name`, `event_type`, and `query` must be omitted. + Returns the updated exclusion filter when the request is successful. + operationId: UpdateExclusionFilter + parameters: + - $ref: "#/components/parameters/RumExclusionFilterApplicationIDParameter" + - $ref: "#/components/parameters/RumExclusionFilterIDParameter" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + enabled: false + event_type: error + name: Exclude noisy browser extension errors + query: "@error.message:*extension*" + id: "051601eb-54a0-abc0-03f9-cc02efa18892" + type: exclusion_filters + schema: + $ref: "#/components/schemas/RumExclusionFilterUpdateRequest" + description: New definition of the RUM exclusion filter. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + enabled: false + event_type: error + name: Exclude noisy browser extension errors + query: "@error.message:*extension*" + id: "051601eb-54a0-abc0-03f9-cc02efa18892" + meta: + enabled_at: 1735689600000 + updated_at: 1735689600000 + updated_by_handle: jane.doe@example.com + type: exclusion_filters + schema: + $ref: "#/components/schemas/RumExclusionFilterResponse" + description: Updated + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "409": + $ref: "#/components/responses/ConflictResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Update a RUM exclusion filter + tags: + - Rum Retention Filters + x-codegen-request-body-name: body + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/rum/applications/{app_id}/retention_filters/permanent: get: description: |- diff --git a/examples/v2/rum-retention-filters/CreateExclusionFilter.rb b/examples/v2/rum-retention-filters/CreateExclusionFilter.rb new file mode 100644 index 000000000000..826625d2772a --- /dev/null +++ b/examples/v2/rum-retention-filters/CreateExclusionFilter.rb @@ -0,0 +1,20 @@ +# Create a RUM exclusion filter returns "Created" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.create_exclusion_filter".to_sym] = true +end +api_instance = DatadogAPIClient::V2::RumRetentionFiltersAPI.new + +body = DatadogAPIClient::V2::RumExclusionFilterCreateRequest.new({ + data: DatadogAPIClient::V2::RumExclusionFilterCreateData.new({ + attributes: DatadogAPIClient::V2::RumExclusionFilterCreateAttributes.new({ + enabled: true, + event_type: DatadogAPIClient::V2::RumExclusionFilterEventType::ERROR, + name: "Exclude noisy browser extension errors", + query: "@error.message:*extension*", + }), + type: DatadogAPIClient::V2::RumExclusionFilterType::EXCLUSION_FILTERS, + }), +}) +p api_instance.create_exclusion_filter("app_id", body) diff --git a/examples/v2/rum-retention-filters/DeleteExclusionFilter.rb b/examples/v2/rum-retention-filters/DeleteExclusionFilter.rb new file mode 100644 index 000000000000..bcfd32637ade --- /dev/null +++ b/examples/v2/rum-retention-filters/DeleteExclusionFilter.rb @@ -0,0 +1,8 @@ +# Delete a RUM exclusion filter returns "No Content" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.delete_exclusion_filter".to_sym] = true +end +api_instance = DatadogAPIClient::V2::RumRetentionFiltersAPI.new +api_instance.delete_exclusion_filter("app_id", "ef_id") diff --git a/examples/v2/rum-retention-filters/GetExclusionFilter.rb b/examples/v2/rum-retention-filters/GetExclusionFilter.rb new file mode 100644 index 000000000000..0514b9057151 --- /dev/null +++ b/examples/v2/rum-retention-filters/GetExclusionFilter.rb @@ -0,0 +1,8 @@ +# Get a RUM exclusion filter returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.get_exclusion_filter".to_sym] = true +end +api_instance = DatadogAPIClient::V2::RumRetentionFiltersAPI.new +p api_instance.get_exclusion_filter("app_id", "ef_id") diff --git a/examples/v2/rum-retention-filters/ListExclusionFilters.rb b/examples/v2/rum-retention-filters/ListExclusionFilters.rb new file mode 100644 index 000000000000..953a4ee594ea --- /dev/null +++ b/examples/v2/rum-retention-filters/ListExclusionFilters.rb @@ -0,0 +1,8 @@ +# Get all RUM exclusion filters returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_exclusion_filters".to_sym] = true +end +api_instance = DatadogAPIClient::V2::RumRetentionFiltersAPI.new +p api_instance.list_exclusion_filters("app_id") diff --git a/examples/v2/rum-retention-filters/UpdateExclusionFilter.rb b/examples/v2/rum-retention-filters/UpdateExclusionFilter.rb new file mode 100644 index 000000000000..b20fac41009a --- /dev/null +++ b/examples/v2/rum-retention-filters/UpdateExclusionFilter.rb @@ -0,0 +1,21 @@ +# Update a RUM exclusion filter returns "Updated" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.update_exclusion_filter".to_sym] = true +end +api_instance = DatadogAPIClient::V2::RumRetentionFiltersAPI.new + +body = DatadogAPIClient::V2::RumExclusionFilterUpdateRequest.new({ + data: DatadogAPIClient::V2::RumExclusionFilterUpdateData.new({ + attributes: DatadogAPIClient::V2::RumExclusionFilterUpdateAttributes.new({ + enabled: true, + event_type: DatadogAPIClient::V2::RumExclusionFilterEventType::ERROR, + name: "Exclude noisy browser extension errors", + query: "@error.message:*extension*", + }), + id: "051601eb-54a0-abc0-03f9-cc02efa18892", + type: DatadogAPIClient::V2::RumExclusionFilterType::EXCLUSION_FILTERS, + }), +}) +p api_instance.update_exclusion_filter("app_id", "ef_id", body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index fc9295484297..d3970647ab1d 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -5448,6 +5448,26 @@ "app_id" => "String", "body" => "RumRetentionFilterCreateRequest", }, + "v2.ListExclusionFilters" => { + "app_id" => "String", + }, + "v2.CreateExclusionFilter" => { + "app_id" => "String", + "body" => "RumExclusionFilterCreateRequest", + }, + "v2.DeleteExclusionFilter" => { + "app_id" => "String", + "ef_id" => "String", + }, + "v2.GetExclusionFilter" => { + "app_id" => "String", + "ef_id" => "String", + }, + "v2.UpdateExclusionFilter" => { + "app_id" => "String", + "ef_id" => "String", + "body" => "RumExclusionFilterUpdateRequest", + }, "v2.ListPermanentRetentionFilters" => { "app_id" => "String", }, diff --git a/features/v2/rum_retention_filters.feature b/features/v2/rum_retention_filters.feature index 9c41dcedc0d0..e9823f588cfe 100644 --- a/features/v2/rum_retention_filters.feature +++ b/features/v2/rum_retention_filters.feature @@ -9,6 +9,24 @@ Feature: Rum Retention Filters And a valid "appKeyAuth" key in the system And an instance of "RumRetentionFilters" API + @generated @skip @team:DataDog/rum-backend + Scenario: Create a RUM exclusion filter returns "Bad Request" response + Given operation "CreateExclusionFilter" enabled + And new "CreateExclusionFilter" request + And request contains "app_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"enabled": true, "event_type": "error", "name": "Exclude noisy browser extension errors", "query": "@error.message:*extension*"}, "type": "exclusion_filters"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/rum-backend + Scenario: Create a RUM exclusion filter returns "Created" response + Given operation "CreateExclusionFilter" enabled + And new "CreateExclusionFilter" request + And request contains "app_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"enabled": true, "event_type": "error", "name": "Exclude noisy browser extension errors", "query": "@error.message:*extension*"}, "type": "exclusion_filters"}} + When the request is sent + Then the response status is 201 Created + @team:DataDog/rum-backend Scenario: Create a RUM retention filter returns "Bad Request" response Given new "CreateRetentionFilter" request @@ -31,6 +49,33 @@ 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 50 + @generated @skip @team:DataDog/rum-backend + Scenario: Delete a RUM exclusion filter returns "Method Not Allowed" response + Given operation "DeleteExclusionFilter" enabled + And new "DeleteExclusionFilter" request + And request contains "app_id" parameter from "REPLACE.ME" + And request contains "ef_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 405 Method Not Allowed + + @generated @skip @team:DataDog/rum-backend + Scenario: Delete a RUM exclusion filter returns "No Content" response + Given operation "DeleteExclusionFilter" enabled + And new "DeleteExclusionFilter" request + And request contains "app_id" parameter from "REPLACE.ME" + And request contains "ef_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/rum-backend + Scenario: Delete a RUM exclusion filter returns "Not Found" response + Given operation "DeleteExclusionFilter" enabled + And new "DeleteExclusionFilter" request + And request contains "app_id" parameter from "REPLACE.ME" + And request contains "ef_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + @replay-only @team:DataDog/rum-backend Scenario: Delete a RUM retention filter returns "No Content" response Given new "DeleteRetentionFilter" request @@ -47,6 +92,24 @@ Feature: Rum Retention Filters When the request is sent Then the response status is 404 Not Found + @generated @skip @team:DataDog/rum-backend + Scenario: Get a RUM exclusion filter returns "Not Found" response + Given operation "GetExclusionFilter" enabled + And new "GetExclusionFilter" request + And request contains "app_id" parameter from "REPLACE.ME" + And request contains "ef_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 RUM exclusion filter returns "OK" response + Given operation "GetExclusionFilter" enabled + And new "GetExclusionFilter" request + And request contains "app_id" parameter from "REPLACE.ME" + And request contains "ef_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @team:DataDog/rum-backend Scenario: Get a RUM retention filter returns "Not Found" response Given new "GetRetentionFilter" request @@ -86,6 +149,14 @@ Feature: Rum Retention Filters When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/rum-backend + Scenario: Get all RUM exclusion filters returns "OK" response + Given operation "ListExclusionFilters" enabled + And new "ListExclusionFilters" request + And request contains "app_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 @@ -120,6 +191,46 @@ Feature: Rum Retention Filters And the response "data[1].id" is equal to "42d89430-5b80-426e-a44b-ba3b417ece25" And the response "data[2].id" is equal to "bff0bc34-99e9-4c16-adce-f47e71948c23" + @generated @skip @team:DataDog/rum-backend + Scenario: Update a RUM exclusion filter returns "Bad Request" response + Given operation "UpdateExclusionFilter" enabled + And new "UpdateExclusionFilter" request + And request contains "app_id" parameter from "REPLACE.ME" + And request contains "ef_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"enabled": true, "event_type": "error", "name": "Exclude noisy browser extension errors", "query": "@error.message:*extension*"}, "id": "051601eb-54a0-abc0-03f9-cc02efa18892", "type": "exclusion_filters"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/rum-backend + Scenario: Update a RUM exclusion filter returns "Conflict" response + Given operation "UpdateExclusionFilter" enabled + And new "UpdateExclusionFilter" request + And request contains "app_id" parameter from "REPLACE.ME" + And request contains "ef_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"enabled": true, "event_type": "error", "name": "Exclude noisy browser extension errors", "query": "@error.message:*extension*"}, "id": "051601eb-54a0-abc0-03f9-cc02efa18892", "type": "exclusion_filters"}} + When the request is sent + Then the response status is 409 Conflict + + @generated @skip @team:DataDog/rum-backend + Scenario: Update a RUM exclusion filter returns "Not Found" response + Given operation "UpdateExclusionFilter" enabled + And new "UpdateExclusionFilter" request + And request contains "app_id" parameter from "REPLACE.ME" + And request contains "ef_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"enabled": true, "event_type": "error", "name": "Exclude noisy browser extension errors", "query": "@error.message:*extension*"}, "id": "051601eb-54a0-abc0-03f9-cc02efa18892", "type": "exclusion_filters"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/rum-backend + Scenario: Update a RUM exclusion filter returns "Updated" response + Given operation "UpdateExclusionFilter" enabled + And new "UpdateExclusionFilter" request + And request contains "app_id" parameter from "REPLACE.ME" + And request contains "ef_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"enabled": true, "event_type": "error", "name": "Exclude noisy browser extension errors", "query": "@error.message:*extension*"}, "id": "051601eb-54a0-abc0-03f9-cc02efa18892", "type": "exclusion_filters"}} + When the request is sent + Then the response status is 200 Updated + @team:DataDog/rum-backend Scenario: Update a RUM retention filter returns "Bad Request" response Given new "UpdateRetentionFilter" request diff --git a/features/v2/undo.json b/features/v2/undo.json index b10abaebef67..c0e6d0d910ce 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -7037,6 +7037,36 @@ "type": "safe" } }, + "ListExclusionFilters": { + "tag": "Rum Retention Filters", + "undo": { + "type": "safe" + } + }, + "CreateExclusionFilter": { + "tag": "Rum Retention Filters", + "undo": { + "type": "safe" + } + }, + "DeleteExclusionFilter": { + "tag": "Rum Retention Filters", + "undo": { + "type": "idempotent" + } + }, + "GetExclusionFilter": { + "tag": "Rum Retention Filters", + "undo": { + "type": "safe" + } + }, + "UpdateExclusionFilter": { + "tag": "Rum Retention Filters", + "undo": { + "type": "idempotent" + } + }, "ListPermanentRetentionFilters": { "tag": "Rum Retention Filters", "undo": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index 6c0f12734f5d..3bb7a21d3ed6 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -687,6 +687,11 @@ def initialize "v2.get_sourcemaps": false, "v2.list_sourcemaps": false, "v2.restore_sourcemaps": false, + "v2.create_exclusion_filter": false, + "v2.delete_exclusion_filter": false, + "v2.get_exclusion_filter": false, + "v2.list_exclusion_filters": false, + "v2.update_exclusion_filter": false, "v2.create_rum_config": false, "v2.get_rum_config": false, "v2.update_rum_config": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 105d969ef8bb..bdad065ffc9a 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -6705,6 +6705,19 @@ def overrides "v2.rum_event_processing_state" => "RUMEventProcessingState", "v2.rum_events_response" => "RUMEventsResponse", "v2.rum_event_type" => "RUMEventType", + "v2.rum_exclusion_filter_attributes" => "RumExclusionFilterAttributes", + "v2.rum_exclusion_filter_create_attributes" => "RumExclusionFilterCreateAttributes", + "v2.rum_exclusion_filter_create_data" => "RumExclusionFilterCreateData", + "v2.rum_exclusion_filter_create_request" => "RumExclusionFilterCreateRequest", + "v2.rum_exclusion_filter_data" => "RumExclusionFilterData", + "v2.rum_exclusion_filter_event_type" => "RumExclusionFilterEventType", + "v2.rum_exclusion_filter_meta" => "RumExclusionFilterMeta", + "v2.rum_exclusion_filter_response" => "RumExclusionFilterResponse", + "v2.rum_exclusion_filters_response" => "RumExclusionFiltersResponse", + "v2.rum_exclusion_filter_type" => "RumExclusionFilterType", + "v2.rum_exclusion_filter_update_attributes" => "RumExclusionFilterUpdateAttributes", + "v2.rum_exclusion_filter_update_data" => "RumExclusionFilterUpdateData", + "v2.rum_exclusion_filter_update_request" => "RumExclusionFilterUpdateRequest", "v2.rum_group_by" => "RUMGroupBy", "v2.rum_group_by_histogram" => "RUMGroupByHistogram", "v2.rum_group_by_missing" => "RUMGroupByMissing", diff --git a/lib/datadog_api_client/v2/api/rum_retention_filters_api.rb b/lib/datadog_api_client/v2/api/rum_retention_filters_api.rb index 0cd11c3ec557..00621cc839bf 100644 --- a/lib/datadog_api_client/v2/api/rum_retention_filters_api.rb +++ b/lib/datadog_api_client/v2/api/rum_retention_filters_api.rb @@ -23,6 +23,85 @@ def initialize(api_client = DatadogAPIClient::APIClient.default) @api_client = api_client end + # Create a RUM exclusion filter. + # + # @see #create_exclusion_filter_with_http_info + def create_exclusion_filter(app_id, body, opts = {}) + data, _status_code, _headers = create_exclusion_filter_with_http_info(app_id, body, opts) + data + end + + # Create a RUM exclusion filter. + # + # Create an exclusion filter for a RUM application. + # Returns the created exclusion filter when the request is successful. + # + # @param app_id [String] RUM application ID. + # @param body [RumExclusionFilterCreateRequest] The definition of the new RUM exclusion filter. + # @param opts [Hash] the optional parameters + # @return [Array<(RumExclusionFilterResponse, Integer, Hash)>] RumExclusionFilterResponse data, response status code and response headers + def create_exclusion_filter_with_http_info(app_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_exclusion_filter".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_exclusion_filter") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_exclusion_filter")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: RumRetentionFiltersAPI.create_exclusion_filter ...' + end + # verify the required parameter 'app_id' is set + if @api_client.config.client_side_validation && app_id.nil? + fail ArgumentError, "Missing the required parameter 'app_id' when calling RumRetentionFiltersAPI.create_exclusion_filter" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling RumRetentionFiltersAPI.create_exclusion_filter" + end + # resource path + local_var_path = '/api/v2/rum/applications/{app_id}/retention_filters/exclusion'.sub('{app_id}', CGI.escape(app_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'RumExclusionFilterResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :create_exclusion_filter, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: RumRetentionFiltersAPI#create_exclusion_filter\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Create a RUM retention filter. # # @see #create_retention_filter_with_http_info @@ -96,6 +175,84 @@ def create_retention_filter_with_http_info(app_id, body, opts = {}) return data, status_code, headers end + # Delete a RUM exclusion filter. + # + # @see #delete_exclusion_filter_with_http_info + def delete_exclusion_filter(app_id, ef_id, opts = {}) + delete_exclusion_filter_with_http_info(app_id, ef_id, opts) + nil + end + + # Delete a RUM exclusion filter. + # + # Delete an exclusion filter for a RUM application. + # The built-in Error Tracking exclusion filter (`error_tracking_exclusion_filter`) cannot be deleted; + # attempting to do so returns a `405 Method Not Allowed` response. + # + # @param app_id [String] RUM application ID. + # @param ef_id [String] Exclusion filter ID. + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_exclusion_filter_with_http_info(app_id, ef_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.delete_exclusion_filter".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_exclusion_filter") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_exclusion_filter")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: RumRetentionFiltersAPI.delete_exclusion_filter ...' + end + # verify the required parameter 'app_id' is set + if @api_client.config.client_side_validation && app_id.nil? + fail ArgumentError, "Missing the required parameter 'app_id' when calling RumRetentionFiltersAPI.delete_exclusion_filter" + end + # verify the required parameter 'ef_id' is set + if @api_client.config.client_side_validation && ef_id.nil? + fail ArgumentError, "Missing the required parameter 'ef_id' when calling RumRetentionFiltersAPI.delete_exclusion_filter" + end + # resource path + local_var_path = '/api/v2/rum/applications/{app_id}/retention_filters/exclusion/{ef_id}'.sub('{app_id}', CGI.escape(app_id.to_s).gsub('%2F', '/')).sub('{ef_id}', CGI.escape(ef_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :delete_exclusion_filter, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: RumRetentionFiltersAPI#delete_exclusion_filter\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Delete a RUM retention filter. # # @see #delete_retention_filter_with_http_info @@ -166,6 +323,82 @@ def delete_retention_filter_with_http_info(app_id, rf_id, opts = {}) return data, status_code, headers end + # Get a RUM exclusion filter. + # + # @see #get_exclusion_filter_with_http_info + def get_exclusion_filter(app_id, ef_id, opts = {}) + data, _status_code, _headers = get_exclusion_filter_with_http_info(app_id, ef_id, opts) + data + end + + # Get a RUM exclusion filter. + # + # Get a single exclusion filter for a RUM application. + # + # @param app_id [String] RUM application ID. + # @param ef_id [String] Exclusion filter ID. + # @param opts [Hash] the optional parameters + # @return [Array<(RumExclusionFilterResponse, Integer, Hash)>] RumExclusionFilterResponse data, response status code and response headers + def get_exclusion_filter_with_http_info(app_id, ef_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_exclusion_filter".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_exclusion_filter") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_exclusion_filter")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: RumRetentionFiltersAPI.get_exclusion_filter ...' + end + # verify the required parameter 'app_id' is set + if @api_client.config.client_side_validation && app_id.nil? + fail ArgumentError, "Missing the required parameter 'app_id' when calling RumRetentionFiltersAPI.get_exclusion_filter" + end + # verify the required parameter 'ef_id' is set + if @api_client.config.client_side_validation && ef_id.nil? + fail ArgumentError, "Missing the required parameter 'ef_id' when calling RumRetentionFiltersAPI.get_exclusion_filter" + end + # resource path + local_var_path = '/api/v2/rum/applications/{app_id}/retention_filters/exclusion/{ef_id}'.sub('{app_id}', CGI.escape(app_id.to_s).gsub('%2F', '/')).sub('{ef_id}', CGI.escape(ef_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'RumExclusionFilterResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :get_exclusion_filter, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: RumRetentionFiltersAPI#get_exclusion_filter\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Get a permanent RUM retention filter. # # @see #get_permanent_retention_filter_with_http_info @@ -311,6 +544,78 @@ def get_retention_filter_with_http_info(app_id, rf_id, opts = {}) return data, status_code, headers end + # Get all RUM exclusion filters. + # + # @see #list_exclusion_filters_with_http_info + def list_exclusion_filters(app_id, opts = {}) + data, _status_code, _headers = list_exclusion_filters_with_http_info(app_id, opts) + data + end + + # Get all RUM exclusion filters. + # + # Get the list of exclusion filters for a RUM application. + # The built-in Error Tracking exclusion filter (`error_tracking_exclusion_filter`) is always returned first. + # + # @param app_id [String] RUM application ID. + # @param opts [Hash] the optional parameters + # @return [Array<(RumExclusionFiltersResponse, Integer, Hash)>] RumExclusionFiltersResponse data, response status code and response headers + def list_exclusion_filters_with_http_info(app_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_exclusion_filters".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_exclusion_filters") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_exclusion_filters")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: RumRetentionFiltersAPI.list_exclusion_filters ...' + end + # verify the required parameter 'app_id' is set + if @api_client.config.client_side_validation && app_id.nil? + fail ArgumentError, "Missing the required parameter 'app_id' when calling RumRetentionFiltersAPI.list_exclusion_filters" + end + # resource path + local_var_path = '/api/v2/rum/applications/{app_id}/retention_filters/exclusion'.sub('{app_id}', CGI.escape(app_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'RumExclusionFiltersResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_exclusion_filters, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: RumRetentionFiltersAPI#list_exclusion_filters\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Get all permanent RUM retention filters. # # @see #list_permanent_retention_filters_with_http_info @@ -516,6 +821,92 @@ def order_retention_filters_with_http_info(app_id, body, opts = {}) return data, status_code, headers end + # Update a RUM exclusion filter. + # + # @see #update_exclusion_filter_with_http_info + def update_exclusion_filter(app_id, ef_id, body, opts = {}) + data, _status_code, _headers = update_exclusion_filter_with_http_info(app_id, ef_id, body, opts) + data + end + + # Update a RUM exclusion filter. + # + # Update an exclusion filter for a RUM application. + # For the built-in Error Tracking exclusion filter (`error_tracking_exclusion_filter`), only `enabled` can be + # updated; `name`, `event_type`, and `query` must be omitted. + # Returns the updated exclusion filter when the request is successful. + # + # @param app_id [String] RUM application ID. + # @param ef_id [String] Exclusion filter ID. + # @param body [RumExclusionFilterUpdateRequest] New definition of the RUM exclusion filter. + # @param opts [Hash] the optional parameters + # @return [Array<(RumExclusionFilterResponse, Integer, Hash)>] RumExclusionFilterResponse data, response status code and response headers + def update_exclusion_filter_with_http_info(app_id, ef_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.update_exclusion_filter".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_exclusion_filter") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_exclusion_filter")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: RumRetentionFiltersAPI.update_exclusion_filter ...' + end + # verify the required parameter 'app_id' is set + if @api_client.config.client_side_validation && app_id.nil? + fail ArgumentError, "Missing the required parameter 'app_id' when calling RumRetentionFiltersAPI.update_exclusion_filter" + end + # verify the required parameter 'ef_id' is set + if @api_client.config.client_side_validation && ef_id.nil? + fail ArgumentError, "Missing the required parameter 'ef_id' when calling RumRetentionFiltersAPI.update_exclusion_filter" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling RumRetentionFiltersAPI.update_exclusion_filter" + end + # resource path + local_var_path = '/api/v2/rum/applications/{app_id}/retention_filters/exclusion/{ef_id}'.sub('{app_id}', CGI.escape(app_id.to_s).gsub('%2F', '/')).sub('{ef_id}', CGI.escape(ef_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'RumExclusionFilterResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :update_exclusion_filter, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: RumRetentionFiltersAPI#update_exclusion_filter\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Update a permanent RUM retention filter. # # @see #update_permanent_retention_filter_with_http_info diff --git a/lib/datadog_api_client/v2/models/rum_exclusion_filter_attributes.rb b/lib/datadog_api_client/v2/models/rum_exclusion_filter_attributes.rb new file mode 100644 index 000000000000..f08dc923a53c --- /dev/null +++ b/lib/datadog_api_client/v2/models/rum_exclusion_filter_attributes.rb @@ -0,0 +1,136 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The attributes of an exclusion filter. + class RumExclusionFilterAttributes + include BaseGenericModel + + # Whether the exclusion filter is active. + attr_accessor :enabled + + # The type of RUM events to filter on. + attr_accessor :event_type + + # The name of the exclusion filter. + attr_accessor :name + + # Additional query used to further restrict which RUM events are excluded. + # Combined with `event_type` when both are provided. + attr_accessor :query + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'enabled' => :'enabled', + :'event_type' => :'event_type', + :'name' => :'name', + :'query' => :'query' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'enabled' => :'Boolean', + :'event_type' => :'RumExclusionFilterEventType', + :'name' => :'String', + :'query' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::RumExclusionFilterAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'enabled') + self.enabled = attributes[:'enabled'] + end + + if attributes.key?(:'event_type') + self.event_type = attributes[:'event_type'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'query') + self.query = attributes[:'query'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + enabled == o.enabled && + event_type == o.event_type && + name == o.name && + query == o.query && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [enabled, event_type, name, query, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/rum_exclusion_filter_create_attributes.rb b/lib/datadog_api_client/v2/models/rum_exclusion_filter_create_attributes.rb new file mode 100644 index 000000000000..a7503cd02fd1 --- /dev/null +++ b/lib/datadog_api_client/v2/models/rum_exclusion_filter_create_attributes.rb @@ -0,0 +1,154 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The attributes of an exclusion filter to create. + class RumExclusionFilterCreateAttributes + include BaseGenericModel + + # Whether the exclusion filter is active. Defaults to `true`. + attr_accessor :enabled + + # The type of RUM events to filter on. + attr_accessor :event_type + + # The name of the exclusion filter. + attr_reader :name + + # Additional query used to further restrict which RUM events are excluded. + # Combined with `event_type` when both are provided. + attr_accessor :query + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'enabled' => :'enabled', + :'event_type' => :'event_type', + :'name' => :'name', + :'query' => :'query' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'enabled' => :'Boolean', + :'event_type' => :'RumExclusionFilterEventType', + :'name' => :'String', + :'query' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::RumExclusionFilterCreateAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'enabled') + self.enabled = attributes[:'enabled'] + end + + if attributes.key?(:'event_type') + self.event_type = attributes[:'event_type'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'query') + self.query = attributes[:'query'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @name.nil? + true + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + enabled == o.enabled && + event_type == o.event_type && + name == o.name && + query == o.query && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [enabled, event_type, name, query, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/rum_exclusion_filter_create_data.rb b/lib/datadog_api_client/v2/models/rum_exclusion_filter_create_data.rb new file mode 100644 index 000000000000..9615d3021c12 --- /dev/null +++ b/lib/datadog_api_client/v2/models/rum_exclusion_filter_create_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The new exclusion filter properties to create. + class RumExclusionFilterCreateData + include BaseGenericModel + + # The attributes of an exclusion filter to create. + attr_reader :attributes + + # The resource type. The value must be `exclusion_filters`. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'RumExclusionFilterCreateAttributes', + :'type' => :'RumExclusionFilterType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::RumExclusionFilterCreateData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/rum_exclusion_filter_create_request.rb b/lib/datadog_api_client/v2/models/rum_exclusion_filter_create_request.rb new file mode 100644 index 000000000000..8d7a8481ae5d --- /dev/null +++ b/lib/datadog_api_client/v2/models/rum_exclusion_filter_create_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The exclusion filter body to create. + class RumExclusionFilterCreateRequest + include BaseGenericModel + + # The new exclusion filter properties to create. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'RumExclusionFilterCreateData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::RumExclusionFilterCreateRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/rum_exclusion_filter_data.rb b/lib/datadog_api_client/v2/models/rum_exclusion_filter_data.rb new file mode 100644 index 000000000000..6ed16b49415c --- /dev/null +++ b/lib/datadog_api_client/v2/models/rum_exclusion_filter_data.rb @@ -0,0 +1,164 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # An exclusion filter. + class RumExclusionFilterData + include BaseGenericModel + + # The attributes of an exclusion filter. + attr_accessor :attributes + + # The ID of the exclusion filter. + attr_reader :id + + # Metadata about the exclusion filter. + attr_accessor :meta + + # The resource type. The value must be `exclusion_filters`. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'meta' => :'meta', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'RumExclusionFilterAttributes', + :'id' => :'String', + :'meta' => :'RumExclusionFilterMeta', + :'type' => :'RumExclusionFilterType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::RumExclusionFilterData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'meta') + self.meta = attributes[:'meta'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + meta == o.meta && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, meta, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/rum_exclusion_filter_event_type.rb b/lib/datadog_api_client/v2/models/rum_exclusion_filter_event_type.rb new file mode 100644 index 000000000000..5c4cd2b31e3d --- /dev/null +++ b/lib/datadog_api_client/v2/models/rum_exclusion_filter_event_type.rb @@ -0,0 +1,32 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The type of RUM events to filter on. + class RumExclusionFilterEventType + include BaseEnumModel + + SESSION = "session".freeze + VIEW = "view".freeze + ACTION = "action".freeze + ERROR = "error".freeze + RESOURCE = "resource".freeze + LONG_TASK = "long_task".freeze + VITAL = "vital".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/rum_exclusion_filter_meta.rb b/lib/datadog_api_client/v2/models/rum_exclusion_filter_meta.rb new file mode 100644 index 000000000000..517932e4b2b5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/rum_exclusion_filter_meta.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Metadata about the exclusion filter. + class RumExclusionFilterMeta + include BaseGenericModel + + # Unix epoch (in milliseconds) when the exclusion filter was last enabled. + attr_accessor :enabled_at + + # Unix epoch (in milliseconds) of the last update. + attr_accessor :updated_at + + # Handle of the user who last updated the exclusion filter. + attr_accessor :updated_by_handle + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'enabled_at' => :'enabled_at', + :'updated_at' => :'updated_at', + :'updated_by_handle' => :'updated_by_handle' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'enabled_at' => :'Integer', + :'updated_at' => :'Integer', + :'updated_by_handle' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::RumExclusionFilterMeta` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'enabled_at') + self.enabled_at = attributes[:'enabled_at'] + end + + if attributes.key?(:'updated_at') + self.updated_at = attributes[:'updated_at'] + end + + if attributes.key?(:'updated_by_handle') + self.updated_by_handle = attributes[:'updated_by_handle'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + enabled_at == o.enabled_at && + updated_at == o.updated_at && + updated_by_handle == o.updated_by_handle && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [enabled_at, updated_at, updated_by_handle, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/rum_exclusion_filter_response.rb b/lib/datadog_api_client/v2/models/rum_exclusion_filter_response.rb new file mode 100644 index 000000000000..90cac126f5b1 --- /dev/null +++ b/lib/datadog_api_client/v2/models/rum_exclusion_filter_response.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # An exclusion filter response body. + class RumExclusionFilterResponse + include BaseGenericModel + + # An exclusion filter. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'RumExclusionFilterData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::RumExclusionFilterResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/rum_exclusion_filter_type.rb b/lib/datadog_api_client/v2/models/rum_exclusion_filter_type.rb new file mode 100644 index 000000000000..aa2d15871fcb --- /dev/null +++ b/lib/datadog_api_client/v2/models/rum_exclusion_filter_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The resource type. The value must be `exclusion_filters`. + class RumExclusionFilterType + include BaseEnumModel + + EXCLUSION_FILTERS = "exclusion_filters".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/rum_exclusion_filter_update_attributes.rb b/lib/datadog_api_client/v2/models/rum_exclusion_filter_update_attributes.rb new file mode 100644 index 000000000000..6601e175b8fe --- /dev/null +++ b/lib/datadog_api_client/v2/models/rum_exclusion_filter_update_attributes.rb @@ -0,0 +1,138 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The attributes of an exclusion filter that can be updated. + # For the built-in Error Tracking exclusion filter, only `enabled` can be set; + # `name`, `event_type`, and `query` must be omitted. + class RumExclusionFilterUpdateAttributes + include BaseGenericModel + + # Whether the exclusion filter is active. + attr_accessor :enabled + + # The type of RUM events to filter on. + attr_accessor :event_type + + # The name of the exclusion filter. + attr_accessor :name + + # Additional query used to further restrict which RUM events are excluded. + # Combined with `event_type` when both are provided. + attr_accessor :query + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'enabled' => :'enabled', + :'event_type' => :'event_type', + :'name' => :'name', + :'query' => :'query' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'enabled' => :'Boolean', + :'event_type' => :'RumExclusionFilterEventType', + :'name' => :'String', + :'query' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::RumExclusionFilterUpdateAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'enabled') + self.enabled = attributes[:'enabled'] + end + + if attributes.key?(:'event_type') + self.event_type = attributes[:'event_type'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'query') + self.query = attributes[:'query'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + enabled == o.enabled && + event_type == o.event_type && + name == o.name && + query == o.query && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [enabled, event_type, name, query, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/rum_exclusion_filter_update_data.rb b/lib/datadog_api_client/v2/models/rum_exclusion_filter_update_data.rb new file mode 100644 index 000000000000..d490ba939e82 --- /dev/null +++ b/lib/datadog_api_client/v2/models/rum_exclusion_filter_update_data.rb @@ -0,0 +1,167 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The exclusion filter properties to update. + class RumExclusionFilterUpdateData + include BaseGenericModel + + # The attributes of an exclusion filter that can be updated. + # For the built-in Error Tracking exclusion filter, only `enabled` can be set; + # `name`, `event_type`, and `query` must be omitted. + attr_reader :attributes + + # The ID of the exclusion filter. Must match the `ef_id` path parameter. + attr_reader :id + + # The resource type. The value must be `exclusion_filters`. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'RumExclusionFilterUpdateAttributes', + :'id' => :'String', + :'type' => :'RumExclusionFilterType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::RumExclusionFilterUpdateData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/rum_exclusion_filter_update_request.rb b/lib/datadog_api_client/v2/models/rum_exclusion_filter_update_request.rb new file mode 100644 index 000000000000..7bbf5018fe21 --- /dev/null +++ b/lib/datadog_api_client/v2/models/rum_exclusion_filter_update_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The exclusion filter body to update. + class RumExclusionFilterUpdateRequest + include BaseGenericModel + + # The exclusion filter properties to update. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'RumExclusionFilterUpdateData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::RumExclusionFilterUpdateRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/rum_exclusion_filters_response.rb b/lib/datadog_api_client/v2/models/rum_exclusion_filters_response.rb new file mode 100644 index 000000000000..d4ae034afb6a --- /dev/null +++ b/lib/datadog_api_client/v2/models/rum_exclusion_filters_response.rb @@ -0,0 +1,107 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # All exclusion filters for a RUM application. + class RumExclusionFiltersResponse + include BaseGenericModel + + # A list of exclusion filters. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::RumExclusionFiltersResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end