Skip to content
Draft
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: 247
configured_endpoints: 234
46 changes: 0 additions & 46 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -965,52 +965,6 @@ Methods:
- <code title="get /notifications/preferences">client.notifications.<a href="./src/mobilerun_sdk/resources/notifications.py">get_preferences</a>() -> <a href="./src/mobilerun_sdk/types/notification_get_preferences_response.py">NotificationGetPreferencesResponse</a></code>
- <code title="patch /notifications/preferences">client.notifications.<a href="./src/mobilerun_sdk/resources/notifications.py">update_preferences</a>(\*\*<a href="src/mobilerun_sdk/types/notification_update_preferences_params.py">params</a>) -> <a href="./src/mobilerun_sdk/types/notification_update_preferences_response.py">NotificationUpdatePreferencesResponse</a></code>

# Esims

Types:

```python
from mobilerun_sdk.types import (
EsimCreateResponse,
EsimRetrieveResponse,
EsimUpdateResponse,
EsimListResponse,
EsimCapacityResponse,
EsimConfirmPaymentResponse,
EsimImportResponse,
EsimInstallResponse,
EsimInstallStatusResponse,
EsimSelectorResponse,
)
```

Methods:

- <code title="post /numbers/esims">client.esims.<a href="./src/mobilerun_sdk/resources/esims/esims.py">create</a>(\*\*<a href="src/mobilerun_sdk/types/esim_create_params.py">params</a>) -> <a href="./src/mobilerun_sdk/types/esim_create_response.py">EsimCreateResponse</a></code>
- <code title="get /numbers/esims/{id}">client.esims.<a href="./src/mobilerun_sdk/resources/esims/esims.py">retrieve</a>(id) -> <a href="./src/mobilerun_sdk/types/esim_retrieve_response.py">EsimRetrieveResponse</a></code>
- <code title="patch /numbers/esims/{id}">client.esims.<a href="./src/mobilerun_sdk/resources/esims/esims.py">update</a>(id, \*\*<a href="src/mobilerun_sdk/types/esim_update_params.py">params</a>) -> <a href="./src/mobilerun_sdk/types/esim_update_response.py">EsimUpdateResponse</a></code>
- <code title="get /numbers/esims">client.esims.<a href="./src/mobilerun_sdk/resources/esims/esims.py">list</a>(\*\*<a href="src/mobilerun_sdk/types/esim_list_params.py">params</a>) -> <a href="./src/mobilerun_sdk/types/esim_list_response.py">EsimListResponse</a></code>
- <code title="delete /numbers/esims/{id}">client.esims.<a href="./src/mobilerun_sdk/resources/esims/esims.py">delete</a>(id) -> None</code>
- <code title="get /numbers/esims/capacity">client.esims.<a href="./src/mobilerun_sdk/resources/esims/esims.py">capacity</a>() -> <a href="./src/mobilerun_sdk/types/esim_capacity_response.py">EsimCapacityResponse</a></code>
- <code title="post /numbers/esims/{id}/confirm-payment">client.esims.<a href="./src/mobilerun_sdk/resources/esims/esims.py">confirm_payment</a>(id) -> <a href="./src/mobilerun_sdk/types/esim_confirm_payment_response.py">EsimConfirmPaymentResponse</a></code>
- <code title="post /numbers/esims/import">client.esims.<a href="./src/mobilerun_sdk/resources/esims/esims.py">import\_</a>(\*\*<a href="src/mobilerun_sdk/types/esim_import_params.py">params</a>) -> <a href="./src/mobilerun_sdk/types/esim_import_response.py">EsimImportResponse</a></code>
- <code title="post /numbers/esims/{id}/install">client.esims.<a href="./src/mobilerun_sdk/resources/esims/esims.py">install</a>(id, \*\*<a href="src/mobilerun_sdk/types/esim_install_params.py">params</a>) -> <a href="./src/mobilerun_sdk/types/esim_install_response.py">EsimInstallResponse</a></code>
- <code title="get /numbers/esims/{id}/install-status">client.esims.<a href="./src/mobilerun_sdk/resources/esims/esims.py">install_status</a>(id) -> <a href="./src/mobilerun_sdk/types/esim_install_status_response.py">EsimInstallStatusResponse</a></code>
- <code title="get /numbers/esims/selector">client.esims.<a href="./src/mobilerun_sdk/resources/esims/esims.py">selector</a>(\*\*<a href="src/mobilerun_sdk/types/esim_selector_params.py">params</a>) -> <a href="./src/mobilerun_sdk/types/esim_selector_response.py">EsimSelectorResponse</a></code>

