From f92affba9dbc9eaf476ce113194ac30bf5931de8 Mon Sep 17 00:00:00 2001 From: TRoc81 <36325432+TRoc81@users.noreply.github.com> Date: Mon, 12 Feb 2024 10:28:52 +0100 Subject: [PATCH 1/2] Add expiration date support for shared links Added support for expiration date on shared links --- owncloud/owncloud.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/owncloud/owncloud.py b/owncloud/owncloud.py index 2933503..bc23e17 100644 --- a/owncloud/owncloud.py +++ b/owncloud/owncloud.py @@ -877,6 +877,7 @@ def share_file_with_link(self, path, **kwargs): perms = kwargs.get('perms', None) public_upload = kwargs.get('public_upload', 'false') password = kwargs.get('password', None) + expiredate = kwargs.get('expiredate', None) name = kwargs.get('name', None) path = self._normalize_path(path) @@ -888,6 +889,8 @@ def share_file_with_link(self, path, **kwargs): post_data['publicUpload'] = str(public_upload).lower() if isinstance(password, six.string_types): post_data['password'] = password + if isinstance(expiredate, datetime.date): + post_data['expireDate'] = expiredate if name is not None: post_data['name'] = self._encode_string(name) if perms: From 08fd9242e93c20d2cefbb784e604580bda1c0dc3 Mon Sep 17 00:00:00 2001 From: TRoc81 <36325432+TRoc81@users.noreply.github.com> Date: Mon, 12 Feb 2024 10:37:40 +0100 Subject: [PATCH 2/2] Updated comments for expiration date Updated comments for expiration date --- owncloud/owncloud.py | 1 + 1 file changed, 1 insertion(+) diff --git a/owncloud/owncloud.py b/owncloud/owncloud.py index bc23e17..363b0df 100644 --- a/owncloud/owncloud.py +++ b/owncloud/owncloud.py @@ -868,6 +868,7 @@ def share_file_with_link(self, path, **kwargs): defaults to read only (1) :param public_upload (optional): allows users to upload files or folders :param password (optional): sets a password + :param expiredate (optional): sets an expiration date for the shared link https://doc.owncloud.com/server/next/admin_manual/configuration/files/file_sharing_configuration.html :param name (optional): display name for the link :returns: instance of :class:`ShareInfo` with the share info