stripe/resources/
webhook_endpoint_ext.rs

1use serde::{Deserialize, Serialize};
2
3/// An enum representing the possible values of an `WebhookEndpoint`'s `status` field.
4#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
5#[serde(rename_all = "snake_case")]
6pub enum WebhookEndpointStatus {
7    Disabled,
8    Enabled,
9}
10
11impl WebhookEndpointStatus {
12    pub fn as_str(self) -> &'static str {
13        match self {
14            WebhookEndpointStatus::Disabled => "disabled",
15            WebhookEndpointStatus::Enabled => "enabled",
16        }
17    }
18}
19
20impl AsRef<str> for WebhookEndpointStatus {
21    fn as_ref(&self) -> &str {
22        self.as_str()
23    }
24}
25
26impl std::fmt::Display for WebhookEndpointStatus {
27    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28        self.as_str().fmt(f)
29    }
30}