Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ url = "2.5.8"
aes-gcm = "0.10"
hex = "0.4"
hmac = "0.12"
md-5 = "0.10"
md5 = { package = "md-5", version = "0.10" }
jsonwebtoken = { version = "10", features = ["rust_crypto"] }

[dev-dependencies]
Expand Down
36 changes: 0 additions & 36 deletions src/services/patreon/webhook_types.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![allow(dead_code)]

use serde::Deserialize;

/// Patreon webhook event types parsed from the `X-Patreon-Event` header.
Expand Down Expand Up @@ -33,14 +31,11 @@ impl PatreonWebhookEvent {
#[derive(Debug, Deserialize)]
pub(crate) struct WebhookPayload {
pub(crate) data: WebhookMemberData,
#[serde(default)]
pub(crate) included: Vec<WebhookIncludedResource>,
}

/// Member resource in the webhook payload (the primary `data` object).
#[derive(Debug, Deserialize)]
pub(crate) struct WebhookMemberData {
pub(crate) id: String,
pub(crate) attributes: WebhookMemberAttributes,
#[serde(default)]
pub(crate) relationships: WebhookMemberRelationships,
Expand Down Expand Up @@ -88,37 +83,6 @@ pub(crate) struct WebhookCampaignRelationship {
#[derive(Debug, Deserialize)]
pub(crate) struct WebhookResourceRef {
pub(crate) id: String,
#[serde(rename = "type")]
pub(crate) resource_type: String,
}

/// Included resources in the webhook payload.
#[derive(Debug, Deserialize)]
#[serde(tag = "type")]
pub(crate) enum WebhookIncludedResource {
#[serde(rename = "user")]
User(WebhookIncludedUser),
#[serde(rename = "tier")]
Tier(WebhookIncludedTier),
#[serde(rename = "campaign")]
Campaign(WebhookIncludedCampaign),
#[serde(other)]
Other,
}

#[derive(Debug, Deserialize)]
pub(crate) struct WebhookIncludedUser {
pub(crate) id: String,
}

#[derive(Debug, Deserialize)]
pub(crate) struct WebhookIncludedTier {
pub(crate) id: String,
}

#[derive(Debug, Deserialize)]
pub(crate) struct WebhookIncludedCampaign {
pub(crate) id: String,
}

#[cfg(test)]
Expand Down
Loading