Skip to content

Commit d8a5561

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 786a1731 of spec repo
1 parent 92d1f44 commit d8a5561

File tree

5 files changed

+73
-4
lines changed

5 files changed

+73
-4
lines changed

.apigentools-info

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2024-07-17 14:52:58.304214",
8-
"spec_repo_commit": "3bf67773"
7+
"regenerated": "2024-07-17 20:47:08.312689",
8+
"spec_repo_commit": "786a1731"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-07-17 14:52:58.321936",
13-
"spec_repo_commit": "3bf67773"
12+
"regenerated": "2024-07-17 20:47:08.331224",
13+
"spec_repo_commit": "786a1731"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

+15
Original file line numberDiff line numberDiff line change
@@ -8741,6 +8741,12 @@ components:
87418741
description: Attributes of hourly usage for a product family for an org for
87428742
a time period.
87438743
properties:
8744+
account_name:
8745+
description: The account name.
8746+
type: string
8747+
account_public_id:
8748+
description: The account public ID.
8749+
type: string
87448750
measurements:
87458751
description: List of the measured usage values for the product family for
87468752
the org for the time period.
@@ -36770,6 +36776,15 @@ paths:
3677036776
schema:
3677136777
default: false
3677236778
type: boolean
36779+
- description: Boolean to specify whether to include accounts connected to the
36780+
current account as partner customers in the Datadog partner network program.
36781+
Defaults to false.
36782+
in: query
36783+
name: filter[include_connected_accounts]
36784+
required: false
36785+
schema:
36786+
default: false
36787+
type: boolean
3677336788
- description: Include breakdown of usage by subcategories where applicable
3677436789
(for product family logs only). Defaults to false.
3677536790
in: query

src/datadogV2/api/api_usage_metering.rs

