fix: format of bucket event notifications (#1138)

This commit is contained in:
mythrnr
2025-12-16 21:44:57 +09:00
committed by GitHub
parent 0bca1fbd56
commit 94d5b1c1e4
4 changed files with 90 additions and 4 deletions
+5 -1
View File
@@ -20,6 +20,7 @@ use url::form_urlencoded;
/// Represents the identity of the user who triggered the event
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Identity {
/// The principal ID of the user
pub principal_id: String,
@@ -27,6 +28,7 @@ pub struct Identity {
/// Represents the bucket that the object is in
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Bucket {
/// The name of the bucket
pub name: String,
@@ -38,6 +40,7 @@ pub struct Bucket {
/// Represents the object that the event occurred on
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct Object {
/// The key (name) of the object
pub key: String,
@@ -62,6 +65,7 @@ pub struct Object {
/// Metadata about the event
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Metadata {
/// The schema version of the event
#[serde(rename = "s3SchemaVersion")]
@@ -76,13 +80,13 @@ pub struct Metadata {
/// Information about the source of the event
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Source {
/// The host where the event originated
pub host: String,
/// The port on the host
pub port: String,
/// The user agent that caused the event
#[serde(rename = "userAgent")]
pub user_agent: String,
}