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

/// GetFriendsDemographicsResponse : Get friend demographics
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct GetFriendsDemographicsResponse {
    /// true if friend demographic information is available.
    #[serde(rename = "available", skip_serializing_if = "Option::is_none")]
    pub available: Option<bool>,
    /// Percentage per gender.
    #[serde(rename = "genders", skip_serializing_if = "Option::is_none")]
    pub genders: Option<Vec<models::GenderTile>>,
    /// Percentage per age group.
    #[serde(rename = "ages", skip_serializing_if = "Option::is_none")]
    pub ages: Option<Vec<models::AgeTile>>,
    /// Percentage per area.
    #[serde(rename = "areas", skip_serializing_if = "Option::is_none")]
    pub areas: Option<Vec<models::AreaTile>>,
    /// Percentage by OS.
    #[serde(rename = "appTypes", skip_serializing_if = "Option::is_none")]
    pub app_types: Option<Vec<models::AppTypeTile>>,
    /// Percentage per friendship duration.
    #[serde(
        rename = "subscriptionPeriods",
        skip_serializing_if = "Option::is_none"
    )]
    pub subscription_periods: Option<Vec<models::SubscriptionPeriodTile>>,
}

impl GetFriendsDemographicsResponse {
    /// Get friend demographics
    pub fn new() -> GetFriendsDemographicsResponse {
        GetFriendsDemographicsResponse {
            available: None,
            genders: None,
            ages: None,
            areas: None,
            app_types: None,
            subscription_periods: None,
        }
    }
}