@@ -19,6 +19,41 @@ class Endpoint(Creatable, Deactivable, Retrievable, Queryable, Updateable):
1919 is_enable : bool
2020 events : List [WebhookEvent ]
2121
22+ class Config :
23+ fields = {
24+ 'url' : {'description' : 'HTTPS url to send webhooks' },
25+ 'secret' : {
26+ 'description' : 'token to verify the webhook is sent by Cuenca '
27+ 'using HMAC algorithm'
28+ },
29+ 'is_enable' : {
30+ 'description' : 'Allows user to turn-off the endpoint '
31+ 'without the need of deleting it'
32+ },
33+ 'events' : {
34+ 'description' : 'list of enabled events. If None, '
35+ 'all events will be enabled for this Endpoint'
36+ },
37+ }
38+ schema_extra = {
39+ 'example' : {
40+ '_id' : 'ENxxne2Z5VSTKZm_w8Hzffcw' ,
41+ 'platform_id' : 'PTZoPrrPT6Ts-9myamq5h1bA' ,
42+ 'created_at' : '2022-06-29T22:00:00Z' ,
43+ 'updated_at' : '2022-06-29T22:00:00Z' ,
44+ 'secret' : '1234' ,
45+ 'url' : 'https://webhook.site/714ed1d8' ,
46+ 'events' : [
47+ 'transaction.create' ,
48+ 'transaction.update' ,
49+ 'user.create' ,
50+ 'user.update' ,
51+ 'user.delete' ,
52+ ],
53+ 'is_enable' : True ,
54+ }
55+ }
56+
2257 @classmethod
2358 def create (
2459 cls ,
@@ -30,7 +65,6 @@ def create(
3065 """
3166 Creates and Endpoint, allowing to recieve Webhooks with the specified
3267 events.
33-
3468 :param url: HTTPS url to send webhooks
3569 :param events: list of enabled events. If None, all events will be
3670 enabled for this Endpoint
@@ -52,7 +86,6 @@ def update(
5286 """
5387 Updates endpoint properties. It allows reconfigure properties
5488 like url and is_active.
55-
5689 :param endpoint_id: existing endpoint_id
5790 :param url
5891 :param is_enable
0 commit comments