Struct sendgrid_api::query::Query

source ·
pub struct Query {
    pub client: Client,
}

Fields§

§client: Client

Implementations§

source§

impl Query

source

pub async fn get_messages( &self, query: &str, limit: f64 ) -> Result<Response<GetMessagesResponse>, ClientError>

Filter all messages.

This function performs a GET to the /messages endpoint.

This is BETA functionality. You may not have access, and we reserve the right to change functionality without notice.

Filter all messages to search your Email Activity. All queries need to be URL encoded, and have this format:

query={query_type}="{query_content}"

encoded, this would look like this:

query=type%3D%22query_content%22

for example:

Filter by a specific email - query=to_email%3D%22example%40example.com%22

Filter by subject line - query=subject%3d%22A%20Great%20Subject%22

Full list of basic query types and examples:

Filter queryUnencoded Example (put this one into the try it out query - it’ll automatically encode it for you)Encoded Example (use this one in your code)
msg_idmsg_id=“filter0307p1las1-16816-5A023E36-1.0”msg_id%3D%22filter0307p1las1-16816-5A023E36-1.0%22
from_emailfrom_email=“testing@sendgrid.net”from_email%3D%22testing%40sendgrid.net%22
subjectsubject=“This is a subject test”subject%22This%20is%20a%20subject%20test%22
to_emailto_email=“example@example.com”to_email%3D%22example%40example.com%22
statusstatus%22processed%22
template_id
asm_group_id
api_key_id
eventsstatus=“processed”status%3D%22processed%22
originating_ip
categories
unique_args
outbound_ip
last_event_timelast_event_time=“2017-11-07T23:13:58Z”last_event_time%3D%E2%80%9C2017-11-07T23%3A13%3A58Z%E2%80%9D
clicksclicks=“0”clicks%3D%220%22

For information about building compound queries, and for the full query language functionality, see the query language reference.

Coming soon, example compound queries: limit + to email + date

Parameters:

  • query: &str – The license key provided with your New Relic account.
  • limit: f64 – The number of messages returned. This parameter must be greater than 0 and less than or equal to 1000.
  • x_query_id: &str – The license key provided with your New Relic account.
  • x_cursor: &str – The license key provided with your New Relic account.
  • authorization: &str – The license key provided with your New Relic account.
source

pub async fn get_messages_msg( &self, msg_id: &str ) -> Result<Response<Message>, ClientError>

Filter messages by message ID.

This function performs a GET to the /messages/{msg_id} endpoint.

This is BETA functionality. You may not have access, and we reserve the right to change functionality without notice.

Get all of the details about the specified message.

Parameters:

  • authorization: &str – The license key provided with your New Relic account.

Auto Trait Implementations§

§

impl !RefUnwindSafe for Query

§

impl Send for Query

§

impl Sync for Query

§

impl Unpin for Query

§

impl !UnwindSafe for Query

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,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.
§

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

§

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