osdm_sys/models/product_category.rs
1/*
2 * UIC 90918-10 - OSDM
3 *
4 * 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/)
5 *
6 * The version of the OpenAPI document: 3.7.0
7 * Contact: osdm@uic.org
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// ProductCategory : Product category based on NeTEx/SIRI. A product category is a classification for vehicle journeys to express some common properties of journeys for marketing and fare products. Provided by OJP.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct ProductCategory {
17 /// Full name of this product category, e.g. 'TGV Lyria' in Switzerland and France. UIC: Long name of Service Brand
18 #[serde(rename = "name")]
19 pub name: String,
20 /// Short name or acronym of the product category, likely to be published, e.g. 'TGV' UIC: Abbreviation of Service Brand
21 #[serde(rename = "shortName")]
22 pub short_name: String,
23 /// Reference to a product category. Product categories should be defined once and used uniformly in all channels (e.g. NeTEx, SIRI, OJP). Provided by OJP.
24 #[serde(rename = "productCategoryRef", deserialize_with = "Option::deserialize")]
25 pub product_category_ref: Option<String>,
26}
27
28impl ProductCategory {
29 /// Product category based on NeTEx/SIRI. A product category is a classification for vehicle journeys to express some common properties of journeys for marketing and fare products. Provided by OJP.
30 pub fn new(name: String, short_name: String, product_category_ref: Option<String>) -> ProductCategory {
31 ProductCategory {
32 name,
33 short_name,
34 product_category_ref,
35 }
36 }
37}
38