Skip to content

Commit a928eda

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add DD_ENV filter to Feature Flags environments API (#1852)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 62afeee commit a928eda

3 files changed

Lines changed: 25 additions & 3 deletions

File tree

.generator/schemas/v2/openapi.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138112,7 +138112,7 @@ paths:
138112138112
get:
138113138113
description: |-
138114138114
Returns a list of environments for the organization.
138115-
Supports filtering by name and key.
138115+
Supports filtering by name, key, and DD_ENV.
138116138116
operationId: ListFeatureFlagsEnvironments
138117138117
parameters:
138118138118
- description: Filter environments by name (partial matching).
@@ -138127,6 +138127,12 @@ paths:
138127138127
name: key
138128138128
schema:
138129138129
type: string
138130+
- description: Filter environments by queries that contain the provided DD_ENV value.
138131+
example: "staging"
138132+
in: query
138133+
name: dd_env
138134+
schema:
138135+
type: string
138130138136
- description: Maximum number of results to return.
138131138137
example: 10
138132138138
in: query

src/datadogV2/api/api_feature_flags.rs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ pub struct ListFeatureFlagsEnvironmentsOptionalParams {
5555
pub name: Option<String>,
5656
/// Filter environments by key (partial matching).
5757
pub key: Option<String>,
58+
/// Filter environments by queries that contain the provided DD_ENV value.
59+
pub dd_env: Option<String>,
5860
/// Maximum number of results to return.
5961
pub limit: Option<i64>,
6062
/// Number of results to skip.
@@ -72,6 +74,11 @@ impl ListFeatureFlagsEnvironmentsOptionalParams {
7274
self.key = Some(value);
7375
self
7476
}
77+
/// Filter environments by queries that contain the provided DD_ENV value.
78+
pub fn dd_env(mut self, value: String) -> Self {
79+
self.dd_env = Some(value);
80+
self
81+
}
7582
/// Maximum number of results to return.
7683
pub fn limit(mut self, value: i64) -> Self {
7784
self.limit = Some(value);
@@ -1829,7 +1836,7 @@ impl FeatureFlagsAPI {
18291836
}
18301837

18311838
/// Returns a list of environments for the organization.
1832-
/// Supports filtering by name and key.
1839+
/// Supports filtering by name, key, and DD_ENV.
18331840
pub async fn list_feature_flags_environments(
18341841
&self,
18351842
params: ListFeatureFlagsEnvironmentsOptionalParams,
@@ -1855,7 +1862,7 @@ impl FeatureFlagsAPI {
18551862
}
18561863

18571864
/// Returns a list of environments for the organization.
1858-
/// Supports filtering by name and key.
1865+
/// Supports filtering by name, key, and DD_ENV.
18591866
pub async fn list_feature_flags_environments_with_http_info(
18601867
&self,
18611868
params: ListFeatureFlagsEnvironmentsOptionalParams,
@@ -1869,6 +1876,7 @@ impl FeatureFlagsAPI {
18691876
// unbox and build optional parameters
18701877
let name = params.name;
18711878
let key = params.key;
1879+
let dd_env = params.dd_env;
18721880
let limit = params.limit;
18731881
let offset = params.offset;
18741882

@@ -1888,6 +1896,10 @@ impl FeatureFlagsAPI {
18881896
if let Some(ref local_query_param) = key {
18891897
local_req_builder = local_req_builder.query(&[("key", &local_query_param.to_string())]);
18901898
};
1899+
if let Some(ref local_query_param) = dd_env {
1900+
local_req_builder =
1901+
local_req_builder.query(&[("dd_env", &local_query_param.to_string())]);
1902+
};
18911903
if let Some(ref local_query_param) = limit {
18921904
local_req_builder =
18931905
local_req_builder.query(&[("limit", &local_query_param.to_string())]);

tests/scenarios/function_mappings.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36800,6 +36800,9 @@ fn test_v2_list_feature_flags_environments(
3680036800
let key = _parameters
3680136801
.get("key")
3680236802
.and_then(|param| Some(serde_json::from_value(param.clone()).unwrap()));
36803+
let dd_env = _parameters
36804+
.get("dd_env")
36805+
.and_then(|param| Some(serde_json::from_value(param.clone()).unwrap()));
3680336806
let limit = _parameters
3680436807
.get("limit")
3680536808
.and_then(|param| Some(serde_json::from_value(param.clone()).unwrap()));
@@ -36810,6 +36813,7 @@ fn test_v2_list_feature_flags_environments(
3681036813
datadogV2::api_feature_flags::ListFeatureFlagsEnvironmentsOptionalParams::default();
3681136814
params.name = name;
3681236815
params.key = key;
36816+
params.dd_env = dd_env;
3681336817
params.limit = limit;
3681436818
params.offset = offset;
3681536819
let response = match block_on(api.list_feature_flags_environments_with_http_info(params)) {

0 commit comments

Comments
 (0)