tencent_sdk/api/
billing.rs1use crate::{
2 Result,
3 client::RequestOptions,
4 types::billing::{AccountBalanceResponse, DescribeAccountBalanceRequest},
5};
6
7#[cfg(feature = "async")]
8use crate::client::Client;
9
10#[cfg(feature = "async")]
11#[derive(Clone)]
12pub struct BillingService {
13 client: Client,
14}
15
16#[cfg(feature = "async")]
17impl BillingService {
18 pub(crate) fn new(client: Client) -> Self {
19 Self { client }
20 }
21
22 pub async fn describe_account_balance(&self) -> Result<AccountBalanceResponse> {
23 self.client
24 .execute(&DescribeAccountBalanceRequest, None)
25 .await
26 }
27
28 pub async fn describe_account_balance_with_options(
29 &self,
30 options: &RequestOptions,
31 ) -> Result<AccountBalanceResponse> {
32 self.client
33 .execute(&DescribeAccountBalanceRequest, Some(options))
34 .await
35 }
36}
37
38#[cfg(feature = "blocking")]
39#[derive(Clone)]
40pub struct BlockingBillingService {
41 client: BlockingClient,
42}
43
44#[cfg(feature = "blocking")]
45use crate::client::BlockingClient;
46
47#[cfg(feature = "blocking")]
48impl BlockingBillingService {
49 pub(crate) fn new(client: BlockingClient) -> Self {
50 Self { client }
51 }
52
53 pub fn describe_account_balance(&self) -> Result<AccountBalanceResponse> {
54 self.client.execute(&DescribeAccountBalanceRequest, None)
55 }
56
57 pub fn describe_account_balance_with_options(
58 &self,
59 options: &RequestOptions,
60 ) -> Result<AccountBalanceResponse> {
61 self.client
62 .execute(&DescribeAccountBalanceRequest, Some(options))
63 }
64}