aws_lite_rs/api/ce.rs
1//! AWS Cost Explorer API client.
2//!
3//! Thin wrapper over generated ops. All URL construction and HTTP methods
4//! are in `ops::ce::CeOps`. This layer adds:
5//! - Ergonomic method signatures
6
7use crate::{
8 AwsHttpClient, Result,
9 ops::ce::CeOps,
10 types::ce::{GetCostAndUsageRequest, GetCostAndUsageResponse},
11};
12
13/// Client for the AWS Cost Explorer API
14pub struct CeClient<'a> {
15 ops: CeOps<'a>,
16}
17
18impl<'a> CeClient<'a> {
19 /// Create a new AWS Cost Explorer API client
20 pub(crate) fn new(client: &'a AwsHttpClient) -> Self {
21 Self {
22 ops: CeOps::new(client),
23 }
24 }
25
26 /// Retrieves cost and usage metrics for your account.
27 pub async fn get_cost_and_usage(
28 &self,
29 body: &GetCostAndUsageRequest,
30 ) -> Result<GetCostAndUsageResponse> {
31 self.ops.get_cost_and_usage(body).await
32 }
33}