From c00a56b08ee7b5ba1ce24c24c67b15c3d2df054e Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 15 Oct 2026 15:24:14 +0000 Subject: [PATCH] Regenerate client from commit ee653d2 of spec repo --- .generator/schemas/v2/openapi.yaml | 278 ++++++++++++ examples/v2/feature-flags/GetSavedFilter.java | 27 ++ .../GetSavedFilter_375197246.java | 27 ++ .../api/client/v2/api/FeatureFlagsApi.java | 145 +++++++ .../v2/model/SavedFilterAttributes.java | 405 ++++++++++++++++++ .../client/v2/model/SavedFilterCondition.java | 243 +++++++++++ .../model/SavedFilterConditionOperator.java | 100 +++++ .../v2/model/SavedFilterCreationType.java | 60 +++ .../api/client/v2/model/SavedFilterData.java | 213 +++++++++ .../client/v2/model/SavedFilterDataType.java | 55 +++ .../client/v2/model/SavedFilterResponse.java | 148 +++++++ .../v2/model/SavedFilterTargetingRule.java | 194 +++++++++ .../api/client/v2/api/feature_flags.feature | 52 +++ .../com/datadog/api/client/v2/api/undo.json | 6 + .../test-runner-data/manifest.json | 21 + ...t-a-saved-filter-returns-a-saved-list.json | 35 ++ ...ved-filter-returns-not-found-response.json | 35 ++ ...et-a-saved-filter-returns-ok-response.json | 35 ++ .../test-server-data/v2/feature-flags.json | 93 ++++ 19 files changed, 2172 insertions(+) create mode 100644 examples/v2/feature-flags/GetSavedFilter.java create mode 100644 examples/v2/feature-flags/GetSavedFilter_375197246.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SavedFilterAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SavedFilterCondition.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SavedFilterConditionOperator.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SavedFilterCreationType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SavedFilterData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SavedFilterDataType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SavedFilterResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SavedFilterTargetingRule.java create mode 100644 src/test/resources/generated-test/test-runner-data/v2/feature-flags/get-a-saved-filter-returns-a-saved-list.json create mode 100644 src/test/resources/generated-test/test-runner-data/v2/feature-flags/get-a-saved-filter-returns-not-found-response.json create mode 100644 src/test/resources/generated-test/test-runner-data/v2/feature-flags/get-a-saved-filter-returns-ok-response.json diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index aa57375c892..8f408f146ef 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -108555,6 +108555,181 @@ components: required: - data type: object + SavedFilterAttributes: + description: Saved filter details, including the full targeting rules and conditions. + properties: + archived_at: + description: The time the saved filter was archived. Omitted when the filter is not archived. + example: "2026-01-03T12:00:00Z" + format: date-time + type: string + created_at: + description: The time the saved filter was created. + example: "2026-01-01T12:00:00Z" + format: date-time + type: string + created_by: + description: The ID of the user who created the saved filter. + example: "550e8400-e29b-41d4-a716-446655440091" + type: string + creation_type: + $ref: "#/components/schemas/SavedFilterCreationType" + description: + description: A description of the saved filter. Omitted when no description is set. + example: Users selected by email address or organization ID. + type: string + migration_metadata: + description: Optional JSON metadata supplied by migration tools for tracking the source of a saved filter. + example: + provider: launchdarkly + segment_key: early-access-users + name: + description: The name of the saved filter. + example: Early access users + type: string + targeting_rules: + description: Targeting rules combined with OR. Conditions within each rule are combined with AND. Both saved lists and saved rules use this structure. + items: + $ref: "#/components/schemas/SavedFilterTargetingRule" + type: array + updated_at: + description: The time the saved filter was last updated. + example: "2026-01-02T12:00:00Z" + format: date-time + type: string + required: + - name + - creation_type + - targeting_rules + - created_by + - created_at + - updated_at + type: object + SavedFilterCondition: + description: An inline condition in a saved filter targeting rule. + properties: + attribute: + description: The attribute evaluated by the condition. + example: email + type: string + id: + description: The ID of the condition. + example: "550e8400-e29b-41d4-a716-446655440093" + format: uuid + type: string + operator: + $ref: "#/components/schemas/SavedFilterConditionOperator" + value: + description: Values used by the condition operator. + example: + - user@example.com + items: + type: string + type: array + required: + - id + - operator + - attribute + - value + type: object + SavedFilterConditionOperator: + description: The comparison operator used by a saved filter condition. + enum: + - LT + - LTE + - GT + - GTE + - MATCHES + - NOT_MATCHES + - ONE_OF + - NOT_ONE_OF + - IS_NULL + - EQUALS + - SEMVER_EQ + - SEMVER_NEQ + - SEMVER_LT + - SEMVER_LTE + - SEMVER_GT + - SEMVER_GTE + example: ONE_OF + type: string + x-enum-varnames: + - LT + - LTE + - GT + - GTE + - MATCHES + - NOT_MATCHES + - ONE_OF + - NOT_ONE_OF + - IS_NULL + - EQUALS + - SEMVER_EQ + - SEMVER_NEQ + - SEMVER_LT + - SEMVER_LTE + - SEMVER_GT + - SEMVER_GTE + SavedFilterCreationType: + description: How the saved filter was authored. RULES indicates rule-based authoring and LIST indicates list import. Both types return targeting rules and conditions. + enum: + - RULES + - LIST + example: RULES + type: string + x-enum-varnames: + - RULES + - LIST + SavedFilterData: + description: A saved filter resource. + properties: + attributes: + $ref: "#/components/schemas/SavedFilterAttributes" + id: + description: The ID of the saved filter. + example: "550e8400-e29b-41d4-a716-446655440090" + format: uuid + type: string + type: + $ref: "#/components/schemas/SavedFilterDataType" + required: + - id + - type + - attributes + type: object + SavedFilterDataType: + description: The saved filter resource type. + enum: + - saved-filters + example: saved-filters + type: string + x-enum-varnames: + - SAVED_FILTERS + SavedFilterResponse: + description: Response containing a saved filter and its targeting rules. + properties: + data: + $ref: "#/components/schemas/SavedFilterData" + required: + - data + type: object + SavedFilterTargetingRule: + description: A targeting rule in a saved filter. A rule matches when all its conditions match. + properties: + conditions: + description: Conditions combined with AND within this targeting rule. + items: + $ref: "#/components/schemas/SavedFilterCondition" + type: array + id: + description: The ID of the targeting rule. + example: "550e8400-e29b-41d4-a716-446655440092" + format: uuid + type: string + required: + - id + - conditions + type: object ScaRequest: description: The top-level request object for submitting a Software Composition Analysis (SCA) scan result. properties: @@ -171735,6 +171910,109 @@ paths: operator: AND permissions: - feature_flag_config_write + /api/v2/feature-flags/saved-filters/{saved_filter_id}: + get: + description: |- + Returns a saved filter by ID, including its full targeting rules, conditions, and values. + Supports both saved lists and saved rules. Targeting rules are combined with OR, + and conditions within each rule are combined with AND. + Returns the stored filter definition rather than evaluating it against users or organizations. + Archived filters can be retrieved. Filters that are deleted or belong to another organization return a not found error. + operationId: GetSavedFilter + parameters: + - description: The ID of the saved filter. + example: "550e8400-e29b-41d4-a716-446655440090" + in: path + name: saved_filter_id + required: true + schema: + format: uuid + type: string + responses: + "200": + content: + application/json: + examples: + default: + summary: A saved rule matching an email address OR an organization ID + value: + data: + attributes: + created_at: "2026-01-01T12:00:00Z" + created_by: "550e8400-e29b-41d4-a716-446655440091" + creation_type: RULES + description: Users selected by email address or organization ID. + name: Early access users + targeting_rules: + - conditions: + - attribute: email + id: "550e8400-e29b-41d4-a716-446655440093" + operator: ONE_OF + value: ["user@example.com"] + id: "550e8400-e29b-41d4-a716-446655440092" + - conditions: + - attribute: org_id + id: "550e8400-e29b-41d4-a716-446655440095" + operator: ONE_OF + value: ["12345", "67890"] + id: "550e8400-e29b-41d4-a716-446655440094" + updated_at: "2026-01-02T12:00:00Z" + id: "550e8400-e29b-41d4-a716-446655440090" + type: saved-filters + saved_list: + summary: A saved list containing user IDs + value: + data: + attributes: + created_at: "2026-01-01T12:00:00Z" + created_by: "550e8400-e29b-41d4-a716-446655440091" + creation_type: LIST + name: Early access user list + targeting_rules: + - conditions: + - attribute: user_id + id: "550e8400-e29b-41d4-a716-446655440098" + operator: ONE_OF + value: ["user-123", "user-456"] + id: "550e8400-e29b-41d4-a716-446655440097" + updated_at: "2026-01-02T12:00:00Z" + id: "550e8400-e29b-41d4-a716-446655440096" + type: saved-filters + schema: + $ref: "#/components/schemas/SavedFilterResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - feature_flag_config_read + summary: Get a saved filter + tags: + - Feature Flags + x-permission: + operator: AND + permissions: + - feature_flag_config_read /api/v2/feature-flags/{feature_flag_id}: get: description: |- diff --git a/examples/v2/feature-flags/GetSavedFilter.java b/examples/v2/feature-flags/GetSavedFilter.java new file mode 100644 index 00000000000..e1e683d6619 --- /dev/null +++ b/examples/v2/feature-flags/GetSavedFilter.java @@ -0,0 +1,27 @@ +// Get a saved filter returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.FeatureFlagsApi; +import com.datadog.api.client.v2.model.SavedFilterResponse; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN")); + FeatureFlagsApi apiInstance = new FeatureFlagsApi(defaultClient); + + try { + SavedFilterResponse result = + apiInstance.getSavedFilter(UUID.fromString("8c051ac8-df7a-496e-b5c0-de691a411100")); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FeatureFlagsApi#getSavedFilter"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/feature-flags/GetSavedFilter_375197246.java b/examples/v2/feature-flags/GetSavedFilter_375197246.java new file mode 100644 index 00000000000..41ab140ed46 --- /dev/null +++ b/examples/v2/feature-flags/GetSavedFilter_375197246.java @@ -0,0 +1,27 @@ +// Get a saved filter returns a saved list + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.FeatureFlagsApi; +import com.datadog.api.client.v2.model.SavedFilterResponse; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN")); + FeatureFlagsApi apiInstance = new FeatureFlagsApi(defaultClient); + + try { + SavedFilterResponse result = + apiInstance.getSavedFilter(UUID.fromString("fb44ff15-fe17-4bab-afe8-9a8eb0cf586c")); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FeatureFlagsApi#getSavedFilter"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/datadog/api/client/v2/api/FeatureFlagsApi.java b/src/main/java/com/datadog/api/client/v2/api/FeatureFlagsApi.java index 68a1e313444..1a16d9cdd39 100644 --- a/src/main/java/com/datadog/api/client/v2/api/FeatureFlagsApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/FeatureFlagsApi.java @@ -19,6 +19,7 @@ import com.datadog.api.client.v2.model.ListEnvironmentsResponse; import com.datadog.api.client.v2.model.ListFeatureFlagsResponse; import com.datadog.api.client.v2.model.OverwriteAllocationsRequest; +import com.datadog.api.client.v2.model.SavedFilterResponse; import com.datadog.api.client.v2.model.UpdateEnvironmentRequest; import com.datadog.api.client.v2.model.UpdateFeatureFlagRequest; import com.datadog.api.client.v2.model.UpdateVariantRequest; @@ -1779,6 +1780,150 @@ public ApiResponse getFeatureFlagsEnvironmentWithHttpInfo(U new GenericType() {}); } + /** + * Get a saved filter. + * + *

See {@link #getSavedFilterWithHttpInfo}. + * + * @param savedFilterId The ID of the saved filter. (required) + * @return SavedFilterResponse + * @throws ApiException if fails to make API call + */ + public SavedFilterResponse getSavedFilter(UUID savedFilterId) throws ApiException { + return getSavedFilterWithHttpInfo(savedFilterId).getData(); + } + + /** + * Get a saved filter. + * + *

See {@link #getSavedFilterWithHttpInfoAsync}. + * + * @param savedFilterId The ID of the saved filter. (required) + * @return CompletableFuture<SavedFilterResponse> + */ + public CompletableFuture getSavedFilterAsync(UUID savedFilterId) { + return getSavedFilterWithHttpInfoAsync(savedFilterId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Returns a saved filter by ID, including its full targeting rules, conditions, and values. + * Supports both saved lists and saved rules. Targeting rules are combined with OR, and conditions + * within each rule are combined with AND. Returns the stored filter definition rather than + * evaluating it against users or organizations. Archived filters can be retrieved. Filters that + * are deleted or belong to another organization return a not found error. + * + * @param savedFilterId The ID of the saved filter. (required) + * @return ApiResponse<SavedFilterResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse getSavedFilterWithHttpInfo(UUID savedFilterId) + throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'savedFilterId' is set + if (savedFilterId == null) { + throw new ApiException( + 400, "Missing the required parameter 'savedFilterId' when calling getSavedFilter"); + } + // create path and map variables + String localVarPath = + "/api/v2/feature-flags/saved-filters/{saved_filter_id}" + .replaceAll( + "\\{" + "saved_filter_id" + "\\}", + apiClient.escapeString(savedFilterId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.FeatureFlagsApi.getSavedFilter", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get a saved filter. + * + *

See {@link #getSavedFilterWithHttpInfo}. + * + * @param savedFilterId The ID of the saved filter. (required) + * @return CompletableFuture<ApiResponse<SavedFilterResponse>> + */ + public CompletableFuture> getSavedFilterWithHttpInfoAsync( + UUID savedFilterId) { + Object localVarPostBody = null; + + // verify the required parameter 'savedFilterId' is set + if (savedFilterId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'savedFilterId' when calling getSavedFilter")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/feature-flags/saved-filters/{saved_filter_id}" + .replaceAll( + "\\{" + "saved_filter_id" + "\\}", + apiClient.escapeString(savedFilterId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.FeatureFlagsApi.getSavedFilter", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + /** Manage optional parameters to listFeatureFlags. */ public static class ListFeatureFlagsOptionalParameters { private String key; diff --git a/src/main/java/com/datadog/api/client/v2/model/SavedFilterAttributes.java b/src/main/java/com/datadog/api/client/v2/model/SavedFilterAttributes.java new file mode 100644 index 00000000000..95335e16135 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SavedFilterAttributes.java @@ -0,0 +1,405 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Saved filter details, including the full targeting rules and conditions. */ +@JsonPropertyOrder({ + SavedFilterAttributes.JSON_PROPERTY_ARCHIVED_AT, + SavedFilterAttributes.JSON_PROPERTY_CREATED_AT, + SavedFilterAttributes.JSON_PROPERTY_CREATED_BY, + SavedFilterAttributes.JSON_PROPERTY_CREATION_TYPE, + SavedFilterAttributes.JSON_PROPERTY_DESCRIPTION, + SavedFilterAttributes.JSON_PROPERTY_MIGRATION_METADATA, + SavedFilterAttributes.JSON_PROPERTY_NAME, + SavedFilterAttributes.JSON_PROPERTY_TARGETING_RULES, + SavedFilterAttributes.JSON_PROPERTY_UPDATED_AT +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SavedFilterAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ARCHIVED_AT = "archived_at"; + private OffsetDateTime archivedAt; + + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + private OffsetDateTime createdAt; + + public static final String JSON_PROPERTY_CREATED_BY = "created_by"; + private String createdBy; + + public static final String JSON_PROPERTY_CREATION_TYPE = "creation_type"; + private SavedFilterCreationType creationType; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_MIGRATION_METADATA = "migration_metadata"; + private Object migrationMetadata = null; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_TARGETING_RULES = "targeting_rules"; + private List targetingRules = new ArrayList<>(); + + public static final String JSON_PROPERTY_UPDATED_AT = "updated_at"; + private OffsetDateTime updatedAt; + + public SavedFilterAttributes() {} + + @JsonCreator + public SavedFilterAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_CREATED_AT) OffsetDateTime createdAt, + @JsonProperty(required = true, value = JSON_PROPERTY_CREATED_BY) String createdBy, + @JsonProperty(required = true, value = JSON_PROPERTY_CREATION_TYPE) + SavedFilterCreationType creationType, + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_TARGETING_RULES) + List targetingRules, + @JsonProperty(required = true, value = JSON_PROPERTY_UPDATED_AT) OffsetDateTime updatedAt) { + this.createdAt = createdAt; + this.createdBy = createdBy; + this.creationType = creationType; + this.unparsed |= !creationType.isValid(); + this.name = name; + this.targetingRules = targetingRules; + for (SavedFilterTargetingRule item : targetingRules) { + this.unparsed |= item.unparsed; + } + this.updatedAt = updatedAt; + } + + public SavedFilterAttributes archivedAt(OffsetDateTime archivedAt) { + this.archivedAt = archivedAt; + return this; + } + + /** + * The time the saved filter was archived. Omitted when the filter is not archived. + * + * @return archivedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ARCHIVED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getArchivedAt() { + return archivedAt; + } + + public void setArchivedAt(OffsetDateTime archivedAt) { + this.archivedAt = archivedAt; + } + + public SavedFilterAttributes createdAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * The time the saved filter was created. + * + * @return createdAt + */ + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + public SavedFilterAttributes createdBy(String createdBy) { + this.createdBy = createdBy; + return this; + } + + /** + * The ID of the user who created the saved filter. + * + * @return createdBy + */ + @JsonProperty(JSON_PROPERTY_CREATED_BY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(String createdBy) { + this.createdBy = createdBy; + } + + public SavedFilterAttributes creationType(SavedFilterCreationType creationType) { + this.creationType = creationType; + this.unparsed |= !creationType.isValid(); + return this; + } + + /** + * How the saved filter was authored. RULES indicates rule-based authoring and LIST indicates list + * import. Both types return targeting rules and conditions. + * + * @return creationType + */ + @JsonProperty(JSON_PROPERTY_CREATION_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SavedFilterCreationType getCreationType() { + return creationType; + } + + public void setCreationType(SavedFilterCreationType creationType) { + if (!creationType.isValid()) { + this.unparsed = true; + } + this.creationType = creationType; + } + + public SavedFilterAttributes description(String description) { + this.description = description; + return this; + } + + /** + * A description of the saved filter. Omitted when no description is set. + * + * @return description + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public SavedFilterAttributes migrationMetadata(Object migrationMetadata) { + this.migrationMetadata = migrationMetadata; + return this; + } + + /** + * Optional JSON metadata supplied by migration tools for tracking the source of a saved filter. + * + * @return migrationMetadata + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MIGRATION_METADATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getMigrationMetadata() { + return migrationMetadata; + } + + public void setMigrationMetadata(Object migrationMetadata) { + this.migrationMetadata = migrationMetadata; + } + + public SavedFilterAttributes name(String name) { + this.name = name; + return this; + } + + /** + * The name of the saved filter. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public SavedFilterAttributes targetingRules(List targetingRules) { + this.targetingRules = targetingRules; + for (SavedFilterTargetingRule item : targetingRules) { + this.unparsed |= item.unparsed; + } + return this; + } + + public SavedFilterAttributes addTargetingRulesItem(SavedFilterTargetingRule targetingRulesItem) { + this.targetingRules.add(targetingRulesItem); + this.unparsed |= targetingRulesItem.unparsed; + return this; + } + + /** + * Targeting rules combined with OR. Conditions within each rule are combined with AND. Both saved + * lists and saved rules use this structure. + * + * @return targetingRules + */ + @JsonProperty(JSON_PROPERTY_TARGETING_RULES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getTargetingRules() { + return targetingRules; + } + + public void setTargetingRules(List targetingRules) { + this.targetingRules = targetingRules; + if (targetingRules != null) { + for (SavedFilterTargetingRule item : targetingRules) { + this.unparsed |= item.unparsed; + } + } + } + + public SavedFilterAttributes updatedAt(OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * The time the saved filter was last updated. + * + * @return updatedAt + */ + @JsonProperty(JSON_PROPERTY_UPDATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return SavedFilterAttributes + */ + @JsonAnySetter + public SavedFilterAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this SavedFilterAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SavedFilterAttributes savedFilterAttributes = (SavedFilterAttributes) o; + return Objects.equals(this.archivedAt, savedFilterAttributes.archivedAt) + && Objects.equals(this.createdAt, savedFilterAttributes.createdAt) + && Objects.equals(this.createdBy, savedFilterAttributes.createdBy) + && Objects.equals(this.creationType, savedFilterAttributes.creationType) + && Objects.equals(this.description, savedFilterAttributes.description) + && Objects.equals(this.migrationMetadata, savedFilterAttributes.migrationMetadata) + && Objects.equals(this.name, savedFilterAttributes.name) + && Objects.equals(this.targetingRules, savedFilterAttributes.targetingRules) + && Objects.equals(this.updatedAt, savedFilterAttributes.updatedAt) + && Objects.equals(this.additionalProperties, savedFilterAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + archivedAt, + createdAt, + createdBy, + creationType, + description, + migrationMetadata, + name, + targetingRules, + updatedAt, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SavedFilterAttributes {\n"); + sb.append(" archivedAt: ").append(toIndentedString(archivedAt)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); + sb.append(" creationType: ").append(toIndentedString(creationType)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" migrationMetadata: ").append(toIndentedString(migrationMetadata)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" targetingRules: ").append(toIndentedString(targetingRules)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SavedFilterCondition.java b/src/main/java/com/datadog/api/client/v2/model/SavedFilterCondition.java new file mode 100644 index 00000000000..950ea313fd5 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SavedFilterCondition.java @@ -0,0 +1,243 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.UUID; + +/** An inline condition in a saved filter targeting rule. */ +@JsonPropertyOrder({ + SavedFilterCondition.JSON_PROPERTY_ATTRIBUTE, + SavedFilterCondition.JSON_PROPERTY_ID, + SavedFilterCondition.JSON_PROPERTY_OPERATOR, + SavedFilterCondition.JSON_PROPERTY_VALUE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SavedFilterCondition { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTE = "attribute"; + private String attribute; + + public static final String JSON_PROPERTY_ID = "id"; + private UUID id; + + public static final String JSON_PROPERTY_OPERATOR = "operator"; + private SavedFilterConditionOperator operator; + + public static final String JSON_PROPERTY_VALUE = "value"; + private List value = new ArrayList<>(); + + public SavedFilterCondition() {} + + @JsonCreator + public SavedFilterCondition( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTE) String attribute, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) UUID id, + @JsonProperty(required = true, value = JSON_PROPERTY_OPERATOR) + SavedFilterConditionOperator operator, + @JsonProperty(required = true, value = JSON_PROPERTY_VALUE) List value) { + this.attribute = attribute; + this.id = id; + this.operator = operator; + this.unparsed |= !operator.isValid(); + this.value = value; + } + + public SavedFilterCondition attribute(String attribute) { + this.attribute = attribute; + return this; + } + + /** + * The attribute evaluated by the condition. + * + * @return attribute + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getAttribute() { + return attribute; + } + + public void setAttribute(String attribute) { + this.attribute = attribute; + } + + public SavedFilterCondition id(UUID id) { + this.id = id; + return this; + } + + /** + * The ID of the condition. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UUID getId() { + return id; + } + + public void setId(UUID id) { + this.id = id; + } + + public SavedFilterCondition operator(SavedFilterConditionOperator operator) { + this.operator = operator; + this.unparsed |= !operator.isValid(); + return this; + } + + /** + * The comparison operator used by a saved filter condition. + * + * @return operator + */ + @JsonProperty(JSON_PROPERTY_OPERATOR) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SavedFilterConditionOperator getOperator() { + return operator; + } + + public void setOperator(SavedFilterConditionOperator operator) { + if (!operator.isValid()) { + this.unparsed = true; + } + this.operator = operator; + } + + public SavedFilterCondition value(List value) { + this.value = value; + return this; + } + + public SavedFilterCondition addValueItem(String valueItem) { + this.value.add(valueItem); + return this; + } + + /** + * Values used by the condition operator. + * + * @return value + */ + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getValue() { + return value; + } + + public void setValue(List value) { + this.value = value; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return SavedFilterCondition + */ + @JsonAnySetter + public SavedFilterCondition putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this SavedFilterCondition object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SavedFilterCondition savedFilterCondition = (SavedFilterCondition) o; + return Objects.equals(this.attribute, savedFilterCondition.attribute) + && Objects.equals(this.id, savedFilterCondition.id) + && Objects.equals(this.operator, savedFilterCondition.operator) + && Objects.equals(this.value, savedFilterCondition.value) + && Objects.equals(this.additionalProperties, savedFilterCondition.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attribute, id, operator, value, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SavedFilterCondition {\n"); + sb.append(" attribute: ").append(toIndentedString(attribute)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" operator: ").append(toIndentedString(operator)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SavedFilterConditionOperator.java b/src/main/java/com/datadog/api/client/v2/model/SavedFilterConditionOperator.java new file mode 100644 index 00000000000..63e2c758bf6 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SavedFilterConditionOperator.java @@ -0,0 +1,100 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The comparison operator used by a saved filter condition. */ +@JsonSerialize(using = SavedFilterConditionOperator.SavedFilterConditionOperatorSerializer.class) +public class SavedFilterConditionOperator extends ModelEnum { + + private static final Set allowedValues = + new HashSet( + Arrays.asList( + "LT", + "LTE", + "GT", + "GTE", + "MATCHES", + "NOT_MATCHES", + "ONE_OF", + "NOT_ONE_OF", + "IS_NULL", + "EQUALS", + "SEMVER_EQ", + "SEMVER_NEQ", + "SEMVER_LT", + "SEMVER_LTE", + "SEMVER_GT", + "SEMVER_GTE")); + + public static final SavedFilterConditionOperator LT = new SavedFilterConditionOperator("LT"); + public static final SavedFilterConditionOperator LTE = new SavedFilterConditionOperator("LTE"); + public static final SavedFilterConditionOperator GT = new SavedFilterConditionOperator("GT"); + public static final SavedFilterConditionOperator GTE = new SavedFilterConditionOperator("GTE"); + public static final SavedFilterConditionOperator MATCHES = + new SavedFilterConditionOperator("MATCHES"); + public static final SavedFilterConditionOperator NOT_MATCHES = + new SavedFilterConditionOperator("NOT_MATCHES"); + public static final SavedFilterConditionOperator ONE_OF = + new SavedFilterConditionOperator("ONE_OF"); + public static final SavedFilterConditionOperator NOT_ONE_OF = + new SavedFilterConditionOperator("NOT_ONE_OF"); + public static final SavedFilterConditionOperator IS_NULL = + new SavedFilterConditionOperator("IS_NULL"); + public static final SavedFilterConditionOperator EQUALS = + new SavedFilterConditionOperator("EQUALS"); + public static final SavedFilterConditionOperator SEMVER_EQ = + new SavedFilterConditionOperator("SEMVER_EQ"); + public static final SavedFilterConditionOperator SEMVER_NEQ = + new SavedFilterConditionOperator("SEMVER_NEQ"); + public static final SavedFilterConditionOperator SEMVER_LT = + new SavedFilterConditionOperator("SEMVER_LT"); + public static final SavedFilterConditionOperator SEMVER_LTE = + new SavedFilterConditionOperator("SEMVER_LTE"); + public static final SavedFilterConditionOperator SEMVER_GT = + new SavedFilterConditionOperator("SEMVER_GT"); + public static final SavedFilterConditionOperator SEMVER_GTE = + new SavedFilterConditionOperator("SEMVER_GTE"); + + SavedFilterConditionOperator(String value) { + super(value, allowedValues); + } + + public static class SavedFilterConditionOperatorSerializer + extends StdSerializer { + public SavedFilterConditionOperatorSerializer(Class t) { + super(t); + } + + public SavedFilterConditionOperatorSerializer() { + this(null); + } + + @Override + public void serialize( + SavedFilterConditionOperator value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static SavedFilterConditionOperator fromValue(String value) { + return new SavedFilterConditionOperator(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SavedFilterCreationType.java b/src/main/java/com/datadog/api/client/v2/model/SavedFilterCreationType.java new file mode 100644 index 00000000000..389365b62f1 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SavedFilterCreationType.java @@ -0,0 +1,60 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** + * How the saved filter was authored. RULES indicates rule-based authoring and LIST indicates list + * import. Both types return targeting rules and conditions. + */ +@JsonSerialize(using = SavedFilterCreationType.SavedFilterCreationTypeSerializer.class) +public class SavedFilterCreationType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("RULES", "LIST")); + + public static final SavedFilterCreationType RULES = new SavedFilterCreationType("RULES"); + public static final SavedFilterCreationType LIST = new SavedFilterCreationType("LIST"); + + SavedFilterCreationType(String value) { + super(value, allowedValues); + } + + public static class SavedFilterCreationTypeSerializer + extends StdSerializer { + public SavedFilterCreationTypeSerializer(Class t) { + super(t); + } + + public SavedFilterCreationTypeSerializer() { + this(null); + } + + @Override + public void serialize( + SavedFilterCreationType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static SavedFilterCreationType fromValue(String value) { + return new SavedFilterCreationType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SavedFilterData.java b/src/main/java/com/datadog/api/client/v2/model/SavedFilterData.java new file mode 100644 index 00000000000..d8645447358 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SavedFilterData.java @@ -0,0 +1,213 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.UUID; + +/** A saved filter resource. */ +@JsonPropertyOrder({ + SavedFilterData.JSON_PROPERTY_ATTRIBUTES, + SavedFilterData.JSON_PROPERTY_ID, + SavedFilterData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SavedFilterData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private SavedFilterAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private UUID id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private SavedFilterDataType type; + + public SavedFilterData() {} + + @JsonCreator + public SavedFilterData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + SavedFilterAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) UUID id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) SavedFilterDataType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public SavedFilterData attributes(SavedFilterAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Saved filter details, including the full targeting rules and conditions. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SavedFilterAttributes getAttributes() { + return attributes; + } + + public void setAttributes(SavedFilterAttributes attributes) { + this.attributes = attributes; + if (attributes != null) { + this.unparsed |= attributes.unparsed; + } + } + + public SavedFilterData id(UUID id) { + this.id = id; + return this; + } + + /** + * The ID of the saved filter. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UUID getId() { + return id; + } + + public void setId(UUID id) { + this.id = id; + } + + public SavedFilterData type(SavedFilterDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The saved filter resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SavedFilterDataType getType() { + return type; + } + + public void setType(SavedFilterDataType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return SavedFilterData + */ + @JsonAnySetter + public SavedFilterData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this SavedFilterData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SavedFilterData savedFilterData = (SavedFilterData) o; + return Objects.equals(this.attributes, savedFilterData.attributes) + && Objects.equals(this.id, savedFilterData.id) + && Objects.equals(this.type, savedFilterData.type) + && Objects.equals(this.additionalProperties, savedFilterData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SavedFilterData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SavedFilterDataType.java b/src/main/java/com/datadog/api/client/v2/model/SavedFilterDataType.java new file mode 100644 index 00000000000..f1cc7af0fbb --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SavedFilterDataType.java @@ -0,0 +1,55 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The saved filter resource type. */ +@JsonSerialize(using = SavedFilterDataType.SavedFilterDataTypeSerializer.class) +public class SavedFilterDataType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("saved-filters")); + + public static final SavedFilterDataType SAVED_FILTERS = new SavedFilterDataType("saved-filters"); + + SavedFilterDataType(String value) { + super(value, allowedValues); + } + + public static class SavedFilterDataTypeSerializer extends StdSerializer { + public SavedFilterDataTypeSerializer(Class t) { + super(t); + } + + public SavedFilterDataTypeSerializer() { + this(null); + } + + @Override + public void serialize( + SavedFilterDataType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static SavedFilterDataType fromValue(String value) { + return new SavedFilterDataType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SavedFilterResponse.java b/src/main/java/com/datadog/api/client/v2/model/SavedFilterResponse.java new file mode 100644 index 00000000000..e486cb3761d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SavedFilterResponse.java @@ -0,0 +1,148 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Response containing a saved filter and its targeting rules. */ +@JsonPropertyOrder({SavedFilterResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SavedFilterResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private SavedFilterData data; + + public SavedFilterResponse() {} + + @JsonCreator + public SavedFilterResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) SavedFilterData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public SavedFilterResponse data(SavedFilterData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * A saved filter resource. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SavedFilterData getData() { + return data; + } + + public void setData(SavedFilterData data) { + this.data = data; + if (data != null) { + this.unparsed |= data.unparsed; + } + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return SavedFilterResponse + */ + @JsonAnySetter + public SavedFilterResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this SavedFilterResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SavedFilterResponse savedFilterResponse = (SavedFilterResponse) o; + return Objects.equals(this.data, savedFilterResponse.data) + && Objects.equals(this.additionalProperties, savedFilterResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SavedFilterResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SavedFilterTargetingRule.java b/src/main/java/com/datadog/api/client/v2/model/SavedFilterTargetingRule.java new file mode 100644 index 00000000000..7165e5457f2 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SavedFilterTargetingRule.java @@ -0,0 +1,194 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.UUID; + +/** A targeting rule in a saved filter. A rule matches when all its conditions match. */ +@JsonPropertyOrder({ + SavedFilterTargetingRule.JSON_PROPERTY_CONDITIONS, + SavedFilterTargetingRule.JSON_PROPERTY_ID +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SavedFilterTargetingRule { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CONDITIONS = "conditions"; + private List conditions = new ArrayList<>(); + + public static final String JSON_PROPERTY_ID = "id"; + private UUID id; + + public SavedFilterTargetingRule() {} + + @JsonCreator + public SavedFilterTargetingRule( + @JsonProperty(required = true, value = JSON_PROPERTY_CONDITIONS) + List conditions, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) UUID id) { + this.conditions = conditions; + for (SavedFilterCondition item : conditions) { + this.unparsed |= item.unparsed; + } + this.id = id; + } + + public SavedFilterTargetingRule conditions(List conditions) { + this.conditions = conditions; + for (SavedFilterCondition item : conditions) { + this.unparsed |= item.unparsed; + } + return this; + } + + public SavedFilterTargetingRule addConditionsItem(SavedFilterCondition conditionsItem) { + this.conditions.add(conditionsItem); + this.unparsed |= conditionsItem.unparsed; + return this; + } + + /** + * Conditions combined with AND within this targeting rule. + * + * @return conditions + */ + @JsonProperty(JSON_PROPERTY_CONDITIONS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getConditions() { + return conditions; + } + + public void setConditions(List conditions) { + this.conditions = conditions; + if (conditions != null) { + for (SavedFilterCondition item : conditions) { + this.unparsed |= item.unparsed; + } + } + } + + public SavedFilterTargetingRule id(UUID id) { + this.id = id; + return this; + } + + /** + * The ID of the targeting rule. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UUID getId() { + return id; + } + + public void setId(UUID id) { + this.id = id; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return SavedFilterTargetingRule + */ + @JsonAnySetter + public SavedFilterTargetingRule putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this SavedFilterTargetingRule object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SavedFilterTargetingRule savedFilterTargetingRule = (SavedFilterTargetingRule) o; + return Objects.equals(this.conditions, savedFilterTargetingRule.conditions) + && Objects.equals(this.id, savedFilterTargetingRule.id) + && Objects.equals(this.additionalProperties, savedFilterTargetingRule.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(conditions, id, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SavedFilterTargetingRule {\n"); + sb.append(" conditions: ").append(toIndentedString(conditions)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/test/resources/com/datadog/api/client/v2/api/feature_flags.feature b/src/test/resources/com/datadog/api/client/v2/api/feature_flags.feature index 6f67ab23a03..b298d717c25 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/feature_flags.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/feature_flags.feature @@ -287,6 +287,58 @@ Feature: Feature Flags And the response "data.attributes.name" has the same value as "feature_flag.data.attributes.name" And the response "data.attributes.value_type" has the same value as "feature_flag.data.attributes.value_type" + @generated @skip @team:ddoghq/feature-flags + Scenario: Get a saved filter returns "Bad Request" response + Given new "GetSavedFilter" request + And request contains "saved_filter_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @team:ddoghq/feature-flags + Scenario: Get a saved filter returns "Not Found" response + Given new "GetSavedFilter" request + And request contains "saved_filter_id" parameter with value "00000000-0000-0000-0000-000000000000" + When the request is sent + Then the response status is 404 Not Found + + @replay-only @team:ddoghq/feature-flags + Scenario: Get a saved filter returns "OK" response + Given new "GetSavedFilter" request + And request contains "saved_filter_id" parameter with value "8c051ac8-df7a-496e-b5c0-de691a411100" + When the request is sent + Then the response status is 200 OK + And the response "data.id" is equal to "8c051ac8-df7a-496e-b5c0-de691a411100" + And the response "data.type" is equal to "saved-filters" + And the response "data.attributes.creation_type" is equal to "RULES" + And the response "data.attributes.name" is equal to "getSavedFilterTest-Rule" + And the response "data.attributes.description" is equal to "Synthetic fixture for OpenAPI tests" + And the response "data.attributes.targeting_rules" has length 2 + And the response "data.attributes.targeting_rules[0].conditions" has length 1 + And the response "data.attributes.targeting_rules[0].conditions[0].attribute" is equal to "email" + And the response "data.attributes.targeting_rules[0].conditions[0].operator" is equal to "ONE_OF" + And the response "data.attributes.targeting_rules[0].conditions[0].value" is equal to ["test@example.com"] + And the response "data.attributes.targeting_rules[1].conditions" has length 1 + And the response "data.attributes.targeting_rules[1].conditions[0].attribute" is equal to "org_id" + And the response "data.attributes.targeting_rules[1].conditions[0].operator" is equal to "ONE_OF" + And the response "data.attributes.targeting_rules[1].conditions[0].value" is equal to ["test-org-1"] + + @replay-only @team:ddoghq/feature-flags + Scenario: Get a saved filter returns a saved list + Given new "GetSavedFilter" request + And request contains "saved_filter_id" parameter with value "fb44ff15-fe17-4bab-afe8-9a8eb0cf586c" + When the request is sent + Then the response status is 200 OK + And the response "data.id" is equal to "fb44ff15-fe17-4bab-afe8-9a8eb0cf586c" + And the response "data.type" is equal to "saved-filters" + And the response "data.attributes.creation_type" is equal to "LIST" + And the response "data.attributes.name" is equal to "getSavedFilterTest-list" + And the response "data.attributes.description" is equal to "Synthetic fixture for OpenAPI tests" + And the response "data.attributes.targeting_rules" has length 1 + And the response "data.attributes.targeting_rules[0].conditions" has length 1 + And the response "data.attributes.targeting_rules[0].conditions[0].attribute" is equal to "user_id" + And the response "data.attributes.targeting_rules[0].conditions[0].operator" is equal to "ONE_OF" + And the response "data.attributes.targeting_rules[0].conditions[0].value" is equal to ["test-user-1", "test-user-2"] + @skip @team:ddoghq/feature-flags Scenario: Get an environment returns "Not Found" response Given new "GetFeatureFlagsEnvironment" request diff --git a/src/test/resources/com/datadog/api/client/v2/api/undo.json b/src/test/resources/com/datadog/api/client/v2/api/undo.json index 68ab96be667..aad409ef634 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/undo.json +++ b/src/test/resources/com/datadog/api/client/v2/api/undo.json @@ -3251,6 +3251,12 @@ "type": "idempotent" } }, + "GetSavedFilter": { + "tag": "Feature Flags", + "undo": { + "type": "safe" + } + }, "GetFeatureFlag": { "tag": "Feature Flags", "undo": { diff --git a/src/test/resources/generated-test/test-runner-data/manifest.json b/src/test/resources/generated-test/test-runner-data/manifest.json index a041d6604a4..b9b66fc3b14 100644 --- a/src/test/resources/generated-test/test-runner-data/manifest.json +++ b/src/test/resources/generated-test/test-runner-data/manifest.json @@ -5887,6 +5887,27 @@ "scenario": "Get a feature flag returns \"OK\" response", "version": "v2" }, + { + "feature": "Feature Flags", + "feature_file": "../../com/datadog/api/client/v2/api/feature_flags.feature", + "file": "v2/feature-flags/get-a-saved-filter-returns-not-found-response.json", + "scenario": "Get a saved filter returns \"Not Found\" response", + "version": "v2" + }, + { + "feature": "Feature Flags", + "feature_file": "../../com/datadog/api/client/v2/api/feature_flags.feature", + "file": "v2/feature-flags/get-a-saved-filter-returns-ok-response.json", + "scenario": "Get a saved filter returns \"OK\" response", + "version": "v2" + }, + { + "feature": "Feature Flags", + "feature_file": "../../com/datadog/api/client/v2/api/feature_flags.feature", + "file": "v2/feature-flags/get-a-saved-filter-returns-a-saved-list.json", + "scenario": "Get a saved filter returns a saved list", + "version": "v2" + }, { "feature": "Feature Flags", "feature_file": "../../com/datadog/api/client/v2/api/feature_flags.feature", diff --git a/src/test/resources/generated-test/test-runner-data/v2/feature-flags/get-a-saved-filter-returns-a-saved-list.json b/src/test/resources/generated-test/test-runner-data/v2/feature-flags/get-a-saved-filter-returns-a-saved-list.json new file mode 100644 index 00000000000..65bd5577fa1 --- /dev/null +++ b/src/test/resources/generated-test/test-runner-data/v2/feature-flags/get-a-saved-filter-returns-a-saved-list.json @@ -0,0 +1,35 @@ +{ + "api": "FeatureFlags", + "expected_status": 200, + "feature": "Feature Flags", + "id": "v2/Feature Flags/Get a saved filter returns a saved list", + "operation_id": "GetSavedFilter", + "request": { + "body": null, + "content_type": null, + "method": "GET", + "pagination": false, + "parameters": [ + { + "explode": null, + "in": "path", + "name": "saved_filter_id", + "required": true, + "schema": { + "format": "uuid", + "ref": null, + "type": "string" + }, + "source": { + "type": "literal", + "value": "fb44ff15-fe17-4bab-afe8-9a8eb0cf586c" + }, + "style": null + } + ], + "path": "/api/v2/feature-flags/saved-filters/{saved_filter_id}" + }, + "scenario": "Get a saved filter returns a saved list", + "schema_version": 1, + "version": "v2" +} diff --git a/src/test/resources/generated-test/test-runner-data/v2/feature-flags/get-a-saved-filter-returns-not-found-response.json b/src/test/resources/generated-test/test-runner-data/v2/feature-flags/get-a-saved-filter-returns-not-found-response.json new file mode 100644 index 00000000000..60bbac6839b --- /dev/null +++ b/src/test/resources/generated-test/test-runner-data/v2/feature-flags/get-a-saved-filter-returns-not-found-response.json @@ -0,0 +1,35 @@ +{ + "api": "FeatureFlags", + "expected_status": 404, + "feature": "Feature Flags", + "id": "v2/Feature Flags/Get a saved filter returns \"Not Found\" response", + "operation_id": "GetSavedFilter", + "request": { + "body": null, + "content_type": null, + "method": "GET", + "pagination": false, + "parameters": [ + { + "explode": null, + "in": "path", + "name": "saved_filter_id", + "required": true, + "schema": { + "format": "uuid", + "ref": null, + "type": "string" + }, + "source": { + "type": "literal", + "value": "00000000-0000-0000-0000-000000000000" + }, + "style": null + } + ], + "path": "/api/v2/feature-flags/saved-filters/{saved_filter_id}" + }, + "scenario": "Get a saved filter returns \"Not Found\" response", + "schema_version": 1, + "version": "v2" +} diff --git a/src/test/resources/generated-test/test-runner-data/v2/feature-flags/get-a-saved-filter-returns-ok-response.json b/src/test/resources/generated-test/test-runner-data/v2/feature-flags/get-a-saved-filter-returns-ok-response.json new file mode 100644 index 00000000000..2ac7d614459 --- /dev/null +++ b/src/test/resources/generated-test/test-runner-data/v2/feature-flags/get-a-saved-filter-returns-ok-response.json @@ -0,0 +1,35 @@ +{ + "api": "FeatureFlags", + "expected_status": 200, + "feature": "Feature Flags", + "id": "v2/Feature Flags/Get a saved filter returns \"OK\" response", + "operation_id": "GetSavedFilter", + "request": { + "body": null, + "content_type": null, + "method": "GET", + "pagination": false, + "parameters": [ + { + "explode": null, + "in": "path", + "name": "saved_filter_id", + "required": true, + "schema": { + "format": "uuid", + "ref": null, + "type": "string" + }, + "source": { + "type": "literal", + "value": "8c051ac8-df7a-496e-b5c0-de691a411100" + }, + "style": null + } + ], + "path": "/api/v2/feature-flags/saved-filters/{saved_filter_id}" + }, + "scenario": "Get a saved filter returns \"OK\" response", + "schema_version": 1, + "version": "v2" +} diff --git a/src/test/resources/generated-test/test-server-data/v2/feature-flags.json b/src/test/resources/generated-test/test-server-data/v2/feature-flags.json index 514cb759652..b843e1a2ed9 100644 --- a/src/test/resources/generated-test/test-server-data/v2/feature-flags.json +++ b/src/test/resources/generated-test/test-server-data/v2/feature-flags.json @@ -538,6 +538,99 @@ "scenario": "Get a feature flag returns \"OK\" response", "version": "v2" }, + { + "feature": "Feature Flags", + "frozen_at": "2026-10-14T20:24:21.981Z", + "interactions": [ + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "GET", + "path": "/api/v2/feature-flags/saved-filters/00000000-0000-0000-0000-000000000000", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"errors\":[{\"status\":\"404\",\"title\":\"Not Found\",\"detail\":\"saved filter not found: record not found\"}]}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "Not Found", + "status": 404 + } + } + ], + "scenario": "Get a saved filter returns \"Not Found\" response", + "version": "v2" + }, + { + "feature": "Feature Flags", + "frozen_at": "2026-10-14T20:24:22.481Z", + "interactions": [ + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "GET", + "path": "/api/v2/feature-flags/saved-filters/8c051ac8-df7a-496e-b5c0-de691a411100", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"8c051ac8-df7a-496e-b5c0-de691a411100\",\"type\":\"saved-filters\",\"attributes\":{\"created_at\":\"2026-10-14T19:57:33Z\",\"created_by\":\"550e8400-e29b-41d4-a716-446655440091\",\"creation_type\":\"RULES\",\"description\":\"Synthetic fixture for OpenAPI tests\",\"name\":\"getSavedFilterTest-Rule\",\"targeting_rules\":[{\"id\":\"204d53d3-9913-485f-af8e-8a8b4b34a4cb\",\"conditions\":[{\"id\":\"e12773d9-27ec-4009-88ab-6654227138c3\",\"operator\":\"ONE_OF\",\"attribute\":\"email\",\"value\":[\"test@example.com\"]}]},{\"id\":\"286b13f5-2b57-42a6-9dd6-555e46332591\",\"conditions\":[{\"id\":\"17367bb6-18cb-4e92-b126-2f1591ab3582\",\"operator\":\"ONE_OF\",\"attribute\":\"org_id\",\"value\":[\"test-org-1\"]}]}],\"updated_at\":\"2026-10-14T19:57:33Z\"}}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + } + ], + "scenario": "Get a saved filter returns \"OK\" response", + "version": "v2" + }, + { + "feature": "Feature Flags", + "frozen_at": "2026-10-14T20:24:22.277Z", + "interactions": [ + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "GET", + "path": "/api/v2/feature-flags/saved-filters/fb44ff15-fe17-4bab-afe8-9a8eb0cf586c", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"fb44ff15-fe17-4bab-afe8-9a8eb0cf586c\",\"type\":\"saved-filters\",\"attributes\":{\"created_at\":\"2026-10-14T20:06:17Z\",\"created_by\":\"550e8400-e29b-41d4-a716-446655440091\",\"creation_type\":\"LIST\",\"description\":\"Synthetic fixture for OpenAPI tests\",\"name\":\"getSavedFilterTest-list\",\"targeting_rules\":[{\"id\":\"bb656152-2e92-43bc-a30a-b0bd9187c2ec\",\"conditions\":[{\"id\":\"6b2127a4-a463-4069-baa8-4950f11c6605\",\"operator\":\"ONE_OF\",\"attribute\":\"user_id\",\"value\":[\"test-user-1\",\"test-user-2\"]}]}],\"updated_at\":\"2026-10-14T20:06:17Z\"}}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + } + ], + "scenario": "Get a saved filter returns a saved list", + "version": "v2" + }, { "feature": "Feature Flags", "frozen_at": "2026-10-13T16:23:05.377Z",