Skip to content

Commit 08f9113

Browse files
authored
Merge pull request #2 from frain-dev/ydev/0.6-support
Ydev/0.6 support
2 parents 7607a6b + a66faaf commit 08f9113

File tree

15 files changed

+333
-128
lines changed

15 files changed

+333
-128
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
venv/
2+
build
3+
convoy_python.egg-info
4+
dist/

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ An application represents a user's application trying to receive webhooks. Once
4545
```python
4646
appData = { "name": "my_app", "support_email": "[email protected]" }
4747
(response, status) = convoy.applications.create({}, appData)
48-
appId = response["data"]["uid"]
48+
app_id = response["data"]["uid"]
4949

5050
```
5151

@@ -61,7 +61,7 @@ endpointData = {
6161
"events": ["*"],
6262
}
6363

64-
(response, status) = convoy.endpoint.create(appId, {}, endpointData)
64+
(response, status) = convoy.endpoint.create(app_id, {}, endpointData)
6565
```
6666

6767
### Sending an Event
@@ -70,7 +70,7 @@ To send an event, you'll need the `uid` we created in the earlier section.
7070

7171
```python
7272
eventData = {
73-
"app_id": appId,
73+
"app_id": app_id,
7474
"event_type": "payment.success",
7575
"data": {
7676
"event": "payment.success",

convoy/api/application.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,49 +11,49 @@ def __init__(self, config):
1111
self.client = Client(config)
1212

1313
def all(self, query):
14-
'''
14+
"""
1515
Get all applicaitons.
16-
'''
17-
response = self.client.httpGet("/applications", query)
16+
"""
17+
response = self.client.http_get("/applications", query)
1818
return response
1919

2020
def create(self, query, data):
21-
'''
21+
"""
2222
Create a new application.
2323
Parameters
2424
----------
2525
data = {
2626
"name": "",
2727
"support_email": ""
2828
}
29-
'''
30-
response = self.client.httpPost("/applications", query, data)
29+
"""
30+
response = self.client.http_post("/applications", query, data)
3131
return response
3232

3333
def find(self, id, query):
34-
'''
34+
"""
3535
Find a particular application.
36-
'''
37-
response = self.client.httpGet("/applications/%s" % (id), query)
36+
"""
37+
response = self.client.http_get("/applications/%s" % (id), query)
3838
return response
3939

4040
def update(self, id, query, data):
41-
'''
41+
"""
4242
Update an application.
4343
Parameters
4444
----------
4545
data = {
4646
"name": "",
4747
"support_email": ""
4848
}
49-
'''
50-
response = self.client.httpPut("/applications/%s" % id, query, data)
49+
"""
50+
response = self.client.http_put("/applications/%s" % id, query, data)
5151
return response
5252

5353
def delete(self, id, query, data):
54-
'''
54+
"""
5555
Delete an application.
56-
'''
57-
response = self.client.httpDelete("/applications/%s" % id, query, data)
56+
"""
57+
response = self.client.http_delete("/applications/%s" % id, query, data)
5858
return response
5959

convoy/api/delivery_attempts.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ class DeliveryAttempt():
1010
def __init__(self, config):
1111
self.client = Client(config)
1212

13-
def all(self, eventdeliveryId, query):
14-
response = self.client.httpGet("/eventdeliveries/%s/deliveryattempts" % eventdeliveryId, query)
13+
def all(self, event_delivery_id, query):
14+
response = self.client.http_get("/eventdeliveries/%s/deliveryattempts" % event_delivery_id, query)
1515
return response
1616

17-
def find(self, eventdeliveryId, deliveryAttemptId, query):
18-
response = self.client.httpGet("/eventdeliveries/%s/deliveryattempts/%s" % (eventdeliveryId, deliveryAttemptId), query)
17+
def find(self, event_delivery_id, delivery_attempt_id, query):
18+
response = self.client.http_get("/eventdeliveries/%s/deliveryattempts/%s" % (event_delivery_id, delivery_attempt_id), query)
1919
return response
2020

convoy/api/endpoint.py

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ class Endpoint():
1010
def __init__(self, config):
1111
self.client = Client(config)
1212

13-
def all(self, appId, query):
14-
'''
13+
def all(self, app_id, query):
14+
"""
1515
Get all endpoints for an application.
16-
'''
17-
response = self.client.httpGet("/applications/%s/endpoints" % appId, query)
16+
"""
17+
response = self.client.http_get("/applications/%s/endpoints" % app_id, query)
1818
return response
1919

20-
def create(self, appId, query, data):
21-
'''
20+
def create(self, app_id, query, data):
21+
"""
2222
Create a new endpoint.
2323
Parameters
2424
----------
@@ -28,19 +28,19 @@ def create(self, appId, query, data):
2828
"secret": "",
2929
"events": [],
3030
}
31-
'''
32-
response = self.client.httpPost("/applications/%s/endpoints" % appId, query, data)
31+
"""
32+
response = self.client.http_post("/applications/%s/endpoints" % app_id, query, data)
3333
return response
3434

35-
def find(self, appId, endpointId, query):
36-
'''
35+
def find(self, app_id, endpoint_id, query):
36+
"""
3737
Find a particular application.
38-
'''
39-
response = self.client.httpGet("/applications/%s/endpoints/%s" % (appId, endpointId), query)
38+
"""
39+
response = self.client.http_get("/applications/%s/endpoints/%s" % (app_id, endpoint_id), query)
4040
return response
4141

42-
def update(self, appId, endpointId, query, data):
43-
'''
42+
def update(self, app_id, endpoint_id, query, data):
43+
"""
4444
Update an application.
4545
Parameters
4646
----------
@@ -50,14 +50,14 @@ def update(self, appId, endpointId, query, data):
5050
"secret": "",
5151
"events": [],
5252
}
53-
'''
54-
response = self.client.httpPut("/applications/%s/endpoints/%s" % (appId, endpointId), query, data)
53+
"""
54+
response = self.client.http_put("/applications/%s/endpoints/%s" % (app_id, endpoint_id), query, data)
5555
return response
5656

57-
def delete(self, appId, endpointId, query, data):
58-
'''
57+
def delete(self, app_id, endpoint_id, query, data):
58+
"""
5959
Delete an application.
60-
'''
61-
response = self.client.httpDelete("/applications/%s/endpoints/%s" % (appId, endpointId), query, data)
60+
"""
61+
response = self.client.http_delete("/applications/%s/endpoints/%s" % (app_id, endpoint_id), query, data)
6262
return response
6363

convoy/api/event.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ def __init__(self, config):
1111
self.client = Client(config)
1212

1313
def all(self, query):
14-
response = self.client.httpGet("/events", query)
14+
response = self.client.http_get("/events", query)
1515
return response
1616

1717
def create(self, query, data):
18-
'''
18+
"""
1919
Create a new event.
2020
Parameters
2121
----------
@@ -27,11 +27,11 @@ def create(self, query, data):
2727
"data": {},
2828
}
2929
}
30-
'''
31-
response = self.client.httpPost("/events", query, data)
30+
"""
31+
response = self.client.http_post("/events", query, data)
3232
return response
3333

3434
def find(self, id, query):
35-
response = self.client.httpGet("/events/%s" % id, query)
35+
response = self.client.http_get("/events/%s" % id, query)
3636
return response
3737

convoy/api/event_delivery.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,35 +11,35 @@ def __init__(self, config):
1111
self.client = Client(config)
1212

1313
def all(self, query):
14-
'''
14+
"""
1515
Get all eventdeliveries.
16-
'''
17-
response = self.client.httpGet("/eventdeliveries", query)
16+
"""
17+
response = self.client.http_get("/eventdeliveries", query)
1818
return response
1919

