11from dimo .errors import check_type
22
33
4- class VehicleEvents :
4+ class VehicleTriggers :
55
66 def __init__ (self , request_method , get_auth_headers ):
77 self ._request = request_method
@@ -14,7 +14,7 @@ def list_all_webhooks(self, developer_jwt: str):
1414 check_type ("developer_jwt" , developer_jwt , str )
1515 url = f"/v1/webhooks"
1616 return self ._request (
17- "GET" , "VehicleEvents " , url , headers = self ._get_auth_headers (developer_jwt )
17+ "GET" , "VehicleTriggers " , url , headers = self ._get_auth_headers (developer_jwt )
1818 )
1919
2020 def register_webhook (self , developer_jwt : str , request : object ):
@@ -26,7 +26,7 @@ def register_webhook(self, developer_jwt: str, request: object):
2626 url = f"/v1/webhooks"
2727 return self ._request (
2828 "POST" ,
29- "VehicleEvents " ,
29+ "VehicleTriggers " ,
3030 url ,
3131 headers = self ._get_auth_headers (developer_jwt ),
3232 data = request ,
@@ -39,29 +39,29 @@ def webhook_signals(self, developer_jwt: str):
3939 check_type ("developer_jwt" , developer_jwt , str )
4040 url = f"/v1/webhooks/signals"
4141 return self ._request (
42- "GET" , "VehicleEvents " , url , headers = self ._get_auth_headers (developer_jwt )
42+ "GET" , "VehicleTriggers " , url , headers = self ._get_auth_headers (developer_jwt )
4343 )
4444
45- def list_vehicle_subscriptions (self , developer_jwt : str , token_id : str ):
45+ def list_vehicle_subscriptions (self , developer_jwt : str , token_did : str ):
4646 """
4747 Lists all webhooks that a specified vehicle token id is subscribed to
4848 """
4949 check_type ("developer_jwt" , developer_jwt , str )
50- check_type ("token_id" , token_id , str )
51- url = f"/v1/webhooks/vehicles/{ token_id } "
50+ check_type ("token_id" , token_did , str )
51+ url = f"/v1/webhooks/vehicles/{ token_did } "
5252 return self ._request (
53- "GET" , "VehicleEvents " , url , headers = self ._get_auth_headers (developer_jwt )
53+ "GET" , "VehicleTriggers " , url , headers = self ._get_auth_headers (developer_jwt )
5454 )
5555
56- def list_vehicle_subscriptions_by_event (self , developer_jwt : str , webhook_id : str ):
56+ def list_vehicle_subscriptions_by_trigger (self , developer_jwt : str , webhook_id : str ):
5757 """
5858 Lists all vehicle subscriptions for a given webhook id
5959 """
6060 check_type ("developer_jwt" , developer_jwt , str )
6161 check_type ("webhook_id" , webhook_id , str )
6262 url = f"/v1/webhooks/{ webhook_id } "
6363 return self ._request (
64- "GET" , "VehicleEvents " , url , headers = self ._get_auth_headers (developer_jwt )
64+ "GET" , "VehicleTriggers " , url , headers = self ._get_auth_headers (developer_jwt )
6565 )
6666
6767 def update_webhook (self , developer_jwt : str , webhook_id : str , request : object ):
@@ -74,7 +74,7 @@ def update_webhook(self, developer_jwt: str, webhook_id: str, request: object):
7474 url = f"/v1/webhooks/{ webhook_id } "
7575 return self ._request (
7676 "PUT" ,
77- "VehicleEvents " ,
77+ "VehicleTriggers " ,
7878 url ,
7979 headers = self ._get_auth_headers (developer_jwt ),
8080 data = request ,
@@ -89,7 +89,7 @@ def delete_webhook(self, developer_jwt: str, webhook_id: str):
8989 url = f"/v1/webhooks/{ webhook_id } "
9090 return self ._request (
9191 "DELETE" ,
92- "VehicleEvents " ,
92+ "VehicleTriggers " ,
9393 url ,
9494 headers = self ._get_auth_headers (developer_jwt ),
9595 )
@@ -102,19 +102,19 @@ def subscribe_all_vehicles(self, developer_jwt: str, webhook_id: str):
102102 check_type ("webhook_id" , webhook_id , str )
103103 url = f"/v1/webhooks/{ webhook_id } /subscribe/all"
104104 return self ._request (
105- "POST" , "VehicleEvents " , url , headers = self ._get_auth_headers (developer_jwt )
105+ "POST" , "VehicleTriggers " , url , headers = self ._get_auth_headers (developer_jwt )
106106 )
107107
108- def subscribe_vehicle (self , developer_jwt : str , token_id : str , webhook_id : str ):
108+ def subscribe_vehicle (self , developer_jwt : str , token_did : str , webhook_id : str ):
109109 """
110110 Subscribes a single vehicle to a specified webhook
111111 """
112112 check_type ("developer_jwt" , developer_jwt , str )
113- check_type ("token_id" , token_id , str )
113+ check_type ("token_id" , token_did , str )
114114 check_type ("webhook_id" , webhook_id , str )
115- url = f"/v1/webhooks/{ webhook_id } /subscribe/{ token_id } "
115+ url = f"/v1/webhooks/{ webhook_id } /subscribe/{ token_did } "
116116 return self ._request (
117- "POST" , "VehicleEvents " , url , headers = self ._get_auth_headers (developer_jwt )
117+ "POST" , "VehicleTriggers " , url , headers = self ._get_auth_headers (developer_jwt )
118118 )
119119
120120 def unsubscribe_all_vehicles (self , developer_jwt : str , webhook_id : str ):
@@ -126,22 +126,22 @@ def unsubscribe_all_vehicles(self, developer_jwt: str, webhook_id: str):
126126 url = f"/v1/webhooks/{ webhook_id } /unsubscribe/all"
127127 return self ._request (
128128 "DELETE" ,
129- "VehicleEvents " ,
129+ "VehicleTriggers " ,
130130 url ,
131131 headers = self ._get_auth_headers (developer_jwt ),
132132 )
133133
134- def unsubscribe_vehicle (self , developer_jwt : str , token_id : str , webhook_id : str ):
134+ def unsubscribe_vehicle (self , developer_jwt : str , token_did : str , webhook_id : str ):
135135 """
136136 Unsubscribes a single vehicle from a specified webhook
137137 """
138138 check_type ("developer_jwt" , developer_jwt , str )
139- check_type ("token_id" , token_id , str )
139+ check_type ("token_id" , token_did , str )
140140 check_type ("webhook_id" , webhook_id , str )
141- url = f"/v1/webhooks/{ webhook_id } /unsubscribe/{ token_id } "
141+ url = f"/v1/webhooks/{ webhook_id } /unsubscribe/{ token_did } "
142142 return self ._request (
143143 "DELETE" ,
144- "VehicleEvents " ,
144+ "VehicleTriggers " ,
145145 url ,
146146 headers = self ._get_auth_headers (developer_jwt ),
147147 )
0 commit comments