From 955b88992f7eae70cddbdb9d353b7ea5e855842c Mon Sep 17 00:00:00 2001 From: Olzhas Arystanov Date: Fri, 7 Feb 2025 04:32:51 +0800 Subject: [PATCH] Improve documentation for file_lock.FileRetentionSetting class. --- b2sdk/_internal/file_lock.py | 15 ++++++++++++++- changelog.d/532.doc.md | 1 + 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 changelog.d/532.doc.md diff --git a/b2sdk/_internal/file_lock.py b/b2sdk/_internal/file_lock.py index 5e95e846d..280eddaf6 100644 --- a/b2sdk/_internal/file_lock.py +++ b/b2sdk/_internal/file_lock.py @@ -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 diff --git a/changelog.d/532.doc.md b/changelog.d/532.doc.md new file mode 100644 index 000000000..9dc826694 --- /dev/null +++ b/changelog.d/532.doc.md @@ -0,0 +1 @@ +Document params in FileRetentionSetting class.