pub struct Client { /* private fields */ }Implementations§
Source§impl<'a> Client
impl<'a> Client
Sourcepub fn account(&'a self) -> AccountClient<'a>
pub fn account(&'a self) -> AccountClient<'a>
Returns a wrapping client for the account API.
Source§impl<'a> Client
impl<'a> Client
Sourcepub fn domain(&'a self) -> DomainClient<'a>
pub fn domain(&'a self) -> DomainClient<'a>
Returns a wrapping client for the domain API.
Source§impl<'a> Client
impl<'a> Client
Sourcepub fn rrset(&'a self) -> RrsetClient<'a>
pub fn rrset(&'a self) -> RrsetClient<'a>
Returns a wrapping client for the Resource Record Sets (RRsets) API.
Source§impl<'a> Client
impl<'a> Client
Sourcepub fn token(&'a self) -> TokenClient<'a>
pub fn token(&'a self) -> TokenClient<'a>
Returns a wrapping client for the token API.
Source§impl Client
impl Client
Sourcepub fn new(token: String) -> Result<Self, Error>
pub fn new(token: String) -> Result<Self, Error>
Creates a new client using the given API token.
§Errors
This method fails with Error::ReqwestClientBuilder if the underlying reqwest::ClientBuilder fails to build a http client.
Sourcepub async fn new_from_credentials(
email: &str,
password: &str,
) -> Result<Self, Error>
pub async fn new_from_credentials( email: &str, password: &str, ) -> Result<Self, Error>
Creates a new client using the given credentials.
§Errors
This method fails with Error::ReqwestClientBuilder if the underlying reqwest::ClientBuilder fails to build a http client.
Sourcepub async fn logout(self) -> Result<(), Error>
pub async fn logout(self) -> Result<(), Error>
Consume and logout the authenticated client.
Attention: this assumes that the client has been authenticated using credentials. Trying to logout a client created from a token will return Error::CannotLogout.
§Errors
This method fails with:
Error::CannotLogoutif the client was not created from credentialsError::UnexpectedStatusCodeif the API responds with an undocumented status codeError::Reqwestif the whole request failed
Sourcepub fn set_max_wait_retry(&mut self, max_wait_retry: u64)
pub fn set_max_wait_retry(&mut self, max_wait_retry: u64)
Sets the maximum wait time for a single retry
Sourcepub fn get_max_wait_retry(&self) -> &u64
pub fn get_max_wait_retry(&self) -> &u64
Returns the maximum wait time for a single retry
Sourcepub fn set_max_retries(&mut self, max_retries: usize)
pub fn set_max_retries(&mut self, max_retries: usize)
Sets the maximum number of retries
Sourcepub fn get_max_retries(&self) -> &usize
pub fn get_max_retries(&self) -> &usize
Returns the maximum number of retries