Skip to content

Commit c008c3a

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 740eb90 of spec repo
1 parent d8b087c commit c008c3a

26 files changed

+2873
-0
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 534 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Approve a flag suggestion returns "OK" response
2+
3+
require "datadog_api_client"
4+
api_instance = DatadogAPIClient::V2::FeatureFlagsAPI.new
5+
6+
body = DatadogAPIClient::V2::ReviewFlagSuggestionRequest.new({
7+
data: DatadogAPIClient::V2::ReviewFlagSuggestionData.new({
8+
attributes: DatadogAPIClient::V2::ReviewFlagSuggestionAttributes.new({
9+
comment: "Looks good, approved!",
10+
}),
11+
type: DatadogAPIClient::V2::FlagSuggestionEventDataType::FLAG_SUGGESTION_EVENTS,
12+
}),
13+
})
14+
p api_instance.approve_flag_suggestion("550e8400-e29b-41d4-a716-446655440020", body)
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Create a flag suggestion returns "Created" response
2+
3+
require "datadog_api_client"
4+
api_instance = DatadogAPIClient::V2::FeatureFlagsAPI.new
5+
6+
body = DatadogAPIClient::V2::CreateFlagSuggestionRequest.new({
7+
data: DatadogAPIClient::V2::CreateFlagSuggestionData.new({
8+
attributes: DatadogAPIClient::V2::CreateFlagSuggestionAttributes.new({
9+
action: DatadogAPIClient::V2::FlagSuggestionAction::ARCHIVED,
10+
comment: "Archive this deprecated flag",
11+
environment_id: "550e8400-e29b-41d4-a716-446655440001",
12+
notification_rule_targets: [
13+
"user@example.com",
14+
],
15+
property: DatadogAPIClient::V2::FlagSuggestionProperty::FLAG,
16+
suggestion: "ENABLED",
17+
suggestion_metadata: DatadogAPIClient::V2::SuggestionMetadata.new({
18+
variant_id: "550e8400-e29b-41d4-a716-446655440005",
19+
}),
20+
}),
21+
type: DatadogAPIClient::V2::FlagSuggestionDataType::FLAG_SUGGESTIONS,
22+
}),
23+
})
24+
p api_instance.create_flag_suggestion("550e8400-e29b-41d4-a716-446655440000", body)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Delete a flag suggestion returns "No Content" response
2+
3+
require "datadog_api_client"
4+
api_instance = DatadogAPIClient::V2::FeatureFlagsAPI.new
5+
api_instance.delete_flag_suggestion("550e8400-e29b-41d4-a716-446655440020")
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Get a flag suggestion returns "OK" response
2+
3+
require "datadog_api_client"
4+
api_instance = DatadogAPIClient::V2::FeatureFlagsAPI.new
5+
p api_instance.get_flag_suggestion("550e8400-e29b-41d4-a716-446655440020")
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Reject a flag suggestion returns "OK" response
2+
3+
require "datadog_api_client"
4+
api_instance = DatadogAPIClient::V2::FeatureFlagsAPI.new
5+
6+
body = DatadogAPIClient::V2::ReviewFlagSuggestionRequest.new({
7+
data: DatadogAPIClient::V2::ReviewFlagSuggestionData.new({
8+
attributes: DatadogAPIClient::V2::ReviewFlagSuggestionAttributes.new({
9+
comment: "Looks good, approved!",
10+
}),
11+
type: DatadogAPIClient::V2::FlagSuggestionEventDataType::FLAG_SUGGESTION_EVENTS,
12+
}),
13+
})
14+
p api_instance.reject_flag_suggestion("550e8400-e29b-41d4-a716-446655440020", body)

