-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathabuse_service.py
More file actions
51 lines (37 loc) · 1.72 KB
/
abuse_service.py
File metadata and controls
51 lines (37 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
from kagglesdk.abuse.types.abuse_service import AdminAllowlistEntityRequest, RemoveDatasetVersionQuarantineRequest, SetReportedDismissalRequest
from kagglesdk.kaggle_http_client import KaggleHttpClient
class AbuseClient(object):
def __init__(self, client: KaggleHttpClient):
self._client = client
def set_reported_dismissal(self, request: SetReportedDismissalRequest = None):
r"""
Set dismissal state for a given entity (only applicable to notebooks /
datasets)
Args:
request (SetReportedDismissalRequest):
The request object; initialized to empty instance if not specified.
"""
if request is None:
request = SetReportedDismissalRequest()
self._client.call("abuse.AbuseService", "SetReportedDismissal", request, None)
def admin_allowlist_entity(self, request: AdminAllowlistEntityRequest = None):
r"""
An admin only method to allowlist an entity, marking it as no longer
moderated automatically
Args:
request (AdminAllowlistEntityRequest):
The request object; initialized to empty instance if not specified.
"""
if request is None:
request = AdminAllowlistEntityRequest()
self._client.call("abuse.AbuseService", "AdminAllowlistEntity", request, None)
def remove_dataset_version_quarantine(self, request: RemoveDatasetVersionQuarantineRequest = None):
r"""
Removes a quarantine on a dataset version, if applicable.
Args:
request (RemoveDatasetVersionQuarantineRequest):
The request object; initialized to empty instance if not specified.
"""
if request is None:
request = RemoveDatasetVersionQuarantineRequest()
self._client.call("abuse.AbuseService", "RemoveDatasetVersionQuarantine", request, None)