From 2670df1dc7fabf04a42fa4c6c155e30a236dbf13 Mon Sep 17 00:00:00 2001 From: Devon Rueckner Date: Tue, 12 Mar 2024 19:28:59 -0400 Subject: [PATCH] device.id, device.name -> deviceId, deviceName --- foxglove_data_platform/client.py | 32 ++++++++++++++++---------------- tests/test_data.py | 2 +- tests/test_events.py | 6 +++--- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/foxglove_data_platform/client.py b/foxglove_data_platform/client.py index 40e2b46..94500cc 100644 --- a/foxglove_data_platform/client.py +++ b/foxglove_data_platform/client.py @@ -201,8 +201,8 @@ def create_event( "device_id or device_name must be provided to create_event" ) params = { - "device.id": device_id, - "device.name": device_name, + "deviceId": device_id, + "deviceName": device_name, "start": start.astimezone().isoformat(), "end": end.astimezone().isoformat(), "metadata": metadata, @@ -260,8 +260,8 @@ def get_events( of `query`. """ params = { - "device.id": device_id, - "device.name": device_name, + "deviceId": device_id, + "deviceName": device_name, "sortBy": camelize(sort_by), "sortOrder": sort_order, "limit": limit, @@ -407,8 +407,8 @@ def _make_stream_link( raise RuntimeError("device_id or device_name must be provided") params = { - "device.id": device_id, - "device.name": device_name, + "deviceId": device_id, + "deviceName": device_name, "end": end.astimezone().isoformat(), "outputFormat": output_format.value, "start": start.astimezone().isoformat(), @@ -476,8 +476,8 @@ def get_coverage( to be considered discrete. """ params = { - "device.id": device_id, - "device.name": device_name, + "deviceId": device_id, + "deviceName": device_name, "tolerance": tolerance, "start": start.astimezone().isoformat(), "end": end.astimezone().isoformat(), @@ -751,8 +751,8 @@ def get_recordings( :param offset: Optionally offset the results by this many records. """ all_params = { - "device.id": device_id, - "device.name": device_name, + "deviceId": device_id, + "deviceName": device_name, "start": start.astimezone().isoformat() if start else None, "end": end.astimezone().isoformat() if end else None, "site.id": site_id, @@ -821,8 +821,8 @@ def get_attachments( :param offset: Optionally offset the results by this many records. """ all_params = { - "device.id": device_id, - "device.name": device_name, + "deviceId": device_id, + "deviceName": device_name, "siteId": site_id, "recordingId": recording_id, "sortBy": camelize(sort_by), @@ -883,8 +883,8 @@ def get_topics( self.__url__("/v1/data/topics"), headers=self.__headers, params={ - "device.id": device_id, - "device.name": device_name, + "deviceId": device_id, + "deviceName": device_name, "start": start.astimezone().isoformat(), "end": end.astimezone().isoformat(), "includeSchemas": "true" if include_schemas else "false", @@ -930,8 +930,8 @@ def upload_data( callback: An optional callback to report progress on the upload. """ params = { - "device.id": device_id, - "device.name": device_name, + "deviceId": device_id, + "deviceName": device_name, "filename": filename, "key": key, } diff --git a/tests/test_data.py b/tests/test_data.py index 06344e6..67b2895 100644 --- a/tests/test_data.py +++ b/tests/test_data.py @@ -83,7 +83,7 @@ def test_upload(): match=[ json_params_matcher( { - "device.id": device_id, + "deviceId": device_id, "filename": filename, }, ) diff --git a/tests/test_events.py b/tests/test_events.py index eed401b..096d817 100644 --- a/tests/test_events.py +++ b/tests/test_events.py @@ -25,7 +25,7 @@ def test_create_event(): match=[ json_params_matcher( { - "device.id": device_id, + "deviceId": device_id, "start": start.astimezone().isoformat(), "end": end.astimezone().isoformat(), "metadata": {}, @@ -74,7 +74,7 @@ def test_get_events(): now = datetime.datetime.now().astimezone() responses.add( responses.GET, - api_url(f"/v1/events?device.id={device_id}"), + api_url(f"/v1/events?deviceId={device_id}"), json=[ { "id": "1", @@ -104,7 +104,7 @@ def test_get_events(): responses.add( responses.GET, - api_url(f"/v1/events?device.name={device_name}"), + api_url(f"/v1/events?deviceName={device_name}"), json=[ { "id": "1",