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};

/// GetNumberOfFollowersResponse : Get number of followers
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct GetNumberOfFollowersResponse {
    /// Calculation status.
    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
    pub status: Option<Status>,
    /// The number of times, as of the specified date, that a user added this LINE Official Account as a friend for the first time. The number doesn't decrease even if a user later blocks the account or when they delete their LINE account.
    #[serde(rename = "followers", skip_serializing_if = "Option::is_none")]
    pub followers: Option<i64>,
    /// The number of users, as of the specified date, that the LINE Official Account can reach through targeted messages based on gender, age, and/or region. This number only includes users who are active on LINE or LINE services and whose demographics have a high level of certainty.
    #[serde(rename = "targetedReaches", skip_serializing_if = "Option::is_none")]
    pub targeted_reaches: Option<i64>,
    /// The number of users blocking the account as of the specified date. The number decreases when a user unblocks the account.   
    #[serde(rename = "blocks", skip_serializing_if = "Option::is_none")]
    pub blocks: Option<i64>,
}

impl GetNumberOfFollowersResponse {
    /// Get number of followers
    pub fn new() -> GetNumberOfFollowersResponse {
        GetNumberOfFollowersResponse {
            status: None,
            followers: None,
            targeted_reaches: None,
            blocks: None,
        }
    }
}
/// Calculation status.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
#[allow(non_camel_case_types)]
pub enum Status {
    #[serde(rename = "ready")]
    Ready,
    #[serde(rename = "unready")]
    Unready,
    #[serde(rename = "out_of_service")]
    OutOfService,
}

impl Default for Status {
    fn default() -> Status {
        Self::Ready
    }
}