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
30 changes: 30 additions & 0 deletions src/metorial/_generated/magnetar/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@
# ConsumerConsumerInternalOauthAuthorizationsGetOutput
# ConsumerConsumerInternalOauthAuthorizationsRejectOutput
# ConsumerConsumerInternalOauthClientsGetOutput
# ConsumerDevicesCheckInBody
# ConsumerDevicesCheckInOutput
# ConsumerDevicesClientsUpdateBody
# ConsumerDevicesClientsUpdateOutput
# ConsumerDevicesGetOutput
# ConsumerDevicesListOutput
# ConsumerDevicesListQuery
# ConsumerDevicesRevokeOutput
# ConsumerDevicesSignOutOutput
# ConsumerIdentityCredentialsGetOutput
# ConsumerIdentityCredentialsListOutput
# ConsumerIdentityCredentialsListQuery
Expand Down Expand Up @@ -139,7 +148,13 @@
# DashboardInstanceConsumerSurfacesListOutput
# DashboardInstanceConsumerSurfacesListQuery
# DashboardInstanceConsumersCreateBody
# DashboardInstanceConsumersCreateMemberSessionBody
# DashboardInstanceConsumersCreateMemberSessionOutput
# DashboardInstanceConsumersCreateOutput
# DashboardInstanceConsumersDevicesGetOutput
# DashboardInstanceConsumersDevicesListOutput
# DashboardInstanceConsumersDevicesListQuery
# DashboardInstanceConsumersDevicesRevokeOutput
# DashboardInstanceConsumersGetMemberConsumerBody
# DashboardInstanceConsumersGetMemberConsumerOutput
# DashboardInstanceConsumersGetOutput
Expand Down Expand Up @@ -1003,6 +1018,15 @@
# mapConsumerConsumerInternalOauthAuthorizationsGetOutput
# mapConsumerConsumerInternalOauthAuthorizationsRejectOutput
# mapConsumerConsumerInternalOauthClientsGetOutput
# mapConsumerDevicesCheckInBody
# mapConsumerDevicesCheckInOutput
# mapConsumerDevicesClientsUpdateBody
# mapConsumerDevicesClientsUpdateOutput
# mapConsumerDevicesGetOutput
# mapConsumerDevicesListOutput
# mapConsumerDevicesListQuery
# mapConsumerDevicesRevokeOutput
# mapConsumerDevicesSignOutOutput
# mapConsumerIdentityCredentialsGetOutput
# mapConsumerIdentityCredentialsListOutput
# mapConsumerIdentityCredentialsListQuery
Expand Down Expand Up @@ -1127,7 +1151,13 @@
# mapDashboardInstanceConsumerSurfacesListOutput
# mapDashboardInstanceConsumerSurfacesListQuery
# mapDashboardInstanceConsumersCreateBody
# mapDashboardInstanceConsumersCreateMemberSessionBody
# mapDashboardInstanceConsumersCreateMemberSessionOutput
# mapDashboardInstanceConsumersCreateOutput
# mapDashboardInstanceConsumersDevicesGetOutput
# mapDashboardInstanceConsumersDevicesListOutput
# mapDashboardInstanceConsumersDevicesListQuery
# mapDashboardInstanceConsumersDevicesRevokeOutput
# mapDashboardInstanceConsumersGetMemberConsumerBody
# mapDashboardInstanceConsumersGetMemberConsumerOutput
# mapDashboardInstanceConsumersGetOutput
Expand Down
5 changes: 5 additions & 0 deletions src/metorial/_generated/magnetar/endpoints/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
from .consumer_agents import *
from .consumer_consumer_internal_oauth_authorizations import *
from .consumer_consumer_internal_oauth_clients import *
from .consumer_devices import *
from .consumer_devices_clients import *
from .consumer_identity_credentials import *
from .consumer_oauth_authorizations import *
from .consumer_profile import *
Expand All @@ -32,6 +34,7 @@
from .consumer_surfaces import *
from .consumer_tool_calls import *
from .consumers import *
from .consumers_devices import *
from .consumers_profiles import *
from .conversations import *
from .conversations_messages import *
Expand Down Expand Up @@ -62,6 +65,7 @@
from .dashboard_instance_chats_threads import *
from .dashboard_instance_consumer_surfaces import *
from .dashboard_instance_consumers import *
from .dashboard_instance_consumers_devices import *
from .dashboard_instance_consumers_profiles import *
from .dashboard_instance_conversations import *
from .dashboard_instance_conversations_messages import *
Expand Down Expand Up @@ -261,6 +265,7 @@
from .management_instance_chats_threads import *
from .management_instance_consumer_surfaces import *
from .management_instance_consumers import *
from .management_instance_consumers_devices import *
from .management_instance_consumers_profiles import *
from .management_instance_conversations import *
from .management_instance_conversations_messages import *
Expand Down
12 changes: 9 additions & 3 deletions src/metorial/_generated/magnetar/endpoints/callbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def list(self, *, limit: Optional[float] = None, after: Optional[str] = None, be
)
return self._get(request).transform(mapDashboardInstanceCallbacksListOutput.from_dict)

