Skip to content

Commit 8b03818

Browse files
committed
finished archive api
1 parent f0b1a97 commit 8b03818

1 file changed

Lines changed: 31 additions & 1 deletion

File tree

ThreadFixProApi/Networks/_utils/_archive.py

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,34 @@ def __init__(self, host, api_key, verify_ssl, timeout, headers, user_agent, cert
2121
the private key and the certificate) or as a tuple of both file’s path
2222
:param debug: Prints requests and responses, useful for debugging.
2323
"""
24-
super().__init__(host, api_key, verify_ssl, timeout, headers, user_agent, cert, debug)
24+
super().__init__(host, api_key, verify_ssl, timeout, headers, user_agent, cert, debug)
25+
26+
def archive_asset(self, asset_id):
27+
"""
28+
Archives a specific asset
29+
:param asset_id: ID of asset to archive
30+
"""
31+
return super().request('PUT', f'/api/archive/assets/{asset_id}')
32+
33+
def archive_asset(self, asset_ids):
34+
"""
35+
Archives a set of assets
36+
:param asset_ids: IDs of assets to archive
37+
"""
38+
params = { 'resources' : asset_ids }
39+
return super().request('PUT', f'/api/archive/assets', params=params)
40+
41+
def archive_asset(self, asset_id):
42+
"""
43+
Unarchives a specific asset
44+
:param asset_id: ID of asset to unarchive
45+
"""
46+
return super().request('PUT', f'/api/unarchive/assets/{asset_id}')
47+
48+
def archive_asset(self, asset_ids):
49+
"""
50+
Unarchives a set of assets
51+
:param asset_ids: IDs of assets to unarchive
52+
"""
53+
params = { 'resources' : asset_ids }
54+
return super().request('PUT', f'/api/unarchive/assets', params=params)

0 commit comments

Comments
 (0)