Skip to content

Commit b05985d

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 8515256 of spec repo
1 parent 57fb487 commit b05985d

27 files changed

+2567
-30
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 537 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/**
2+
* Approve a flag suggestion returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
const apiInstance = new v2.FeatureFlagsApi(configuration);
9+
10+
const params: v2.FeatureFlagsApiApproveFlagSuggestionRequest = {
11+
body: {
12+
data: {
13+
attributes: {
14+
comment: "Looks good, approved!",
15+
},
16+
type: "flag-suggestion-events",
17+
},
18+
},
19+
suggestionId: "550e8400-e29b-41d4-a716-446655440020",
20+
};
21+
22+
apiInstance
23+
.approveFlagSuggestion(params)
24+
.then((data: v2.FlagSuggestionResponse) => {
25+
console.log(
26+
"API called successfully. Returned data: " + JSON.stringify(data)
27+
);
28+
})
29+
.catch((error: any) => console.error(error));
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/**
2+
* Create a flag suggestion returns "Created" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
const apiInstance = new v2.FeatureFlagsApi(configuration);
9+
10+
const params: v2.FeatureFlagsApiCreateFlagSuggestionRequest = {
11+
body: {
12+
data: {
13+
attributes: {
14+
action: "archived",
15+
comment: "Archive this deprecated flag",
16+
environmentId: "550e8400-e29b-41d4-a716-446655440001",
17+
notificationRuleTargets: ["user@example.com"],
18+
property: "FLAG",
19+
suggestion: "ENABLED",
20+
suggestionMetadata: {
21+
variantId: "550e8400-e29b-41d4-a716-446655440005",
22+
},
23+
},
24+
type: "flag-suggestions",
25+
},
26+
},
27+
featureFlagId: "550e8400-e29b-41d4-a716-446655440000",
28+
};
29+
30+
apiInstance
31+
.createFlagSuggestion(params)
32+
.then((data: v2.FlagSuggestionResponse) => {
33+
console.log(
34+
"API called successfully. Returned data: " + JSON.stringify(data)
35+
);
36+
})
37+
.catch((error: any) => console.error(error));
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/**
2+
* Delete a flag suggestion returns "No Content" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
const apiInstance = new v2.FeatureFlagsApi(configuration);
9+
10+
const params: v2.FeatureFlagsApiDeleteFlagSuggestionRequest = {
11+
suggestionId: "550e8400-e29b-41d4-a716-446655440020",
12+
};
13+
14+
apiInstance
15+
.deleteFlagSuggestion(params)
16+
.then((data: any) => {
17+
console.log(
18+
"API called successfully. Returned data: " + JSON.stringify(data)
19+
);
20+
})
21+
.catch((error: any) => console.error(error));
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/**
2+
* Get a flag suggestion returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
const apiInstance = new v2.FeatureFlagsApi(configuration);
9+
10+
const params: v2.FeatureFlagsApiGetFlagSuggestionRequest = {
11+
suggestionId: "550e8400-e29b-41d4-a716-446655440020",
12+
};
13+
14+
apiInstance
15+
.getFlagSuggestion(params)
16+
.then((data: v2.FlagSuggestionResponse) => {
17+
console.log(
18+
"API called successfully. Returned data: " + JSON.stringify(data)
19+
);
20+
})
21+
.catch((error: any) => console.error(error));
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/**
2+
* Reject a flag suggestion returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
const apiInstance = new v2.FeatureFlagsApi(configuration);
9+
10+
const params: v2.FeatureFlagsApiRejectFlagSuggestionRequest = {
11+
body: {
12+
data: {
13+
attributes: {
14+
comment: "Looks good, approved!",
15+
},
16+
type: "flag-suggestion-events",
17+
},
18+
},
19+
suggestionId: "550e8400-e29b-41d4-a716-446655440020",
20+
};
21+
22+
apiInstance
23+
.rejectFlagSuggestion(params)
24+
.then((data: v2.FlagSuggestionResponse) => {
25+
console.log(
26+
"API called successfully. Returned data: " + JSON.stringify(data)
27+
);
28+
})
29+
.catch((error: any) => console.error(error));

features/support/scenarios_model_mapping.ts

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6578,6 +6578,42 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = {
65786578
},
65796579
"operationResponseType": "AllocationExposureScheduleResponse",
65806580
},
6581+
"v2.GetFlagSuggestion": {
6582+
"suggestionId": {
6583+
"type": "string",
6584+
"format": "uuid",
6585+
},
6586+
"operationResponseType": "FlagSuggestionResponse",
6587+
},
6588+
"v2.DeleteFlagSuggestion": {
6589+
"suggestionId": {
6590+
"type": "string",
6591+
"format": "uuid",
6592+
},
6593+
"operationResponseType": "{}",
6594+
},
6595+
"v2.ApproveFlagSuggestion": {
6596+
"suggestionId": {
6597+
"type": "string",
6598+
"format": "uuid",
6599+
},
6600+
"body": {
6601+
"type": "ReviewFlagSuggestionRequest",
6602+
"format": "",
6603+
},
6604+
"operationResponseType": "FlagSuggestionResponse",
6605+
},
6606+
"v2.RejectFlagSuggestion": {
6607+
"suggestionId": {
6608+
"type": "string",
6609+
"format": "uuid",
6610+
},
6611+
"body": {
6612+
"type": "ReviewFlagSuggestionRequest",
6613+
"format": "",
6614+
},
6615+
"operationResponseType": "FlagSuggestionResponse",
6616+
},
65816617
"v2.GetFeatureFlag": {
65826618
"featureFlagId": {
65836619
"type": "string",
@@ -6655,6 +6691,17 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = {
66556691
},
66566692
"operationResponseType": "{}",
66576693
},
6694+
"v2.CreateFlagSuggestion": {
6695+
"featureFlagId": {
6696+
"type": "string",
6697+
"format": "uuid",
6698+
},
6699+
"body": {
6700+
"type": "CreateFlagSuggestionRequest",
6701+
"format": "",
6702+
},
6703+
"operationResponseType": "FlagSuggestionResponse",
6704+
},
66586705
"v2.UnarchiveFeatureFlag": {
66596706
"featureFlagId": {
66606707
"type": "string",

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

0 commit comments

Comments
 (0)