Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102052,6 +102052,14 @@ components:
RUMApplicationCreateAttributes:
description: RUM application creation attributes.
properties:
create_default_retention_filters:
default: true
description: |-
Whether to create the default retention filters when the application is created: `Sessions with errors` and `Sessions`, each with a 100% retention rate.
Set to `false` to create the application without them, for example when you add your own retention filters right after creating it. Until you add retention filters, the application only retains sessions matched by its [permanent retention filters](https://docs.datadoghq.com/real_user_monitoring/rum_without_limits/retention_filters/#permanent-retention-filters).
This setting doesn't affect permanent retention filters (sessions with forced replays, Synthetics sessions and RUM-APM flat sampling).
example: false
type: boolean
name:
description: Name of the RUM application.
example: my_new_rum_application
Expand Down Expand Up @@ -219711,7 +219719,7 @@ paths:
$ref: "#/components/schemas/RUMApplicationCreateRequest"
required: true
responses:
"200":
"201":
content:
application/json:
examples:
Expand All @@ -219732,7 +219740,7 @@ paths:
type: rum_application
schema:
$ref: "#/components/schemas/RUMApplicationResponse"
description: OK
description: Created
"400":
$ref: "#/components/responses/BadRequestResponse"
"429":
Expand Down
2 changes: 1 addition & 1 deletion examples/v2/rum/CreateRUMApplication.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Create a new RUM application returns "OK" response
// Create a new RUM application returns "Created" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
Expand Down
40 changes: 40 additions & 0 deletions examples/v2/rum/CreateRUMApplication_3241419056.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// Create a new RUM application without default retention filters returns "Created" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.RumApi;
import com.datadog.api.client.v2.model.RUMApplicationCreate;
import com.datadog.api.client.v2.model.RUMApplicationCreateAttributes;
import com.datadog.api.client.v2.model.RUMApplicationCreateRequest;
import com.datadog.api.client.v2.model.RUMApplicationCreateType;
import com.datadog.api.client.v2.model.RUMApplicationResponse;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN"));
RumApi apiInstance = new RumApi(defaultClient);

RUMApplicationCreateRequest body =
new RUMApplicationCreateRequest()
.data(
new RUMApplicationCreate()
.attributes(
new RUMApplicationCreateAttributes()
.name("test-rum-no-default-rf-5c67ebb32077e1d9")
.type("browser")
.createDefaultRetentionFilters(false))
.type(RUMApplicationCreateType.RUM_APPLICATION_CREATE));

try {
RUMApplicationResponse result = apiInstance.createRUMApplication(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling RumApi#createRUMApplication");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Create a new RUM application with Product Scales returns "OK" response
// Create a new RUM application with Product Scales returns "Created" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/datadog/api/client/v2/api/RumApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ public CompletableFuture<RUMApplicationResponse> createRUMApplicationAsync(
* <table border="1">
* <caption>Response details</caption>
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
* <tr><td> 200 </td><td> OK </td><td> - </td></tr>
* <tr><td> 201 </td><td> Created </td><td> - </td></tr>
* <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr>
* <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr>
* </table>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

/** RUM application creation attributes. */
@JsonPropertyOrder({
RUMApplicationCreateAttributes.JSON_PROPERTY_CREATE_DEFAULT_RETENTION_FILTERS,
RUMApplicationCreateAttributes.JSON_PROPERTY_NAME,
RUMApplicationCreateAttributes.JSON_PROPERTY_PRODUCT_ANALYTICS_RETENTION_STATE,
RUMApplicationCreateAttributes.JSON_PROPERTY_RUM_EVENT_PROCESSING_STATE,
Expand All @@ -28,6 +29,10 @@
value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
public class RUMApplicationCreateAttributes {
@JsonIgnore public boolean unparsed = false;
public static final String JSON_PROPERTY_CREATE_DEFAULT_RETENTION_FILTERS =
"create_default_retention_filters";
private Boolean createDefaultRetentionFilters = true;

public static final String JSON_PROPERTY_NAME = "name";
private String name;

Expand All @@ -50,6 +55,35 @@ public RUMApplicationCreateAttributes(
this.name = name;
}

public RUMApplicationCreateAttributes createDefaultRetentionFilters(
Boolean createDefaultRetentionFilters) {
this.createDefaultRetentionFilters = createDefaultRetentionFilters;
return this;
}

/**
* Whether to create the default retention filters when the application is created: <code>
* Sessions with errors</code> and <code>Sessions</code>, each with a 100% retention rate. Set to
* <code>false</code> to create the application without them, for example when you add your own
* retention filters right after creating it. Until you add retention filters, the application
* only retains sessions matched by its <a
* href="https://docs.datadoghq.com/real_user_monitoring/rum_without_limits/retention_filters/#permanent-retention-filters">permanent
* retention filters</a>. This setting doesn't affect permanent retention filters (sessions with
* forced replays, Synthetics sessions and RUM-APM flat sampling).
*
* @return createDefaultRetentionFilters
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_CREATE_DEFAULT_RETENTION_FILTERS)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public Boolean getCreateDefaultRetentionFilters() {
return createDefaultRetentionFilters;
}

public void setCreateDefaultRetentionFilters(Boolean createDefaultRetentionFilters) {
this.createDefaultRetentionFilters = createDefaultRetentionFilters;
}

public RUMApplicationCreateAttributes name(String name) {
this.name = name;
return this;
Expand Down Expand Up @@ -203,7 +237,10 @@ public boolean equals(Object o) {
}
RUMApplicationCreateAttributes rumApplicationCreateAttributes =
(RUMApplicationCreateAttributes) o;
return Objects.equals(this.name, rumApplicationCreateAttributes.name)
return Objects.equals(
this.createDefaultRetentionFilters,
rumApplicationCreateAttributes.createDefaultRetentionFilters)
&& Objects.equals(this.name, rumApplicationCreateAttributes.name)
&& Objects.equals(
this.productAnalyticsRetentionState,
rumApplicationCreateAttributes.productAnalyticsRetentionState)
Expand All @@ -217,13 +254,21 @@ public boolean equals(Object o) {
@Override
public int hashCode() {
return Objects.hash(
name, productAnalyticsRetentionState, rumEventProcessingState, type, additionalProperties);
createDefaultRetentionFilters,
name,
productAnalyticsRetentionState,
rumEventProcessingState,
type,
additionalProperties);
}

@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class RUMApplicationCreateAttributes {\n");
sb.append(" createDefaultRetentionFilters: ")
.append(toIndentedString(createDefaultRetentionFilters))
.append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" productAnalyticsRetentionState: ")
.append(toIndentedString(productAnalyticsRetentionState))
Expand Down
18 changes: 14 additions & 4 deletions src/test/resources/com/datadog/api/client/v2/api/rum.feature
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ Feature: RUM
Then the response status is 400 Bad Request

@skip-validation @team:ddoghq/rum-backend
Scenario: Create a new RUM application returns "OK" response
Scenario: Create a new RUM application returns "Created" response
Given new "CreateRUMApplication" request
And body with value {"data": {"attributes": {"name": "test-rum-{{ unique_hash }}", "type": "ios"}, "type": "rum_application_create"}}
When the request is sent
Then the response status is 200 RUM application.
Then the response status is 201 Created
And the response "data.type" is equal to "rum_application"
And the response "data.attributes.type" is equal to "ios"
And the response "data.attributes.name" is equal to "test-rum-{{ unique_hash }}"
Expand All @@ -48,18 +48,28 @@ Feature: RUM
And the response "data.attributes.product_scales.product_analytics_retention_scale" has field "last_modified_at"

@skip-validation @team:ddoghq/rum-backend
Scenario: Create a new RUM application with Product Scales returns "OK" response
Scenario: Create a new RUM application with Product Scales returns "Created" response
Given new "CreateRUMApplication" request
And body with value {"data": {"attributes": {"name": "test-rum-with-product-scales-{{ unique_hash }}", "type": "browser", "rum_event_processing_state": "ERROR_FOCUSED_MODE", "product_analytics_retention_state": "NONE"}, "type": "rum_application_create"}}
When the request is sent
Then the response status is 200 OK
Then the response status is 201 Created
And the response "data.type" is equal to "rum_application"
And the response "data.attributes.name" is equal to "test-rum-with-product-scales-{{ unique_hash }}"
And the response "data.attributes.product_scales.rum_event_processing_scale.state" is equal to "ERROR_FOCUSED_MODE"
And the response "data.attributes.product_scales.product_analytics_retention_scale.state" is equal to "NONE"
And the response "data.attributes.product_scales.rum_event_processing_scale" has field "last_modified_at"
And the response "data.attributes.product_scales.product_analytics_retention_scale" has field "last_modified_at"

@skip-validation @team:ddoghq/rum-backend
Scenario: Create a new RUM application without default retention filters returns "Created" response
Given new "CreateRUMApplication" request
And body with value {"data": {"attributes": {"name": "test-rum-no-default-rf-{{ unique_hash }}", "type": "browser", "create_default_retention_filters": false}, "type": "rum_application_create"}}
When the request is sent
Then the response status is 201 Created
And the response "data.type" is equal to "rum_application"
And the response "data.attributes.name" is equal to "test-rum-no-default-rf-{{ unique_hash }}"
And the response "data.attributes.type" is equal to "browser"

@skip-validation @team:ddoghq/rum-backend
Scenario: Delete a RUM application returns "No Content" response
Given there is a valid "rum_application" in the system
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9586,15 +9586,22 @@
{
"feature": "RUM",
"feature_file": "../../com/datadog/api/client/v2/api/rum.feature",
"file": "v2/rum/create-a-new-rum-application-returns-ok-response.json",
"scenario": "Create a new RUM application returns \"OK\" response",
"file": "v2/rum/create-a-new-rum-application-returns-created-response.json",
"scenario": "Create a new RUM application returns \"Created\" response",
"version": "v2"
},
{
"feature": "RUM",
"feature_file": "../../com/datadog/api/client/v2/api/rum.feature",
"file": "v2/rum/create-a-new-rum-application-with-product-scales-returns-ok-response.json",
"scenario": "Create a new RUM application with Product Scales returns \"OK\" response",
"file": "v2/rum/create-a-new-rum-application-with-product-scales-returns-created-response.json",
"scenario": "Create a new RUM application with Product Scales returns \"Created\" response",
"version": "v2"
},
{
"feature": "RUM",
"feature_file": "../../com/datadog/api/client/v2/api/rum.feature",
"file": "v2/rum/create-a-new-rum-application-without-default-retention-filters-returns-created-response.json",
"scenario": "Create a new RUM application without default retention filters returns \"Created\" response",
"version": "v2"
},
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"api": "RUM",
"expected_status": 200,
"expected_status": 201,
"feature": "RUM",
"id": "v2/RUM/Create a new RUM application returns \"OK\" response",
"id": "v2/RUM/Create a new RUM application returns \"Created\" response",
"operation_id": "CreateRUMApplication",
"request": {
"body": {
Expand All @@ -28,7 +28,7 @@
"parameters": [],
"path": "/api/v2/rum/applications"
},
"scenario": "Create a new RUM application returns \"OK\" response",
"scenario": "Create a new RUM application returns \"Created\" response",
"schema_version": 1,
"version": "v2"
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"api": "RUM",
"expected_status": 200,
"expected_status": 201,
"feature": "RUM",
"id": "v2/RUM/Create a new RUM application with Product Scales returns \"OK\" response",
"id": "v2/RUM/Create a new RUM application with Product Scales returns \"Created\" response",
"operation_id": "CreateRUMApplication",
"request": {
"body": {
Expand Down Expand Up @@ -30,7 +30,7 @@
"parameters": [],
"path": "/api/v2/rum/applications"
},
"scenario": "Create a new RUM application with Product Scales returns \"OK\" response",
"scenario": "Create a new RUM application with Product Scales returns \"Created\" response",
"schema_version": 1,
"version": "v2"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"api": "RUM",
"expected_status": 201,
"feature": "RUM",
"id": "v2/RUM/Create a new RUM application without default retention filters returns \"Created\" response",
"operation_id": "CreateRUMApplication",
"request": {
"body": {
"schema": {
"format": null,
"ref": "RUMApplicationCreateRequest",
"type": "object"
},
"source": "inline",
"value": {
"data": {
"attributes": {
"create_default_retention_filters": false,
"name": "test-rum-no-default-rf-{{ unique_hash }}",
"type": "browser"
},
"type": "rum_application_create"
}
}
},
"content_type": "application/json",
"method": "POST",
"pagination": false,
"parameters": [],
"path": "/api/v2/rum/applications"
},
"scenario": "Create a new RUM application without default retention filters returns \"Created\" response",
"schema_version": 1,
"version": "v2"
}
Loading
Loading