features/scenarios_model_mapping.rb

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2334,6 +2334,20 @@
23342334
"v2.StopExposureSchedule" => {
23352335
"exposure_schedule_id" => "UUID",
23362336
},
2337+
"v2.DeleteFlagSuggestion" => {
2338+
"suggestion_id" => "UUID",
2339+
},
2340+
"v2.GetFlagSuggestion" => {
2341+
"suggestion_id" => "UUID",
2342+
},
2343+
"v2.ApproveFlagSuggestion" => {
2344+
"suggestion_id" => "UUID",
2345+
"body" => "ReviewFlagSuggestionRequest",
2346+
},
2347+
"v2.RejectFlagSuggestion" => {
2348+
"suggestion_id" => "UUID",
2349+
"body" => "ReviewFlagSuggestionRequest",
2350+
},
23372351
"v2.GetFeatureFlag" => {
23382352
"feature_flag_id" => "UUID",
23392353
},
@@ -2362,6 +2376,10 @@
23622376
"feature_flag_id" => "UUID",
23632377
"environment_id" => "UUID",
23642378
},
2379+
"v2.CreateFlagSuggestion" => {
2380+
"feature_flag_id" => "UUID",
2381+
"body" => "CreateFlagSuggestionRequest",
2382+
},
23652383
"v2.UnarchiveFeatureFlag" => {
23662384
"feature_flag_id" => "UUID",
23672385
},

features/v2/feature_flags.feature

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,30 @@ Feature: Feature Flags
77
And a valid "appKeyAuth" key in the system
88
And an instance of "FeatureFlags" API
99

10+
@generated @skip @team:DataDog/feature-flags
11+
Scenario: Approve a flag suggestion returns "Bad Request" response
12+
Given new "ApproveFlagSuggestion" request
13+
And request contains "suggestion_id" parameter from "REPLACE.ME"
14+
And body with value {"data": {"attributes": {"comment": "Looks good, approved!"}, "type": "flag-suggestion-events"}}
15+
When the request is sent
16+
Then the response status is 400 Bad Request
17+
18+
@generated @skip @team:DataDog/feature-flags
19+
Scenario: Approve a flag suggestion returns "Not Found" response
20+
Given new "ApproveFlagSuggestion" request
21+
And request contains "suggestion_id" parameter from "REPLACE.ME"
22+
And body with value {"data": {"attributes": {"comment": "Looks good, approved!"}, "type": "flag-suggestion-events"}}
23+
When the request is sent
24+
Then the response status is 404 Not Found
25+
26+
@generated @skip @team:DataDog/feature-flags
27+
Scenario: Approve a flag suggestion returns "OK" response
28+
Given new "ApproveFlagSuggestion" request
29+
And request contains "suggestion_id" parameter from "REPLACE.ME"
30+
And body with value {"data": {"attributes": {"comment": "Looks good, approved!"}, "type": "flag-suggestion-events"}}
31+
When the request is sent
32+
Then the response status is 200 OK
33+
1034
@skip @team:DataDog/feature-flags
1135
Scenario: Archive a feature flag returns "Bad Request" response
1236
Given new "ArchiveFeatureFlag" request
@@ -53,6 +77,38 @@ Feature: Feature Flags
5377
And the response "data.attributes.name" is equal to "Test Feature Flag {{ unique }}"
5478
And the response "data.attributes.value_type" is equal to "BOOLEAN"
5579

