line-bot-sdk-rust 3.0.0

LINE Messaging API SDK for Rust
Documentation
/*
* Copyright (C) 2016 LINE Corp.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*     http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/*
 * LINE Messaging API(Insight)
 *
 * This document describes LINE Messaging API(Insight).
 *
 * The version of the OpenAPI document: 0.0.1
 *
 * Generated by: https://openapi-generator.tech
 */

use crate::line_insight::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct GetStatisticsPerUnitResponseMessage {
    /// Bubble's serial number.
    #[serde(rename = "seq")]
    pub seq: i32,
    /// Number of times the bubble was displayed.
    #[serde(rename = "impression", skip_serializing_if = "Option::is_none")]
    pub impression: Option<i64>,
    /// Number of times audio or video in the bubble started playing.
    #[serde(rename = "mediaPlayed", skip_serializing_if = "Option::is_none")]
    pub media_played: Option<i64>,
    /// Number of times audio or video in the bubble started playing and was played 25% of the total time.
    #[serde(
        rename = "mediaPlayed25Percent",
        skip_serializing_if = "Option::is_none"
    )]
    pub media_played25_percent: Option<i64>,
    /// Number of times audio or video in the bubble started playing and was played 50% of the total time.
    #[serde(
        rename = "mediaPlayed50Percent",
        skip_serializing_if = "Option::is_none"
    )]
    pub media_played50_percent: Option<i64>,
    /// Number of times audio or video in the bubble started playing and was played 75% of the total time.
    #[serde(
        rename = "mediaPlayed75Percent",
        skip_serializing_if = "Option::is_none"
    )]
    pub media_played75_percent: Option<i64>,
    /// Number of times audio or video in the bubble started playing and was played 100% of the total time.
    #[serde(
        rename = "mediaPlayed100Percent",
        skip_serializing_if = "Option::is_none"
    )]
    pub media_played100_percent: Option<i64>,
    /// Number of users the bubble was displayed.
    #[serde(rename = "uniqueImpression", skip_serializing_if = "Option::is_none")]
    pub unique_impression: Option<i64>,
    /// Number of users that started playing audio or video in the bubble.
    #[serde(rename = "uniqueMediaPlayed", skip_serializing_if = "Option::is_none")]
    pub unique_media_played: Option<i64>,
    /// Number of users that started playing audio or video in the bubble and played 25% of the total time.
    #[serde(
        rename = "uniqueMediaPlayed25Percent",
        skip_serializing_if = "Option::is_none"
    )]
    pub unique_media_played25_percent: Option<i64>,
    /// Number of users that started playing audio or video in the bubble and played 50% of the total time.
    #[serde(
        rename = "uniqueMediaPlayed50Percent",
        skip_serializing_if = "Option::is_none"
    )]
    pub unique_media_played50_percent: Option<i64>,
    /// Number of users that started playing audio or video in the bubble and played 75% of the total time.
    #[serde(
        rename = "uniqueMediaPlayed75Percent",
        skip_serializing_if = "Option::is_none"
    )]
    pub unique_media_played75_percent: Option<i64>,
    /// Number of users that started playing audio or video in the bubble and played 100% of the total time.
    #[serde(
        rename = "uniqueMediaPlayed100Percent",
        skip_serializing_if = "Option::is_none"
    )]
    pub unique_media_played100_percent: Option<i64>,
}

impl GetStatisticsPerUnitResponseMessage {
    pub fn new(seq: i32) -> GetStatisticsPerUnitResponseMessage {
        GetStatisticsPerUnitResponseMessage {
            seq,
            impression: None,
            media_played: None,
            media_played25_percent: None,
            media_played50_percent: None,
            media_played75_percent: None,
            media_played100_percent: None,
            unique_impression: None,
            unique_media_played: None,
            unique_media_played25_percent: None,
            unique_media_played50_percent: None,
            unique_media_played75_percent: None,
            unique_media_played100_percent: None,
        }
    }
}