Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update public document with configuration event type #2026

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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2025-01-30 13:13:49.060132",
"spec_repo_commit": "833109b8"
"regenerated": "2025-01-31 15:03:07.790966",
"spec_repo_commit": "b01f90f4"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2025-01-30 13:13:49.075985",
"spec_repo_commit": "833109b8"
"regenerated": "2025-01-31 15:03:07.806862",
"spec_repo_commit": "b01f90f4"
}
}
}
9 changes: 5 additions & 4 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5363,8 +5363,7 @@ components:
- USER
- SYSTEM
ChangeEventCustomAttributesChangedResource:
description: Object representing a uniquely identified resource. Only the resource
type `feature_flag` is supported.
description: Object representing a uniquely identified resource.
properties:
name:
description: Resource's name.
Expand All @@ -5380,10 +5379,12 @@ components:
description: Resource's type.
enum:
- feature_flag
- configuration
example: feature_flag
type: string
x-enum-varnames:
- FEATURE_FLAG
- CONFIGURATION
ChangeEventCustomAttributesImpactedResourcesItems:
description: Object representing a uniquely identified resource. Only the resource
type `service` is supported.
Expand Down Expand Up @@ -11239,7 +11240,7 @@ components:

Refer to [Tags docs](https://docs.datadoghq.com/getting_started/tagging/).'
example:
- environment:test
- env:test
items:
description: A tag.
type: string
Expand Down Expand Up @@ -35963,7 +35964,7 @@ paths:
category: change
message: payment_processed feature flag has been enabled
tags:
- environment:test
- env:test
title: payment_processed feature flag updated
type: event
schema:
Expand Down
2 changes: 1 addition & 1 deletion examples/v2/events/CreateEvent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const params: v2.EventsApiCreateEventRequest = {
},
category: "change",
message: "payment_processed feature flag has been enabled",
tags: ["environment:test"],
tags: ["env:test"],
title: "payment_processed feature flag updated",
},
type: "event",
Expand Down
4 changes: 2 additions & 2 deletions features/v2/events.feature
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@ Feature: Events
@generated @skip @team:DataDog/event-management
Scenario: Post an event returns "Bad request" response
Given new "CreateEvent" request
And body with value {"data": {"attributes": {"attributes": {"author": {"name": "[email protected]", "type": "user"}, "change_metadata": {"dd": {"team": "datadog_team", "user_email": "[email protected]", "user_id": "datadog_user_id", "user_name": "datadog_username"}, "resource_link": "datadog.com/feature/fallback_payments_test"}, "changed_resource": {"name": "fallback_payments_test", "type": "feature_flag"}, "impacted_resources": [{"name": "payments_api", "type": "service"}], "new_value": {"enabled": true, "percentage": "50%", "rule": {"datacenter": "devcycle.us1.prod"}}, "prev_value": {"enabled": true, "percentage": "10%", "rule": {"datacenter": "devcycle.us1.prod"}}}, "category": "change", "message": "payment_processed feature flag has been enabled", "tags": ["environment:test"], "title": "payment_processed feature flag updated"}, "type": "event"}}
And body with value {"data": {"attributes": {"attributes": {"author": {"name": "[email protected]", "type": "user"}, "change_metadata": {"dd": {"team": "datadog_team", "user_email": "[email protected]", "user_id": "datadog_user_id", "user_name": "datadog_username"}, "resource_link": "datadog.com/feature/fallback_payments_test"}, "changed_resource": {"name": "fallback_payments_test", "type": "feature_flag"}, "impacted_resources": [{"name": "payments_api", "type": "service"}], "new_value": {"enabled": true, "percentage": "50%", "rule": {"datacenter": "devcycle.us1.prod"}}, "prev_value": {"enabled": true, "percentage": "10%", "rule": {"datacenter": "devcycle.us1.prod"}}}, "category": "change", "message": "payment_processed feature flag has been enabled", "tags": ["env:test"], "title": "payment_processed feature flag updated"}, "type": "event"}}
When the request is sent
Then the response status is 400 Bad request

