pub struct Registrar<'a> {
    pub client: &'a Client,
}
Expand description

The Registrar Service handles the domains registrations of the DNSimple API.

See API Documentation: registrar

Fields§

§client: &'a Client

Implementations§

source§

impl Registrar<'_>

source

pub fn check_domain( &self, account_id: u64, domain: &str ) -> Result<DNSimpleResponse<DomainCheck>, DNSimpleError>

Checks a domain name for availability.

Examples
use dnsimple::dnsimple::new_client;

let client = new_client(true, String::from("AUTH_TOKEN"));
let domain_check = client.registrar().check_domain(1234, "example.com").unwrap().data.unwrap();
Attributes

account_id: The account id domain: The domain name

source

pub fn check_domain_premium_price( &self, account_id: u64, domain: &str, action: Option<String> ) -> Result<DNSimpleResponse<DomainPremiumPrice>, DNSimpleError>

👎Deprecated: please use get_domain_prices instead

Get the premium price for a domain.

Examples
use dnsimple::dnsimple::new_client;

let client = new_client(true, String::from("AUTH_TOKEN"));
let domain_check = client.registrar().check_domain_premium_price(1234, "example.com", None).unwrap().data.unwrap();
Attributes

account_id: The account id domain: The domain name

source

pub fn get_domain_prices( &self, account_id: u64, domain: &str ) -> Result<DNSimpleResponse<DomainPrice>, DNSimpleError>

Get a domain’s price for registration, renewal, and transfer.

Examples
use dnsimple::dnsimple::new_client;

let client = new_client(true, String::from("AUTH_TOKEN"));
let domain_check = client.registrar().get_domain_prices(1234, "example.com").unwrap().data.unwrap();
Attributes

account_id: The account id domain: The domain name

source

pub fn get_domain_registration( &self, account_id: u64, domain: &str, domain_registration_id: u64 ) -> Result<DNSimpleResponse<DomainRegistration>, DNSimpleError>

Get the details of an existing domain registration.

Examples
use dnsimple::dnsimple::new_client;

let client = new_client(true, String::from("AUTH_TOKEN"));
let domain_check = client.registrar().get_domain_registration(1234, "example.com", 1556).unwrap().data.unwrap();
Attributes

account_id: The account id domain: The domain name domain_registration_id: The domain registration id

source

pub fn get_domain_renewal( &self, account_id: u64, domain: &str, domain_renewal_id: u64 ) -> Result<DNSimpleResponse<DomainRenewal>, DNSimpleError>

Get the details of an existing domain transfer.

Examples
use dnsimple::dnsimple::new_client;

let client = new_client(true, String::from("AUTH_TOKEN"));
let domain_check = client.registrar().get_domain_renewal(1234, "example.com", 1556).unwrap().data.unwrap();
Attributes

account_id: The account id domain: The domain name domain_renewal_id: The domain renewal id

source

pub fn register_domain( &self, account_id: u64, domain: &str, payload: DomainRegistrationPayload ) -> Result<DNSimpleResponse<DomainRegistration>, DNSimpleError>

Get a domain’s price for registration, renewal, and transfer.

Examples
use dnsimple::dnsimple::new_client;
use dnsimple::dnsimple::registrar::DomainRegistrationPayload;

let client = new_client(true, String::from("AUTH_TOKEN"));
let payload = DomainRegistrationPayload {
    registrant_id: 42,
    whois_privacy: None,
    auto_renew: None,
    extended_attributes: None,
    premium_price: None,
};
let domain_check = client.registrar().register_domain(1234, "example.com", payload).unwrap().data.unwrap();
Attributes

account_id: The account id domain: The domain name payload: The DomainRegistrationPayload with the information needed to register the domain

source

pub fn transfer_domain( &self, account_id: u64, domain: &str, payload: DomainTransferPayload ) -> Result<DNSimpleResponse<DomainTransfer>, DNSimpleError>

Transfer a domain name from another domain registrar into DNSimple.

Examples
use dnsimple::dnsimple::new_client;
use dnsimple::dnsimple::registrar::DomainTransferPayload;

let client = new_client(true, String::from("AUTH_TOKEN"));
let payload = DomainTransferPayload {
    registrant_id: 42,
    auth_code: "Some code".to_string(),
    whois_privacy: None,
    auto_renew: None,
    extended_attributes: None,
    premium_price: None,
};
let domain_transfer = client.registrar().transfer_domain(1234, "example.com", payload).unwrap().data.unwrap();
Attributes

