Struct dnsimple::dnsimple::registrar::Registrar [−][src]
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
pub fn check_domain(
&self,
account_id: u64,
domain: &str
) -> Result<DNSimpleResponse<DomainCheck>, String>
pub fn check_domain(
&self,
account_id: u64,
domain: &str
) -> Result<DNSimpleResponse<DomainCheck>, String>
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
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
pub fn get_domain_prices(
&self,
account_id: u64,
domain: &str
) -> Result<DNSimpleResponse<DomainPrice>, String>
pub fn get_domain_prices(
&self,
account_id: u64,
domain: &str
) -> Result<DNSimpleResponse<DomainPrice>, String>
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
pub fn register_domain(
&self,
account_id: u64,
domain: &str,
payload: DomainRegistrationPayload
) -> Result<DNSimpleResponse<DomainRegistration>, String>
pub fn register_domain(
&self,
account_id: u64,
domain: &str,
payload: DomainRegistrationPayload
) -> Result<DNSimpleResponse<DomainRegistration>, String>
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
pub fn transfer_domain(
&self,
account_id: u64,
domain: &str,
payload: DomainTransferPayload
) -> Result<DNSimpleResponse<DomainTransfer>, String>
pub fn transfer_domain(
&self,
account_id: u64,
domain: &str,
payload: DomainTransferPayload
) -> Result<DNSimpleResponse<DomainTransfer>, String>
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
pub fn get_domain_transfer(
&self,
account_id: u64,
domain: String,
domain_transfer: u64
) -> Result<DNSimpleResponse<DomainTransfer>, String>
pub fn get_domain_transfer(
&self,
account_id: u64,
domain: String,
domain_transfer: u64
) -> Result<DNSimpleResponse<DomainTransfer>, String>
Retrieves the details of an existing domain transfer.
Attributes
account_id
: The account id
domain
: The domain name
domain_transfer
: The domain transfer id
pub fn cancel_domain_transfer(
&self,
account_id: u64,
domain: String,
domain_transfer: u64
) -> Result<DNSimpleResponse<DomainTransfer>, String>
pub fn cancel_domain_transfer(
&self,
account_id: u64,
domain: String,
domain_transfer: u64
) -> Result<DNSimpleResponse<DomainTransfer>, String>
Cancels an in progress domain transfer.
Attributes
account_id
: The account id
domain
: The domain name
domain_transfer
: The domain transfer id
pub fn renew_domain(
&self,
account_id: u64,
domain: String,
payload: DomainRenewalPayload
) -> Result<DNSimpleResponse<DomainRenewal>, String>
pub fn renew_domain(
&self,
account_id: u64,
domain: String,
payload: DomainRenewalPayload
) -> Result<DNSimpleResponse<DomainRenewal>, String>
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
pub fn enable_domain_auto_renewal(
&self,
account_id: u64,
domain: String
) -> DNSimpleEmptyResponse
pub fn enable_domain_auto_renewal(
&self,
account_id: u64,
domain: String
) -> DNSimpleEmptyResponse
pub fn disable_domain_auto_renewal(
&self,
account_id: u64,
domain: String
) -> DNSimpleEmptyResponse
pub fn disable_domain_auto_renewal(
&self,
account_id: u64,
domain: String
) -> DNSimpleEmptyResponse
pub fn get_domain_delegation(
&self,
account_id: u64,
domain: String
) -> Result<DNSimpleResponse<Vec<String>>, String>
pub fn get_domain_delegation(
&self,
account_id: u64,
domain: String
) -> Result<DNSimpleResponse<Vec<String>>, String>
List name servers for the domain in the account.
Arguments
account_id
: The account ID
domain
: The domain name or id
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
pub fn change_domain_delegation_to_vanity(
&self,
account_id: u64,
domain: String,
server_names: Vec<&str>
) -> Result<DNSimpleResponse<Vec<VanityNameServer>>, String>
pub fn change_domain_delegation_to_vanity(
&self,
account_id: u64,
domain: String,
server_names: Vec<&str>
) -> Result<DNSimpleResponse<Vec<VanityNameServer>>, String>
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
pub fn change_domain_delegation_from_vanity(
&self,
account_id: u64,
domain: String
) -> DNSimpleEmptyResponse
pub fn change_domain_delegation_from_vanity(
&self,
account_id: u64,
domain: String
) -> DNSimpleEmptyResponse
De-delegate from vanity name servers
Arguments
account_id
: The account ID
domain
: The domain name or id
pub fn get_whois_privacy(
&self,
account_id: u64,
domain: String
) -> Result<DNSimpleResponse<WhoisPrivacy>, String>
pub fn get_whois_privacy(
&self,
account_id: u64,
domain: String
) -> Result<DNSimpleResponse<WhoisPrivacy>, String>
Retrieve the domain WHOIS privacy
Arguments
account_id
: The account ID
domain
: The domain name or id