Skip to content

Commit 7ed3f26

Browse files
authored
Add documentation and fixture for alerts endpoint (#1540)
* Add documentation and fixture for alerts endpoint * Update * Adjust * Adjust
1 parent 9ca3ba6 commit 7ed3f26

File tree

5 files changed

+101
-0
lines changed

5 files changed

+101
-0
lines changed

docs/endpoints.rst

+7
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,16 @@ This is a list of the endpoints available, and their characteristics.
1313
.. _Contributor Guide: contributing.html
1414

1515

16+
Vehicle information endpoints
17+
----------------------
18+
19+
.. include:: endpoints/vehicle_data.alerts.rst
20+
21+
1622
Vehicle data endpoints
1723
----------------------
1824

25+
.. include:: endpoints/vehicle_data.alerts.rst
1926
.. include:: endpoints/vehicle_data.battery-status.rst
2027
.. include:: endpoints/vehicle_data.charge-history.rst
2128
.. include:: endpoints/vehicle_data.charge-mode.rst
+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
alerts
2+
''''''''''''''
3+
4+
.. rst-class:: endpoint
5+
6+
Base url:
7+
``/commerce/v1/accounts/{account_id}/kamereon/vehicles/{vin}/alerts``
8+
9+
Sample return:
10+
.. literalinclude:: /../tests/fixtures/kamereon/vehicle_info/alerts.json
11+
:language: JSON

src/renault_api/kamereon/models.py

+1
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
}
8787

