Skip to content

Commit

Permalink
device.id, device.name -> deviceId, deviceName
Browse files Browse the repository at this point in the history
  • Loading branch information
indirectlylit committed Mar 12, 2024
1 parent 8bb43fd commit 2670df1
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
32 changes: 16 additions & 16 deletions foxglove_data_platform/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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(),
Expand Down Expand Up @@ -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(),
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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,
}
Expand Down
2 changes: 1 addition & 1 deletion tests/test_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def test_upload():
match=[
json_params_matcher(
{
"device.id": device_id,
"deviceId": device_id,
"filename": filename,
},
)
Expand Down
6 changes: 3 additions & 3 deletions tests/test_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -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": {},
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 2670df1

Please sign in to comment.