osdm-sys 0.1.0-alpha.3

Specifications for the OSDM API standard. The OSDM specification supports two modes of operation: Retailer Mode and Distributor Mode. The API works identically in both modes, except that in distributor mode the API also returns fare information. The following resources are key to get started: - [Processes](https://osdm.io/spec/processes/) - [Models](https://osdm.io/spec/models/) - [Getting started](https://osdm.io/spec/getting-started/)
Documentation
/*
 * UIC 90918-10 - OSDM
 *
 * Specifications for the OSDM API standard. The OSDM specification supports two modes of operation: Retailer Mode and Distributor Mode. The API works identically in both modes, except that in distributor mode the API also returns fare information.  The following resources are key to get started:    -  [Processes](https://osdm.io/spec/processes/)   -  [Models](https://osdm.io/spec/models/)   -  [Getting started](https://osdm.io/spec/getting-started/)
 *
 * The version of the OpenAPI document: 3.7.0
 * Contact: osdm@uic.org
 * Generated by: https://openapi-generator.tech
 */

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

#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
#[serde(tag = "objectType")]
pub enum PlaceRef {
    #[serde(rename = "AddressRef")]
    AddressRef {
        /// Reference to an address by id.
        #[serde(rename = "addressRef")]
        address_ref: String,
    },
    #[serde(rename = "FareConnectionPointRef")]
    FareConnectionPointRef {
        /// Reference to a fare connection point by id.
        #[serde(rename = "fareConnectionPointRef")]
        fare_connection_point_ref: String,
    },
    #[serde(rename = "GeoPositionRef")]
    GeoPositionRef {
        /// Latitude from equator. -90 (South) to +90 (North). Decimal degrees. e.g. 56.356.
        #[serde(rename = "latitude")]
        latitude: f64,
        /// Longitude from Greenwich Meridian. -180 (West) to +180 (East). Decimal degrees. eg 2.356.
        #[serde(rename = "longitude")]
        longitude: f64,
    },
    #[serde(rename = "PointOfInterestRef")]
    PointOfInterestRef {
        /// Reference to a point of interest by id.
        #[serde(rename = "pointOfInterestRef")]
        point_of_interest_ref: String,
    },
    #[serde(rename = "StopPlaceRef")]
    StopPlaceRef {
        /// Reference to a stop place using URNs to define code. For UIC see UIC MERITS/TAP-TSI station codes.
        #[serde(rename = "stopPlaceRef")]
        stop_place_ref: String,
    },
}

impl Default for PlaceRef {
    fn default() -> Self {
        Self::AddressRef {
            address_ref: Default::default(),
        }
    }
}