pub struct WebhookOperation {
pub tags: Option<Vec<String>>,
pub summary: Option<String>,
pub description: Option<String>,
pub external_docs: Option<ExternalDocs>,
pub operation_id: Option<String>,
pub request_body: Option<WebhookRequestBody>,
pub responses: Option<HashMap<String, WebhookResponse>>,
pub security: Option<Vec<HashMap<String, Vec<String>>>>,
pub deprecated: Option<bool>,
}Expand description
Webhook operation (similar to path operation)
Fields§
Tags for API documentation
summary: Option<String>Brief summary
description: Option<String>Detailed description
external_docs: Option<ExternalDocs>External documentation
operation_id: Option<String>Unique operation ID
request_body: Option<WebhookRequestBody>Request body schema
responses: Option<HashMap<String, WebhookResponse>>Expected responses from the webhook consumer
security: Option<Vec<HashMap<String, Vec<String>>>>Security requirements
deprecated: Option<bool>Whether this operation is deprecated
Implementations§
Source§impl WebhookOperation
impl WebhookOperation
Sourcepub fn description(self, description: impl Into<String>) -> Self
pub fn description(self, description: impl Into<String>) -> Self
Set the description
Sourcepub fn operation_id(self, id: impl Into<String>) -> Self
pub fn operation_id(self, id: impl Into<String>) -> Self
Set the operation ID
Add tags
Sourcepub fn request_body(self, body: WebhookRequestBody) -> Self
pub fn request_body(self, body: WebhookRequestBody) -> Self
Set the request body
Sourcepub fn response(
self,
status: impl Into<String>,
response: WebhookResponse,
) -> Self
pub fn response( self, status: impl Into<String>, response: WebhookResponse, ) -> Self
Add a response
Sourcepub fn deprecated(self) -> Self
pub fn deprecated(self) -> Self
Mark as deprecated
Trait Implementations§
Source§impl Clone for WebhookOperation
impl Clone for WebhookOperation
Source§fn clone(&self) -> WebhookOperation
fn clone(&self) -> WebhookOperation
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for WebhookOperation
impl Debug for WebhookOperation
Source§impl Default for WebhookOperation
impl Default for WebhookOperation
Source§fn default() -> WebhookOperation
fn default() -> WebhookOperation
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for WebhookOperation
impl<'de> Deserialize<'de> for WebhookOperation
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 WebhookOperation
impl RefUnwindSafe for WebhookOperation
impl Send for WebhookOperation
impl Sync for WebhookOperation
impl Unpin for WebhookOperation
impl UnwindSafe for WebhookOperation
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