Skip to main content

nominal_api/conjure/errors/scout/integrations/api/
invalid_webhook_url.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 InvalidWebhookUrl {
16    #[builder(into)]
17    #[serde(rename = "url")]
18    url: String,
19    #[builder(into)]
20    #[serde(rename = "reason")]
21    reason: String,
22}
23impl InvalidWebhookUrl {
24    /// Constructs a new instance of the type.
25    #[inline]
26    pub fn new(url: impl Into<String>, reason: impl Into<String>) -> Self {
27        Self::builder().url(url).reason(reason).build()
28    }
29    #[inline]
30    pub fn url(&self) -> &str {
31        &*self.url
32    }
33    #[inline]
34    pub fn reason(&self) -> &str {
35        &*self.reason
36    }
37}
38impl conjure_error::ErrorType for InvalidWebhookUrl {
39    #[inline]
40    fn code() -> conjure_error::ErrorCode {
41        conjure_error::ErrorCode::InvalidArgument
42    }
43    #[inline]
44    fn name() -> &'static str {
45        "Scout:InvalidWebhookUrl"
46    }
47    #[inline]
48    fn safe_args() -> &'static [&'static str] {
49        &["reason", "url"]
50    }
51}