Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
configured_endpoints: 14
configured_endpoints: 15
7 changes: 4 additions & 3 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
Types:

```python
from miru_device_sdk.types import AgentHealthResponse, AgentVersionResponse
from miru_device_sdk.types import AgentHealthResponse, AgentSyncResponse, AgentVersionResponse
```

Methods:

- <code title="get /health">client.agent.<a href="./src/miru_device_sdk/resources/agent.py">health</a>() -> <a href="./src/miru_device_sdk/types/agent_health_response.py">AgentHealthResponse</a></code>
- <code title="post /sync">client.agent.<a href="./src/miru_device_sdk/resources/agent.py">sync</a>() -> <a href="./src/miru_device_sdk/types/agent_sync_response.py">AgentSyncResponse</a></code>
- <code title="get /version">client.agent.<a href="./src/miru_device_sdk/resources/agent.py">version</a>() -> <a href="./src/miru_device_sdk/types/agent_version_response.py">AgentVersionResponse</a></code>

# Calibrations
Expand All @@ -23,6 +24,7 @@ Methods:

- <code title="post /calibrations">client.calibrations.<a href="./src/miru_device_sdk/resources/calibrations.py">create</a>(\*\*<a href="src/miru_device_sdk/types/calibration_create_params.py">params</a>) -> <a href="./src/miru_device_sdk/types/calibration_create_response.py">CalibrationCreateResponse</a></code>
- <code title="get /calibrations/latest/{report_id}/content">client.calibrations.<a href="./src/miru_device_sdk/resources/calibrations.py">download</a>(report_id) -> BinaryAPIResponse</code>
- <code title="post /calibrations/latest/invalidate">client.calibrations.<a href="./src/miru_device_sdk/resources/calibrations.py">invalidate</a>(\*\*<a href="src/miru_device_sdk/types/calibration_invalidate_params.py">params</a>) -> <a href="./src/miru_device_sdk/types/calibration.py">Calibration</a></code>
- <code title="get /calibrations/latest">client.calibrations.<a href="./src/miru_device_sdk/resources/calibrations.py">latest</a>(\*\*<a href="src/miru_device_sdk/types/calibration_latest_params.py">params</a>) -> <a href="./src/miru_device_sdk/types/calibration_latest_response.py">CalibrationLatestResponse</a></code>

# Deployments
Expand All @@ -43,13 +45,12 @@ Methods:
Types:

```python
from miru_device_sdk.types import DeviceRetrieveResponse, DeviceSyncResponse
from miru_device_sdk.types import DeviceRetrieveResponse
```

Methods:

- <code title="get /device">client.device.<a href="./src/miru_device_sdk/resources/device.py">retrieve</a>() -> <a href="./src/miru_device_sdk/types/device_retrieve_response.py">DeviceRetrieveResponse</a></code>
- <code title="post /device/sync">client.device.<a href="./src/miru_device_sdk/resources/device.py">sync</a>() -> <a href="./src/miru_device_sdk/types/device_sync_response.py">DeviceSyncResponse</a></code>

# FileRules

Expand Down
4 changes: 2 additions & 2 deletions src/miru_device_sdk/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def __init__(
if base_url is None:
base_url = os.environ.get("MIRU_BASE_URL")
if base_url is None:
base_url = f"http://localhost/v0.2"
base_url = f"http://localhost/v0.3"
if http_client is None:
http_client = _build_sync_httpx_client(
socket_path=socket_path,
Expand Down Expand Up @@ -448,7 +448,7 @@ def __init__(
if base_url is None:
base_url = os.environ.get("MIRU_BASE_URL")
if base_url is None:
base_url = f"http://localhost/v0.2"
base_url = f"http://localhost/v0.3"
if http_client is None:
http_client = _build_async_httpx_client(
socket_path=socket_path,
Expand Down
51 changes: 51 additions & 0 deletions src/miru_device_sdk/resources/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
async_to_streamed_response_wrapper,
)
from .._base_client import make_request_options
from ..types.agent_sync_response import AgentSyncResponse
from ..types.agent_health_response import AgentHealthResponse
from ..types.agent_version_response import AgentVersionResponse

Expand Down Expand Up @@ -59,6 +60,25 @@ def health(
cast_to=AgentHealthResponse,
)

def sync(
self,
*,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> AgentSyncResponse:
"""Manually force a device sync with the edits made in the dashboard."""
return self._post(
"/sync",
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=AgentSyncResponse,
)

def version(
self,
*,
Expand Down Expand Up @@ -118,6 +138,25 @@ async def health(
cast_to=AgentHealthResponse,
)

async def sync(
self,
*,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> AgentSyncResponse:
"""Manually force a device sync with the edits made in the dashboard."""
return await self._post(
"/sync",
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=AgentSyncResponse,
)

async def version(
self,
*,
Expand Down Expand Up @@ -145,6 +184,9 @@ def __init__(self, agent: AgentResource) -> None:
self.health = to_raw_response_wrapper(
agent.health,
)
self.sync = to_raw_response_wrapper(
agent.sync,
)
self.version = to_raw_response_wrapper(
agent.version,
)
Expand All @@ -157,6 +199,9 @@ def __init__(self, agent: AsyncAgentResource) -> None:
self.health = async_to_raw_response_wrapper(
agent.health,
)
self.sync = async_to_raw_response_wrapper(
agent.sync,
)
self.version = async_to_raw_response_wrapper(
agent.version,
)
Expand All @@ -169,6 +214,9 @@ def __init__(self, agent: AgentResource) -> None:
self.health = to_streamed_response_wrapper(
agent.health,
)
self.sync = to_streamed_response_wrapper(
agent.sync,
)
self.version = to_streamed_response_wrapper(
agent.version,
)
Expand All @@ -181,6 +229,9 @@ def __init__(self, agent: AsyncAgentResource) -> None:
self.health = async_to_streamed_response_wrapper(
agent.health,
)
self.sync = async_to_streamed_response_wrapper(
agent.sync,
)
self.version = async_to_streamed_response_wrapper(
agent.version,
)
Loading
Loading