+14
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ pub struct GetHourlyUsageOptionalParams {
104104
pub filter_timestamp_end: Option<chrono::DateTime<chrono::Utc>>,
105105
/// Include child org usage in the response. Defaults to false.
106106
pub filter_include_descendants: Option<bool>,
107+
/// Boolean to specify whether to include accounts connected to the current account as partner customers in the Datadog partner network program. Defaults to false.
108+
pub filter_include_connected_accounts: Option<bool>,
107109
/// Include breakdown of usage by subcategories where applicable (for product family logs only). Defaults to false.
108110
pub filter_include_breakdown: Option<bool>,
109111
/// Comma separated list of product family versions to use in the format `product_family:version`. For example,
@@ -127,6 +129,11 @@ impl GetHourlyUsageOptionalParams {
127129
self.filter_include_descendants = Some(value);
128130
self
129131
}
132+
/// Boolean to specify whether to include accounts connected to the current account as partner customers in the Datadog partner network program. Defaults to false.
133+
pub fn filter_include_connected_accounts(mut self, value: bool) -> Self {
134+
self.filter_include_connected_accounts = Some(value);
135+
self
136+
}
130137
/// Include breakdown of usage by subcategories where applicable (for product family logs only). Defaults to false.
131138
pub fn filter_include_breakdown(mut self, value: bool) -> Self {
132139
self.filter_include_breakdown = Some(value);
@@ -1021,6 +1028,7 @@ impl UsageMeteringAPI {
10211028
// unbox and build optional parameters
10221029
let filter_timestamp_end = params.filter_timestamp_end;
10231030
let filter_include_descendants = params.filter_include_descendants;
1031+
let filter_include_connected_accounts = params.filter_include_connected_accounts;
10241032
let filter_include_breakdown = params.filter_include_breakdown;
10251033
let filter_versions = params.filter_versions;
10261034
let page_limit = params.page_limit;
@@ -1055,6 +1063,12 @@ impl UsageMeteringAPI {
10551063
&local_query_param.to_string(),
10561064
)]);
10571065
};
1066+
if let Some(ref local_query_param) = filter_include_connected_accounts {
1067+
local_req_builder = local_req_builder.query(&[(
1068+
"filter[include_connected_accounts]",
1069+
&local_query_param.to_string(),
1070+
)]);
1071+
};
10581072
if let Some(ref local_query_param) = filter_include_breakdown {
10591073
local_req_builder = local_req_builder
10601074
.query(&[("filter[include_breakdown]", &local_query_param.to_string())]);

src/datadogV2/model/model_hourly_usage_attributes.rs

+36
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ use std::fmt::{self, Formatter};
1111
#[skip_serializing_none]
1212
#[derive(Clone, Debug, PartialEq, Serialize)]
1313
pub struct HourlyUsageAttributes {
14+
/// The account name.
15+
#[serde(rename = "account_name")]
16+
pub account_name: Option<String>,
17+
/// The account public ID.
18+
#[serde(rename = "account_public_id")]
19+
pub account_public_id: Option<String>,
1420
/// List of the measured usage values for the product family for the org for the time period.
1521
#[serde(rename = "measurements")]
1622
pub measurements: Option<Vec<crate::datadogV2::model::HourlyUsageMeasurement>>,
@@ -37,6 +43,8 @@ pub struct HourlyUsageAttributes {
3743
impl HourlyUsageAttributes {
3844
pub fn new() -> HourlyUsageAttributes {
3945
HourlyUsageAttributes {
46+
account_name: None,
47+
account_public_id: None,
4048
measurements: None,
4149
org_name: None,
4250
product_family: None,
@@ -47,6 +55,16 @@ impl HourlyUsageAttributes {
4755
}
4856
}
4957

58+
pub fn account_name(mut self, value: String) -> Self {
59+
self.account_name = Some(value);
60+
self
61+
}
62+
63+
pub fn account_public_id(mut self, value: String) -> Self {
64+
self.account_public_id = Some(value);
65+
self
66+
}
67+
5068
pub fn measurements(
5169
mut self,
5270
value: Vec<crate::datadogV2::model::HourlyUsageMeasurement>,
@@ -104,6 +122,8 @@ impl<'de> Deserialize<'de> for HourlyUsageAttributes {
104122
where
105123
M: MapAccess<'a>,
106124
{
125+
let mut account_name: Option<String> = None;
126+
let mut account_public_id: Option<String> = None;
107127
let mut measurements: Option<Vec<crate::datadogV2::model::HourlyUsageMeasurement>> =
108128
None;
109129
let mut org_name: Option<String> = None;
@@ -115,6 +135,20 @@ impl<'de> Deserialize<'de> for HourlyUsageAttributes {
115135

116136
while let Some((k, v)) = map.next_entry::<String, serde_json::Value>()? {
117137
match k.as_str() {
138+
"account_name" => {
139+
if v.is_null() {
140+
continue;
141+
}
142+
account_name =
143+
Some(serde_json::from_value(v).map_err(M::Error::custom)?);
144+
}
145+
"account_public_id" => {
146+
if v.is_null() {
147+
continue;
148+
}
149+
account_public_id =
150+
Some(serde_json::from_value(v).map_err(M::Error::custom)?);
151+
}
118152
"measurements" => {
119153
if v.is_null() {
120154
continue;
@@ -158,6 +192,8 @@ impl<'de> Deserialize<'de> for HourlyUsageAttributes {
158192
}
159193

160194
let content = HourlyUsageAttributes {
195+
account_name,
196+
account_public_id,
161197
measurements,
162198
org_name,
163199
product_family,

tests/scenarios/function_mappings.rs

+4
Original file line numberDiff line numberDiff line change
@@ -12844,6 +12844,9 @@ fn test_v2_get_hourly_usage(world: &mut DatadogWorld, _parameters: &HashMap<Stri
1284412844
let filter_include_descendants = _parameters
1284512845
.get("filter[include_descendants]")
1284612846
.and_then(|param| Some(serde_json::from_value(param.clone()).unwrap()));
12847+
let filter_include_connected_accounts = _parameters
12848+
.get("filter[include_connected_accounts]")
12849+
.and_then(|param| Some(serde_json::from_value(param.clone()).unwrap()));
1284712850
let filter_include_breakdown = _parameters
1284812851
.get("filter[include_breakdown]")
1284912852
.and_then(|param| Some(serde_json::from_value(param.clone()).unwrap()));
@@ -12859,6 +12862,7 @@ fn test_v2_get_hourly_usage(world: &mut DatadogWorld, _parameters: &HashMap<Stri
1285912862
let mut params = datadogV2::api_usage_metering::GetHourlyUsageOptionalParams::default();
1286012863
params.filter_timestamp_end = filter_timestamp_end;
1286112864
params.filter_include_descendants = filter_include_descendants;
12865+
params.filter_include_connected_accounts = filter_include_connected_accounts;
1286212866
params.filter_include_breakdown = filter_include_breakdown;
1286312867
params.filter_versions = filter_versions;
1286412868
params.page_limit = page_limit;

0 commit comments

Comments
 (0)