Struct CloudCostManagementAPI

Source
pub struct CloudCostManagementAPI { /* private fields */ }
Expand description

The Cloud Cost Management API allows you to set up, edit, and delete Cloud Cost Management accounts for AWS, Azure, and GCP. You can query your cost data by using the Metrics endpoint and the cloud_cost data source. For more information, see the Cloud Cost Management documentation.

Implementations§

Source§

impl CloudCostManagementAPI

Source

pub fn new() -> Self

Source

pub fn with_config(config: Configuration) -> Self

Examples found in repository?
examples/v2_cloud-cost-management_ListBudgets.rs (line 8)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = CloudCostManagementAPI::with_config(configuration);
9    let resp = api.list_budgets().await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
More examples
Hide additional examples
examples/v2_cloud-cost-management_ListCustomCostsFiles.rs (line 8)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = CloudCostManagementAPI::with_config(configuration);
9    let resp = api.list_custom_costs_files().await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
examples/v2_cloud-cost-management_ListCustomCostsFiles_1968771127.rs (line 8)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = CloudCostManagementAPI::with_config(configuration);
9    let resp = api.list_custom_costs_files().await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
examples/v2_cloud-cost-management_ListCostAWSCURConfigs.rs (line 8)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = CloudCostManagementAPI::with_config(configuration);
9    let resp = api.list_cost_awscur_configs().await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
examples/v2_cloud-cost-management_ListCostAzureUCConfigs.rs (line 8)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = CloudCostManagementAPI::with_config(configuration);
9    let resp = api.list_cost_azure_uc_configs().await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
examples/v2_cloud-cost-management_ListCostGCPUsageCostConfigs.rs (line 8)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = CloudCostManagementAPI::with_config(configuration);
9    let resp = api.list_cost_gcp_usage_cost_configs().await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
Source

pub fn with_client_and_config( config: Configuration, client: ClientWithMiddleware, ) -> Self

Source

pub async fn create_cost_awscur_config( &self, body: AwsCURConfigPostRequest, ) -> Result<AwsCURConfigResponse, Error<CreateCostAWSCURConfigError>>

Create a Cloud Cost Management account for an AWS CUR config.

Examples found in repository?
examples/v2_cloud-cost-management_CreateCostAWSCURConfig.rs (line 23)
10async fn main() {
11    let body = AwsCURConfigPostRequest::new(AwsCURConfigPostData::new(
12        AwsCURConfigPostRequestAttributes::new(
13            "123456789123".to_string(),
14            "dd-cost-bucket".to_string(),
15            "dd-report-name".to_string(),
16            "dd-report-prefix".to_string(),
17        )
18        .bucket_region("us-east-1".to_string()),
19        AwsCURConfigPostRequestType::AWS_CUR_CONFIG_POST_REQUEST,
20    ));
21    let configuration = datadog::Configuration::new();
22    let api = CloudCostManagementAPI::with_config(configuration);
23    let resp = api.create_cost_awscur_config(body).await;
24    if let Ok(value) = resp {
25        println!("{:#?}", value);
26    } else {
27        println!("{:#?}", resp.unwrap_err());
28    }
29}
Source

pub async fn create_cost_awscur_config_with_http_info( &self, body: AwsCURConfigPostRequest, ) -> Result<ResponseContent<AwsCURConfigResponse>, Error<CreateCostAWSCURConfigError>>

Create a Cloud Cost Management account for an AWS CUR config.

Source

pub async fn create_cost_azure_uc_configs( &self, body: AzureUCConfigPostRequest, ) -> Result<AzureUCConfigPairsResponse, Error<CreateCostAzureUCConfigsError>>

Create a Cloud Cost Management account for an Azure config.

