webhook_line/models/
link_content.rs

1/*
2 * Webhook Type Definition
3 *
4 * Webhook event definition of the LINE Messaging API
5 *
6 * The version of the OpenAPI document: 1.0.0
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// LinkContent : Content of the account link event.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct LinkContent {
17    /// One of the following values to indicate whether linking the account was successful or not
18    #[serde(rename = "result")]
19    pub result: Result,
20    /// Specified nonce (number used once) when verifying the user ID.
21    #[serde(rename = "nonce")]
22    pub nonce: String,
23}
24
25impl LinkContent {
26    /// Content of the account link event.
27    pub fn new(result: Result, nonce: String) -> LinkContent {
28        LinkContent {
29            result,
30            nonce,
31        }
32    }
33}
34/// One of the following values to indicate whether linking the account was successful or not
35#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
36pub enum Result {
37    #[serde(rename = "ok")]
38    Ok,
39    #[serde(rename = "failed")]
40    Failed,
41}
42
43impl Default for Result {
44    fn default() -> Result {
45        Self::Ok
46    }
47}
48