diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index b2e0e022c91c..cd9a7bc0fc2d 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -1565,6 +1565,23 @@ components: required: true schema: $ref: "#/components/schemas/RumPermanentRetentionFilterID" + RumRateLimitScopeIDParameter: + description: |- + The identifier of the scope the rate limit configuration applies to. + For the `application` scope, this is the RUM application ID. + in: path + name: scope_id + required: true + schema: + example: cd73a516-a481-4af5-8352-9b577465c77b + type: string + RumRateLimitScopeTypeParameter: + description: The type of scope the rate limit configuration applies to. + in: path + name: scope_type + required: true + schema: + $ref: "#/components/schemas/RumRateLimitScopeType" RumRetentionFilterIDParameter: description: Retention filter ID. in: path @@ -71652,6 +71669,179 @@ components: $ref: "#/components/schemas/RumPermanentRetentionFilterData" type: array type: object + RumRateLimitAdaptiveConfig: + description: The configuration used when `mode` is `adaptive`. + properties: + max_retention_rate: + description: The maximum fraction of sessions to retain, in the range `(0, 1]`. + example: 0.5 + exclusiveMinimum: true + format: double + maximum: 1 + minimum: 0 + type: number + required: + - max_retention_rate + type: object + RumRateLimitConfigAttributes: + description: The RUM rate limit configuration properties. + properties: + adaptive: + $ref: "#/components/schemas/RumRateLimitAdaptiveConfig" + custom: + $ref: "#/components/schemas/RumRateLimitCustomConfig" + mode: + $ref: "#/components/schemas/RumRateLimitMode" + org_id: + description: The ID of the organization the rate limit configuration belongs to. + example: 2 + format: int64 + type: integer + updated_at: + description: The date the rate limit configuration was last updated. + example: "2026-03-04T15:37:54.951447Z" + type: string + updated_by: + description: The handle of the user who last updated the rate limit configuration. + example: test@example.com + type: string + required: + - mode + - org_id + type: object + RumRateLimitConfigData: + description: The RUM rate limit configuration object. + properties: + attributes: + $ref: "#/components/schemas/RumRateLimitConfigAttributes" + id: + description: The identifier of the scope the rate limit configuration applies to. + example: cd73a516-a481-4af5-8352-9b577465c77b + type: string + type: + $ref: "#/components/schemas/RumRateLimitConfigType" + required: + - id + - type + - attributes + type: object + RumRateLimitConfigResponse: + description: The RUM rate limit configuration response. + properties: + data: + $ref: "#/components/schemas/RumRateLimitConfigData" + required: + - data + type: object + RumRateLimitConfigType: + default: rum_rate_limit_config + description: The type of the resource, always `rum_rate_limit_config`. + enum: + - rum_rate_limit_config + example: rum_rate_limit_config + type: string + x-enum-varnames: ["RUM_RATE_LIMIT_CONFIG"] + RumRateLimitConfigUpdateAttributes: + description: The RUM rate limit configuration properties to create or update. + properties: + adaptive: + $ref: "#/components/schemas/RumRateLimitAdaptiveConfig" + custom: + $ref: "#/components/schemas/RumRateLimitCustomConfig" + mode: + $ref: "#/components/schemas/RumRateLimitMode" + required: + - mode + type: object + RumRateLimitConfigUpdateData: + description: The RUM rate limit configuration to create or update. + properties: + attributes: + $ref: "#/components/schemas/RumRateLimitConfigUpdateAttributes" + id: + description: |- + The identifier of the scope the rate limit configuration applies to. + Must match `scope_id` in the path. + example: cd73a516-a481-4af5-8352-9b577465c77b + type: string + type: + $ref: "#/components/schemas/RumRateLimitConfigType" + required: + - id + - type + - attributes + type: object + RumRateLimitConfigUpdateRequest: + description: The body of a request to create or update a RUM rate limit configuration. + properties: + data: + $ref: "#/components/schemas/RumRateLimitConfigUpdateData" + required: + - data + type: object + RumRateLimitCustomConfig: + description: The configuration used when `mode` is `custom`. + properties: + daily_reset_time: + description: The time of day when the daily quota resets, in `HH:MM` 24-hour format. + example: "08:00" + pattern: "^([01]\\d|2[0-3]):[0-5]\\d$" + type: string + daily_reset_timezone: + description: The timezone offset used for the daily reset time, in `±HH:MM` format. + example: "+09:00" + pattern: "^[+-](0\\d|1[0-4]):[0-5]\\d$" + type: string + quota_reached_action: + $ref: "#/components/schemas/RumRateLimitQuotaReachedAction" + session_limit: + description: The maximum number of sessions allowed within the window. + example: 1000000 + format: int64 + minimum: 1 + type: integer + window_type: + $ref: "#/components/schemas/RumRateLimitWindowType" + required: + - window_type + - session_limit + - daily_reset_time + - daily_reset_timezone + - quota_reached_action + type: object + RumRateLimitMode: + description: |- + The rate limit mode. `custom` enforces a fixed session limit, while + `adaptive` dynamically adjusts retention. + enum: + - custom + - adaptive + example: custom + type: string + x-enum-varnames: ["CUSTOM", "ADAPTIVE"] + RumRateLimitQuotaReachedAction: + description: The action to take when the session quota is reached. + enum: + - stop + - slowdown + example: stop + type: string + x-enum-varnames: ["STOP", "SLOWDOWN"] + RumRateLimitScopeType: + default: application + description: The type of scope the rate limit configuration applies to. + enum: + - application + example: application + type: string + x-enum-varnames: ["APPLICATION"] + RumRateLimitWindowType: + description: The window type over which the session limit is enforced. + enum: + - daily + example: daily + type: string + x-enum-varnames: ["DAILY"] RumRetentionFilterAttributes: description: The object describing attributes of a RUM retention filter. properties: @@ -147474,6 +147664,142 @@ paths: tags: - Rum Metrics x-codegen-request-body-name: body + /api/v2/rum/config/rate-limit/{scope_type}/{scope_id}: + delete: + description: Delete the RUM rate limit configuration for a given scope. + operationId: DeleteRumRateLimitConfig + parameters: + - $ref: "#/components/parameters/RumRateLimitScopeTypeParameter" + - $ref: "#/components/parameters/RumRateLimitScopeIDParameter" + responses: + "204": + description: No Content + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Delete a RUM rate limit configuration + tags: + - Rum Rate Limit + 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 the RUM rate limit configuration for a given scope. + operationId: GetRumRateLimitConfig + parameters: + - $ref: "#/components/parameters/RumRateLimitScopeTypeParameter" + - $ref: "#/components/parameters/RumRateLimitScopeIDParameter" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + custom: + daily_reset_time: "08:00" + daily_reset_timezone: "+09:00" + quota_reached_action: stop + session_limit: 1000000 + window_type: daily + mode: custom + org_id: 2 + updated_at: "2026-03-04T15:37:54.951447Z" + updated_by: test@example.com + id: cd73a516-a481-4af5-8352-9b577465c77b + type: rum_rate_limit_config + schema: + $ref: "#/components/schemas/RumRateLimitConfigResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Get a RUM rate limit configuration + tags: + - Rum Rate Limit + 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/). + put: + description: |- + Create or update the RUM rate limit configuration for a given scope. + Returns the rate limit configuration object when the request is successful. + operationId: UpdateRumRateLimitConfig + parameters: + - $ref: "#/components/parameters/RumRateLimitScopeTypeParameter" + - $ref: "#/components/parameters/RumRateLimitScopeIDParameter" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + custom: + daily_reset_time: "08:00" + daily_reset_timezone: "+09:00" + quota_reached_action: stop + session_limit: 1000000 + window_type: daily + mode: custom + id: cd73a516-a481-4af5-8352-9b577465c77b + type: rum_rate_limit_config + schema: + $ref: "#/components/schemas/RumRateLimitConfigUpdateRequest" + description: The definition of the RUM rate limit configuration to create or update. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + custom: + daily_reset_time: "08:00" + daily_reset_timezone: "+09:00" + quota_reached_action: stop + session_limit: 1000000 + window_type: daily + mode: custom + org_id: 2 + updated_at: "2026-03-04T21:52:53.526022Z" + updated_by: test@example.com + id: cd73a516-a481-4af5-8352-9b577465c77b + type: rum_rate_limit_config + schema: + $ref: "#/components/schemas/RumRateLimitConfigResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Create or update a RUM rate limit configuration + tags: + - Rum Rate Limit + 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/events: get: description: |- @@ -171532,6 +171858,9 @@ tags: description: Find out more at url: https://docs.datadoghq.com/real_user_monitoring/platform/generate_metrics/ name: Rum Metrics + - description: |- + Manage RUM rate limit configurations for your organization's RUM applications. + name: Rum Rate Limit - description: Manage heatmap snapshots for RUM replay sessions. Create, update, delete, and retrieve snapshots to visualize user interactions on specific views. name: Rum Replay Heatmaps - description: Create and manage playlists of RUM replay sessions. Organize, categorize, and share collections of replay sessions for analysis and collaboration. diff --git a/examples/v2/rum-rate-limit/DeleteRumRateLimitConfig.rb b/examples/v2/rum-rate-limit/DeleteRumRateLimitConfig.rb new file mode 100644 index 000000000000..e28a4b3c89cb --- /dev/null +++ b/examples/v2/rum-rate-limit/DeleteRumRateLimitConfig.rb @@ -0,0 +1,8 @@ +# Delete a RUM rate limit configuration returns "No Content" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.delete_rum_rate_limit_config".to_sym] = true +end +api_instance = DatadogAPIClient::V2::RumRateLimitAPI.new +api_instance.delete_rum_rate_limit_config(RumRateLimitScopeType::APPLICATION, "cd73a516-a481-4af5-8352-9b577465c77b") diff --git a/examples/v2/rum-rate-limit/GetRumRateLimitConfig.rb b/examples/v2/rum-rate-limit/GetRumRateLimitConfig.rb new file mode 100644 index 000000000000..3f0ae8a6ecd4 --- /dev/null +++ b/examples/v2/rum-rate-limit/GetRumRateLimitConfig.rb @@ -0,0 +1,8 @@ +# Get a RUM rate limit configuration returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.get_rum_rate_limit_config".to_sym] = true +end +api_instance = DatadogAPIClient::V2::RumRateLimitAPI.new +p api_instance.get_rum_rate_limit_config(RumRateLimitScopeType::APPLICATION, "cd73a516-a481-4af5-8352-9b577465c77b") diff --git a/examples/v2/rum-rate-limit/UpdateRumRateLimitConfig.rb b/examples/v2/rum-rate-limit/UpdateRumRateLimitConfig.rb new file mode 100644 index 000000000000..45986f3207e5 --- /dev/null +++ b/examples/v2/rum-rate-limit/UpdateRumRateLimitConfig.rb @@ -0,0 +1,28 @@ +# Create or update a RUM rate limit configuration returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.update_rum_rate_limit_config".to_sym] = true +end +api_instance = DatadogAPIClient::V2::RumRateLimitAPI.new + +body = DatadogAPIClient::V2::RumRateLimitConfigUpdateRequest.new({ + data: DatadogAPIClient::V2::RumRateLimitConfigUpdateData.new({ + attributes: DatadogAPIClient::V2::RumRateLimitConfigUpdateAttributes.new({ + adaptive: DatadogAPIClient::V2::RumRateLimitAdaptiveConfig.new({ + max_retention_rate: 0.5, + }), + custom: DatadogAPIClient::V2::RumRateLimitCustomConfig.new({ + daily_reset_time: "08:00", + daily_reset_timezone: "+09:00", + quota_reached_action: DatadogAPIClient::V2::RumRateLimitQuotaReachedAction::STOP, + session_limit: 1000000, + window_type: DatadogAPIClient::V2::RumRateLimitWindowType::DAILY, + }), + mode: DatadogAPIClient::V2::RumRateLimitMode::CUSTOM, + }), + id: "cd73a516-a481-4af5-8352-9b577465c77b", + type: DatadogAPIClient::V2::RumRateLimitConfigType::RUM_RATE_LIMIT_CONFIG, + }), +}) +p api_instance.update_rum_rate_limit_config(RumRateLimitScopeType::APPLICATION, "cd73a516-a481-4af5-8352-9b577465c77b", body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 920e80f058e0..ffd4cadb808d 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -4544,6 +4544,19 @@ "metric_id" => "String", "body" => "RumMetricUpdateRequest", }, + "v2.DeleteRumRateLimitConfig" => { + "scope_type" => "RumRateLimitScopeType", + "scope_id" => "String", + }, + "v2.GetRumRateLimitConfig" => { + "scope_type" => "RumRateLimitScopeType", + "scope_id" => "String", + }, + "v2.UpdateRumRateLimitConfig" => { + "scope_type" => "RumRateLimitScopeType", + "scope_id" => "String", + "body" => "RumRateLimitConfigUpdateRequest", + }, "v2.ListRumReplayPlaylists" => { "filter_created_by_uuid" => "String", "filter_query" => "String", diff --git a/features/v2/rum_rate_limit.feature b/features/v2/rum_rate_limit.feature new file mode 100644 index 000000000000..90869ed17829 --- /dev/null +++ b/features/v2/rum_rate_limit.feature @@ -0,0 +1,93 @@ +@endpoint(rum-rate-limit) @endpoint(rum-rate-limit-v2) +Feature: Rum Rate Limit + Manage RUM rate limit configurations for your organization's RUM + applications. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "RumRateLimit" API + + @generated @skip @team:DataDog/rum-backend + Scenario: Create or update a RUM rate limit configuration returns "Bad Request" response + Given operation "UpdateRumRateLimitConfig" enabled + And new "UpdateRumRateLimitConfig" request + And request contains "scope_type" parameter from "REPLACE.ME" + And request contains "scope_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"adaptive": {"max_retention_rate": 0.5}, "custom": {"daily_reset_time": "08:00", "daily_reset_timezone": "+09:00", "quota_reached_action": "stop", "session_limit": 1000000, "window_type": "daily"}, "mode": "custom"}, "id": "cd73a516-a481-4af5-8352-9b577465c77b", "type": "rum_rate_limit_config"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/rum-backend + Scenario: Create or update a RUM rate limit configuration returns "Not Found" response + Given operation "UpdateRumRateLimitConfig" enabled + And new "UpdateRumRateLimitConfig" request + And request contains "scope_type" parameter from "REPLACE.ME" + And request contains "scope_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"adaptive": {"max_retention_rate": 0.5}, "custom": {"daily_reset_time": "08:00", "daily_reset_timezone": "+09:00", "quota_reached_action": "stop", "session_limit": 1000000, "window_type": "daily"}, "mode": "custom"}, "id": "cd73a516-a481-4af5-8352-9b577465c77b", "type": "rum_rate_limit_config"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/rum-backend + Scenario: Create or update a RUM rate limit configuration returns "OK" response + Given operation "UpdateRumRateLimitConfig" enabled + And new "UpdateRumRateLimitConfig" request + And request contains "scope_type" parameter from "REPLACE.ME" + And request contains "scope_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"adaptive": {"max_retention_rate": 0.5}, "custom": {"daily_reset_time": "08:00", "daily_reset_timezone": "+09:00", "quota_reached_action": "stop", "session_limit": 1000000, "window_type": "daily"}, "mode": "custom"}, "id": "cd73a516-a481-4af5-8352-9b577465c77b", "type": "rum_rate_limit_config"}} + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/rum-backend + Scenario: Delete a RUM rate limit configuration returns "Bad Request" response + Given operation "DeleteRumRateLimitConfig" enabled + And new "DeleteRumRateLimitConfig" request + And request contains "scope_type" parameter from "REPLACE.ME" + And request contains "scope_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/rum-backend + Scenario: Delete a RUM rate limit configuration returns "No Content" response + Given operation "DeleteRumRateLimitConfig" enabled + And new "DeleteRumRateLimitConfig" request + And request contains "scope_type" parameter from "REPLACE.ME" + And request contains "scope_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 rate limit configuration returns "Not Found" response + Given operation "DeleteRumRateLimitConfig" enabled + And new "DeleteRumRateLimitConfig" request + And request contains "scope_type" parameter from "REPLACE.ME" + And request contains "scope_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 rate limit configuration returns "Bad Request" response + Given operation "GetRumRateLimitConfig" enabled + And new "GetRumRateLimitConfig" request + And request contains "scope_type" parameter from "REPLACE.ME" + And request contains "scope_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/rum-backend + Scenario: Get a RUM rate limit configuration returns "Not Found" response + Given operation "GetRumRateLimitConfig" enabled + And new "GetRumRateLimitConfig" request + And request contains "scope_type" parameter from "REPLACE.ME" + And request contains "scope_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 rate limit configuration returns "OK" response + Given operation "GetRumRateLimitConfig" enabled + And new "GetRumRateLimitConfig" request + And request contains "scope_type" parameter from "REPLACE.ME" + And request contains "scope_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK diff --git a/features/v2/undo.json b/features/v2/undo.json index f1a04b48a1aa..ea7e02411b0a 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -5966,6 +5966,24 @@ "type": "idempotent" } }, + "DeleteRumRateLimitConfig": { + "tag": "Rum Rate Limit", + "undo": { + "type": "idempotent" + } + }, + "GetRumRateLimitConfig": { + "tag": "Rum Rate Limit", + "undo": { + "type": "safe" + } + }, + "UpdateRumRateLimitConfig": { + "tag": "Rum Rate Limit", + "undo": { + "type": "idempotent" + } + }, "ListRUMEvents": { "tag": "RUM", "undo": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index eeeec9db856f..f9dfdd659cca 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -567,6 +567,9 @@ def initialize "v2.update_connection": false, "v2.get_pruned_trace_by_id": false, "v2.get_trace_by_id": false, + "v2.delete_rum_rate_limit_config": false, + "v2.get_rum_rate_limit_config": false, + "v2.update_rum_rate_limit_config": false, "v2.create_scorecard_outcomes_batch": false, "v2.list_entity_risk_scores": false, "v2.create_incident_service": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index bfa0086bf6f1..ae40e0b5cebc 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -5546,6 +5546,19 @@ def overrides "v2.rum_query_filter" => "RUMQueryFilter", "v2.rum_query_options" => "RUMQueryOptions", "v2.rum_query_page_options" => "RUMQueryPageOptions", + "v2.rum_rate_limit_adaptive_config" => "RumRateLimitAdaptiveConfig", + "v2.rum_rate_limit_config_attributes" => "RumRateLimitConfigAttributes", + "v2.rum_rate_limit_config_data" => "RumRateLimitConfigData", + "v2.rum_rate_limit_config_response" => "RumRateLimitConfigResponse", + "v2.rum_rate_limit_config_type" => "RumRateLimitConfigType", + "v2.rum_rate_limit_config_update_attributes" => "RumRateLimitConfigUpdateAttributes", + "v2.rum_rate_limit_config_update_data" => "RumRateLimitConfigUpdateData", + "v2.rum_rate_limit_config_update_request" => "RumRateLimitConfigUpdateRequest", + "v2.rum_rate_limit_custom_config" => "RumRateLimitCustomConfig", + "v2.rum_rate_limit_mode" => "RumRateLimitMode", + "v2.rum_rate_limit_quota_reached_action" => "RumRateLimitQuotaReachedAction", + "v2.rum_rate_limit_scope_type" => "RumRateLimitScopeType", + "v2.rum_rate_limit_window_type" => "RumRateLimitWindowType", "v2.rum_response_links" => "RUMResponseLinks", "v2.rum_response_metadata" => "RUMResponseMetadata", "v2.rum_response_page" => "RUMResponsePage", @@ -7231,6 +7244,7 @@ def overrides "v2.rum_api" => "RUMAPI", "v2.rum_audience_management_api" => "RumAudienceManagementAPI", "v2.rum_metrics_api" => "RumMetricsAPI", + "v2.rum_rate_limit_api" => "RumRateLimitAPI", "v2.rum_replay_heatmaps_api" => "RumReplayHeatmapsAPI", "v2.rum_replay_playlists_api" => "RumReplayPlaylistsAPI", "v2.rum_replay_sessions_api" => "RumReplaySessionsAPI", diff --git a/lib/datadog_api_client/v2/api/rum_rate_limit_api.rb b/lib/datadog_api_client/v2/api/rum_rate_limit_api.rb new file mode 100644 index 000000000000..bd18a5fba3af --- /dev/null +++ b/lib/datadog_api_client/v2/api/rum_rate_limit_api.rb @@ -0,0 +1,277 @@ +=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 'cgi' + +module DatadogAPIClient::V2 + class RumRateLimitAPI + attr_accessor :api_client + + def initialize(api_client = DatadogAPIClient::APIClient.default) + @api_client = api_client + end + + # Delete a RUM rate limit configuration. + # + # @see #delete_rum_rate_limit_config_with_http_info + def delete_rum_rate_limit_config(scope_type, scope_id, opts = {}) + delete_rum_rate_limit_config_with_http_info(scope_type, scope_id, opts) + nil + end + + # Delete a RUM rate limit configuration. + # + # Delete the RUM rate limit configuration for a given scope. + # + # @param scope_type [RumRateLimitScopeType] The type of scope the rate limit configuration applies to. + # @param scope_id [String] The identifier of the scope the rate limit configuration applies to. For the `application` scope, this is the RUM application ID. + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_rum_rate_limit_config_with_http_info(scope_type, scope_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.delete_rum_rate_limit_config".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_rum_rate_limit_config") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_rum_rate_limit_config")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: RumRateLimitAPI.delete_rum_rate_limit_config ...' + end + # verify the required parameter 'scope_type' is set + if @api_client.config.client_side_validation && scope_type.nil? + fail ArgumentError, "Missing the required parameter 'scope_type' when calling RumRateLimitAPI.delete_rum_rate_limit_config" + end + # verify enum value + allowable_values = ['application'] + if @api_client.config.client_side_validation && !allowable_values.include?(scope_type) + fail ArgumentError, "invalid value for \"scope_type\", must be one of #{allowable_values}" + end + # verify the required parameter 'scope_id' is set + if @api_client.config.client_side_validation && scope_id.nil? + fail ArgumentError, "Missing the required parameter 'scope_id' when calling RumRateLimitAPI.delete_rum_rate_limit_config" + end + # resource path + local_var_path = '/api/v2/rum/config/rate-limit/{scope_type}/{scope_id}'.sub('{scope_type}', CGI.escape(scope_type.to_s).gsub('%2F', '/')).sub('{scope_id}', CGI.escape(scope_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_rum_rate_limit_config, + :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: RumRateLimitAPI#delete_rum_rate_limit_config\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get a RUM rate limit configuration. + # + # @see #get_rum_rate_limit_config_with_http_info + def get_rum_rate_limit_config(scope_type, scope_id, opts = {}) + data, _status_code, _headers = get_rum_rate_limit_config_with_http_info(scope_type, scope_id, opts) + data + end + + # Get a RUM rate limit configuration. + # + # Get the RUM rate limit configuration for a given scope. + # + # @param scope_type [RumRateLimitScopeType] The type of scope the rate limit configuration applies to. + # @param scope_id [String] The identifier of the scope the rate limit configuration applies to. For the `application` scope, this is the RUM application ID. + # @param opts [Hash] the optional parameters + # @return [Array<(RumRateLimitConfigResponse, Integer, Hash)>] RumRateLimitConfigResponse data, response status code and response headers + def get_rum_rate_limit_config_with_http_info(scope_type, scope_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_rum_rate_limit_config".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_rum_rate_limit_config") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_rum_rate_limit_config")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: RumRateLimitAPI.get_rum_rate_limit_config ...' + end + # verify the required parameter 'scope_type' is set + if @api_client.config.client_side_validation && scope_type.nil? + fail ArgumentError, "Missing the required parameter 'scope_type' when calling RumRateLimitAPI.get_rum_rate_limit_config" + end + # verify enum value + allowable_values = ['application'] + if @api_client.config.client_side_validation && !allowable_values.include?(scope_type) + fail ArgumentError, "invalid value for \"scope_type\", must be one of #{allowable_values}" + end + # verify the required parameter 'scope_id' is set + if @api_client.config.client_side_validation && scope_id.nil? + fail ArgumentError, "Missing the required parameter 'scope_id' when calling RumRateLimitAPI.get_rum_rate_limit_config" + end + # resource path + local_var_path = '/api/v2/rum/config/rate-limit/{scope_type}/{scope_id}'.sub('{scope_type}', CGI.escape(scope_type.to_s).gsub('%2F', '/')).sub('{scope_id}', CGI.escape(scope_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] || 'RumRateLimitConfigResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :get_rum_rate_limit_config, + :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: RumRateLimitAPI#get_rum_rate_limit_config\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Create or update a RUM rate limit configuration. + # + # @see #update_rum_rate_limit_config_with_http_info + def update_rum_rate_limit_config(scope_type, scope_id, body, opts = {}) + data, _status_code, _headers = update_rum_rate_limit_config_with_http_info(scope_type, scope_id, body, opts) + data + end + + # Create or update a RUM rate limit configuration. + # + # Create or update the RUM rate limit configuration for a given scope. + # Returns the rate limit configuration object when the request is successful. + # + # @param scope_type [RumRateLimitScopeType] The type of scope the rate limit configuration applies to. + # @param scope_id [String] The identifier of the scope the rate limit configuration applies to. For the `application` scope, this is the RUM application ID. + # @param body [RumRateLimitConfigUpdateRequest] The definition of the RUM rate limit configuration to create or update. + # @param opts [Hash] the optional parameters + # @return [Array<(RumRateLimitConfigResponse, Integer, Hash)>] RumRateLimitConfigResponse data, response status code and response headers + def update_rum_rate_limit_config_with_http_info(scope_type, scope_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.update_rum_rate_limit_config".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_rum_rate_limit_config") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_rum_rate_limit_config")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: RumRateLimitAPI.update_rum_rate_limit_config ...' + end + # verify the required parameter 'scope_type' is set + if @api_client.config.client_side_validation && scope_type.nil? + fail ArgumentError, "Missing the required parameter 'scope_type' when calling RumRateLimitAPI.update_rum_rate_limit_config" + end + # verify enum value + allowable_values = ['application'] + if @api_client.config.client_side_validation && !allowable_values.include?(scope_type) + fail ArgumentError, "invalid value for \"scope_type\", must be one of #{allowable_values}" + end + # verify the required parameter 'scope_id' is set + if @api_client.config.client_side_validation && scope_id.nil? + fail ArgumentError, "Missing the required parameter 'scope_id' when calling RumRateLimitAPI.update_rum_rate_limit_config" + 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 RumRateLimitAPI.update_rum_rate_limit_config" + end + # resource path + local_var_path = '/api/v2/rum/config/rate-limit/{scope_type}/{scope_id}'.sub('{scope_type}', CGI.escape(scope_type.to_s).gsub('%2F', '/')).sub('{scope_id}', CGI.escape(scope_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] || 'RumRateLimitConfigResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :update_rum_rate_limit_config, + :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::Put, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: RumRateLimitAPI#update_rum_rate_limit_config\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/datadog_api_client/v2/models/rum_rate_limit_adaptive_config.rb b/lib/datadog_api_client/v2/models/rum_rate_limit_adaptive_config.rb new file mode 100644 index 000000000000..8f4926708947 --- /dev/null +++ b/lib/datadog_api_client/v2/models/rum_rate_limit_adaptive_config.rb @@ -0,0 +1,131 @@ +=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 used when `mode` is `adaptive`. + class RumRateLimitAdaptiveConfig + include BaseGenericModel + + # The maximum fraction of sessions to retain, in the range `(0, 1]`. + attr_reader :max_retention_rate + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'max_retention_rate' => :'max_retention_rate' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'max_retention_rate' => :'Float' + } + 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::RumRateLimitAdaptiveConfig` 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?(:'max_retention_rate') + self.max_retention_rate = attributes[:'max_retention_rate'] + 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 @max_retention_rate.nil? + return false if @max_retention_rate > 1 + return false if @max_retention_rate <= 0 + true + end + + # Custom attribute writer method with validation + # @param max_retention_rate [Object] Object to be assigned + # @!visibility private + def max_retention_rate=(max_retention_rate) + if max_retention_rate.nil? + fail ArgumentError, 'invalid value for "max_retention_rate", max_retention_rate cannot be nil.' + end + if max_retention_rate > 1 + fail ArgumentError, 'invalid value for "max_retention_rate", must be smaller than or equal to 1.' + end + if max_retention_rate <= 0 + fail ArgumentError, 'invalid value for "max_retention_rate", must be greater than 0.' + end + @max_retention_rate = max_retention_rate + 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 && + max_retention_rate == o.max_retention_rate && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [max_retention_rate, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/rum_rate_limit_config_attributes.rb b/lib/datadog_api_client/v2/models/rum_rate_limit_config_attributes.rb new file mode 100644 index 000000000000..f38f30239bba --- /dev/null +++ b/lib/datadog_api_client/v2/models/rum_rate_limit_config_attributes.rb @@ -0,0 +1,185 @@ +=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 RUM rate limit configuration properties. + class RumRateLimitConfigAttributes + include BaseGenericModel + + # The configuration used when `mode` is `adaptive`. + attr_accessor :adaptive + + # The configuration used when `mode` is `custom`. + attr_accessor :custom + + # The rate limit mode. `custom` enforces a fixed session limit, while + # `adaptive` dynamically adjusts retention. + attr_reader :mode + + # The ID of the organization the rate limit configuration belongs to. + attr_reader :org_id + + # The date the rate limit configuration was last updated. + attr_accessor :updated_at + + # The handle of the user who last updated the rate limit configuration. + attr_accessor :updated_by + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'adaptive' => :'adaptive', + :'custom' => :'custom', + :'mode' => :'mode', + :'org_id' => :'org_id', + :'updated_at' => :'updated_at', + :'updated_by' => :'updated_by' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'adaptive' => :'RumRateLimitAdaptiveConfig', + :'custom' => :'RumRateLimitCustomConfig', + :'mode' => :'RumRateLimitMode', + :'org_id' => :'Integer', + :'updated_at' => :'String', + :'updated_by' => :'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::RumRateLimitConfigAttributes` 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?(:'adaptive') + self.adaptive = attributes[:'adaptive'] + end + + if attributes.key?(:'custom') + self.custom = attributes[:'custom'] + end + + if attributes.key?(:'mode') + self.mode = attributes[:'mode'] + end + + if attributes.key?(:'org_id') + self.org_id = attributes[:'org_id'] + end + + if attributes.key?(:'updated_at') + self.updated_at = attributes[:'updated_at'] + end + + if attributes.key?(:'updated_by') + self.updated_by = attributes[:'updated_by'] + 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 @mode.nil? + return false if @org_id.nil? + true + end + + # Custom attribute writer method with validation + # @param mode [Object] Object to be assigned + # @!visibility private + def mode=(mode) + if mode.nil? + fail ArgumentError, 'invalid value for "mode", mode cannot be nil.' + end + @mode = mode + end + + # Custom attribute writer method with validation + # @param org_id [Object] Object to be assigned + # @!visibility private + def org_id=(org_id) + if org_id.nil? + fail ArgumentError, 'invalid value for "org_id", org_id cannot be nil.' + end + @org_id = org_id + 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 && + adaptive == o.adaptive && + custom == o.custom && + mode == o.mode && + org_id == o.org_id && + updated_at == o.updated_at && + updated_by == o.updated_by && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [adaptive, custom, mode, org_id, updated_at, updated_by, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/rum_rate_limit_config_data.rb b/lib/datadog_api_client/v2/models/rum_rate_limit_config_data.rb new file mode 100644 index 000000000000..519fee8ca879 --- /dev/null +++ b/lib/datadog_api_client/v2/models/rum_rate_limit_config_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 RUM rate limit configuration object. + class RumRateLimitConfigData + include BaseGenericModel + + # The RUM rate limit configuration properties. + attr_reader :attributes + + # The identifier of the scope the rate limit configuration applies to. + attr_reader :id + + # The type of the resource, always `rum_rate_limit_config`. + 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' => :'RumRateLimitConfigAttributes', + :'id' => :'String', + :'type' => :'RumRateLimitConfigType' + } + 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::RumRateLimitConfigData` 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_rate_limit_config_response.rb b/lib/datadog_api_client/v2/models/rum_rate_limit_config_response.rb new file mode 100644 index 000000000000..491c626ae168 --- /dev/null +++ b/lib/datadog_api_client/v2/models/rum_rate_limit_config_response.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 RUM rate limit configuration response. + class RumRateLimitConfigResponse + include BaseGenericModel + + # The RUM rate limit configuration object. + 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' => :'RumRateLimitConfigData' + } + 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::RumRateLimitConfigResponse` 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_rate_limit_config_type.rb b/lib/datadog_api_client/v2/models/rum_rate_limit_config_type.rb new file mode 100644 index 000000000000..5a8f50118fe5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/rum_rate_limit_config_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, always `rum_rate_limit_config`. + class RumRateLimitConfigType + include BaseEnumModel + + RUM_RATE_LIMIT_CONFIG = "rum_rate_limit_config".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/rum_rate_limit_config_update_attributes.rb b/lib/datadog_api_client/v2/models/rum_rate_limit_config_update_attributes.rb new file mode 100644 index 000000000000..37e6e4647d23 --- /dev/null +++ b/lib/datadog_api_client/v2/models/rum_rate_limit_config_update_attributes.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 RUM rate limit configuration properties to create or update. + class RumRateLimitConfigUpdateAttributes + include BaseGenericModel + + # The configuration used when `mode` is `adaptive`. + attr_accessor :adaptive + + # The configuration used when `mode` is `custom`. + attr_accessor :custom + + # The rate limit mode. `custom` enforces a fixed session limit, while + # `adaptive` dynamically adjusts retention. + attr_reader :mode + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'adaptive' => :'adaptive', + :'custom' => :'custom', + :'mode' => :'mode' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'adaptive' => :'RumRateLimitAdaptiveConfig', + :'custom' => :'RumRateLimitCustomConfig', + :'mode' => :'RumRateLimitMode' + } + 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::RumRateLimitConfigUpdateAttributes` 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?(:'adaptive') + self.adaptive = attributes[:'adaptive'] + end + + if attributes.key?(:'custom') + self.custom = attributes[:'custom'] + end + + if attributes.key?(:'mode') + self.mode = attributes[:'mode'] + 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 @mode.nil? + true + end + + # Custom attribute writer method with validation + # @param mode [Object] Object to be assigned + # @!visibility private + def mode=(mode) + if mode.nil? + fail ArgumentError, 'invalid value for "mode", mode cannot be nil.' + end + @mode = mode + 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 && + adaptive == o.adaptive && + custom == o.custom && + mode == o.mode && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [adaptive, custom, mode, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/rum_rate_limit_config_update_data.rb b/lib/datadog_api_client/v2/models/rum_rate_limit_config_update_data.rb new file mode 100644 index 000000000000..e28f2817f63a --- /dev/null +++ b/lib/datadog_api_client/v2/models/rum_rate_limit_config_update_data.rb @@ -0,0 +1,166 @@ +=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 RUM rate limit configuration to create or update. + class RumRateLimitConfigUpdateData + include BaseGenericModel + + # The RUM rate limit configuration properties to create or update. + attr_reader :attributes + + # The identifier of the scope the rate limit configuration applies to. + # Must match `scope_id` in the path. + attr_reader :id + + # The type of the resource, always `rum_rate_limit_config`. + 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' => :'RumRateLimitConfigUpdateAttributes', + :'id' => :'String', + :'type' => :'RumRateLimitConfigType' + } + 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::RumRateLimitConfigUpdateData` 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_rate_limit_config_update_request.rb b/lib/datadog_api_client/v2/models/rum_rate_limit_config_update_request.rb new file mode 100644 index 000000000000..a85f60f7a1fd --- /dev/null +++ b/lib/datadog_api_client/v2/models/rum_rate_limit_config_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 body of a request to create or update a RUM rate limit configuration. + class RumRateLimitConfigUpdateRequest + include BaseGenericModel + + # The RUM rate limit configuration to create or 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' => :'RumRateLimitConfigUpdateData' + } + 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::RumRateLimitConfigUpdateRequest` 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_rate_limit_custom_config.rb b/lib/datadog_api_client/v2/models/rum_rate_limit_custom_config.rb new file mode 100644 index 000000000000..9b3e48d73fdc --- /dev/null +++ b/lib/datadog_api_client/v2/models/rum_rate_limit_custom_config.rb @@ -0,0 +1,223 @@ +=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 used when `mode` is `custom`. + class RumRateLimitCustomConfig + include BaseGenericModel + + # The time of day when the daily quota resets, in `HH:MM` 24-hour format. + attr_reader :daily_reset_time + + # The timezone offset used for the daily reset time, in `±HH:MM` format. + attr_reader :daily_reset_timezone + + # The action to take when the session quota is reached. + attr_reader :quota_reached_action + + # The maximum number of sessions allowed within the window. + attr_reader :session_limit + + # The window type over which the session limit is enforced. + attr_reader :window_type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'daily_reset_time' => :'daily_reset_time', + :'daily_reset_timezone' => :'daily_reset_timezone', + :'quota_reached_action' => :'quota_reached_action', + :'session_limit' => :'session_limit', + :'window_type' => :'window_type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'daily_reset_time' => :'String', + :'daily_reset_timezone' => :'String', + :'quota_reached_action' => :'RumRateLimitQuotaReachedAction', + :'session_limit' => :'Integer', + :'window_type' => :'RumRateLimitWindowType' + } + 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::RumRateLimitCustomConfig` 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?(:'daily_reset_time') + self.daily_reset_time = attributes[:'daily_reset_time'] + end + + if attributes.key?(:'daily_reset_timezone') + self.daily_reset_timezone = attributes[:'daily_reset_timezone'] + end + + if attributes.key?(:'quota_reached_action') + self.quota_reached_action = attributes[:'quota_reached_action'] + end + + if attributes.key?(:'session_limit') + self.session_limit = attributes[:'session_limit'] + end + + if attributes.key?(:'window_type') + self.window_type = attributes[:'window_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 @daily_reset_time.nil? + pattern = Regexp.new(/^([01]\d|2[0-3]):[0-5]\d$/) + return false if @daily_reset_time !~ pattern + return false if @daily_reset_timezone.nil? + pattern = Regexp.new(/^[+-](0\d|1[0-4]):[0-5]\d$/) + return false if @daily_reset_timezone !~ pattern + return false if @quota_reached_action.nil? + return false if @session_limit.nil? + return false if @session_limit < 1 + return false if @window_type.nil? + true + end + + # Custom attribute writer method with validation + # @param daily_reset_time [Object] Object to be assigned + # @!visibility private + def daily_reset_time=(daily_reset_time) + if daily_reset_time.nil? + fail ArgumentError, 'invalid value for "daily_reset_time", daily_reset_time cannot be nil.' + end + pattern = Regexp.new(/^([01]\d|2[0-3]):[0-5]\d$/) + if daily_reset_time !~ pattern + fail ArgumentError, "invalid value for \"daily_reset_time\", must conform to the pattern #{pattern}." + end + @daily_reset_time = daily_reset_time + end + + # Custom attribute writer method with validation + # @param daily_reset_timezone [Object] Object to be assigned + # @!visibility private + def daily_reset_timezone=(daily_reset_timezone) + if daily_reset_timezone.nil? + fail ArgumentError, 'invalid value for "daily_reset_timezone", daily_reset_timezone cannot be nil.' + end + pattern = Regexp.new(/^[+-](0\d|1[0-4]):[0-5]\d$/) + if daily_reset_timezone !~ pattern + fail ArgumentError, "invalid value for \"daily_reset_timezone\", must conform to the pattern #{pattern}." + end + @daily_reset_timezone = daily_reset_timezone + end + + # Custom attribute writer method with validation + # @param quota_reached_action [Object] Object to be assigned + # @!visibility private + def quota_reached_action=(quota_reached_action) + if quota_reached_action.nil? + fail ArgumentError, 'invalid value for "quota_reached_action", quota_reached_action cannot be nil.' + end + @quota_reached_action = quota_reached_action + end + + # Custom attribute writer method with validation + # @param session_limit [Object] Object to be assigned + # @!visibility private + def session_limit=(session_limit) + if session_limit.nil? + fail ArgumentError, 'invalid value for "session_limit", session_limit cannot be nil.' + end + if session_limit < 1 + fail ArgumentError, 'invalid value for "session_limit", must be greater than or equal to 1.' + end + @session_limit = session_limit + end + + # Custom attribute writer method with validation + # @param window_type [Object] Object to be assigned + # @!visibility private + def window_type=(window_type) + if window_type.nil? + fail ArgumentError, 'invalid value for "window_type", window_type cannot be nil.' + end + @window_type = window_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 && + daily_reset_time == o.daily_reset_time && + daily_reset_timezone == o.daily_reset_timezone && + quota_reached_action == o.quota_reached_action && + session_limit == o.session_limit && + window_type == o.window_type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [daily_reset_time, daily_reset_timezone, quota_reached_action, session_limit, window_type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/rum_rate_limit_mode.rb b/lib/datadog_api_client/v2/models/rum_rate_limit_mode.rb new file mode 100644 index 000000000000..50c41f38e0e6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/rum_rate_limit_mode.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 rate limit mode. `custom` enforces a fixed session limit, while + # `adaptive` dynamically adjusts retention. + class RumRateLimitMode + include BaseEnumModel + + CUSTOM = "custom".freeze + ADAPTIVE = "adaptive".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/rum_rate_limit_quota_reached_action.rb b/lib/datadog_api_client/v2/models/rum_rate_limit_quota_reached_action.rb new file mode 100644 index 000000000000..54a606998cce --- /dev/null +++ b/lib/datadog_api_client/v2/models/rum_rate_limit_quota_reached_action.rb @@ -0,0 +1,27 @@ +=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 action to take when the session quota is reached. + class RumRateLimitQuotaReachedAction + include BaseEnumModel + + STOP = "stop".freeze + SLOWDOWN = "slowdown".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/rum_rate_limit_scope_type.rb b/lib/datadog_api_client/v2/models/rum_rate_limit_scope_type.rb new file mode 100644 index 000000000000..518286948539 --- /dev/null +++ b/lib/datadog_api_client/v2/models/rum_rate_limit_scope_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 scope the rate limit configuration applies to. + class RumRateLimitScopeType + include BaseEnumModel + + APPLICATION = "application".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/rum_rate_limit_window_type.rb b/lib/datadog_api_client/v2/models/rum_rate_limit_window_type.rb new file mode 100644 index 000000000000..4348d507068f --- /dev/null +++ b/lib/datadog_api_client/v2/models/rum_rate_limit_window_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 window type over which the session limit is enforced. + class RumRateLimitWindowType + include BaseEnumModel + + DAILY = "daily".freeze + end +end