Examples found in repository?
examples/v2_cloud-cost-management_CreateCostAzureUCConfigs.rs (line 35)
11async fn main() {
12    let body = AzureUCConfigPostRequest::new(AzureUCConfigPostData::new(
13        AzureUCConfigPostRequestAttributes::new(
14            "1234abcd-1234-abcd-1234-1234abcd1234".to_string(),
15            BillConfig::new(
16                "dd-actual-export".to_string(),
17                "dd-export-path".to_string(),
18                "dd-storage-account".to_string(),
19                "dd-storage-container".to_string(),
20            ),
21            BillConfig::new(
22                "dd-actual-export".to_string(),
23                "dd-export-path".to_string(),
24                "dd-storage-account".to_string(),
25                "dd-storage-container".to_string(),
26            ),
27            "1234abcd-1234-abcd-1234-1234abcd1234".to_string(),
28            "subscriptions/1234abcd-1234-abcd-1234-1234abcd1234".to_string(),
29        )
30        .is_enabled(true),
31        AzureUCConfigPostRequestType::AZURE_UC_CONFIG_POST_REQUEST,
32    ));
33    let configuration = datadog::Configuration::new();
34    let api = CloudCostManagementAPI::with_config(configuration);
35    let resp = api.create_cost_azure_uc_configs(body).await;
36    if let Ok(value) = resp {
37        println!("{:#?}", value);
38    } else {
39        println!("{:#?}", resp.unwrap_err());
40    }
41}
Source

pub async fn create_cost_azure_uc_configs_with_http_info( &self, body: AzureUCConfigPostRequest, ) -> Result<ResponseContent<AzureUCConfigPairsResponse>, Error<CreateCostAzureUCConfigsError>>

Create a Cloud Cost Management account for an Azure config.

Source

pub async fn create_cost_gcp_usage_cost_config( &self, body: GCPUsageCostConfigPostRequest, ) -> Result<GCPUsageCostConfigResponse, Error<CreateCostGCPUsageCostConfigError>>

Create a Cloud Cost Management account for an GCP Usage Cost config.

Examples found in repository?
examples/v2_cloud-cost-management_CreateCostGCPUsageCostConfig.rs (line 24)
10async fn main() {
11    let body = GCPUsageCostConfigPostRequest::new(GCPUsageCostConfigPostData::new(
12        GCPUsageCostConfigPostRequestAttributes::new(
13            "123456_A123BC_12AB34".to_string(),
14            "dd-cost-bucket".to_string(),
15            "billing".to_string(),
16            "dd-cloud-cost-report".to_string(),
17            "dd-ccm-gcp-integration@my-environment.iam.gserviceaccount.com".to_string(),
18        )
19        .export_prefix("datadog_cloud_cost_usage_export".to_string()),
20        GCPUsageCostConfigPostRequestType::GCP_USAGE_COST_CONFIG_POST_REQUEST,
21    ));
22    let configuration = datadog::Configuration::new();
23    let api = CloudCostManagementAPI::with_config(configuration);
24    let resp = api.create_cost_gcp_usage_cost_config(body).await;
25    if let Ok(value) = resp {
26        println!("{:#?}", value);
27    } else {
28        println!("{:#?}", resp.unwrap_err());
29    }
30}
Source

pub async fn create_cost_gcp_usage_cost_config_with_http_info( &self, body: GCPUsageCostConfigPostRequest, ) -> Result<ResponseContent<GCPUsageCostConfigResponse>, Error<CreateCostGCPUsageCostConfigError>>

Create a Cloud Cost Management account for an GCP Usage Cost config.

Source

pub async fn delete_budget( &self, budget_id: String, ) -> Result<(), Error<DeleteBudgetError>>

Delete a budget.

Examples found in repository?
examples/v2_cloud-cost-management_DeleteBudget.rs (line 9)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = CloudCostManagementAPI::with_config(configuration);
9    let resp = api.delete_budget("budget_id".to_string()).await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
Source

pub async fn delete_budget_with_http_info( &self, budget_id: String, ) -> Result<ResponseContent<()>, Error<DeleteBudgetError>>

Delete a budget.

Source

pub async fn delete_cost_awscur_config( &self, cloud_account_id: String, ) -> Result<(), Error<DeleteCostAWSCURConfigError>>

Archive a Cloud Cost Management Account.

Examples found in repository?
examples/v2_cloud-cost-management_DeleteCostAWSCURConfig.rs (line 9)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = CloudCostManagementAPI::with_config(configuration);
9    let resp = api.delete_cost_awscur_config("100".to_string()).await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
Source

