pub struct Registrar<'a> {
pub client: &'a Client,
}
Expand description
The Registrar Service handles the domains registrations of the DNSimple API.
Fields§
§client: &'a Client
Implementations§
source§impl Registrar<'_>
impl Registrar<'_>
sourcepub fn check_domain(
&self,
account_id: u64,
domain: &str
) -> Result<DNSimpleResponse<DomainCheck>, DNSimpleError>
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
👎Deprecated: please use get_domain_prices
instead
get_domain_prices
insteadGet 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
sourcepub fn get_domain_prices(
&self,
account_id: u64,
domain: &str
) -> Result<DNSimpleResponse<DomainPrice>, DNSimpleError>
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
sourcepub fn get_domain_registration(
&self,
account_id: u64,
domain: &str,
domain_registration_id: u64
) -> Result<DNSimpleResponse<DomainRegistration>, DNSimpleError>
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
sourcepub fn get_domain_renewal(
&self,
account_id: u64,
domain: &str,
domain_renewal_id: u64
) -> Result<DNSimpleResponse<DomainRenewal>, DNSimpleError>
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
sourcepub fn register_domain(
&self,
account_id: u64,
domain: &str,
payload: DomainRegistrationPayload
) -> Result<DNSimpleResponse<DomainRegistration>, DNSimpleError>
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
sourcepub fn transfer_domain(
&self,
account_id: u64,
domain: &str,
payload: DomainTransferPayload
) -> Result<DNSimpleResponse<DomainTransfer>, DNSimpleError>
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
sourcepub fn get_domain_transfer(
&self,
account_id: u64,
domain: String,
domain_transfer: u64
) -> Result<DNSimpleResponse<DomainTransfer>, DNSimpleError>
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
sourcepub fn cancel_domain_transfer(
&self,
account_id: u64,
domain: String,
domain_transfer: u64
) -> Result<DNSimpleResponse<DomainTransfer>, DNSimpleError>
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
sourcepub fn renew_domain(
&self,
account_id: u64,
domain: String,
payload: DomainRenewalPayload
) -> Result<DNSimpleResponse<DomainRenewal>, DNSimpleError>
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
sourcepub fn transfer_domain_out(
&self,
account_id: u64,
domain: String
) -> Result<DNSimpleEmptyResponse, DNSimpleError>
pub fn transfer_domain_out( &self, account_id: u64, domain: String ) -> Result<DNSimpleEmptyResponse, DNSimpleError>
source§impl Registrar<'_>
impl Registrar<'_>
sourcepub fn enable_domain_auto_renewal(
&self,
account_id: u64,
domain: String
) -> Result<DNSimpleEmptyResponse, DNSimpleError>
pub fn enable_domain_auto_renewal( &self, account_id: u64, domain: String ) -> Result<DNSimpleEmptyResponse, DNSimpleError>
sourcepub fn disable_domain_auto_renewal(
&self,
account_id: u64,
domain: String
) -> Result<DNSimpleEmptyResponse, DNSimpleError>
pub fn disable_domain_auto_renewal( &self, account_id: u64, domain: String ) -> Result<DNSimpleEmptyResponse, DNSimpleError>
source§impl Registrar<'_>
impl Registrar<'_>
sourcepub fn get_domain_delegation(
&self,
account_id: u64,
domain: String
) -> Result<DNSimpleResponse<Vec<String>>, DNSimpleError>
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
sourcepub fn change_domain_delegation(
&self,
account_id: u64,
domain: String,
server_names: Vec<&str>
) -> Result<DNSimpleResponse<Vec<String>>, DNSimpleError>
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
sourcepub fn change_domain_delegation_to_vanity(
&self,
account_id: u64,
domain: String,
server_names: Vec<&str>
) -> Result<DNSimpleResponse<Vec<VanityNameServer>>, DNSimpleError>
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
sourcepub fn change_domain_delegation_from_vanity(
&self,
account_id: u64,
domain: String
) -> Result<DNSimpleEmptyResponse, DNSimpleError>
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<'_>
impl Registrar<'_>
sourcepub fn get_whois_privacy(
&self,
account_id: u64,
domain: String
) -> Result<DNSimpleResponse<WhoisPrivacy>, DNSimpleError>
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