2020
def find(self, id, query):
21-
'''
21+
"""
2222
Find a particular eventdelivery.
23-
'''
24-
response = self.client.httpGet("/eventdeliveries/%s" % id, query)
23+
"""
24+
response = self.client.http_get("/eventdeliveries/%s" % id, query)
2525
return response
2626

2727
def resend(self, id, query):
28-
'''
28+
"""
2929
Resend an eventdelivery.
30-
'''
31-
response = self.client.httpPut("/eventdeliveries/%s/resend" % id, query, {})
30+
"""
31+
response = self.client.http_put("/eventdeliveries/%s/resend" % id, query, {})
3232
return response
3333

3434
def batchresend(self, id, query, data):
35-
'''
35+
"""
3636
Batch resend eventdeliveries.
3737
Parameters
3838
----------
3939
data = {
4040
ids: []
4141
}
42-
'''
43-
response = self.client.httpPut("/eventdeliveries/batchretry" % id, query, data)
42+
"""
43+
response = self.client.http_put("/eventdeliveries/batchretry" % id, query, data)
4444
return response
4545

convoy/api/group.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ def __init__(self, config):
1111
self.client = Client(config)
1212

1313
def all(self, query):
14-
'''
14+
"""
1515
Get all groups.
16-
'''
17-
response = self.client.httpGet("/groups", query)
16+
"""
17+
response = self.client.http_get("/groups", query)
1818
return response
1919

2020
def create(self, query, data):
21-
'''
21+
"""
2222
Create a new group.
2323
Parameters
2424
----------
@@ -40,19 +40,19 @@ def create(self, query, data):
4040
},
4141
},
4242
}
43-
'''
44-
response = self.client.httpPost("/groups", query, data)
43+
"""
44+
response = self.client.http_post("/groups", query, data)
4545
return response
4646

4747
def find(self, id, query):
48-
'''
48+
"""
4949
Find a particular group.
50-
'''
51-
response = self.client.httpGet("/groups/%s" % id, query)
50+
"""
51+
response = self.client.http_get("/groups/%s" % id, query)
5252
return response
5353

5454
def update(self, id, query, data):
55-
'''
55+
"""
5656
Update a group.
5757
Parameters
5858
----------
@@ -74,14 +74,14 @@ def update(self, id, query, data):
7474
},
7575
},
7676
}
77-
'''
78-
response = self.client.httpPut("/groups/%s" % id, query, data)
77+
"""
78+
response = self.client.http_put("/groups/%s" % id, query, data)
7979
return response
8080

8181
def delete(self, id, query, data):
82-
'''
82+
"""
8383
Delete a group.
84-
'''
85-
response = self.client.httpDelete("/groups/%s" % id, query, data)
84+
"""
85+
response = self.client.http_delete("/groups/%s" % id, query, data)
8686
return response
8787

0 commit comments

Comments
 (0)