Struct DesignsApi

Source
pub struct DesignsApi {
    pub client: Client,
}

Fields§

§client: Client

Implementations§

Source§

impl DesignsApi

Source

pub async fn get_design( &self, id: &str, ) -> Result<Response<DesignOutputAllOf>, ClientError>

Get Design.

This function performs a GET to the /designs/{id} endpoint.

This endpoint allows you to retrieve a single design.

A GET request to /designs/{id} will retrieve details about a specific design in your Design Library.

This endpoint is valuable when retrieving information stored in a field that you wish to update using a PATCH request.

Source

pub async fn post_duplicate_design( &self, id: &str, body: &DesignDuplicateInput, ) -> Result<Response<DesignOutputAllOf>, ClientError>

Duplicate Design.

This function performs a POST to the /designs/{id} endpoint.

This endpoint allows you to duplicate one of your existing designs.

Modifying an existing design is often the easiest way to create something new.

You are not required to pass any data in the body of a request to this endpoint. If you choose to leave the name field blank, your duplicate will be assigned the name of the design it was copied from with the text “Duplicate: “ prepended to it. This name change is only a convenience, as the duplicate will be assigned a unique ID that differentiates it from your other designs.

You can modify your duplicate’s name at the time of creation by passing an updated value to the name field when making the initial request. More on retrieving design IDs can be found below.

Source

pub async fn delete_design( &self, id: &str, ) -> Result<Response<Help>, ClientError>

Delete Design.

This function performs a DELETE to the /designs/{id} endpoint.

This endpoint allows you to delete a single design.

Be sure to check the ID of the design you intend to delete before making this request; deleting a design is a permanent action.

Source

pub async fn put_design( &self, id: &str, body: &PutDesignRequest, ) -> Result<Response<DesignOutputAllOf>, ClientError>

Update Design.

This function performs a PATCH to the /designs/{id} endpoint.

This endpoint allows you to edit a design.

The Design API supports PATCH requests, which allow you to make partial updates to a single design. Passing data to a specific field will update only the data stored in that field; all other fields will be unaltered.

For example, updating a design’s name requires that you make a PATCH request to this endpoint with data specified for the name field only.

{
    "name": "<Updated Name>"
}
Source

pub async fn list_designs( &self, page_size: u64, page_token: &str, summary: bool, ) -> Result<Response<ListDesignsResponse>, ClientError>

List Designs.

This function performs a GET to the /designs endpoint.

This endpoint allows you to retrieve a list of designs already stored in your Design Library.

A GET request to /designs will return a list of your existing designs. This endpoint will not return the pre-built Twilio SendGrid designs. Pre-built designs can be retrieved using the /designs/pre-builts endpoint, which is detailed below.

By default, you will receive 100 results per request; however, you can modify the number of results returned by passing an integer to the page_size query parameter.

Parameters:

  • page_size: u64 – number of results to return.
  • page_token: &str – token corresponding to a specific page of results, as provided by metadata.
  • summary: bool – Indicates if your subuser statistics will be sent to your New Relic Dashboard.
Source

pub async fn post_design( &self, body: &DesignInputAllOf, ) -> Result<Response<DesignOutputAllOf>, ClientError>

Create Design.

This function performs a POST to the /designs endpoint.

This endpoint allows you to create a new design.

You can add a new design by passing data, including a string of HTML email content, to /designs. When creating designs from scratch, be aware of the styling constraints inherent to many email clients. For a list of best practices, see our guide to Cross-Platform Email Design.

The Design Library can also convert your design’s HTML elements into drag and drop modules that are editable in the Designs Library user interface. For more, visit the Design and Code Editor documentation.

Because the /designs endpoint makes it easy to add designs, you can create a design with your preferred tooling or migrate designs you already own without relying on the Design Library UI.

Source

pub async fn get_sendgrid_pre_built_design( &self, id: &str, ) -> Result<Response<DesignOutputAllOf>, ClientError>

Get SendGrid Pre-built Design.

This function performs a GET to the /designs/pre-builts/{id} endpoint.

This endpoint allows you to retrieve a single pre-built design.

A GET request to /designs/pre-builts/{id} will retrieve details about a specific pre-built design.

This endpoint is valuable when retrieving details about a pre-built design that you wish to duplicate and modify.

Source

pub async fn post_sendgrid_pre_built_design( &self, id: &str, body: &DesignDuplicateInput, ) -> Result<Response<DesignOutputAllOf>, ClientError>

Duplicate SendGrid Pre-built Design.

This function performs a POST to the /designs/pre-builts/{id} endpoint.

This endpoint allows you to duplicate one of the pre-built Twilio SendGrid designs.

Like duplicating one of your existing designs, you are not required to pass any data in the body of a request to this endpoint. If you choose to leave the name field blank, your duplicate will be assigned the name of the design it was copied from with the text “Duplicate: “ prepended to it. This name change is only a convenience, as the duplicate design will be assigned a unique ID that differentiates it from your other designs. You can retrieve the IDs for Twilio SendGrid pre-built designs using the “List SendGrid Pre-built Designs” endpoint.

You can modify your duplicate’s name at the time of creation by passing an updated value to the name field when making the initial request. More on retrieving design IDs can be found above.

Source

pub async fn list_sendgrid_pre_built_designs( &self, page_size: u64, page_token: &str, summary: bool, ) -> Result<Response<ListDesignsResponse>, ClientError>

List SendGrid Pre-built Designs.

This function performs a GET to the /designs/pre-builts endpoint.

This endpoint allows you to retrieve a list of pre-built designs provided by Twilio SendGrid.

Unlike the /designs endpoint where your designs are stored, a GET request made to designs/pre-builts will retrieve a list of the pre-built Twilio SendGrid designs. This endpoint will not return the designs stored in your Design Library.

By default, you will receive 100 results per request; however, you can modify the number of results returned by passing an integer to the page_size query parameter.

This endpoint is useful for retrieving the IDs of Twilio SendGrid designs that you want to duplicate and modify.

Parameters:

  • page_size: u64 – number of results to return.
  • page_token: &str – token corresponding to a specific page of results, as provided by metadata.
  • summary: bool – Indicates if your subuser statistics will be sent to your New Relic Dashboard.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

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 T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T