onesignal_rust_api/models/create_notification_success_response.rs
1/*
2 * OneSignal
3 *
4 * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com
5 *
6 * Contact: devrel@onesignal.com
7 * Generated by: https://openapi-generator.tech
8 */
9
10
11
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct CreateNotificationSuccessResponse {
15 /// 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.
16 #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
17 pub id: Option<String>,
18 /// 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`).
19 #[serde(rename = "external_id", skip_serializing_if = "Option::is_none")]
20 pub external_id: Option<String>,
21 /// 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.
22 #[serde(rename = "errors", skip_serializing_if = "Option::is_none")]
23 pub errors: Option<serde_json::Value>,
24}
25
26impl CreateNotificationSuccessResponse {
27 pub fn new() -> CreateNotificationSuccessResponse {
28 CreateNotificationSuccessResponse {
29 id: None,
30 external_id: None,
31 errors: None,
32 }
33 }
34}
35
36