opensearch-client 0.3.1

Strongly typed OpenSearch Client
Documentation
/*
 * opensearch-client
 *
 * Rust Client for OpenSearch
 *
 * The version of the OpenAPI document: 3.1.0
 * Contact: alberto.paro@gmail.com
 * Generated by Paro OpenAPI Generator
 */

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

/// GeoLocation

/// A latitude/longitude as a two-dimensional point. It can be represented in the following ways:
/// - As a `{lat, long}` object.
/// - As a geohash value.
/// - As a `[lon, lat]` array.
/// - As a string in `"<lat>, <lon>"` or WKT point format.
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GeoLocation {
    TextValue(String),
    LatLonGeoLocation(common::LatLonGeoLocation),
    CoordsValue(Vec<f64>),
    GeoHashLocation(common::GeoHashLocation),
}

impl Default for GeoLocation {
    fn default() -> GeoLocation {
        GeoLocation::CoordsValue(vec![0.0, 0.0])
    }
}