Skip to content

Commit

Permalink
Merge pull request Backblaze#533 from reef-technologies/master
Browse files Browse the repository at this point in the history
Improve documentation for file_lock.FileRetentionSetting class
  • Loading branch information
mlech-reef authored Feb 10, 2025
2 parents c214f59 + ae082cc commit 9ee87a0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
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.

0 comments on commit 9ee87a0

Please sign in to comment.