1
+ """Define the Gitcoin API client."""
2
+
1
3
import requests
2
4
3
5
4
6
class Config :
5
7
"""Define Base Class for API Endpoint Config."""
6
- params = {}
8
+
9
+ def __init__ (self ):
10
+ self .params = {}
7
11
8
12
def has (self , name ):
9
13
"""Tell if a setting for 'name' was defined."""
@@ -20,26 +24,28 @@ def get(self, name):
20
24
21
25
class BountyConfig (Config ):
22
26
"""Define 'bounties' API Endpoint Config."""
23
- params = {
24
- 'raw_data' : (True , str ),
25
- 'experience_level' : (True , str ),
26
- 'project_length' : (True , str ),
27
- 'bounty_type' : (True , str ),
28
- 'bounty_owner_address' : (True , str ),
29
- 'idx_status' : (True , str ),
30
- 'network' : (True , str ),
31
- 'bounty_owner_github_username' : (True , str ),
32
- 'standard_bounties_id' : (True , str ),
33
- 'pk__gt' : (False , int ),
34
- 'started' : (False , str ),
35
- 'is_open' : (False , bool ),
36
- 'github_url' : (True , str ),
37
- 'fulfiller_github_username' : (False , str ),
38
- 'interested_github_username' : (False , str ),
39
- 'order_by' : (False , str ),
40
- 'limit' : (False , int ),
41
- 'offset' : (False , int )
42
- }
27
+
28
+ def __init__ (self ):
29
+ self .params = {
30
+ 'raw_data' : (True , str ),
31
+ 'experience_level' : (True , str ),
32
+ 'project_length' : (True , str ),
33
+ 'bounty_type' : (True , str ),
34
+ 'bounty_owner_address' : (True , str ),
35
+ 'idx_status' : (True , str ),
36
+ 'network' : (True , str ),
37
+ 'bounty_owner_github_username' : (True , str ),
38
+ 'standard_bounties_id' : (True , str ),
39
+ 'pk__gt' : (False , int ),
40
+ 'started' : (False , str ),
41
+ 'is_open' : (False , bool ),
42
+ 'github_url' : (True , str ),
43
+ 'fulfiller_github_username' : (False , str ),
44
+ 'interested_github_username' : (False , str ),
45
+ 'order_by' : (False , str ),
46
+ 'limit' : (False , int ),
47
+ 'offset' : (False , int )
48
+ }
43
49
44
50
45
51
class Endpoint :
@@ -144,6 +150,6 @@ def set_url(self, id, url):
144
150
def bounties (self ):
145
151
"""Wrap the 'bounties' API endpoint."""
146
152
url = self .urls ['bounties' ]
147
- endpointClass = self .classes ['endpoint' ]
148
- configClass = self .classes ['bounties_list_config' ]
149
- return endpointClass (url , configClass ())
153
+ endpoint_class = self .classes ['endpoint' ]
154
+ config_class = self .classes ['bounties_list_config' ]
155
+ return endpoint_class (url , config_class ())
0 commit comments