Skip to content

Commit 0199286

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add filter[owned_by] parameter to GET /api/v2/application_keys (#1720)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 5b2bf13 commit 0199286

3 files changed

Lines changed: 24 additions & 0 deletions

File tree

.generator/schemas/v2/openapi.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,13 @@ components:
161161
schema:
162162
example: "2020-11-24T18:46:21+00:00"
163163
type: string
164+
ApplicationKeyFilterOwnedByParameter:
165+
description: Filter application keys by owner ID.
166+
in: query
167+
name: filter[owned_by]
168+
required: false
169+
schema:
170+
type: string
164171
ApplicationKeyFilterParameter:
165172
description: Filter application keys by the specified string.
166173
in: query
@@ -107769,6 +107776,7 @@ paths:
107769107776
- $ref: "#/components/parameters/ApplicationKeyFilterParameter"
107770107777
- $ref: "#/components/parameters/ApplicationKeyFilterCreatedAtStartParameter"
107771107778
- $ref: "#/components/parameters/ApplicationKeyFilterCreatedAtEndParameter"
107779+
- $ref: "#/components/parameters/ApplicationKeyFilterOwnedByParameter"
107772107780
- $ref: "#/components/parameters/ApplicationKeyIncludeParameter"
107773107781
responses:
107774107782
"200":

src/datadogV2/api/api_key_management.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,8 @@ pub struct ListApplicationKeysOptionalParams {
151151
pub filter_created_at_start: Option<String>,
152152
/// Only include application keys created on or before the specified date.
153153
pub filter_created_at_end: Option<String>,
154+
/// Filter application keys by owner ID.
155+
pub filter_owned_by: Option<String>,
154156
/// Resource path for related resources to include in the response. Only `owned_by` is supported.
155157
pub include: Option<String>,
156158
}
@@ -188,6 +190,11 @@ impl ListApplicationKeysOptionalParams {
188190
self.filter_created_at_end = Some(value);
189191
self
190192
}
193+
/// Filter application keys by owner ID.
194+
pub fn filter_owned_by(mut self, value: String) -> Self {
195+
self.filter_owned_by = Some(value);
196+
self
197+
}
191198
/// Resource path for related resources to include in the response. Only `owned_by` is supported.
192199
pub fn include(mut self, value: String) -> Self {
193200
self.include = Some(value);
@@ -1946,6 +1953,7 @@ impl KeyManagementAPI {
19461953
let filter = params.filter;
19471954
let filter_created_at_start = params.filter_created_at_start;
19481955
let filter_created_at_end = params.filter_created_at_end;
1956+
let filter_owned_by = params.filter_owned_by;
19491957
let include = params.include;
19501958

19511959
let local_client = &self.client;
@@ -1981,6 +1989,10 @@ impl KeyManagementAPI {
19811989
local_req_builder = local_req_builder
19821990
.query(&[("filter[created_at][end]", &local_query_param.to_string())]);
19831991
};
1992+
if let Some(ref local_query_param) = filter_owned_by {
1993+
local_req_builder =
1994+
local_req_builder.query(&[("filter[owned_by]", &local_query_param.to_string())]);
1995+
};
19841996
if let Some(ref local_query_param) = include {
19851997
local_req_builder =
19861998
local_req_builder.query(&[("include", &local_query_param.to_string())]);

tests/scenarios/function_mappings.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18422,6 +18422,9 @@ fn test_v2_list_application_keys(world: &mut DatadogWorld, _parameters: &HashMap
1842218422
let filter_created_at_end = _parameters
1842318423
.get("filter[created_at][end]")
1842418424
.and_then(|param| Some(serde_json::from_value(param.clone()).unwrap()));
18425+
let filter_owned_by = _parameters
18426+
.get("filter[owned_by]")
18427+
.and_then(|param| Some(serde_json::from_value(param.clone()).unwrap()));
1842518428
let include = _parameters
1842618429
.get("include")
1842718430
.and_then(|param| Some(serde_json::from_value(param.clone()).unwrap()));
@@ -18432,6 +18435,7 @@ fn test_v2_list_application_keys(world: &mut DatadogWorld, _parameters: &HashMap
1843218435
params.filter = filter;
1843318436
params.filter_created_at_start = filter_created_at_start;
1843418437
params.filter_created_at_end = filter_created_at_end;
18438+
params.filter_owned_by = filter_owned_by;
1843518439
params.include = include;
1843618440
let response = match block_on(api.list_application_keys_with_http_info(params)) {
1843718441
Ok(response) => response,

0 commit comments

Comments
 (0)