mobilitydata_client/models/location.rs
1/*
2 * Mobility Database Catalog
3 *
4 * API for the Mobility Database Catalog. See [https://mobilitydatabase.org/](https://mobilitydatabase.org/). The Mobility Database API uses OAuth2 authentication. To initiate a successful API request, an access token must be included as a bearer token in the HTTP header. Access tokens are valid for one hour. To obtain an access token, you'll first need a refresh token, which is long-lived and does not expire.
5 *
6 * The version of the OpenAPI document: 1.0.0
7 * Contact: api@mobilitydata.org
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct Location {
16 /// ISO 3166-1 alpha-2 code designating the country where the system is located. For a list of valid codes [see here](https://unece.org/trade/uncefact/unlocode-country-subdivisions-iso-3166-2).
17 #[serde(rename = "country_code", skip_serializing_if = "Option::is_none")]
18 pub country_code: Option<String>,
19 /// The english name of the country where the system is located.
20 #[serde(rename = "country", skip_serializing_if = "Option::is_none")]
21 pub country: Option<String>,
22 /// ISO 3166-2 english subdivision name designating the subdivision (e.g province, state, region) where the system is located. For a list of valid names [see here](https://unece.org/trade/uncefact/unlocode-country-subdivisions-iso-3166-2).
23 #[serde(rename = "subdivision_name", skip_serializing_if = "Option::is_none")]
24 pub subdivision_name: Option<String>,
25 /// Primary municipality in english in which the transit system is located.
26 #[serde(rename = "municipality", skip_serializing_if = "Option::is_none")]
27 pub municipality: Option<String>,
28}
29
30impl Location {
31 pub fn new() -> Location {
32 Location {
33 country_code: None,
34 country: None,
35 subdivision_name: None,
36 municipality: None,
37 }
38 }
39}
40