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

Improve documentation for file_lock.FileRetentionSetting class #533

Merged
merged 2 commits into from
Feb 10, 2025
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
15 changes: 14 additions & 1 deletion b2sdk/_internal/file_lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,22 @@ def __eq__(self, other):


class FileRetentionSetting:
"""Represent file retention settings, i.e. whether the file is retained, in which mode and until when"""
"""
Represent file retention settings, i.e. whether the file is retained, in which mode and until when

:param mode: retention mode
:type mode: RetentionMode
:param retain_until: retain until timestamp (in milliseconds since :abbr:`epoch (1970-01-01 00:00:00)`)
:type retain_until: int
"""

def __init__(self, mode: RetentionMode, retain_until: int | None = None):
"""
:param mode: retention mode
:type mode: RetentionMode
:param retain_until: retain until timestamp (in milliseconds since :abbr:`epoch (1970-01-01 00:00:00)`)
:type retain_until: int
"""
if mode in RETENTION_MODES_REQUIRING_PERIODS and retain_until is None:
raise ValueError(f'must specify retain_until for retention mode {mode}')
self.mode = mode
Expand Down
1 change: 1 addition & 0 deletions changelog.d/532.doc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Document params in FileRetentionSetting class.