8888
_DEFAULT_ENDPOINTS: dict[str, str] = {
89+
"alerts": "/vehicles/{vin}/alerts",
8990
"battery-status": "/kca/car-adapter/v2/cars/{vin}/battery-status",
9091
"charge-history": "/kca/car-adapter/v1/cars/{vin}/charge-history",
9192
"charge-mode": "/kca/car-adapter/v1/cars/{vin}/charge-mode",

tests/__snapshots__/test_renault_vehicle.ambr

+5
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
# ---
1717
# name: test_get_endpoints[tests/fixtures/kamereon/vehicles/duster.1.json]
1818
dict({
19+
'alerts': '/vehicles/{vin}/alerts',
1920
'battery-status': '/kca/car-adapter/v2/cars/{vin}/battery-status',
2021
'charge-history': '/kca/car-adapter/v1/cars/{vin}/charge-history',
2122
'charge-mode': '/kca/car-adapter/v1/cars/{vin}/charge-mode',
@@ -45,6 +46,7 @@
4546
# ---
4647
# name: test_get_endpoints[tests/fixtures/kamereon/vehicles/renault_5.1.json]
4748
dict({
49+
'alerts': '/vehicles/{vin}/alerts',
4850
'battery-status': '/kca/car-adapter/v2/cars/{vin}/battery-status',
4951
'charge-history': '/kca/car-adapter/v1/cars/{vin}/charge-history',
5052
'charge-mode': '/kca/car-adapter/v1/cars/{vin}/charge-mode',
@@ -64,6 +66,7 @@
6466
# ---
6567
# name: test_get_endpoints[tests/fixtures/kamereon/vehicles/spring.1.json]
6668
dict({
69+
'alerts': '/vehicles/{vin}/alerts',
6770
'battery-status': '/kca/car-adapter/v2/cars/{vin}/battery-status',
6871
'charge-history': '/kca/car-adapter/v1/cars/{vin}/charge-history',
6972
'charge-mode': '/kca/car-adapter/v1/cars/{vin}/charge-mode',
@@ -83,6 +86,7 @@
8386
# ---
8487
# name: test_get_endpoints[tests/fixtures/kamereon/vehicles/twingo_ze.1.json]
8588
dict({
89+
'alerts': '/vehicles/{vin}/alerts',
8690
'battery-status': '/kca/car-adapter/v2/cars/{vin}/battery-status',
8791
'charge-history': '/kca/car-adapter/v1/cars/{vin}/charge-history',
8892
'charge-mode': '/kca/car-adapter/v1/cars/{vin}/charge-mode',
@@ -126,6 +130,7 @@
126130
# ---
127131
# name: test_get_endpoints[tests/fixtures/kamereon/vehicles/zoe_50.1.json]
128132
dict({
133+
'alerts': '/vehicles/{vin}/alerts',
129134
'battery-status': '/kca/car-adapter/v2/cars/{vin}/battery-status',
130135
'charge-history': '/kca/car-adapter/v1/cars/{vin}/charge-history',
131136
'charge-mode': '/kca/car-adapter/v1/cars/{vin}/charge-mode',
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
[
2+
{
3+
"id": "xxxxxxxxxx",
4+
"alertType": "proactive",
5+
"canArchitecture": "204",
6+
"alertCode": "crashairbagmalfunction",
7+
"trueValues": "1",
8+
"priority": 0,
9+
"minAge": 1,
10+
"minMileage": 100,
11+
"generateTime": 1440,
12+
"generateMileage": 15,
13+
"closeTime": 1440,
14+
"closeMileage": 36,
15+
"criticity": 3,
16+
"generateOccurrence": 3,
17+
"closeOccurrence": 10,
18+
"generateLead": 1,
19+
"notifSMS": 0,
20+
"notifMail": 1,
21+
"notifMybrand": 1,
22+
"notifSourceEvent": "CRIT3.RDVDEALER",
23+
"leadContactDays": 90,
24+
"notifContactDays": 5,
25+
"notifReminderDay": 15,
26+
"notifReminderCount": 0,
27+
"notifReminderCounter": 0,
28+
"notifReminderDate": "2024-03-15T00:00:00.000Z",
29+
"vin": "xxxxxxxxxxx",
30+
"registrationNumber": "xxxxxxxxxxxx",
31+
"countryCode": "IT",
32+
"deliveryDate": "2020-10-30T00:00:00.000Z",
33+
"brandComCode": "REN",
34+
"modelCode": "HJB",
35+
"partyId": "xxxxxxxxxxxxxxx",
36+
"partyCountry": "IT",
37+
"partyOrg": 0,
38+
"partyStaff": 0,
39+
"partyPhone": 1,
40+
"partySms": null,
41+
"partyMail": null,
42+
"partyPostal": null,
43+
"localeDefault": "it-IT",
44+
"dealerNumber": "xxxxxxxxxxx",
45+
"dealerNumberOrigin": "dealer_myr",
46+
"isConnected": 1,
47+
"mileageDate": "2024-02-29T00:00:00.000Z",
48+
"mileage": 63593,
49+
"yearMileage": 16064,
50+
"operationCode": null,
51+
"operationName": null,
52+
"operationType": null,
53+
"nextDate": null,
54+
"nextMileage": null,
55+
"reconductCount": 0,
56+
"isConnectedOperation": 0,
57+
"genReason": null,
58+
"endMileage": 70068,
59+
"status": 0,
60+
"creationDateTime": "2024-02-29T14:21:02.382Z",
61+
"lastUpdateDateTime": "2024-10-29T02:08:45.671Z",
62+
"inVehicleDateTime": "2024-02-29T14:21:15.000Z",
63+
"closureReason": "archived",
64+
"function": "the airbag",
65+
"shortDescription": "WARNING: Check Airbag",
66+
"longDescription": "WARNING: Check Airbag",
67+
"criticityName": "Major alert",
68+
"alertCodeTitle": "Defective airbag",
69+
"alertCodeSubTitle": "Details of the event",
70+
"alertCodeDescription": "The airbag must be inspected",
71+
"alertCodeDetailDescription": "We have detected a malfunction in your airbag system.\nYou must inspect it to ensure that the front passengers are protected if there is an impact. For further information, refer to the user manual of your vehicle below.",
72+
"iconUrl": "https://cap-static-medias.ope.apps.renault.com/images/crashAirbag.png",
73+
"detailImageUrl": "https://cap-static-medias.ope.apps.renault.com/images/crashAirbag.png",
74+
"userGuideUrl": "https://it.e-guide.renault.com/ita/",
75+
"mileageUnit": "km"
76+
}
77+
]

0 commit comments

Comments
 (0)