@generated @skip @team:DataDog/event-management
Scenario: Post an event returns "OK" response
Given new "CreateEvent" request
And body with value {"data": {"attributes": {"attributes": {"author": {"name": "[email protected]", "type": "user"}, "change_metadata": {"dd": {"team": "datadog_team", "user_email": "[email protected]", "user_id": "datadog_user_id", "user_name": "datadog_username"}, "resource_link": "datadog.com/feature/fallback_payments_test"}, "changed_resource": {"name": "fallback_payments_test", "type": "feature_flag"}, "impacted_resources": [{"name": "payments_api", "type": "service"}], "new_value": {"enabled": true, "percentage": "50%", "rule": {"datacenter": "devcycle.us1.prod"}}, "prev_value": {"enabled": true, "percentage": "10%", "rule": {"datacenter": "devcycle.us1.prod"}}}, "category": "change", "message": "payment_processed feature flag has been enabled", "tags": ["environment:test"], "title": "payment_processed feature flag updated"}, "type": "event"}}
And body with value {"data": {"attributes": {"attributes": {"author": {"name": "[email protected]", "type": "user"}, "change_metadata": {"dd": {"team": "datadog_team", "user_email": "[email protected]", "user_id": "datadog_user_id", "user_name": "datadog_username"}, "resource_link": "datadog.com/feature/fallback_payments_test"}, "changed_resource": {"name": "fallback_payments_test", "type": "feature_flag"}, "impacted_resources": [{"name": "payments_api", "type": "service"}], "new_value": {"enabled": true, "percentage": "50%", "rule": {"datacenter": "devcycle.us1.prod"}}, "prev_value": {"enabled": true, "percentage": "10%", "rule": {"datacenter": "devcycle.us1.prod"}}}, "category": "change", "message": "payment_processed feature flag has been enabled", "tags": ["env:test"], "title": "payment_processed feature flag updated"}, "type": "event"}}
When the request is sent
Then the response status is 200 OK

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export class ChangeEventCustomAttributes {
*/
"changeMetadata"?: { [key: string]: any };
/**
* Object representing a uniquely identified resource. Only the resource type `feature_flag` is supported.
* Object representing a uniquely identified resource.
*/
"changedResource": ChangeEventCustomAttributesChangedResource;
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { ChangeEventCustomAttributesChangedResourceType } from "./ChangeEventCus
import { AttributeTypeMap } from "../../datadog-api-client-common/util";

/**
* Object representing a uniquely identified resource. Only the resource type `feature_flag` is supported.
* Object representing a uniquely identified resource.
*/
export class ChangeEventCustomAttributesChangedResource {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,7 @@ import { UnparsedObject } from "../../datadog-api-client-common/util";

export type ChangeEventCustomAttributesChangedResourceType =
| typeof FEATURE_FLAG
| typeof CONFIGURATION
| UnparsedObject;
export const FEATURE_FLAG = "feature_flag";
export const CONFIGURATION = "configuration";
5 changes: 4 additions & 1 deletion packages/datadog-api-client-v2/models/ObjectSerializer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1666,7 +1666,10 @@ const enumsMap: { [key: string]: any[] } = {
CaseStatus: ["OPEN", "IN_PROGRESS", "CLOSED"],
CaseType: ["STANDARD"],
ChangeEventCustomAttributesAuthorType: ["user", "system"],
ChangeEventCustomAttributesChangedResourceType: ["feature_flag"],
ChangeEventCustomAttributesChangedResourceType: [
"feature_flag",
"configuration",
],
ChangeEventCustomAttributesImpactedResourcesItemsType: ["service"],
CloudConfigurationRuleType: ["cloud_configuration"],
CloudWorkloadSecurityAgentRuleType: ["agent_rule"],
Expand Down