pub struct Accounts<'a> {
pub client: &'a Client,
}
Expand description
The Accounts Service handles the accounts endpoint of the DNSimple API.
Fields§
§client: &'a Client
Implementations§
source§impl Accounts<'_>
impl Accounts<'_>
sourcepub fn list_accounts(
&self
) -> Result<DNSimpleResponse<Vec<Account>>, DNSimpleError>
pub fn list_accounts( &self ) -> Result<DNSimpleResponse<Vec<Account>>, DNSimpleError>
Lists the accounts the current authenticated entity has access to.
Examples
use dnsimple::dnsimple::new_client;
let client = new_client(true, String::from("AUTH_TOKEN"));
let response = client.accounts().list_accounts().unwrap();
let accounts = response.data.unwrap();
let first_account = accounts.first().unwrap();