Struct dnsimple::dnsimple::certificates::Certificates
source · pub struct Certificates<'a> {
pub client: &'a Client,
}
Expand description
The Certificates Service handles the certificates endpoint of the DNSimple API.
Fields§
§client: &'a Client
Implementations§
source§impl Certificates<'_>
impl Certificates<'_>
sourcepub fn list_certificates(
&self,
account_id: u64,
domain: &str,
options: Option<RequestOptions>
) -> Result<DNSimpleResponse<Vec<Certificate>>, DNSimpleError>
pub fn list_certificates( &self, account_id: u64, domain: &str, options: Option<RequestOptions> ) -> Result<DNSimpleResponse<Vec<Certificate>>, DNSimpleError>
List the certificates for a domain in the account.
Examples
use dnsimple::dnsimple::{Client, new_client};
let client = new_client(true, String::from("AUTH_TOKEN"));
let certificates = client.certificates().list_certificates(1010, "example.com", None).unwrap().data.unwrap();
Arguments
account_id
: The id of the account
domain
: The domain name or id
options
: The RequestOptions
.
- Sorting: id
, common_name
, expiration
sourcepub fn get_certificate(
&self,
account_id: u64,
domain: &str,
certificate_id: u64
) -> Result<DNSimpleResponse<Certificate>, DNSimpleError>
pub fn get_certificate( &self, account_id: u64, domain: &str, certificate_id: u64 ) -> Result<DNSimpleResponse<Certificate>, DNSimpleError>
Get the details of a certificate
Examples
use dnsimple::dnsimple::{Client, new_client};
let client = new_client(true, String::from("AUTH_TOKEN"));
let certificate = client.certificates().get_certificate(1010, "example.com", 42).unwrap().data.unwrap();
Arguments
account_id
: The id of the account
domain
: The domain name or id
certificate_id
: The certificate id
sourcepub fn download_certificate(
&self,
account_id: u64,
domain: &str,
certificate_id: u64
) -> Result<DNSimpleResponse<CertificateBundle>, DNSimpleError>
pub fn download_certificate( &self, account_id: u64, domain: &str, certificate_id: u64 ) -> Result<DNSimpleResponse<CertificateBundle>, DNSimpleError>
Download a certificate
Examples
use dnsimple::dnsimple::{Client, new_client};
let client = new_client(true, String::from("AUTH_TOKEN"));
let certificate = client.certificates().download_certificate(1010, "example.com", 42).unwrap().data.unwrap();
Arguments
account_id
: The id of the account
domain
: The domain name or id
certificate_id
: The certificate id
sourcepub fn get_certificate_private_key(
&self,
account_id: u64,
domain: &str,
certificate_id: u64
) -> Result<DNSimpleResponse<CertificatePrivateKey>, DNSimpleError>
pub fn get_certificate_private_key( &self, account_id: u64, domain: &str, certificate_id: u64 ) -> Result<DNSimpleResponse<CertificatePrivateKey>, DNSimpleError>
Get the PEM-encoded certificate private key
Examples
use dnsimple::dnsimple::{Client, new_client};
let client = new_client(true, String::from("AUTH_TOKEN"));
let private_key = client.certificates().get_certificate_private_key(1010, "example.com", 42).unwrap().data.unwrap();
Arguments
account_id
: The id of the account
domain
: The domain name or id
certificate_id
: The certificate id
sourcepub fn purchase_letsencrypt_certificate(
&self,
account_id: u64,
domain: &str,
payload: LetsEncryptPurchasePayload
) -> Result<DNSimpleResponse<LetsEncryptPurchase>, DNSimpleError>
pub fn purchase_letsencrypt_certificate( &self, account_id: u64, domain: &str, payload: LetsEncryptPurchasePayload ) -> Result<DNSimpleResponse<LetsEncryptPurchase>, DNSimpleError>
Purchase a Let’s Encrypt certificate with DNSimple.
Examples
use dnsimple::dnsimple::{Client, new_client};
use dnsimple::dnsimple::certificates::LetsEncryptPurchasePayload;
let client = new_client(true, String::from("AUTH_TOKEN"));
let payload = LetsEncryptPurchasePayload {
auto_renew: true,
name: String::from("secret"),
alternate_names: vec![],
signature_algorithm: None,
};
let purchase = client.certificates().purchase_letsencrypt_certificate(1010, "example.com", payload).unwrap().data.unwrap();
Arguments
account_id
: The id of the account
domain
: The domain name or id
payload
: The LetsEncryptPurchasePayload
containing the information to purchase the certificate
sourcepub fn issue_letsencrypt_certificate(
&self,
account_id: u64,
domain: &str,
certificate_id: u64
) -> Result<DNSimpleResponse<Certificate>, DNSimpleError>
pub fn issue_letsencrypt_certificate( &self, account_id: u64, domain: &str, certificate_id: u64 ) -> Result<DNSimpleResponse<Certificate>, DNSimpleError>
Issue a Let’s Encrypt certificate for a domain in the account
Examples
use dnsimple::dnsimple::{Client, new_client};
let client = new_client(true, String::from("AUTH_TOKEN"));
let issued = client.certificates().issue_letsencrypt_certificate(1010, "example.com", 42).unwrap().data.unwrap();
Arguments
account_id
: The id of the account
domain
: The domain name or id
certificate_id
: The id of the certificate to be issued
sourcepub fn purchase_letsencrypt_certificate_renewal(
&self,
account_id: u64,
domain: &str,
certificate_id: u64,
payload: LetsEncryptPurchaseRenewalPayload
) -> Result<DNSimpleResponse<LetsEncryptPurchaseRenewal>, DNSimpleError>
pub fn purchase_letsencrypt_certificate_renewal( &self, account_id: u64, domain: &str, certificate_id: u64, payload: LetsEncryptPurchaseRenewalPayload ) -> Result<DNSimpleResponse<LetsEncryptPurchaseRenewal>, DNSimpleError>
Purchase a Let’s Encrypt certificate renewal
Examples
use dnsimple::dnsimple::{Client, new_client};
use dnsimple::dnsimple::certificates::LetsEncryptPurchaseRenewalPayload;
let client = new_client(true, String::from("AUTH_TOKEN"));
let payload = LetsEncryptPurchaseRenewalPayload {
auto_renew: false,
signature_algorithm: None,
};
let issued = client.certificates().purchase_letsencrypt_certificate_renewal(1010, "example.com", 42, payload).unwrap().data.unwrap();
Arguments
account_id
: The id of the account
domain
: The domain name or id
payload
: The LetsEncryptPurchaseRenewalPayload
containing the information to purchase the certificate
sourcepub fn issue_letsencrypt_certificate_renewal(
&self,
account_id: u64,
domain: &str,
certificate_id: u64,
certificate_renewal_id: u64
) -> Result<DNSimpleResponse<Certificate>, DNSimpleError>
pub fn issue_letsencrypt_certificate_renewal( &self, account_id: u64, domain: &str, certificate_id: u64, certificate_renewal_id: u64 ) -> Result<DNSimpleResponse<Certificate>, DNSimpleError>
Issue a Let’s Encrypt certificate for a domain in the account
Examples
use dnsimple::dnsimple::{Client, new_client};
let client = new_client(true, String::from("AUTH_TOKEN"));
let issued = client.certificates().issue_letsencrypt_certificate_renewal(1010, "example.com", 41, 42).unwrap().data.unwrap();
Arguments
account_id
: The id of the account
domain
: The domain name or id
certificate_id
: The id of the certificate to be issued
certificate_renewal_id
: The certificate renewal id