Skip to main content

mobilitydata_client/models/
license_rule.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 LicenseRule {
16    /// Name of the rule.
17    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
18    pub name: Option<String>,
19    /// Label of the rule.
20    #[serde(rename = "label", skip_serializing_if = "Option::is_none")]
21    pub label: Option<String>,
22    /// Description of the rule.
23    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
24    pub description: Option<String>,
25    /// Type of rule.
26    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
27    pub r#type: Option<Type>,
28}
29
30impl LicenseRule {
31    pub fn new() -> LicenseRule {
32        LicenseRule {
33            name: None,
34            label: None,
35            description: None,
36            r#type: None,
37        }
38    }
39}
40/// Type of rule.
41#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
42pub enum Type {
43    #[serde(rename = "permission")]
44    Permission,
45    #[serde(rename = "condition")]
46    Condition,
47    #[serde(rename = "limitation")]
48    Limitation,
49}
50
51impl Default for Type {
52    fn default() -> Type {
53        Self::Permission
54    }
55}
56