sms77_client/balance.rs
1use ureq::{Error};
2use crate::client::Client;
3
4pub struct Balance {
5 client: Client
6}
7
8impl Balance {
9 pub fn new(client: Client) -> Self {
10 Balance {
11 client,
12 }
13 }
14
15 pub fn get(&self) -> Result<f64, Error> {
16 Ok(self.client.request("GET", "balance")
17 .call()?
18 .into_json::<f64>()?)
19 }
20}