v2_cloud_cost_management_UploadCustomCostsFile/
v2_cloud-cost-management_UploadCustomCostsFile.rs1use datadog_api_client::datadog;
3use datadog_api_client::datadogV2::api_cloud_cost_management::CloudCostManagementAPI;
4use datadog_api_client::datadogV2::model::CustomCostsFileLineItem;
5
6#[tokio::main]
7async fn main() {
8 let body = vec![CustomCostsFileLineItem::new()
9 .billed_cost(100.5 as f64)
10 .billing_currency("USD".to_string())
11 .charge_description("Monthly usage charge for my service".to_string())
12 .charge_period_end("2023-02-28".to_string())
13 .charge_period_start("2023-02-01".to_string())];
14 let configuration = datadog::Configuration::new();
15 let api = CloudCostManagementAPI::with_config(configuration);
16 let resp = api.upload_custom_costs_file(body).await;
17 if let Ok(value) = resp {
18 println!("{:#?}", value);
19 } else {
20 println!("{:#?}", resp.unwrap_err());
21 }
22}