google-cloudevents 0.2.0

Prost/Serde structs for Google CloudEvent types with axum integration
Documentation
// This file is @generated by prost-build.
/// The data within Firebase Analytics log events.
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(default)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AnalyticsLogData {
    /// User related dimensions.
    #[prost(message, optional, tag = "1")]
    pub user_dim: ::core::option::Option<UserDimensions>,
    /// A repeated record of event related dimensions.
    #[prost(message, repeated, tag = "2")]
    pub event_dim: ::prost::alloc::vec::Vec<EventDimensions>,
}
/// Message containing information about the user associated with the event.
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(default)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UserDimensions {
    /// The user ID set via the setUserId API.
    #[prost(string, tag = "1")]
    pub user_id: ::prost::alloc::string::String,
    /// The time (in microseconds) at which the user first opened the app.
    #[prost(int64, tag = "2")]
    pub first_open_timestamp_micros: i64,
    /// A repeated record of user properties set with the setUserProperty API.
    /// <https://firebase.google.com/docs/analytics/android/properties>
    #[prost(map = "string, message", tag = "3")]
    pub user_properties: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        UserPropertyValue,
    >,
    /// Device information.
    #[prost(message, optional, tag = "4")]
    pub device_info: ::core::option::Option<DeviceInfo>,
    /// User's geographic information.
    #[prost(message, optional, tag = "5")]
    pub geo_info: ::core::option::Option<GeoInfo>,
    /// App information.
    #[prost(message, optional, tag = "6")]
    pub app_info: ::core::option::Option<AppInfo>,
    /// Information about marketing campaign which acquired the user.
    #[prost(message, optional, tag = "7")]
    pub traffic_source: ::core::option::Option<TrafficSource>,
    /// Information regarding the bundle in which these events were uploaded.
    #[prost(message, optional, tag = "8")]
    pub bundle_info: ::core::option::Option<ExportBundleInfo>,
    /// Lifetime Value information about this user.
    #[prost(message, optional, tag = "9")]
    pub ltv_info: ::core::option::Option<LtvInfo>,
}
/// Predefined (eg: LTV) or custom properties (eg: birthday) stored on client
/// side and associated with subsequent HitBundles.
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(default)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UserPropertyValue {
    /// Last set value of user property.
    #[prost(message, optional, tag = "1")]
    pub value: ::core::option::Option<AnalyticsValue>,
    /// UTC client time when user property was last set.
    #[prost(int64, tag = "2")]
    pub set_timestamp_usec: i64,
    /// Index for user property (one-based).
    #[prost(int32, tag = "3")]
    pub index: i32,
}
/// Value for Event Params and UserProperty can be of type string or int or
/// float or double.
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(default)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AnalyticsValue {
    #[prost(oneof = "analytics_value::ParamValue", tags = "1, 2, 3, 4")]
    pub param_value: ::core::option::Option<analytics_value::ParamValue>,
}
/// Nested message and enum types in `AnalyticsValue`.
pub mod analytics_value {
    #[derive(serde::Serialize, serde::Deserialize)]
    #[serde(default)]
    #[serde(rename_all = "snake_case")]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum ParamValue {
        #[prost(string, tag = "1")]
        StringValue(::prost::alloc::string::String),
        #[prost(int64, tag = "2")]
        IntValue(i64),
        #[prost(float, tag = "3")]
        FloatValue(f32),
        #[prost(double, tag = "4")]
        DoubleValue(f64),
    }
}
/// Message containing device informations.
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(default)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeviceInfo {
    /// Device category.
    /// Eg. tablet or mobile.
    #[prost(string, tag = "1")]
    pub device_category: ::prost::alloc::string::String,
    /// Device brand name.
    /// Eg. Samsung, HTC, etc.
    #[prost(string, tag = "2")]
    pub mobile_brand_name: ::prost::alloc::string::String,
    /// Device model name.
    /// Eg. GT-I9192
    #[prost(string, tag = "3")]
    pub mobile_model_name: ::prost::alloc::string::String,
    /// Device marketing name.
    /// Eg. Galaxy S4 Mini
    #[prost(string, tag = "4")]
    pub mobile_marketing_name: ::prost::alloc::string::String,
    /// Device model.
    /// Eg. GT-I9192
    #[prost(string, tag = "12")]
    pub device_model: ::prost::alloc::string::String,
    /// Device OS version when data capture ended.
    /// Eg. 4.4.2
    #[prost(string, tag = "6")]
    pub platform_version: ::prost::alloc::string::String,
    /// Vendor specific device identifier. This is IDFV on iOS. Not used for
    /// Android.
    /// Example: "599F9C00-92DC-4B5C-9464-7971F01F8370"
    #[prost(string, tag = "7")]
    pub device_id: ::prost::alloc::string::String,
    /// The type of the resettable_device_id is always IDFA on iOS and AdId
    /// on Android.
    /// Example: "71683BF9-FA3B-4B0D-9535-A1F05188BAF3"
    #[prost(string, tag = "8")]
    pub resettable_device_id: ::prost::alloc::string::String,
    /// The user language.
    /// Eg. "en-us", "en-za", "zh-tw", "jp"
    #[prost(string, tag = "9")]
    pub user_default_language: ::prost::alloc::string::String,
    /// The timezone of the device when data was uploaded as seconds skew from UTC.
    #[prost(int32, tag = "10")]
    pub device_time_zone_offset_seconds: i32,
    /// The device's Limit Ad Tracking setting.
    /// When true, we cannot use device_id for remarketing, demographics or
    /// influencing ads serving behaviour. However, we can use device_id for
    /// conversion tracking and campaign attribution.
    #[prost(bool, tag = "11")]
    pub limited_ad_tracking: bool,
}
/// Message which contains App Information.
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(default)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AppInfo {
    /// The app's version name
    /// Examples: "1.0", "4.3.1.1.213361", "2.3 (1824253)", "v1.8b22p6"
    #[prost(string, tag = "1")]
    pub app_version: ::prost::alloc::string::String,
    /// Unique id for this instance of the app.
    /// Example: "71683BF9FA3B4B0D9535A1F05188BAF3"
    #[prost(string, tag = "2")]
    pub app_instance_id: ::prost::alloc::string::String,
    /// The identifier of the store that installed the app.
    /// Eg. "com.sec.android.app.samsungapps", "com.amazon.venezia",
    /// "com.nokia.nstore"
    #[prost(string, tag = "3")]
    pub app_store: ::prost::alloc::string::String,
    /// The app platform.
    /// Eg "ANDROID", "IOS".
    #[prost(string, tag = "4")]
    pub app_platform: ::prost::alloc::string::String,
    /// Unique application identifier within an app store.
    #[prost(string, tag = "5")]
    pub app_id: ::prost::alloc::string::String,
}
/// User's geographic informaiton.
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(default)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GeoInfo {
    /// The geographic continent.
    /// Eg. Americas
    #[prost(string, tag = "1")]
    pub continent: ::prost::alloc::string::String,
    /// The geographic country.
    /// Eg. Brazil
    #[prost(string, tag = "2")]
    pub country: ::prost::alloc::string::String,
    /// The geographic region.
    /// Eg. State of Sao Paulo
    #[prost(string, tag = "3")]
    pub region: ::prost::alloc::string::String,
    /// The geographic city.
    /// Eg. Sao Paulo
    #[prost(string, tag = "4")]
    pub city: ::prost::alloc::string::String,
}
/// Mesage containing marketing campaign information which acquired the user.
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(default)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TrafficSource {
    /// The name of the campaign which acquired the user.
    #[prost(string, tag = "2")]
    pub user_acquired_campaign: ::prost::alloc::string::String,
    /// The name of the network which acquired the user.
    #[prost(string, tag = "3")]
    pub user_acquired_source: ::prost::alloc::string::String,
    /// The name of the medium which acquired the user.
    #[prost(string, tag = "4")]
    pub user_acquired_medium: ::prost::alloc::string::String,
}
/// Message containing information regarding the bundle in which these
/// events were uploaded.
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(default)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct ExportBundleInfo {
    /// Monotonically increasing index for each bundle set by SDK.
    #[prost(int32, tag = "1")]
    pub bundle_sequence_id: i32,
    /// Timestamp offset between collection time and upload time.
    #[prost(int64, tag = "2")]
    pub server_timestamp_offset_micros: i64,
}
/// Lifetime Value information about this user.
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(default)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LtvInfo {
    /// The Lifetime Value revenue of this user.
    #[prost(double, tag = "1")]
    pub revenue: f64,
    /// The currency corresponding to the revenue.
    #[prost(string, tag = "2")]
    pub currency: ::prost::alloc::string::String,
}
/// Message containing information pertaining to the event.
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(default)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EventDimensions {
    /// The date on which this event was logged.
    /// (YYYYMMDD format in the registered timezone of your app.)
    #[prost(string, tag = "6")]
    pub date: ::prost::alloc::string::String,
    /// The name of this event.
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// A repeated record of the parameters associated with this event.
    #[prost(map = "string, message", tag = "2")]
    pub params: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        AnalyticsValue,
    >,
    /// UTC client time when the event happened.
    #[prost(int64, tag = "4")]
    pub timestamp_micros: i64,
    /// UTC client time when the previous event happened.
    #[prost(int64, tag = "5")]
    pub previous_timestamp_micros: i64,
    /// Value param in USD.
    #[prost(double, tag = "7")]
    pub value_in_usd: f64,
}
/// The CloudEvent raised when a Firebase Analytics log is written.
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(default)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AnalyticsLogWrittenEvent {
    /// The data associated with the event.
    #[prost(message, optional, tag = "1")]
    pub data: ::core::option::Option<AnalyticsLogData>,
}