## Messages

Types:

```python
from mobilerun_sdk.types.esims import MessageListResponse, MessageSendResponse
```

Methods:

- <code title="get /numbers/esims/{id}/messages">client.esims.messages.<a href="./src/mobilerun_sdk/resources/esims/messages.py">list</a>(id, \*\*<a href="src/mobilerun_sdk/types/esims/message_list_params.py">params</a>) -> <a href="./src/mobilerun_sdk/types/esims/message_list_response.py">MessageListResponse</a></code>
- <code title="post /numbers/esims/{id}/messages">client.esims.messages.<a href="./src/mobilerun_sdk/resources/esims/messages.py">send</a>(id, \*\*<a href="src/mobilerun_sdk/types/esims/message_send_params.py">params</a>) -> <a href="./src/mobilerun_sdk/types/esims/message_send_response.py">MessageSendResponse</a></code>

# Messages

Types:
Expand Down
38 changes: 0 additions & 38 deletions src/mobilerun_sdk/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
if TYPE_CHECKING:
from .resources import (
apps,
esims,
files,
store,
tasks,
Expand All @@ -64,7 +63,6 @@
from .resources.proxies import ProxiesResource, AsyncProxiesResource
from .resources.carriers import CarriersResource, AsyncCarriersResource
from .resources.profiles import ProfilesResource, AsyncProfilesResource
from .resources.esims.esims import EsimsResource, AsyncEsimsResource
from .resources.store.store import StoreResource, AsyncStoreResource
from .resources.tasks.tasks import TasksResource, AsyncTasksResource
from .resources.notifications import NotificationsResource, AsyncNotificationsResource
Expand Down Expand Up @@ -249,12 +247,6 @@ def notifications(self) -> NotificationsResource:

return NotificationsResource(self)

@cached_property
def esims(self) -> EsimsResource:
from .resources.esims import EsimsResource

return EsimsResource(self)

@cached_property
def messages(self) -> MessagesResource:
from .resources.messages import MessagesResource
Expand Down Expand Up @@ -555,12 +547,6 @@ def notifications(self) -> AsyncNotificationsResource:

return AsyncNotificationsResource(self)

@cached_property
def esims(self) -> AsyncEsimsResource:
from .resources.esims import AsyncEsimsResource

return AsyncEsimsResource(self)

@cached_property
def messages(self) -> AsyncMessagesResource:
from .resources.messages import AsyncMessagesResource
Expand Down Expand Up @@ -807,12 +793,6 @@ def notifications(self) -> notifications.NotificationsResourceWithRawResponse:

return NotificationsResourceWithRawResponse(self._client.notifications)

@cached_property
def esims(self) -> esims.EsimsResourceWithRawResponse:
from .resources.esims import EsimsResourceWithRawResponse

return EsimsResourceWithRawResponse(self._client.esims)

@cached_property
def messages(self) -> messages.MessagesResourceWithRawResponse:
from .resources.messages import MessagesResourceWithRawResponse
Expand Down Expand Up @@ -936,12 +916,6 @@ def notifications(self) -> notifications.AsyncNotificationsResourceWithRawRespon

return AsyncNotificationsResourceWithRawResponse(self._client.notifications)

@cached_property
def esims(self) -> esims.AsyncEsimsResourceWithRawResponse:
from .resources.esims import AsyncEsimsResourceWithRawResponse

return AsyncEsimsResourceWithRawResponse(self._client.esims)

@cached_property
def messages(self) -> messages.AsyncMessagesResourceWithRawResponse:
from .resources.messages import AsyncMessagesResourceWithRawResponse
Expand Down Expand Up @@ -1065,12 +1039,6 @@ def notifications(self) -> notifications.NotificationsResourceWithStreamingRespo

return NotificationsResourceWithStreamingResponse(self._client.notifications)

@cached_property
def esims(self) -> esims.EsimsResourceWithStreamingResponse:
from .resources.esims import EsimsResourceWithStreamingResponse

return EsimsResourceWithStreamingResponse(self._client.esims)

@cached_property
def messages(self) -> messages.MessagesResourceWithStreamingResponse:
from .resources.messages import MessagesResourceWithStreamingResponse
Expand Down Expand Up @@ -1194,12 +1162,6 @@ def notifications(self) -> notifications.AsyncNotificationsResourceWithStreaming

return AsyncNotificationsResourceWithStreamingResponse(self._client.notifications)

@cached_property
def esims(self) -> esims.AsyncEsimsResourceWithStreamingResponse:
from .resources.esims import AsyncEsimsResourceWithStreamingResponse

return AsyncEsimsResourceWithStreamingResponse(self._client.esims)

@cached_property
def messages(self) -> messages.AsyncMessagesResourceWithStreamingResponse:
from .resources.messages import AsyncMessagesResourceWithStreamingResponse
Expand Down
14 changes: 0 additions & 14 deletions src/mobilerun_sdk/resources/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,6 @@
AppsResourceWithStreamingResponse,
AsyncAppsResourceWithStreamingResponse,
)
from .esims import (
EsimsResource,
AsyncEsimsResource,
EsimsResourceWithRawResponse,
AsyncEsimsResourceWithRawResponse,
EsimsResourceWithStreamingResponse,
AsyncEsimsResourceWithStreamingResponse,
)
from .files import (
FilesResource,
AsyncFilesResource,
Expand Down Expand Up @@ -258,12 +250,6 @@
"AsyncNotificationsResourceWithRawResponse",
"NotificationsResourceWithStreamingResponse",
"AsyncNotificationsResourceWithStreamingResponse",
"EsimsResource",
"AsyncEsimsResource",
"EsimsResourceWithRawResponse",
"AsyncEsimsResourceWithRawResponse",
"EsimsResourceWithStreamingResponse",
"AsyncEsimsResourceWithStreamingResponse",
"MessagesResource",
"AsyncMessagesResource",
"MessagesResourceWithRawResponse",
Expand Down
8 changes: 6 additions & 2 deletions src/mobilerun_sdk/resources/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,9 @@ def confirm_upload(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> AppConfirmUploadResponse:
"""
Verifies the APK file exists in R2 and sets the app status to available.
Verifies the uploaded files in R2 and sets the app version status to available.
Idempotent: replaying confirmation for an already-available version returns the
same successful response without re-verifying the files.

Args:
extra_headers: Send extra headers
Expand Down Expand Up @@ -506,7 +508,9 @@ async def confirm_upload(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> AppConfirmUploadResponse:
"""
Verifies the APK file exists in R2 and sets the app status to available.
Verifies the uploaded files in R2 and sets the app version status to available.
Idempotent: replaying confirmation for an already-available version returns the
same successful response without re-verifying the files.

Args:
extra_headers: Send extra headers
Expand Down
54 changes: 42 additions & 12 deletions src/mobilerun_sdk/resources/assistant/conversations.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ def abort(
self,
*,
session_id: str,
expected_turn_id: str | Omit = omit,
# 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,
Expand All @@ -244,7 +245,13 @@ def abort(
"""
return self._post(
"/assistant/chat/abort",
body=maybe_transform({"session_id": session_id}, conversation_abort_params.ConversationAbortParams),
body=maybe_transform(
{
"session_id": session_id,
"expected_turn_id": expected_turn_id,
},
conversation_abort_params.ConversationAbortParams,
),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
Expand All @@ -263,8 +270,14 @@ def answer_permission(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> ConversationAnswerPermissionResponse:
"""
Deliver a HITL approval/rejection for an in-flight turn.
"""Deliver a HITL approval/rejection for an in-flight turn.

Interactive HITL
clients must start the turn with `Accept: text/event-stream`, wait for a
`tool-hitl-approval` event, and send its `permissionId` here at
`/assistant/chat/permission`. Do not submit approval as free-form user text or
as `confirmed: true`. For `devices.reset`, only `once` and `reject` are allowed;
the generic `always` response is rejected with HTTP 400.

Args:
extra_headers: Send extra headers
Expand Down Expand Up @@ -428,9 +441,12 @@ def send(

The response format follows the Accept header:
`text/event-stream` for SSE, `application/json` for a buffered assistant reply.
`sessionId` targets a concrete active chat. The resolved chat session ID is
returned as `chatSessionId` in the JSON body and as the `X-Chat-Session-Id`
response header on the SSE response.
Interactive HITL requires `Accept: text/event-stream`: the stream can emit a
`tool-hitl-approval` event, whose decision must be delivered to
`/assistant/chat/permission`. Buffered JSON responses do not provide an
interactive HITL continuation contract. `sessionId` targets a concrete active
chat. The resolved chat session ID is returned as `chatSessionId` in the JSON
body and as the `X-Chat-Session-Id` response header on the SSE response.

Args:
extra_headers: Send extra headers
Expand Down Expand Up @@ -677,6 +693,7 @@ async def abort(
self,
*,
session_id: str,
expected_turn_id: str | Omit = omit,
# 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,
Expand All @@ -701,7 +718,11 @@ async def abort(
return await self._post(
"/assistant/chat/abort",
body=await async_maybe_transform(
{"session_id": session_id}, conversation_abort_params.ConversationAbortParams
{
"session_id": session_id,
"expected_turn_id": expected_turn_id,
},
conversation_abort_params.ConversationAbortParams,
),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
Expand All @@ -721,8 +742,14 @@ async def answer_permission(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> ConversationAnswerPermissionResponse:
"""
Deliver a HITL approval/rejection for an in-flight turn.
"""Deliver a HITL approval/rejection for an in-flight turn.

Interactive HITL
clients must start the turn with `Accept: text/event-stream`, wait for a
`tool-hitl-approval` event, and send its `permissionId` here at
`/assistant/chat/permission`. Do not submit approval as free-form user text or
as `confirmed: true`. For `devices.reset`, only `once` and `reject` are allowed;
the generic `always` response is rejected with HTTP 400.

Args:
extra_headers: Send extra headers
Expand Down Expand Up @@ -886,9 +913,12 @@ async def send(

The response format follows the Accept header:
`text/event-stream` for SSE, `application/json` for a buffered assistant reply.
`sessionId` targets a concrete active chat. The resolved chat session ID is
returned as `chatSessionId` in the JSON body and as the `X-Chat-Session-Id`
response header on the SSE response.
Interactive HITL requires `Accept: text/event-stream`: the stream can emit a
`tool-hitl-approval` event, whose decision must be delivered to
`/assistant/chat/permission`. Buffered JSON responses do not provide an
interactive HITL continuation contract. `sessionId` targets a concrete active
chat. The resolved chat session ID is returned as `chatSessionId` in the JSON
body and as the `X-Chat-Session-Id` response header on the SSE response.

Args:
extra_headers: Send extra headers
Expand Down
6 changes: 5 additions & 1 deletion src/mobilerun_sdk/resources/connect/proxies.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import httpx

from ..._types import Body, Omit, Query, Headers, NoneType, NotGiven, omit, not_given
from ..._utils import path_template, maybe_transform, async_maybe_transform
from ..._utils import path_template, maybe_transform, strip_not_given, async_maybe_transform
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from ..._response import (
Expand Down Expand Up @@ -140,6 +140,7 @@ def buy(
*,
country: str,
type: Literal["dedicated_residential", "residential", "mobile"],
idempotency_key: str | Omit = omit,
# 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,
Expand All @@ -161,6 +162,7 @@ def buy(

timeout: Override the client-level default timeout for this request, in seconds
"""
extra_headers = {**strip_not_given({"Idempotency-Key": idempotency_key}), **(extra_headers or {})}
return self._post(
"/connect/proxies",
body=maybe_transform(
Expand Down Expand Up @@ -505,6 +507,7 @@ async def buy(
*,
country: str,
type: Literal["dedicated_residential", "residential", "mobile"],
idempotency_key: str | Omit = omit,
# 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,
Expand All @@ -526,6 +529,7 @@ async def buy(

timeout: Override the client-level default timeout for this request, in seconds
"""
extra_headers = {**strip_not_given({"Idempotency-Key": idempotency_key}), **(extra_headers or {})}
return await self._post(
"/connect/proxies",
body=await async_maybe_transform(
Expand Down
Loading