@@ -29,27 +29,27 @@ class S3EventBridgeNotificationObject(DictWrapper):
29
29
@property
30
30
def key (self ) -> str :
31
31
"""Object key"""
32
- return unquote_plus (self ["object" ][ " key" ])
32
+ return unquote_plus (self ["key" ])
33
33
34
34
@property
35
35
def size (self ) -> str :
36
36
"""Object size"""
37
- return self ["object" ][ " size" ]
37
+ return self ["size" ]
38
38
39
39
@property
40
40
def etag (self ) -> str :
41
41
"""Object etag"""
42
- return self ["object" ][ " etag" ]
42
+ return self ["etag" ]
43
43
44
44
@property
45
45
def version_id (self ) -> str :
46
46
"""Object version ID"""
47
- return self ["object" ][ " version-id" ]
47
+ return self ["version-id" ]
48
48
49
49
@property
50
50
def sequencer (self ) -> str :
51
51
"""Object key"""
52
- return self ["object" ][ " sequencer" ]
52
+ return self ["sequencer" ]
53
53
54
54
55
55
class S3EventBridgeNotificationDetail (DictWrapper ):
@@ -61,27 +61,27 @@ def version(self) -> str:
61
61
@property
62
62
def bucket (self ) -> S3EventNotificationEventBridgeBucket :
63
63
"""Get the bucket name for the S3 notification"""
64
- return S3EventNotificationEventBridgeBucket (self ["detail" ][ " bucket" ])
64
+ return S3EventNotificationEventBridgeBucket (self ["bucket" ])
65
65
66
66
@property
67
67
def object (self ) -> S3EventBridgeNotificationObject : # noqa: A003
68
68
"""Get the request-id for the S3 notification"""
69
- return S3EventBridgeNotificationObject (self ["detail" ][ " object" ])
69
+ return S3EventBridgeNotificationObject (self ["object" ])
70
70
71
71
@property
72
72
def request_id (self ) -> str :
73
73
"""Get the request-id for the S3 notification"""
74
- return self ["detail" ][ " request-id" ]
74
+ return self ["request-id" ]
75
75
76
76
@property
77
77
def requester (self ) -> str :
78
78
"""Get the AWS account ID or AWS service principal of requester for the S3 notification"""
79
- return self ["detail" ][ " requester" ]
79
+ return self ["requester" ]
80
80
81
81
@property
82
82
def source_ip_address (self ) -> str :
83
83
"""Get the source IP address of S3 request. Only present for events triggered by an S3 request."""
84
- return self ["detail" ][ " source-ip-address" ]
84
+ return self ["source-ip-address" ]
85
85
86
86
@property
87
87
def reason (self ) -> Optional [str ]:
@@ -91,7 +91,7 @@ def reason(self) -> Optional[str]:
91
91
`CompleteMultipartUpload`. For 'Object Deleted' events, this is set to `DeleteObject` when an object is deleted
92
92
by an S3 API call, or 'Lifecycle Expiration' when an object is deleted by an S3 Lifecycle expiration rule.
93
93
"""
94
- return self [ "detail" ] .get ("reason" )
94
+ return self .get ("reason" )
95
95
96
96
@property
97
97
def deletion_type (self ) -> Optional [str ]:
@@ -101,7 +101,7 @@ def deletion_type(self) -> Optional[str]:
101
101
this is set to 'Permanently Deleted'. When a delete marker is created for a versioned object, this is set to
102
102
'Delete Marker Created'.
103
103
"""
104
- return self [ "detail" ] .get ("deletion-type" )
104
+ return self .get ("deletion-type" )
105
105
106
106
@property
107
107
def restore_expiry_time (self ) -> Optional [str ]:
0 commit comments