osdm_sys/models/
combination_tag.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/// CombinationTag : Tag to indicate that some products from a provider can be sold only when in conjunction with product(s) from another provider using the same tag. At least one, not all, combinationTags must be in common to allow combination. No combinationTags indicate that there are no combination constraints on the product. 
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct CombinationTag {
17    #[serde(rename = "id")]
18    pub id: String,
19    /// If false it means that this product can be sold also when not in conjunction with a product with the same tag. This is needed to propose specific products from one provider that depend on public ones of another. 
20    #[serde(rename = "needsToBeCombined", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
21    pub needs_to_be_combined: Option<Option<bool>>,
22}
23
24impl CombinationTag {
25    /// Tag to indicate that some products from a provider can be sold only when in conjunction with product(s) from another provider using the same tag. At least one, not all, combinationTags must be in common to allow combination. No combinationTags indicate that there are no combination constraints on the product. 
26    pub fn new(id: String) -> CombinationTag {
27        CombinationTag {
28            id,
29            needs_to_be_combined: None,
30        }
31    }
32}
33