80+
@generated @skip @team:DataDog/feature-flags
81+
Scenario: Create a flag suggestion returns "Bad Request" response
82+
Given new "CreateFlagSuggestion" request
83+
And request contains "feature_flag_id" parameter from "REPLACE.ME"
84+
And body with value {"data": {"attributes": {"action": "archived", "comment": "Archive this deprecated flag", "environment_id": "550e8400-e29b-41d4-a716-446655440001", "notification_rule_targets": ["user@example.com"], "property": "FLAG", "suggestion": "ENABLED", "suggestion_metadata": {"variant_id": "550e8400-e29b-41d4-a716-446655440005"}}, "type": "flag-suggestions"}}
85+
When the request is sent
86+
Then the response status is 400 Bad Request
87+
88+
@generated @skip @team:DataDog/feature-flags
89+
Scenario: Create a flag suggestion returns "Conflict" response
90+
Given new "CreateFlagSuggestion" request
91+
And request contains "feature_flag_id" parameter from "REPLACE.ME"
92+
And body with value {"data": {"attributes": {"action": "archived", "comment": "Archive this deprecated flag", "environment_id": "550e8400-e29b-41d4-a716-446655440001", "notification_rule_targets": ["user@example.com"], "property": "FLAG", "suggestion": "ENABLED", "suggestion_metadata": {"variant_id": "550e8400-e29b-41d4-a716-446655440005"}}, "type": "flag-suggestions"}}
93+
When the request is sent
94+
Then the response status is 409 Conflict
95+
96+
@generated @skip @team:DataDog/feature-flags
97+
Scenario: Create a flag suggestion returns "Created" response
98+
Given new "CreateFlagSuggestion" request
99+
And request contains "feature_flag_id" parameter from "REPLACE.ME"
100+
And body with value {"data": {"attributes": {"action": "archived", "comment": "Archive this deprecated flag", "environment_id": "550e8400-e29b-41d4-a716-446655440001", "notification_rule_targets": ["user@example.com"], "property": "FLAG", "suggestion": "ENABLED", "suggestion_metadata": {"variant_id": "550e8400-e29b-41d4-a716-446655440005"}}, "type": "flag-suggestions"}}
101+
When the request is sent
102+
Then the response status is 201 Created
103+
104+
@generated @skip @team:DataDog/feature-flags
105+
Scenario: Create a flag suggestion returns "Not Found" response
106+
Given new "CreateFlagSuggestion" request
107+
And request contains "feature_flag_id" parameter from "REPLACE.ME"
108+
And body with value {"data": {"attributes": {"action": "archived", "comment": "Archive this deprecated flag", "environment_id": "550e8400-e29b-41d4-a716-446655440001", "notification_rule_targets": ["user@example.com"], "property": "FLAG", "suggestion": "ENABLED", "suggestion_metadata": {"variant_id": "550e8400-e29b-41d4-a716-446655440005"}}, "type": "flag-suggestions"}}
109+
When the request is sent
110+
Then the response status is 404 Not Found
111+
56112
@team:DataDog/feature-flags
57113
Scenario: Create allocation for a flag in an environment returns "Created" response
58114
Given there is a valid "feature_flag" in the system
@@ -130,6 +186,27 @@ Feature: Feature Flags
130186
When the request is sent
131187
Then the response status is 404 Not Found
132188

189+
@generated @skip @team:DataDog/feature-flags
190+
Scenario: Delete a flag suggestion returns "Bad Request" response
191+
Given new "DeleteFlagSuggestion" request
192+
And request contains "suggestion_id" parameter from "REPLACE.ME"
193+
When the request is sent
194+
Then the response status is 400 Bad Request
195+
196+
@generated @skip @team:DataDog/feature-flags
197+
Scenario: Delete a flag suggestion returns "No Content" response
198+
Given new "DeleteFlagSuggestion" request
199+
And request contains "suggestion_id" parameter from "REPLACE.ME"
200+
When the request is sent
201+
Then the response status is 204 No Content
202+
203+
@generated @skip @team:DataDog/feature-flags
204+
Scenario: Delete a flag suggestion returns "Not Found" response
205+
Given new "DeleteFlagSuggestion" request
206+
And request contains "suggestion_id" parameter from "REPLACE.ME"
207+
When the request is sent
208+
Then the response status is 404 Not Found
209+
133210
@skip @team:DataDog/feature-flags
134211
Scenario: Delete an environment returns "No Content" response
135212
Given there is a valid "environment" in the system
@@ -219,6 +296,27 @@ Feature: Feature Flags
219296
And the response "data.attributes.name" has the same value as "feature_flag.data.attributes.name"
220297
And the response "data.attributes.value_type" has the same value as "feature_flag.data.attributes.value_type"
221298

