netbox_openapi/models/
image_attachment.rs1#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct ImageAttachment {
15 #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
16 pub id: Option<i32>,
17 #[serde(rename = "url", skip_serializing_if = "Option::is_none")]
18 pub url: Option<String>,
19 #[serde(rename = "display", skip_serializing_if = "Option::is_none")]
20 pub display: Option<String>,
21 #[serde(rename = "object_type")]
22 pub object_type: String,
23 #[serde(rename = "object_id")]
24 pub object_id: i64,
25 #[serde(
26 rename = "parent",
27 default,
28 with = "::serde_with::rust::double_option",
29 skip_serializing_if = "Option::is_none"
30 )]
31 pub parent: Option<Option<serde_json::Value>>,
32 #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
33 pub name: Option<String>,
34 #[serde(rename = "image")]
35 pub image: String,
36 #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
37 pub description: Option<String>,
38 #[serde(rename = "image_height", skip_serializing_if = "Option::is_none")]
39 pub image_height: Option<i32>,
40 #[serde(rename = "image_width", skip_serializing_if = "Option::is_none")]
41 pub image_width: Option<i32>,
42 #[serde(
43 rename = "created",
44 default,
45 with = "::serde_with::rust::double_option",
46 skip_serializing_if = "Option::is_none"
47 )]
48 pub created: Option<Option<String>>,
49 #[serde(
50 rename = "last_updated",
51 default,
52 with = "::serde_with::rust::double_option",
53 skip_serializing_if = "Option::is_none"
54 )]
55 pub last_updated: Option<Option<String>>,
56}
57
58impl ImageAttachment {
59 pub fn new(object_type: String, object_id: i64, image: String) -> ImageAttachment {
61 ImageAttachment {
62 id: None,
63 url: None,
64 display: None,
65 object_type,
66 object_id,
67 parent: None,
68 name: None,
69 image,
70 description: None,
71 image_height: None,
72 image_width: None,
73 created: None,
74 last_updated: None,
75 }
76 }
77}