pub async fn delete_cost_awscur_config_with_http_info( &self, cloud_account_id: String, ) -> Result<ResponseContent<()>, Error<DeleteCostAWSCURConfigError>>

Archive a Cloud Cost Management Account.

Source

pub async fn delete_cost_azure_uc_config( &self, cloud_account_id: String, ) -> Result<(), Error<DeleteCostAzureUCConfigError>>

Archive a Cloud Cost Management Account.

Examples found in repository?
examples/v2_cloud-cost-management_DeleteCostAzureUCConfig.rs (line 9)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = CloudCostManagementAPI::with_config(configuration);
9    let resp = api.delete_cost_azure_uc_config("100".to_string()).await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
Source

pub async fn delete_cost_azure_uc_config_with_http_info( &self, cloud_account_id: String, ) -> Result<ResponseContent<()>, Error<DeleteCostAzureUCConfigError>>

Archive a Cloud Cost Management Account.

Source

pub async fn delete_cost_gcp_usage_cost_config( &self, cloud_account_id: String, ) -> Result<(), Error<DeleteCostGCPUsageCostConfigError>>

Archive a Cloud Cost Management account.

Examples found in repository?
examples/v2_cloud-cost-management_DeleteCostGCPUsageCostConfig.rs (line 10)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = CloudCostManagementAPI::with_config(configuration);
9    let resp = api
10        .delete_cost_gcp_usage_cost_config("100".to_string())
11        .await;
12    if let Ok(value) = resp {
13        println!("{:#?}", value);
14    } else {
15        println!("{:#?}", resp.unwrap_err());
16    }
17}
Source

pub async fn delete_cost_gcp_usage_cost_config_with_http_info( &self, cloud_account_id: String, ) -> Result<ResponseContent<()>, Error<DeleteCostGCPUsageCostConfigError>>

Archive a Cloud Cost Management account.

Source

pub async fn delete_custom_costs_file( &self, file_id: String, ) -> Result<(), Error<DeleteCustomCostsFileError>>

Delete the specified Custom Costs file.

Examples found in repository?
examples/v2_cloud-cost-management_DeleteCustomCostsFile.rs (line 9)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = CloudCostManagementAPI::with_config(configuration);
9    let resp = api.delete_custom_costs_file("file_id".to_string()).await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
More examples
Hide additional examples
examples/v2_cloud-cost-management_DeleteCustomCostsFile_372970393.rs (line 10)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = CloudCostManagementAPI::with_config(configuration);
9    let resp = api
10        .delete_custom_costs_file("9d055d22-a838-4e9f-bc34-a4f9ab66280c".to_string())
11        .await;
12    if let Ok(value) = resp {
13        println!("{:#?}", value);
14    } else {
15        println!("{:#?}", resp.unwrap_err());
16    }
17}
Source

pub async fn delete_custom_costs_file_with_http_info( &self, file_id: String, ) -> Result<ResponseContent<()>, Error<DeleteCustomCostsFileError>>

Delete the specified Custom Costs file.

Source

pub async fn get_budget( &self, budget_id: String, ) -> Result<BudgetWithEntries, Error<GetBudgetError>>

Get a budget.

Examples found in repository?
examples/v2_cloud-cost-management_GetBudget.rs (line 9)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = CloudCostManagementAPI::with_config(configuration);
9    let resp = api.get_budget("budget_id".to_string()).await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
Source

pub async fn get_budget_with_http_info( &self, budget_id: String, ) -> Result<ResponseContent<BudgetWithEntries>, Error<GetBudgetError>>

Get a budget.

Source

pub async fn get_custom_costs_file( &self, file_id: String, ) -> Result<CustomCostsFileGetResponse, Error<GetCustomCostsFileError>>

Fetch the specified Custom Costs file.

