Skip to main content

nominal_api/conjure/clients/scout/webhook/template/
webhook_template_service.rs

1use conjure_http::endpoint;
2#[conjure_http::conjure_client(name = "WebhookTemplateService")]
3pub trait WebhookTemplateService<
4    #[response_body]
5    I: Iterator<
6            Item = Result<conjure_http::private::Bytes, conjure_http::private::Error>,
7        >,
8> {
9    /// Validates a Handlebars webhook template and returns the evaluated payload.
10    /// Checks for template syntax errors and validates that the result is valid JSON.
11    #[endpoint(
12        method = POST,
13        path = "/scout/v1/webhook-templates/validate",
14        name = "validateTemplate",
15        accept = conjure_http::client::StdResponseDeserializer
16    )]
17    fn validate_template(
18        &self,
19        #[auth]
20        auth_: &conjure_object::BearerToken,
21        #[body(serializer = conjure_http::client::StdRequestSerializer)]
22        request: &super::super::super::super::super::objects::scout::webhook::template::api::ValidateTemplateRequest,
23    ) -> Result<
24        super::super::super::super::super::objects::scout::webhook::template::api::ValidationResult,
25        conjure_http::private::Error,
26    >;
27    /// Sends a test webhook using the specified integration and template.
28    /// This allows users to verify their webhook configuration before using it in procedures.
29    #[endpoint(
30        method = POST,
31        path = "/scout/v1/webhook-templates/test",
32        name = "testWebhook",
33        accept = conjure_http::client::StdResponseDeserializer
34    )]
35    fn test_webhook(
36        &self,
37        #[auth]
38        auth_: &conjure_object::BearerToken,
39        #[body(serializer = conjure_http::client::StdRequestSerializer)]
40        request: &super::super::super::super::super::objects::scout::webhook::template::api::TestWebhookRequest,
41    ) -> Result<
42        super::super::super::super::super::objects::scout::webhook::template::api::TestWebhookResponse,
43        conjure_http::private::Error,
44    >;
45}
46#[conjure_http::conjure_client(name = "WebhookTemplateService")]
47pub trait AsyncWebhookTemplateService<
48    #[response_body]
49    I: conjure_http::private::Stream<
50            Item = Result<conjure_http::private::Bytes, conjure_http::private::Error>,
51        >,
52> {
53    /// Validates a Handlebars webhook template and returns the evaluated payload.
54    /// Checks for template syntax errors and validates that the result is valid JSON.
55    #[endpoint(
56        method = POST,
57        path = "/scout/v1/webhook-templates/validate",
58        name = "validateTemplate",
59        accept = conjure_http::client::StdResponseDeserializer
60    )]
61    async fn validate_template(
62        &self,
63        #[auth]
64        auth_: &conjure_object::BearerToken,
65        #[body(serializer = conjure_http::client::StdRequestSerializer)]
66        request: &super::super::super::super::super::objects::scout::webhook::template::api::ValidateTemplateRequest,
67    ) -> Result<
68        super::super::super::super::super::objects::scout::webhook::template::api::ValidationResult,
69        conjure_http::private::Error,
70    >;
71    /// Sends a test webhook using the specified integration and template.
72    /// This allows users to verify their webhook configuration before using it in procedures.
73    #[endpoint(
74        method = POST,
75        path = "/scout/v1/webhook-templates/test",
76        name = "testWebhook",
77        accept = conjure_http::client::StdResponseDeserializer
78    )]
79    async fn test_webhook(
80        &self,
81        #[auth]
82        auth_: &conjure_object::BearerToken,
83        #[body(serializer = conjure_http::client::StdRequestSerializer)]
84        request: &super::super::super::super::super::objects::scout::webhook::template::api::TestWebhookRequest,
85    ) -> Result<
86        super::super::super::super::super::objects::scout::webhook::template::api::TestWebhookResponse,
87        conjure_http::private::Error,
88    >;
89}
90#[conjure_http::conjure_client(name = "WebhookTemplateService", local)]
91pub trait LocalAsyncWebhookTemplateService<
92    #[response_body]
93    I: conjure_http::private::Stream<
94            Item = Result<conjure_http::private::Bytes, conjure_http::private::Error>,
95        >,
96> {
97    /// Validates a Handlebars webhook template and returns the evaluated payload.
98    /// Checks for template syntax errors and validates that the result is valid JSON.
99    #[endpoint(
100        method = POST,
101        path = "/scout/v1/webhook-templates/validate",
102        name = "validateTemplate",
103        accept = conjure_http::client::StdResponseDeserializer
104    )]
105    async fn validate_template(
106        &self,
107        #[auth]
108        auth_: &conjure_object::BearerToken,
109        #[body(serializer = conjure_http::client::StdRequestSerializer)]
110        request: &super::super::super::super::super::objects::scout::webhook::template::api::ValidateTemplateRequest,
111    ) -> Result<
112        super::super::super::super::super::objects::scout::webhook::template::api::ValidationResult,
113        conjure_http::private::Error,
114    >;
115    /// Sends a test webhook using the specified integration and template.
116    /// This allows users to verify their webhook configuration before using it in procedures.
117    #[endpoint(
118        method = POST,
119        path = "/scout/v1/webhook-templates/test",
120        name = "testWebhook",
121        accept = conjure_http::client::StdResponseDeserializer
122    )]
123    async fn test_webhook(
124        &self,
125        #[auth]
126        auth_: &conjure_object::BearerToken,
127        #[body(serializer = conjure_http::client::StdRequestSerializer)]
128        request: &super::super::super::super::super::objects::scout::webhook::template::api::TestWebhookRequest,
129    ) -> Result<
130        super::super::super::super::super::objects::scout::webhook::template::api::TestWebhookResponse,
131        conjure_http::private::Error,
132    >;
133}