Skip to main content

netbox_openapi/models/
patched_bulk_webhook_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.8 (4.6)
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11/// PatchedBulkWebhookRequest : Adds an `owner` field for models which have a ForeignKey to users.Owner.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct PatchedBulkWebhookRequest {
15    #[serde(rename = "id")]
16    pub id: i32,
17    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
18    pub name: Option<String>,
19    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
20    pub description: Option<String>,
21    /// This URL will be called using the HTTP method defined when the webhook is called. Must be http:// or <https://.> Jinja2 template processing is supported (with the same context as the request body) for part or all of the URL.
22    #[serde(rename = "payload_url", skip_serializing_if = "Option::is_none")]
23    pub payload_url: Option<String>,
24    /// * `GET` - GET * `POST` - POST * `PUT` - PUT * `PATCH` - PATCH * `DELETE` - DELETE
25    #[serde(rename = "http_method", skip_serializing_if = "Option::is_none")]
26    pub http_method: Option<HttpMethod>,
27    /// The complete list of official content types is available here (<https://www.iana.org/assignments/media-types/media-types.xhtml>).
28    #[serde(rename = "http_content_type", skip_serializing_if = "Option::is_none")]
29    pub http_content_type: Option<String>,
30    /// User-supplied HTTP headers to be sent with the request in addition to the HTTP content type. Headers should be defined in the format <code>Name: Value</code>. Jinja2 template processing is supported with the same context as the request body (below). When interpolating untrusted data (such as object attributes) into a header value, apply the <code>header_safe</code> filter to guard against HTTP header injection, e.g. <code>X-Object: {{ data.name | header_safe }}</code>.
31    #[serde(rename = "additional_headers", skip_serializing_if = "Option::is_none")]
32    pub additional_headers: Option<String>,
33    /// Jinja2 template for a custom request body. If blank, a JSON object representing the change will be included. Available context data includes: <code>event</code>, <code>model</code>, <code>timestamp</code>, <code>username</code>, <code>request_id</code>, and <code>data</code>.
34    #[serde(rename = "body_template", skip_serializing_if = "Option::is_none")]
35    pub body_template: Option<String>,
36    /// When provided, the request will include a <code>X-Hook-Signature</code> header containing a HMAC hex digest of the payload body using the secret as the key. The secret is not transmitted in the request.
37    #[serde(rename = "secret", skip_serializing_if = "Option::is_none")]
38    pub secret: Option<String>,
39    /// Enable SSL certificate verification. Disable with caution!
40    #[serde(rename = "ssl_verification", skip_serializing_if = "Option::is_none")]
41    pub ssl_verification: Option<bool>,
42    /// The specific CA certificate file to use for SSL verification. Leave blank to use the system defaults.
43    #[serde(
44        rename = "ca_file_path",
45        default,
46        with = "::serde_with::rust::double_option",
47        skip_serializing_if = "Option::is_none"
48    )]
49    pub ca_file_path: Option<Option<String>>,
50    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
51    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
52    #[serde(
53        rename = "owner",
54        default,
55        with = "::serde_with::rust::double_option",
56        skip_serializing_if = "Option::is_none"
57    )]
58    pub owner: Option<Option<Box<crate::models::AsnRangeRequestOwner>>>,
59    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
60    pub tags: Option<Vec<crate::models::NestedTagRequest>>,
61}
62
63impl PatchedBulkWebhookRequest {
64    /// Adds an `owner` field for models which have a ForeignKey to users.Owner.
65    pub fn new(id: i32) -> PatchedBulkWebhookRequest {
66        PatchedBulkWebhookRequest {
67            id,
68            name: None,
69            description: None,
70            payload_url: None,
71            http_method: None,
72            http_content_type: None,
73            additional_headers: None,
74            body_template: None,
75            secret: None,
76            ssl_verification: None,
77            ca_file_path: None,
78            custom_fields: None,
79            owner: None,
80            tags: None,
81        }
82    }
83}
84
85/// * `GET` - GET * `POST` - POST * `PUT` - PUT * `PATCH` - PATCH * `DELETE` - DELETE
86#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
87pub enum HttpMethod {
88    #[serde(rename = "GET")]
89    Get,
90    #[serde(rename = "POST")]
91    Post,
92    #[serde(rename = "PUT")]
93    Put,
94    #[serde(rename = "PATCH")]
95    Patch,
96    #[serde(rename = "DELETE")]
97    Delete,
98}
99
100impl Default for HttpMethod {
101    fn default() -> HttpMethod {
102        Self::Get
103    }
104}