pub struct Templates<'a> {
pub client: &'a Client,
}
Expand description
The Templates Service handles the domains templates of the DNSimple API.
Fields§
§client: &'a Client
Implementations§
source§impl Templates<'_>
impl Templates<'_>
sourcepub fn list_templates(
&self,
account_id: u64,
options: Option<RequestOptions>
) -> Result<DNSimpleResponse<Vec<Template>>, DNSimpleError>
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.
sourcepub fn create_template(
&self,
account_id: u64,
payload: TemplatePayload
) -> Result<DNSimpleResponse<Template>, DNSimpleError>
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
sourcepub fn get_template(
&self,
account_id: u64,
template: String
) -> Result<DNSimpleResponse<Template>, DNSimpleError>
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
sourcepub fn update_template(
&self,
account_id: u64,
template: String,
payload: TemplatePayload
) -> Result<DNSimpleResponse<Template>, DNSimpleError>
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
sourcepub fn delete_template(
&self,
account_id: u64,
template: String
) -> Result<DNSimpleEmptyResponse, DNSimpleError>
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
sourcepub fn list_template_records(
&self,
account_id: u64,
template: String,
options: Option<RequestOptions>
) -> Result<DNSimpleResponse<Vec<TemplateRecord>>, DNSimpleError>
pub fn list_template_records( &self, account_id: u64, template: String, options: Option<RequestOptions> ) -> Result<DNSimpleResponse<Vec<TemplateRecord>>, DNSimpleError>
sourcepub fn create_template_record(
&self,
account_id: u64,
template: String,
payload: TemplateRecordPayload
) -> Result<DNSimpleResponse<TemplateRecord>, DNSimpleError>
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
sourcepub fn get_template_record(
&self,
account_id: u64,
template: String,
record: u64
) -> Result<DNSimpleResponse<TemplateRecord>, DNSimpleError>
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
sourcepub fn delete_template_record(
&self,
account_id: u64,
template: String,
record: u64
) -> Result<DNSimpleEmptyResponse, DNSimpleError>
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
sourcepub fn apply_template(
&self,
account_id: u64,
domain: String,
template: String
) -> Result<DNSimpleEmptyResponse, DNSimpleError>
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