Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

S3: Sending notification to EventBridge LIFECYCLE_TRANSITION_EVENT #7448

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
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
11 changes: 6 additions & 5 deletions moto/s3/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,11 +222,6 @@
self._metadata = {} # type: ignore
self._metadata.update(metadata)

def set_storage_class(self, storage: Optional[str]) -> None:
if storage is not None and storage not in STORAGE_CLASS:
raise InvalidStorageClass(storage=storage)
self._storage_class = storage

def set_expiry(self, expiry: Optional[datetime.datetime]) -> None:
self._expiry = expiry

Expand Down Expand Up @@ -332,6 +327,12 @@
def storage_class(self) -> Optional[str]:
return self._storage_class

@storage_class.setter
def storage_class(self, storage: Optional[str]) -> None:
if storage is not None and storage not in STORAGE_CLASS:
raise InvalidStorageClass(storage=storage)
self._storage_class = storage

Check warning on line 334 in moto/s3/models.py

View check run for this annotation

Codecov / codecov/patch

moto/s3/models.py#L332-L334

Added lines #L332 - L334 were not covered by tests

@property
def expiry_date(self) -> Optional[str]:
if self._expiry is not None:
Expand Down