Skip to main content

osdm_sys/models/
product_search_request.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/// ProductSearchRequest : Search criteria to search for products 
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
17pub struct ProductSearchRequest {
18    /// id of the product 
19    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
20    pub id: Option<String>,
21    #[serde(rename = "types", skip_serializing_if = "Option::is_none")]
22    pub types: Option<Vec<String>>,
23    /// The product codes to be searched. 
24    #[serde(rename = "codes", skip_serializing_if = "Option::is_none")]
25    pub codes: Option<Vec<String>>,
26    #[serde(rename = "flexibilities", skip_serializing_if = "Option::is_none")]
27    pub flexibilities: Option<Vec<String>>,
28    #[serde(rename = "serviceClasses", skip_serializing_if = "Option::is_none")]
29    pub service_classes: Option<Vec<models::ServiceClass>>,
30    #[serde(rename = "travelClasses", skip_serializing_if = "Option::is_none")]
31    pub travel_classes: Option<Vec<String>>,
32    #[serde(rename = "fulfillmentOptions", skip_serializing_if = "Option::is_none")]
33    pub fulfillment_options: Option<Vec<models::FulfillmentOption>>,
34    /// product tags associated with the product
35    #[serde(rename = "productTags", skip_serializing_if = "Option::is_none")]
36    pub product_tags: Option<Vec<String>>,
37}
38
39impl ProductSearchRequest {
40    /// Search criteria to search for products 
41    pub fn new() -> ProductSearchRequest {
42        ProductSearchRequest {
43            id: None,
44            types: None,
45            codes: None,
46            flexibilities: None,
47            service_classes: None,
48            travel_classes: None,
49            fulfillment_options: None,
50            product_tags: None,
51        }
52    }
53}
54