pub struct Webhook {
pub summary: Option<String>,
pub description: Option<String>,
pub operations: HashMap<String, WebhookOperation>,
}Expand description
Webhook definition for OpenAPI 3.1
A webhook describes an HTTP callback that your API will call when a specific event occurs.
Fields§
§summary: Option<String>Summary of the webhook
description: Option<String>Detailed description of the webhook
operations: HashMap<String, WebhookOperation>HTTP methods for the webhook (typically POST)
Implementations§
Source§impl Webhook
impl Webhook
Sourcepub fn with_summary(summary: impl Into<String>) -> Self
pub fn with_summary(summary: impl Into<String>) -> Self
Create a webhook with a summary
Sourcepub fn description(self, description: impl Into<String>) -> Self
pub fn description(self, description: impl Into<String>) -> Self
Set the description
Sourcepub fn post(self, operation: WebhookOperation) -> Self
pub fn post(self, operation: WebhookOperation) -> Self
Add a POST operation
Sourcepub fn get(self, operation: WebhookOperation) -> Self
pub fn get(self, operation: WebhookOperation) -> Self
Add a GET operation
Sourcepub fn put(self, operation: WebhookOperation) -> Self
pub fn put(self, operation: WebhookOperation) -> Self
Add a PUT operation
Sourcepub fn delete(self, operation: WebhookOperation) -> Self
pub fn delete(self, operation: WebhookOperation) -> Self
Add a DELETE operation
Sourcepub fn operation(self, method: impl Into<String>, op: WebhookOperation) -> Self
pub fn operation(self, method: impl Into<String>, op: WebhookOperation) -> Self
Add an operation with a specific HTTP method
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Webhook
impl<'de> Deserialize<'de> for Webhook
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Webhook
impl RefUnwindSafe for Webhook
impl Send for Webhook
impl Sync for Webhook
impl Unpin for Webhook
impl UnwindSafe for Webhook
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more