fireblocks_sdk/apis/
webhooks_v2_api.rs

1// Fireblocks API
2//
3// Fireblocks provides a suite of applications to manage digital asset operations and a complete development platform to build your business on the blockchain.  - Visit our website for more information: [Fireblocks Website](https://fireblocks.com) - Visit our developer docs: [Fireblocks DevPortal](https://developers.fireblocks.com)
4//
5// The version of the OpenAPI document: 1.8.0
6// Contact: developers@fireblocks.com
7// Generated by: https://openapi-generator.tech
8
9use {
10    super::{Error, configuration},
11    crate::{
12        apis::{ContentType, ResponseContent},
13        models,
14    },
15    async_trait::async_trait,
16    reqwest,
17    serde::{Deserialize, Serialize, de::Error as _},
18    std::sync::Arc,
19};
20
21#[async_trait]
22pub trait WebhooksV2Api: Send + Sync {
23    /// POST /webhooks
24    ///
25    /// Creates a new webhook, which will be triggered on the specified events
26    /// **Endpoint Permissions:** Owner, Admin, Non-Signing Admin.
27    async fn create_webhook(
28        &self,
29        params: CreateWebhookParams,
30    ) -> Result<models::Webhook, Error<CreateWebhookError>>;
31
32    /// DELETE /webhooks/{webhookId}
33    ///
34    /// Delete a webhook by its ID.  **Endpoint Permissions:** Owner, Admin,
35    /// Non-Signing Admin.
36    async fn delete_webhook(
37        &self,
38        params: DeleteWebhookParams,
39    ) -> Result<models::Webhook, Error<DeleteWebhookError>>;
40
41    /// GET /webhooks/{webhookId}/notifications/{notificationId}
42    ///
43    /// Get a notification by its notification ID.  **Endpoint Permissions:**
44    /// Owner, Admin, Non-Signing Admin.
45    async fn get_notification(
46        &self,
47        params: GetNotificationParams,
48    ) -> Result<models::NotificationWithData, Error<GetNotificationError>>;
49
50    /// GET /webhooks/{webhookId}/notifications/{notificationId}/attempts
51    ///
52    /// Get notification attempts by notification ID.
53    async fn get_notification_attempts(
54        &self,
55        params: GetNotificationAttemptsParams,
56    ) -> Result<models::NotificationAttemptsPaginatedResponse, Error<GetNotificationAttemptsError>>;
57
58    /// GET /webhooks/{webhookId}/notifications
59    ///
60    /// Get all notifications by webhook ID (paginated).  **Endpoint
61    /// Permissions:** Owner, Admin, Non-Signing Admin.
62    async fn get_notifications(
63        &self,
64        params: GetNotificationsParams,
65    ) -> Result<models::NotificationPaginatedResponse, Error<GetNotificationsError>>;
66
67    /// GET /webhooks/{webhookId}/notifications/resend_failed/jobs/{jobId}
68    ///
69    /// Get the status of a resend job.
70    async fn get_resend_job_status(
71        &self,
72        params: GetResendJobStatusParams,
73    ) -> Result<models::ResendFailedNotificationsJobStatusResponse, Error<GetResendJobStatusError>>;
74
75    /// GET /webhooks/{webhookId}
76    ///
77    /// Retrieve a webhook by its ID.  **Endpoint Permissions:** Owner, Admin,
78    /// Non-Signing Admin.
79    async fn get_webhook(
80        &self,
81        params: GetWebhookParams,
82    ) -> Result<models::Webhook, Error<GetWebhookError>>;
83
84    /// GET /webhooks
85    ///
86    /// Get all webhooks (paginated).  **Endpoint Permissions:** Owner, Admin,
87    /// Non-Signing Admin.
88    async fn get_webhooks(
89        &self,
90        params: GetWebhooksParams,
91    ) -> Result<models::WebhookPaginatedResponse, Error<GetWebhooksError>>;
92
93    /// POST /webhooks/{webhookId}/notifications/resend_failed
94    ///
95    /// Resend all failed notifications for a webhook in the last 24 hours.
96    /// **Endpoint Permission:** Owner, Admin, Non-Signing Admin, Signer,
97    /// Editor.
98    async fn resend_failed_notifications(
99        &self,
100        params: ResendFailedNotificationsParams,
101    ) -> Result<models::ResendFailedNotificationsResponse, Error<ResendFailedNotificationsError>>;
102
103    /// POST /webhooks/{webhookId}/notifications/{notificationId}/resend
104    ///
105    /// Resend a notification by its ID.  **Endpoint Permissions:** Owner,
106    /// Admin, Non-Signing Admin, Signer, Editor.
107    async fn resend_notification_by_id(
108        &self,
109        params: ResendNotificationByIdParams,
110    ) -> Result<(), Error<ResendNotificationByIdError>>;
111
112    /// POST /webhooks/{webhookId}/notifications/resend_by_resource
113    ///
114    /// Resend notifications by their resource ID.  **Endpoint Permissions:**
115    /// Owner, Admin, Non-Signing Admin, Signer, Editor.
116    async fn resend_notifications_by_resource_id(
117        &self,
118        params: ResendNotificationsByResourceIdParams,
119    ) -> Result<(), Error<ResendNotificationsByResourceIdError>>;
120
121    /// PATCH /webhooks/{webhookId}
122    ///
123    /// Update a webhook by its ID.  **Endpoint Permissions:** Owner, Admin,
124    /// Non-Signing Admin.
125    async fn update_webhook(
126        &self,
127        params: UpdateWebhookParams,
128    ) -> Result<models::Webhook, Error<UpdateWebhookError>>;
129}
130
131pub struct WebhooksV2ApiClient {
132    configuration: Arc<configuration::Configuration>,
133}
134
135impl WebhooksV2ApiClient {
136    pub fn new(configuration: Arc<configuration::Configuration>) -> Self {
137        Self { configuration }
138    }
139}
140
141/// struct for passing parameters to the method
142/// [`WebhooksV2Api::create_webhook`]
143#[derive(Clone, Debug)]
144#[cfg_attr(feature = "bon", derive(::bon::Builder))]
145pub struct CreateWebhookParams {
146    pub create_webhook_request: models::CreateWebhookRequest,
147    /// A unique identifier for the request. If the request is sent multiple
148    /// times with the same idempotency key, the server will return the same
149    /// response as the first request. The idempotency key is valid for 24
150    /// hours.
151    pub idempotency_key: Option<String>,
152}
153
154/// struct for passing parameters to the method
155/// [`WebhooksV2Api::delete_webhook`]
156#[derive(Clone, Debug)]
157#[cfg_attr(feature = "bon", derive(::bon::Builder))]
158pub struct DeleteWebhookParams {
159    /// The unique identifier of the webhook
160    pub webhook_id: String,
161}
162
163/// struct for passing parameters to the method
164/// [`WebhooksV2Api::get_notification`]
165#[derive(Clone, Debug)]
166#[cfg_attr(feature = "bon", derive(::bon::Builder))]
167pub struct GetNotificationParams {
168    /// The ID of the webhook to fetch
169    pub webhook_id: String,
170    /// The ID of the notification to fetch
171    pub notification_id: String,
172    /// Include the data of the notification
173    pub include_data: Option<bool>,
174}
175
176/// struct for passing parameters to the method
177/// [`WebhooksV2Api::get_notification_attempts`]
178#[derive(Clone, Debug)]
179#[cfg_attr(feature = "bon", derive(::bon::Builder))]
180pub struct GetNotificationAttemptsParams {
181    /// The ID of the webhook to fetch
182    pub webhook_id: String,
183    /// The ID of the notification to fetch
184    pub notification_id: String,
185    /// Cursor of the required page
186    pub page_cursor: Option<String>,
187    /// Maximum number of items in the page
188    pub page_size: Option<f64>,
189}
190
191/// struct for passing parameters to the method
192/// [`WebhooksV2Api::get_notifications`]
193#[derive(Clone, Debug)]
194#[cfg_attr(feature = "bon", derive(::bon::Builder))]
195pub struct GetNotificationsParams {
196    pub webhook_id: String,
197    /// ASC / DESC ordering (default DESC)
198    pub order: Option<String>,
199    /// Sort by field (id, createdAt, updatedAt, status, eventType, resourceId)
200    pub sort_by: Option<String>,
201    /// Cursor of the required page
202    pub page_cursor: Option<String>,
203    /// Maximum number of items on the page
204    pub page_size: Option<f64>,
205    /// Start time in milliseconds since epoch to filter by notifications
206    /// created after this time (default 31 days ago)
207    pub start_time: Option<String>,
208    /// End time in milliseconds since epoch to filter by notifications created
209    /// before this time (default current time)
210    pub end_time: Option<String>,
211    /// List of notification statuses to filter by
212    pub statuses: Option<Vec<models::NotificationStatus>>,
213    /// List of webhook event types to filter by
214    pub events: Option<Vec<models::WebhookEvent>>,
215    /// Resource ID to filter by
216    pub resource_id: Option<String>,
217}
218
219/// struct for passing parameters to the method
220/// [`WebhooksV2Api::get_resend_job_status`]
221#[derive(Clone, Debug)]
222#[cfg_attr(feature = "bon", derive(::bon::Builder))]
223pub struct GetResendJobStatusParams {
224    /// The ID of the webhook
225    pub webhook_id: String,
226    /// The ID of the resend job
227    pub job_id: String,
228}
229
230/// struct for passing parameters to the method [`WebhooksV2Api::get_webhook`]
231#[derive(Clone, Debug)]
232#[cfg_attr(feature = "bon", derive(::bon::Builder))]
233pub struct GetWebhookParams {
234    /// The unique identifier of the webhook
235    pub webhook_id: String,
236}
237
238/// struct for passing parameters to the method [`WebhooksV2Api::get_webhooks`]
239#[derive(Clone, Debug)]
240#[cfg_attr(feature = "bon", derive(::bon::Builder))]
241pub struct GetWebhooksParams {
242    /// ASC / DESC ordering (default DESC)
243    pub order: Option<String>,
244    /// Cursor of the required page
245    pub page_cursor: Option<String>,
246    /// Maximum number of items on the page
247    pub page_size: Option<f64>,
248}
249
250/// struct for passing parameters to the method
251/// [`WebhooksV2Api::resend_failed_notifications`]
252#[derive(Clone, Debug)]
253#[cfg_attr(feature = "bon", derive(::bon::Builder))]
254pub struct ResendFailedNotificationsParams {
255    /// The ID of the webhook
256    pub webhook_id: String,
257    pub resend_failed_notifications_request: models::ResendFailedNotificationsRequest,
258    /// A unique identifier for the request. If the request is sent multiple
259    /// times with the same idempotency key, the server will return the same
260    /// response as the first request. The idempotency key is valid for 24
261    /// hours.
262    pub idempotency_key: Option<String>,
263}
264
265/// struct for passing parameters to the method
266/// [`WebhooksV2Api::resend_notification_by_id`]
267#[derive(Clone, Debug)]
268#[cfg_attr(feature = "bon", derive(::bon::Builder))]
269pub struct ResendNotificationByIdParams {
270    /// The ID of the webhook
271    pub webhook_id: String,
272    /// The ID of the notification
273    pub notification_id: String,
274    /// A unique identifier for the request. If the request is sent multiple
275    /// times with the same idempotency key, the server will return the same
276    /// response as the first request. The idempotency key is valid for 24
277    /// hours.
278    pub idempotency_key: Option<String>,
279}
280
281/// struct for passing parameters to the method
282/// [`WebhooksV2Api::resend_notifications_by_resource_id`]
283#[derive(Clone, Debug)]
284#[cfg_attr(feature = "bon", derive(::bon::Builder))]
285pub struct ResendNotificationsByResourceIdParams {
286    /// The ID of the webhook
287    pub webhook_id: String,
288    pub resend_notifications_by_resource_id_request: models::ResendNotificationsByResourceIdRequest,
289    /// A unique identifier for the request. If the request is sent multiple
290    /// times with the same idempotency key, the server will return the same
291    /// response as the first request. The idempotency key is valid for 24
292    /// hours.
293    pub idempotency_key: Option<String>,
294}
295
296/// struct for passing parameters to the method
297/// [`WebhooksV2Api::update_webhook`]
298#[derive(Clone, Debug)]
299#[cfg_attr(feature = "bon", derive(::bon::Builder))]
300pub struct UpdateWebhookParams {
301    /// The unique identifier of the webhook
302    pub webhook_id: String,
303    pub update_webhook_request: models::UpdateWebhookRequest,
304}
305
306#[async_trait]
307impl WebhooksV2Api for WebhooksV2ApiClient {
308    /// Creates a new webhook, which will be triggered on the specified events
309    /// **Endpoint Permissions:** Owner, Admin, Non-Signing Admin.
310    async fn create_webhook(
311        &self,
312        params: CreateWebhookParams,
313    ) -> Result<models::Webhook, Error<CreateWebhookError>> {
314        let CreateWebhookParams {
315            create_webhook_request,
316            idempotency_key,
317        } = params;
318
319        let local_var_configuration = &self.configuration;
320
321        let local_var_client = &local_var_configuration.client;
322
323        let local_var_uri_str = format!("{}/webhooks", local_var_configuration.base_path);
324        let mut local_var_req_builder =
325            local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
326
327        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
328            local_var_req_builder = local_var_req_builder
329                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
330        }
331        if let Some(local_var_param_value) = idempotency_key {
332            local_var_req_builder =
333                local_var_req_builder.header("Idempotency-Key", local_var_param_value.to_string());
334        }
335        local_var_req_builder = local_var_req_builder.json(&create_webhook_request);
336
337        let local_var_req = local_var_req_builder.build()?;
338        let local_var_resp = local_var_client.execute(local_var_req).await?;
339
340        let local_var_status = local_var_resp.status();
341        let local_var_content_type = local_var_resp
342            .headers()
343            .get("content-type")
344            .and_then(|v| v.to_str().ok())
345            .unwrap_or("application/octet-stream");
346        let local_var_content_type = super::ContentType::from(local_var_content_type);
347        let local_var_content = local_var_resp.text().await?;
348
349        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
350            match local_var_content_type {
351                ContentType::Json => {
352                    crate::deserialize_wrapper(&local_var_content).map_err(Error::from)
353                }
354                ContentType::Text => {
355                    return Err(Error::from(serde_json::Error::custom(
356                        "Received `text/plain` content type response that cannot be converted to \
357                         `models::Webhook`",
358                    )));
359                }
360                ContentType::Unsupported(local_var_unknown_type) => {
361                    return Err(Error::from(serde_json::Error::custom(format!(
362                        "Received `{local_var_unknown_type}` content type response that cannot be \
363                         converted to `models::Webhook`"
364                    ))));
365                }
366            }
367        } else {
368            let local_var_entity: Option<CreateWebhookError> =
369                serde_json::from_str(&local_var_content).ok();
370            let local_var_error = ResponseContent {
371                status: local_var_status,
372                content: local_var_content,
373                entity: local_var_entity,
374            };
375            Err(Error::ResponseError(local_var_error))
376        }
377    }
378
379    /// Delete a webhook by its ID.  **Endpoint Permissions:** Owner, Admin,
380    /// Non-Signing Admin.
381    async fn delete_webhook(
382        &self,
383        params: DeleteWebhookParams,
384    ) -> Result<models::Webhook, Error<DeleteWebhookError>> {
385        let DeleteWebhookParams { webhook_id } = params;
386
387        let local_var_configuration = &self.configuration;
388
389        let local_var_client = &local_var_configuration.client;
390
391        let local_var_uri_str = format!(
392            "{}/webhooks/{webhookId}",
393            local_var_configuration.base_path,
394            webhookId = crate::apis::urlencode(webhook_id)
395        );
396        let mut local_var_req_builder =
397            local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
398
399        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
400            local_var_req_builder = local_var_req_builder
401                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
402        }
403
404        let local_var_req = local_var_req_builder.build()?;
405        let local_var_resp = local_var_client.execute(local_var_req).await?;
406
407        let local_var_status = local_var_resp.status();
408        let local_var_content_type = local_var_resp
409            .headers()
410            .get("content-type")
411            .and_then(|v| v.to_str().ok())
412            .unwrap_or("application/octet-stream");
413        let local_var_content_type = super::ContentType::from(local_var_content_type);
414        let local_var_content = local_var_resp.text().await?;
415
416        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
417            match local_var_content_type {
418                ContentType::Json => {
419                    crate::deserialize_wrapper(&local_var_content).map_err(Error::from)
420                }
421                ContentType::Text => {
422                    return Err(Error::from(serde_json::Error::custom(
423                        "Received `text/plain` content type response that cannot be converted to \
424                         `models::Webhook`",
425                    )));
426                }
427                ContentType::Unsupported(local_var_unknown_type) => {
428                    return Err(Error::from(serde_json::Error::custom(format!(
429                        "Received `{local_var_unknown_type}` content type response that cannot be \
430                         converted to `models::Webhook`"
431                    ))));
432                }
433            }
434        } else {
435            let local_var_entity: Option<DeleteWebhookError> =
436                serde_json::from_str(&local_var_content).ok();
437            let local_var_error = ResponseContent {
438                status: local_var_status,
439                content: local_var_content,
440                entity: local_var_entity,
441            };
442            Err(Error::ResponseError(local_var_error))
443        }
444    }
445
446    /// Get a notification by its notification ID.  **Endpoint Permissions:**
447    /// Owner, Admin, Non-Signing Admin.
448    async fn get_notification(
449        &self,
450        params: GetNotificationParams,
451    ) -> Result<models::NotificationWithData, Error<GetNotificationError>> {
452        let GetNotificationParams {
453            webhook_id,
454            notification_id,
455            include_data,
456        } = params;
457
458        let local_var_configuration = &self.configuration;
459
460        let local_var_client = &local_var_configuration.client;
461
462        let local_var_uri_str = format!(
463            "{}/webhooks/{webhookId}/notifications/{notificationId}",
464            local_var_configuration.base_path,
465            webhookId = crate::apis::urlencode(webhook_id),
466            notificationId = crate::apis::urlencode(notification_id)
467        );
468        let mut local_var_req_builder =
469            local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
470
471        if let Some(ref param_value) = include_data {
472            local_var_req_builder =
473                local_var_req_builder.query(&[("includeData", &param_value.to_string())]);
474        }
475        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
476            local_var_req_builder = local_var_req_builder
477                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
478        }
479
480        let local_var_req = local_var_req_builder.build()?;
481        let local_var_resp = local_var_client.execute(local_var_req).await?;
482
483        let local_var_status = local_var_resp.status();
484        let local_var_content_type = local_var_resp
485            .headers()
486            .get("content-type")
487            .and_then(|v| v.to_str().ok())
488            .unwrap_or("application/octet-stream");
489        let local_var_content_type = super::ContentType::from(local_var_content_type);
490        let local_var_content = local_var_resp.text().await?;
491
492        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
493            match local_var_content_type {
494                ContentType::Json => {
495                    crate::deserialize_wrapper(&local_var_content).map_err(Error::from)
496                }
497                ContentType::Text => {
498                    return Err(Error::from(serde_json::Error::custom(
499                        "Received `text/plain` content type response that cannot be converted to \
500                         `models::NotificationWithData`",
501                    )));
502                }
503                ContentType::Unsupported(local_var_unknown_type) => {
504                    return Err(Error::from(serde_json::Error::custom(format!(
505                        "Received `{local_var_unknown_type}` content type response that cannot be \
506                         converted to `models::NotificationWithData`"
507                    ))));
508                }
509            }
510        } else {
511            let local_var_entity: Option<GetNotificationError> =
512                serde_json::from_str(&local_var_content).ok();
513            let local_var_error = ResponseContent {
514                status: local_var_status,
515                content: local_var_content,
516                entity: local_var_entity,
517            };
518            Err(Error::ResponseError(local_var_error))
519        }
520    }
521
522    /// Get notification attempts by notification ID.
523    async fn get_notification_attempts(
524        &self,
525        params: GetNotificationAttemptsParams,
526    ) -> Result<models::NotificationAttemptsPaginatedResponse, Error<GetNotificationAttemptsError>>
527    {
528        let GetNotificationAttemptsParams {
529            webhook_id,
530            notification_id,
531            page_cursor,
532            page_size,
533        } = params;
534
535        let local_var_configuration = &self.configuration;
536
537        let local_var_client = &local_var_configuration.client;
538
539        let local_var_uri_str = format!(
540            "{}/webhooks/{webhookId}/notifications/{notificationId}/attempts",
541            local_var_configuration.base_path,
542            webhookId = crate::apis::urlencode(webhook_id),
543            notificationId = crate::apis::urlencode(notification_id)
544        );
545        let mut local_var_req_builder =
546            local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
547
548        if let Some(ref param_value) = page_cursor {
549            local_var_req_builder =
550                local_var_req_builder.query(&[("pageCursor", &param_value.to_string())]);
551        }
552        if let Some(ref param_value) = page_size {
553            local_var_req_builder =
554                local_var_req_builder.query(&[("pageSize", &param_value.to_string())]);
555        }
556        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
557            local_var_req_builder = local_var_req_builder
558                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
559        }
560
561        let local_var_req = local_var_req_builder.build()?;
562        let local_var_resp = local_var_client.execute(local_var_req).await?;
563
564        let local_var_status = local_var_resp.status();
565        let local_var_content_type = local_var_resp
566            .headers()
567            .get("content-type")
568            .and_then(|v| v.to_str().ok())
569            .unwrap_or("application/octet-stream");
570        let local_var_content_type = super::ContentType::from(local_var_content_type);
571        let local_var_content = local_var_resp.text().await?;
572
573        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
574            match local_var_content_type {
575                ContentType::Json => {
576                    crate::deserialize_wrapper(&local_var_content).map_err(Error::from)
577                }
578                ContentType::Text => {
579                    return Err(Error::from(serde_json::Error::custom(
580                        "Received `text/plain` content type response that cannot be converted to \
581                         `models::NotificationAttemptsPaginatedResponse`",
582                    )));
583                }
584                ContentType::Unsupported(local_var_unknown_type) => {
585                    return Err(Error::from(serde_json::Error::custom(format!(
586                        "Received `{local_var_unknown_type}` content type response that cannot be \
587                         converted to `models::NotificationAttemptsPaginatedResponse`"
588                    ))));
589                }
590            }
591        } else {
592            let local_var_entity: Option<GetNotificationAttemptsError> =
593                serde_json::from_str(&local_var_content).ok();
594            let local_var_error = ResponseContent {
595                status: local_var_status,
596                content: local_var_content,
597                entity: local_var_entity,
598            };
599            Err(Error::ResponseError(local_var_error))
600        }
601    }
602
603    /// Get all notifications by webhook ID (paginated).  **Endpoint
604    /// Permissions:** Owner, Admin, Non-Signing Admin.
605    async fn get_notifications(
606        &self,
607        params: GetNotificationsParams,
608    ) -> Result<models::NotificationPaginatedResponse, Error<GetNotificationsError>> {
609        let GetNotificationsParams {
610            webhook_id,
611            order,
612            sort_by,
613            page_cursor,
614            page_size,
615            start_time,
616            end_time,
617            statuses,
618            events,
619            resource_id,
620        } = params;
621
622        let local_var_configuration = &self.configuration;
623
624        let local_var_client = &local_var_configuration.client;
625
626        let local_var_uri_str = format!(
627            "{}/webhooks/{webhookId}/notifications",
628            local_var_configuration.base_path,
629            webhookId = crate::apis::urlencode(webhook_id)
630        );
631        let mut local_var_req_builder =
632            local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
633
634        if let Some(ref param_value) = order {
635            local_var_req_builder =
636                local_var_req_builder.query(&[("order", &param_value.to_string())]);
637        }
638        if let Some(ref param_value) = sort_by {
639            local_var_req_builder =
640                local_var_req_builder.query(&[("sortBy", &param_value.to_string())]);
641        }
642        if let Some(ref param_value) = page_cursor {
643            local_var_req_builder =
644                local_var_req_builder.query(&[("pageCursor", &param_value.to_string())]);
645        }
646        if let Some(ref param_value) = page_size {
647            local_var_req_builder =
648                local_var_req_builder.query(&[("pageSize", &param_value.to_string())]);
649        }
650        if let Some(ref param_value) = start_time {
651            local_var_req_builder =
652                local_var_req_builder.query(&[("startTime", &param_value.to_string())]);
653        }
654        if let Some(ref param_value) = end_time {
655            local_var_req_builder =
656                local_var_req_builder.query(&[("endTime", &param_value.to_string())]);
657        }
658        if let Some(ref param_value) = statuses {
659            local_var_req_builder = match "multi" {
660                "multi" => local_var_req_builder.query(
661                    &param_value
662                        .into_iter()
663                        .map(|p| ("statuses".to_owned(), p.to_string()))
664                        .collect::<Vec<(std::string::String, std::string::String)>>(),
665                ),
666                _ => local_var_req_builder.query(&[(
667                    "statuses",
668                    &param_value
669                        .into_iter()
670                        .map(|p| p.to_string())
671                        .collect::<Vec<String>>()
672                        .join(",")
673                        .to_string(),
674                )]),
675            };
676        }
677        if let Some(ref param_value) = events {
678            local_var_req_builder = match "multi" {
679                "multi" => local_var_req_builder.query(
680                    &param_value
681                        .into_iter()
682                        .map(|p| ("events".to_owned(), p.to_string()))
683                        .collect::<Vec<(std::string::String, std::string::String)>>(),
684                ),
685                _ => local_var_req_builder.query(&[(
686                    "events",
687                    &param_value
688                        .into_iter()
689                        .map(|p| p.to_string())
690                        .collect::<Vec<String>>()
691                        .join(",")
692                        .to_string(),
693                )]),
694            };
695        }
696        if let Some(ref param_value) = resource_id {
697            local_var_req_builder =
698                local_var_req_builder.query(&[("resourceId", &param_value.to_string())]);
699        }
700        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
701            local_var_req_builder = local_var_req_builder
702                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
703        }
704
705        let local_var_req = local_var_req_builder.build()?;
706        let local_var_resp = local_var_client.execute(local_var_req).await?;
707
708        let local_var_status = local_var_resp.status();
709        let local_var_content_type = local_var_resp
710            .headers()
711            .get("content-type")
712            .and_then(|v| v.to_str().ok())
713            .unwrap_or("application/octet-stream");
714        let local_var_content_type = super::ContentType::from(local_var_content_type);
715        let local_var_content = local_var_resp.text().await?;
716
717        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
718            match local_var_content_type {
719                ContentType::Json => {
720                    crate::deserialize_wrapper(&local_var_content).map_err(Error::from)
721                }
722                ContentType::Text => {
723                    return Err(Error::from(serde_json::Error::custom(
724                        "Received `text/plain` content type response that cannot be converted to \
725                         `models::NotificationPaginatedResponse`",
726                    )));
727                }
728                ContentType::Unsupported(local_var_unknown_type) => {
729                    return Err(Error::from(serde_json::Error::custom(format!(
730                        "Received `{local_var_unknown_type}` content type response that cannot be \
731                         converted to `models::NotificationPaginatedResponse`"
732                    ))));
733                }
734            }
735        } else {
736            let local_var_entity: Option<GetNotificationsError> =
737                serde_json::from_str(&local_var_content).ok();
738            let local_var_error = ResponseContent {
739                status: local_var_status,
740                content: local_var_content,
741                entity: local_var_entity,
742            };
743            Err(Error::ResponseError(local_var_error))
744        }
745    }
746
747    /// Get the status of a resend job.
748    async fn get_resend_job_status(
749        &self,
750        params: GetResendJobStatusParams,
751    ) -> Result<models::ResendFailedNotificationsJobStatusResponse, Error<GetResendJobStatusError>>
752    {
753        let GetResendJobStatusParams { webhook_id, job_id } = params;
754
755        let local_var_configuration = &self.configuration;
756
757        let local_var_client = &local_var_configuration.client;
758
759        let local_var_uri_str = format!(
760            "{}/webhooks/{webhookId}/notifications/resend_failed/jobs/{jobId}",
761            local_var_configuration.base_path,
762            webhookId = crate::apis::urlencode(webhook_id),
763            jobId = crate::apis::urlencode(job_id)
764        );
765        let mut local_var_req_builder =
766            local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
767
768        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
769            local_var_req_builder = local_var_req_builder
770                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
771        }
772
773        let local_var_req = local_var_req_builder.build()?;
774        let local_var_resp = local_var_client.execute(local_var_req).await?;
775
776        let local_var_status = local_var_resp.status();
777        let local_var_content_type = local_var_resp
778            .headers()
779            .get("content-type")
780            .and_then(|v| v.to_str().ok())
781            .unwrap_or("application/octet-stream");
782        let local_var_content_type = super::ContentType::from(local_var_content_type);
783        let local_var_content = local_var_resp.text().await?;
784
785        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
786            match local_var_content_type {
787                ContentType::Json => {
788                    crate::deserialize_wrapper(&local_var_content).map_err(Error::from)
789                }
790                ContentType::Text => {
791                    return Err(Error::from(serde_json::Error::custom(
792                        "Received `text/plain` content type response that cannot be converted to \
793                         `models::ResendFailedNotificationsJobStatusResponse`",
794                    )));
795                }
796                ContentType::Unsupported(local_var_unknown_type) => {
797                    return Err(Error::from(serde_json::Error::custom(format!(
798                        "Received `{local_var_unknown_type}` content type response that cannot be \
799                         converted to `models::ResendFailedNotificationsJobStatusResponse`"
800                    ))));
801                }
802            }
803        } else {
804            let local_var_entity: Option<GetResendJobStatusError> =
805                serde_json::from_str(&local_var_content).ok();
806            let local_var_error = ResponseContent {
807                status: local_var_status,
808                content: local_var_content,
809                entity: local_var_entity,
810            };
811            Err(Error::ResponseError(local_var_error))
812        }
813    }
814
815    /// Retrieve a webhook by its ID.  **Endpoint Permissions:** Owner, Admin,
816    /// Non-Signing Admin.
817    async fn get_webhook(
818        &self,
819        params: GetWebhookParams,
820    ) -> Result<models::Webhook, Error<GetWebhookError>> {
821        let GetWebhookParams { webhook_id } = params;
822
823        let local_var_configuration = &self.configuration;
824
825        let local_var_client = &local_var_configuration.client;
826
827        let local_var_uri_str = format!(
828            "{}/webhooks/{webhookId}",
829            local_var_configuration.base_path,
830            webhookId = crate::apis::urlencode(webhook_id)
831        );
832        let mut local_var_req_builder =
833            local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
834
835        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
836            local_var_req_builder = local_var_req_builder
837                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
838        }
839
840        let local_var_req = local_var_req_builder.build()?;
841        let local_var_resp = local_var_client.execute(local_var_req).await?;
842
843        let local_var_status = local_var_resp.status();
844        let local_var_content_type = local_var_resp
845            .headers()
846            .get("content-type")
847            .and_then(|v| v.to_str().ok())
848            .unwrap_or("application/octet-stream");
849        let local_var_content_type = super::ContentType::from(local_var_content_type);
850        let local_var_content = local_var_resp.text().await?;
851
852        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
853            match local_var_content_type {
854                ContentType::Json => {
855                    crate::deserialize_wrapper(&local_var_content).map_err(Error::from)
856                }
857                ContentType::Text => {
858                    return Err(Error::from(serde_json::Error::custom(
859                        "Received `text/plain` content type response that cannot be converted to \
860                         `models::Webhook`",
861                    )));
862                }
863                ContentType::Unsupported(local_var_unknown_type) => {
864                    return Err(Error::from(serde_json::Error::custom(format!(
865                        "Received `{local_var_unknown_type}` content type response that cannot be \
866                         converted to `models::Webhook`"
867                    ))));
868                }
869            }
870        } else {
871            let local_var_entity: Option<GetWebhookError> =
872                serde_json::from_str(&local_var_content).ok();
873            let local_var_error = ResponseContent {
874                status: local_var_status,
875                content: local_var_content,
876                entity: local_var_entity,
877            };
878            Err(Error::ResponseError(local_var_error))
879        }
880    }
881
882    /// Get all webhooks (paginated).  **Endpoint Permissions:** Owner, Admin,
883    /// Non-Signing Admin.
884    async fn get_webhooks(
885        &self,
886        params: GetWebhooksParams,
887    ) -> Result<models::WebhookPaginatedResponse, Error<GetWebhooksError>> {
888        let GetWebhooksParams {
889            order,
890            page_cursor,
891            page_size,
892        } = params;
893
894        let local_var_configuration = &self.configuration;
895
896        let local_var_client = &local_var_configuration.client;
897
898        let local_var_uri_str = format!("{}/webhooks", local_var_configuration.base_path);
899        let mut local_var_req_builder =
900            local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
901
902        if let Some(ref param_value) = order {
903            local_var_req_builder =
904                local_var_req_builder.query(&[("order", &param_value.to_string())]);
905        }
906        if let Some(ref param_value) = page_cursor {
907            local_var_req_builder =
908                local_var_req_builder.query(&[("pageCursor", &param_value.to_string())]);
909        }
910        if let Some(ref param_value) = page_size {
911            local_var_req_builder =
912                local_var_req_builder.query(&[("pageSize", &param_value.to_string())]);
913        }
914        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
915            local_var_req_builder = local_var_req_builder
916                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
917        }
918
919        let local_var_req = local_var_req_builder.build()?;
920        let local_var_resp = local_var_client.execute(local_var_req).await?;
921
922        let local_var_status = local_var_resp.status();
923        let local_var_content_type = local_var_resp
924            .headers()
925            .get("content-type")
926            .and_then(|v| v.to_str().ok())
927            .unwrap_or("application/octet-stream");
928        let local_var_content_type = super::ContentType::from(local_var_content_type);
929        let local_var_content = local_var_resp.text().await?;
930
931        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
932            match local_var_content_type {
933                ContentType::Json => {
934                    crate::deserialize_wrapper(&local_var_content).map_err(Error::from)
935                }
936                ContentType::Text => {
937                    return Err(Error::from(serde_json::Error::custom(
938                        "Received `text/plain` content type response that cannot be converted to \
939                         `models::WebhookPaginatedResponse`",
940                    )));
941                }
942                ContentType::Unsupported(local_var_unknown_type) => {
943                    return Err(Error::from(serde_json::Error::custom(format!(
944                        "Received `{local_var_unknown_type}` content type response that cannot be \
945                         converted to `models::WebhookPaginatedResponse`"
946                    ))));
947                }
948            }
949        } else {
950            let local_var_entity: Option<GetWebhooksError> =
951                serde_json::from_str(&local_var_content).ok();
952            let local_var_error = ResponseContent {
953                status: local_var_status,
954                content: local_var_content,
955                entity: local_var_entity,
956            };
957            Err(Error::ResponseError(local_var_error))
958        }
959    }
960
961    /// Resend all failed notifications for a webhook in the last 24 hours.
962    /// **Endpoint Permission:** Owner, Admin, Non-Signing Admin, Signer,
963    /// Editor.
964    async fn resend_failed_notifications(
965        &self,
966        params: ResendFailedNotificationsParams,
967    ) -> Result<models::ResendFailedNotificationsResponse, Error<ResendFailedNotificationsError>>
968    {
969        let ResendFailedNotificationsParams {
970            webhook_id,
971            resend_failed_notifications_request,
972            idempotency_key,
973        } = params;
974
975        let local_var_configuration = &self.configuration;
976
977        let local_var_client = &local_var_configuration.client;
978
979        let local_var_uri_str = format!(
980            "{}/webhooks/{webhookId}/notifications/resend_failed",
981            local_var_configuration.base_path,
982            webhookId = crate::apis::urlencode(webhook_id)
983        );
984        let mut local_var_req_builder =
985            local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
986
987        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
988            local_var_req_builder = local_var_req_builder
989                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
990        }
991        if let Some(local_var_param_value) = idempotency_key {
992            local_var_req_builder =
993                local_var_req_builder.header("Idempotency-Key", local_var_param_value.to_string());
994        }
995        local_var_req_builder = local_var_req_builder.json(&resend_failed_notifications_request);
996
997        let local_var_req = local_var_req_builder.build()?;
998        let local_var_resp = local_var_client.execute(local_var_req).await?;
999
1000        let local_var_status = local_var_resp.status();
1001        let local_var_content_type = local_var_resp
1002            .headers()
1003            .get("content-type")
1004            .and_then(|v| v.to_str().ok())
1005            .unwrap_or("application/octet-stream");
1006        let local_var_content_type = super::ContentType::from(local_var_content_type);
1007        let local_var_content = local_var_resp.text().await?;
1008
1009        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1010            match local_var_content_type {
1011                ContentType::Json => {
1012                    crate::deserialize_wrapper(&local_var_content).map_err(Error::from)
1013                }
1014                ContentType::Text => {
1015                    return Err(Error::from(serde_json::Error::custom(
1016                        "Received `text/plain` content type response that cannot be converted to \
1017                         `models::ResendFailedNotificationsResponse`",
1018                    )));
1019                }
1020                ContentType::Unsupported(local_var_unknown_type) => {
1021                    return Err(Error::from(serde_json::Error::custom(format!(
1022                        "Received `{local_var_unknown_type}` content type response that cannot be \
1023                         converted to `models::ResendFailedNotificationsResponse`"
1024                    ))));
1025                }
1026            }
1027        } else {
1028            let local_var_entity: Option<ResendFailedNotificationsError> =
1029                serde_json::from_str(&local_var_content).ok();
1030            let local_var_error = ResponseContent {
1031                status: local_var_status,
1032                content: local_var_content,
1033                entity: local_var_entity,
1034            };
1035            Err(Error::ResponseError(local_var_error))
1036        }
1037    }
1038
1039    /// Resend a notification by its ID.  **Endpoint Permissions:** Owner,
1040    /// Admin, Non-Signing Admin, Signer, Editor.
1041    async fn resend_notification_by_id(
1042        &self,
1043        params: ResendNotificationByIdParams,
1044    ) -> Result<(), Error<ResendNotificationByIdError>> {
1045        let ResendNotificationByIdParams {
1046            webhook_id,
1047            notification_id,
1048            idempotency_key,
1049        } = params;
1050
1051        let local_var_configuration = &self.configuration;
1052
1053        let local_var_client = &local_var_configuration.client;
1054
1055        let local_var_uri_str = format!(
1056            "{}/webhooks/{webhookId}/notifications/{notificationId}/resend",
1057            local_var_configuration.base_path,
1058            webhookId = crate::apis::urlencode(webhook_id),
1059            notificationId = crate::apis::urlencode(notification_id)
1060        );
1061        let mut local_var_req_builder =
1062            local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1063
1064        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1065            local_var_req_builder = local_var_req_builder
1066                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1067        }
1068        if let Some(local_var_param_value) = idempotency_key {
1069            local_var_req_builder =
1070                local_var_req_builder.header("Idempotency-Key", local_var_param_value.to_string());
1071        }
1072
1073        let local_var_req = local_var_req_builder.build()?;
1074        let local_var_resp = local_var_client.execute(local_var_req).await?;
1075
1076        let local_var_status = local_var_resp.status();
1077        let local_var_content = local_var_resp.text().await?;
1078
1079        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1080            Ok(())
1081        } else {
1082            let local_var_entity: Option<ResendNotificationByIdError> =
1083                serde_json::from_str(&local_var_content).ok();
1084            let local_var_error = ResponseContent {
1085                status: local_var_status,
1086                content: local_var_content,
1087                entity: local_var_entity,
1088            };
1089            Err(Error::ResponseError(local_var_error))
1090        }
1091    }
1092
1093    /// Resend notifications by their resource ID.  **Endpoint Permissions:**
1094    /// Owner, Admin, Non-Signing Admin, Signer, Editor.
1095    async fn resend_notifications_by_resource_id(
1096        &self,
1097        params: ResendNotificationsByResourceIdParams,
1098    ) -> Result<(), Error<ResendNotificationsByResourceIdError>> {
1099        let ResendNotificationsByResourceIdParams {
1100            webhook_id,
1101            resend_notifications_by_resource_id_request,
1102            idempotency_key,
1103        } = params;
1104
1105        let local_var_configuration = &self.configuration;
1106
1107        let local_var_client = &local_var_configuration.client;
1108
1109        let local_var_uri_str = format!(
1110            "{}/webhooks/{webhookId}/notifications/resend_by_resource",
1111            local_var_configuration.base_path,
1112            webhookId = crate::apis::urlencode(webhook_id)
1113        );
1114        let mut local_var_req_builder =
1115            local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1116
1117        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1118            local_var_req_builder = local_var_req_builder
1119                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1120        }
1121        if let Some(local_var_param_value) = idempotency_key {
1122            local_var_req_builder =
1123                local_var_req_builder.header("Idempotency-Key", local_var_param_value.to_string());
1124        }
1125        local_var_req_builder =
1126            local_var_req_builder.json(&resend_notifications_by_resource_id_request);
1127
1128        let local_var_req = local_var_req_builder.build()?;
1129        let local_var_resp = local_var_client.execute(local_var_req).await?;
1130
1131        let local_var_status = local_var_resp.status();
1132        let local_var_content = local_var_resp.text().await?;
1133
1134        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1135            Ok(())
1136        } else {
1137            let local_var_entity: Option<ResendNotificationsByResourceIdError> =
1138                serde_json::from_str(&local_var_content).ok();
1139            let local_var_error = ResponseContent {
1140                status: local_var_status,
1141                content: local_var_content,
1142                entity: local_var_entity,
1143            };
1144            Err(Error::ResponseError(local_var_error))
1145        }
1146    }
1147
1148    /// Update a webhook by its ID.  **Endpoint Permissions:** Owner, Admin,
1149    /// Non-Signing Admin.
1150    async fn update_webhook(
1151        &self,
1152        params: UpdateWebhookParams,
1153    ) -> Result<models::Webhook, Error<UpdateWebhookError>> {
1154        let UpdateWebhookParams {
1155            webhook_id,
1156            update_webhook_request,
1157        } = params;
1158
1159        let local_var_configuration = &self.configuration;
1160
1161        let local_var_client = &local_var_configuration.client;
1162
1163        let local_var_uri_str = format!(
1164            "{}/webhooks/{webhookId}",
1165            local_var_configuration.base_path,
1166            webhookId = crate::apis::urlencode(webhook_id)
1167        );
1168        let mut local_var_req_builder =
1169            local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
1170
1171        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1172            local_var_req_builder = local_var_req_builder
1173                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1174        }
1175        local_var_req_builder = local_var_req_builder.json(&update_webhook_request);
1176
1177        let local_var_req = local_var_req_builder.build()?;
1178        let local_var_resp = local_var_client.execute(local_var_req).await?;
1179
1180        let local_var_status = local_var_resp.status();
1181        let local_var_content_type = local_var_resp
1182            .headers()
1183            .get("content-type")
1184            .and_then(|v| v.to_str().ok())
1185            .unwrap_or("application/octet-stream");
1186        let local_var_content_type = super::ContentType::from(local_var_content_type);
1187        let local_var_content = local_var_resp.text().await?;
1188
1189        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1190            match local_var_content_type {
1191                ContentType::Json => {
1192                    crate::deserialize_wrapper(&local_var_content).map_err(Error::from)
1193                }
1194                ContentType::Text => {
1195                    return Err(Error::from(serde_json::Error::custom(
1196                        "Received `text/plain` content type response that cannot be converted to \
1197                         `models::Webhook`",
1198                    )));
1199                }
1200                ContentType::Unsupported(local_var_unknown_type) => {
1201                    return Err(Error::from(serde_json::Error::custom(format!(
1202                        "Received `{local_var_unknown_type}` content type response that cannot be \
1203                         converted to `models::Webhook`"
1204                    ))));
1205                }
1206            }
1207        } else {
1208            let local_var_entity: Option<UpdateWebhookError> =
1209                serde_json::from_str(&local_var_content).ok();
1210            let local_var_error = ResponseContent {
1211                status: local_var_status,
1212                content: local_var_content,
1213                entity: local_var_entity,
1214            };
1215            Err(Error::ResponseError(local_var_error))
1216        }
1217    }
1218}
1219
1220/// struct for typed errors of method [`WebhooksV2Api::create_webhook`]
1221#[derive(Debug, Clone, Serialize, Deserialize)]
1222#[serde(untagged)]
1223pub enum CreateWebhookError {
1224    DefaultResponse(models::ErrorSchema),
1225    UnknownValue(serde_json::Value),
1226}
1227
1228/// struct for typed errors of method [`WebhooksV2Api::delete_webhook`]
1229#[derive(Debug, Clone, Serialize, Deserialize)]
1230#[serde(untagged)]
1231pub enum DeleteWebhookError {
1232    DefaultResponse(models::ErrorSchema),
1233    UnknownValue(serde_json::Value),
1234}
1235
1236/// struct for typed errors of method [`WebhooksV2Api::get_notification`]
1237#[derive(Debug, Clone, Serialize, Deserialize)]
1238#[serde(untagged)]
1239pub enum GetNotificationError {
1240    UnknownValue(serde_json::Value),
1241}
1242
1243/// struct for typed errors of method
1244/// [`WebhooksV2Api::get_notification_attempts`]
1245#[derive(Debug, Clone, Serialize, Deserialize)]
1246#[serde(untagged)]
1247pub enum GetNotificationAttemptsError {
1248    DefaultResponse(models::ErrorSchema),
1249    UnknownValue(serde_json::Value),
1250}
1251
1252/// struct for typed errors of method [`WebhooksV2Api::get_notifications`]
1253#[derive(Debug, Clone, Serialize, Deserialize)]
1254#[serde(untagged)]
1255pub enum GetNotificationsError {
1256    UnknownValue(serde_json::Value),
1257}
1258
1259/// struct for typed errors of method [`WebhooksV2Api::get_resend_job_status`]
1260#[derive(Debug, Clone, Serialize, Deserialize)]
1261#[serde(untagged)]
1262pub enum GetResendJobStatusError {
1263    DefaultResponse(models::ErrorSchema),
1264    UnknownValue(serde_json::Value),
1265}
1266
1267/// struct for typed errors of method [`WebhooksV2Api::get_webhook`]
1268#[derive(Debug, Clone, Serialize, Deserialize)]
1269#[serde(untagged)]
1270pub enum GetWebhookError {
1271    DefaultResponse(models::ErrorSchema),
1272    UnknownValue(serde_json::Value),
1273}
1274
1275/// struct for typed errors of method [`WebhooksV2Api::get_webhooks`]
1276#[derive(Debug, Clone, Serialize, Deserialize)]
1277#[serde(untagged)]
1278pub enum GetWebhooksError {
1279    DefaultResponse(models::ErrorSchema),
1280    UnknownValue(serde_json::Value),
1281}
1282
1283/// struct for typed errors of method
1284/// [`WebhooksV2Api::resend_failed_notifications`]
1285#[derive(Debug, Clone, Serialize, Deserialize)]
1286#[serde(untagged)]
1287pub enum ResendFailedNotificationsError {
1288    DefaultResponse(models::ErrorSchema),
1289    UnknownValue(serde_json::Value),
1290}
1291
1292/// struct for typed errors of method
1293/// [`WebhooksV2Api::resend_notification_by_id`]
1294#[derive(Debug, Clone, Serialize, Deserialize)]
1295#[serde(untagged)]
1296pub enum ResendNotificationByIdError {
1297    DefaultResponse(models::ErrorSchema),
1298    UnknownValue(serde_json::Value),
1299}
1300
1301/// struct for typed errors of method
1302/// [`WebhooksV2Api::resend_notifications_by_resource_id`]
1303#[derive(Debug, Clone, Serialize, Deserialize)]
1304#[serde(untagged)]
1305pub enum ResendNotificationsByResourceIdError {
1306    DefaultResponse(models::ErrorSchema),
1307    UnknownValue(serde_json::Value),
1308}
1309
1310/// struct for typed errors of method [`WebhooksV2Api::update_webhook`]
1311#[derive(Debug, Clone, Serialize, Deserialize)]
1312#[serde(untagged)]
1313pub enum UpdateWebhookError {
1314    DefaultResponse(models::ErrorSchema),
1315    UnknownValue(serde_json::Value),
1316}