Skip to main content

nominal_api/conjure/objects/scout/integrations/api/
update_simple_webhook_details.rs

1#[derive(
2    Debug,
3    Clone,
4    conjure_object::serde::Serialize,
5    conjure_object::serde::Deserialize,
6    PartialEq,
7    Eq,
8    PartialOrd,
9    Ord,
10    Hash
11)]
12#[serde(crate = "conjure_object::serde")]
13#[conjure_object::private::staged_builder::staged_builder]
14#[builder(crate = conjure_object::private::staged_builder, update, inline)]
15pub struct UpdateSimpleWebhookDetails {
16    #[builder(into)]
17    #[serde(rename = "webhook")]
18    webhook: String,
19    #[builder(default, into)]
20    #[serde(rename = "secret", skip_serializing_if = "Option::is_none", default)]
21    secret: Option<String>,
22    #[builder(default, into)]
23    #[serde(rename = "contentType", skip_serializing_if = "Option::is_none", default)]
24    content_type: Option<super::WebhookContentType>,
25    #[builder(default, into)]
26    #[serde(rename = "timeoutSeconds", skip_serializing_if = "Option::is_none", default)]
27    timeout_seconds: Option<i32>,
28    #[builder(default, into)]
29    #[serde(rename = "customHeaders", skip_serializing_if = "Option::is_none", default)]
30    custom_headers: Option<std::collections::BTreeMap<String, String>>,
31}
32impl UpdateSimpleWebhookDetails {
33    /// Constructs a new instance of the type.
34    #[inline]
35    pub fn new(webhook: impl Into<String>) -> Self {
36        Self::builder().webhook(webhook).build()
37    }
38    /// Webhook URL (must be HTTPS in production)
39    #[inline]
40    pub fn webhook(&self) -> &str {
41        &*self.webhook
42    }
43    /// Optional secret for HMAC-SHA256 signing
44    #[inline]
45    pub fn secret(&self) -> Option<&str> {
46        self.secret.as_ref().map(|o| &**o)
47    }
48    /// Content-Type for requests
49    #[inline]
50    pub fn content_type(&self) -> Option<&super::WebhookContentType> {
51        self.content_type.as_ref().map(|o| &*o)
52    }
53    /// HTTP request timeout in seconds
54    #[inline]
55    pub fn timeout_seconds(&self) -> Option<i32> {
56        self.timeout_seconds.as_ref().map(|o| *o)
57    }
58    /// Additional headers to include in all requests
59    #[inline]
60    pub fn custom_headers(&self) -> Option<&std::collections::BTreeMap<String, String>> {
61        self.custom_headers.as_ref().map(|o| &*o)
62    }
63}