pub struct CreateNotificationSuccessResponse {
pub id: Option<String>,
pub external_id: Option<String>,
pub errors: Option<Value>,
}Fields§
§id: Option<String>Notification identifier when the request created a notification. An empty string means no notification was created; read errors for details (HTTP may still be 200). All OneSignal server SDKs expose message-sent / message-not-sent narrowing helpers (named idiomatically per language — e.g. isMessageSent, is_message_sent, message_sent?); prefer them over comparing id directly.
external_id: Option<String>Optional correlation / idempotency-related value from the API response. This is not the end-user External ID used for targeting recipients (that lives under include_aliases.external_id).
errors: Option<Value>Polymorphic field: may be an array of human-readable strings and/or an object (for example with invalid_aliases, invalid_external_user_ids, or invalid_player_ids) depending on the API response; HTTP may still be 200 with partial success. Typed SDKs model this loosely so both shapes deserialize.
Implementations§
Source§impl CreateNotificationSuccessResponse
impl CreateNotificationSuccessResponse
Sourcepub fn is_message_sent(&self) -> bool
pub fn is_message_sent(&self) -> bool
Whether this is the MessageSent branch — a notification was created
(id is present and non-empty). Prefer this over inspecting id
directly.
Sourcepub fn is_message_not_sent(&self) -> bool
pub fn is_message_not_sent(&self) -> bool
Whether this is the MessageNotSent branch — no notification was
created (id absent or empty); inspect errors for why.
Sourcepub fn as_sent(&self) -> Option<&MessageSent>
pub fn as_sent(&self) -> Option<&MessageSent>
Returns Some(self) viewed as a MessageSent when a notification was
created, otherwise None.
Sourcepub fn as_not_sent(&self) -> Option<&MessageNotSent>
pub fn as_not_sent(&self) -> Option<&MessageNotSent>
Returns Some(self) viewed as a MessageNotSent when no notification
was created, otherwise None.
Trait Implementations§
Source§impl Clone for CreateNotificationSuccessResponse
impl Clone for CreateNotificationSuccessResponse
Source§fn clone(&self) -> CreateNotificationSuccessResponse
fn clone(&self) -> CreateNotificationSuccessResponse
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more