From cb1f78409ddfeb5f697071f3e8f9a9c36b9f5cca Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Tue, 20 Oct 2026 18:11:10 +0000 Subject: [PATCH] Regenerate client from commit 34abb52 of spec repo --- .generator/schemas/v2/openapi.yaml | 365 ++++++++ .../UpdateSavedFilterAttributes.java | 41 + ...pdateSavedFilterAttributes_1194333410.java | 57 ++ ...pdateSavedFilterAttributes_1937053112.java | 55 ++ ...pdateSavedFilterAttributes_2658080376.java | 57 ++ ...UpdateSavedFilterAttributes_281483245.java | 41 + ...pdateSavedFilterAttributes_3212710506.java | 42 + ...pdateSavedFilterAttributes_3817543566.java | 43 + ...pdateSavedFilterAttributes_4162852827.java | 39 + ...UpdateSavedFilterAttributes_727520235.java | 55 ++ .../api/client/v2/api/FeatureFlagsApi.java | 177 ++++ .../v2/model/PatchSavedFilterAttributes.java | 290 ++++++ .../PatchSavedFilterConflictResponse.java | 300 +++++++ .../client/v2/model/PatchSavedFilterData.java | 186 ++++ .../PatchSavedFilterForbiddenResponse.java | 366 ++++++++ .../v2/model/PatchSavedFilterRequest.java | 148 +++ .../v2/model/SavedFilterAPIErrorResponse.java | 96 ++ ...SavedFilterApprovalConflictAttributes.java | 202 +++++ .../SavedFilterApprovalConflictData.java | 220 +++++ .../SavedFilterApprovalConflictResponse.java | 99 +++ .../SavedFilterApprovalConflictType.java | 58 ++ .../v2/model/SavedFilterConditionRequest.java | 218 +++++ .../v2/model/SavedFilterFlagReference.java | 174 ++++ .../SavedFilterJSONAPIErrorResponse.java | 109 +++ ...SavedFilterPermissionDeniedAttributes.java | 199 +++++ .../SavedFilterPermissionDeniedData.java | 219 +++++ .../SavedFilterPermissionDeniedResponse.java | 98 ++ .../SavedFilterPermissionDeniedType.java | 58 ++ .../SavedFilterTargetingRuleRequest.java | 166 ++++ .../api/client/v2/api/feature_flags.feature | 294 ++++++ .../com/datadog/api/client/v2/api/undo.json | 6 + .../test-runner-data/manifest.json | 140 +++ ...ts-the-current-timestamp-for-metadata.json | 51 ++ ...cepts-the-current-timestamp-for-rules.json | 63 ++ ...-the-description-with-an-empty-string.json | 50 ++ ...d-filter-preserves-a-null-description.json | 51 ++ ...saved-filter-rejects-a-duplicate-name.json | 50 ++ ...ved-filter-rejects-a-null-only-update.json | 50 ++ ...ilter-rejects-a-timestamp-only-update.json | 50 ++ ...-a-saved-filter-rejects-an-empty-name.json | 50 ++ ...d-filter-rejects-an-invalid-timestamp.json | 51 ++ ...-filter-rejects-empty-targeting-rules.json | 50 ++ ...d-filter-rejects-nested-saved-filters.json | 63 ++ ...ved-filter-rejects-stale-rule-updates.json | 63 ++ ...replaces-rules-and-preserves-metadata.json | 62 ++ ...er-replaces-the-rules-of-a-saved-list.json | 62 ++ ...d-filter-returns-bad-request-response.json | 48 + ...aved-filter-returns-conflict-response.json | 51 ++ ...ved-filter-returns-not-found-response.json | 50 ++ ...ch-a-saved-filter-returns-ok-response.json | 50 ++ ...r-updates-metadata-and-rules-together.json | 64 ++ ...-only-the-description-of-a-saved-list.json | 50 ++ .../test-server-data/v2/feature-flags.json | 839 ++++++++++++++++++ 53 files changed, 6536 insertions(+) create mode 100644 examples/v2/feature-flags/UpdateSavedFilterAttributes.java create mode 100644 examples/v2/feature-flags/UpdateSavedFilterAttributes_1194333410.java create mode 100644 examples/v2/feature-flags/UpdateSavedFilterAttributes_1937053112.java create mode 100644 examples/v2/feature-flags/UpdateSavedFilterAttributes_2658080376.java create mode 100644 examples/v2/feature-flags/UpdateSavedFilterAttributes_281483245.java create mode 100644 examples/v2/feature-flags/UpdateSavedFilterAttributes_3212710506.java create mode 100644 examples/v2/feature-flags/UpdateSavedFilterAttributes_3817543566.java create mode 100644 examples/v2/feature-flags/UpdateSavedFilterAttributes_4162852827.java create mode 100644 examples/v2/feature-flags/UpdateSavedFilterAttributes_727520235.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/PatchSavedFilterAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/PatchSavedFilterConflictResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/PatchSavedFilterData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/PatchSavedFilterForbiddenResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/PatchSavedFilterRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SavedFilterAPIErrorResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SavedFilterApprovalConflictAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SavedFilterApprovalConflictData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SavedFilterApprovalConflictResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SavedFilterApprovalConflictType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SavedFilterConditionRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SavedFilterFlagReference.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SavedFilterJSONAPIErrorResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SavedFilterPermissionDeniedAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SavedFilterPermissionDeniedData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SavedFilterPermissionDeniedResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SavedFilterPermissionDeniedType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SavedFilterTargetingRuleRequest.java create mode 100644 src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-accepts-the-current-timestamp-for-metadata.json create mode 100644 src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-accepts-the-current-timestamp-for-rules.json create mode 100644 src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-clears-the-description-with-an-empty-string.json create mode 100644 src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-preserves-a-null-description.json create mode 100644 src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-rejects-a-duplicate-name.json create mode 100644 src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-rejects-a-null-only-update.json create mode 100644 src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-rejects-a-timestamp-only-update.json create mode 100644 src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-rejects-an-empty-name.json create mode 100644 src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-rejects-an-invalid-timestamp.json create mode 100644 src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-rejects-empty-targeting-rules.json create mode 100644 src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-rejects-nested-saved-filters.json create mode 100644 src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-rejects-stale-rule-updates.json create mode 100644 src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-replaces-rules-and-preserves-metadata.json create mode 100644 src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-replaces-the-rules-of-a-saved-list.json create mode 100644 src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-returns-bad-request-response.json create mode 100644 src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-returns-conflict-response.json create mode 100644 src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-returns-not-found-response.json create mode 100644 src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-returns-ok-response.json create mode 100644 src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-updates-metadata-and-rules-together.json create mode 100644 src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-updates-only-the-description-of-a-saved-list.json diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 0168ec45e3b..64947c88c57 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -94889,6 +94889,64 @@ components: version: $ref: "#/components/schemas/Version" type: object + PatchSavedFilterAttributes: + description: Fields to update. At least one of `name`, `description`, or `targeting_rules` must have a non-null value. Omitted or null fields are preserved. The creation type cannot be changed. + properties: + description: + description: The new description. Send an empty string to clear the description. If omitted or null, the existing description is preserved. + example: Updated early access users. + nullable: true + type: string + last_updated_at: + description: The `updated_at` value returned by a previous read, as an RFC 3339 timestamp. If it differs from the stored update time, truncated to seconds, the request returns a 409 response. For metadata-only updates, this check does not prevent all concurrent writes. This field alone does not constitute an update. + example: "2026-01-02T12:00:00Z" + format: date-time + nullable: true + type: string + name: + description: The new name of the saved filter. Must not be empty. + example: Early access users + minLength: 1 + nullable: true + type: string + targeting_rules: + description: The complete replacement targeting rules, combined with OR. Conditions within each rule are combined with AND. Replaces all existing rules. Values are not appended. Must contain at least one rule. Saved filters cannot reference other saved filters. + items: + $ref: "#/components/schemas/SavedFilterTargetingRuleRequest" + minItems: 1 + nullable: true + type: array + type: object + PatchSavedFilterConflictResponse: + description: A stale update, duplicate name, or other conflict, or a resource listing consumer flags requiring approval. + oneOf: + - $ref: "#/components/schemas/SavedFilterJSONAPIErrorResponse" + - $ref: "#/components/schemas/SavedFilterApprovalConflictResponse" + PatchSavedFilterData: + description: The saved filter fields to update. + properties: + attributes: + $ref: "#/components/schemas/PatchSavedFilterAttributes" + type: + $ref: "#/components/schemas/SavedFilterDataType" + required: + - type + - attributes + type: object + PatchSavedFilterForbiddenResponse: + description: An authentication or permission error, or a resource listing consumer flags that the caller cannot edit. + oneOf: + - $ref: "#/components/schemas/SavedFilterAPIErrorResponse" + - $ref: "#/components/schemas/SavedFilterJSONAPIErrorResponse" + - $ref: "#/components/schemas/SavedFilterPermissionDeniedResponse" + PatchSavedFilterRequest: + description: Request to partially update a saved filter. + properties: + data: + $ref: "#/components/schemas/PatchSavedFilterData" + required: + - data + type: object PatchStatusPageRequest: description: Request object for updating a status page. example: @@ -108855,6 +108913,72 @@ components: required: - data type: object + SavedFilterAPIErrorResponse: + additionalProperties: false + description: A saved filter authorization error containing at least one error message. + properties: + errors: + description: The authorization error messages. + example: + - Forbidden + - Failed permission authorization checks + items: + type: string + minItems: 1 + type: array + required: + - errors + type: object + SavedFilterApprovalConflictAttributes: + description: One or more feature flags that reference this saved filter require approval for the rule update. + properties: + approval_required_flags: + description: Feature flags preventing this update. + items: + $ref: "#/components/schemas/SavedFilterFlagReference" + type: array + message: + description: The reason the saved filter update was rejected. + example: One or more feature flags that reference this saved filter require approval for the rule update. + type: string + required: + - message + - approval_required_flags + type: object + SavedFilterApprovalConflictData: + description: One or more feature flags that reference this saved filter require approval for the rule update. + properties: + attributes: + $ref: "#/components/schemas/SavedFilterApprovalConflictAttributes" + id: + description: The ID of the saved filter. + example: 550e8400-e29b-41d4-a716-446655440090 + format: uuid + type: string + type: + $ref: "#/components/schemas/SavedFilterApprovalConflictType" + required: + - id + - type + - attributes + type: object + SavedFilterApprovalConflictResponse: + additionalProperties: false + description: One or more feature flags that reference this saved filter require approval for the rule update. + properties: + data: + $ref: "#/components/schemas/SavedFilterApprovalConflictData" + required: + - data + type: object + SavedFilterApprovalConflictType: + description: The resource type for this saved filter update error. + enum: + - update-approval-conflict + example: update-approval-conflict + type: string + x-enum-varnames: + - UPDATE_APPROVAL_CONFLICT SavedFilterAttributes: description: Saved filter details, including the full targeting rules and conditions. properties: @@ -108970,6 +109094,30 @@ components: - SEMVER_LTE - SEMVER_GT - SEMVER_GTE + SavedFilterConditionRequest: + description: An inline condition to write in a saved filter. Nested saved-filter references are not supported. + properties: + attribute: + description: The attribute evaluated by the condition. + example: user_id + minLength: 1 + type: string + operator: + $ref: "#/components/schemas/SavedFilterConditionOperator" + value: + description: Values used by the condition operator. Values must satisfy the selected operator and the organization targeting limits. + example: + - test-user-1 + - test-user-2 + items: + type: string + minItems: 1 + type: array + required: + - operator + - attribute + - value + type: object 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: @@ -109005,6 +109153,89 @@ components: type: string x-enum-varnames: - SAVED_FILTERS + SavedFilterFlagReference: + description: A feature flag that references the saved filter. + properties: + id: + description: The ID of the feature flag. + example: 550e8400-e29b-41d4-a716-446655440000 + format: uuid + type: string + name: + description: The name of the feature flag. + example: Early access + type: string + required: + - id + - name + type: object + SavedFilterJSONAPIErrorResponse: + additionalProperties: false + description: A saved filter error containing at least one JSON:API error object. + properties: + errors: + description: The error details. + example: + - detail: A saved filter with this name already exists. + status: "409" + title: Conflict + items: + $ref: "#/components/schemas/JSONAPIErrorItem" + minItems: 1 + type: array + required: + - errors + type: object + SavedFilterPermissionDeniedAttributes: + description: The caller lacks edit permission on one or more feature flags that reference this saved filter. + properties: + denied_flags: + description: Feature flags preventing this update. + items: + $ref: "#/components/schemas/SavedFilterFlagReference" + type: array + message: + description: The reason the saved filter update was rejected. + example: The caller lacks edit permission on one or more feature flags that reference this saved filter. + type: string + required: + - message + - denied_flags + type: object + SavedFilterPermissionDeniedData: + description: The caller lacks edit permission on one or more feature flags that reference this saved filter. + properties: + attributes: + $ref: "#/components/schemas/SavedFilterPermissionDeniedAttributes" + id: + description: The ID of the saved filter. + example: 550e8400-e29b-41d4-a716-446655440090 + format: uuid + type: string + type: + $ref: "#/components/schemas/SavedFilterPermissionDeniedType" + required: + - id + - type + - attributes + type: object + SavedFilterPermissionDeniedResponse: + additionalProperties: false + description: The caller lacks edit permission on one or more feature flags that reference this saved filter. + properties: + data: + $ref: "#/components/schemas/SavedFilterPermissionDeniedData" + required: + - data + type: object + SavedFilterPermissionDeniedType: + description: The resource type for this saved filter update error. + enum: + - update-grace-denied + example: update-grace-denied + type: string + x-enum-varnames: + - UPDATE_GRACE_DENIED SavedFilterResponse: description: Response containing a saved filter and its targeting rules. properties: @@ -109030,6 +109261,18 @@ components: - id - conditions type: object + SavedFilterTargetingRuleRequest: + description: A replacement saved filter targeting rule. + properties: + conditions: + description: Inline conditions combined with AND. Must contain at least one condition. + items: + $ref: "#/components/schemas/SavedFilterConditionRequest" + minItems: 1 + type: array + required: + - conditions + type: object ScaRequest: description: The top-level request object for submitting a Software Composition Analysis (SCA) scan result. properties: @@ -173172,6 +173415,128 @@ paths: operator: AND permissions: - feature_flag_config_read + patch: + description: |- + Partially updates a saved filter. Supports both `LIST` and `RULES` filters. + Supply at least one of `name`, `description`, or `targeting_rules`. Omitted or null fields + are preserved. Supplying `targeting_rules` replaces the entire collection and propagates + changes to every feature flag that references the saved filter. + Metadata-only updates do not require edit permission or approval on those feature flags. + Rule updates require edit permission on all consumer flags and are rejected when approval + is required, unless the caller has the `feature_flag_approvals_override` permission. + The optional `last_updated_at` field detects stale updates. It does not set the update time. + operationId: UpdateSavedFilterAttributes + 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 + requestBody: + content: + application/json: + examples: + default: + summary: Rename a saved filter while preserving its description and rules + value: + data: + attributes: + name: Early access users + type: saved-filters + replace_rules: + summary: Replace the complete rules collection + value: + data: + attributes: + targeting_rules: + - conditions: + - attribute: user_id + operator: ONE_OF + value: + - test-user-1 + - test-user-2 + type: saved-filters + schema: + $ref: "#/components/schemas/PatchSavedFilterRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + summary: A saved filter 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 + 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/PatchSavedFilterForbiddenResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "409": + content: + application/json: + schema: + $ref: "#/components/schemas/PatchSavedFilterConflictResponse" + description: Conflict + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - feature_flag_config_write + summary: Patch a saved filter + tags: + - Feature Flags + x-permission: + operator: AND + permissions: + - feature_flag_config_write /api/v2/feature-flags/{feature_flag_id}: get: description: |- diff --git a/examples/v2/feature-flags/UpdateSavedFilterAttributes.java b/examples/v2/feature-flags/UpdateSavedFilterAttributes.java new file mode 100644 index 00000000000..8a4ea5102d3 --- /dev/null +++ b/examples/v2/feature-flags/UpdateSavedFilterAttributes.java @@ -0,0 +1,41 @@ +// Patch 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.PatchSavedFilterAttributes; +import com.datadog.api.client.v2.model.PatchSavedFilterData; +import com.datadog.api.client.v2.model.PatchSavedFilterRequest; +import com.datadog.api.client.v2.model.SavedFilterDataType; +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); + + PatchSavedFilterRequest body = + new PatchSavedFilterRequest() + .data( + new PatchSavedFilterData() + .type(SavedFilterDataType.SAVED_FILTERS) + .attributes( + new PatchSavedFilterAttributes() + .name("patchSavedFilterTest-renamed-157e7ff3"))); + + try { + SavedFilterResponse result = + apiInstance.updateSavedFilterAttributes( + UUID.fromString("2cfc7949-7eb4-4d76-b1b8-d1aa9b565535"), body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FeatureFlagsApi#updateSavedFilterAttributes"); + 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/UpdateSavedFilterAttributes_1194333410.java b/examples/v2/feature-flags/UpdateSavedFilterAttributes_1194333410.java new file mode 100644 index 00000000000..144aa390bda --- /dev/null +++ b/examples/v2/feature-flags/UpdateSavedFilterAttributes_1194333410.java @@ -0,0 +1,57 @@ +// Patch a saved filter updates metadata and rules together + +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.PatchSavedFilterAttributes; +import com.datadog.api.client.v2.model.PatchSavedFilterData; +import com.datadog.api.client.v2.model.PatchSavedFilterRequest; +import com.datadog.api.client.v2.model.SavedFilterConditionOperator; +import com.datadog.api.client.v2.model.SavedFilterConditionRequest; +import com.datadog.api.client.v2.model.SavedFilterDataType; +import com.datadog.api.client.v2.model.SavedFilterResponse; +import com.datadog.api.client.v2.model.SavedFilterTargetingRuleRequest; +import java.util.Collections; +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); + + PatchSavedFilterRequest body = + new PatchSavedFilterRequest() + .data( + new PatchSavedFilterData() + .type(SavedFilterDataType.SAVED_FILTERS) + .attributes( + new PatchSavedFilterAttributes() + .name("patchSavedFilterTest-combined-157e7ff3") + .description("Combined synthetic test update.") + .targetingRules( + Collections.singletonList( + new SavedFilterTargetingRuleRequest() + .conditions( + Collections.singletonList( + new SavedFilterConditionRequest() + .operator(SavedFilterConditionOperator.ONE_OF) + .attribute("org_id") + .value( + Collections.singletonList( + "test-org-1")))))))); + + try { + SavedFilterResponse result = + apiInstance.updateSavedFilterAttributes( + UUID.fromString("2cfc7949-7eb4-4d76-b1b8-d1aa9b565535"), body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FeatureFlagsApi#updateSavedFilterAttributes"); + 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/UpdateSavedFilterAttributes_1937053112.java b/examples/v2/feature-flags/UpdateSavedFilterAttributes_1937053112.java new file mode 100644 index 00000000000..60d5e1242b4 --- /dev/null +++ b/examples/v2/feature-flags/UpdateSavedFilterAttributes_1937053112.java @@ -0,0 +1,55 @@ +// Patch a saved filter replaces rules and preserves metadata + +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.PatchSavedFilterAttributes; +import com.datadog.api.client.v2.model.PatchSavedFilterData; +import com.datadog.api.client.v2.model.PatchSavedFilterRequest; +import com.datadog.api.client.v2.model.SavedFilterConditionOperator; +import com.datadog.api.client.v2.model.SavedFilterConditionRequest; +import com.datadog.api.client.v2.model.SavedFilterDataType; +import com.datadog.api.client.v2.model.SavedFilterResponse; +import com.datadog.api.client.v2.model.SavedFilterTargetingRuleRequest; +import java.util.Collections; +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); + + PatchSavedFilterRequest body = + new PatchSavedFilterRequest() + .data( + new PatchSavedFilterData() + .type(SavedFilterDataType.SAVED_FILTERS) + .attributes( + new PatchSavedFilterAttributes() + .targetingRules( + Collections.singletonList( + new SavedFilterTargetingRuleRequest() + .conditions( + Collections.singletonList( + new SavedFilterConditionRequest() + .operator(SavedFilterConditionOperator.ONE_OF) + .attribute("email") + .value( + Collections.singletonList( + "test@example.com")))))))); + + try { + SavedFilterResponse result = + apiInstance.updateSavedFilterAttributes( + UUID.fromString("2cfc7949-7eb4-4d76-b1b8-d1aa9b565535"), body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FeatureFlagsApi#updateSavedFilterAttributes"); + 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/UpdateSavedFilterAttributes_2658080376.java b/examples/v2/feature-flags/UpdateSavedFilterAttributes_2658080376.java new file mode 100644 index 00000000000..84cb1a82f26 --- /dev/null +++ b/examples/v2/feature-flags/UpdateSavedFilterAttributes_2658080376.java @@ -0,0 +1,57 @@ +// Patch a saved filter accepts the current timestamp for rules + +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.PatchSavedFilterAttributes; +import com.datadog.api.client.v2.model.PatchSavedFilterData; +import com.datadog.api.client.v2.model.PatchSavedFilterRequest; +import com.datadog.api.client.v2.model.SavedFilterConditionOperator; +import com.datadog.api.client.v2.model.SavedFilterConditionRequest; +import com.datadog.api.client.v2.model.SavedFilterDataType; +import com.datadog.api.client.v2.model.SavedFilterResponse; +import com.datadog.api.client.v2.model.SavedFilterTargetingRuleRequest; +import java.time.OffsetDateTime; +import java.util.Collections; +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); + + PatchSavedFilterRequest body = + new PatchSavedFilterRequest() + .data( + new PatchSavedFilterData() + .attributes( + new PatchSavedFilterAttributes() + .lastUpdatedAt(OffsetDateTime.parse("2026-10-16T20:20:30Z")) + .targetingRules( + Collections.singletonList( + new SavedFilterTargetingRuleRequest() + .conditions( + Collections.singletonList( + new SavedFilterConditionRequest() + .attribute("user_id") + .operator(SavedFilterConditionOperator.ONE_OF) + .value( + Collections.singletonList( + "test-user-2"))))))) + .type(SavedFilterDataType.SAVED_FILTERS)); + + try { + SavedFilterResponse result = + apiInstance.updateSavedFilterAttributes( + UUID.fromString("a8c393b4-3a9c-48fd-aa48-402c97e8d9c9"), body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FeatureFlagsApi#updateSavedFilterAttributes"); + 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/UpdateSavedFilterAttributes_281483245.java b/examples/v2/feature-flags/UpdateSavedFilterAttributes_281483245.java new file mode 100644 index 00000000000..845c1686558 --- /dev/null +++ b/examples/v2/feature-flags/UpdateSavedFilterAttributes_281483245.java @@ -0,0 +1,41 @@ +// Patch a saved filter updates only the description of 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.PatchSavedFilterAttributes; +import com.datadog.api.client.v2.model.PatchSavedFilterData; +import com.datadog.api.client.v2.model.PatchSavedFilterRequest; +import com.datadog.api.client.v2.model.SavedFilterDataType; +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); + + PatchSavedFilterRequest body = + new PatchSavedFilterRequest() + .data( + new PatchSavedFilterData() + .type(SavedFilterDataType.SAVED_FILTERS) + .attributes( + new PatchSavedFilterAttributes() + .description("Updated synthetic test description."))); + + try { + SavedFilterResponse result = + apiInstance.updateSavedFilterAttributes( + UUID.fromString("d8e3a81b-1505-4600-99c6-c563d01d46b1"), body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FeatureFlagsApi#updateSavedFilterAttributes"); + 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/UpdateSavedFilterAttributes_3212710506.java b/examples/v2/feature-flags/UpdateSavedFilterAttributes_3212710506.java new file mode 100644 index 00000000000..d604e70a2a9 --- /dev/null +++ b/examples/v2/feature-flags/UpdateSavedFilterAttributes_3212710506.java @@ -0,0 +1,42 @@ +// Patch a saved filter preserves a null description + +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.PatchSavedFilterAttributes; +import com.datadog.api.client.v2.model.PatchSavedFilterData; +import com.datadog.api.client.v2.model.PatchSavedFilterRequest; +import com.datadog.api.client.v2.model.SavedFilterDataType; +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); + + PatchSavedFilterRequest body = + new PatchSavedFilterRequest() + .data( + new PatchSavedFilterData() + .type(SavedFilterDataType.SAVED_FILTERS) + .attributes( + new PatchSavedFilterAttributes() + .description(null) + .name("patchSavedFilterTest-null-157e7ff3"))); + + try { + SavedFilterResponse result = + apiInstance.updateSavedFilterAttributes( + UUID.fromString("2cfc7949-7eb4-4d76-b1b8-d1aa9b565535"), body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FeatureFlagsApi#updateSavedFilterAttributes"); + 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/UpdateSavedFilterAttributes_3817543566.java b/examples/v2/feature-flags/UpdateSavedFilterAttributes_3817543566.java new file mode 100644 index 00000000000..fb3387fc466 --- /dev/null +++ b/examples/v2/feature-flags/UpdateSavedFilterAttributes_3817543566.java @@ -0,0 +1,43 @@ +// Patch a saved filter accepts the current timestamp for metadata + +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.PatchSavedFilterAttributes; +import com.datadog.api.client.v2.model.PatchSavedFilterData; +import com.datadog.api.client.v2.model.PatchSavedFilterRequest; +import com.datadog.api.client.v2.model.SavedFilterDataType; +import com.datadog.api.client.v2.model.SavedFilterResponse; +import java.time.OffsetDateTime; +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); + + PatchSavedFilterRequest body = + new PatchSavedFilterRequest() + .data( + new PatchSavedFilterData() + .attributes( + new PatchSavedFilterAttributes() + .description("Metadata with current timestamp.") + .lastUpdatedAt(OffsetDateTime.parse("2026-10-16T20:20:29Z"))) + .type(SavedFilterDataType.SAVED_FILTERS)); + + try { + SavedFilterResponse result = + apiInstance.updateSavedFilterAttributes( + UUID.fromString("a8c393b4-3a9c-48fd-aa48-402c97e8d9c9"), body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FeatureFlagsApi#updateSavedFilterAttributes"); + 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/UpdateSavedFilterAttributes_4162852827.java b/examples/v2/feature-flags/UpdateSavedFilterAttributes_4162852827.java new file mode 100644 index 00000000000..a793c5a0cf6 --- /dev/null +++ b/examples/v2/feature-flags/UpdateSavedFilterAttributes_4162852827.java @@ -0,0 +1,39 @@ +// Patch a saved filter clears the description with an empty string + +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.PatchSavedFilterAttributes; +import com.datadog.api.client.v2.model.PatchSavedFilterData; +import com.datadog.api.client.v2.model.PatchSavedFilterRequest; +import com.datadog.api.client.v2.model.SavedFilterDataType; +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); + + PatchSavedFilterRequest body = + new PatchSavedFilterRequest() + .data( + new PatchSavedFilterData() + .type(SavedFilterDataType.SAVED_FILTERS) + .attributes(new PatchSavedFilterAttributes().description(""))); + + try { + SavedFilterResponse result = + apiInstance.updateSavedFilterAttributes( + UUID.fromString("2cfc7949-7eb4-4d76-b1b8-d1aa9b565535"), body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FeatureFlagsApi#updateSavedFilterAttributes"); + 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/UpdateSavedFilterAttributes_727520235.java b/examples/v2/feature-flags/UpdateSavedFilterAttributes_727520235.java new file mode 100644 index 00000000000..60acca1f648 --- /dev/null +++ b/examples/v2/feature-flags/UpdateSavedFilterAttributes_727520235.java @@ -0,0 +1,55 @@ +// Patch a saved filter replaces the rules of 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.PatchSavedFilterAttributes; +import com.datadog.api.client.v2.model.PatchSavedFilterData; +import com.datadog.api.client.v2.model.PatchSavedFilterRequest; +import com.datadog.api.client.v2.model.SavedFilterConditionOperator; +import com.datadog.api.client.v2.model.SavedFilterConditionRequest; +import com.datadog.api.client.v2.model.SavedFilterDataType; +import com.datadog.api.client.v2.model.SavedFilterResponse; +import com.datadog.api.client.v2.model.SavedFilterTargetingRuleRequest; +import java.util.Collections; +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); + + PatchSavedFilterRequest body = + new PatchSavedFilterRequest() + .data( + new PatchSavedFilterData() + .type(SavedFilterDataType.SAVED_FILTERS) + .attributes( + new PatchSavedFilterAttributes() + .targetingRules( + Collections.singletonList( + new SavedFilterTargetingRuleRequest() + .conditions( + Collections.singletonList( + new SavedFilterConditionRequest() + .operator(SavedFilterConditionOperator.ONE_OF) + .attribute("user_id") + .value( + Collections.singletonList( + "test-user-3")))))))); + + try { + SavedFilterResponse result = + apiInstance.updateSavedFilterAttributes( + UUID.fromString("d8e3a81b-1505-4600-99c6-c563d01d46b1"), body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FeatureFlagsApi#updateSavedFilterAttributes"); + 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 1a16d9cdd39..429e26ddc90 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.PatchSavedFilterRequest; import com.datadog.api.client.v2.model.SavedFilterResponse; import com.datadog.api.client.v2.model.UpdateEnvironmentRequest; import com.datadog.api.client.v2.model.UpdateFeatureFlagRequest; @@ -3923,6 +3924,182 @@ public ApiResponse updateFeatureFlagsEnvironmentWithHttpInf new GenericType() {}); } + /** + * Patch a saved filter. + * + *

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

