webhook_line/models/
location_message_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#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct LocationMessageContent {
16    /// Type
17    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
18    pub r#type: Option<String>,
19    /// Message ID
20    #[serde(rename = "id")]
21    pub id: String,
22    /// Title
23    #[serde(rename = "title", skip_serializing_if = "Option::is_none")]
24    pub title: Option<String>,
25    /// Address
26    #[serde(rename = "address", skip_serializing_if = "Option::is_none")]
27    pub address: Option<String>,
28    /// Latitude
29    #[serde(rename = "latitude")]
30    pub latitude: f64,
31    /// Longitude
32    #[serde(rename = "longitude")]
33    pub longitude: f64,
34}
35
36impl LocationMessageContent {
37    pub fn new(
38        r#type: String,
39        id: String,
40        latitude: f64,
41        longitude: f64,
42    ) -> LocationMessageContent {
43        LocationMessageContent {
44            r#type: Some(r#type),
45            id,
46            title: None,
47            address: None,
48            latitude,
49            longitude,
50        }
51    }
52}