noaa_weather_client 1.3.0

A client library for the NOAA weather.gov API
Documentation
use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct RelativeLocationGeoJson {
    #[serde(rename = "@context", skip_serializing_if = "Option::is_none")]
    pub at_context: Option<Box<models::JsonLdContext>>,
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    #[serde(rename = "type")]
    pub r#type: Type,
    #[serde(rename = "geometry", deserialize_with = "Option::deserialize")]
    pub geometry: Option<Box<models::GeoJsonGeometry>>,
    #[serde(rename = "properties")]
    pub properties: Box<models::RelativeLocation>,
}

impl RelativeLocationGeoJson {
    pub fn new(
        r#type: Type,
        geometry: Option<models::GeoJsonGeometry>,
        properties: models::RelativeLocation,
    ) -> RelativeLocationGeoJson {
        RelativeLocationGeoJson {
            at_context: None,
            id: None,
            r#type,
            geometry: geometry.map(Box::new),
            properties: Box::new(properties),
        }
    }
}
#[derive(
    Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize, Default,
)]
pub enum Type {
    #[serde(rename = "Feature")]
    #[default]
    Feature,
}