pub struct Identity<'a> {
pub client: &'a Client,
}
Expand description
The Identity Service handles the identity (whoami) endpoint of the DNSimple API.
Fields§
§client: &'a Client
Implementations§
source§impl Identity<'_>
impl Identity<'_>
sourcepub fn whoami(&self) -> Result<DNSimpleResponse<WhoamiData>, DNSimpleError>
pub fn whoami(&self) -> Result<DNSimpleResponse<WhoamiData>, DNSimpleError>
Retrieves the details about the current authenticated entity used to access the API.
Examples
use dnsimple::dnsimple::{Client, new_client};
let client = new_client(true, String::from("AUTH_TOKEN"));
let response = client.identity().whoami().unwrap().data.unwrap();
let account = response.account.unwrap();