Skip to main content

nautobot_openapi/models/
bulk_writable_role_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/// BulkWritableRoleRequest : Serializer for `Role` objects.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct BulkWritableRoleRequest {
15    #[serde(rename = "id")]
16    pub id: uuid::Uuid,
17    #[serde(rename = "content_types")]
18    pub content_types: Vec<String>,
19    #[serde(rename = "name")]
20    pub name: String,
21    /// RGB color in hexadecimal (e.g. 00ff00)
22    #[serde(rename = "color", skip_serializing_if = "Option::is_none")]
23    pub color: Option<String>,
24    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
25    pub description: Option<String>,
26    #[serde(
27        rename = "weight",
28        default,
29        with = "::serde_with::rust::double_option",
30        skip_serializing_if = "Option::is_none"
31    )]
32    pub weight: Option<Option<i32>>,
33    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
34    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
35    #[serde(rename = "relationships", skip_serializing_if = "Option::is_none")]
36    pub relationships: Option<
37        ::std::collections::HashMap<
38            String,
39            crate::models::ApprovalWorkflowDefinitionRequestRelationshipsValue,
40        >,
41    >,
42}
43
44impl BulkWritableRoleRequest {
45    /// Serializer for `Role` objects.
46    pub fn new(
47        id: uuid::Uuid,
48        content_types: Vec<String>,
49        name: String,
50    ) -> BulkWritableRoleRequest {
51        BulkWritableRoleRequest {
52            id,
53            content_types,
54            name,
55            color: None,
56            description: None,
57            weight: None,
58            custom_fields: None,
59            relationships: None,
60        }
61    }
62}