Examples found in repository?
examples/v2_cloud-cost-management_GetCustomCostsFile.rs (line 9)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = CloudCostManagementAPI::with_config(configuration);
9    let resp = api.get_custom_costs_file("file_id".to_string()).await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
More examples
Hide additional examples
examples/v2_cloud-cost-management_GetCustomCostsFile_1307381576.rs (line 10)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = CloudCostManagementAPI::with_config(configuration);
9    let resp = api
10        .get_custom_costs_file("9d055d22-a838-4e9f-bc34-a4f9ab66280c".to_string())
11        .await;
12    if let Ok(value) = resp {
13        println!("{:#?}", value);
14    } else {
15        println!("{:#?}", resp.unwrap_err());
16    }
17}
Source

pub async fn get_custom_costs_file_with_http_info( &self, file_id: String, ) -> Result<ResponseContent<CustomCostsFileGetResponse>, Error<GetCustomCostsFileError>>

Fetch the specified Custom Costs file.

Source

pub async fn list_budgets(&self) -> Result<BudgetArray, Error<ListBudgetsError>>

List budgets.

Examples found in repository?
examples/v2_cloud-cost-management_ListBudgets.rs (line 9)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = CloudCostManagementAPI::with_config(configuration);
9    let resp = api.list_budgets().await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
Source

pub async fn list_budgets_with_http_info( &self, ) -> Result<ResponseContent<BudgetArray>, Error<ListBudgetsError>>

List budgets.

Source

pub async fn list_cost_awscur_configs( &self, ) -> Result<AwsCURConfigsResponse, Error<ListCostAWSCURConfigsError>>

List the AWS CUR configs.

Examples found in repository?
examples/v2_cloud-cost-management_ListCostAWSCURConfigs.rs (line 9)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = CloudCostManagementAPI::with_config(configuration);
9    let resp = api.list_cost_awscur_configs().await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
Source

pub async fn list_cost_awscur_configs_with_http_info( &self, ) -> Result<ResponseContent<AwsCURConfigsResponse>, Error<ListCostAWSCURConfigsError>>

List the AWS CUR configs.

Source

pub async fn list_cost_azure_uc_configs( &self, ) -> Result<AzureUCConfigsResponse, Error<ListCostAzureUCConfigsError>>

List the Azure configs.

Examples found in repository?
examples/v2_cloud-cost-management_ListCostAzureUCConfigs.rs (line 9)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = CloudCostManagementAPI::with_config(configuration);
9    let resp = api.list_cost_azure_uc_configs().await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
Source

pub async fn list_cost_azure_uc_configs_with_http_info( &self, ) -> Result<ResponseContent<AzureUCConfigsResponse>, Error<ListCostAzureUCConfigsError>>

List the Azure configs.

Source

pub async fn list_cost_gcp_usage_cost_configs( &self, ) -> Result<GCPUsageCostConfigsResponse, Error<ListCostGCPUsageCostConfigsError>>

List the GCP Usage Cost configs.

Examples found in repository?
examples/v2_cloud-cost-management_ListCostGCPUsageCostConfigs.rs (line 9)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = CloudCostManagementAPI::with_config(configuration);
9    let resp = api.list_cost_gcp_usage_cost_configs().await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
Source

pub async fn list_cost_gcp_usage_cost_configs_with_http_info( &self, ) -> Result<ResponseContent<GCPUsageCostConfigsResponse>, Error<ListCostGCPUsageCostConfigsError>>

List the GCP Usage Cost configs.

Source

pub async fn list_custom_costs_files( &self, ) -> Result<CustomCostsFileListResponse, Error<ListCustomCostsFilesError>>

List the Custom Costs files.

Examples found in repository?
examples/v2_cloud-cost-management_ListCustomCostsFiles.rs (line 9)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = CloudCostManagementAPI::with_config(configuration);
9    let resp = api.list_custom_costs_files().await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
More examples
Hide additional examples
examples/v2_cloud-cost-management_ListCustomCostsFiles_1968771127.rs (line 9)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = CloudCostManagementAPI::with_config(configuration);
9    let resp = api.list_custom_costs_files().await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
Source

pub async fn list_custom_costs_files_with_http_info( &self, ) -> Result<ResponseContent<CustomCostsFileListResponse>, Error<ListCustomCostsFilesError>>

