Skip to content

Commit

Permalink
Improve documentation for file_lock.FileRetentionSetting class.
Browse files Browse the repository at this point in the history
  • Loading branch information
olzhasar-reef committed Feb 6, 2025
1 parent c214f59 commit 955b889
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 955b889

Please sign in to comment.