299+
@generated @skip @team:DataDog/feature-flags
300+
Scenario: Get a flag suggestion returns "Bad Request" response
301+
Given new "GetFlagSuggestion" request
302+
And request contains "suggestion_id" parameter from "REPLACE.ME"
303+
When the request is sent
304+
Then the response status is 400 Bad Request
305+
306+
@generated @skip @team:DataDog/feature-flags
307+
Scenario: Get a flag suggestion returns "Not Found" response
308+
Given new "GetFlagSuggestion" request
309+
And request contains "suggestion_id" parameter from "REPLACE.ME"
310+
When the request is sent
311+
Then the response status is 404 Not Found
312+
313+
@generated @skip @team:DataDog/feature-flags
314+
Scenario: Get a flag suggestion returns "OK" response
315+
Given new "GetFlagSuggestion" request
316+
And request contains "suggestion_id" parameter from "REPLACE.ME"
317+
When the request is sent
318+
Then the response status is 200 OK
319+
222320
@skip @team:DataDog/feature-flags
223321
Scenario: Get an environment returns "Not Found" response
224322
Given new "GetFeatureFlagsEnvironment" request
@@ -274,6 +372,30 @@ Feature: Feature Flags
274372
When the request is sent
275373
Then the response status is 200 OK
276374

375+
@generated @skip @team:DataDog/feature-flags
376+
Scenario: Reject a flag suggestion returns "Bad Request" response
377+
Given new "RejectFlagSuggestion" request
378+
And request contains "suggestion_id" parameter from "REPLACE.ME"
379+
And body with value {"data": {"attributes": {"comment": "Looks good, approved!"}, "type": "flag-suggestion-events"}}
380+
When the request is sent
381+
Then the response status is 400 Bad Request
382+
383+
@generated @skip @team:DataDog/feature-flags
384+
Scenario: Reject a flag suggestion returns "Not Found" response
385+
Given new "RejectFlagSuggestion" request
386+
And request contains "suggestion_id" parameter from "REPLACE.ME"
387+
And body with value {"data": {"attributes": {"comment": "Looks good, approved!"}, "type": "flag-suggestion-events"}}
388+
When the request is sent
389+
Then the response status is 404 Not Found
390+
391+
@generated @skip @team:DataDog/feature-flags
392+
Scenario: Reject a flag suggestion returns "OK" response
393+
Given new "RejectFlagSuggestion" request
394+
And request contains "suggestion_id" parameter from "REPLACE.ME"
395+
And body with value {"data": {"attributes": {"comment": "Looks good, approved!"}, "type": "flag-suggestion-events"}}
396+
When the request is sent
397+
Then the response status is 200 OK
398+
277399
@generated @skip @team:DataDog/feature-flags
278400
Scenario: Resume a progressive rollout returns "Bad Request" response
279401
Given new "ResumeExposureSchedule" request

