asana/models/
webhook_request.rs

1/*
2 * Asana
3 *
4 * This is the interface for interacting with the [Asana Platform](https://developers.asana.com). Our API reference is generated from our [OpenAPI spec] (https://raw.githubusercontent.com/Asana/developer-docs/master/defs/asana_oas.yaml).
5 *
6 * The version of the OpenAPI document: 1.0
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
12pub struct WebhookRequest {
13    /// A resource ID to subscribe to. Many Asana resources are valid to create webhooks on, but higher-level resources require filters.
14    #[serde(rename = "resource")]
15    pub resource: String,
16    /// The URL to receive the HTTP POST. The full URL will be used to deliver events from this webhook (including parameters) which allows encoding of application-specific state when the webhook is created.
17    #[serde(rename = "target")]
18    pub target: String,
19    /// An array of WebhookFilter objects to specify a whitelist of filters to apply to events from this webhook. If a webhook event passes any of the filters the event will be delivered; otherwise no event will be sent to the receiving server.
20    #[serde(rename = "filters", skip_serializing_if = "Option::is_none")]
21    pub filters: Option<Vec<crate::models::WebhookFilter>>,
22}
23
24impl WebhookRequest {
25    pub fn new(resource: String, target: String) -> WebhookRequest {
26        WebhookRequest { resource, target, filters: None }
27    }
28}