Skip to main content

nautobot_openapi/models/
bulk_writable_note_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/// BulkWritableNoteRequest : This base serializer implements common fields and logic for all ModelSerializers.  Namely, it:  - defines the `display` field which exposes a human friendly value for the given object. - ensures that `id` field is always present on the serializer as well. - ensures that `created` and `last_updated` fields are always present if applicable to this model and serializer. - ensures that `object_type` field is always present on the serializer which represents the content-type of this   serializer's associated model (e.g. \"dcim.device\"). This is required as the OpenAPI schema, using the   PolymorphicProxySerializer class defined below, relies upon this field as a way to identify to the client   which of several possible serializers are in use for a given attribute. - supports `?depth` query parameter. It is passed in as `nested_depth` to the `build_nested_field()` function   to enable the dynamic generation of nested serializers.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct BulkWritableNoteRequest {
15    #[serde(rename = "id")]
16    pub id: uuid::Uuid,
17    #[serde(rename = "assigned_object_type")]
18    pub assigned_object_type: String,
19    #[serde(rename = "assigned_object_id")]
20    pub assigned_object_id: uuid::Uuid,
21    #[serde(rename = "note")]
22    pub note: String,
23    #[serde(
24        rename = "user",
25        default,
26        with = "::serde_with::rust::double_option",
27        skip_serializing_if = "Option::is_none"
28    )]
29    pub user: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
30}
31
32impl BulkWritableNoteRequest {
33    /// This base serializer implements common fields and logic for all ModelSerializers.  Namely, it:  - defines the `display` field which exposes a human friendly value for the given object. - ensures that `id` field is always present on the serializer as well. - ensures that `created` and `last_updated` fields are always present if applicable to this model and serializer. - ensures that `object_type` field is always present on the serializer which represents the content-type of this   serializer's associated model (e.g. \"dcim.device\"). This is required as the OpenAPI schema, using the   PolymorphicProxySerializer class defined below, relies upon this field as a way to identify to the client   which of several possible serializers are in use for a given attribute. - supports `?depth` query parameter. It is passed in as `nested_depth` to the `build_nested_field()` function   to enable the dynamic generation of nested serializers.
34    pub fn new(
35        id: uuid::Uuid,
36        assigned_object_type: String,
37        assigned_object_id: uuid::Uuid,
38        note: String,
39    ) -> BulkWritableNoteRequest {
40        BulkWritableNoteRequest {
41            id,
42            assigned_object_type,
43            assigned_object_id,
44            note,
45            user: None,
46        }
47    }
48}