Skip to main content

netbox_openapi/models/
extras_image_attachments_create_request.rs

1/*
2 * NetBox REST API
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: 4.6.2 (4.6)
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
12pub struct ExtrasImageAttachmentsCreateRequest {
13    #[serde(rename = "object_type")]
14    pub object_type: String,
15    #[serde(rename = "object_id")]
16    pub object_id: i64,
17    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
18    pub name: Option<String>,
19    #[serde(rename = "image")]
20    pub image: std::path::PathBuf,
21    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
22    pub description: Option<String>,
23}
24
25impl ExtrasImageAttachmentsCreateRequest {
26    pub fn new(
27        object_type: String,
28        object_id: i64,
29        image: std::path::PathBuf,
30    ) -> ExtrasImageAttachmentsCreateRequest {
31        ExtrasImageAttachmentsCreateRequest {
32            object_type,
33            object_id,
34            name: None,
35            image,
36            description: None,
37        }
38    }
39}