@@ -169,6 +169,8 @@ impl GetHourlyUsageOptionalParams {
169
169
#[ non_exhaustive]
170
170
#[ derive( Clone , Default , Debug ) ]
171
171
pub struct GetMonthlyCostAttributionOptionalParams {
172
+ /// Datetime in ISO-8601 format, UTC, precise to month: `[YYYY-MM]` for cost ending this month.
173
+ pub end_month : Option < chrono:: DateTime < chrono:: Utc > > ,
172
174
/// The direction to sort by: `[desc, asc]`.
173
175
pub sort_direction : Option < crate :: datadogV2:: model:: SortDirection > ,
174
176
/// The billing dimension to sort by. Always sorted by total cost. Example: `infra_host`.
@@ -183,6 +185,11 @@ pub struct GetMonthlyCostAttributionOptionalParams {
183
185
}
184
186
185
187
impl GetMonthlyCostAttributionOptionalParams {
188
+ /// Datetime in ISO-8601 format, UTC, precise to month: `[YYYY-MM]` for cost ending this month.
189
+ pub fn end_month ( mut self , value : chrono:: DateTime < chrono:: Utc > ) -> Self {
190
+ self . end_month = Some ( value) ;
191
+ self
192
+ }
186
193
/// The direction to sort by: `[desc, asc]`.
187
194
pub fn sort_direction ( mut self , value : crate :: datadogV2:: model:: SortDirection ) -> Self {
188
195
self . sort_direction = Some ( value) ;
@@ -1193,15 +1200,14 @@ impl UsageMeteringAPI {
1193
1200
pub async fn get_monthly_cost_attribution (
1194
1201
& self ,
1195
1202
start_month : chrono:: DateTime < chrono:: Utc > ,
1196
- end_month : chrono:: DateTime < chrono:: Utc > ,
1197
1203
fields : String ,
1198
1204
params : GetMonthlyCostAttributionOptionalParams ,
1199
1205
) -> Result <
1200
1206
crate :: datadogV2:: model:: MonthlyCostAttributionResponse ,
1201
1207
datadog:: Error < GetMonthlyCostAttributionError > ,
1202
1208
> {
1203
1209
match self
1204
- . get_monthly_cost_attribution_with_http_info ( start_month, end_month , fields, params)
1210
+ . get_monthly_cost_attribution_with_http_info ( start_month, fields, params)
1205
1211
. await
1206
1212
{
1207
1213
Ok ( response_content) => {
@@ -1236,7 +1242,6 @@ impl UsageMeteringAPI {
1236
1242
pub async fn get_monthly_cost_attribution_with_http_info (
1237
1243
& self ,
1238
1244
start_month : chrono:: DateTime < chrono:: Utc > ,
1239
- end_month : chrono:: DateTime < chrono:: Utc > ,
1240
1245
fields : String ,
1241
1246
params : GetMonthlyCostAttributionOptionalParams ,
1242
1247
) -> Result <
@@ -1255,6 +1260,7 @@ impl UsageMeteringAPI {
1255
1260
}
1256
1261
1257
1262
// unbox and build optional parameters
1263
+ let end_month = params. end_month ;
1258
1264
let sort_direction = params. sort_direction ;
1259
1265
let sort_name = params. sort_name ;
1260
1266
let tag_breakdown_keys = params. tag_breakdown_keys ;
@@ -1274,11 +1280,13 @@ impl UsageMeteringAPI {
1274
1280
"start_month" ,
1275
1281
& start_month. to_rfc3339_opts ( chrono:: SecondsFormat :: Millis , true ) ,
1276
1282
) ] ) ;
1277
- local_req_builder = local_req_builder. query ( & [ (
1278
- "end_month" ,
1279
- & end_month. to_rfc3339_opts ( chrono:: SecondsFormat :: Millis , true ) ,
1280
- ) ] ) ;
1281
1283
local_req_builder = local_req_builder. query ( & [ ( "fields" , & fields. to_string ( ) ) ] ) ;
1284
+ if let Some ( ref local_query_param) = end_month {
1285
+ local_req_builder = local_req_builder. query ( & [ (
1286
+ "end_month" ,
1287
+ & local_query_param. to_rfc3339_opts ( chrono:: SecondsFormat :: Millis , true ) ,
1288
+ ) ] ) ;
1289
+ } ;
1282
1290
if let Some ( ref local_query_param) = sort_direction {
1283
1291
local_req_builder =
1284
1292
local_req_builder. query ( & [ ( "sort_direction" , & local_query_param. to_string ( ) ) ] ) ;
0 commit comments