List the Custom Costs files.

Source

pub async fn update_cost_awscur_config( &self, cloud_account_id: String, body: AwsCURConfigPatchRequest, ) -> Result<AwsCURConfigsResponse, Error<UpdateCostAWSCURConfigError>>

Update the status (active/archived) and/or account filtering configuration of an AWS CUR config.

Examples found in repository?
examples/v2_cloud-cost-management_UpdateCostAWSCURConfig.rs (line 17)
10async fn main() {
11    let body = AwsCURConfigPatchRequest::new(AwsCURConfigPatchData::new(
12        AwsCURConfigPatchRequestAttributes::new().is_enabled(true),
13        AwsCURConfigPatchRequestType::AWS_CUR_CONFIG_PATCH_REQUEST,
14    ));
15    let configuration = datadog::Configuration::new();
16    let api = CloudCostManagementAPI::with_config(configuration);
17    let resp = api.update_cost_awscur_config("100".to_string(), body).await;
18    if let Ok(value) = resp {
19        println!("{:#?}", value);
20    } else {
21        println!("{:#?}", resp.unwrap_err());
22    }
23}
Source

pub async fn update_cost_awscur_config_with_http_info( &self, cloud_account_id: String, body: AwsCURConfigPatchRequest, ) -> Result<ResponseContent<AwsCURConfigsResponse>, Error<UpdateCostAWSCURConfigError>>

Update the status (active/archived) and/or account filtering configuration of an AWS CUR config.

Source

pub async fn update_cost_azure_uc_configs( &self, cloud_account_id: String, body: AzureUCConfigPatchRequest, ) -> Result<AzureUCConfigPairsResponse, Error<UpdateCostAzureUCConfigsError>>

Update the status of an Azure config (active/archived).

Examples found in repository?
examples/v2_cloud-cost-management_UpdateCostAzureUCConfigs.rs (line 18)
10async fn main() {
11    let body = AzureUCConfigPatchRequest::new(AzureUCConfigPatchData::new(
12        AzureUCConfigPatchRequestAttributes::new(true),
13        AzureUCConfigPatchRequestType::AZURE_UC_CONFIG_PATCH_REQUEST,
14    ));
15    let configuration = datadog::Configuration::new();
16    let api = CloudCostManagementAPI::with_config(configuration);
17    let resp = api
18        .update_cost_azure_uc_configs("100".to_string(), body)
19        .await;
20    if let Ok(value) = resp {
21        println!("{:#?}", value);
22    } else {
23        println!("{:#?}", resp.unwrap_err());
24    }
25}
Source

pub async fn update_cost_azure_uc_configs_with_http_info( &self, cloud_account_id: String, body: AzureUCConfigPatchRequest, ) -> Result<ResponseContent<AzureUCConfigPairsResponse>, Error<UpdateCostAzureUCConfigsError>>

Update the status of an Azure config (active/archived).

Source

pub async fn update_cost_gcp_usage_cost_config( &self, cloud_account_id: String, body: GCPUsageCostConfigPatchRequest, ) -> Result<GCPUsageCostConfigResponse, Error<UpdateCostGCPUsageCostConfigError>>

Update the status of an GCP Usage Cost config (active/archived).

Examples found in repository?
examples/v2_cloud-cost-management_UpdateCostGCPUsageCostConfig.rs (line 18)
10async fn main() {
11    let body = GCPUsageCostConfigPatchRequest::new(GCPUsageCostConfigPatchData::new(
12        GCPUsageCostConfigPatchRequestAttributes::new(true),
13        GCPUsageCostConfigPatchRequestType::GCP_USAGE_COST_CONFIG_PATCH_REQUEST,
14    ));
15    let configuration = datadog::Configuration::new();
16    let api = CloudCostManagementAPI::with_config(configuration);
17    let resp = api
18        .update_cost_gcp_usage_cost_config("100".to_string(), body)
19        .await;
20    if let Ok(value) = resp {
21        println!("{:#?}", value);
22    } else {
23        println!("{:#?}", resp.unwrap_err());
24    }
25}
Source