def create(self, *, integration_id: str, integration_provider_id: str, name: Optional[str] = None, description: Optional[str] = None) -> DashboardInstanceCallbacksCreateOutput:
def create(self, *, integration_id: str, integration_provider_id: str, name: Optional[str] = None, description: Optional[str] = None, trigger_group_selections: Optional[Dict[str, Dict[str, Any]]] = None) -> DashboardInstanceCallbacksCreateOutput:
"""
Create callback
Enables callbacks for an integration provider and returns the callback it created. Only providers whose type reports `triggers.status` as `enabled` support this. Callback instances are then registered for every matching integration instance in the background.
Expand All @@ -72,6 +72,7 @@ def create(self, *, integration_id: str, integration_provider_id: str, name: Opt
:param integration_provider_id: str
:param name: Optional[str] (optional)
:param description: Optional[str] (optional)
:param trigger_group_selections: Optional[Dict[str, Dict[str, Any]]] (optional)
:return: DashboardInstanceCallbacksCreateOutput
"""
# Build body parameters from keyword arguments
Expand All @@ -82,6 +83,8 @@ def create(self, *, integration_id: str, integration_provider_id: str, name: Opt
body_dict["name"] = name
if description is not None:
body_dict["description"] = description
if trigger_group_selections is not None:
body_dict["trigger_group_selections"] = trigger_group_selections

request = MetorialRequest(
path=['callbacks'],
Expand All @@ -102,15 +105,16 @@ def get(self, callback_id: str) -> DashboardInstanceCallbacksGetOutput:
)
return self._get(request).transform(mapDashboardInstanceCallbacksGetOutput.from_dict)

def update(self, callback_id: str, *, name: Optional[str] = None, description: Optional[str] = None, metadata: Optional[Dict[str, Any]] = None) -> DashboardInstanceCallbacksUpdateOutput:
def update(self, callback_id: str, *, name: Optional[str] = None, description: Optional[str] = None, metadata: Optional[Dict[str, Any]] = None, trigger_group_selections: Optional[Dict[str, Dict[str, Any]]] = None) -> DashboardInstanceCallbacksUpdateOutput:
"""
Update callback
Updates the name, description or metadata of a callback. Everything else about a callback is derived from its integration provider - set `callbacks.status` to `disabled` there to tear it down.
Updates the name, description, metadata or trigger group selections of a callback. Changing the selections re-registers the affected triggers. Everything else about a callback is derived from its integration provider - set `callbacks.status` to `disabled` there to tear it down.

:param callback_id: str
:param name: Optional[str] (optional)
:param description: Optional[str] (optional)
:param metadata: Optional[Dict[str, Any]] (optional)
:param trigger_group_selections: Optional[Dict[str, Dict[str, Any]]] (optional)
:return: DashboardInstanceCallbacksUpdateOutput
"""
# Build body parameters from keyword arguments
Expand All @@ -121,6 +125,8 @@ def update(self, callback_id: str, *, name: Optional[str] = None, description: O
body_dict["description"] = description
if metadata is not None:
body_dict["metadata"] = metadata
if trigger_group_selections is not None:
body_dict["trigger_group_selections"] = trigger_group_selections

request = MetorialRequest(
path=['callbacks', callback_id],
Expand Down
113 changes: 113 additions & 0 deletions src/metorial/_generated/magnetar/endpoints/consumer_devices.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
from typing import Any, Dict, List, Optional, Union
from metorial._endpoint import BaseMetorialEndpoint, MetorialEndpointManager, MetorialRequest
from ..resources import mapConsumerDevicesCheckInOutput, ConsumerDevicesCheckInOutput, mapConsumerDevicesCheckInBody, ConsumerDevicesCheckInBody, mapConsumerDevicesListOutput, ConsumerDevicesListOutput, mapConsumerDevicesListQuery, ConsumerDevicesListQuery, mapConsumerDevicesGetOutput, ConsumerDevicesGetOutput, mapConsumerDevicesSignOutOutput, ConsumerDevicesSignOutOutput, mapConsumerDevicesRevokeOutput, ConsumerDevicesRevokeOutput

class MetorialConsumerDevicesEndpoint(BaseMetorialEndpoint):
"""Enroll Metorial Desktop devices and choose which integrations and skills each AI tool on them receives."""

def __init__(self, config: MetorialEndpointManager):
super().__init__(config)

def check_in(self, *, installation_id: str, name: str, os: str, arch: str, app_version: str, clients: List[Dict[str, Any]], magic_mcp_token_ids: Optional[List[str]] = None) -> ConsumerDevicesCheckInOutput:
"""
Check in device
Enrolls the signed-in Metorial Desktop device, or refreshes what it reports, and returns what each AI tool on it should receive.

:param installation_id: str
:param name: str
:param os: str
:param arch: str
:param app_version: str
:param clients: List[Dict[str, Any]]
:param magic_mcp_token_ids: Optional[List[str]] (optional)
:return: ConsumerDevicesCheckInOutput
"""
# Build body parameters from keyword arguments
body_dict = {}
body_dict["installation_id"] = installation_id
body_dict["name"] = name
body_dict["os"] = os
body_dict["arch"] = arch
body_dict["app_version"] = app_version
body_dict["clients"] = clients
if magic_mcp_token_ids is not None:
body_dict["magic_mcp_token_ids"] = magic_mcp_token_ids

request = MetorialRequest(
path=['consumer', 'devices', 'check-in'],
body=body_dict
)
return self._post(request).transform(mapConsumerDevicesCheckInOutput.from_dict)

def list(self, *, limit: Optional[float] = None, after: Optional[str] = None, before: Optional[str] = None, cursor: Optional[str] = None, order: Optional[str] = None, status: Optional[Union[str, List[str]]] = None) -> ConsumerDevicesListOutput:
"""
List devices
Returns the devices the authenticated consumer profile has enrolled.

:param limit: Optional[float] (optional)
:param after: Optional[str] (optional)
:param before: Optional[str] (optional)
:param cursor: Optional[str] (optional)
:param order: Optional[str] (optional)
:param status: Optional[Union[str, List[str]]] (optional)
:return: ConsumerDevicesListOutput
"""
# Build query parameters from keyword arguments
query_dict = {}
if limit is not None:
query_dict["limit"] = limit
if after is not None:
query_dict["after"] = after
if before is not None:
query_dict["before"] = before
if cursor is not None:
query_dict["cursor"] = cursor
if order is not None:
query_dict["order"] = order
if status is not None:
query_dict["status"] = status

request = MetorialRequest(
path=['consumer', 'devices'],
query=query_dict
)
return self._get(request).transform(mapConsumerDevicesListOutput.from_dict)

def get(self, consumer_device_id: str) -> ConsumerDevicesGetOutput:
"""
Get device
Retrieves a device enrolled by the authenticated consumer profile.

:param consumer_device_id: str
:return: ConsumerDevicesGetOutput
"""
request = MetorialRequest(
path=['consumer', 'devices', consumer_device_id]
)
return self._get(request).transform(mapConsumerDevicesGetOutput.from_dict)

def sign_out(self) -> ConsumerDevicesSignOutOutput:
"""
Sign out device
Ends the device sign-in this request was made with and revokes its integration tokens. Other devices stay signed in.


:return: ConsumerDevicesSignOutOutput
"""
request = MetorialRequest(
path=['consumer', 'devices', 'sign-out']
)
return self._post(request).transform(mapConsumerDevicesSignOutOutput.from_dict)

def revoke(self, consumer_device_id: str) -> ConsumerDevicesRevokeOutput:
"""
Revoke device
Signs the device out and revokes its integration tokens. The app removes what it installed the next time it reaches Metorial.

:param consumer_device_id: str
:return: ConsumerDevicesRevokeOutput
"""
request = MetorialRequest(
path=['consumer', 'devices', consumer_device_id, 'revoke']
)
return self._post(request).transform(mapConsumerDevicesRevokeOutput.from_dict)
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
from typing import Any, Dict, List, Optional, Union
from metorial._endpoint import BaseMetorialEndpoint, MetorialEndpointManager, MetorialRequest
from ..resources import mapConsumerDevicesClientsUpdateOutput, ConsumerDevicesClientsUpdateOutput, mapConsumerDevicesClientsUpdateBody, ConsumerDevicesClientsUpdateBody

class MetorialConsumerDevicesClientsEndpoint(BaseMetorialEndpoint):
"""Enroll Metorial Desktop devices and choose which integrations and skills each AI tool on them receives."""

def __init__(self, config: MetorialEndpointManager):
super().__init__(config)

def update(self, consumer_device_id: str, client_key: str, *, enabled: Optional[bool] = None, excluded_magic_mcp_server_ids: Optional[List[str]] = None, excluded_skill_ids: Optional[List[str]] = None) -> ConsumerDevicesClientsUpdateOutput:
"""
Update device AI tool
Turns an AI tool on the device on or off, and chooses which integrations and skills it does not receive. The device applies the change at its next sync.

:param consumer_device_id: str
:param client_key: str
:param enabled: Optional[bool] (optional)
:param excluded_magic_mcp_server_ids: Optional[List[str]] (optional)
:param excluded_skill_ids: Optional[List[str]] (optional)
:return: ConsumerDevicesClientsUpdateOutput
"""
# Build body parameters from keyword arguments
body_dict = {}
if enabled is not None:
body_dict["enabled"] = enabled
if excluded_magic_mcp_server_ids is not None:
body_dict["excluded_magic_mcp_server_ids"] = excluded_magic_mcp_server_ids
if excluded_skill_ids is not None:
body_dict["excluded_skill_ids"] = excluded_skill_ids

request = MetorialRequest(
path=['consumer', 'devices', consumer_device_id, 'clients', client_key],
body=body_dict
)
return self._patch(request).transform(mapConsumerDevicesClientsUpdateOutput.from_dict)
21 changes: 20 additions & 1 deletion src/metorial/_generated/magnetar/endpoints/consumers.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import Any, Dict, List, Optional, Union
from metorial._endpoint import BaseMetorialEndpoint, MetorialEndpointManager, MetorialRequest
from ..resources import mapDashboardInstanceConsumersListOutput, DashboardInstanceConsumersListOutput, mapDashboardInstanceConsumersListQuery, DashboardInstanceConsumersListQuery, mapDashboardInstanceConsumersGetOutput, DashboardInstanceConsumersGetOutput, mapDashboardInstanceConsumersCreateOutput, DashboardInstanceConsumersCreateOutput, mapDashboardInstanceConsumersCreateBody, DashboardInstanceConsumersCreateBody, mapDashboardInstanceConsumersGetMemberConsumerOutput, DashboardInstanceConsumersGetMemberConsumerOutput, mapDashboardInstanceConsumersGetMemberConsumerBody, DashboardInstanceConsumersGetMemberConsumerBody, mapDashboardInstanceConsumersUpdateOutput, DashboardInstanceConsumersUpdateOutput, mapDashboardInstanceConsumersUpdateBody, DashboardInstanceConsumersUpdateBody
from ..resources import mapDashboardInstanceConsumersListOutput, DashboardInstanceConsumersListOutput, mapDashboardInstanceConsumersListQuery, DashboardInstanceConsumersListQuery, mapDashboardInstanceConsumersGetOutput, DashboardInstanceConsumersGetOutput, mapDashboardInstanceConsumersCreateOutput, DashboardInstanceConsumersCreateOutput, mapDashboardInstanceConsumersCreateBody, DashboardInstanceConsumersCreateBody, mapDashboardInstanceConsumersGetMemberConsumerOutput, DashboardInstanceConsumersGetMemberConsumerOutput, mapDashboardInstanceConsumersGetMemberConsumerBody, DashboardInstanceConsumersGetMemberConsumerBody, mapDashboardInstanceConsumersCreateMemberSessionOutput, DashboardInstanceConsumersCreateMemberSessionOutput, mapDashboardInstanceConsumersCreateMemberSessionBody, DashboardInstanceConsumersCreateMemberSessionBody, mapDashboardInstanceConsumersUpdateOutput, DashboardInstanceConsumersUpdateOutput, mapDashboardInstanceConsumersUpdateBody, DashboardInstanceConsumersUpdateBody

class MetorialConsumersEndpoint(BaseMetorialEndpoint):
"""Manage instance consumers independently from portals and inspect the profiles linked to each consumer."""
Expand Down Expand Up @@ -100,6 +100,25 @@ def get_member_consumer(self, *, surface_identifier: Optional[str] = None) -> Da
)
return self._post(request).transform(mapDashboardInstanceConsumersGetMemberConsumerOutput.from_dict)

def create_member_session(self, *, integration_id: Optional[str] = None) -> DashboardInstanceConsumersCreateMemberSessionOutput:
"""
Create member consumer session
Exchanges a CLI sign-in for a short-lived credential for the member’s own consumer profile.

:param integration_id: Optional[str] (optional)
:return: DashboardInstanceConsumersCreateMemberSessionOutput
"""
# Build body parameters from keyword arguments
body_dict = {}
if integration_id is not None:
body_dict["integration_id"] = integration_id

request = MetorialRequest(
path=['member-consumer-session'],
body=body_dict
)
return self._post(request).transform(mapDashboardInstanceConsumersCreateMemberSessionOutput.from_dict)

def update(self, consumer_id: str, *, name: Optional[str] = None, email: Optional[str] = None) -> DashboardInstanceConsumersUpdateOutput:
"""
Update consumer
Expand Down
Loading
Loading