Skip to main content

nautobot_openapi/models/
min_max_validation_rule_request.rs

1/*
2 * API Documentation
3 *
4 * Source of truth and network automation platform
5 *
6 * The version of the OpenAPI document: 3.1.0 (3.1)
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11/// MinMaxValidationRuleRequest : Serializer for `MinMaxValidationRule` objects.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct MinMaxValidationRuleRequest {
15    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
16    pub id: Option<uuid::Uuid>,
17    #[serde(rename = "content_type")]
18    pub content_type: String,
19    #[serde(rename = "name")]
20    pub name: String,
21    #[serde(rename = "field")]
22    pub field: String,
23    #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")]
24    pub enabled: Option<bool>,
25    /// Optional error message to display when validation fails.
26    #[serde(rename = "error_message", skip_serializing_if = "Option::is_none")]
27    pub error_message: Option<String>,
28    /// When set, apply a minimum value contraint to the value of the model field.
29    #[serde(
30        rename = "min",
31        default,
32        with = "::serde_with::rust::double_option",
33        skip_serializing_if = "Option::is_none"
34    )]
35    pub min: Option<Option<f64>>,
36    /// When set, apply a maximum value contraint to the value of the model field.
37    #[serde(
38        rename = "max",
39        default,
40        with = "::serde_with::rust::double_option",
41        skip_serializing_if = "Option::is_none"
42    )]
43    pub max: Option<Option<f64>>,
44    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
45    pub tags: Option<Vec<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>>,
46    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
47    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
48    #[serde(rename = "relationships", skip_serializing_if = "Option::is_none")]
49    pub relationships: Option<
50        ::std::collections::HashMap<
51            String,
52            crate::models::ApprovalWorkflowDefinitionRequestRelationshipsValue,
53        >,
54    >,
55}
56
57impl MinMaxValidationRuleRequest {
58    /// Serializer for `MinMaxValidationRule` objects.
59    pub fn new(content_type: String, name: String, field: String) -> MinMaxValidationRuleRequest {
60        MinMaxValidationRuleRequest {
61            id: None,
62            content_type,
63            name,
64            field,
65            enabled: None,
66            error_message: None,
67            min: None,
68            max: None,
69            tags: None,
70            custom_fields: None,
71            relationships: None,
72        }
73    }
74}