lemon_bugsnag_rs 0.1.2

A library for interacting with the BugSnag error-reporting and sessions APIs.
Documentation
use serde::Serialize;

use super::{
    device::Device, notifier::Notifier,
    session_counts::session_count::SessionCount, sessions::Session, App,
};

// TODO: User should not need access to the payload as we will handle that for
// them. However, the client is complaining this struct is more restrictive at
// this level, than in the client level.
/// The payload that will be sent to Bugsnag's session API via the backend
/// clients
#[derive(Clone, Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct Payload {
    /// Information about the notifier used to send the session information
    pub notifier: Notifier,
    /// Information about the running app that the session started on
    pub app: Option<App>,
    /// Information about the host device running the application that the
    /// session started on
    pub device: Option<Device>,
    /// Details of the started sessions. Multiple sessions on the same app and
    /// device can be batched together to minimize network traffic. This field
    /// is required unless sessionsCounts are being used.
    pub sessions: Option<Vec<Session>>,
    /// Summary counts of the number of sessions started in a minute. This can
    /// be used instead of the sessions key for server side applications to
    /// provide a session count summary and reduce the payload size being sent.
    pub session_counts: Option<Vec<SessionCount>>,
}