Skip to main content

nautobot_openapi/models/
bulk_writable_regular_expression_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/// BulkWritableRegularExpressionValidationRuleRequest : Serializer for `RegularExpressionValidationRule` objects.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct BulkWritableRegularExpressionValidationRuleRequest {
15    #[serde(rename = "id")]
16    pub id: 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    #[serde(rename = "regular_expression")]
29    pub regular_expression: String,
30    /// When enabled, the regular expression value is first processed as a Jinja2 template with access to the context of the data being validated in a variable named <code>object</code>.
31    #[serde(rename = "context_processing", skip_serializing_if = "Option::is_none")]
32    pub context_processing: Option<bool>,
33    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
34    pub tags: Option<Vec<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>>,
35    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
36    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
37    #[serde(rename = "relationships", skip_serializing_if = "Option::is_none")]
38    pub relationships: Option<
39        ::std::collections::HashMap<
40            String,
41            crate::models::ApprovalWorkflowDefinitionRequestRelationshipsValue,
42        >,
43    >,
44}
45
46impl BulkWritableRegularExpressionValidationRuleRequest {
47    /// Serializer for `RegularExpressionValidationRule` objects.
48    pub fn new(
49        id: uuid::Uuid,
50        content_type: String,
51        name: String,
52        field: String,
53        regular_expression: String,
54    ) -> BulkWritableRegularExpressionValidationRuleRequest {
55        BulkWritableRegularExpressionValidationRuleRequest {
56            id,
57            content_type,
58            name,
59            field,
60            enabled: None,
61            error_message: None,
62            regular_expression,
63            context_processing: None,
64            tags: None,
65            custom_fields: None,
66            relationships: None,
67        }
68    }
69}