/*
* API Documentation
*
* Source of truth and network automation platform
*
* The version of the OpenAPI document: 2.4.20 (2.4)
*
* Generated by: https://openapi-generator.tech
*/
/// ObjectChange : 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.
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct ObjectChange {
#[serde(rename = "id", skip_serializing_if = "Option::is_none")]
pub id: Option<uuid::Uuid>,
#[serde(rename = "object_type", skip_serializing_if = "Option::is_none")]
pub object_type: Option<String>,
/// Human friendly display value
#[serde(rename = "display", skip_serializing_if = "Option::is_none")]
pub display: Option<String>,
#[serde(rename = "url", skip_serializing_if = "Option::is_none")]
pub url: Option<String>,
#[serde(rename = "natural_slug", skip_serializing_if = "Option::is_none")]
pub natural_slug: Option<String>,
#[serde(rename = "action", skip_serializing_if = "Option::is_none")]
pub action: Option<Box<crate::models::ObjectChangeAction>>,
#[serde(
rename = "changed_object_type",
skip_serializing_if = "Option::is_none"
)]
pub changed_object_type: Option<String>,
#[serde(
rename = "related_object_type",
skip_serializing_if = "Option::is_none"
)]
pub related_object_type: Option<String>,
#[serde(
rename = "changed_object",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub changed_object: Option<Option<Box<crate::models::ObjectChangeChangedObject>>>,
#[serde(rename = "time", skip_serializing_if = "Option::is_none")]
pub time: Option<String>,
#[serde(rename = "user_name", skip_serializing_if = "Option::is_none")]
pub user_name: Option<String>,
#[serde(rename = "request_id", skip_serializing_if = "Option::is_none")]
pub request_id: Option<uuid::Uuid>,
#[serde(rename = "changed_object_id")]
pub changed_object_id: uuid::Uuid,
#[serde(rename = "change_context", skip_serializing_if = "Option::is_none")]
pub change_context: Option<String>,
#[serde(
rename = "change_context_detail",
skip_serializing_if = "Option::is_none"
)]
pub change_context_detail: Option<String>,
#[serde(
rename = "related_object_id",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub related_object_id: Option<Option<uuid::Uuid>>,
#[serde(rename = "object_repr", skip_serializing_if = "Option::is_none")]
pub object_repr: Option<String>,
#[serde(
rename = "object_data",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub object_data: Option<Option<serde_json::Value>>,
#[serde(
rename = "object_data_v2",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub object_data_v2: Option<Option<serde_json::Value>>,
#[serde(
rename = "user",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub user: Option<Option<Box<crate::models::BulkWritableCircuitRequestTenant>>>,
}
impl ObjectChange {
/// 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.
pub fn new(changed_object_id: uuid::Uuid) -> ObjectChange {
ObjectChange {
id: None,
object_type: None,
display: None,
url: None,
natural_slug: None,
action: None,
changed_object_type: None,
related_object_type: None,
changed_object: None,
time: None,
user_name: None,
request_id: None,
changed_object_id,
change_context: None,
change_context_detail: None,
related_object_id: None,
object_repr: None,
object_data: None,
object_data_v2: None,
user: None,
}
}
}