features/v2/undo.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1954,6 +1954,30 @@
19541954
"type": "idempotent"
19551955
}
19561956
},
1957+
"DeleteFlagSuggestion": {
1958+
"tag": "Feature Flags",
1959+
"undo": {
1960+
"type": "idempotent"
1961+
}
1962+
},
1963+
"GetFlagSuggestion": {
1964+
"tag": "Feature Flags",
1965+
"undo": {
1966+
"type": "safe"
1967+
}
1968+
},
1969+
"ApproveFlagSuggestion": {
1970+
"tag": "Feature Flags",
1971+
"undo": {
1972+
"type": "safe"
1973+
}
1974+
},
1975+
"RejectFlagSuggestion": {
1976+
"tag": "Feature Flags",
1977+
"undo": {
1978+
"type": "safe"
1979+
}
1980+
},
19571981
"GetFeatureFlag": {
19581982
"tag": "Feature Flags",
19591983
"undo": {
@@ -2003,6 +2027,19 @@
20032027
"type": "idempotent"
20042028
}
20052029
},
2030+
"CreateFlagSuggestion": {
2031+
"tag": "Feature Flags",
2032+
"undo": {
2033+
"operationId": "DeleteFlagSuggestion",
2034+
"parameters": [
2035+
{
2036+
"name": "suggestion_id",
2037+
"source": "data.id"
2038+
}
2039+
],
2040+
"type": "unsafe"
2041+
}
2042+
},
20062043
"UnarchiveFeatureFlag": {
20072044
"tag": "Feature Flags",
20082045
"undo": {

lib/datadog_api_client/inflector.rb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2026,6 +2026,9 @@ def overrides
20262026
"v2.create_feature_flag_data" => "CreateFeatureFlagData",
20272027
"v2.create_feature_flag_data_type" => "CreateFeatureFlagDataType",
20282028
"v2.create_feature_flag_request" => "CreateFeatureFlagRequest",
2029+
"v2.create_flag_suggestion_attributes" => "CreateFlagSuggestionAttributes",
2030+
"v2.create_flag_suggestion_data" => "CreateFlagSuggestionData",
2031+
"v2.create_flag_suggestion_request" => "CreateFlagSuggestionRequest",
20292032
"v2.create_incident_notification_rule_request" => "CreateIncidentNotificationRuleRequest",
20302033
"v2.create_incident_notification_template_request" => "CreateIncidentNotificationTemplateRequest",
20312034
"v2.create_jira_issue_request_array" => "CreateJiraIssueRequestArray",
@@ -2700,6 +2703,14 @@ def overrides
27002703
"v2.finding_status" => "FindingStatus",
27012704
"v2.finding_type" => "FindingType",
27022705
"v2.finding_vulnerability_type" => "FindingVulnerabilityType",
2706+
"v2.flag_suggestion" => "FlagSuggestion",
2707+
"v2.flag_suggestion_action" => "FlagSuggestionAction",
2708+
"v2.flag_suggestion_attributes" => "FlagSuggestionAttributes",
2709+
"v2.flag_suggestion_data_type" => "FlagSuggestionDataType",
2710+
"v2.flag_suggestion_event_data_type" => "FlagSuggestionEventDataType",
2711+
"v2.flag_suggestion_property" => "FlagSuggestionProperty",
2712+
"v2.flag_suggestion_response" => "FlagSuggestionResponse",
2713+
"v2.flag_suggestion_status" => "FlagSuggestionStatus",
27032714
"v2.flaky_test" => "FlakyTest",
27042715
"v2.flaky_test_attributes" => "FlakyTestAttributes",
27052716
"v2.flaky_test_attributes_flaky_state" => "FlakyTestAttributesFlakyState",
@@ -4711,6 +4722,9 @@ def overrides
47114722
"v2.revert_custom_rule_revision_request" => "RevertCustomRuleRevisionRequest",
47124723
"v2.revert_custom_rule_revision_request_data" => "RevertCustomRuleRevisionRequestData",
47134724
"v2.revert_custom_rule_revision_request_data_attributes" => "RevertCustomRuleRevisionRequestDataAttributes",
4725+
"v2.review_flag_suggestion_attributes" => "ReviewFlagSuggestionAttributes",
4726+
"v2.review_flag_suggestion_data" => "ReviewFlagSuggestionData",
4727+
"v2.review_flag_suggestion_request" => "ReviewFlagSuggestionRequest",
47144728
"v2.role" => "Role",
47154729
"v2.role_attributes" => "RoleAttributes",
47164730
"v2.role_clone" => "RoleClone",
@@ -5568,6 +5582,7 @@ def overrides
55685582
"v2.step" => "Step",
55695583
"v2.step_display" => "StepDisplay",
55705584
"v2.step_display_bounds" => "StepDisplayBounds",
5585+
"v2.suggestion_metadata" => "SuggestionMetadata",
55715586
"v2.suite_create_edit" => "SuiteCreateEdit",
55725587
"v2.suite_create_edit_request" => "SuiteCreateEditRequest",
55735588
"v2.suite_json_patch_request" => "SuiteJsonPatchRequest",

0 commit comments

Comments
 (0)