Struct dnsimple::dnsimple::Client[][src]

pub struct Client {
    pub _agent: Agent,
    // some fields omitted
}
Expand description

Represents the Rust client for the DNSimple API V2

The client is your entrypoint to the DNSimple API. Using it you will be able to call all the endpoints of the DNSimple API and their respective functions.

Examples

use dnsimple::dnsimple::{Client, new_client};

let client = new_client(true, String::from("AUTH_TOKEN"));
let identity = client.identity().whoami().unwrap().data.unwrap();

let account = identity.account.unwrap();

Fields

_agent: Agent

Implementations

Returns the accounts service attached to this client

Returns the contacts service attached to this client

Returns the certificates service attached to this client

Returns the domains service attached to this client

Returns the identity service attached to this client

Returns the oauth service attached to this client

Returns the registrar service attached to this client

Returns the services service attached to this client

Returns the templates service attached to this client

Returns the tlds service attached to this endpoint

Returns the vanity_name_servers service attached to this endpoint

Returns the webhooks service attached to this endpoint

Returns the zones service attached to this endpoint

Convenience function to change the base url in runtime (used internally for testing).

Note that if you want to do this you will have to declare your client mutable.

use dnsimple::dnsimple::{Client, new_client};
let mut client = new_client(true, String::from("ACCESS_TOKEN"));
client.set_base_url("https://example.com");
Arguments

url: The url we want to change the base url to.

Returns the current url (including the API_VERSION as part of the path).

Sends a GET request to the DNSimple API

Arguments

path: the path to the endpoint options: optionally a RequestOptions with things like pagination, filtering and sorting

Sends a POST request to the DNSimple API

Arguments

path: the path to the endpoint data: the json payload to be sent to the server

pub fn empty_post(&self, path: &str) -> DNSimpleEmptyResponse

Sends a POST request to the DNSimple API without any payload

Arguments

path: the path to the endpoint

Sends a PUT request to the DNSimple API

Arguments

path: the path to the endpoint data: the json payload to be sent to the server

Sends a PUT request to the DNSimple API without any payload

Arguments

path: the path to the endpoint

Sends a PATCH request to the DNSimple API

Arguments

path: the path to the endpoint data: the json payload to be sent to the server

Sends a DELETE request to the DNSimple API

Arguments

path: the path to the endpoint

Sends a DELETE request to the DNSimple API returning a response containing a DNSimpleResponse

Arguments

path: the path to the endpoint

pub fn build_post_request(&self, path: &&str) -> Request

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.