messaging-api-line 0.0.2

This document describes LINE Messaging API.
Documentation
/*
 * LINE Messaging API
 *
 * This document describes LINE Messaging API.
 *
 * The version of the OpenAPI document: 0.0.1
 *
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct LocationMessage {
    /// Type of message
    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
    pub r#type: Option<String>,
    #[serde(rename = "quickReply", skip_serializing_if = "Option::is_none")]
    pub quick_reply: Option<Box<models::QuickReply>>,
    #[serde(rename = "sender", skip_serializing_if = "Option::is_none")]
    pub sender: Option<Box<models::Sender>>,
    #[serde(rename = "title")]
    pub title: String,
    #[serde(rename = "address")]
    pub address: String,
    #[serde(rename = "latitude")]
    pub latitude: f64,
    #[serde(rename = "longitude")]
    pub longitude: f64,
}

impl LocationMessage {
    pub fn new(
        r#type: String,
        title: String,
        address: String,
        latitude: f64,
        longitude: f64,
    ) -> LocationMessage {
        LocationMessage {
            r#type: Some(r#type),
            quick_reply: None,
            sender: None,
            title,
            address,
            latitude,
            longitude,
        }
    }
}