// Telegram Bot SDK for Swift (unofficial).
// This file is autogenerated by API/generate_wrappers.rb script.

import Foundation
import SwiftyJSON

/// Represents a location on a map. By default, the location will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the location.
///
/// - SeeAlso: <https://core.telegram.org/bots/api#inlinequeryresultlocation>

public struct InlineQueryResultLocation: JsonConvertible {
    /// Original JSON for fields not yet added to Swift structures.
    public var json: JSON

    /// Type of the result, must be location
    public var type_string: String {
        get { return json["type"].stringValue }
        set { json["type"].stringValue = newValue }
    }

    /// Unique identifier for this result, 1-64 Bytes
    public var id: String {
        get { return json["id"].stringValue }
        set { json["id"].stringValue = newValue }
    }

    /// Location latitude in degrees
    public var latitude: Float {
        get { return json["latitude"].floatValue }
        set { json["latitude"].floatValue = newValue }
    }

    /// Location longitude in degrees
    public var longitude: Float {
        get { return json["longitude"].floatValue }
        set { json["longitude"].floatValue = newValue }
    }

    /// Location title
    public var title: String {
        get { return json["title"].stringValue }
        set { json["title"].stringValue = newValue }
    }

    /// Optional. Inline keyboard attached to the message
    public var reply_markup: InlineKeyboardMarkup? {
        get {
            let value = json["reply_markup"]
            return value.isNullOrUnknown ? nil : InlineKeyboardMarkup(json: value)
        }
        set {
            json["reply_markup"] = newValue?.json ?? JSON.null
        }
    }

    /// Optional. Content of the message to be sent instead of the location
    public var input_message_content: InputMessageContent? {
        get {
            let value = json["input_message_content"]
            return value.isNullOrUnknown ? nil : InputMessageContent(json: value)
        }
        set {
            json["input_message_content"] = newValue?.json ?? JSON.null
        }
    }

    /// Optional. Url of the thumbnail for the result
    public var thumb_url: String? {
        get { return json["thumb_url"].string }
        set { json["thumb_url"].string = newValue }
    }

    /// Optional. Thumbnail width
    public var thumb_width: Int? {
        get { return json["thumb_width"].int }
        set { json["thumb_width"].int = newValue }
    }

    /// Optional. Thumbnail height
    public var thumb_height: Int? {
        get { return json["thumb_height"].int }
        set { json["thumb_height"].int = newValue }
    }

    public init(json: JSON = [:]) {
        self.json = json
    }
}
