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

The Templates Service handles the domains templates of the DNSimple API.

See API Documentation: templates

Fields§

§client: &'a Client

Implementations§

source§

impl Templates<'_>

source

pub fn list_templates( &self, account_id: u64, options: Option<RequestOptions> ) -> Result<DNSimpleResponse<Vec<Template>>, DNSimpleError>

List templates in the account.

Arguments

account_id: The account id options: The RequestOptions for sorting, etc.

source

pub fn create_template( &self, account_id: u64, payload: TemplatePayload ) -> Result<DNSimpleResponse<Template>, DNSimpleError>

Create a template in the account

Arguments

account_id: The account id payload: The Template payload with the information to create the template

source

pub fn get_template( &self, account_id: u64, template: String ) -> Result<DNSimpleResponse<Template>, DNSimpleError>

Retrieve a template in the account

Arguments

account_id: The account id template: The template name or id

source

pub fn update_template( &self, account_id: u64, template: String, payload: TemplatePayload ) -> Result<DNSimpleResponse<Template>, DNSimpleError>

Update a template in the account

Arguments

account_id: The account id template: The template name or id payload: The Template payload with the information to create the template

source

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

Deletes a template from the account

Arguments

account_id: The account id template: The template name or id

source

pub fn list_template_records( &self, account_id: u64, template: String, options: Option<RequestOptions> ) -> Result<DNSimpleResponse<Vec<TemplateRecord>>, DNSimpleError>

List template records

Arguments

account_id: The account id template: The template name or id

source

pub fn create_template_record( &self, account_id: u64, template: String, payload: TemplateRecordPayload ) -> Result<DNSimpleResponse<TemplateRecord>, DNSimpleError>

Create a template record

Arguments

account_id: The account id template: The template name or id payload: The TemplateRecordPayload with the information needed to create the template record

source

pub fn get_template_record( &self, account_id: u64, template: String, record: u64 ) -> Result<DNSimpleResponse<TemplateRecord>, DNSimpleError>

Retrieve a template record

Arguments

account_id: The account id template: The template name or id record: The record id

source

pub fn delete_template_record( &self, account_id: u64, template: String, record: u64 ) -> Result<DNSimpleEmptyResponse, DNSimpleError>

Delete a template record

Arguments

account_id: The account id template: The template name or id record: The record id

source

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

Applies a template to a domain.

Arguments

account_id: The account id domain: The domain name or id template: The template id or short name

Auto Trait Implementations§

§

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

§

impl<'a> Send for Templates<'a>

§

impl<'a> Sync for Templates<'a>

§

impl<'a> Unpin for Templates<'a>

§

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