Skip to content
Open
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
534 changes: 534 additions & 0 deletions .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

29 changes: 29 additions & 0 deletions examples/v2/feature-flags/ApproveFlagSuggestion.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/**
* Approve a flag suggestion returns "OK" response
*/

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
const apiInstance = new v2.FeatureFlagsApi(configuration);

const params: v2.FeatureFlagsApiApproveFlagSuggestionRequest = {
body: {
data: {
attributes: {
comment: "Looks good, approved!",
},
type: "flag-suggestion-events",
},
},
suggestionId: "550e8400-e29b-41d4-a716-446655440020",
};

apiInstance
.approveFlagSuggestion(params)
.then((data: v2.FlagSuggestionResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
37 changes: 37 additions & 0 deletions examples/v2/feature-flags/CreateFlagSuggestion.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/**
* Create a flag suggestion returns "Created" response
*/

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
const apiInstance = new v2.FeatureFlagsApi(configuration);

const params: v2.FeatureFlagsApiCreateFlagSuggestionRequest = {
body: {
data: {
attributes: {
action: "archived",
comment: "Archive this deprecated flag",
environmentId: "550e8400-e29b-41d4-a716-446655440001",
notificationRuleTargets: ["user@example.com"],
property: "FLAG",
suggestion: "ENABLED",
suggestionMetadata: {
variantId: "550e8400-e29b-41d4-a716-446655440005",
},
},
type: "flag-suggestions",
},
},
featureFlagId: "550e8400-e29b-41d4-a716-446655440000",
};

apiInstance
.createFlagSuggestion(params)
.then((data: v2.FlagSuggestionResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
21 changes: 21 additions & 0 deletions examples/v2/feature-flags/DeleteFlagSuggestion.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/**
* Delete a flag suggestion returns "No Content" response
*/

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
const apiInstance = new v2.FeatureFlagsApi(configuration);

const params: v2.FeatureFlagsApiDeleteFlagSuggestionRequest = {
suggestionId: "550e8400-e29b-41d4-a716-446655440020",
};

apiInstance
.deleteFlagSuggestion(params)
.then((data: any) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
21 changes: 21 additions & 0 deletions examples/v2/feature-flags/GetFlagSuggestion.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/**
* Get a flag suggestion returns "OK" response
*/

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
const apiInstance = new v2.FeatureFlagsApi(configuration);

const params: v2.FeatureFlagsApiGetFlagSuggestionRequest = {
suggestionId: "550e8400-e29b-41d4-a716-446655440020",
};

apiInstance
.getFlagSuggestion(params)
.then((data: v2.FlagSuggestionResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
29 changes: 29 additions & 0 deletions examples/v2/feature-flags/RejectFlagSuggestion.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/**
* Reject a flag suggestion returns "OK" response
*/

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
const apiInstance = new v2.FeatureFlagsApi(configuration);

const params: v2.FeatureFlagsApiRejectFlagSuggestionRequest = {
body: {
data: {
attributes: {
comment: "Looks good, approved!",
},
type: "flag-suggestion-events",
},
},
suggestionId: "550e8400-e29b-41d4-a716-446655440020",
};

apiInstance
.rejectFlagSuggestion(params)
.then((data: v2.FlagSuggestionResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
47 changes: 47 additions & 0 deletions features/support/scenarios_model_mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6611,6 +6611,42 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = {
},
"operationResponseType": "AllocationExposureScheduleResponse",
},
"v2.GetFlagSuggestion": {
"suggestionId": {
"type": "string",
"format": "uuid",
},
"operationResponseType": "FlagSuggestionResponse",
},
"v2.DeleteFlagSuggestion": {
"suggestionId": {
"type": "string",
"format": "uuid",
},
"operationResponseType": "{}",
},
"v2.ApproveFlagSuggestion": {
"suggestionId": {
"type": "string",
"format": "uuid",
},
"body": {
"type": "ReviewFlagSuggestionRequest",
"format": "",
},
"operationResponseType": "FlagSuggestionResponse",
},
"v2.RejectFlagSuggestion": {
"suggestionId": {
"type": "string",
"format": "uuid",
},
"body": {
"type": "ReviewFlagSuggestionRequest",
"format": "",
},
"operationResponseType": "FlagSuggestionResponse",
},
"v2.GetFeatureFlag": {
"featureFlagId": {
"type": "string",
Expand Down Expand Up @@ -6688,6 +6724,17 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = {
},
"operationResponseType": "{}",
},
"v2.CreateFlagSuggestion": {
"featureFlagId": {
"type": "string",
"format": "uuid",
},
"body": {
"type": "CreateFlagSuggestionRequest",
"format": "",
},
"operationResponseType": "FlagSuggestionResponse",
},
"v2.UnarchiveFeatureFlag": {
"featureFlagId": {
"type": "string",
Expand Down
122 changes: 122 additions & 0 deletions features/v2/feature_flags.feature
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,30 @@ Feature: Feature Flags
And a valid "appKeyAuth" key in the system
And an instance of "FeatureFlags" API

@generated @skip @team:DataDog/feature-flags
Scenario: Approve a flag suggestion returns "Bad Request" response
Given new "ApproveFlagSuggestion" request
And request contains "suggestion_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"comment": "Looks good, approved!"}, "type": "flag-suggestion-events"}}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/feature-flags
Scenario: Approve a flag suggestion returns "Not Found" response
Given new "ApproveFlagSuggestion" request
And request contains "suggestion_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"comment": "Looks good, approved!"}, "type": "flag-suggestion-events"}}
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/feature-flags
Scenario: Approve a flag suggestion returns "OK" response
Given new "ApproveFlagSuggestion" request
And request contains "suggestion_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"comment": "Looks good, approved!"}, "type": "flag-suggestion-events"}}
When the request is sent
Then the response status is 200 OK

@skip @team:DataDog/feature-flags
Scenario: Archive a feature flag returns "Bad Request" response
Given new "ArchiveFeatureFlag" request
Expand Down Expand Up @@ -53,6 +77,38 @@ Feature: Feature Flags
And the response "data.attributes.name" is equal to "Test Feature Flag {{ unique }}"
And the response "data.attributes.value_type" is equal to "BOOLEAN"

@generated @skip @team:DataDog/feature-flags
Scenario: Create a flag suggestion returns "Bad Request" response
Given new "CreateFlagSuggestion" request
And request contains "feature_flag_id" parameter from "REPLACE.ME"
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"}}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/feature-flags
Scenario: Create a flag suggestion returns "Conflict" response
Given new "CreateFlagSuggestion" request
And request contains "feature_flag_id" parameter from "REPLACE.ME"
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"}}
When the request is sent
Then the response status is 409 Conflict

@generated @skip @team:DataDog/feature-flags
Scenario: Create a flag suggestion returns "Created" response
Given new "CreateFlagSuggestion" request
And request contains "feature_flag_id" parameter from "REPLACE.ME"
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"}}
When the request is sent
Then the response status is 201 Created

@generated @skip @team:DataDog/feature-flags
Scenario: Create a flag suggestion returns "Not Found" response
Given new "CreateFlagSuggestion" request
And request contains "feature_flag_id" parameter from "REPLACE.ME"
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"}}
When the request is sent
Then the response status is 404 Not Found

@team:DataDog/feature-flags
Scenario: Create allocation for a flag in an environment returns "Created" response
Given there is a valid "feature_flag" in the system
Expand Down Expand Up @@ -130,6 +186,27 @@ Feature: Feature Flags
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/feature-flags
Scenario: Delete a flag suggestion returns "Bad Request" response
Given new "DeleteFlagSuggestion" request
And request contains "suggestion_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/feature-flags
Scenario: Delete a flag suggestion returns "No Content" response
Given new "DeleteFlagSuggestion" request
And request contains "suggestion_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 204 No Content

@generated @skip @team:DataDog/feature-flags
Scenario: Delete a flag suggestion returns "Not Found" response
Given new "DeleteFlagSuggestion" request
And request contains "suggestion_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not Found

@skip @team:DataDog/feature-flags
Scenario: Delete an environment returns "No Content" response
Given there is a valid "environment" in the system
Expand Down Expand Up @@ -219,6 +296,27 @@ Feature: Feature Flags
And the response "data.attributes.name" has the same value as "feature_flag.data.attributes.name"
And the response "data.attributes.value_type" has the same value as "feature_flag.data.attributes.value_type"

@generated @skip @team:DataDog/feature-flags
Scenario: Get a flag suggestion returns "Bad Request" response
Given new "GetFlagSuggestion" request
And request contains "suggestion_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/feature-flags
Scenario: Get a flag suggestion returns "Not Found" response
Given new "GetFlagSuggestion" request
And request contains "suggestion_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/feature-flags
Scenario: Get a flag suggestion returns "OK" response
Given new "GetFlagSuggestion" request
And request contains "suggestion_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 200 OK

@skip @team:DataDog/feature-flags
Scenario: Get an environment returns "Not Found" response
Given new "GetFeatureFlagsEnvironment" request
Expand Down Expand Up @@ -274,6 +372,30 @@ Feature: Feature Flags
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/feature-flags
Scenario: Reject a flag suggestion returns "Bad Request" response
Given new "RejectFlagSuggestion" request
And request contains "suggestion_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"comment": "Looks good, approved!"}, "type": "flag-suggestion-events"}}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/feature-flags
Scenario: Reject a flag suggestion returns "Not Found" response
Given new "RejectFlagSuggestion" request
And request contains "suggestion_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"comment": "Looks good, approved!"}, "type": "flag-suggestion-events"}}
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/feature-flags
Scenario: Reject a flag suggestion returns "OK" response
Given new "RejectFlagSuggestion" request
And request contains "suggestion_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"comment": "Looks good, approved!"}, "type": "flag-suggestion-events"}}
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/feature-flags
Scenario: Resume a progressive rollout returns "Bad Request" response
Given new "ResumeExposureSchedule" request
Expand Down
Loading
Loading