See {@link #updateSavedFilterAttributesWithHttpInfoAsync}. + * + * @param savedFilterId The ID of the saved filter. (required) + * @param body (required) + * @return CompletableFuture<SavedFilterResponse> + */ + public CompletableFuture updateSavedFilterAttributesAsync( + UUID savedFilterId, PatchSavedFilterRequest body) { + return updateSavedFilterAttributesWithHttpInfoAsync(savedFilterId, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Partially updates a saved filter. Supports both LIST and RULES + * filters. Supply at least one of name, description, or + * targeting_rules. Omitted or null fields are preserved. Supplying targeting_rules + * replaces the entire collection and propagates changes to every feature flag that + * references the saved filter. Metadata-only updates do not require edit permission or approval + * on those feature flags. Rule updates require edit permission on all consumer flags and are + * rejected when approval is required, unless the caller has the + * feature_flag_approvals_override permission. The optional last_updated_at + * field detects stale updates. It does not set the update time. + * + * @param savedFilterId The ID of the saved filter. (required) + * @param body (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 -
409 Conflict -
429 Too many requests -
+ */ + public ApiResponse updateSavedFilterAttributesWithHttpInfo( + UUID savedFilterId, PatchSavedFilterRequest body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'savedFilterId' is set + if (savedFilterId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'savedFilterId' when calling" + + " updateSavedFilterAttributes"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling updateSavedFilterAttributes"); + } + // 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.updateSavedFilterAttributes", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Patch a saved filter. + * + *

See {@link #updateSavedFilterAttributesWithHttpInfo}. + * + * @param savedFilterId The ID of the saved filter. (required) + * @param body (required) + * @return CompletableFuture<ApiResponse<SavedFilterResponse>> + */ + public CompletableFuture> + updateSavedFilterAttributesWithHttpInfoAsync( + UUID savedFilterId, PatchSavedFilterRequest body) { + Object localVarPostBody = body; + + // 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" + + " updateSavedFilterAttributes")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'body' when calling updateSavedFilterAttributes")); + 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.updateSavedFilterAttributes", + 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( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + /** * Update a variant. * diff --git a/src/main/java/com/datadog/api/client/v2/model/PatchSavedFilterAttributes.java b/src/main/java/com/datadog/api/client/v2/model/PatchSavedFilterAttributes.java new file mode 100644 index 00000000000..6e84f370643 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/PatchSavedFilterAttributes.java @@ -0,0 +1,290 @@ +/* + * 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.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; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * Fields to update. At least one of name, description, or + * targeting_rules must have a non-null value. Omitted or null fields are preserved. The + * creation type cannot be changed. + */ +@JsonPropertyOrder({ + PatchSavedFilterAttributes.JSON_PROPERTY_DESCRIPTION, + PatchSavedFilterAttributes.JSON_PROPERTY_LAST_UPDATED_AT, + PatchSavedFilterAttributes.JSON_PROPERTY_NAME, + PatchSavedFilterAttributes.JSON_PROPERTY_TARGETING_RULES +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class PatchSavedFilterAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private JsonNullable description = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_LAST_UPDATED_AT = "last_updated_at"; + private JsonNullable lastUpdatedAt = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_NAME = "name"; + private JsonNullable name = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_TARGETING_RULES = "targeting_rules"; + private JsonNullable> targetingRules = + JsonNullable.>undefined(); + + public PatchSavedFilterAttributes description(String description) { + this.description = JsonNullable.of(description); + return this; + } + + /** + * The new description. Send an empty string to clear the description. If omitted or null, the + * existing description is preserved. + * + * @return description + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getDescription() { + return description.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getDescription_JsonNullable() { + return description; + } + + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + public void setDescription_JsonNullable(JsonNullable description) { + this.description = description; + } + + public void setDescription(String description) { + this.description = JsonNullable.of(description); + } + + public PatchSavedFilterAttributes lastUpdatedAt(OffsetDateTime lastUpdatedAt) { + this.lastUpdatedAt = JsonNullable.of(lastUpdatedAt); + return this; + } + + /** + * The updated_at value returned by a previous read, as an RFC 3339 timestamp. If it + * differs from the stored update time, truncated to seconds, the request returns a 409 response. + * For metadata-only updates, this check does not prevent all concurrent writes. This field alone + * does not constitute an update. + * + * @return lastUpdatedAt + */ + @jakarta.annotation.Nullable + @JsonIgnore + public OffsetDateTime getLastUpdatedAt() { + return lastUpdatedAt.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_LAST_UPDATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getLastUpdatedAt_JsonNullable() { + return lastUpdatedAt; + } + + @JsonProperty(JSON_PROPERTY_LAST_UPDATED_AT) + public void setLastUpdatedAt_JsonNullable(JsonNullable lastUpdatedAt) { + this.lastUpdatedAt = lastUpdatedAt; + } + + public void setLastUpdatedAt(OffsetDateTime lastUpdatedAt) { + this.lastUpdatedAt = JsonNullable.of(lastUpdatedAt); + } + + public PatchSavedFilterAttributes name(String name) { + this.name = JsonNullable.of(name); + return this; + } + + /** + * The new name of the saved filter. Must not be empty. + * + * @return name + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getName() { + return name.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getName_JsonNullable() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + public void setName_JsonNullable(JsonNullable name) { + this.name = name; + } + + public void setName(String name) { + this.name = JsonNullable.of(name); + } + + public PatchSavedFilterAttributes targetingRules( + List targetingRules) { + this.targetingRules = JsonNullable.>of(targetingRules); + return this; + } + + public PatchSavedFilterAttributes addTargetingRulesItem( + SavedFilterTargetingRuleRequest targetingRulesItem) { + if (this.targetingRules == null || !this.targetingRules.isPresent()) { + this.targetingRules = + JsonNullable.>of(new ArrayList<>()); + } + try { + this.targetingRules.get().add(targetingRulesItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + } + + /** + * The complete replacement targeting rules, combined with OR. Conditions within each rule are + * combined with AND. Replaces all existing rules. Values are not appended. Must contain at least + * one rule. Saved filters cannot reference other saved filters. + * + * @return targetingRules + */ + @jakarta.annotation.Nullable + @JsonIgnore + public List getTargetingRules() { + return targetingRules.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_TARGETING_RULES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable> getTargetingRules_JsonNullable() { + return targetingRules; + } + + @JsonProperty(JSON_PROPERTY_TARGETING_RULES) + public void setTargetingRules_JsonNullable( + JsonNullable> targetingRules) { + this.targetingRules = targetingRules; + } + + public void setTargetingRules(List targetingRules) { + this.targetingRules = JsonNullable.>of(targetingRules); + } + + /** + * 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 PatchSavedFilterAttributes + */ + @JsonAnySetter + public PatchSavedFilterAttributes 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 PatchSavedFilterAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PatchSavedFilterAttributes patchSavedFilterAttributes = (PatchSavedFilterAttributes) o; + return Objects.equals(this.description, patchSavedFilterAttributes.description) + && Objects.equals(this.lastUpdatedAt, patchSavedFilterAttributes.lastUpdatedAt) + && Objects.equals(this.name, patchSavedFilterAttributes.name) + && Objects.equals(this.targetingRules, patchSavedFilterAttributes.targetingRules) + && Objects.equals( + this.additionalProperties, patchSavedFilterAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(description, lastUpdatedAt, name, targetingRules, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PatchSavedFilterAttributes {\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" lastUpdatedAt: ").append(toIndentedString(lastUpdatedAt)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" targetingRules: ").append(toIndentedString(targetingRules)).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/PatchSavedFilterConflictResponse.java b/src/main/java/com/datadog/api/client/v2/model/PatchSavedFilterConflictResponse.java new file mode 100644 index 00000000000..a34728a9985 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/PatchSavedFilterConflictResponse.java @@ -0,0 +1,300 @@ +/* + * 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.AbstractOpenApiSchema; +import com.datadog.api.client.JSON; +import com.datadog.api.client.UnparsedObject; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.JsonToken; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.MapperFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import jakarta.ws.rs.core.GenericType; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; + +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +@JsonDeserialize( + using = PatchSavedFilterConflictResponse.PatchSavedFilterConflictResponseDeserializer.class) +@JsonSerialize( + using = PatchSavedFilterConflictResponse.PatchSavedFilterConflictResponseSerializer.class) +public class PatchSavedFilterConflictResponse extends AbstractOpenApiSchema { + private static final Logger log = + Logger.getLogger(PatchSavedFilterConflictResponse.class.getName()); + + @JsonIgnore public boolean unparsed = false; + + public static class PatchSavedFilterConflictResponseSerializer + extends StdSerializer { + public PatchSavedFilterConflictResponseSerializer(Class t) { + super(t); + } + + public PatchSavedFilterConflictResponseSerializer() { + this(null); + } + + @Override + public void serialize( + PatchSavedFilterConflictResponse value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class PatchSavedFilterConflictResponseDeserializer + extends StdDeserializer { + public PatchSavedFilterConflictResponseDeserializer() { + this(PatchSavedFilterConflictResponse.class); + } + + public PatchSavedFilterConflictResponseDeserializer(Class vc) { + super(vc); + } + + @Override + public PatchSavedFilterConflictResponse deserialize(JsonParser jp, DeserializationContext ctxt) + throws IOException, JsonProcessingException { + JsonNode tree = jp.readValueAsTree(); + Object deserialized = null; + Object tmp = null; + boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); + int match = 0; + JsonToken token = tree.traverse(jp.getCodec()).nextToken(); + // deserialize SavedFilterJSONAPIErrorResponse + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (SavedFilterJSONAPIErrorResponse.class.equals(Integer.class) + || SavedFilterJSONAPIErrorResponse.class.equals(Long.class) + || SavedFilterJSONAPIErrorResponse.class.equals(Float.class) + || SavedFilterJSONAPIErrorResponse.class.equals(Double.class) + || SavedFilterJSONAPIErrorResponse.class.equals(Boolean.class) + || SavedFilterJSONAPIErrorResponse.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((SavedFilterJSONAPIErrorResponse.class.equals(Integer.class) + || SavedFilterJSONAPIErrorResponse.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((SavedFilterJSONAPIErrorResponse.class.equals(Float.class) + || SavedFilterJSONAPIErrorResponse.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (SavedFilterJSONAPIErrorResponse.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (SavedFilterJSONAPIErrorResponse.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(SavedFilterJSONAPIErrorResponse.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((SavedFilterJSONAPIErrorResponse) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'SavedFilterJSONAPIErrorResponse'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log( + Level.FINER, "Input data does not match schema 'SavedFilterJSONAPIErrorResponse'", e); + } + + // deserialize SavedFilterApprovalConflictResponse + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (SavedFilterApprovalConflictResponse.class.equals(Integer.class) + || SavedFilterApprovalConflictResponse.class.equals(Long.class) + || SavedFilterApprovalConflictResponse.class.equals(Float.class) + || SavedFilterApprovalConflictResponse.class.equals(Double.class) + || SavedFilterApprovalConflictResponse.class.equals(Boolean.class) + || SavedFilterApprovalConflictResponse.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((SavedFilterApprovalConflictResponse.class.equals(Integer.class) + || SavedFilterApprovalConflictResponse.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((SavedFilterApprovalConflictResponse.class.equals(Float.class) + || SavedFilterApprovalConflictResponse.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (SavedFilterApprovalConflictResponse.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (SavedFilterApprovalConflictResponse.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(SavedFilterApprovalConflictResponse.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((SavedFilterApprovalConflictResponse) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'SavedFilterApprovalConflictResponse'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log( + Level.FINER, + "Input data does not match schema 'SavedFilterApprovalConflictResponse'", + e); + } + + PatchSavedFilterConflictResponse ret = new PatchSavedFilterConflictResponse(); + if (match == 1) { + ret.setActualInstance(deserialized); + } else { + Map res = + new ObjectMapper() + .readValue( + tree.traverse(jp.getCodec()).readValueAsTree().toString(), + new TypeReference>() {}); + ret.setActualInstance(new UnparsedObject(res)); + } + return ret; + } + + /** Handle deserialization of the 'null' value. */ + @Override + public PatchSavedFilterConflictResponse getNullValue(DeserializationContext ctxt) + throws JsonMappingException { + throw new JsonMappingException( + ctxt.getParser(), "PatchSavedFilterConflictResponse cannot be null"); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public PatchSavedFilterConflictResponse() { + super("oneOf", Boolean.FALSE); + } + + public PatchSavedFilterConflictResponse(SavedFilterJSONAPIErrorResponse o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public PatchSavedFilterConflictResponse(SavedFilterApprovalConflictResponse o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put( + "SavedFilterJSONAPIErrorResponse", new GenericType() {}); + schemas.put( + "SavedFilterApprovalConflictResponse", + new GenericType() {}); + JSON.registerDescendants( + PatchSavedFilterConflictResponse.class, Collections.unmodifiableMap(schemas)); + } + + @Override + public Map getSchemas() { + return PatchSavedFilterConflictResponse.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: SavedFilterJSONAPIErrorResponse, + * SavedFilterApprovalConflictResponse + * + *

It could be an instance of the 'oneOf' schemas. The oneOf child schemas may themselves be a + * composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (JSON.isInstanceOf( + SavedFilterJSONAPIErrorResponse.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf( + SavedFilterApprovalConflictResponse.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(UnparsedObject.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + throw new RuntimeException( + "Invalid instance type. Must be SavedFilterJSONAPIErrorResponse," + + " SavedFilterApprovalConflictResponse"); + } + + /** + * Get the actual instance, which can be the following: SavedFilterJSONAPIErrorResponse, + * SavedFilterApprovalConflictResponse + * + * @return The actual instance (SavedFilterJSONAPIErrorResponse, + * SavedFilterApprovalConflictResponse) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `SavedFilterJSONAPIErrorResponse`. If the actual instance is not + * `SavedFilterJSONAPIErrorResponse`, the ClassCastException will be thrown. + * + * @return The actual instance of `SavedFilterJSONAPIErrorResponse` + * @throws ClassCastException if the instance is not `SavedFilterJSONAPIErrorResponse` + */ + public SavedFilterJSONAPIErrorResponse getSavedFilterJSONAPIErrorResponse() + throws ClassCastException { + return (SavedFilterJSONAPIErrorResponse) super.getActualInstance(); + } + + /** + * Get the actual instance of `SavedFilterApprovalConflictResponse`. If the actual instance is not + * `SavedFilterApprovalConflictResponse`, the ClassCastException will be thrown. + * + * @return The actual instance of `SavedFilterApprovalConflictResponse` + * @throws ClassCastException if the instance is not `SavedFilterApprovalConflictResponse` + */ + public SavedFilterApprovalConflictResponse getSavedFilterApprovalConflictResponse() + throws ClassCastException { + return (SavedFilterApprovalConflictResponse) super.getActualInstance(); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/PatchSavedFilterData.java b/src/main/java/com/datadog/api/client/v2/model/PatchSavedFilterData.java new file mode 100644 index 00000000000..23032145162 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/PatchSavedFilterData.java @@ -0,0 +1,186 @@ +/* + * 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; + +/** The saved filter fields to update. */ +@JsonPropertyOrder({ + PatchSavedFilterData.JSON_PROPERTY_ATTRIBUTES, + PatchSavedFilterData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class PatchSavedFilterData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private PatchSavedFilterAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private SavedFilterDataType type; + + public PatchSavedFilterData() {} + + @JsonCreator + public PatchSavedFilterData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + PatchSavedFilterAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) SavedFilterDataType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public PatchSavedFilterData attributes(PatchSavedFilterAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Fields to update. At least one of name, description, or + * targeting_rules must have a non-null value. Omitted or null fields are preserved. The + * creation type cannot be changed. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public PatchSavedFilterAttributes getAttributes() { + return attributes; + } + + public void setAttributes(PatchSavedFilterAttributes attributes) { + this.attributes = attributes; + if (attributes != null) { + this.unparsed |= attributes.unparsed; + } + } + + public PatchSavedFilterData 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 PatchSavedFilterData + */ + @JsonAnySetter + public PatchSavedFilterData 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 PatchSavedFilterData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PatchSavedFilterData patchSavedFilterData = (PatchSavedFilterData) o; + return Objects.equals(this.attributes, patchSavedFilterData.attributes) + && Objects.equals(this.type, patchSavedFilterData.type) + && Objects.equals(this.additionalProperties, patchSavedFilterData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PatchSavedFilterData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).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/PatchSavedFilterForbiddenResponse.java b/src/main/java/com/datadog/api/client/v2/model/PatchSavedFilterForbiddenResponse.java new file mode 100644 index 00000000000..9bf65a36200 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/PatchSavedFilterForbiddenResponse.java @@ -0,0 +1,366 @@ +/* + * 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.AbstractOpenApiSchema; +import com.datadog.api.client.JSON; +import com.datadog.api.client.UnparsedObject; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.JsonToken; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.MapperFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import jakarta.ws.rs.core.GenericType; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; + +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +@JsonDeserialize( + using = PatchSavedFilterForbiddenResponse.PatchSavedFilterForbiddenResponseDeserializer.class) +@JsonSerialize( + using = PatchSavedFilterForbiddenResponse.PatchSavedFilterForbiddenResponseSerializer.class) +public class PatchSavedFilterForbiddenResponse extends AbstractOpenApiSchema { + private static final Logger log = + Logger.getLogger(PatchSavedFilterForbiddenResponse.class.getName()); + + @JsonIgnore public boolean unparsed = false; + + public static class PatchSavedFilterForbiddenResponseSerializer + extends StdSerializer { + public PatchSavedFilterForbiddenResponseSerializer(Class t) { + super(t); + } + + public PatchSavedFilterForbiddenResponseSerializer() { + this(null); + } + + @Override + public void serialize( + PatchSavedFilterForbiddenResponse value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class PatchSavedFilterForbiddenResponseDeserializer + extends StdDeserializer { + public PatchSavedFilterForbiddenResponseDeserializer() { + this(PatchSavedFilterForbiddenResponse.class); + } + + public PatchSavedFilterForbiddenResponseDeserializer(Class vc) { + super(vc); + } + + @Override + public PatchSavedFilterForbiddenResponse deserialize(JsonParser jp, DeserializationContext ctxt) + throws IOException, JsonProcessingException { + JsonNode tree = jp.readValueAsTree(); + Object deserialized = null; + Object tmp = null; + boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); + int match = 0; + JsonToken token = tree.traverse(jp.getCodec()).nextToken(); + // deserialize SavedFilterAPIErrorResponse + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (SavedFilterAPIErrorResponse.class.equals(Integer.class) + || SavedFilterAPIErrorResponse.class.equals(Long.class) + || SavedFilterAPIErrorResponse.class.equals(Float.class) + || SavedFilterAPIErrorResponse.class.equals(Double.class) + || SavedFilterAPIErrorResponse.class.equals(Boolean.class) + || SavedFilterAPIErrorResponse.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((SavedFilterAPIErrorResponse.class.equals(Integer.class) + || SavedFilterAPIErrorResponse.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((SavedFilterAPIErrorResponse.class.equals(Float.class) + || SavedFilterAPIErrorResponse.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (SavedFilterAPIErrorResponse.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (SavedFilterAPIErrorResponse.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(SavedFilterAPIErrorResponse.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((SavedFilterAPIErrorResponse) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'SavedFilterAPIErrorResponse'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'SavedFilterAPIErrorResponse'", e); + } + + // deserialize SavedFilterJSONAPIErrorResponse + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (SavedFilterJSONAPIErrorResponse.class.equals(Integer.class) + || SavedFilterJSONAPIErrorResponse.class.equals(Long.class) + || SavedFilterJSONAPIErrorResponse.class.equals(Float.class) + || SavedFilterJSONAPIErrorResponse.class.equals(Double.class) + || SavedFilterJSONAPIErrorResponse.class.equals(Boolean.class) + || SavedFilterJSONAPIErrorResponse.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((SavedFilterJSONAPIErrorResponse.class.equals(Integer.class) + || SavedFilterJSONAPIErrorResponse.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((SavedFilterJSONAPIErrorResponse.class.equals(Float.class) + || SavedFilterJSONAPIErrorResponse.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (SavedFilterJSONAPIErrorResponse.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (SavedFilterJSONAPIErrorResponse.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(SavedFilterJSONAPIErrorResponse.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((SavedFilterJSONAPIErrorResponse) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'SavedFilterJSONAPIErrorResponse'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log( + Level.FINER, "Input data does not match schema 'SavedFilterJSONAPIErrorResponse'", e); + } + + // deserialize SavedFilterPermissionDeniedResponse + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (SavedFilterPermissionDeniedResponse.class.equals(Integer.class) + || SavedFilterPermissionDeniedResponse.class.equals(Long.class) + || SavedFilterPermissionDeniedResponse.class.equals(Float.class) + || SavedFilterPermissionDeniedResponse.class.equals(Double.class) + || SavedFilterPermissionDeniedResponse.class.equals(Boolean.class) + || SavedFilterPermissionDeniedResponse.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((SavedFilterPermissionDeniedResponse.class.equals(Integer.class) + || SavedFilterPermissionDeniedResponse.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((SavedFilterPermissionDeniedResponse.class.equals(Float.class) + || SavedFilterPermissionDeniedResponse.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (SavedFilterPermissionDeniedResponse.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (SavedFilterPermissionDeniedResponse.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(SavedFilterPermissionDeniedResponse.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((SavedFilterPermissionDeniedResponse) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'SavedFilterPermissionDeniedResponse'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log( + Level.FINER, + "Input data does not match schema 'SavedFilterPermissionDeniedResponse'", + e); + } + + PatchSavedFilterForbiddenResponse ret = new PatchSavedFilterForbiddenResponse(); + if (match == 1) { + ret.setActualInstance(deserialized); + } else { + Map res = + new ObjectMapper() + .readValue( + tree.traverse(jp.getCodec()).readValueAsTree().toString(), + new TypeReference>() {}); + ret.setActualInstance(new UnparsedObject(res)); + } + return ret; + } + + /** Handle deserialization of the 'null' value. */ + @Override + public PatchSavedFilterForbiddenResponse getNullValue(DeserializationContext ctxt) + throws JsonMappingException { + throw new JsonMappingException( + ctxt.getParser(), "PatchSavedFilterForbiddenResponse cannot be null"); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public PatchSavedFilterForbiddenResponse() { + super("oneOf", Boolean.FALSE); + } + + public PatchSavedFilterForbiddenResponse(SavedFilterAPIErrorResponse o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public PatchSavedFilterForbiddenResponse(SavedFilterJSONAPIErrorResponse o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public PatchSavedFilterForbiddenResponse(SavedFilterPermissionDeniedResponse o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("SavedFilterAPIErrorResponse", new GenericType() {}); + schemas.put( + "SavedFilterJSONAPIErrorResponse", new GenericType() {}); + schemas.put( + "SavedFilterPermissionDeniedResponse", + new GenericType() {}); + JSON.registerDescendants( + PatchSavedFilterForbiddenResponse.class, Collections.unmodifiableMap(schemas)); + } + + @Override + public Map getSchemas() { + return PatchSavedFilterForbiddenResponse.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: SavedFilterAPIErrorResponse, SavedFilterJSONAPIErrorResponse, + * SavedFilterPermissionDeniedResponse + * + *

It could be an instance of the 'oneOf' schemas. The oneOf child schemas may themselves be a + * composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (JSON.isInstanceOf(SavedFilterAPIErrorResponse.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf( + SavedFilterJSONAPIErrorResponse.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf( + SavedFilterPermissionDeniedResponse.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(UnparsedObject.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + throw new RuntimeException( + "Invalid instance type. Must be SavedFilterAPIErrorResponse," + + " SavedFilterJSONAPIErrorResponse, SavedFilterPermissionDeniedResponse"); + } + + /** + * Get the actual instance, which can be the following: SavedFilterAPIErrorResponse, + * SavedFilterJSONAPIErrorResponse, SavedFilterPermissionDeniedResponse + * + * @return The actual instance (SavedFilterAPIErrorResponse, SavedFilterJSONAPIErrorResponse, + * SavedFilterPermissionDeniedResponse) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `SavedFilterAPIErrorResponse`. If the actual instance is not + * `SavedFilterAPIErrorResponse`, the ClassCastException will be thrown. + * + * @return The actual instance of `SavedFilterAPIErrorResponse` + * @throws ClassCastException if the instance is not `SavedFilterAPIErrorResponse` + */ + public SavedFilterAPIErrorResponse getSavedFilterAPIErrorResponse() throws ClassCastException { + return (SavedFilterAPIErrorResponse) super.getActualInstance(); + } + + /** + * Get the actual instance of `SavedFilterJSONAPIErrorResponse`. If the actual instance is not + * `SavedFilterJSONAPIErrorResponse`, the ClassCastException will be thrown. + * + * @return The actual instance of `SavedFilterJSONAPIErrorResponse` + * @throws ClassCastException if the instance is not `SavedFilterJSONAPIErrorResponse` + */ + public SavedFilterJSONAPIErrorResponse getSavedFilterJSONAPIErrorResponse() + throws ClassCastException { + return (SavedFilterJSONAPIErrorResponse) super.getActualInstance(); + } + + /** + * Get the actual instance of `SavedFilterPermissionDeniedResponse`. If the actual instance is not + * `SavedFilterPermissionDeniedResponse`, the ClassCastException will be thrown. + * + * @return The actual instance of `SavedFilterPermissionDeniedResponse` + * @throws ClassCastException if the instance is not `SavedFilterPermissionDeniedResponse` + */ + public SavedFilterPermissionDeniedResponse getSavedFilterPermissionDeniedResponse() + throws ClassCastException { + return (SavedFilterPermissionDeniedResponse) super.getActualInstance(); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/PatchSavedFilterRequest.java b/src/main/java/com/datadog/api/client/v2/model/PatchSavedFilterRequest.java new file mode 100644 index 00000000000..9153416236d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/PatchSavedFilterRequest.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; + +/** Request to partially update a saved filter. */ +@JsonPropertyOrder({PatchSavedFilterRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class PatchSavedFilterRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private PatchSavedFilterData data; + + public PatchSavedFilterRequest() {} + + @JsonCreator + public PatchSavedFilterRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) PatchSavedFilterData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public PatchSavedFilterRequest data(PatchSavedFilterData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * The saved filter fields to update. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public PatchSavedFilterData getData() { + return data; + } + + public void setData(PatchSavedFilterData 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 PatchSavedFilterRequest + */ + @JsonAnySetter + public PatchSavedFilterRequest 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 PatchSavedFilterRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PatchSavedFilterRequest patchSavedFilterRequest = (PatchSavedFilterRequest) o; + return Objects.equals(this.data, patchSavedFilterRequest.data) + && Objects.equals(this.additionalProperties, patchSavedFilterRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PatchSavedFilterRequest {\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/SavedFilterAPIErrorResponse.java b/src/main/java/com/datadog/api/client/v2/model/SavedFilterAPIErrorResponse.java new file mode 100644 index 00000000000..2becea7d266 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SavedFilterAPIErrorResponse.java @@ -0,0 +1,96 @@ +/* + * 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.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.List; +import java.util.Objects; + +/** A saved filter authorization error containing at least one error message. */ +@JsonPropertyOrder({SavedFilterAPIErrorResponse.JSON_PROPERTY_ERRORS}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SavedFilterAPIErrorResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ERRORS = "errors"; + private List errors = new ArrayList<>(); + + public SavedFilterAPIErrorResponse() {} + + @JsonCreator + public SavedFilterAPIErrorResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_ERRORS) List errors) { + this.errors = errors; + } + + public SavedFilterAPIErrorResponse errors(List errors) { + this.errors = errors; + return this; + } + + public SavedFilterAPIErrorResponse addErrorsItem(String errorsItem) { + this.errors.add(errorsItem); + return this; + } + + /** + * The authorization error messages. + * + * @return errors + */ + @JsonProperty(JSON_PROPERTY_ERRORS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getErrors() { + return errors; + } + + public void setErrors(List errors) { + this.errors = errors; + } + + /** Return true if this SavedFilterAPIErrorResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SavedFilterAPIErrorResponse savedFilterApiErrorResponse = (SavedFilterAPIErrorResponse) o; + return Objects.equals(this.errors, savedFilterApiErrorResponse.errors); + } + + @Override + public int hashCode() { + return Objects.hash(errors); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SavedFilterAPIErrorResponse {\n"); + sb.append(" errors: ").append(toIndentedString(errors)).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/SavedFilterApprovalConflictAttributes.java b/src/main/java/com/datadog/api/client/v2/model/SavedFilterApprovalConflictAttributes.java new file mode 100644 index 00000000000..d1e7761af6c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SavedFilterApprovalConflictAttributes.java @@ -0,0 +1,202 @@ +/* + * 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; + +/** + * One or more feature flags that reference this saved filter require approval for the rule update. + */ +@JsonPropertyOrder({ + SavedFilterApprovalConflictAttributes.JSON_PROPERTY_APPROVAL_REQUIRED_FLAGS, + SavedFilterApprovalConflictAttributes.JSON_PROPERTY_MESSAGE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SavedFilterApprovalConflictAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_APPROVAL_REQUIRED_FLAGS = "approval_required_flags"; + private List approvalRequiredFlags = new ArrayList<>(); + + public static final String JSON_PROPERTY_MESSAGE = "message"; + private String message; + + public SavedFilterApprovalConflictAttributes() {} + + @JsonCreator + public SavedFilterApprovalConflictAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_APPROVAL_REQUIRED_FLAGS) + List approvalRequiredFlags, + @JsonProperty(required = true, value = JSON_PROPERTY_MESSAGE) String message) { + this.approvalRequiredFlags = approvalRequiredFlags; + for (SavedFilterFlagReference item : approvalRequiredFlags) { + this.unparsed |= item.unparsed; + } + this.message = message; + } + + public SavedFilterApprovalConflictAttributes approvalRequiredFlags( + List approvalRequiredFlags) { + this.approvalRequiredFlags = approvalRequiredFlags; + for (SavedFilterFlagReference item : approvalRequiredFlags) { + this.unparsed |= item.unparsed; + } + return this; + } + + public SavedFilterApprovalConflictAttributes addApprovalRequiredFlagsItem( + SavedFilterFlagReference approvalRequiredFlagsItem) { + this.approvalRequiredFlags.add(approvalRequiredFlagsItem); + this.unparsed |= approvalRequiredFlagsItem.unparsed; + return this; + } + + /** + * Feature flags preventing this update. + * + * @return approvalRequiredFlags + */ + @JsonProperty(JSON_PROPERTY_APPROVAL_REQUIRED_FLAGS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getApprovalRequiredFlags() { + return approvalRequiredFlags; + } + + public void setApprovalRequiredFlags(List approvalRequiredFlags) { + this.approvalRequiredFlags = approvalRequiredFlags; + if (approvalRequiredFlags != null) { + for (SavedFilterFlagReference item : approvalRequiredFlags) { + this.unparsed |= item.unparsed; + } + } + } + + public SavedFilterApprovalConflictAttributes message(String message) { + this.message = message; + return this; + } + + /** + * The reason the saved filter update was rejected. + * + * @return message + */ + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + /** + * 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 SavedFilterApprovalConflictAttributes + */ + @JsonAnySetter + public SavedFilterApprovalConflictAttributes 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 SavedFilterApprovalConflictAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SavedFilterApprovalConflictAttributes savedFilterApprovalConflictAttributes = + (SavedFilterApprovalConflictAttributes) o; + return Objects.equals( + this.approvalRequiredFlags, savedFilterApprovalConflictAttributes.approvalRequiredFlags) + && Objects.equals(this.message, savedFilterApprovalConflictAttributes.message) + && Objects.equals( + this.additionalProperties, savedFilterApprovalConflictAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(approvalRequiredFlags, message, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SavedFilterApprovalConflictAttributes {\n"); + sb.append(" approvalRequiredFlags: ") + .append(toIndentedString(approvalRequiredFlags)) + .append("\n"); + sb.append(" message: ").append(toIndentedString(message)).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/SavedFilterApprovalConflictData.java b/src/main/java/com/datadog/api/client/v2/model/SavedFilterApprovalConflictData.java new file mode 100644 index 00000000000..ea1ab630efc --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SavedFilterApprovalConflictData.java @@ -0,0 +1,220 @@ +/* + * 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; + +/** + * One or more feature flags that reference this saved filter require approval for the rule update. + */ +@JsonPropertyOrder({ + SavedFilterApprovalConflictData.JSON_PROPERTY_ATTRIBUTES, + SavedFilterApprovalConflictData.JSON_PROPERTY_ID, + SavedFilterApprovalConflictData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SavedFilterApprovalConflictData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private SavedFilterApprovalConflictAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private UUID id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private SavedFilterApprovalConflictType type; + + public SavedFilterApprovalConflictData() {} + + @JsonCreator + public SavedFilterApprovalConflictData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + SavedFilterApprovalConflictAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) UUID id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + SavedFilterApprovalConflictType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public SavedFilterApprovalConflictData attributes( + SavedFilterApprovalConflictAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * One or more feature flags that reference this saved filter require approval for the rule + * update. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SavedFilterApprovalConflictAttributes getAttributes() { + return attributes; + } + + public void setAttributes(SavedFilterApprovalConflictAttributes attributes) { + this.attributes = attributes; + if (attributes != null) { + this.unparsed |= attributes.unparsed; + } + } + + public SavedFilterApprovalConflictData 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 SavedFilterApprovalConflictData type(SavedFilterApprovalConflictType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The resource type for this saved filter update error. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SavedFilterApprovalConflictType getType() { + return type; + } + + public void setType(SavedFilterApprovalConflictType 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 SavedFilterApprovalConflictData + */ + @JsonAnySetter + public SavedFilterApprovalConflictData 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 SavedFilterApprovalConflictData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SavedFilterApprovalConflictData savedFilterApprovalConflictData = + (SavedFilterApprovalConflictData) o; + return Objects.equals(this.attributes, savedFilterApprovalConflictData.attributes) + && Objects.equals(this.id, savedFilterApprovalConflictData.id) + && Objects.equals(this.type, savedFilterApprovalConflictData.type) + && Objects.equals( + this.additionalProperties, savedFilterApprovalConflictData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SavedFilterApprovalConflictData {\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/SavedFilterApprovalConflictResponse.java b/src/main/java/com/datadog/api/client/v2/model/SavedFilterApprovalConflictResponse.java new file mode 100644 index 00000000000..b796882ae71 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SavedFilterApprovalConflictResponse.java @@ -0,0 +1,99 @@ +/* + * 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.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.Objects; + +/** + * One or more feature flags that reference this saved filter require approval for the rule update. + */ +@JsonPropertyOrder({SavedFilterApprovalConflictResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SavedFilterApprovalConflictResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private SavedFilterApprovalConflictData data; + + public SavedFilterApprovalConflictResponse() {} + + @JsonCreator + public SavedFilterApprovalConflictResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + SavedFilterApprovalConflictData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public SavedFilterApprovalConflictResponse data(SavedFilterApprovalConflictData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * One or more feature flags that reference this saved filter require approval for the rule + * update. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SavedFilterApprovalConflictData getData() { + return data; + } + + public void setData(SavedFilterApprovalConflictData data) { + this.data = data; + if (data != null) { + this.unparsed |= data.unparsed; + } + } + + /** Return true if this SavedFilterApprovalConflictResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SavedFilterApprovalConflictResponse savedFilterApprovalConflictResponse = + (SavedFilterApprovalConflictResponse) o; + return Objects.equals(this.data, savedFilterApprovalConflictResponse.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SavedFilterApprovalConflictResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).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/SavedFilterApprovalConflictType.java b/src/main/java/com/datadog/api/client/v2/model/SavedFilterApprovalConflictType.java new file mode 100644 index 00000000000..b5b114541a4 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SavedFilterApprovalConflictType.java @@ -0,0 +1,58 @@ +/* + * 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 resource type for this saved filter update error. */ +@JsonSerialize( + using = SavedFilterApprovalConflictType.SavedFilterApprovalConflictTypeSerializer.class) +public class SavedFilterApprovalConflictType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("update-approval-conflict")); + + public static final SavedFilterApprovalConflictType UPDATE_APPROVAL_CONFLICT = + new SavedFilterApprovalConflictType("update-approval-conflict"); + + SavedFilterApprovalConflictType(String value) { + super(value, allowedValues); + } + + public static class SavedFilterApprovalConflictTypeSerializer + extends StdSerializer { + public SavedFilterApprovalConflictTypeSerializer(Class t) { + super(t); + } + + public SavedFilterApprovalConflictTypeSerializer() { + this(null); + } + + @Override + public void serialize( + SavedFilterApprovalConflictType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static SavedFilterApprovalConflictType fromValue(String value) { + return new SavedFilterApprovalConflictType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SavedFilterConditionRequest.java b/src/main/java/com/datadog/api/client/v2/model/SavedFilterConditionRequest.java new file mode 100644 index 00000000000..463273c422e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SavedFilterConditionRequest.java @@ -0,0 +1,218 @@ +/* + * 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; + +/** + * An inline condition to write in a saved filter. Nested saved-filter references are not supported. + */ +@JsonPropertyOrder({ + SavedFilterConditionRequest.JSON_PROPERTY_ATTRIBUTE, + SavedFilterConditionRequest.JSON_PROPERTY_OPERATOR, + SavedFilterConditionRequest.JSON_PROPERTY_VALUE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SavedFilterConditionRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTE = "attribute"; + private String attribute; + + 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 SavedFilterConditionRequest() {} + + @JsonCreator + public SavedFilterConditionRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTE) String attribute, + @JsonProperty(required = true, value = JSON_PROPERTY_OPERATOR) + SavedFilterConditionOperator operator, + @JsonProperty(required = true, value = JSON_PROPERTY_VALUE) List value) { + this.attribute = attribute; + this.operator = operator; + this.unparsed |= !operator.isValid(); + this.value = value; + } + + public SavedFilterConditionRequest 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 SavedFilterConditionRequest 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 SavedFilterConditionRequest value(List value) { + this.value = value; + return this; + } + + public SavedFilterConditionRequest addValueItem(String valueItem) { + this.value.add(valueItem); + return this; + } + + /** + * Values used by the condition operator. Values must satisfy the selected operator and the + * organization targeting limits. + * + * @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 SavedFilterConditionRequest + */ + @JsonAnySetter + public SavedFilterConditionRequest 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 SavedFilterConditionRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SavedFilterConditionRequest savedFilterConditionRequest = (SavedFilterConditionRequest) o; + return Objects.equals(this.attribute, savedFilterConditionRequest.attribute) + && Objects.equals(this.operator, savedFilterConditionRequest.operator) + && Objects.equals(this.value, savedFilterConditionRequest.value) + && Objects.equals( + this.additionalProperties, savedFilterConditionRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attribute, operator, value, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SavedFilterConditionRequest {\n"); + sb.append(" attribute: ").append(toIndentedString(attribute)).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/SavedFilterFlagReference.java b/src/main/java/com/datadog/api/client/v2/model/SavedFilterFlagReference.java new file mode 100644 index 00000000000..8178373f182 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SavedFilterFlagReference.java @@ -0,0 +1,174 @@ +/* + * 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 feature flag that references the saved filter. */ +@JsonPropertyOrder({ + SavedFilterFlagReference.JSON_PROPERTY_ID, + SavedFilterFlagReference.JSON_PROPERTY_NAME +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SavedFilterFlagReference { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private UUID id; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public SavedFilterFlagReference() {} + + @JsonCreator + public SavedFilterFlagReference( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) UUID id, + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name) { + this.id = id; + this.name = name; + } + + public SavedFilterFlagReference id(UUID id) { + this.id = id; + return this; + } + + /** + * The ID of the feature flag. + * + * @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 SavedFilterFlagReference name(String name) { + this.name = name; + return this; + } + + /** + * The name of the feature flag. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + /** + * 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 SavedFilterFlagReference + */ + @JsonAnySetter + public SavedFilterFlagReference 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 SavedFilterFlagReference object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SavedFilterFlagReference savedFilterFlagReference = (SavedFilterFlagReference) o; + return Objects.equals(this.id, savedFilterFlagReference.id) + && Objects.equals(this.name, savedFilterFlagReference.name) + && Objects.equals(this.additionalProperties, savedFilterFlagReference.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SavedFilterFlagReference {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).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/SavedFilterJSONAPIErrorResponse.java b/src/main/java/com/datadog/api/client/v2/model/SavedFilterJSONAPIErrorResponse.java new file mode 100644 index 00000000000..5d4cd0f1d67 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SavedFilterJSONAPIErrorResponse.java @@ -0,0 +1,109 @@ +/* + * 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.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.List; +import java.util.Objects; + +/** A saved filter error containing at least one JSON:API error object. */ +@JsonPropertyOrder({SavedFilterJSONAPIErrorResponse.JSON_PROPERTY_ERRORS}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SavedFilterJSONAPIErrorResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ERRORS = "errors"; + private List errors = new ArrayList<>(); + + public SavedFilterJSONAPIErrorResponse() {} + + @JsonCreator + public SavedFilterJSONAPIErrorResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_ERRORS) List errors) { + this.errors = errors; + for (JSONAPIErrorItem item : errors) { + this.unparsed |= item.unparsed; + } + } + + public SavedFilterJSONAPIErrorResponse errors(List errors) { + this.errors = errors; + for (JSONAPIErrorItem item : errors) { + this.unparsed |= item.unparsed; + } + return this; + } + + public SavedFilterJSONAPIErrorResponse addErrorsItem(JSONAPIErrorItem errorsItem) { + this.errors.add(errorsItem); + this.unparsed |= errorsItem.unparsed; + return this; + } + + /** + * The error details. + * + * @return errors + */ + @JsonProperty(JSON_PROPERTY_ERRORS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getErrors() { + return errors; + } + + public void setErrors(List errors) { + this.errors = errors; + if (errors != null) { + for (JSONAPIErrorItem item : errors) { + this.unparsed |= item.unparsed; + } + } + } + + /** Return true if this SavedFilterJSONAPIErrorResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SavedFilterJSONAPIErrorResponse savedFilterJsonapiErrorResponse = + (SavedFilterJSONAPIErrorResponse) o; + return Objects.equals(this.errors, savedFilterJsonapiErrorResponse.errors); + } + + @Override + public int hashCode() { + return Objects.hash(errors); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SavedFilterJSONAPIErrorResponse {\n"); + sb.append(" errors: ").append(toIndentedString(errors)).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/SavedFilterPermissionDeniedAttributes.java b/src/main/java/com/datadog/api/client/v2/model/SavedFilterPermissionDeniedAttributes.java new file mode 100644 index 00000000000..a1ccc7ceac6 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SavedFilterPermissionDeniedAttributes.java @@ -0,0 +1,199 @@ +/* + * 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; + +/** + * The caller lacks edit permission on one or more feature flags that reference this saved filter. + */ +@JsonPropertyOrder({ + SavedFilterPermissionDeniedAttributes.JSON_PROPERTY_DENIED_FLAGS, + SavedFilterPermissionDeniedAttributes.JSON_PROPERTY_MESSAGE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SavedFilterPermissionDeniedAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DENIED_FLAGS = "denied_flags"; + private List deniedFlags = new ArrayList<>(); + + public static final String JSON_PROPERTY_MESSAGE = "message"; + private String message; + + public SavedFilterPermissionDeniedAttributes() {} + + @JsonCreator + public SavedFilterPermissionDeniedAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_DENIED_FLAGS) + List deniedFlags, + @JsonProperty(required = true, value = JSON_PROPERTY_MESSAGE) String message) { + this.deniedFlags = deniedFlags; + for (SavedFilterFlagReference item : deniedFlags) { + this.unparsed |= item.unparsed; + } + this.message = message; + } + + public SavedFilterPermissionDeniedAttributes deniedFlags( + List deniedFlags) { + this.deniedFlags = deniedFlags; + for (SavedFilterFlagReference item : deniedFlags) { + this.unparsed |= item.unparsed; + } + return this; + } + + public SavedFilterPermissionDeniedAttributes addDeniedFlagsItem( + SavedFilterFlagReference deniedFlagsItem) { + this.deniedFlags.add(deniedFlagsItem); + this.unparsed |= deniedFlagsItem.unparsed; + return this; + } + + /** + * Feature flags preventing this update. + * + * @return deniedFlags + */ + @JsonProperty(JSON_PROPERTY_DENIED_FLAGS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getDeniedFlags() { + return deniedFlags; + } + + public void setDeniedFlags(List deniedFlags) { + this.deniedFlags = deniedFlags; + if (deniedFlags != null) { + for (SavedFilterFlagReference item : deniedFlags) { + this.unparsed |= item.unparsed; + } + } + } + + public SavedFilterPermissionDeniedAttributes message(String message) { + this.message = message; + return this; + } + + /** + * The reason the saved filter update was rejected. + * + * @return message + */ + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + /** + * 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 SavedFilterPermissionDeniedAttributes + */ + @JsonAnySetter + public SavedFilterPermissionDeniedAttributes 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 SavedFilterPermissionDeniedAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SavedFilterPermissionDeniedAttributes savedFilterPermissionDeniedAttributes = + (SavedFilterPermissionDeniedAttributes) o; + return Objects.equals(this.deniedFlags, savedFilterPermissionDeniedAttributes.deniedFlags) + && Objects.equals(this.message, savedFilterPermissionDeniedAttributes.message) + && Objects.equals( + this.additionalProperties, savedFilterPermissionDeniedAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(deniedFlags, message, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SavedFilterPermissionDeniedAttributes {\n"); + sb.append(" deniedFlags: ").append(toIndentedString(deniedFlags)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).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/SavedFilterPermissionDeniedData.java b/src/main/java/com/datadog/api/client/v2/model/SavedFilterPermissionDeniedData.java new file mode 100644 index 00000000000..09de1fa2b95 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SavedFilterPermissionDeniedData.java @@ -0,0 +1,219 @@ +/* + * 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; + +/** + * The caller lacks edit permission on one or more feature flags that reference this saved filter. + */ +@JsonPropertyOrder({ + SavedFilterPermissionDeniedData.JSON_PROPERTY_ATTRIBUTES, + SavedFilterPermissionDeniedData.JSON_PROPERTY_ID, + SavedFilterPermissionDeniedData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SavedFilterPermissionDeniedData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private SavedFilterPermissionDeniedAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private UUID id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private SavedFilterPermissionDeniedType type; + + public SavedFilterPermissionDeniedData() {} + + @JsonCreator + public SavedFilterPermissionDeniedData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + SavedFilterPermissionDeniedAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) UUID id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + SavedFilterPermissionDeniedType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public SavedFilterPermissionDeniedData attributes( + SavedFilterPermissionDeniedAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * The caller lacks edit permission on one or more feature flags that reference this saved filter. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SavedFilterPermissionDeniedAttributes getAttributes() { + return attributes; + } + + public void setAttributes(SavedFilterPermissionDeniedAttributes attributes) { + this.attributes = attributes; + if (attributes != null) { + this.unparsed |= attributes.unparsed; + } + } + + public SavedFilterPermissionDeniedData 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 SavedFilterPermissionDeniedData type(SavedFilterPermissionDeniedType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The resource type for this saved filter update error. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SavedFilterPermissionDeniedType getType() { + return type; + } + + public void setType(SavedFilterPermissionDeniedType 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 SavedFilterPermissionDeniedData + */ + @JsonAnySetter + public SavedFilterPermissionDeniedData 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 SavedFilterPermissionDeniedData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SavedFilterPermissionDeniedData savedFilterPermissionDeniedData = + (SavedFilterPermissionDeniedData) o; + return Objects.equals(this.attributes, savedFilterPermissionDeniedData.attributes) + && Objects.equals(this.id, savedFilterPermissionDeniedData.id) + && Objects.equals(this.type, savedFilterPermissionDeniedData.type) + && Objects.equals( + this.additionalProperties, savedFilterPermissionDeniedData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SavedFilterPermissionDeniedData {\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/SavedFilterPermissionDeniedResponse.java b/src/main/java/com/datadog/api/client/v2/model/SavedFilterPermissionDeniedResponse.java new file mode 100644 index 00000000000..dca4e56e89d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SavedFilterPermissionDeniedResponse.java @@ -0,0 +1,98 @@ +/* + * 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.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.Objects; + +/** + * The caller lacks edit permission on one or more feature flags that reference this saved filter. + */ +@JsonPropertyOrder({SavedFilterPermissionDeniedResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SavedFilterPermissionDeniedResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private SavedFilterPermissionDeniedData data; + + public SavedFilterPermissionDeniedResponse() {} + + @JsonCreator + public SavedFilterPermissionDeniedResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + SavedFilterPermissionDeniedData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public SavedFilterPermissionDeniedResponse data(SavedFilterPermissionDeniedData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * The caller lacks edit permission on one or more feature flags that reference this saved filter. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SavedFilterPermissionDeniedData getData() { + return data; + } + + public void setData(SavedFilterPermissionDeniedData data) { + this.data = data; + if (data != null) { + this.unparsed |= data.unparsed; + } + } + + /** Return true if this SavedFilterPermissionDeniedResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SavedFilterPermissionDeniedResponse savedFilterPermissionDeniedResponse = + (SavedFilterPermissionDeniedResponse) o; + return Objects.equals(this.data, savedFilterPermissionDeniedResponse.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SavedFilterPermissionDeniedResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).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/SavedFilterPermissionDeniedType.java b/src/main/java/com/datadog/api/client/v2/model/SavedFilterPermissionDeniedType.java new file mode 100644 index 00000000000..69d73ece336 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SavedFilterPermissionDeniedType.java @@ -0,0 +1,58 @@ +/* + * 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 resource type for this saved filter update error. */ +@JsonSerialize( + using = SavedFilterPermissionDeniedType.SavedFilterPermissionDeniedTypeSerializer.class) +public class SavedFilterPermissionDeniedType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("update-grace-denied")); + + public static final SavedFilterPermissionDeniedType UPDATE_GRACE_DENIED = + new SavedFilterPermissionDeniedType("update-grace-denied"); + + SavedFilterPermissionDeniedType(String value) { + super(value, allowedValues); + } + + public static class SavedFilterPermissionDeniedTypeSerializer + extends StdSerializer { + public SavedFilterPermissionDeniedTypeSerializer(Class t) { + super(t); + } + + public SavedFilterPermissionDeniedTypeSerializer() { + this(null); + } + + @Override + public void serialize( + SavedFilterPermissionDeniedType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static SavedFilterPermissionDeniedType fromValue(String value) { + return new SavedFilterPermissionDeniedType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SavedFilterTargetingRuleRequest.java b/src/main/java/com/datadog/api/client/v2/model/SavedFilterTargetingRuleRequest.java new file mode 100644 index 00000000000..ea2c00c4083 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SavedFilterTargetingRuleRequest.java @@ -0,0 +1,166 @@ +/* + * 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; + +/** A replacement saved filter targeting rule. */ +@JsonPropertyOrder({SavedFilterTargetingRuleRequest.JSON_PROPERTY_CONDITIONS}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SavedFilterTargetingRuleRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CONDITIONS = "conditions"; + private List conditions = new ArrayList<>(); + + public SavedFilterTargetingRuleRequest() {} + + @JsonCreator + public SavedFilterTargetingRuleRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_CONDITIONS) + List conditions) { + this.conditions = conditions; + for (SavedFilterConditionRequest item : conditions) { + this.unparsed |= item.unparsed; + } + } + + public SavedFilterTargetingRuleRequest conditions(List conditions) { + this.conditions = conditions; + for (SavedFilterConditionRequest item : conditions) { + this.unparsed |= item.unparsed; + } + return this; + } + + public SavedFilterTargetingRuleRequest addConditionsItem( + SavedFilterConditionRequest conditionsItem) { + this.conditions.add(conditionsItem); + this.unparsed |= conditionsItem.unparsed; + return this; + } + + /** + * Inline conditions combined with AND. Must contain at least one condition. + * + * @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 (SavedFilterConditionRequest item : conditions) { + this.unparsed |= item.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 SavedFilterTargetingRuleRequest + */ + @JsonAnySetter + public SavedFilterTargetingRuleRequest 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 SavedFilterTargetingRuleRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SavedFilterTargetingRuleRequest savedFilterTargetingRuleRequest = + (SavedFilterTargetingRuleRequest) o; + return Objects.equals(this.conditions, savedFilterTargetingRuleRequest.conditions) + && Objects.equals( + this.additionalProperties, savedFilterTargetingRuleRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(conditions, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SavedFilterTargetingRuleRequest {\n"); + sb.append(" conditions: ").append(toIndentedString(conditions)).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 b298d717c25..c2a82ad2841 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 @@ -632,6 +632,300 @@ Feature: Feature Flags And the response "meta.page.offset" is equal to 1 And the response "meta.page.total" is equal to 2 + @replay-only @team:ddoghq/feature-flags + Scenario: Patch a saved filter accepts the current timestamp for metadata + Given new "UpdateSavedFilterAttributes" request + And request contains "saved_filter_id" parameter with value "a8c393b4-3a9c-48fd-aa48-402c97e8d9c9" + And body with value {"data":{"attributes":{"description":"Metadata with current timestamp.","last_updated_at":"2026-10-16T20:20:29Z"},"type":"saved-filters"}} + When the request is sent + Then the response status is 200 OK + And the response "data.id" is equal to "a8c393b4-3a9c-48fd-aa48-402c97e8d9c9" + And the response "data.type" is equal to "saved-filters" + And the response "data.attributes.name" is equal to "patchSavedFilterTest-concurrency-437ebfe7" + And the response "data.attributes.description" is equal to "Metadata with current timestamp." + And the response "data.attributes.creation_type" is equal to "RULES" + 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].operator" is equal to "ONE_OF" + 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].value" is equal to ["test-user-1"] + + @replay-only @team:ddoghq/feature-flags + Scenario: Patch a saved filter accepts the current timestamp for rules + Given new "UpdateSavedFilterAttributes" request + And request contains "saved_filter_id" parameter with value "a8c393b4-3a9c-48fd-aa48-402c97e8d9c9" + And body with value {"data":{"attributes":{"last_updated_at":"2026-10-16T20:20:30Z","targeting_rules":[{"conditions":[{"attribute":"user_id","operator":"ONE_OF","value":["test-user-2"]}]}]},"type":"saved-filters"}} + When the request is sent + Then the response status is 200 OK + And the response "data.id" is equal to "a8c393b4-3a9c-48fd-aa48-402c97e8d9c9" + And the response "data.type" is equal to "saved-filters" + And the response "data.attributes.name" is equal to "patchSavedFilterTest-concurrency-437ebfe7" + And the response "data.attributes.description" is equal to "Metadata with current timestamp." + And the response "data.attributes.creation_type" is equal to "RULES" + 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].operator" is equal to "ONE_OF" + 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].value" is equal to ["test-user-2"] + + @replay-only @team:ddoghq/feature-flags + Scenario: Patch a saved filter clears the description with an empty string + Given new "UpdateSavedFilterAttributes" request + And request contains "saved_filter_id" parameter with value "2cfc7949-7eb4-4d76-b1b8-d1aa9b565535" + And body with value {"data":{"type":"saved-filters","attributes":{"description":""}}} + When the request is sent + Then the response status is 200 OK + And the response "data.id" is equal to "2cfc7949-7eb4-4d76-b1b8-d1aa9b565535" + And the response "data.type" is equal to "saved-filters" + And the response "data.attributes.name" is equal to "patchSavedFilterTest-null-157e7ff3" + And the response "data.attributes.description" is equal to "" + And the response "data.attributes.creation_type" is equal to "RULES" + 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].operator" is equal to "ONE_OF" + And the response "data.attributes.targeting_rules[0].conditions[0].attribute" is equal to "org_id" + And the response "data.attributes.targeting_rules[0].conditions[0].value" is equal to ["test-org-1"] + + @replay-only @team:ddoghq/feature-flags + Scenario: Patch a saved filter preserves a null description + Given new "UpdateSavedFilterAttributes" request + And request contains "saved_filter_id" parameter with value "2cfc7949-7eb4-4d76-b1b8-d1aa9b565535" + And body with value {"data":{"type":"saved-filters","attributes":{"description":null,"name":"patchSavedFilterTest-null-157e7ff3"}}} + When the request is sent + Then the response status is 200 OK + And the response "data.id" is equal to "2cfc7949-7eb4-4d76-b1b8-d1aa9b565535" + And the response "data.type" is equal to "saved-filters" + And the response "data.attributes.name" is equal to "patchSavedFilterTest-null-157e7ff3" + And the response "data.attributes.description" is equal to "Combined synthetic test update." + And the response "data.attributes.creation_type" is equal to "RULES" + 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].operator" is equal to "ONE_OF" + And the response "data.attributes.targeting_rules[0].conditions[0].attribute" is equal to "org_id" + And the response "data.attributes.targeting_rules[0].conditions[0].value" is equal to ["test-org-1"] + + @replay-only @team:ddoghq/feature-flags + Scenario: Patch a saved filter rejects a duplicate name + Given new "UpdateSavedFilterAttributes" request + And request contains "saved_filter_id" parameter with value "2cfc7949-7eb4-4d76-b1b8-d1aa9b565535" + And body with value {"data":{"type":"saved-filters","attributes":{"name":"patchSavedFilterTest-LIST-157e7ff3"}}} + When the request is sent + Then the response status is 409 Conflict + And the response "errors" has length 1 + And the response "errors[0].status" is equal to "409" + And the response "errors[0].title" is equal to "Conflict" + And the response "errors[0].detail" is equal to "a saved filter with this name already exists: conflict occurred" + + @replay-only @team:ddoghq/feature-flags + Scenario: Patch a saved filter rejects a null-only update + Given new "UpdateSavedFilterAttributes" request + And request contains "saved_filter_id" parameter with value "2cfc7949-7eb4-4d76-b1b8-d1aa9b565535" + And body with value {"data":{"type":"saved-filters","attributes":{"description":null}}} + When the request is sent + Then the response status is 400 Bad Request + And the response "errors" has length 1 + And the response "errors[0].status" is equal to "400" + And the response "errors[0].title" is equal to "Bad Request" + And the response "errors[0].detail" is equal to "at least one field must be provided" + + @replay-only @team:ddoghq/feature-flags + Scenario: Patch a saved filter rejects a timestamp-only update + Given new "UpdateSavedFilterAttributes" request + And request contains "saved_filter_id" parameter with value "a8c393b4-3a9c-48fd-aa48-402c97e8d9c9" + And body with value {"data":{"attributes":{"last_updated_at":"2026-10-16T20:20:30Z"},"type":"saved-filters"}} + When the request is sent + Then the response status is 400 Bad Request + And the response "errors" has length 1 + And the response "errors[0].status" is equal to "400" + And the response "errors[0].title" is equal to "Bad Request" + And the response "errors[0].detail" is equal to "at least one field must be provided" + + @replay-only @skip-python @skip-ruby @team:ddoghq/feature-flags + Scenario: Patch a saved filter rejects an empty name + Given new "UpdateSavedFilterAttributes" request + And request contains "saved_filter_id" parameter with value "2cfc7949-7eb4-4d76-b1b8-d1aa9b565535" + And body with value {"data":{"type":"saved-filters","attributes":{"name":""}}} + When the request is sent + Then the response status is 400 Bad Request + And the response "errors" has length 1 + And the response "errors[0].status" is equal to "400" + And the response "errors[0].title" is equal to "Bad Request" + And the response "errors[0].detail" is equal to "name must not be empty" + + @replay-only @skip-java @skip-python @skip-ruby @skip-typescript @team:ddoghq/feature-flags + Scenario: Patch a saved filter rejects an invalid timestamp + Given new "UpdateSavedFilterAttributes" request + And request contains "saved_filter_id" parameter with value "2cfc7949-7eb4-4d76-b1b8-d1aa9b565535" + And body with value {"data":{"type":"saved-filters","attributes":{"description":"Not applied.","last_updated_at":"invalid"}}} + When the request is sent + Then the response status is 400 Bad Request + And the response "errors" has length 1 + And the response "errors[0].status" is equal to "400" + And the response "errors[0].title" is equal to "Bad Request" + And the response "errors[0].detail" is equal to "last_updated_at must be a valid RFC3339 timestamp" + + @replay-only @skip-python @skip-ruby @team:ddoghq/feature-flags + Scenario: Patch a saved filter rejects empty targeting rules + Given new "UpdateSavedFilterAttributes" request + And request contains "saved_filter_id" parameter with value "2cfc7949-7eb4-4d76-b1b8-d1aa9b565535" + And body with value {"data":{"type":"saved-filters","attributes":{"targeting_rules":[]}}} + When the request is sent + Then the response status is 400 Bad Request + And the response "errors" has length 1 + And the response "errors[0].status" is equal to "400" + And the response "errors[0].title" is equal to "Bad Request" + And the response "errors[0].detail" is equal to "attribute \"targeting_rules\" failed min validation" + + @replay-only @team:ddoghq/feature-flags + Scenario: Patch a saved filter rejects nested saved filters + Given new "UpdateSavedFilterAttributes" request + And request contains "saved_filter_id" parameter with value "2cfc7949-7eb4-4d76-b1b8-d1aa9b565535" + And body with value {"data":{"type":"saved-filters","attributes":{"targeting_rules":[{"conditions":[{"operator":"ONE_OF","attribute":"user_id","value":["test-user-1"],"saved_filter_id":"d8e3a81b-1505-4600-99c6-c563d01d46b1"}]}]}}} + When the request is sent + Then the response status is 400 Bad Request + And the response "errors" has length 1 + And the response "errors[0].status" is equal to "400" + And the response "errors[0].title" is equal to "Bad Request" + And the response "errors[0].detail" is equal to "targeting rule 0 condition 0: saved filters cannot reference other saved filters" + + @replay-only @team:ddoghq/feature-flags + Scenario: Patch a saved filter rejects stale rule updates + Given new "UpdateSavedFilterAttributes" request + And request contains "saved_filter_id" parameter with value "a8c393b4-3a9c-48fd-aa48-402c97e8d9c9" + And body with value {"data":{"attributes":{"last_updated_at":"2020-01-01T00:00:00Z","targeting_rules":[{"conditions":[{"attribute":"user_id","operator":"ONE_OF","value":["not-applied"]}]}]},"type":"saved-filters"}} + When the request is sent + Then the response status is 409 Conflict + And the response "errors" has length 1 + And the response "errors[0].status" is equal to "409" + And the response "errors[0].title" is equal to "Conflict" + And the response "errors[0].detail" is equal to "saved filter has been modified since you last fetched it; please refresh and retry: conflict occurred" + + @replay-only @team:ddoghq/feature-flags + Scenario: Patch a saved filter replaces rules and preserves metadata + Given new "UpdateSavedFilterAttributes" request + And request contains "saved_filter_id" parameter with value "2cfc7949-7eb4-4d76-b1b8-d1aa9b565535" + And body with value {"data":{"type":"saved-filters","attributes":{"targeting_rules":[{"conditions":[{"operator":"ONE_OF","attribute":"email","value":["test@example.com"]}]}]}}} + When the request is sent + Then the response status is 200 OK + And the response "data.id" is equal to "2cfc7949-7eb4-4d76-b1b8-d1aa9b565535" + And the response "data.type" is equal to "saved-filters" + And the response "data.attributes.name" is equal to "patchSavedFilterTest-renamed-157e7ff3" + And the response "data.attributes.description" is equal to "Original synthetic test description." + And the response "data.attributes.creation_type" is equal to "RULES" + 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].operator" is equal to "ONE_OF" + 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].value" is equal to ["test@example.com"] + + @replay-only @team:ddoghq/feature-flags + Scenario: Patch a saved filter replaces the rules of a saved list + Given new "UpdateSavedFilterAttributes" request + And request contains "saved_filter_id" parameter with value "d8e3a81b-1505-4600-99c6-c563d01d46b1" + And body with value {"data":{"type":"saved-filters","attributes":{"targeting_rules":[{"conditions":[{"operator":"ONE_OF","attribute":"user_id","value":["test-user-3"]}]}]}}} + When the request is sent + Then the response status is 200 OK + And the response "data.id" is equal to "d8e3a81b-1505-4600-99c6-c563d01d46b1" + And the response "data.type" is equal to "saved-filters" + And the response "data.attributes.name" is equal to "patchSavedFilterTest-LIST-157e7ff3" + And the response "data.attributes.description" is equal to "Updated synthetic test description." + And the response "data.attributes.creation_type" is equal to "LIST" + 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].operator" is equal to "ONE_OF" + 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].value" is equal to ["test-user-3"] + + @replay-only @team:ddoghq/feature-flags + Scenario: Patch a saved filter returns "Bad Request" response + Given new "UpdateSavedFilterAttributes" request + And request contains "saved_filter_id" parameter with value "2cfc7949-7eb4-4d76-b1b8-d1aa9b565535" + And body with value {"data":{"type":"saved-filters","attributes":{}}} + When the request is sent + Then the response status is 400 Bad Request + And the response "errors" has length 1 + And the response "errors[0].status" is equal to "400" + And the response "errors[0].title" is equal to "Bad Request" + And the response "errors[0].detail" is equal to "at least one field must be provided" + + @replay-only @team:ddoghq/feature-flags + Scenario: Patch a saved filter returns "Conflict" response + Given new "UpdateSavedFilterAttributes" request + And request contains "saved_filter_id" parameter with value "2cfc7949-7eb4-4d76-b1b8-d1aa9b565535" + And body with value {"data":{"type":"saved-filters","attributes":{"description":"Not applied.","last_updated_at":"2020-01-01T00:00:00Z"}}} + When the request is sent + Then the response status is 409 Conflict + And the response "errors" has length 1 + And the response "errors[0].status" is equal to "409" + And the response "errors[0].title" is equal to "Conflict" + And the response "errors[0].detail" is equal to "saved filter has been modified since you last fetched it; please refresh and retry: conflict occurred" + + @replay-only @team:ddoghq/feature-flags + Scenario: Patch a saved filter returns "Not Found" response + Given new "UpdateSavedFilterAttributes" request + And request contains "saved_filter_id" parameter with value "00000000-0000-0000-0000-000000000000" + And body with value {"data":{"type":"saved-filters","attributes":{"description":"Not applied."}}} + When the request is sent + Then the response status is 404 Not Found + And the response "errors" has length 1 + And the response "errors[0].status" is equal to "404" + And the response "errors[0].title" is equal to "Not Found" + And the response "errors[0].detail" is equal to "saved filter not found or already deleted: record not found" + + @replay-only @team:ddoghq/feature-flags + Scenario: Patch a saved filter returns "OK" response + Given new "UpdateSavedFilterAttributes" request + And request contains "saved_filter_id" parameter with value "2cfc7949-7eb4-4d76-b1b8-d1aa9b565535" + And body with value {"data":{"type":"saved-filters","attributes":{"name":"patchSavedFilterTest-renamed-157e7ff3"}}} + When the request is sent + Then the response status is 200 OK + And the response "data.id" is equal to "2cfc7949-7eb4-4d76-b1b8-d1aa9b565535" + And the response "data.type" is equal to "saved-filters" + And the response "data.attributes.name" is equal to "patchSavedFilterTest-renamed-157e7ff3" + And the response "data.attributes.description" is equal to "Original synthetic test description." + And the response "data.attributes.creation_type" is equal to "RULES" + 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].operator" is equal to "ONE_OF" + 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].value" is equal to ["test-user-1","test-user-2"] + + @replay-only @team:ddoghq/feature-flags + Scenario: Patch a saved filter updates metadata and rules together + Given new "UpdateSavedFilterAttributes" request + And request contains "saved_filter_id" parameter with value "2cfc7949-7eb4-4d76-b1b8-d1aa9b565535" + And body with value {"data":{"type":"saved-filters","attributes":{"name":"patchSavedFilterTest-combined-157e7ff3","description":"Combined synthetic test update.","targeting_rules":[{"conditions":[{"operator":"ONE_OF","attribute":"org_id","value":["test-org-1"]}]}]}}} + When the request is sent + Then the response status is 200 OK + And the response "data.id" is equal to "2cfc7949-7eb4-4d76-b1b8-d1aa9b565535" + And the response "data.type" is equal to "saved-filters" + And the response "data.attributes.name" is equal to "patchSavedFilterTest-combined-157e7ff3" + And the response "data.attributes.description" is equal to "Combined synthetic test update." + And the response "data.attributes.creation_type" is equal to "RULES" + 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].operator" is equal to "ONE_OF" + And the response "data.attributes.targeting_rules[0].conditions[0].attribute" is equal to "org_id" + And the response "data.attributes.targeting_rules[0].conditions[0].value" is equal to ["test-org-1"] + + @replay-only @team:ddoghq/feature-flags + Scenario: Patch a saved filter updates only the description of a saved list + Given new "UpdateSavedFilterAttributes" request + And request contains "saved_filter_id" parameter with value "d8e3a81b-1505-4600-99c6-c563d01d46b1" + And body with value {"data":{"type":"saved-filters","attributes":{"description":"Updated synthetic test description."}}} + When the request is sent + Then the response status is 200 OK + And the response "data.id" is equal to "d8e3a81b-1505-4600-99c6-c563d01d46b1" + And the response "data.type" is equal to "saved-filters" + And the response "data.attributes.name" is equal to "patchSavedFilterTest-LIST-157e7ff3" + And the response "data.attributes.description" is equal to "Updated synthetic test description." + And the response "data.attributes.creation_type" is equal to "LIST" + 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].operator" is equal to "ONE_OF" + 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].value" is equal to ["test-user-1","test-user-2"] + @generated @skip @team:ddoghq/feature-flags Scenario: Pause a progressive rollout returns "Bad Request" response Given new "PauseExposureSchedule" 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 5099fc97d12..3f937ed045d 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 @@ -3263,6 +3263,12 @@ "type": "safe" } }, + "UpdateSavedFilterAttributes": { + "tag": "Feature Flags", + "undo": { + "type": "idempotent" + } + }, "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 976b3017394..a38c39c816d 100644 --- a/src/test/resources/generated-test/test-runner-data/manifest.json +++ b/src/test/resources/generated-test/test-runner-data/manifest.json @@ -6055,6 +6055,146 @@ "scenario": "List feature flags supports legacy pagination aliases", "version": "v2" }, + { + "feature": "Feature Flags", + "feature_file": "../../com/datadog/api/client/v2/api/feature_flags.feature", + "file": "v2/feature-flags/patch-a-saved-filter-accepts-the-current-timestamp-for-metadata.json", + "scenario": "Patch a saved filter accepts the current timestamp for metadata", + "version": "v2" + }, + { + "feature": "Feature Flags", + "feature_file": "../../com/datadog/api/client/v2/api/feature_flags.feature", + "file": "v2/feature-flags/patch-a-saved-filter-accepts-the-current-timestamp-for-rules.json", + "scenario": "Patch a saved filter accepts the current timestamp for rules", + "version": "v2" + }, + { + "feature": "Feature Flags", + "feature_file": "../../com/datadog/api/client/v2/api/feature_flags.feature", + "file": "v2/feature-flags/patch-a-saved-filter-clears-the-description-with-an-empty-string.json", + "scenario": "Patch a saved filter clears the description with an empty string", + "version": "v2" + }, + { + "feature": "Feature Flags", + "feature_file": "../../com/datadog/api/client/v2/api/feature_flags.feature", + "file": "v2/feature-flags/patch-a-saved-filter-preserves-a-null-description.json", + "scenario": "Patch a saved filter preserves a null description", + "version": "v2" + }, + { + "feature": "Feature Flags", + "feature_file": "../../com/datadog/api/client/v2/api/feature_flags.feature", + "file": "v2/feature-flags/patch-a-saved-filter-rejects-a-duplicate-name.json", + "scenario": "Patch a saved filter rejects a duplicate name", + "version": "v2" + }, + { + "feature": "Feature Flags", + "feature_file": "../../com/datadog/api/client/v2/api/feature_flags.feature", + "file": "v2/feature-flags/patch-a-saved-filter-rejects-a-null-only-update.json", + "scenario": "Patch a saved filter rejects a null-only update", + "version": "v2" + }, + { + "feature": "Feature Flags", + "feature_file": "../../com/datadog/api/client/v2/api/feature_flags.feature", + "file": "v2/feature-flags/patch-a-saved-filter-rejects-a-timestamp-only-update.json", + "scenario": "Patch a saved filter rejects a timestamp-only update", + "version": "v2" + }, + { + "feature": "Feature Flags", + "feature_file": "../../com/datadog/api/client/v2/api/feature_flags.feature", + "file": "v2/feature-flags/patch-a-saved-filter-rejects-an-empty-name.json", + "scenario": "Patch a saved filter rejects an empty name", + "version": "v2" + }, + { + "feature": "Feature Flags", + "feature_file": "../../com/datadog/api/client/v2/api/feature_flags.feature", + "file": "v2/feature-flags/patch-a-saved-filter-rejects-an-invalid-timestamp.json", + "scenario": "Patch a saved filter rejects an invalid timestamp", + "version": "v2" + }, + { + "feature": "Feature Flags", + "feature_file": "../../com/datadog/api/client/v2/api/feature_flags.feature", + "file": "v2/feature-flags/patch-a-saved-filter-rejects-empty-targeting-rules.json", + "scenario": "Patch a saved filter rejects empty targeting rules", + "version": "v2" + }, + { + "feature": "Feature Flags", + "feature_file": "../../com/datadog/api/client/v2/api/feature_flags.feature", + "file": "v2/feature-flags/patch-a-saved-filter-rejects-nested-saved-filters.json", + "scenario": "Patch a saved filter rejects nested saved filters", + "version": "v2" + }, + { + "feature": "Feature Flags", + "feature_file": "../../com/datadog/api/client/v2/api/feature_flags.feature", + "file": "v2/feature-flags/patch-a-saved-filter-rejects-stale-rule-updates.json", + "scenario": "Patch a saved filter rejects stale rule updates", + "version": "v2" + }, + { + "feature": "Feature Flags", + "feature_file": "../../com/datadog/api/client/v2/api/feature_flags.feature", + "file": "v2/feature-flags/patch-a-saved-filter-replaces-rules-and-preserves-metadata.json", + "scenario": "Patch a saved filter replaces rules and preserves metadata", + "version": "v2" + }, + { + "feature": "Feature Flags", + "feature_file": "../../com/datadog/api/client/v2/api/feature_flags.feature", + "file": "v2/feature-flags/patch-a-saved-filter-replaces-the-rules-of-a-saved-list.json", + "scenario": "Patch a saved filter replaces the rules of a saved list", + "version": "v2" + }, + { + "feature": "Feature Flags", + "feature_file": "../../com/datadog/api/client/v2/api/feature_flags.feature", + "file": "v2/feature-flags/patch-a-saved-filter-returns-bad-request-response.json", + "scenario": "Patch a saved filter returns \"Bad Request\" response", + "version": "v2" + }, + { + "feature": "Feature Flags", + "feature_file": "../../com/datadog/api/client/v2/api/feature_flags.feature", + "file": "v2/feature-flags/patch-a-saved-filter-returns-conflict-response.json", + "scenario": "Patch a saved filter returns \"Conflict\" response", + "version": "v2" + }, + { + "feature": "Feature Flags", + "feature_file": "../../com/datadog/api/client/v2/api/feature_flags.feature", + "file": "v2/feature-flags/patch-a-saved-filter-returns-not-found-response.json", + "scenario": "Patch 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/patch-a-saved-filter-returns-ok-response.json", + "scenario": "Patch 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/patch-a-saved-filter-updates-metadata-and-rules-together.json", + "scenario": "Patch a saved filter updates metadata and rules together", + "version": "v2" + }, + { + "feature": "Feature Flags", + "feature_file": "../../com/datadog/api/client/v2/api/feature_flags.feature", + "file": "v2/feature-flags/patch-a-saved-filter-updates-only-the-description-of-a-saved-list.json", + "scenario": "Patch a saved filter updates only the description of 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/patch-a-saved-filter-accepts-the-current-timestamp-for-metadata.json b/src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-accepts-the-current-timestamp-for-metadata.json new file mode 100644 index 00000000000..1d4c2667065 --- /dev/null +++ b/src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-accepts-the-current-timestamp-for-metadata.json @@ -0,0 +1,51 @@ +{ + "api": "FeatureFlags", + "expected_status": 200, + "feature": "Feature Flags", + "id": "v2/Feature Flags/Patch a saved filter accepts the current timestamp for metadata", + "operation_id": "UpdateSavedFilterAttributes", + "request": { + "body": { + "schema": { + "format": null, + "ref": "PatchSavedFilterRequest", + "type": "object" + }, + "source": "inline", + "value": { + "data": { + "attributes": { + "description": "Metadata with current timestamp.", + "last_updated_at": "2026-10-16T20:20:29Z" + }, + "type": "saved-filters" + } + } + }, + "content_type": "application/json", + "method": "PATCH", + "pagination": false, + "parameters": [ + { + "explode": null, + "in": "path", + "name": "saved_filter_id", + "required": true, + "schema": { + "format": "uuid", + "ref": null, + "type": "string" + }, + "source": { + "type": "literal", + "value": "a8c393b4-3a9c-48fd-aa48-402c97e8d9c9" + }, + "style": null + } + ], + "path": "/api/v2/feature-flags/saved-filters/{saved_filter_id}" + }, + "scenario": "Patch a saved filter accepts the current timestamp for metadata", + "schema_version": 1, + "version": "v2" +} diff --git a/src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-accepts-the-current-timestamp-for-rules.json b/src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-accepts-the-current-timestamp-for-rules.json new file mode 100644 index 00000000000..8060c0e5e5a --- /dev/null +++ b/src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-accepts-the-current-timestamp-for-rules.json @@ -0,0 +1,63 @@ +{ + "api": "FeatureFlags", + "expected_status": 200, + "feature": "Feature Flags", + "id": "v2/Feature Flags/Patch a saved filter accepts the current timestamp for rules", + "operation_id": "UpdateSavedFilterAttributes", + "request": { + "body": { + "schema": { + "format": null, + "ref": "PatchSavedFilterRequest", + "type": "object" + }, + "source": "inline", + "value": { + "data": { + "attributes": { + "last_updated_at": "2026-10-16T20:20:30Z", + "targeting_rules": [ + { + "conditions": [ + { + "attribute": "user_id", + "operator": "ONE_OF", + "value": [ + "test-user-2" + ] + } + ] + } + ] + }, + "type": "saved-filters" + } + } + }, + "content_type": "application/json", + "method": "PATCH", + "pagination": false, + "parameters": [ + { + "explode": null, + "in": "path", + "name": "saved_filter_id", + "required": true, + "schema": { + "format": "uuid", + "ref": null, + "type": "string" + }, + "source": { + "type": "literal", + "value": "a8c393b4-3a9c-48fd-aa48-402c97e8d9c9" + }, + "style": null + } + ], + "path": "/api/v2/feature-flags/saved-filters/{saved_filter_id}" + }, + "scenario": "Patch a saved filter accepts the current timestamp for rules", + "schema_version": 1, + "version": "v2" +} diff --git a/src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-clears-the-description-with-an-empty-string.json b/src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-clears-the-description-with-an-empty-string.json new file mode 100644 index 00000000000..c875aa02648 --- /dev/null +++ b/src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-clears-the-description-with-an-empty-string.json @@ -0,0 +1,50 @@ +{ + "api": "FeatureFlags", + "expected_status": 200, + "feature": "Feature Flags", + "id": "v2/Feature Flags/Patch a saved filter clears the description with an empty string", + "operation_id": "UpdateSavedFilterAttributes", + "request": { + "body": { + "schema": { + "format": null, + "ref": "PatchSavedFilterRequest", + "type": "object" + }, + "source": "inline", + "value": { + "data": { + "attributes": { + "description": "" + }, + "type": "saved-filters" + } + } + }, + "content_type": "application/json", + "method": "PATCH", + "pagination": false, + "parameters": [ + { + "explode": null, + "in": "path", + "name": "saved_filter_id", + "required": true, + "schema": { + "format": "uuid", + "ref": null, + "type": "string" + }, + "source": { + "type": "literal", + "value": "2cfc7949-7eb4-4d76-b1b8-d1aa9b565535" + }, + "style": null + } + ], + "path": "/api/v2/feature-flags/saved-filters/{saved_filter_id}" + }, + "scenario": "Patch a saved filter clears the description with an empty string", + "schema_version": 1, + "version": "v2" +} diff --git a/src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-preserves-a-null-description.json b/src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-preserves-a-null-description.json new file mode 100644 index 00000000000..5891aa60dbb --- /dev/null +++ b/src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-preserves-a-null-description.json @@ -0,0 +1,51 @@ +{ + "api": "FeatureFlags", + "expected_status": 200, + "feature": "Feature Flags", + "id": "v2/Feature Flags/Patch a saved filter preserves a null description", + "operation_id": "UpdateSavedFilterAttributes", + "request": { + "body": { + "schema": { + "format": null, + "ref": "PatchSavedFilterRequest", + "type": "object" + }, + "source": "inline", + "value": { + "data": { + "attributes": { + "description": null, + "name": "patchSavedFilterTest-null-157e7ff3" + }, + "type": "saved-filters" + } + } + }, + "content_type": "application/json", + "method": "PATCH", + "pagination": false, + "parameters": [ + { + "explode": null, + "in": "path", + "name": "saved_filter_id", + "required": true, + "schema": { + "format": "uuid", + "ref": null, + "type": "string" + }, + "source": { + "type": "literal", + "value": "2cfc7949-7eb4-4d76-b1b8-d1aa9b565535" + }, + "style": null + } + ], + "path": "/api/v2/feature-flags/saved-filters/{saved_filter_id}" + }, + "scenario": "Patch a saved filter preserves a null description", + "schema_version": 1, + "version": "v2" +} diff --git a/src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-rejects-a-duplicate-name.json b/src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-rejects-a-duplicate-name.json new file mode 100644 index 00000000000..93b05fed145 --- /dev/null +++ b/src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-rejects-a-duplicate-name.json @@ -0,0 +1,50 @@ +{ + "api": "FeatureFlags", + "expected_status": 409, + "feature": "Feature Flags", + "id": "v2/Feature Flags/Patch a saved filter rejects a duplicate name", + "operation_id": "UpdateSavedFilterAttributes", + "request": { + "body": { + "schema": { + "format": null, + "ref": "PatchSavedFilterRequest", + "type": "object" + }, + "source": "inline", + "value": { + "data": { + "attributes": { + "name": "patchSavedFilterTest-LIST-157e7ff3" + }, + "type": "saved-filters" + } + } + }, + "content_type": "application/json", + "method": "PATCH", + "pagination": false, + "parameters": [ + { + "explode": null, + "in": "path", + "name": "saved_filter_id", + "required": true, + "schema": { + "format": "uuid", + "ref": null, + "type": "string" + }, + "source": { + "type": "literal", + "value": "2cfc7949-7eb4-4d76-b1b8-d1aa9b565535" + }, + "style": null + } + ], + "path": "/api/v2/feature-flags/saved-filters/{saved_filter_id}" + }, + "scenario": "Patch a saved filter rejects a duplicate name", + "schema_version": 1, + "version": "v2" +} diff --git a/src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-rejects-a-null-only-update.json b/src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-rejects-a-null-only-update.json new file mode 100644 index 00000000000..2d587c4a2bf --- /dev/null +++ b/src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-rejects-a-null-only-update.json @@ -0,0 +1,50 @@ +{ + "api": "FeatureFlags", + "expected_status": 400, + "feature": "Feature Flags", + "id": "v2/Feature Flags/Patch a saved filter rejects a null-only update", + "operation_id": "UpdateSavedFilterAttributes", + "request": { + "body": { + "schema": { + "format": null, + "ref": "PatchSavedFilterRequest", + "type": "object" + }, + "source": "inline", + "value": { + "data": { + "attributes": { + "description": null + }, + "type": "saved-filters" + } + } + }, + "content_type": "application/json", + "method": "PATCH", + "pagination": false, + "parameters": [ + { + "explode": null, + "in": "path", + "name": "saved_filter_id", + "required": true, + "schema": { + "format": "uuid", + "ref": null, + "type": "string" + }, + "source": { + "type": "literal", + "value": "2cfc7949-7eb4-4d76-b1b8-d1aa9b565535" + }, + "style": null + } + ], + "path": "/api/v2/feature-flags/saved-filters/{saved_filter_id}" + }, + "scenario": "Patch a saved filter rejects a null-only update", + "schema_version": 1, + "version": "v2" +} diff --git a/src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-rejects-a-timestamp-only-update.json b/src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-rejects-a-timestamp-only-update.json new file mode 100644 index 00000000000..62f7ee14eeb --- /dev/null +++ b/src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-rejects-a-timestamp-only-update.json @@ -0,0 +1,50 @@ +{ + "api": "FeatureFlags", + "expected_status": 400, + "feature": "Feature Flags", + "id": "v2/Feature Flags/Patch a saved filter rejects a timestamp-only update", + "operation_id": "UpdateSavedFilterAttributes", + "request": { + "body": { + "schema": { + "format": null, + "ref": "PatchSavedFilterRequest", + "type": "object" + }, + "source": "inline", + "value": { + "data": { + "attributes": { + "last_updated_at": "2026-10-16T20:20:30Z" + }, + "type": "saved-filters" + } + } + }, + "content_type": "application/json", + "method": "PATCH", + "pagination": false, + "parameters": [ + { + "explode": null, + "in": "path", + "name": "saved_filter_id", + "required": true, + "schema": { + "format": "uuid", + "ref": null, + "type": "string" + }, + "source": { + "type": "literal", + "value": "a8c393b4-3a9c-48fd-aa48-402c97e8d9c9" + }, + "style": null + } + ], + "path": "/api/v2/feature-flags/saved-filters/{saved_filter_id}" + }, + "scenario": "Patch a saved filter rejects a timestamp-only update", + "schema_version": 1, + "version": "v2" +} diff --git a/src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-rejects-an-empty-name.json b/src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-rejects-an-empty-name.json new file mode 100644 index 00000000000..3e6f6fcb23b --- /dev/null +++ b/src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-rejects-an-empty-name.json @@ -0,0 +1,50 @@ +{ + "api": "FeatureFlags", + "expected_status": 400, + "feature": "Feature Flags", + "id": "v2/Feature Flags/Patch a saved filter rejects an empty name", + "operation_id": "UpdateSavedFilterAttributes", + "request": { + "body": { + "schema": { + "format": null, + "ref": "PatchSavedFilterRequest", + "type": "object" + }, + "source": "inline", + "value": { + "data": { + "attributes": { + "name": "" + }, + "type": "saved-filters" + } + } + }, + "content_type": "application/json", + "method": "PATCH", + "pagination": false, + "parameters": [ + { + "explode": null, + "in": "path", + "name": "saved_filter_id", + "required": true, + "schema": { + "format": "uuid", + "ref": null, + "type": "string" + }, + "source": { + "type": "literal", + "value": "2cfc7949-7eb4-4d76-b1b8-d1aa9b565535" + }, + "style": null + } + ], + "path": "/api/v2/feature-flags/saved-filters/{saved_filter_id}" + }, + "scenario": "Patch a saved filter rejects an empty name", + "schema_version": 1, + "version": "v2" +} diff --git a/src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-rejects-an-invalid-timestamp.json b/src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-rejects-an-invalid-timestamp.json new file mode 100644 index 00000000000..9269e3dc071 --- /dev/null +++ b/src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-rejects-an-invalid-timestamp.json @@ -0,0 +1,51 @@ +{ + "api": "FeatureFlags", + "expected_status": 400, + "feature": "Feature Flags", + "id": "v2/Feature Flags/Patch a saved filter rejects an invalid timestamp", + "operation_id": "UpdateSavedFilterAttributes", + "request": { + "body": { + "schema": { + "format": null, + "ref": "PatchSavedFilterRequest", + "type": "object" + }, + "source": "inline", + "value": { + "data": { + "attributes": { + "description": "Not applied.", + "last_updated_at": "invalid" + }, + "type": "saved-filters" + } + } + }, + "content_type": "application/json", + "method": "PATCH", + "pagination": false, + "parameters": [ + { + "explode": null, + "in": "path", + "name": "saved_filter_id", + "required": true, + "schema": { + "format": "uuid", + "ref": null, + "type": "string" + }, + "source": { + "type": "literal", + "value": "2cfc7949-7eb4-4d76-b1b8-d1aa9b565535" + }, + "style": null + } + ], + "path": "/api/v2/feature-flags/saved-filters/{saved_filter_id}" + }, + "scenario": "Patch a saved filter rejects an invalid timestamp", + "schema_version": 1, + "version": "v2" +} diff --git a/src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-rejects-empty-targeting-rules.json b/src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-rejects-empty-targeting-rules.json new file mode 100644 index 00000000000..ef8b8f482a6 --- /dev/null +++ b/src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-rejects-empty-targeting-rules.json @@ -0,0 +1,50 @@ +{ + "api": "FeatureFlags", + "expected_status": 400, + "feature": "Feature Flags", + "id": "v2/Feature Flags/Patch a saved filter rejects empty targeting rules", + "operation_id": "UpdateSavedFilterAttributes", + "request": { + "body": { + "schema": { + "format": null, + "ref": "PatchSavedFilterRequest", + "type": "object" + }, + "source": "inline", + "value": { + "data": { + "attributes": { + "targeting_rules": [] + }, + "type": "saved-filters" + } + } + }, + "content_type": "application/json", + "method": "PATCH", + "pagination": false, + "parameters": [ + { + "explode": null, + "in": "path", + "name": "saved_filter_id", + "required": true, + "schema": { + "format": "uuid", + "ref": null, + "type": "string" + }, + "source": { + "type": "literal", + "value": "2cfc7949-7eb4-4d76-b1b8-d1aa9b565535" + }, + "style": null + } + ], + "path": "/api/v2/feature-flags/saved-filters/{saved_filter_id}" + }, + "scenario": "Patch a saved filter rejects empty targeting rules", + "schema_version": 1, + "version": "v2" +} diff --git a/src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-rejects-nested-saved-filters.json b/src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-rejects-nested-saved-filters.json new file mode 100644 index 00000000000..7ef3e35ff95 --- /dev/null +++ b/src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-rejects-nested-saved-filters.json @@ -0,0 +1,63 @@ +{ + "api": "FeatureFlags", + "expected_status": 400, + "feature": "Feature Flags", + "id": "v2/Feature Flags/Patch a saved filter rejects nested saved filters", + "operation_id": "UpdateSavedFilterAttributes", + "request": { + "body": { + "schema": { + "format": null, + "ref": "PatchSavedFilterRequest", + "type": "object" + }, + "source": "inline", + "value": { + "data": { + "attributes": { + "targeting_rules": [ + { + "conditions": [ + { + "attribute": "user_id", + "operator": "ONE_OF", + "saved_filter_id": "d8e3a81b-1505-4600-99c6-c563d01d46b1", + "value": [ + "test-user-1" + ] + } + ] + } + ] + }, + "type": "saved-filters" + } + } + }, + "content_type": "application/json", + "method": "PATCH", + "pagination": false, + "parameters": [ + { + "explode": null, + "in": "path", + "name": "saved_filter_id", + "required": true, + "schema": { + "format": "uuid", + "ref": null, + "type": "string" + }, + "source": { + "type": "literal", + "value": "2cfc7949-7eb4-4d76-b1b8-d1aa9b565535" + }, + "style": null + } + ], + "path": "/api/v2/feature-flags/saved-filters/{saved_filter_id}" + }, + "scenario": "Patch a saved filter rejects nested saved filters", + "schema_version": 1, + "version": "v2" +} diff --git a/src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-rejects-stale-rule-updates.json b/src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-rejects-stale-rule-updates.json new file mode 100644 index 00000000000..a380c92447f --- /dev/null +++ b/src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-rejects-stale-rule-updates.json @@ -0,0 +1,63 @@ +{ + "api": "FeatureFlags", + "expected_status": 409, + "feature": "Feature Flags", + "id": "v2/Feature Flags/Patch a saved filter rejects stale rule updates", + "operation_id": "UpdateSavedFilterAttributes", + "request": { + "body": { + "schema": { + "format": null, + "ref": "PatchSavedFilterRequest", + "type": "object" + }, + "source": "inline", + "value": { + "data": { + "attributes": { + "last_updated_at": "2020-01-01T00:00:00Z", + "targeting_rules": [ + { + "conditions": [ + { + "attribute": "user_id", + "operator": "ONE_OF", + "value": [ + "not-applied" + ] + } + ] + } + ] + }, + "type": "saved-filters" + } + } + }, + "content_type": "application/json", + "method": "PATCH", + "pagination": false, + "parameters": [ + { + "explode": null, + "in": "path", + "name": "saved_filter_id", + "required": true, + "schema": { + "format": "uuid", + "ref": null, + "type": "string" + }, + "source": { + "type": "literal", + "value": "a8c393b4-3a9c-48fd-aa48-402c97e8d9c9" + }, + "style": null + } + ], + "path": "/api/v2/feature-flags/saved-filters/{saved_filter_id}" + }, + "scenario": "Patch a saved filter rejects stale rule updates", + "schema_version": 1, + "version": "v2" +} diff --git a/src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-replaces-rules-and-preserves-metadata.json b/src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-replaces-rules-and-preserves-metadata.json new file mode 100644 index 00000000000..1a273a007c0 --- /dev/null +++ b/src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-replaces-rules-and-preserves-metadata.json @@ -0,0 +1,62 @@ +{ + "api": "FeatureFlags", + "expected_status": 200, + "feature": "Feature Flags", + "id": "v2/Feature Flags/Patch a saved filter replaces rules and preserves metadata", + "operation_id": "UpdateSavedFilterAttributes", + "request": { + "body": { + "schema": { + "format": null, + "ref": "PatchSavedFilterRequest", + "type": "object" + }, + "source": "inline", + "value": { + "data": { + "attributes": { + "targeting_rules": [ + { + "conditions": [ + { + "attribute": "email", + "operator": "ONE_OF", + "value": [ + "test@example.com" + ] + } + ] + } + ] + }, + "type": "saved-filters" + } + } + }, + "content_type": "application/json", + "method": "PATCH", + "pagination": false, + "parameters": [ + { + "explode": null, + "in": "path", + "name": "saved_filter_id", + "required": true, + "schema": { + "format": "uuid", + "ref": null, + "type": "string" + }, + "source": { + "type": "literal", + "value": "2cfc7949-7eb4-4d76-b1b8-d1aa9b565535" + }, + "style": null + } + ], + "path": "/api/v2/feature-flags/saved-filters/{saved_filter_id}" + }, + "scenario": "Patch a saved filter replaces rules and preserves metadata", + "schema_version": 1, + "version": "v2" +} diff --git a/src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-replaces-the-rules-of-a-saved-list.json b/src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-replaces-the-rules-of-a-saved-list.json new file mode 100644 index 00000000000..b8773e586d3 --- /dev/null +++ b/src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-replaces-the-rules-of-a-saved-list.json @@ -0,0 +1,62 @@ +{ + "api": "FeatureFlags", + "expected_status": 200, + "feature": "Feature Flags", + "id": "v2/Feature Flags/Patch a saved filter replaces the rules of a saved list", + "operation_id": "UpdateSavedFilterAttributes", + "request": { + "body": { + "schema": { + "format": null, + "ref": "PatchSavedFilterRequest", + "type": "object" + }, + "source": "inline", + "value": { + "data": { + "attributes": { + "targeting_rules": [ + { + "conditions": [ + { + "attribute": "user_id", + "operator": "ONE_OF", + "value": [ + "test-user-3" + ] + } + ] + } + ] + }, + "type": "saved-filters" + } + } + }, + "content_type": "application/json", + "method": "PATCH", + "pagination": false, + "parameters": [ + { + "explode": null, + "in": "path", + "name": "saved_filter_id", + "required": true, + "schema": { + "format": "uuid", + "ref": null, + "type": "string" + }, + "source": { + "type": "literal", + "value": "d8e3a81b-1505-4600-99c6-c563d01d46b1" + }, + "style": null + } + ], + "path": "/api/v2/feature-flags/saved-filters/{saved_filter_id}" + }, + "scenario": "Patch a saved filter replaces the rules of a saved list", + "schema_version": 1, + "version": "v2" +} diff --git a/src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-returns-bad-request-response.json b/src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-returns-bad-request-response.json new file mode 100644 index 00000000000..65d4bf1c4ea --- /dev/null +++ b/src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-returns-bad-request-response.json @@ -0,0 +1,48 @@ +{ + "api": "FeatureFlags", + "expected_status": 400, + "feature": "Feature Flags", + "id": "v2/Feature Flags/Patch a saved filter returns \"Bad Request\" response", + "operation_id": "UpdateSavedFilterAttributes", + "request": { + "body": { + "schema": { + "format": null, + "ref": "PatchSavedFilterRequest", + "type": "object" + }, + "source": "inline", + "value": { + "data": { + "attributes": {}, + "type": "saved-filters" + } + } + }, + "content_type": "application/json", + "method": "PATCH", + "pagination": false, + "parameters": [ + { + "explode": null, + "in": "path", + "name": "saved_filter_id", + "required": true, + "schema": { + "format": "uuid", + "ref": null, + "type": "string" + }, + "source": { + "type": "literal", + "value": "2cfc7949-7eb4-4d76-b1b8-d1aa9b565535" + }, + "style": null + } + ], + "path": "/api/v2/feature-flags/saved-filters/{saved_filter_id}" + }, + "scenario": "Patch a saved filter returns \"Bad Request\" response", + "schema_version": 1, + "version": "v2" +} diff --git a/src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-returns-conflict-response.json b/src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-returns-conflict-response.json new file mode 100644 index 00000000000..53bf6b445af --- /dev/null +++ b/src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-returns-conflict-response.json @@ -0,0 +1,51 @@ +{ + "api": "FeatureFlags", + "expected_status": 409, + "feature": "Feature Flags", + "id": "v2/Feature Flags/Patch a saved filter returns \"Conflict\" response", + "operation_id": "UpdateSavedFilterAttributes", + "request": { + "body": { + "schema": { + "format": null, + "ref": "PatchSavedFilterRequest", + "type": "object" + }, + "source": "inline", + "value": { + "data": { + "attributes": { + "description": "Not applied.", + "last_updated_at": "2020-01-01T00:00:00Z" + }, + "type": "saved-filters" + } + } + }, + "content_type": "application/json", + "method": "PATCH", + "pagination": false, + "parameters": [ + { + "explode": null, + "in": "path", + "name": "saved_filter_id", + "required": true, + "schema": { + "format": "uuid", + "ref": null, + "type": "string" + }, + "source": { + "type": "literal", + "value": "2cfc7949-7eb4-4d76-b1b8-d1aa9b565535" + }, + "style": null + } + ], + "path": "/api/v2/feature-flags/saved-filters/{saved_filter_id}" + }, + "scenario": "Patch a saved filter returns \"Conflict\" response", + "schema_version": 1, + "version": "v2" +} diff --git a/src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-returns-not-found-response.json b/src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-returns-not-found-response.json new file mode 100644 index 00000000000..09f28850249 --- /dev/null +++ b/src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-returns-not-found-response.json @@ -0,0 +1,50 @@ +{ + "api": "FeatureFlags", + "expected_status": 404, + "feature": "Feature Flags", + "id": "v2/Feature Flags/Patch a saved filter returns \"Not Found\" response", + "operation_id": "UpdateSavedFilterAttributes", + "request": { + "body": { + "schema": { + "format": null, + "ref": "PatchSavedFilterRequest", + "type": "object" + }, + "source": "inline", + "value": { + "data": { + "attributes": { + "description": "Not applied." + }, + "type": "saved-filters" + } + } + }, + "content_type": "application/json", + "method": "PATCH", + "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": "Patch 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/patch-a-saved-filter-returns-ok-response.json b/src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-returns-ok-response.json new file mode 100644 index 00000000000..18540c16ca6 --- /dev/null +++ b/src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-returns-ok-response.json @@ -0,0 +1,50 @@ +{ + "api": "FeatureFlags", + "expected_status": 200, + "feature": "Feature Flags", + "id": "v2/Feature Flags/Patch a saved filter returns \"OK\" response", + "operation_id": "UpdateSavedFilterAttributes", + "request": { + "body": { + "schema": { + "format": null, + "ref": "PatchSavedFilterRequest", + "type": "object" + }, + "source": "inline", + "value": { + "data": { + "attributes": { + "name": "patchSavedFilterTest-renamed-157e7ff3" + }, + "type": "saved-filters" + } + } + }, + "content_type": "application/json", + "method": "PATCH", + "pagination": false, + "parameters": [ + { + "explode": null, + "in": "path", + "name": "saved_filter_id", + "required": true, + "schema": { + "format": "uuid", + "ref": null, + "type": "string" + }, + "source": { + "type": "literal", + "value": "2cfc7949-7eb4-4d76-b1b8-d1aa9b565535" + }, + "style": null + } + ], + "path": "/api/v2/feature-flags/saved-filters/{saved_filter_id}" + }, + "scenario": "Patch a saved filter returns \"OK\" response", + "schema_version": 1, + "version": "v2" +} diff --git a/src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-updates-metadata-and-rules-together.json b/src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-updates-metadata-and-rules-together.json new file mode 100644 index 00000000000..8b52099288c --- /dev/null +++ b/src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-updates-metadata-and-rules-together.json @@ -0,0 +1,64 @@ +{ + "api": "FeatureFlags", + "expected_status": 200, + "feature": "Feature Flags", + "id": "v2/Feature Flags/Patch a saved filter updates metadata and rules together", + "operation_id": "UpdateSavedFilterAttributes", + "request": { + "body": { + "schema": { + "format": null, + "ref": "PatchSavedFilterRequest", + "type": "object" + }, + "source": "inline", + "value": { + "data": { + "attributes": { + "description": "Combined synthetic test update.", + "name": "patchSavedFilterTest-combined-157e7ff3", + "targeting_rules": [ + { + "conditions": [ + { + "attribute": "org_id", + "operator": "ONE_OF", + "value": [ + "test-org-1" + ] + } + ] + } + ] + }, + "type": "saved-filters" + } + } + }, + "content_type": "application/json", + "method": "PATCH", + "pagination": false, + "parameters": [ + { + "explode": null, + "in": "path", + "name": "saved_filter_id", + "required": true, + "schema": { + "format": "uuid", + "ref": null, + "type": "string" + }, + "source": { + "type": "literal", + "value": "2cfc7949-7eb4-4d76-b1b8-d1aa9b565535" + }, + "style": null + } + ], + "path": "/api/v2/feature-flags/saved-filters/{saved_filter_id}" + }, + "scenario": "Patch a saved filter updates metadata and rules together", + "schema_version": 1, + "version": "v2" +} diff --git a/src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-updates-only-the-description-of-a-saved-list.json b/src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-updates-only-the-description-of-a-saved-list.json new file mode 100644 index 00000000000..59308630085 --- /dev/null +++ b/src/test/resources/generated-test/test-runner-data/v2/feature-flags/patch-a-saved-filter-updates-only-the-description-of-a-saved-list.json @@ -0,0 +1,50 @@ +{ + "api": "FeatureFlags", + "expected_status": 200, + "feature": "Feature Flags", + "id": "v2/Feature Flags/Patch a saved filter updates only the description of a saved list", + "operation_id": "UpdateSavedFilterAttributes", + "request": { + "body": { + "schema": { + "format": null, + "ref": "PatchSavedFilterRequest", + "type": "object" + }, + "source": "inline", + "value": { + "data": { + "attributes": { + "description": "Updated synthetic test description." + }, + "type": "saved-filters" + } + } + }, + "content_type": "application/json", + "method": "PATCH", + "pagination": false, + "parameters": [ + { + "explode": null, + "in": "path", + "name": "saved_filter_id", + "required": true, + "schema": { + "format": "uuid", + "ref": null, + "type": "string" + }, + "source": { + "type": "literal", + "value": "d8e3a81b-1505-4600-99c6-c563d01d46b1" + }, + "style": null + } + ], + "path": "/api/v2/feature-flags/saved-filters/{saved_filter_id}" + }, + "scenario": "Patch a saved filter updates only the description of a saved list", + "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 b843e1a2ed9..9f4c6ddb22e 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 @@ -4310,6 +4310,845 @@ "scenario": "List feature flags supports legacy pagination aliases", "version": "v2" }, + { + "feature": "Feature Flags", + "frozen_at": "2026-10-16T20:20:29.850359Z", + "interactions": [ + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "description": "Metadata with current timestamp.", + "last_updated_at": "2026-10-16T20:20:29Z" + }, + "type": "saved-filters" + } + } + }, + "content_type": "application/json", + "method": "PATCH", + "path": "/api/v2/feature-flags/saved-filters/a8c393b4-3a9c-48fd-aa48-402c97e8d9c9", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"a8c393b4-3a9c-48fd-aa48-402c97e8d9c9\",\"type\":\"saved-filters\",\"attributes\":{\"created_at\":\"2026-10-16T20:20:29Z\",\"created_by\":\"550e8400-e29b-41d4-a716-446655440091\",\"creation_type\":\"RULES\",\"description\":\"Metadata with current timestamp.\",\"name\":\"patchSavedFilterTest-concurrency-437ebfe7\",\"targeting_rules\":[{\"id\":\"6574b030-a2c7-4cd4-8adf-b10fa11c6701\",\"conditions\":[{\"id\":\"53bb120f-9a9d-4c05-a500-c89d4a51d1ad\",\"operator\":\"ONE_OF\",\"attribute\":\"user_id\",\"value\":[\"test-user-1\"]}]}],\"updated_at\":\"2026-10-16T20:20:30Z\"}}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + } + ], + "scenario": "Patch a saved filter accepts the current timestamp for metadata", + "version": "v2" + }, + { + "feature": "Feature Flags", + "frozen_at": "2026-10-16T20:20:29.969751Z", + "interactions": [ + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "last_updated_at": "2026-10-16T20:20:30Z", + "targeting_rules": [ + { + "conditions": [ + { + "attribute": "user_id", + "operator": "ONE_OF", + "value": [ + "test-user-2" + ] + } + ] + } + ] + }, + "type": "saved-filters" + } + } + }, + "content_type": "application/json", + "method": "PATCH", + "path": "/api/v2/feature-flags/saved-filters/a8c393b4-3a9c-48fd-aa48-402c97e8d9c9", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"a8c393b4-3a9c-48fd-aa48-402c97e8d9c9\",\"type\":\"saved-filters\",\"attributes\":{\"created_at\":\"2026-10-16T20:20:29Z\",\"created_by\":\"550e8400-e29b-41d4-a716-446655440091\",\"creation_type\":\"RULES\",\"description\":\"Metadata with current timestamp.\",\"name\":\"patchSavedFilterTest-concurrency-437ebfe7\",\"targeting_rules\":[{\"id\":\"efe993b9-2792-443e-838e-509ee7ee5d89\",\"conditions\":[{\"id\":\"23ba234c-a66f-4a34-9678-524d0de9742a\",\"operator\":\"ONE_OF\",\"attribute\":\"user_id\",\"value\":[\"test-user-2\"]}]}],\"updated_at\":\"2026-10-16T20:20:30Z\"}}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + } + ], + "scenario": "Patch a saved filter accepts the current timestamp for rules", + "version": "v2" + }, + { + "feature": "Feature Flags", + "frozen_at": "2026-10-16T20:15:10.461609Z", + "interactions": [ + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "description": "" + }, + "type": "saved-filters" + } + } + }, + "content_type": "application/json", + "method": "PATCH", + "path": "/api/v2/feature-flags/saved-filters/2cfc7949-7eb4-4d76-b1b8-d1aa9b565535", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"2cfc7949-7eb4-4d76-b1b8-d1aa9b565535\",\"type\":\"saved-filters\",\"attributes\":{\"created_at\":\"2026-10-16T20:15:09Z\",\"created_by\":\"550e8400-e29b-41d4-a716-446655440091\",\"creation_type\":\"RULES\",\"description\":\"\",\"name\":\"patchSavedFilterTest-null-157e7ff3\",\"targeting_rules\":[{\"id\":\"666fb698-8e0a-436b-b269-d008c3b5c860\",\"conditions\":[{\"id\":\"fb5218f6-2c90-42f0-ab6d-74d11ab3d1d8\",\"operator\":\"ONE_OF\",\"attribute\":\"org_id\",\"value\":[\"test-org-1\"]}]}],\"updated_at\":\"2026-10-16T20:15:10Z\"}}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + } + ], + "scenario": "Patch a saved filter clears the description with an empty string", + "version": "v2" + }, + { + "feature": "Feature Flags", + "frozen_at": "2026-10-16T20:15:10.283978Z", + "interactions": [ + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "description": null, + "name": "patchSavedFilterTest-null-157e7ff3" + }, + "type": "saved-filters" + } + } + }, + "content_type": "application/json", + "method": "PATCH", + "path": "/api/v2/feature-flags/saved-filters/2cfc7949-7eb4-4d76-b1b8-d1aa9b565535", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"2cfc7949-7eb4-4d76-b1b8-d1aa9b565535\",\"type\":\"saved-filters\",\"attributes\":{\"created_at\":\"2026-10-16T20:15:09Z\",\"created_by\":\"550e8400-e29b-41d4-a716-446655440091\",\"creation_type\":\"RULES\",\"description\":\"Combined synthetic test update.\",\"name\":\"patchSavedFilterTest-null-157e7ff3\",\"targeting_rules\":[{\"id\":\"666fb698-8e0a-436b-b269-d008c3b5c860\",\"conditions\":[{\"id\":\"fb5218f6-2c90-42f0-ab6d-74d11ab3d1d8\",\"operator\":\"ONE_OF\",\"attribute\":\"org_id\",\"value\":[\"test-org-1\"]}]}],\"updated_at\":\"2026-10-16T20:15:10Z\"}}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + } + ], + "scenario": "Patch a saved filter preserves a null description", + "version": "v2" + }, + { + "feature": "Feature Flags", + "frozen_at": "2026-10-16T20:15:11.650679Z", + "interactions": [ + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "name": "patchSavedFilterTest-LIST-157e7ff3" + }, + "type": "saved-filters" + } + } + }, + "content_type": "application/json", + "method": "PATCH", + "path": "/api/v2/feature-flags/saved-filters/2cfc7949-7eb4-4d76-b1b8-d1aa9b565535", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"errors\":[{\"status\":\"409\",\"title\":\"Conflict\",\"detail\":\"a saved filter with this name already exists: conflict occurred\"}]}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "Conflict", + "status": 409 + } + } + ], + "scenario": "Patch a saved filter rejects a duplicate name", + "version": "v2" + }, + { + "feature": "Feature Flags", + "frozen_at": "2026-10-16T20:15:10.737063Z", + "interactions": [ + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "description": null + }, + "type": "saved-filters" + } + } + }, + "content_type": "application/json", + "method": "PATCH", + "path": "/api/v2/feature-flags/saved-filters/2cfc7949-7eb4-4d76-b1b8-d1aa9b565535", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"errors\":[{\"status\":\"400\",\"title\":\"Bad Request\",\"detail\":\"at least one field must be provided\"}]}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "Bad Request", + "status": 400 + } + } + ], + "scenario": "Patch a saved filter rejects a null-only update", + "version": "v2" + }, + { + "feature": "Feature Flags", + "frozen_at": "2026-10-16T20:20:30.337845Z", + "interactions": [ + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "last_updated_at": "2026-10-16T20:20:30Z" + }, + "type": "saved-filters" + } + } + }, + "content_type": "application/json", + "method": "PATCH", + "path": "/api/v2/feature-flags/saved-filters/a8c393b4-3a9c-48fd-aa48-402c97e8d9c9", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"errors\":[{\"status\":\"400\",\"title\":\"Bad Request\",\"detail\":\"at least one field must be provided\"}]}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "Bad Request", + "status": 400 + } + } + ], + "scenario": "Patch a saved filter rejects a timestamp-only update", + "version": "v2" + }, + { + "feature": "Feature Flags", + "frozen_at": "2026-10-16T20:15:10.829934Z", + "interactions": [ + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "name": "" + }, + "type": "saved-filters" + } + } + }, + "content_type": "application/json", + "method": "PATCH", + "path": "/api/v2/feature-flags/saved-filters/2cfc7949-7eb4-4d76-b1b8-d1aa9b565535", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"errors\":[{\"status\":\"400\",\"title\":\"Bad Request\",\"detail\":\"name must not be empty\"}]}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "Bad Request", + "status": 400 + } + } + ], + "scenario": "Patch a saved filter rejects an empty name", + "version": "v2" + }, + { + "feature": "Feature Flags", + "frozen_at": "2026-10-16T20:15:11.185268Z", + "interactions": [ + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "description": "Not applied.", + "last_updated_at": "invalid" + }, + "type": "saved-filters" + } + } + }, + "content_type": "application/json", + "method": "PATCH", + "path": "/api/v2/feature-flags/saved-filters/2cfc7949-7eb4-4d76-b1b8-d1aa9b565535", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"errors\":[{\"status\":\"400\",\"title\":\"Bad Request\",\"detail\":\"last_updated_at must be a valid RFC3339 timestamp\"}]}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "Bad Request", + "status": 400 + } + } + ], + "scenario": "Patch a saved filter rejects an invalid timestamp", + "version": "v2" + }, + { + "feature": "Feature Flags", + "frozen_at": "2026-10-16T20:15:10.983440Z", + "interactions": [ + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "targeting_rules": [] + }, + "type": "saved-filters" + } + } + }, + "content_type": "application/json", + "method": "PATCH", + "path": "/api/v2/feature-flags/saved-filters/2cfc7949-7eb4-4d76-b1b8-d1aa9b565535", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"errors\":[{\"status\":\"400\",\"title\":\"Bad Request\",\"detail\":\"attribute \\\"targeting_rules\\\" failed min validation\"}]}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "Bad Request", + "status": 400 + } + } + ], + "scenario": "Patch a saved filter rejects empty targeting rules", + "version": "v2" + }, + { + "feature": "Feature Flags", + "frozen_at": "2026-10-16T20:15:11.075942Z", + "interactions": [ + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "targeting_rules": [ + { + "conditions": [ + { + "attribute": "user_id", + "operator": "ONE_OF", + "saved_filter_id": "d8e3a81b-1505-4600-99c6-c563d01d46b1", + "value": [ + "test-user-1" + ] + } + ] + } + ] + }, + "type": "saved-filters" + } + } + }, + "content_type": "application/json", + "method": "PATCH", + "path": "/api/v2/feature-flags/saved-filters/2cfc7949-7eb4-4d76-b1b8-d1aa9b565535", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"errors\":[{\"status\":\"400\",\"title\":\"Bad Request\",\"detail\":\"targeting rule 0 condition 0: saved filters cannot reference other saved filters\"}]}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "Bad Request", + "status": 400 + } + } + ], + "scenario": "Patch a saved filter rejects nested saved filters", + "version": "v2" + }, + { + "feature": "Feature Flags", + "frozen_at": "2026-10-16T20:20:30.141351Z", + "interactions": [ + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "last_updated_at": "2020-01-01T00:00:00Z", + "targeting_rules": [ + { + "conditions": [ + { + "attribute": "user_id", + "operator": "ONE_OF", + "value": [ + "not-applied" + ] + } + ] + } + ] + }, + "type": "saved-filters" + } + } + }, + "content_type": "application/json", + "method": "PATCH", + "path": "/api/v2/feature-flags/saved-filters/a8c393b4-3a9c-48fd-aa48-402c97e8d9c9", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"errors\":[{\"status\":\"409\",\"title\":\"Conflict\",\"detail\":\"saved filter has been modified since you last fetched it; please refresh and retry: conflict occurred\"}]}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "Conflict", + "status": 409 + } + } + ], + "scenario": "Patch a saved filter rejects stale rule updates", + "version": "v2" + }, + { + "feature": "Feature Flags", + "frozen_at": "2026-10-16T20:15:09.936504Z", + "interactions": [ + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "targeting_rules": [ + { + "conditions": [ + { + "attribute": "email", + "operator": "ONE_OF", + "value": [ + "test@example.com" + ] + } + ] + } + ] + }, + "type": "saved-filters" + } + } + }, + "content_type": "application/json", + "method": "PATCH", + "path": "/api/v2/feature-flags/saved-filters/2cfc7949-7eb4-4d76-b1b8-d1aa9b565535", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"2cfc7949-7eb4-4d76-b1b8-d1aa9b565535\",\"type\":\"saved-filters\",\"attributes\":{\"created_at\":\"2026-10-16T20:15:09Z\",\"created_by\":\"550e8400-e29b-41d4-a716-446655440091\",\"creation_type\":\"RULES\",\"description\":\"Original synthetic test description.\",\"name\":\"patchSavedFilterTest-renamed-157e7ff3\",\"targeting_rules\":[{\"id\":\"d2477e54-e8d3-4681-a61d-27475a3a15f0\",\"conditions\":[{\"id\":\"70246a9c-a20e-4ec1-b8e8-498338fa2b58\",\"operator\":\"ONE_OF\",\"attribute\":\"email\",\"value\":[\"test@example.com\"]}]}],\"updated_at\":\"2026-10-16T20:15:10Z\"}}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + } + ], + "scenario": "Patch a saved filter replaces rules and preserves metadata", + "version": "v2" + }, + { + "feature": "Feature Flags", + "frozen_at": "2026-10-16T20:15:09.710568Z", + "interactions": [ + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "targeting_rules": [ + { + "conditions": [ + { + "attribute": "user_id", + "operator": "ONE_OF", + "value": [ + "test-user-3" + ] + } + ] + } + ] + }, + "type": "saved-filters" + } + } + }, + "content_type": "application/json", + "method": "PATCH", + "path": "/api/v2/feature-flags/saved-filters/d8e3a81b-1505-4600-99c6-c563d01d46b1", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"d8e3a81b-1505-4600-99c6-c563d01d46b1\",\"type\":\"saved-filters\",\"attributes\":{\"created_at\":\"2026-10-16T20:15:09Z\",\"created_by\":\"550e8400-e29b-41d4-a716-446655440091\",\"creation_type\":\"LIST\",\"description\":\"Updated synthetic test description.\",\"name\":\"patchSavedFilterTest-LIST-157e7ff3\",\"targeting_rules\":[{\"id\":\"1257126b-c18d-49dc-827d-75c72fe023bb\",\"conditions\":[{\"id\":\"9935e8c2-4cd8-44b9-89cd-1b24f2a9442a\",\"operator\":\"ONE_OF\",\"attribute\":\"user_id\",\"value\":[\"test-user-3\"]}]}],\"updated_at\":\"2026-10-16T20:15:09Z\"}}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + } + ], + "scenario": "Patch a saved filter replaces the rules of a saved list", + "version": "v2" + }, + { + "feature": "Feature Flags", + "frozen_at": "2026-10-16T20:15:10.643890Z", + "interactions": [ + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": {}, + "type": "saved-filters" + } + } + }, + "content_type": "application/json", + "method": "PATCH", + "path": "/api/v2/feature-flags/saved-filters/2cfc7949-7eb4-4d76-b1b8-d1aa9b565535", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"errors\":[{\"status\":\"400\",\"title\":\"Bad Request\",\"detail\":\"at least one field must be provided\"}]}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "Bad Request", + "status": 400 + } + } + ], + "scenario": "Patch a saved filter returns \"Bad Request\" response", + "version": "v2" + }, + { + "feature": "Feature Flags", + "frozen_at": "2026-10-16T20:15:11.406641Z", + "interactions": [ + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "description": "Not applied.", + "last_updated_at": "2020-01-01T00:00:00Z" + }, + "type": "saved-filters" + } + } + }, + "content_type": "application/json", + "method": "PATCH", + "path": "/api/v2/feature-flags/saved-filters/2cfc7949-7eb4-4d76-b1b8-d1aa9b565535", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"errors\":[{\"status\":\"409\",\"title\":\"Conflict\",\"detail\":\"saved filter has been modified since you last fetched it; please refresh and retry: conflict occurred\"}]}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "Conflict", + "status": 409 + } + } + ], + "scenario": "Patch a saved filter returns \"Conflict\" response", + "version": "v2" + }, + { + "feature": "Feature Flags", + "frozen_at": "2026-10-16T20:15:11.282379Z", + "interactions": [ + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "description": "Not applied." + }, + "type": "saved-filters" + } + } + }, + "content_type": "application/json", + "method": "PATCH", + "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 or already deleted: record not found\"}]}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "Not Found", + "status": 404 + } + } + ], + "scenario": "Patch a saved filter returns \"Not Found\" response", + "version": "v2" + }, + { + "feature": "Feature Flags", + "frozen_at": "2026-10-16T20:15:09.418909Z", + "interactions": [ + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "name": "patchSavedFilterTest-renamed-157e7ff3" + }, + "type": "saved-filters" + } + } + }, + "content_type": "application/json", + "method": "PATCH", + "path": "/api/v2/feature-flags/saved-filters/2cfc7949-7eb4-4d76-b1b8-d1aa9b565535", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"2cfc7949-7eb4-4d76-b1b8-d1aa9b565535\",\"type\":\"saved-filters\",\"attributes\":{\"created_at\":\"2026-10-16T20:15:09Z\",\"created_by\":\"550e8400-e29b-41d4-a716-446655440091\",\"creation_type\":\"RULES\",\"description\":\"Original synthetic test description.\",\"name\":\"patchSavedFilterTest-renamed-157e7ff3\",\"targeting_rules\":[{\"id\":\"b6cb0903-79ec-42af-bd1c-139a017416d2\",\"conditions\":[{\"id\":\"ba1e08f4-ce3e-420d-9c9e-f0112edd6976\",\"operator\":\"ONE_OF\",\"attribute\":\"user_id\",\"value\":[\"test-user-1\",\"test-user-2\"]}]}],\"updated_at\":\"2026-10-16T20:15:09Z\"}}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + } + ], + "scenario": "Patch a saved filter returns \"OK\" response", + "version": "v2" + }, + { + "feature": "Feature Flags", + "frozen_at": "2026-10-16T20:15:10.111275Z", + "interactions": [ + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "description": "Combined synthetic test update.", + "name": "patchSavedFilterTest-combined-157e7ff3", + "targeting_rules": [ + { + "conditions": [ + { + "attribute": "org_id", + "operator": "ONE_OF", + "value": [ + "test-org-1" + ] + } + ] + } + ] + }, + "type": "saved-filters" + } + } + }, + "content_type": "application/json", + "method": "PATCH", + "path": "/api/v2/feature-flags/saved-filters/2cfc7949-7eb4-4d76-b1b8-d1aa9b565535", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"2cfc7949-7eb4-4d76-b1b8-d1aa9b565535\",\"type\":\"saved-filters\",\"attributes\":{\"created_at\":\"2026-10-16T20:15:09Z\",\"created_by\":\"550e8400-e29b-41d4-a716-446655440091\",\"creation_type\":\"RULES\",\"description\":\"Combined synthetic test update.\",\"name\":\"patchSavedFilterTest-combined-157e7ff3\",\"targeting_rules\":[{\"id\":\"666fb698-8e0a-436b-b269-d008c3b5c860\",\"conditions\":[{\"id\":\"fb5218f6-2c90-42f0-ab6d-74d11ab3d1d8\",\"operator\":\"ONE_OF\",\"attribute\":\"org_id\",\"value\":[\"test-org-1\"]}]}],\"updated_at\":\"2026-10-16T20:15:10Z\"}}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + } + ], + "scenario": "Patch a saved filter updates metadata and rules together", + "version": "v2" + }, + { + "feature": "Feature Flags", + "frozen_at": "2026-10-16T20:15:09.584831Z", + "interactions": [ + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "description": "Updated synthetic test description." + }, + "type": "saved-filters" + } + } + }, + "content_type": "application/json", + "method": "PATCH", + "path": "/api/v2/feature-flags/saved-filters/d8e3a81b-1505-4600-99c6-c563d01d46b1", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"d8e3a81b-1505-4600-99c6-c563d01d46b1\",\"type\":\"saved-filters\",\"attributes\":{\"created_at\":\"2026-10-16T20:15:09Z\",\"created_by\":\"550e8400-e29b-41d4-a716-446655440091\",\"creation_type\":\"LIST\",\"description\":\"Updated synthetic test description.\",\"name\":\"patchSavedFilterTest-LIST-157e7ff3\",\"targeting_rules\":[{\"id\":\"5cf3c126-8342-4187-9d2f-1b04a6cd0d97\",\"conditions\":[{\"id\":\"c4ac8587-d84d-4b1b-8e96-d347aca28f82\",\"operator\":\"ONE_OF\",\"attribute\":\"user_id\",\"value\":[\"test-user-1\",\"test-user-2\"]}]}],\"updated_at\":\"2026-10-16T20:15:09Z\"}}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + } + ], + "scenario": "Patch a saved filter updates only the description of a saved list", + "version": "v2" + }, { "feature": "Feature Flags", "frozen_at": "2026-04-22T20:15:57.687Z",