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

The Certificates Service handles the certificates endpoint of the DNSimple API.

See API Documentation: certificates

Fields§

§client: &'a Client

Implementations§

source§

impl Certificates<'_>

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

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

Auto Trait Implementations§

§

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

§

impl<'a> Send for Certificates<'a>

§

impl<'a> Sync for Certificates<'a>

§

impl<'a> Unpin for Certificates<'a>

§

impl<'a> !UnwindSafe for Certificates<'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.