This repository was archived by the owner on Sep 16, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplateWrapper.py
70 lines (55 loc) · 1.7 KB
/
templateWrapper.py
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/usr/bin/env python3
from .wrapperInterface import WrapperInterface
from typing import Union
class TemplateWrapper(WrapperInterface):
def __init__(self, apiKey: str):
pass
# Endpoint used for the query
@property
def endpoint(self) -> str:
pass
# A dictionary that contains the available result formats for each collection
@property
def allowedResultFormats(self) -> {str: [str]}:
pass
# The result format that will be used for the query
@property
def resultFormat(self) -> str:
pass
# resultFormat must be settable
@resultFormat.setter
def resultFormat(self, value: str):
pass
# Collection being used for the query
@property
def collection(self) -> str:
pass
# collection must be settable
@collection.setter
def collection(self, value: str):
pass
# Maximum number of results that the API will return
@property
def maxRecords(self) -> int:
pass
# Dictionary of allowed keys and their allowed values for searchField()
@property
def allowedSearchFields(self) -> {str: [str]}:
pass
# Specify value for a given search parameter for manual search
def searchField(self, key: str, value):
pass
# Reset a search parameter
def resetField(self, key: str):
pass
# Translate a search in the wrapper input format into a query that the wrapper api understands
def translateQuery(self, query: dict) -> str:
pass
# Set the index from which the returned results start
# (Necessary if there are more hits for a query than the maximum number of returned results.)
def startAt(self, value: int):
pass
# Make the call to the API
# If no query is given, use the manual search specified by searchField() calls
def callAPI(self, query: Union[dict, None], raw: bool, dry: bool):
pass