messaging_api_line/models/
number_of_messages_response.rs

1/*
2 * LINE Messaging API
3 *
4 * This document describes LINE Messaging API.
5 *
6 * The version of the OpenAPI document: 0.0.1
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct NumberOfMessagesResponse {
16    /// Aggregation process status. One of:  `ready`: The number of messages can be obtained. `unready`: We haven't finished calculating the number of sent messages for the specified in date. For example, this property is returned when the delivery date or a future date is specified. Calculation usually takes about a day. `unavailable_for_privacy`: The total number of messages on the specified day is less than 20. `out_of_service`: The specified date is earlier than the date on which we first started calculating sent messages (March 31, 2018). 
17    #[serde(rename = "status")]
18    pub status: Status,
19    /// The number of messages delivered using the phone number on the date specified in `date`. The response has this property only when the value of `status` is `ready`.  
20    #[serde(rename = "success", skip_serializing_if = "Option::is_none")]
21    pub success: Option<i64>,
22}
23
24impl NumberOfMessagesResponse {
25    pub fn new(status: Status) -> NumberOfMessagesResponse {
26        NumberOfMessagesResponse {
27            status,
28            success: None,
29        }
30    }
31}
32/// Aggregation process status. One of:  `ready`: The number of messages can be obtained. `unready`: We haven't finished calculating the number of sent messages for the specified in date. For example, this property is returned when the delivery date or a future date is specified. Calculation usually takes about a day. `unavailable_for_privacy`: The total number of messages on the specified day is less than 20. `out_of_service`: The specified date is earlier than the date on which we first started calculating sent messages (March 31, 2018). 
33#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
34pub enum Status {
35    #[serde(rename = "ready")]
36    Ready,
37    #[serde(rename = "unready")]
38    Unready,
39    #[serde(rename = "unavailable_for_privacy")]
40    UnavailableForPrivacy,
41    #[serde(rename = "out_of_service")]
42    OutOfService,
43}
44
45impl Default for Status {
46    fn default() -> Status {
47        Self::Ready
48    }
49}
50