account_id: The account id domain: The domain name payload: The DomainTransferPayload with the information needed to transfer the domain

source

pub fn get_domain_transfer( &self, account_id: u64, domain: String, domain_transfer: u64 ) -> Result<DNSimpleResponse<DomainTransfer>, DNSimpleError>

Retrieves the details of an existing domain transfer.

Attributes

account_id: The account id domain: The domain name domain_transfer: The domain transfer id

source

pub fn cancel_domain_transfer( &self, account_id: u64, domain: String, domain_transfer: u64 ) -> Result<DNSimpleResponse<DomainTransfer>, DNSimpleError>

Cancels an in progress domain transfer.

Attributes

account_id: The account id domain: The domain name domain_transfer: The domain transfer id

source

pub fn renew_domain( &self, account_id: u64, domain: String, payload: DomainRenewalPayload ) -> Result<DNSimpleResponse<DomainRenewal>, DNSimpleError>

Get a domain’s price for registration, renewal, and transfer.

Attributes

account_id: The account id domain: The domain name payload: The DomainRenewalPayload with the information needed to renew the domain

source

pub fn transfer_domain_out( &self, account_id: u64, domain: String ) -> Result<DNSimpleEmptyResponse, DNSimpleError>

Authorize a domain transfer out

Attributes

account_id: The account id domain: The domain name

source§

impl Registrar<'_>

source

pub fn enable_domain_auto_renewal( &self, account_id: u64, domain: String ) -> Result<DNSimpleEmptyResponse, DNSimpleError>

Enable domain auto-renewal

Arguments

account_id: The account ID domain: The domain name or id

source

pub fn disable_domain_auto_renewal( &self, account_id: u64, domain: String ) -> Result<DNSimpleEmptyResponse, DNSimpleError>

Disable domain auto-renewal

Arguments

account_id: The account ID domain: The domain name or id

source§

impl Registrar<'_>

source

pub fn get_domain_delegation( &self, account_id: u64, domain: String ) -> Result<DNSimpleResponse<Vec<String>>, DNSimpleError>

List name servers for the domain in the account.

Arguments

account_id: The account ID domain: The domain name or id

source

pub fn change_domain_delegation( &self, account_id: u64, domain: String, server_names: Vec<&str> ) -> Result<DNSimpleResponse<Vec<String>>, DNSimpleError>

Change domain name servers

Arguments

account_id: The account ID domain: The domain name or id server_names: A list of name server names as strings

source

pub fn change_domain_delegation_to_vanity( &self, account_id: u64, domain: String, server_names: Vec<&str> ) -> Result<DNSimpleResponse<Vec<VanityNameServer>>, DNSimpleError>

Delegate to vanity name servers

Arguments

account_id: The account ID domain: The domain name or id server_names: A list of name server names as strings

source

pub fn change_domain_delegation_from_vanity( &self, account_id: u64, domain: String ) -> Result<DNSimpleEmptyResponse, DNSimpleError>

De-delegate from vanity name servers

Arguments

account_id: The account ID domain: The domain name or id

source§

impl Registrar<'_>

source

pub fn get_whois_privacy( &self, account_id: u64, domain: String ) -> Result<DNSimpleResponse<WhoisPrivacy>, DNSimpleError>

Retrieve the domain WHOIS privacy

Arguments

account_id: The account ID domain: The domain name or id

source

pub fn enable_whois_privacy( &self, account_id: u64, domain: String ) -> Result<DNSimpleResponse<WhoisPrivacy>, DNSimpleError>

Enable WHOIS privacy

Arguments

account_id: The account ID domain: The domain name or id

source

pub fn disable_whois_privacy( &self, account_id: u64, domain: String ) -> Result<DNSimpleResponse<WhoisPrivacy>, DNSimpleError>

Enable WHOIS privacy

Arguments

account_id: The account ID domain: The domain name or id

source

pub fn renew_whois_privacy( &self, account_id: u64, domain: String ) -> Result<DNSimpleResponse<WhoisPrivacyRenewal>, DNSimpleError>

Renew WHOIS privacy

Arguments

account_id: The account ID domain: The domain name or id

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for Registrar<'a>

§

impl<'a> Send for Registrar<'a>

§

impl<'a> Sync for Registrar<'a>

§

impl<'a> Unpin for Registrar<'a>

§

impl<'a> !UnwindSafe for Registrar<'a>

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.