Skip to main content

StartLiveActivityRequest

Struct StartLiveActivityRequest 

Source
pub struct StartLiveActivityRequest {
Show 16 fields pub name: String, pub event: EventType, pub activity_id: String, pub event_attributes: Value, pub event_updates: Value, pub contents: Box<LanguageStringMap>, pub headings: Box<LanguageStringMap>, pub stale_date: Option<i32>, pub priority: Option<i32>, pub ios_relevance_score: Option<f32>, pub idempotency_key: Option<String>, pub include_aliases: Option<HashMap<String, Vec<String>>>, pub include_subscription_ids: Option<Vec<String>>, pub included_segments: Option<Vec<String>>, pub excluded_segments: Option<Vec<String>>, pub filters: Option<Vec<FilterExpression>>,
}

Fields§

§name: String

An internal name to assist with your campaign organization. This does not get displayed in the message itself.

§event: EventType§activity_id: String

Set a unique activity_id to track and manage the Live Activity.

§event_attributes: Value

Default/static data to initialize the Live Activity upon start.

§event_updates: Value

Dynamic content used to update the running Live Activity at start. Must match the ContentState interface defined in your app.

§contents: Box<LanguageStringMap>§headings: Box<LanguageStringMap>§stale_date: Option<i32>

Accepts Unix timestamp in seconds. When time reaches the configured stale date, the system considers the Live Activity out of date, and the ActivityState of the Live Activity changes to ActivityState.stale.

§priority: Option<i32>

Delivery priority through the push provider (APNs). Pass 10 for higher priority notifications, or 5 for lower priority notifications. Lower priority notifications are sent based on the power considerations of the end user’s device. If not set, defaults to 10.

§ios_relevance_score: Option<f32>

iOS 15+. A score to indicate how a notification should be displayed when grouped. Use a float between 0-1.

§idempotency_key: Option<String>

Correlation and idempotency key. A request received with this parameter will first look for another notification with the same idempotency key. If one exists, a notification will not be sent, and result of the previous operation will instead be returned. Therefore, if you plan on using this feature, it’s important to use a good source of randomness to generate the UUID passed here. This key is only idempotent for 30 days. After 30 days, the notification could be removed from our system and a notification with the same idempotency key will be sent again. See Idempotent Notification Requests for more details writeOnly: true

§include_aliases: Option<HashMap<String, Vec<String>>>

Target specific users by aliases assigned via API. An alias can be an external_id, onesignal_id, or a custom alias. Accepts an object where keys are alias labels and values are arrays of alias IDs to include Example usage: { "external_id": ["exId1", "extId2"], "internal_label": ["id1", "id2"] } Not compatible with any other targeting parameters. REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call Note: If targeting push, email, or sms subscribers with same ids, use with target_channel to indicate you are sending a push or email or sms.

§include_subscription_ids: Option<Vec<String>>

Specific subscription ids to target. Not compatible with other targeting parameters.

§included_segments: Option<Vec<String>>

Segment names to include. Only compatible with excluded_segments.

§excluded_segments: Option<Vec<String>>

Segment names to exclude. Only compatible with included_segments.

§filters: Option<Vec<FilterExpression>>

Implementations§

Source§

impl StartLiveActivityRequest

Source

pub fn new( name: String, event: EventType, activity_id: String, event_attributes: Value, event_updates: Value, contents: LanguageStringMap, headings: LanguageStringMap, ) -> StartLiveActivityRequest

Trait Implementations§

Source§

impl Clone for StartLiveActivityRequest

Source§

fn clone(&self) -> StartLiveActivityRequest

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for StartLiveActivityRequest

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for StartLiveActivityRequest

Source§

fn default() -> StartLiveActivityRequest

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for StartLiveActivityRequest

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for StartLiveActivityRequest

Source§

fn eq(&self, other: &StartLiveActivityRequest) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for StartLiveActivityRequest

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for StartLiveActivityRequest

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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<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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,