Struct SingleSends

Source
pub struct SingleSends {
    pub client: Client,
}

Fields§

§client: Client

Implementations§

Source§

impl SingleSends

Source

pub async fn get_marketing_singlesends( &self, page_size: i64, page_token: &str, ) -> Result<Response<GetMarketingSinglesendsResponse>, ClientError>

Get All Single Sends.

This function performs a GET to the /marketing/singlesends endpoint.

This endpoint allows you to retrieve all your Single Sends.

Returns all of your Single Sends with condensed details about each, including the Single Sends’ IDs. For more details about an individual Single Send, pass the Single Send’s ID to the /marketing/singlesends/{id} endpoint.

Parameters:

  • page_size: i64
  • page_token: &str – The license key provided with your New Relic account.
Source

pub async fn post_marketing_singlesend( &self, body: &SinglesendRequest, ) -> Result<Response<SinglesendResponseAllOf>, ClientError>

Create Single Send.

This function performs a POST to the /marketing/singlesends endpoint.

This endpoint allows you to create a new Single Send.

Please note that if you are migrating from the previous version of Single Sends, you no longer need to pass a template ID with your request to this endpoint. Instead, you will pass all template data in the email_config object.

Source

pub async fn delete_marketing_singlesends( &self, ids: &[String], ) -> Result<Response<()>, ClientError>

Bulk Delete Single Sends.

This function performs a DELETE to the /marketing/singlesends endpoint.

This endpoint allows you to delete multiple Single Sends using an array of Single Sends IDs.

To first retrieve all your Single Sends’ IDs, you can make a GET request to the /marketing/singlensends endpoint.

Please note that a DELETE request is permanent, and your Single Sends will not be recoverable after deletion.

Parameters:

  • ids: &[String] – The recipient IDs of the recipients that already existed from this request.
Source

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

Get Single Send by ID.

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

This endpoint allows you to retrieve details about one Single Send using a Single Send ID.

You can retrieve all of your Single Sends by making a GET request to the /marketing/singlesends endpoint.

Source

pub async fn post_marketing_singlesend_single_sends( &self, id: &str, body: &PostMarketingSinglesendsRequest, ) -> Result<Response<SinglesendResponseAllOf>, ClientError>

Duplicate Single Send.

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

This endpoint allows you to duplicate an existing Single Send using its Single Send ID.

Duplicating a Single Send is useful when you want to create a Single Send but don’t want to start from scratch. Once duplicated, you can update or edit the Single Send by making a PATCH request to the /marketing/singlesends/{id} endpoint.

If you leave the name field blank, your duplicate will be assigned the name of the Single Send it was copied from with the text “Copy of ” prepended to it. The name field length is limited to 100 characters, so the end of the new Single Send name, including “Copy of ”, will be trimmed if the name exceeds this limit.

Source

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

Delete Single Send by ID.

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

This endpoint allows you to delete one Single Send using a Single Send ID.

To first retrieve all your Single Sends’ IDs, you can make a GET request to the /marketing/singlensends endpoint.

Please note that a DELETE request is permanent, and your Single Send will not be recoverable after deletion.

Source

pub async fn patch_marketing_singlesends( &self, id: &str, body: &SinglesendRequest, ) -> Result<Response<SinglesendResponseAllOf>, ClientError>

Update Single Send.

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

This endpoint allows you to update a Single Send using a Single Send ID.

You only need to pass the fields you want to update. Any blank/missing fields will remain unaltered.

Get Single Sends Search.

This function performs a POST to the /marketing/singlesends/search endpoint.

This endpoint allows you to search for Single Sends based on specified criteria.

You can search for Single Sends by passing a combination of values using the name, status, and categories request body fields.

For example, if you want to search for all Single Sends that are “drafts” or “scheduled” and also associated with the category “shoes,” your request body may look like the example below.

{
  "status": [
    "draft",
    "scheduled"
  ],
  "categories": [
    "shoes"
  ],
}

Parameters:

  • page_size: i64
  • page_token: &str – The license key provided with your New Relic account.
Source

pub async fn put_marketing_singlesends_schedule( &self, id: &str, body: &PutMarketingSinglesendsScheduleRequest, ) -> Result<Response<PutMarketingSinglesendsScheduleResponse>, ClientError>

Schedule Single Send.

This function performs a PUT to the /marketing/singlesends/{id}/schedule endpoint.

This endpoint allows you to schedule a Single Send for future delivery using a Single Send ID.

To schedule a Single Send, you must pass a date string in ISO 8601 time format (yyyy-MM-ddTHH:mm:ssZ) using the required send_at field. For example, the ISO 8601 format for 9:00 AM UTC on May 6, 2020 would be 2020-05-06T09:00:00Z. You may also pass the string "now" to send the Single Send immediately.

Source

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

Delete Single Send Schedule.

This function performs a DELETE to the /marketing/singlesends/{id}/schedule endpoint.

This endpoint allows you to cancel a scheduled Single Send using a Single Send ID.

Making a DELETE request to this endpoint will cancel the scheduled sending of a Single Send. The request will not delete the Single Send itself. Deleting a Single Send can be done by passing a DELETE request to /marketing/singlesends/{id}.

Source

pub async fn get_marketing_singlesends_categories( &self, ) -> Result<Response<GetMarketingSinglesendsCategoriesResponse>, ClientError>

Get All Categories.

This function performs a GET to the /marketing/singlesends/categories endpoint.

This endpoint allows you to retrieve all the categories associated with your Single Sends.

This endpoint will return your latest 1,000 categories.

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,