nautobot_openapi/models/
image_attachment_request.rs1#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct ImageAttachmentRequest {
15 #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
16 pub id: Option<uuid::Uuid>,
17 #[serde(rename = "content_type")]
18 pub content_type: String,
19 #[serde(rename = "object_id")]
20 pub object_id: uuid::Uuid,
21 #[serde(rename = "image")]
22 pub image: std::path::PathBuf,
23 #[serde(rename = "image_height")]
24 pub image_height: i32,
25 #[serde(rename = "image_width")]
26 pub image_width: i32,
27 #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
28 pub name: Option<String>,
29}
30
31impl ImageAttachmentRequest {
32 pub fn new(
34 content_type: String,
35 object_id: uuid::Uuid,
36 image: std::path::PathBuf,
37 image_height: i32,
38 image_width: i32,
39 ) -> ImageAttachmentRequest {
40 ImageAttachmentRequest {
41 id: None,
42 content_type,
43 object_id,
44 image,
45 image_height,
46 image_width,
47 name: None,
48 }
49 }
50}