From 8e5810678b577f69a332e73697c2a8a26d4f5f61 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Fri, 29 May 2026 08:36:24 +0000 Subject: [PATCH] Regenerate client from commit 6a02de5 of spec repo --- .generator/schemas/v2/openapi.yaml | 254 ++++++++++++++++++ .../GetPermanentRetentionFilter.rb | 5 + .../ListPermanentRetentionFilters.rb | 5 + .../UpdatePermanentRetentionFilter.rb | 18 ++ features/scenarios_model_mapping.rb | 12 + features/v2/rum_retention_filters.feature | 50 ++++ features/v2/undo.json | 18 ++ lib/datadog_api_client/inflector.rb | 10 + .../v2/api/rum_retention_filters_api.rb | 226 ++++++++++++++++ ...m_permanent_retention_filter_attributes.rb | 135 ++++++++++ .../rum_permanent_retention_filter_data.rb | 125 +++++++++ ..._permanent_retention_filter_editability.rb | 105 ++++++++ .../rum_permanent_retention_filter_id.rb | 28 ++ ...rum_permanent_retention_filter_response.rb | 105 ++++++++ .../rum_permanent_retention_filter_type.rb | 26 ++ ...nent_retention_filter_update_attributes.rb | 105 ++++++++ ..._permanent_retention_filter_update_data.rb | 165 ++++++++++++ ...rmanent_retention_filter_update_request.rb | 123 +++++++++ ...um_permanent_retention_filters_response.rb | 107 ++++++++ 19 files changed, 1622 insertions(+) create mode 100644 examples/v2/rum-retention-filters/GetPermanentRetentionFilter.rb create mode 100644 examples/v2/rum-retention-filters/ListPermanentRetentionFilters.rb create mode 100644 examples/v2/rum-retention-filters/UpdatePermanentRetentionFilter.rb create mode 100644 lib/datadog_api_client/v2/models/rum_permanent_retention_filter_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/rum_permanent_retention_filter_data.rb create mode 100644 lib/datadog_api_client/v2/models/rum_permanent_retention_filter_editability.rb create mode 100644 lib/datadog_api_client/v2/models/rum_permanent_retention_filter_id.rb create mode 100644 lib/datadog_api_client/v2/models/rum_permanent_retention_filter_response.rb create mode 100644 lib/datadog_api_client/v2/models/rum_permanent_retention_filter_type.rb create mode 100644 lib/datadog_api_client/v2/models/rum_permanent_retention_filter_update_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/rum_permanent_retention_filter_update_data.rb create mode 100644 lib/datadog_api_client/v2/models/rum_permanent_retention_filter_update_request.rb create mode 100644 lib/datadog_api_client/v2/models/rum_permanent_retention_filters_response.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 25b7d2083191..b2e0e022c91c 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -1558,6 +1558,13 @@ components: required: true schema: type: string + RumPermanentRetentionFilterIDParameter: + description: The identifier of the permanent RUM retention filter. + in: path + name: permanent_rf_id + required: true + schema: + $ref: "#/components/schemas/RumPermanentRetentionFilterID" RumRetentionFilterIDParameter: description: Retention filter ID. in: path @@ -71551,6 +71558,100 @@ components: $ref: "#/components/schemas/RumMetricResponseData" type: array type: object + RumPermanentRetentionFilterAttributes: + description: The attributes of a permanent RUM retention filter. + properties: + cross_product_sampling: + $ref: "#/components/schemas/RumCrossProductSampling" + description: + description: A description of what the filter retains. + example: "All sessions generated by Synthetics are retained at 100%." + type: string + editability: + $ref: "#/components/schemas/RumPermanentRetentionFilterEditability" + name: + description: The display name of the permanent retention filter. + example: "Synthetics Sessions" + type: string + type: object + RumPermanentRetentionFilterData: + description: A permanent RUM retention filter. + properties: + attributes: + $ref: "#/components/schemas/RumPermanentRetentionFilterAttributes" + id: + $ref: "#/components/schemas/RumPermanentRetentionFilterID" + type: + $ref: "#/components/schemas/RumPermanentRetentionFilterType" + type: object + RumPermanentRetentionFilterEditability: + description: Indicates which cross-product fields of a permanent RUM retention filter can be updated. + properties: + trace_editable: + description: Whether the APM trace cross-product configuration of the filter can be updated. + example: true + type: boolean + type: object + RumPermanentRetentionFilterID: + description: The identifier of a permanent RUM retention filter. + enum: + - rum_apm_flat_sampling + - synthetics_sessions + - forced_replay_sessions + example: synthetics_sessions + type: string + x-enum-varnames: ["RUM_APM_FLAT_SAMPLING", "SYNTHETICS_SESSIONS", "FORCED_REPLAY_SESSIONS"] + RumPermanentRetentionFilterResponse: + description: A permanent RUM retention filter object. + properties: + data: + $ref: "#/components/schemas/RumPermanentRetentionFilterData" + type: object + RumPermanentRetentionFilterType: + default: permanent_retention_filters + description: The type of the resource. The value should always be `permanent_retention_filters`. + enum: + - permanent_retention_filters + example: permanent_retention_filters + type: string + x-enum-varnames: ["PERMANENT_RETENTION_FILTERS"] + RumPermanentRetentionFilterUpdateAttributes: + description: The configuration to update on a permanent RUM retention filter. + properties: + cross_product_sampling: + $ref: "#/components/schemas/RumCrossProductSamplingUpdate" + type: object + RumPermanentRetentionFilterUpdateData: + description: The new permanent RUM retention filter configuration to update. + properties: + attributes: + $ref: "#/components/schemas/RumPermanentRetentionFilterUpdateAttributes" + id: + $ref: "#/components/schemas/RumPermanentRetentionFilterID" + type: + $ref: "#/components/schemas/RumPermanentRetentionFilterType" + required: + - id + - type + - attributes + type: object + RumPermanentRetentionFilterUpdateRequest: + description: The permanent RUM retention filter body to update. + properties: + data: + $ref: "#/components/schemas/RumPermanentRetentionFilterUpdateData" + required: + - data + type: object + RumPermanentRetentionFiltersResponse: + description: All permanent RUM retention filters for a RUM application. + properties: + data: + description: A list of permanent RUM retention filters. + items: + $ref: "#/components/schemas/RumPermanentRetentionFilterData" + type: array + type: object RumRetentionFilterAttributes: description: The object describing attributes of a RUM retention filter. properties: @@ -146732,6 +146833,159 @@ paths: tags: - Rum Retention Filters x-codegen-request-body-name: body + /api/v2/rum/applications/{app_id}/retention_filters/permanent: + get: + description: |- + Get the list of permanent RUM retention filters for a RUM application. + Permanent retention filters are predefined filters that cannot be created or deleted. + For each filter, the `editability` block indicates which cross-product fields can be updated. + operationId: ListPermanentRetentionFilters + parameters: + - $ref: "#/components/parameters/RumApplicationIDParameter" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + cross_product_sampling: + trace_enabled: true + trace_sample_rate: 100.0 + description: RUM retains all Synthetics sessions. + editability: + trace_editable: true + name: Synthetics Sessions + id: synthetics_sessions + type: permanent_retention_filters + - attributes: + cross_product_sampling: + trace_enabled: true + trace_sample_rate: 100.0 + description: RUM retains all sessions with forced replays. + editability: + trace_editable: true + name: Forced Replay Sessions + id: forced_replay_sessions + type: permanent_retention_filters + - attributes: + cross_product_sampling: + trace_enabled: true + trace_sample_rate: 100.0 + description: Configures APM trace sampling for RUM sessions using flat sampling. + editability: + trace_editable: false + name: RUM APM Flat Sampling + id: rum_apm_flat_sampling + type: permanent_retention_filters + schema: + $ref: "#/components/schemas/RumPermanentRetentionFiltersResponse" + description: OK + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Get all permanent RUM retention filters + tags: + - Rum Retention Filters + /api/v2/rum/applications/{app_id}/retention_filters/permanent/{permanent_rf_id}: + get: + description: Get a permanent RUM retention filter for a RUM application by its identifier. + operationId: GetPermanentRetentionFilter + parameters: + - $ref: "#/components/parameters/RumApplicationIDParameter" + - $ref: "#/components/parameters/RumPermanentRetentionFilterIDParameter" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + cross_product_sampling: + trace_enabled: true + trace_sample_rate: 75.0 + description: RUM retains all Synthetics sessions. + editability: + trace_editable: true + name: Synthetics Sessions + id: synthetics_sessions + type: permanent_retention_filters + schema: + $ref: "#/components/schemas/RumPermanentRetentionFilterResponse" + description: OK + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Get a permanent RUM retention filter + tags: + - Rum Retention Filters + patch: + description: |- + Update the cross-product sampling configuration of a permanent RUM retention filter for a RUM application. + Only fields marked as editable in the `editability` block of the filter can be updated. + Updating a non-editable field returns a `400` response. + operationId: UpdatePermanentRetentionFilter + parameters: + - $ref: "#/components/parameters/RumApplicationIDParameter" + - $ref: "#/components/parameters/RumPermanentRetentionFilterIDParameter" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + cross_product_sampling: + trace_enabled: true + trace_sample_rate: 50.0 + id: synthetics_sessions + type: permanent_retention_filters + schema: + $ref: "#/components/schemas/RumPermanentRetentionFilterUpdateRequest" + description: New configuration of the permanent RUM retention filter. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + cross_product_sampling: + trace_enabled: true + trace_sample_rate: 50.0 + description: RUM retains all Synthetics sessions. + editability: + trace_editable: true + name: Synthetics Sessions + id: synthetics_sessions + type: permanent_retention_filters + schema: + $ref: "#/components/schemas/RumPermanentRetentionFilterResponse" + description: Updated + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Update a permanent RUM retention filter + tags: + - Rum Retention Filters + x-codegen-request-body-name: body /api/v2/rum/applications/{app_id}/retention_filters/{rf_id}: delete: description: Delete a RUM retention filter for a RUM application. diff --git a/examples/v2/rum-retention-filters/GetPermanentRetentionFilter.rb b/examples/v2/rum-retention-filters/GetPermanentRetentionFilter.rb new file mode 100644 index 000000000000..258af67a22d1 --- /dev/null +++ b/examples/v2/rum-retention-filters/GetPermanentRetentionFilter.rb @@ -0,0 +1,5 @@ +# Get a permanent RUM retention filter returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::RumRetentionFiltersAPI.new +p api_instance.get_permanent_retention_filter("app_id", RumPermanentRetentionFilterID::SYNTHETICS_SESSIONS) diff --git a/examples/v2/rum-retention-filters/ListPermanentRetentionFilters.rb b/examples/v2/rum-retention-filters/ListPermanentRetentionFilters.rb new file mode 100644 index 000000000000..ff8060e61043 --- /dev/null +++ b/examples/v2/rum-retention-filters/ListPermanentRetentionFilters.rb @@ -0,0 +1,5 @@ +# Get all permanent RUM retention filters returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::RumRetentionFiltersAPI.new +p api_instance.list_permanent_retention_filters("app_id") diff --git a/examples/v2/rum-retention-filters/UpdatePermanentRetentionFilter.rb b/examples/v2/rum-retention-filters/UpdatePermanentRetentionFilter.rb new file mode 100644 index 000000000000..d09f95133fc6 --- /dev/null +++ b/examples/v2/rum-retention-filters/UpdatePermanentRetentionFilter.rb @@ -0,0 +1,18 @@ +# Update a permanent RUM retention filter returns "Updated" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::RumRetentionFiltersAPI.new + +body = DatadogAPIClient::V2::RumPermanentRetentionFilterUpdateRequest.new({ + data: DatadogAPIClient::V2::RumPermanentRetentionFilterUpdateData.new({ + attributes: DatadogAPIClient::V2::RumPermanentRetentionFilterUpdateAttributes.new({ + cross_product_sampling: DatadogAPIClient::V2::RumCrossProductSamplingUpdate.new({ + trace_enabled: true, + trace_sample_rate: 25.0, + }), + }), + id: DatadogAPIClient::V2::RumPermanentRetentionFilterID::SYNTHETICS_SESSIONS, + type: DatadogAPIClient::V2::RumPermanentRetentionFilterType::PERMANENT_RETENTION_FILTERS, + }), +}) +p api_instance.update_permanent_retention_filter("app_id", RumPermanentRetentionFilterID::SYNTHETICS_SESSIONS, body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index fe446d237e62..920e80f058e0 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -4506,6 +4506,18 @@ "app_id" => "String", "body" => "RumRetentionFilterCreateRequest", }, + "v2.ListPermanentRetentionFilters" => { + "app_id" => "String", + }, + "v2.GetPermanentRetentionFilter" => { + "app_id" => "String", + "permanent_rf_id" => "RumPermanentRetentionFilterID", + }, + "v2.UpdatePermanentRetentionFilter" => { + "app_id" => "String", + "permanent_rf_id" => "RumPermanentRetentionFilterID", + "body" => "RumPermanentRetentionFilterUpdateRequest", + }, "v2.DeleteRetentionFilter" => { "app_id" => "String", "rf_id" => "String", diff --git a/features/v2/rum_retention_filters.feature b/features/v2/rum_retention_filters.feature index 08d0a42a2538..9c41dcedc0d0 100644 --- a/features/v2/rum_retention_filters.feature +++ b/features/v2/rum_retention_filters.feature @@ -70,6 +70,22 @@ Feature: Rum Retention Filters And the response "data.attributes.query" is equal to "custom_query" And the response "data.attributes.sample_rate" is equal to 25 + @generated @skip @team:DataDog/rum-backend + Scenario: Get a permanent RUM retention filter returns "Not Found" response + Given new "GetPermanentRetentionFilter" request + And request contains "app_id" parameter from "REPLACE.ME" + And request contains "permanent_rf_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/rum-backend + Scenario: Get a permanent RUM retention filter returns "OK" response + Given new "GetPermanentRetentionFilter" request + And request contains "app_id" parameter from "REPLACE.ME" + And request contains "permanent_rf_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @replay-only @team:DataDog/rum-backend Scenario: Get all RUM retention filters returns "OK" response Given new "ListRetentionFilters" request @@ -78,6 +94,13 @@ Feature: Rum Retention Filters Then the response status is 200 OK And the response "data" has length 3 + @generated @skip @team:DataDog/rum-backend + Scenario: Get all permanent RUM retention filters returns "OK" response + Given new "ListPermanentRetentionFilters" request + And request contains "app_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @team:DataDog/rum-backend Scenario: Order RUM retention filters returns "Bad Request" response Given new "OrderRetentionFilters" request @@ -130,3 +153,30 @@ Feature: Rum Retention Filters And the response "data.attributes.enabled" is equal to true And the response "data.attributes.query" is equal to "view_query" And the response "data.attributes.sample_rate" is equal to 100 + + @generated @skip @team:DataDog/rum-backend + Scenario: Update a permanent RUM retention filter returns "Bad Request" response + Given new "UpdatePermanentRetentionFilter" request + And request contains "app_id" parameter from "REPLACE.ME" + And request contains "permanent_rf_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"cross_product_sampling": {"trace_enabled": true, "trace_sample_rate": 25.0}}, "id": "synthetics_sessions", "type": "permanent_retention_filters"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/rum-backend + Scenario: Update a permanent RUM retention filter returns "Not Found" response + Given new "UpdatePermanentRetentionFilter" request + And request contains "app_id" parameter from "REPLACE.ME" + And request contains "permanent_rf_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"cross_product_sampling": {"trace_enabled": true, "trace_sample_rate": 25.0}}, "id": "synthetics_sessions", "type": "permanent_retention_filters"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/rum-backend + Scenario: Update a permanent RUM retention filter returns "Updated" response + Given new "UpdatePermanentRetentionFilter" request + And request contains "app_id" parameter from "REPLACE.ME" + And request contains "permanent_rf_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"cross_product_sampling": {"trace_enabled": true, "trace_sample_rate": 25.0}}, "id": "synthetics_sessions", "type": "permanent_retention_filters"}} + When the request is sent + Then the response status is 200 Updated diff --git a/features/v2/undo.json b/features/v2/undo.json index 71e42bf1b94b..f1a04b48a1aa 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -5875,6 +5875,24 @@ "type": "safe" } }, + "ListPermanentRetentionFilters": { + "tag": "Rum Retention Filters", + "undo": { + "type": "safe" + } + }, + "GetPermanentRetentionFilter": { + "tag": "Rum Retention Filters", + "undo": { + "type": "safe" + } + }, + "UpdatePermanentRetentionFilter": { + "tag": "Rum Retention Filters", + "undo": { + "type": "idempotent" + } + }, "DeleteRetentionFilter": { "tag": "Rum Retention Filters", "undo": { diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 67fc3b9b9500..bfa0086bf6f1 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -5530,6 +5530,16 @@ def overrides "v2.rum_metric_update_compute" => "RumMetricUpdateCompute", "v2.rum_metric_update_data" => "RumMetricUpdateData", "v2.rum_metric_update_request" => "RumMetricUpdateRequest", + "v2.rum_permanent_retention_filter_attributes" => "RumPermanentRetentionFilterAttributes", + "v2.rum_permanent_retention_filter_data" => "RumPermanentRetentionFilterData", + "v2.rum_permanent_retention_filter_editability" => "RumPermanentRetentionFilterEditability", + "v2.rum_permanent_retention_filter_id" => "RumPermanentRetentionFilterID", + "v2.rum_permanent_retention_filter_response" => "RumPermanentRetentionFilterResponse", + "v2.rum_permanent_retention_filters_response" => "RumPermanentRetentionFiltersResponse", + "v2.rum_permanent_retention_filter_type" => "RumPermanentRetentionFilterType", + "v2.rum_permanent_retention_filter_update_attributes" => "RumPermanentRetentionFilterUpdateAttributes", + "v2.rum_permanent_retention_filter_update_data" => "RumPermanentRetentionFilterUpdateData", + "v2.rum_permanent_retention_filter_update_request" => "RumPermanentRetentionFilterUpdateRequest", "v2.rum_product_analytics_retention_scale" => "RUMProductAnalyticsRetentionScale", "v2.rum_product_analytics_retention_state" => "RUMProductAnalyticsRetentionState", "v2.rum_product_scales" => "RUMProductScales", 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 7b30e91e1bbe..0cd11c3ec557 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 @@ -166,6 +166,81 @@ def delete_retention_filter_with_http_info(app_id, rf_id, opts = {}) return data, status_code, headers end + # Get a permanent RUM retention filter. + # + # @see #get_permanent_retention_filter_with_http_info + def get_permanent_retention_filter(app_id, permanent_rf_id, opts = {}) + data, _status_code, _headers = get_permanent_retention_filter_with_http_info(app_id, permanent_rf_id, opts) + data + end + + # Get a permanent RUM retention filter. + # + # Get a permanent RUM retention filter for a RUM application by its identifier. + # + # @param app_id [String] RUM application ID. + # @param permanent_rf_id [RumPermanentRetentionFilterID] The identifier of the permanent RUM retention filter. + # @param opts [Hash] the optional parameters + # @return [Array<(RumPermanentRetentionFilterResponse, Integer, Hash)>] RumPermanentRetentionFilterResponse data, response status code and response headers + def get_permanent_retention_filter_with_http_info(app_id, permanent_rf_id, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: RumRetentionFiltersAPI.get_permanent_retention_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_permanent_retention_filter" + end + # verify the required parameter 'permanent_rf_id' is set + if @api_client.config.client_side_validation && permanent_rf_id.nil? + fail ArgumentError, "Missing the required parameter 'permanent_rf_id' when calling RumRetentionFiltersAPI.get_permanent_retention_filter" + end + # verify enum value + allowable_values = ['rum_apm_flat_sampling', 'synthetics_sessions', 'forced_replay_sessions'] + if @api_client.config.client_side_validation && !allowable_values.include?(permanent_rf_id) + fail ArgumentError, "invalid value for \"permanent_rf_id\", must be one of #{allowable_values}" + end + # resource path + local_var_path = '/api/v2/rum/applications/{app_id}/retention_filters/permanent/{permanent_rf_id}'.sub('{app_id}', CGI.escape(app_id.to_s).gsub('%2F', '/')).sub('{permanent_rf_id}', CGI.escape(permanent_rf_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] || 'RumPermanentRetentionFilterResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :get_permanent_retention_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_permanent_retention_filter\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Get a RUM retention filter. # # @see #get_retention_filter_with_http_info @@ -236,6 +311,73 @@ def get_retention_filter_with_http_info(app_id, rf_id, opts = {}) return data, status_code, headers end + # Get all permanent RUM retention filters. + # + # @see #list_permanent_retention_filters_with_http_info + def list_permanent_retention_filters(app_id, opts = {}) + data, _status_code, _headers = list_permanent_retention_filters_with_http_info(app_id, opts) + data + end + + # Get all permanent RUM retention filters. + # + # Get the list of permanent RUM retention filters for a RUM application. + # Permanent retention filters are predefined filters that cannot be created or deleted. + # For each filter, the `editability` block indicates which cross-product fields can be updated. + # + # @param app_id [String] RUM application ID. + # @param opts [Hash] the optional parameters + # @return [Array<(RumPermanentRetentionFiltersResponse, Integer, Hash)>] RumPermanentRetentionFiltersResponse data, response status code and response headers + def list_permanent_retention_filters_with_http_info(app_id, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: RumRetentionFiltersAPI.list_permanent_retention_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_permanent_retention_filters" + end + # resource path + local_var_path = '/api/v2/rum/applications/{app_id}/retention_filters/permanent'.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] || 'RumPermanentRetentionFiltersResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_permanent_retention_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_permanent_retention_filters\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Get all RUM retention filters. # # @see #list_retention_filters_with_http_info @@ -374,6 +516,90 @@ def order_retention_filters_with_http_info(app_id, body, opts = {}) return data, status_code, headers end + # Update a permanent RUM retention filter. + # + # @see #update_permanent_retention_filter_with_http_info + def update_permanent_retention_filter(app_id, permanent_rf_id, body, opts = {}) + data, _status_code, _headers = update_permanent_retention_filter_with_http_info(app_id, permanent_rf_id, body, opts) + data + end + + # Update a permanent RUM retention filter. + # + # Update the cross-product sampling configuration of a permanent RUM retention filter for a RUM application. + # Only fields marked as editable in the `editability` block of the filter can be updated. + # Updating a non-editable field returns a `400` response. + # + # @param app_id [String] RUM application ID. + # @param permanent_rf_id [RumPermanentRetentionFilterID] The identifier of the permanent RUM retention filter. + # @param body [RumPermanentRetentionFilterUpdateRequest] New configuration of the permanent RUM retention filter. + # @param opts [Hash] the optional parameters + # @return [Array<(RumPermanentRetentionFilterResponse, Integer, Hash)>] RumPermanentRetentionFilterResponse data, response status code and response headers + def update_permanent_retention_filter_with_http_info(app_id, permanent_rf_id, body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: RumRetentionFiltersAPI.update_permanent_retention_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_permanent_retention_filter" + end + # verify the required parameter 'permanent_rf_id' is set + if @api_client.config.client_side_validation && permanent_rf_id.nil? + fail ArgumentError, "Missing the required parameter 'permanent_rf_id' when calling RumRetentionFiltersAPI.update_permanent_retention_filter" + end + # verify enum value + allowable_values = ['rum_apm_flat_sampling', 'synthetics_sessions', 'forced_replay_sessions'] + if @api_client.config.client_side_validation && !allowable_values.include?(permanent_rf_id) + fail ArgumentError, "invalid value for \"permanent_rf_id\", must be one of #{allowable_values}" + 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_permanent_retention_filter" + end + # resource path + local_var_path = '/api/v2/rum/applications/{app_id}/retention_filters/permanent/{permanent_rf_id}'.sub('{app_id}', CGI.escape(app_id.to_s).gsub('%2F', '/')).sub('{permanent_rf_id}', CGI.escape(permanent_rf_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] || 'RumPermanentRetentionFilterResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :update_permanent_retention_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_permanent_retention_filter\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Update a RUM retention filter. # # @see #update_retention_filter_with_http_info diff --git a/lib/datadog_api_client/v2/models/rum_permanent_retention_filter_attributes.rb b/lib/datadog_api_client/v2/models/rum_permanent_retention_filter_attributes.rb new file mode 100644 index 000000000000..ea051e038351 --- /dev/null +++ b/lib/datadog_api_client/v2/models/rum_permanent_retention_filter_attributes.rb @@ -0,0 +1,135 @@ +=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 a permanent RUM retention filter. + class RumPermanentRetentionFilterAttributes + include BaseGenericModel + + # The configuration for cross-product retention filters. + attr_accessor :cross_product_sampling + + # A description of what the filter retains. + attr_accessor :description + + # Indicates which cross-product fields of a permanent RUM retention filter can be updated. + attr_accessor :editability + + # The display name of the permanent retention filter. + attr_accessor :name + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'cross_product_sampling' => :'cross_product_sampling', + :'description' => :'description', + :'editability' => :'editability', + :'name' => :'name' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'cross_product_sampling' => :'RumCrossProductSampling', + :'description' => :'String', + :'editability' => :'RumPermanentRetentionFilterEditability', + :'name' => :'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::RumPermanentRetentionFilterAttributes` 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?(:'cross_product_sampling') + self.cross_product_sampling = attributes[:'cross_product_sampling'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'editability') + self.editability = attributes[:'editability'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + 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 && + cross_product_sampling == o.cross_product_sampling && + description == o.description && + editability == o.editability && + name == o.name && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [cross_product_sampling, description, editability, name, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/rum_permanent_retention_filter_data.rb b/lib/datadog_api_client/v2/models/rum_permanent_retention_filter_data.rb new file mode 100644 index 000000000000..59119a78ef3d --- /dev/null +++ b/lib/datadog_api_client/v2/models/rum_permanent_retention_filter_data.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 + # A permanent RUM retention filter. + class RumPermanentRetentionFilterData + include BaseGenericModel + + # The attributes of a permanent RUM retention filter. + attr_accessor :attributes + + # The identifier of a permanent RUM retention filter. + attr_accessor :id + + # The type of the resource. The value should always be `permanent_retention_filters`. + attr_accessor :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' => :'RumPermanentRetentionFilterAttributes', + :'id' => :'RumPermanentRetentionFilterID', + :'type' => :'RumPermanentRetentionFilterType' + } + 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::RumPermanentRetentionFilterData` 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 + + # 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_permanent_retention_filter_editability.rb b/lib/datadog_api_client/v2/models/rum_permanent_retention_filter_editability.rb new file mode 100644 index 000000000000..2e18a3d80a83 --- /dev/null +++ b/lib/datadog_api_client/v2/models/rum_permanent_retention_filter_editability.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 + # Indicates which cross-product fields of a permanent RUM retention filter can be updated. + class RumPermanentRetentionFilterEditability + include BaseGenericModel + + # Whether the APM trace cross-product configuration of the filter can be updated. + attr_accessor :trace_editable + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'trace_editable' => :'trace_editable' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'trace_editable' => :'Boolean' + } + 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::RumPermanentRetentionFilterEditability` 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?(:'trace_editable') + self.trace_editable = attributes[:'trace_editable'] + 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 && + trace_editable == o.trace_editable && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [trace_editable, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/rum_permanent_retention_filter_id.rb b/lib/datadog_api_client/v2/models/rum_permanent_retention_filter_id.rb new file mode 100644 index 000000000000..b96224196f41 --- /dev/null +++ b/lib/datadog_api_client/v2/models/rum_permanent_retention_filter_id.rb @@ -0,0 +1,28 @@ +=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 identifier of a permanent RUM retention filter. + class RumPermanentRetentionFilterID + include BaseEnumModel + + RUM_APM_FLAT_SAMPLING = "rum_apm_flat_sampling".freeze + SYNTHETICS_SESSIONS = "synthetics_sessions".freeze + FORCED_REPLAY_SESSIONS = "forced_replay_sessions".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/rum_permanent_retention_filter_response.rb b/lib/datadog_api_client/v2/models/rum_permanent_retention_filter_response.rb new file mode 100644 index 000000000000..a4f767b89dcb --- /dev/null +++ b/lib/datadog_api_client/v2/models/rum_permanent_retention_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 + # A permanent RUM retention filter object. + class RumPermanentRetentionFilterResponse + include BaseGenericModel + + # A permanent RUM retention 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' => :'RumPermanentRetentionFilterData' + } + 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::RumPermanentRetentionFilterResponse` 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_permanent_retention_filter_type.rb b/lib/datadog_api_client/v2/models/rum_permanent_retention_filter_type.rb new file mode 100644 index 000000000000..11653ad3419d --- /dev/null +++ b/lib/datadog_api_client/v2/models/rum_permanent_retention_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 type of the resource. The value should always be `permanent_retention_filters`. + class RumPermanentRetentionFilterType + include BaseEnumModel + + PERMANENT_RETENTION_FILTERS = "permanent_retention_filters".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/rum_permanent_retention_filter_update_attributes.rb b/lib/datadog_api_client/v2/models/rum_permanent_retention_filter_update_attributes.rb new file mode 100644 index 000000000000..a455f47351ed --- /dev/null +++ b/lib/datadog_api_client/v2/models/rum_permanent_retention_filter_update_attributes.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 + # The configuration to update on a permanent RUM retention filter. + class RumPermanentRetentionFilterUpdateAttributes + include BaseGenericModel + + # The configuration for cross-product retention filters. All fields are optional for partial updates. + attr_accessor :cross_product_sampling + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'cross_product_sampling' => :'cross_product_sampling' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'cross_product_sampling' => :'RumCrossProductSamplingUpdate' + } + 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::RumPermanentRetentionFilterUpdateAttributes` 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?(:'cross_product_sampling') + self.cross_product_sampling = attributes[:'cross_product_sampling'] + 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 && + cross_product_sampling == o.cross_product_sampling && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [cross_product_sampling, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/rum_permanent_retention_filter_update_data.rb b/lib/datadog_api_client/v2/models/rum_permanent_retention_filter_update_data.rb new file mode 100644 index 000000000000..2df9de4441da --- /dev/null +++ b/lib/datadog_api_client/v2/models/rum_permanent_retention_filter_update_data.rb @@ -0,0 +1,165 @@ +=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 permanent RUM retention filter configuration to update. + class RumPermanentRetentionFilterUpdateData + include BaseGenericModel + + # The configuration to update on a permanent RUM retention filter. + attr_reader :attributes + + # The identifier of a permanent RUM retention filter. + attr_reader :id + + # The type of the resource. The value should always be `permanent_retention_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' => :'RumPermanentRetentionFilterUpdateAttributes', + :'id' => :'RumPermanentRetentionFilterID', + :'type' => :'RumPermanentRetentionFilterType' + } + 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::RumPermanentRetentionFilterUpdateData` 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_permanent_retention_filter_update_request.rb b/lib/datadog_api_client/v2/models/rum_permanent_retention_filter_update_request.rb new file mode 100644 index 000000000000..6ec94c517d31 --- /dev/null +++ b/lib/datadog_api_client/v2/models/rum_permanent_retention_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 permanent RUM retention filter body to update. + class RumPermanentRetentionFilterUpdateRequest + include BaseGenericModel + + # The new permanent RUM retention filter configuration 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' => :'RumPermanentRetentionFilterUpdateData' + } + 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::RumPermanentRetentionFilterUpdateRequest` 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_permanent_retention_filters_response.rb b/lib/datadog_api_client/v2/models/rum_permanent_retention_filters_response.rb new file mode 100644 index 000000000000..b6264cc128aa --- /dev/null +++ b/lib/datadog_api_client/v2/models/rum_permanent_retention_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 permanent RUM retention filters for a RUM application. + class RumPermanentRetentionFiltersResponse + include BaseGenericModel + + # A list of permanent RUM retention 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::RumPermanentRetentionFiltersResponse` 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