Skip to content

Commit

Permalink
feat: addeded resource methods for shallow-copy
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonyjb committed Jul 17, 2023
1 parent 4a5422f commit c14ce3b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
20 changes: 20 additions & 0 deletions h51/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,14 @@ def persist(self):

self._document.update(r)

def shallow_copy(self):
"""Shallow copy an asset (remove the expires time)"""

r = self._client(
'post',
f'assets/{self.uid}/shallow-copy'
)

@classmethod
def all(cls, client, secure=None, type=None, q=None, rate_buffer=0):
"""
Expand Down Expand Up @@ -305,6 +313,18 @@ def persist_many(cls, client, uids):
data={'uids': uids}
)

@classmethod
def shallow_copy_many(cls, client, uids):
"""
Find one or more assets matching the given uids and shallow copy them
(remove the expires time).
"""
return client(
'post',
'assets/shallow-copy',
data={'uids': uids}
)

@classmethod
def zip(
cls,
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# Versions should comply with PEP440. For a discussion on single-sourcing
# the version across setup.py and the project code, see
# https://packaging.python.org/en/latest/single_source_version.html
version='0.0.8',
version='0.0.9',
description=\
'The H51 Python library provides a pythonic interface to the H51 API.',
long_description=long_description,
Expand Down

0 comments on commit c14ce3b

Please sign in to comment.