pub async fn update_cost_gcp_usage_cost_config_with_http_info( &self, cloud_account_id: String, body: GCPUsageCostConfigPatchRequest, ) -> Result<ResponseContent<GCPUsageCostConfigResponse>, Error<UpdateCostGCPUsageCostConfigError>>

Update the status of an GCP Usage Cost config (active/archived).

Source

pub async fn upload_custom_costs_file( &self, body: Vec<CustomCostsFileLineItem>, ) -> Result<CustomCostsFileUploadResponse, Error<UploadCustomCostsFileError>>

Upload a Custom Costs file.

Examples found in repository?
examples/v2_cloud-cost-management_UploadCustomCostsFile.rs (line 16)
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}
More examples
Hide additional examples
examples/v2_cloud-cost-management_UploadCustomCostsFile_4125168396.rs (line 19)
8async fn main() {
9    let body = vec![CustomCostsFileLineItem::new()
10        .billed_cost(250.0 as f64)
11        .billing_currency("USD".to_string())
12        .charge_description("my_description".to_string())
13        .charge_period_end("2023-06-06".to_string())
14        .charge_period_start("2023-05-06".to_string())
15        .provider_name("my_provider".to_string())
16        .tags(BTreeMap::from([("key".to_string(), "value".to_string())]))];
17    let configuration = datadog::Configuration::new();
18    let api = CloudCostManagementAPI::with_config(configuration);
19    let resp = api.upload_custom_costs_file(body).await;
20    if let Ok(value) = resp {
21        println!("{:#?}", value);
22    } else {
23        println!("{:#?}", resp.unwrap_err());
24    }
25}
Source

pub async fn upload_custom_costs_file_with_http_info( &self, body: Vec<CustomCostsFileLineItem>, ) -> Result<ResponseContent<CustomCostsFileUploadResponse>, Error<UploadCustomCostsFileError>>

Upload a Custom Costs file.

Source

pub async fn upsert_budget( &self, body: BudgetWithEntries, ) -> Result<BudgetWithEntries, Error<UpsertBudgetError>>

Create a new budget or update an existing one.

Examples found in repository?
examples/v2_cloud-cost-management_UpsertBudget.rs (line 37)
11async fn main() {
12    let body = BudgetWithEntries::new().data(
13        BudgetWithEntriesData::new()
14            .attributes(
15                BudgetAttributes::new()
16                    .created_at(1738258683590)
17                    .created_by("00000000-0a0a-0a0a-aaa0-00000000000a".to_string())
18                    .end_month(202502)
19                    .entries(vec![BudgetEntry::new()
20                        .amount(500.0 as f64)
21                        .month(202501)
22                        .tag_filters(vec![TagFilter::new()
23                            .tag_key("service".to_string())
24                            .tag_value("ec2".to_string())])])
25                    .metrics_query("aws.cost.amortized{service:ec2} by {service}".to_string())
26                    .name("my budget".to_string())
27                    .org_id(123)
28                    .start_month(202501)
29                    .total_amount(1000.0 as f64)
30                    .updated_at(1738258683590)
31                    .updated_by("00000000-0a0a-0a0a-aaa0-00000000000a".to_string()),
32            )
33            .id("00000000-0a0a-0a0a-aaa0-00000000000a".to_string()),
34    );
35    let configuration = datadog::Configuration::new();
36    let api = CloudCostManagementAPI::with_config(configuration);
37    let resp = api.upsert_budget(body).await;
38    if let Ok(value) = resp {
39        println!("{:#?}", value);
40    } else {
41        println!("{:#?}", resp.unwrap_err());
42    }
43}
Source

pub async fn upsert_budget_with_http_info( &self, body: BudgetWithEntries, ) -> Result<ResponseContent<BudgetWithEntries>, Error<UpsertBudgetError>>

Create a new budget or update an existing one.

Trait Implementations§

Source§

impl Clone for CloudCostManagementAPI

Source§

fn clone(&self) -> CloudCostManagementAPI

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CloudCostManagementAPI

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for CloudCostManagementAPI

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,