diff --git a/src/metorial/_generated/magnetar/__init__.py b/src/metorial/_generated/magnetar/__init__.py index 14d0e9db..ff01a07f 100644 --- a/src/metorial/_generated/magnetar/__init__.py +++ b/src/metorial/_generated/magnetar/__init__.py @@ -15,6 +15,15 @@ # ConsumerConsumerInternalOauthAuthorizationsGetOutput # ConsumerConsumerInternalOauthAuthorizationsRejectOutput # ConsumerConsumerInternalOauthClientsGetOutput +# ConsumerDevicesCheckInBody +# ConsumerDevicesCheckInOutput +# ConsumerDevicesClientsUpdateBody +# ConsumerDevicesClientsUpdateOutput +# ConsumerDevicesGetOutput +# ConsumerDevicesListOutput +# ConsumerDevicesListQuery +# ConsumerDevicesRevokeOutput +# ConsumerDevicesSignOutOutput # ConsumerIdentityCredentialsGetOutput # ConsumerIdentityCredentialsListOutput # ConsumerIdentityCredentialsListQuery @@ -139,7 +148,13 @@ # DashboardInstanceConsumerSurfacesListOutput # DashboardInstanceConsumerSurfacesListQuery # DashboardInstanceConsumersCreateBody +# DashboardInstanceConsumersCreateMemberSessionBody +# DashboardInstanceConsumersCreateMemberSessionOutput # DashboardInstanceConsumersCreateOutput +# DashboardInstanceConsumersDevicesGetOutput +# DashboardInstanceConsumersDevicesListOutput +# DashboardInstanceConsumersDevicesListQuery +# DashboardInstanceConsumersDevicesRevokeOutput # DashboardInstanceConsumersGetMemberConsumerBody # DashboardInstanceConsumersGetMemberConsumerOutput # DashboardInstanceConsumersGetOutput @@ -1003,6 +1018,15 @@ # mapConsumerConsumerInternalOauthAuthorizationsGetOutput # mapConsumerConsumerInternalOauthAuthorizationsRejectOutput # mapConsumerConsumerInternalOauthClientsGetOutput +# mapConsumerDevicesCheckInBody +# mapConsumerDevicesCheckInOutput +# mapConsumerDevicesClientsUpdateBody +# mapConsumerDevicesClientsUpdateOutput +# mapConsumerDevicesGetOutput +# mapConsumerDevicesListOutput +# mapConsumerDevicesListQuery +# mapConsumerDevicesRevokeOutput +# mapConsumerDevicesSignOutOutput # mapConsumerIdentityCredentialsGetOutput # mapConsumerIdentityCredentialsListOutput # mapConsumerIdentityCredentialsListQuery @@ -1127,7 +1151,13 @@ # mapDashboardInstanceConsumerSurfacesListOutput # mapDashboardInstanceConsumerSurfacesListQuery # mapDashboardInstanceConsumersCreateBody +# mapDashboardInstanceConsumersCreateMemberSessionBody +# mapDashboardInstanceConsumersCreateMemberSessionOutput # mapDashboardInstanceConsumersCreateOutput +# mapDashboardInstanceConsumersDevicesGetOutput +# mapDashboardInstanceConsumersDevicesListOutput +# mapDashboardInstanceConsumersDevicesListQuery +# mapDashboardInstanceConsumersDevicesRevokeOutput # mapDashboardInstanceConsumersGetMemberConsumerBody # mapDashboardInstanceConsumersGetMemberConsumerOutput # mapDashboardInstanceConsumersGetOutput diff --git a/src/metorial/_generated/magnetar/endpoints/__init__.py b/src/metorial/_generated/magnetar/endpoints/__init__.py index ff773dfa..eb857ee8 100644 --- a/src/metorial/_generated/magnetar/endpoints/__init__.py +++ b/src/metorial/_generated/magnetar/endpoints/__init__.py @@ -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 * @@ -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 * @@ -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 * @@ -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 * diff --git a/src/metorial/_generated/magnetar/endpoints/callbacks.py b/src/metorial/_generated/magnetar/endpoints/callbacks.py index 09f3f225..b5be007f 100644 --- a/src/metorial/_generated/magnetar/endpoints/callbacks.py +++ b/src/metorial/_generated/magnetar/endpoints/callbacks.py @@ -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. @@ -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 @@ -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'], @@ -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 @@ -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], diff --git a/src/metorial/_generated/magnetar/endpoints/consumer_devices.py b/src/metorial/_generated/magnetar/endpoints/consumer_devices.py new file mode 100644 index 00000000..de32ede6 --- /dev/null +++ b/src/metorial/_generated/magnetar/endpoints/consumer_devices.py @@ -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) \ No newline at end of file diff --git a/src/metorial/_generated/magnetar/endpoints/consumer_devices_clients.py b/src/metorial/_generated/magnetar/endpoints/consumer_devices_clients.py new file mode 100644 index 00000000..3c513553 --- /dev/null +++ b/src/metorial/_generated/magnetar/endpoints/consumer_devices_clients.py @@ -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) \ No newline at end of file diff --git a/src/metorial/_generated/magnetar/endpoints/consumers.py b/src/metorial/_generated/magnetar/endpoints/consumers.py index a81c34a1..67b3105c 100644 --- a/src/metorial/_generated/magnetar/endpoints/consumers.py +++ b/src/metorial/_generated/magnetar/endpoints/consumers.py @@ -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.""" @@ -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 diff --git a/src/metorial/_generated/magnetar/endpoints/consumers_devices.py b/src/metorial/_generated/magnetar/endpoints/consumers_devices.py new file mode 100644 index 00000000..51d9fa58 --- /dev/null +++ b/src/metorial/_generated/magnetar/endpoints/consumers_devices.py @@ -0,0 +1,75 @@ +from typing import Any, Dict, List, Optional, Union +from metorial._endpoint import BaseMetorialEndpoint, MetorialEndpointManager, MetorialRequest +from ..resources import mapDashboardInstanceConsumersDevicesListOutput, DashboardInstanceConsumersDevicesListOutput, mapDashboardInstanceConsumersDevicesListQuery, DashboardInstanceConsumersDevicesListQuery, mapDashboardInstanceConsumersDevicesGetOutput, DashboardInstanceConsumersDevicesGetOutput, mapDashboardInstanceConsumersDevicesRevokeOutput, DashboardInstanceConsumersDevicesRevokeOutput + +class MetorialConsumersDevicesEndpoint(BaseMetorialEndpoint): + """Inspect and revoke the Metorial Desktop devices consumers have enrolled.""" + + def __init__(self, config: MetorialEndpointManager): + super().__init__(config) + + def list(self, *, limit: Optional[float] = None, after: Optional[str] = None, before: Optional[str] = None, cursor: Optional[str] = None, order: Optional[str] = None, consumer_profile_id: Optional[Union[str, List[str]]] = None, consumer_id: Optional[Union[str, List[str]]] = None, status: Optional[Union[str, List[str]]] = None) -> DashboardInstanceConsumersDevicesListOutput: + """ + List consumer devices + Returns the Metorial Desktop devices enrolled by consumers of an instance. + + :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 consumer_profile_id: Optional[Union[str, List[str]]] (optional) + :param consumer_id: Optional[Union[str, List[str]]] (optional) + :param status: Optional[Union[str, List[str]]] (optional) + :return: DashboardInstanceConsumersDevicesListOutput + """ + # 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 consumer_profile_id is not None: + query_dict["consumer_profile_id"] = consumer_profile_id + if consumer_id is not None: + query_dict["consumer_id"] = consumer_id + if status is not None: + query_dict["status"] = status + + request = MetorialRequest( + path=['consumer-devices'], + query=query_dict + ) + return self._get(request).transform(mapDashboardInstanceConsumersDevicesListOutput.from_dict) + + def get(self, consumer_device_id: str) -> DashboardInstanceConsumersDevicesGetOutput: + """ + Get consumer device + Retrieves a Metorial Desktop device enrolled by a consumer. + + :param consumer_device_id: str + :return: DashboardInstanceConsumersDevicesGetOutput + """ + request = MetorialRequest( + path=['consumer-devices', consumer_device_id] + ) + return self._get(request).transform(mapDashboardInstanceConsumersDevicesGetOutput.from_dict) + + def revoke(self, consumer_device_id: str) -> DashboardInstanceConsumersDevicesRevokeOutput: + """ + Revoke consumer 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: DashboardInstanceConsumersDevicesRevokeOutput + """ + request = MetorialRequest( + path=['consumer-devices', consumer_device_id, 'revoke'] + ) + return self._post(request).transform(mapDashboardInstanceConsumersDevicesRevokeOutput.from_dict) \ No newline at end of file diff --git a/src/metorial/_generated/magnetar/endpoints/dashboard_instance_callbacks.py b/src/metorial/_generated/magnetar/endpoints/dashboard_instance_callbacks.py index d9af75f8..f6f451e7 100644 --- a/src/metorial/_generated/magnetar/endpoints/dashboard_instance_callbacks.py +++ b/src/metorial/_generated/magnetar/endpoints/dashboard_instance_callbacks.py @@ -64,7 +64,7 @@ def list(self, instance_id: str, *, limit: Optional[float] = None, after: Option ) return self._get(request).transform(mapDashboardInstanceCallbacksListOutput.from_dict) - def create(self, instance_id: str, *, integration_id: str, integration_provider_id: str, name: Optional[str] = None, description: Optional[str] = None) -> DashboardInstanceCallbacksCreateOutput: + def create(self, instance_id: str, *, 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. @@ -74,6 +74,7 @@ def create(self, instance_id: str, *, integration_id: str, integration_provider_ :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 @@ -84,6 +85,8 @@ def create(self, instance_id: str, *, integration_id: str, integration_provider_ 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=['dashboard', 'instances', instance_id, 'callbacks'], @@ -105,16 +108,17 @@ def get(self, instance_id: str, callback_id: str) -> DashboardInstanceCallbacksG ) return self._get(request).transform(mapDashboardInstanceCallbacksGetOutput.from_dict) - def update(self, instance_id: str, callback_id: str, *, name: Optional[str] = None, description: Optional[str] = None, metadata: Optional[Dict[str, Any]] = None) -> DashboardInstanceCallbacksUpdateOutput: + def update(self, instance_id: str, 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 instance_id: str :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 @@ -125,6 +129,8 @@ def update(self, instance_id: str, callback_id: str, *, name: Optional[str] = No 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=['dashboard', 'instances', instance_id, 'callbacks', callback_id], diff --git a/src/metorial/_generated/magnetar/endpoints/dashboard_instance_consumers.py b/src/metorial/_generated/magnetar/endpoints/dashboard_instance_consumers.py index b1935d1d..5288373c 100644 --- a/src/metorial/_generated/magnetar/endpoints/dashboard_instance_consumers.py +++ b/src/metorial/_generated/magnetar/endpoints/dashboard_instance_consumers.py @@ -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 MetorialDashboardInstanceConsumersEndpoint(BaseMetorialEndpoint): """Manage instance consumers independently from portals and inspect the profiles linked to each consumer.""" @@ -104,6 +104,26 @@ def get_member_consumer(self, instance_id: str, *, surface_identifier: Optional[ ) return self._post(request).transform(mapDashboardInstanceConsumersGetMemberConsumerOutput.from_dict) + def create_member_session(self, instance_id: str, *, 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 instance_id: str + :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=['dashboard', 'instances', instance_id, 'member-consumer-session'], + body=body_dict + ) + return self._post(request).transform(mapDashboardInstanceConsumersCreateMemberSessionOutput.from_dict) + def update(self, instance_id: str, consumer_id: str, *, name: Optional[str] = None, email: Optional[str] = None) -> DashboardInstanceConsumersUpdateOutput: """ Update consumer diff --git a/src/metorial/_generated/magnetar/endpoints/dashboard_instance_consumers_devices.py b/src/metorial/_generated/magnetar/endpoints/dashboard_instance_consumers_devices.py new file mode 100644 index 00000000..affd1717 --- /dev/null +++ b/src/metorial/_generated/magnetar/endpoints/dashboard_instance_consumers_devices.py @@ -0,0 +1,78 @@ +from typing import Any, Dict, List, Optional, Union +from metorial._endpoint import BaseMetorialEndpoint, MetorialEndpointManager, MetorialRequest +from ..resources import mapDashboardInstanceConsumersDevicesListOutput, DashboardInstanceConsumersDevicesListOutput, mapDashboardInstanceConsumersDevicesListQuery, DashboardInstanceConsumersDevicesListQuery, mapDashboardInstanceConsumersDevicesGetOutput, DashboardInstanceConsumersDevicesGetOutput, mapDashboardInstanceConsumersDevicesRevokeOutput, DashboardInstanceConsumersDevicesRevokeOutput + +class MetorialDashboardInstanceConsumersDevicesEndpoint(BaseMetorialEndpoint): + """Inspect and revoke the Metorial Desktop devices consumers have enrolled.""" + + def __init__(self, config: MetorialEndpointManager): + super().__init__(config) + + def list(self, instance_id: str, *, limit: Optional[float] = None, after: Optional[str] = None, before: Optional[str] = None, cursor: Optional[str] = None, order: Optional[str] = None, consumer_profile_id: Optional[Union[str, List[str]]] = None, consumer_id: Optional[Union[str, List[str]]] = None, status: Optional[Union[str, List[str]]] = None) -> DashboardInstanceConsumersDevicesListOutput: + """ + List consumer devices + Returns the Metorial Desktop devices enrolled by consumers of an instance. + + :param instance_id: str + :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 consumer_profile_id: Optional[Union[str, List[str]]] (optional) + :param consumer_id: Optional[Union[str, List[str]]] (optional) + :param status: Optional[Union[str, List[str]]] (optional) + :return: DashboardInstanceConsumersDevicesListOutput + """ + # 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 consumer_profile_id is not None: + query_dict["consumer_profile_id"] = consumer_profile_id + if consumer_id is not None: + query_dict["consumer_id"] = consumer_id + if status is not None: + query_dict["status"] = status + + request = MetorialRequest( + path=['dashboard', 'instances', instance_id, 'consumer-devices'], + query=query_dict + ) + return self._get(request).transform(mapDashboardInstanceConsumersDevicesListOutput.from_dict) + + def get(self, instance_id: str, consumer_device_id: str) -> DashboardInstanceConsumersDevicesGetOutput: + """ + Get consumer device + Retrieves a Metorial Desktop device enrolled by a consumer. + + :param instance_id: str + :param consumer_device_id: str + :return: DashboardInstanceConsumersDevicesGetOutput + """ + request = MetorialRequest( + path=['dashboard', 'instances', instance_id, 'consumer-devices', consumer_device_id] + ) + return self._get(request).transform(mapDashboardInstanceConsumersDevicesGetOutput.from_dict) + + def revoke(self, instance_id: str, consumer_device_id: str) -> DashboardInstanceConsumersDevicesRevokeOutput: + """ + Revoke consumer device + Signs the device out and revokes its integration tokens. The app removes what it installed the next time it reaches Metorial. + + :param instance_id: str + :param consumer_device_id: str + :return: DashboardInstanceConsumersDevicesRevokeOutput + """ + request = MetorialRequest( + path=['dashboard', 'instances', instance_id, 'consumer-devices', consumer_device_id, 'revoke'] + ) + return self._post(request).transform(mapDashboardInstanceConsumersDevicesRevokeOutput.from_dict) \ No newline at end of file diff --git a/src/metorial/_generated/magnetar/endpoints/management_instance_callbacks.py b/src/metorial/_generated/magnetar/endpoints/management_instance_callbacks.py index d9ce98bb..cae47226 100644 --- a/src/metorial/_generated/magnetar/endpoints/management_instance_callbacks.py +++ b/src/metorial/_generated/magnetar/endpoints/management_instance_callbacks.py @@ -64,7 +64,7 @@ def list(self, instance_id: str, *, limit: Optional[float] = None, after: Option ) return self._get(request).transform(mapDashboardInstanceCallbacksListOutput.from_dict) - def create(self, instance_id: str, *, integration_id: str, integration_provider_id: str, name: Optional[str] = None, description: Optional[str] = None) -> DashboardInstanceCallbacksCreateOutput: + def create(self, instance_id: str, *, 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. @@ -74,6 +74,7 @@ def create(self, instance_id: str, *, integration_id: str, integration_provider_ :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 @@ -84,6 +85,8 @@ def create(self, instance_id: str, *, integration_id: str, integration_provider_ 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=['instances', instance_id, 'callbacks'], @@ -105,16 +108,17 @@ def get(self, instance_id: str, callback_id: str) -> DashboardInstanceCallbacksG ) return self._get(request).transform(mapDashboardInstanceCallbacksGetOutput.from_dict) - def update(self, instance_id: str, callback_id: str, *, name: Optional[str] = None, description: Optional[str] = None, metadata: Optional[Dict[str, Any]] = None) -> DashboardInstanceCallbacksUpdateOutput: + def update(self, instance_id: str, 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 instance_id: str :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 @@ -125,6 +129,8 @@ def update(self, instance_id: str, callback_id: str, *, name: Optional[str] = No 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=['instances', instance_id, 'callbacks', callback_id], diff --git a/src/metorial/_generated/magnetar/endpoints/management_instance_consumers.py b/src/metorial/_generated/magnetar/endpoints/management_instance_consumers.py index 2eb124a6..7e772d57 100644 --- a/src/metorial/_generated/magnetar/endpoints/management_instance_consumers.py +++ b/src/metorial/_generated/magnetar/endpoints/management_instance_consumers.py @@ -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 MetorialManagementInstanceConsumersEndpoint(BaseMetorialEndpoint): """Manage instance consumers independently from portals and inspect the profiles linked to each consumer.""" @@ -104,6 +104,26 @@ def get_member_consumer(self, instance_id: str, *, surface_identifier: Optional[ ) return self._post(request).transform(mapDashboardInstanceConsumersGetMemberConsumerOutput.from_dict) + def create_member_session(self, instance_id: str, *, 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 instance_id: str + :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=['instances', instance_id, 'member-consumer-session'], + body=body_dict + ) + return self._post(request).transform(mapDashboardInstanceConsumersCreateMemberSessionOutput.from_dict) + def update(self, instance_id: str, consumer_id: str, *, name: Optional[str] = None, email: Optional[str] = None) -> DashboardInstanceConsumersUpdateOutput: """ Update consumer diff --git a/src/metorial/_generated/magnetar/endpoints/management_instance_consumers_devices.py b/src/metorial/_generated/magnetar/endpoints/management_instance_consumers_devices.py new file mode 100644 index 00000000..9fb9519d --- /dev/null +++ b/src/metorial/_generated/magnetar/endpoints/management_instance_consumers_devices.py @@ -0,0 +1,78 @@ +from typing import Any, Dict, List, Optional, Union +from metorial._endpoint import BaseMetorialEndpoint, MetorialEndpointManager, MetorialRequest +from ..resources import mapDashboardInstanceConsumersDevicesListOutput, DashboardInstanceConsumersDevicesListOutput, mapDashboardInstanceConsumersDevicesListQuery, DashboardInstanceConsumersDevicesListQuery, mapDashboardInstanceConsumersDevicesGetOutput, DashboardInstanceConsumersDevicesGetOutput, mapDashboardInstanceConsumersDevicesRevokeOutput, DashboardInstanceConsumersDevicesRevokeOutput + +class MetorialManagementInstanceConsumersDevicesEndpoint(BaseMetorialEndpoint): + """Inspect and revoke the Metorial Desktop devices consumers have enrolled.""" + + def __init__(self, config: MetorialEndpointManager): + super().__init__(config) + + def list(self, instance_id: str, *, limit: Optional[float] = None, after: Optional[str] = None, before: Optional[str] = None, cursor: Optional[str] = None, order: Optional[str] = None, consumer_profile_id: Optional[Union[str, List[str]]] = None, consumer_id: Optional[Union[str, List[str]]] = None, status: Optional[Union[str, List[str]]] = None) -> DashboardInstanceConsumersDevicesListOutput: + """ + List consumer devices + Returns the Metorial Desktop devices enrolled by consumers of an instance. + + :param instance_id: str + :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 consumer_profile_id: Optional[Union[str, List[str]]] (optional) + :param consumer_id: Optional[Union[str, List[str]]] (optional) + :param status: Optional[Union[str, List[str]]] (optional) + :return: DashboardInstanceConsumersDevicesListOutput + """ + # 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 consumer_profile_id is not None: + query_dict["consumer_profile_id"] = consumer_profile_id + if consumer_id is not None: + query_dict["consumer_id"] = consumer_id + if status is not None: + query_dict["status"] = status + + request = MetorialRequest( + path=['instances', instance_id, 'consumer-devices'], + query=query_dict + ) + return self._get(request).transform(mapDashboardInstanceConsumersDevicesListOutput.from_dict) + + def get(self, instance_id: str, consumer_device_id: str) -> DashboardInstanceConsumersDevicesGetOutput: + """ + Get consumer device + Retrieves a Metorial Desktop device enrolled by a consumer. + + :param instance_id: str + :param consumer_device_id: str + :return: DashboardInstanceConsumersDevicesGetOutput + """ + request = MetorialRequest( + path=['instances', instance_id, 'consumer-devices', consumer_device_id] + ) + return self._get(request).transform(mapDashboardInstanceConsumersDevicesGetOutput.from_dict) + + def revoke(self, instance_id: str, consumer_device_id: str) -> DashboardInstanceConsumersDevicesRevokeOutput: + """ + Revoke consumer device + Signs the device out and revokes its integration tokens. The app removes what it installed the next time it reaches Metorial. + + :param instance_id: str + :param consumer_device_id: str + :return: DashboardInstanceConsumersDevicesRevokeOutput + """ + request = MetorialRequest( + path=['instances', instance_id, 'consumer-devices', consumer_device_id, 'revoke'] + ) + return self._post(request).transform(mapDashboardInstanceConsumersDevicesRevokeOutput.from_dict) \ No newline at end of file diff --git a/src/metorial/_generated/magnetar/resources/callbacks/create.py b/src/metorial/_generated/magnetar/resources/callbacks/create.py index b6ee6f81..2ec92478 100644 --- a/src/metorial/_generated/magnetar/resources/callbacks/create.py +++ b/src/metorial/_generated/magnetar/resources/callbacks/create.py @@ -13,6 +13,14 @@ class CallbacksCreateOutputProvider: updated_at: datetime description: Optional[str] = None @dataclass +class CallbacksCreateOutputTriggerGroups: + object: str + key: str + name: str + selection_schema: Dict[str, Any] + status: str + description: Optional[str] = None +@dataclass class CallbacksCreateOutput: object: str id: str @@ -21,10 +29,12 @@ class CallbacksCreateOutput: integration_id: str integration_provider_id: str provider: CallbacksCreateOutputProvider + trigger_groups: List[CallbacksCreateOutputTriggerGroups] created_at: datetime updated_at: datetime description: Optional[str] = None metadata: Optional[Dict[str, Any]] = None + trigger_group_selections: Optional[Dict[str, Dict[str, Any]]] = None class mapCallbacksCreateOutputProvider: @@ -48,6 +58,26 @@ def to_dict(value: Union[CallbacksCreateOutputProvider, Dict[str, Any], None]) - return value return dataclasses.asdict(value) +class mapCallbacksCreateOutputTriggerGroups: + @staticmethod + def from_dict(data: Dict[str, Any]) -> CallbacksCreateOutputTriggerGroups: + return CallbacksCreateOutputTriggerGroups( + object=data.get('object'), + key=data.get('key'), + name=data.get('name'), + description=data.get('description'), + selection_schema=data.get('selection_schema'), + status=data.get('status') + ) + + @staticmethod + def to_dict(value: Union[CallbacksCreateOutputTriggerGroups, Dict[str, Any], None]) -> Optional[Dict[str, Any]]: + if value is None: + return None + if isinstance(value, dict): + return value + return dataclasses.asdict(value) + class mapCallbacksCreateOutput: @staticmethod def from_dict(data: Dict[str, Any]) -> CallbacksCreateOutput: @@ -61,6 +91,8 @@ def from_dict(data: Dict[str, Any]) -> CallbacksCreateOutput: integration_id=data.get('integration_id'), integration_provider_id=data.get('integration_provider_id'), provider=mapCallbacksCreateOutputProvider.from_dict(data.get('provider')) if data.get('provider') else None, + trigger_group_selections=data.get('trigger_group_selections'), + trigger_groups=[mapCallbacksCreateOutputTriggerGroups.from_dict(item) for item in data.get('trigger_groups', []) if item], created_at=datetime.fromisoformat(data.get('created_at').replace('Z', '+00:00')) if data.get('created_at') else None, updated_at=datetime.fromisoformat(data.get('updated_at').replace('Z', '+00:00')) if data.get('updated_at') else None ) @@ -80,6 +112,7 @@ class CallbacksCreateBody: integration_provider_id: str name: Optional[str] = None description: Optional[str] = None + trigger_group_selections: Optional[Dict[str, Dict[str, Any]]] = None class mapCallbacksCreateBody: @@ -89,7 +122,8 @@ def from_dict(data: Dict[str, Any]) -> CallbacksCreateBody: integration_id=data.get('integration_id'), integration_provider_id=data.get('integration_provider_id'), name=data.get('name'), - description=data.get('description') + description=data.get('description'), + trigger_group_selections=data.get('trigger_group_selections') ) @staticmethod diff --git a/src/metorial/_generated/magnetar/resources/callbacks/delete.py b/src/metorial/_generated/magnetar/resources/callbacks/delete.py index 13bf1ea0..19fe203f 100644 --- a/src/metorial/_generated/magnetar/resources/callbacks/delete.py +++ b/src/metorial/_generated/magnetar/resources/callbacks/delete.py @@ -13,6 +13,14 @@ class CallbacksDeleteOutputProvider: updated_at: datetime description: Optional[str] = None @dataclass +class CallbacksDeleteOutputTriggerGroups: + object: str + key: str + name: str + selection_schema: Dict[str, Any] + status: str + description: Optional[str] = None +@dataclass class CallbacksDeleteOutput: object: str id: str @@ -21,10 +29,12 @@ class CallbacksDeleteOutput: integration_id: str integration_provider_id: str provider: CallbacksDeleteOutputProvider + trigger_groups: List[CallbacksDeleteOutputTriggerGroups] created_at: datetime updated_at: datetime description: Optional[str] = None metadata: Optional[Dict[str, Any]] = None + trigger_group_selections: Optional[Dict[str, Dict[str, Any]]] = None class mapCallbacksDeleteOutputProvider: @@ -48,6 +58,26 @@ def to_dict(value: Union[CallbacksDeleteOutputProvider, Dict[str, Any], None]) - return value return dataclasses.asdict(value) +class mapCallbacksDeleteOutputTriggerGroups: + @staticmethod + def from_dict(data: Dict[str, Any]) -> CallbacksDeleteOutputTriggerGroups: + return CallbacksDeleteOutputTriggerGroups( + object=data.get('object'), + key=data.get('key'), + name=data.get('name'), + description=data.get('description'), + selection_schema=data.get('selection_schema'), + status=data.get('status') + ) + + @staticmethod + def to_dict(value: Union[CallbacksDeleteOutputTriggerGroups, Dict[str, Any], None]) -> Optional[Dict[str, Any]]: + if value is None: + return None + if isinstance(value, dict): + return value + return dataclasses.asdict(value) + class mapCallbacksDeleteOutput: @staticmethod def from_dict(data: Dict[str, Any]) -> CallbacksDeleteOutput: @@ -61,6 +91,8 @@ def from_dict(data: Dict[str, Any]) -> CallbacksDeleteOutput: integration_id=data.get('integration_id'), integration_provider_id=data.get('integration_provider_id'), provider=mapCallbacksDeleteOutputProvider.from_dict(data.get('provider')) if data.get('provider') else None, + trigger_group_selections=data.get('trigger_group_selections'), + trigger_groups=[mapCallbacksDeleteOutputTriggerGroups.from_dict(item) for item in data.get('trigger_groups', []) if item], created_at=datetime.fromisoformat(data.get('created_at').replace('Z', '+00:00')) if data.get('created_at') else None, updated_at=datetime.fromisoformat(data.get('updated_at').replace('Z', '+00:00')) if data.get('updated_at') else None ) diff --git a/src/metorial/_generated/magnetar/resources/callbacks/get.py b/src/metorial/_generated/magnetar/resources/callbacks/get.py index 56ae1484..ce181b62 100644 --- a/src/metorial/_generated/magnetar/resources/callbacks/get.py +++ b/src/metorial/_generated/magnetar/resources/callbacks/get.py @@ -13,6 +13,14 @@ class CallbacksGetOutputProvider: updated_at: datetime description: Optional[str] = None @dataclass +class CallbacksGetOutputTriggerGroups: + object: str + key: str + name: str + selection_schema: Dict[str, Any] + status: str + description: Optional[str] = None +@dataclass class CallbacksGetOutput: object: str id: str @@ -21,10 +29,12 @@ class CallbacksGetOutput: integration_id: str integration_provider_id: str provider: CallbacksGetOutputProvider + trigger_groups: List[CallbacksGetOutputTriggerGroups] created_at: datetime updated_at: datetime description: Optional[str] = None metadata: Optional[Dict[str, Any]] = None + trigger_group_selections: Optional[Dict[str, Dict[str, Any]]] = None class mapCallbacksGetOutputProvider: @@ -48,6 +58,26 @@ def to_dict(value: Union[CallbacksGetOutputProvider, Dict[str, Any], None]) -> O return value return dataclasses.asdict(value) +class mapCallbacksGetOutputTriggerGroups: + @staticmethod + def from_dict(data: Dict[str, Any]) -> CallbacksGetOutputTriggerGroups: + return CallbacksGetOutputTriggerGroups( + object=data.get('object'), + key=data.get('key'), + name=data.get('name'), + description=data.get('description'), + selection_schema=data.get('selection_schema'), + status=data.get('status') + ) + + @staticmethod + def to_dict(value: Union[CallbacksGetOutputTriggerGroups, Dict[str, Any], None]) -> Optional[Dict[str, Any]]: + if value is None: + return None + if isinstance(value, dict): + return value + return dataclasses.asdict(value) + class mapCallbacksGetOutput: @staticmethod def from_dict(data: Dict[str, Any]) -> CallbacksGetOutput: @@ -61,6 +91,8 @@ def from_dict(data: Dict[str, Any]) -> CallbacksGetOutput: integration_id=data.get('integration_id'), integration_provider_id=data.get('integration_provider_id'), provider=mapCallbacksGetOutputProvider.from_dict(data.get('provider')) if data.get('provider') else None, + trigger_group_selections=data.get('trigger_group_selections'), + trigger_groups=[mapCallbacksGetOutputTriggerGroups.from_dict(item) for item in data.get('trigger_groups', []) if item], created_at=datetime.fromisoformat(data.get('created_at').replace('Z', '+00:00')) if data.get('created_at') else None, updated_at=datetime.fromisoformat(data.get('updated_at').replace('Z', '+00:00')) if data.get('updated_at') else None ) diff --git a/src/metorial/_generated/magnetar/resources/callbacks/list.py b/src/metorial/_generated/magnetar/resources/callbacks/list.py index bf60481a..0440481b 100644 --- a/src/metorial/_generated/magnetar/resources/callbacks/list.py +++ b/src/metorial/_generated/magnetar/resources/callbacks/list.py @@ -13,6 +13,14 @@ class CallbacksListOutputItemsProvider: updated_at: datetime description: Optional[str] = None @dataclass +class CallbacksListOutputItemsTriggerGroups: + object: str + key: str + name: str + selection_schema: Dict[str, Any] + status: str + description: Optional[str] = None +@dataclass class CallbacksListOutputItems: object: str id: str @@ -21,10 +29,12 @@ class CallbacksListOutputItems: integration_id: str integration_provider_id: str provider: CallbacksListOutputItemsProvider + trigger_groups: List[CallbacksListOutputItemsTriggerGroups] created_at: datetime updated_at: datetime description: Optional[str] = None metadata: Optional[Dict[str, Any]] = None + trigger_group_selections: Optional[Dict[str, Dict[str, Any]]] = None @dataclass class CallbacksListOutputPagination: has_more_before: bool @@ -56,6 +66,26 @@ def to_dict(value: Union[CallbacksListOutputItemsProvider, Dict[str, Any], None] return value return dataclasses.asdict(value) +class mapCallbacksListOutputItemsTriggerGroups: + @staticmethod + def from_dict(data: Dict[str, Any]) -> CallbacksListOutputItemsTriggerGroups: + return CallbacksListOutputItemsTriggerGroups( + object=data.get('object'), + key=data.get('key'), + name=data.get('name'), + description=data.get('description'), + selection_schema=data.get('selection_schema'), + status=data.get('status') + ) + + @staticmethod + def to_dict(value: Union[CallbacksListOutputItemsTriggerGroups, Dict[str, Any], None]) -> Optional[Dict[str, Any]]: + if value is None: + return None + if isinstance(value, dict): + return value + return dataclasses.asdict(value) + class mapCallbacksListOutputItems: @staticmethod def from_dict(data: Dict[str, Any]) -> CallbacksListOutputItems: @@ -69,6 +99,8 @@ def from_dict(data: Dict[str, Any]) -> CallbacksListOutputItems: integration_id=data.get('integration_id'), integration_provider_id=data.get('integration_provider_id'), provider=mapCallbacksListOutputItemsProvider.from_dict(data.get('provider')) if data.get('provider') else None, + trigger_group_selections=data.get('trigger_group_selections'), + trigger_groups=[mapCallbacksListOutputItemsTriggerGroups.from_dict(item) for item in data.get('trigger_groups', []) if item], created_at=datetime.fromisoformat(data.get('created_at').replace('Z', '+00:00')) if data.get('created_at') else None, updated_at=datetime.fromisoformat(data.get('updated_at').replace('Z', '+00:00')) if data.get('updated_at') else None ) diff --git a/src/metorial/_generated/magnetar/resources/callbacks/update.py b/src/metorial/_generated/magnetar/resources/callbacks/update.py index 72af8b12..7f3e4eea 100644 --- a/src/metorial/_generated/magnetar/resources/callbacks/update.py +++ b/src/metorial/_generated/magnetar/resources/callbacks/update.py @@ -13,6 +13,14 @@ class CallbacksUpdateOutputProvider: updated_at: datetime description: Optional[str] = None @dataclass +class CallbacksUpdateOutputTriggerGroups: + object: str + key: str + name: str + selection_schema: Dict[str, Any] + status: str + description: Optional[str] = None +@dataclass class CallbacksUpdateOutput: object: str id: str @@ -21,10 +29,12 @@ class CallbacksUpdateOutput: integration_id: str integration_provider_id: str provider: CallbacksUpdateOutputProvider + trigger_groups: List[CallbacksUpdateOutputTriggerGroups] created_at: datetime updated_at: datetime description: Optional[str] = None metadata: Optional[Dict[str, Any]] = None + trigger_group_selections: Optional[Dict[str, Dict[str, Any]]] = None class mapCallbacksUpdateOutputProvider: @@ -48,6 +58,26 @@ def to_dict(value: Union[CallbacksUpdateOutputProvider, Dict[str, Any], None]) - return value return dataclasses.asdict(value) +class mapCallbacksUpdateOutputTriggerGroups: + @staticmethod + def from_dict(data: Dict[str, Any]) -> CallbacksUpdateOutputTriggerGroups: + return CallbacksUpdateOutputTriggerGroups( + object=data.get('object'), + key=data.get('key'), + name=data.get('name'), + description=data.get('description'), + selection_schema=data.get('selection_schema'), + status=data.get('status') + ) + + @staticmethod + def to_dict(value: Union[CallbacksUpdateOutputTriggerGroups, Dict[str, Any], None]) -> Optional[Dict[str, Any]]: + if value is None: + return None + if isinstance(value, dict): + return value + return dataclasses.asdict(value) + class mapCallbacksUpdateOutput: @staticmethod def from_dict(data: Dict[str, Any]) -> CallbacksUpdateOutput: @@ -61,6 +91,8 @@ def from_dict(data: Dict[str, Any]) -> CallbacksUpdateOutput: integration_id=data.get('integration_id'), integration_provider_id=data.get('integration_provider_id'), provider=mapCallbacksUpdateOutputProvider.from_dict(data.get('provider')) if data.get('provider') else None, + trigger_group_selections=data.get('trigger_group_selections'), + trigger_groups=[mapCallbacksUpdateOutputTriggerGroups.from_dict(item) for item in data.get('trigger_groups', []) if item], created_at=datetime.fromisoformat(data.get('created_at').replace('Z', '+00:00')) if data.get('created_at') else None, updated_at=datetime.fromisoformat(data.get('updated_at').replace('Z', '+00:00')) if data.get('updated_at') else None ) @@ -79,6 +111,7 @@ class CallbacksUpdateBody: name: Optional[str] = None description: Optional[str] = None metadata: Optional[Dict[str, Any]] = None + trigger_group_selections: Optional[Dict[str, Dict[str, Any]]] = None class mapCallbacksUpdateBody: @@ -87,7 +120,8 @@ def from_dict(data: Dict[str, Any]) -> CallbacksUpdateBody: return CallbacksUpdateBody( name=data.get('name'), description=data.get('description'), - metadata=data.get('metadata') + metadata=data.get('metadata'), + trigger_group_selections=data.get('trigger_group_selections') ) @staticmethod diff --git a/src/metorial/_generated/magnetar/resources/consumer/__init__.py b/src/metorial/_generated/magnetar/resources/consumer/__init__.py index f6bcabe3..0207b926 100644 --- a/src/metorial/_generated/magnetar/resources/consumer/__init__.py +++ b/src/metorial/_generated/magnetar/resources/consumer/__init__.py @@ -1,5 +1,6 @@ from .agents import * from .consumer_internal import * +from .devices import * from .identity_credentials import * from .oauth import * from .profile import * diff --git a/src/metorial/_generated/magnetar/resources/consumer/devices/__init__.py b/src/metorial/_generated/magnetar/resources/consumer/devices/__init__.py new file mode 100644 index 00000000..9b498a90 --- /dev/null +++ b/src/metorial/_generated/magnetar/resources/consumer/devices/__init__.py @@ -0,0 +1,6 @@ +from .check_in import * +from .clients import * +from .get import * +from .list import * +from .revoke import * +from .sign_out import * \ No newline at end of file diff --git a/src/metorial/_generated/magnetar/resources/consumer/devices/check_in.py b/src/metorial/_generated/magnetar/resources/consumer/devices/check_in.py new file mode 100644 index 00000000..dc685d5e --- /dev/null +++ b/src/metorial/_generated/magnetar/resources/consumer/devices/check_in.py @@ -0,0 +1,143 @@ +from dataclasses import dataclass +from typing import Any, Dict, List, Optional, Union +from datetime import datetime +import dataclasses + +@dataclass +class ConsumerDevicesCheckInOutputClients: + object: str + key: str + name: str + detected: bool + installable: bool + supports_skills: bool + enabled: bool + excluded_magic_mcp_server_ids: List[str] + excluded_skill_ids: List[str] +@dataclass +class ConsumerDevicesCheckInOutput: + object: str + id: str + status: str + consumer_profile_id: str + name: str + os: str + arch: str + app_version: str + clients: List[ConsumerDevicesCheckInOutputClients] + last_seen_at: datetime + created_at: datetime + updated_at: datetime + revoked_at: Optional[datetime] = None + + +class mapConsumerDevicesCheckInOutputClients: + @staticmethod + def from_dict(data: Dict[str, Any]) -> ConsumerDevicesCheckInOutputClients: + return ConsumerDevicesCheckInOutputClients( + object=data.get('object'), + key=data.get('key'), + name=data.get('name'), + detected=data.get('detected'), + installable=data.get('installable'), + supports_skills=data.get('supports_skills'), + enabled=data.get('enabled'), + excluded_magic_mcp_server_ids=data.get('excluded_magic_mcp_server_ids', []), + excluded_skill_ids=data.get('excluded_skill_ids', []) + ) + + @staticmethod + def to_dict(value: Union[ConsumerDevicesCheckInOutputClients, Dict[str, Any], None]) -> Optional[Dict[str, Any]]: + if value is None: + return None + if isinstance(value, dict): + return value + return dataclasses.asdict(value) + +class mapConsumerDevicesCheckInOutput: + @staticmethod + def from_dict(data: Dict[str, Any]) -> ConsumerDevicesCheckInOutput: + return ConsumerDevicesCheckInOutput( + object=data.get('object'), + id=data.get('id'), + status=data.get('status'), + consumer_profile_id=data.get('consumer_profile_id'), + name=data.get('name'), + os=data.get('os'), + arch=data.get('arch'), + app_version=data.get('app_version'), + clients=[mapConsumerDevicesCheckInOutputClients.from_dict(item) for item in data.get('clients', []) if item], + last_seen_at=datetime.fromisoformat(data.get('last_seen_at').replace('Z', '+00:00')) if data.get('last_seen_at') else None, + revoked_at=datetime.fromisoformat(data.get('revoked_at').replace('Z', '+00:00')) if data.get('revoked_at') else None, + created_at=datetime.fromisoformat(data.get('created_at').replace('Z', '+00:00')) if data.get('created_at') else None, + updated_at=datetime.fromisoformat(data.get('updated_at').replace('Z', '+00:00')) if data.get('updated_at') else None + ) + + @staticmethod + def to_dict(value: Union[ConsumerDevicesCheckInOutput, Dict[str, Any], None]) -> Optional[Dict[str, Any]]: + if value is None: + return None + if isinstance(value, dict): + return value + # assume dataclass for generated models + return dataclasses.asdict(value) + +@dataclass +class ConsumerDevicesCheckInBodyClients: + key: str + name: str + detected: bool + installable: bool + supports_skills: bool +@dataclass +class ConsumerDevicesCheckInBody: + installation_id: str + name: str + os: str + arch: str + app_version: str + clients: List[ConsumerDevicesCheckInBodyClients] + magic_mcp_token_ids: Optional[List[str]] = None + + +class mapConsumerDevicesCheckInBodyClients: + @staticmethod + def from_dict(data: Dict[str, Any]) -> ConsumerDevicesCheckInBodyClients: + return ConsumerDevicesCheckInBodyClients( + key=data.get('key'), + name=data.get('name'), + detected=data.get('detected'), + installable=data.get('installable'), + supports_skills=data.get('supports_skills') + ) + + @staticmethod + def to_dict(value: Union[ConsumerDevicesCheckInBodyClients, Dict[str, Any], None]) -> Optional[Dict[str, Any]]: + if value is None: + return None + if isinstance(value, dict): + return value + return dataclasses.asdict(value) + +class mapConsumerDevicesCheckInBody: + @staticmethod + def from_dict(data: Dict[str, Any]) -> ConsumerDevicesCheckInBody: + return ConsumerDevicesCheckInBody( + installation_id=data.get('installation_id'), + name=data.get('name'), + os=data.get('os'), + arch=data.get('arch'), + app_version=data.get('app_version'), + clients=[mapConsumerDevicesCheckInBodyClients.from_dict(item) for item in data.get('clients', []) if item], + magic_mcp_token_ids=data.get('magic_mcp_token_ids', []) + ) + + @staticmethod + def to_dict(value: Union[ConsumerDevicesCheckInBody, Dict[str, Any], None]) -> Optional[Dict[str, Any]]: + if value is None: + return None + if isinstance(value, dict): + return value + # assume dataclass for generated models + return dataclasses.asdict(value) + diff --git a/src/metorial/_generated/magnetar/resources/consumer/devices/clients/__init__.py b/src/metorial/_generated/magnetar/resources/consumer/devices/clients/__init__.py new file mode 100644 index 00000000..2ff1c514 --- /dev/null +++ b/src/metorial/_generated/magnetar/resources/consumer/devices/clients/__init__.py @@ -0,0 +1 @@ +from .update import * \ No newline at end of file diff --git a/src/metorial/_generated/magnetar/resources/consumer/devices/clients/update.py b/src/metorial/_generated/magnetar/resources/consumer/devices/clients/update.py new file mode 100644 index 00000000..b5796663 --- /dev/null +++ b/src/metorial/_generated/magnetar/resources/consumer/devices/clients/update.py @@ -0,0 +1,109 @@ +from dataclasses import dataclass +from typing import Any, Dict, List, Optional, Union +from datetime import datetime +import dataclasses + +@dataclass +class ConsumerDevicesClientsUpdateOutputClients: + object: str + key: str + name: str + detected: bool + installable: bool + supports_skills: bool + enabled: bool + excluded_magic_mcp_server_ids: List[str] + excluded_skill_ids: List[str] +@dataclass +class ConsumerDevicesClientsUpdateOutput: + object: str + id: str + status: str + consumer_profile_id: str + name: str + os: str + arch: str + app_version: str + clients: List[ConsumerDevicesClientsUpdateOutputClients] + last_seen_at: datetime + created_at: datetime + updated_at: datetime + revoked_at: Optional[datetime] = None + + +class mapConsumerDevicesClientsUpdateOutputClients: + @staticmethod + def from_dict(data: Dict[str, Any]) -> ConsumerDevicesClientsUpdateOutputClients: + return ConsumerDevicesClientsUpdateOutputClients( + object=data.get('object'), + key=data.get('key'), + name=data.get('name'), + detected=data.get('detected'), + installable=data.get('installable'), + supports_skills=data.get('supports_skills'), + enabled=data.get('enabled'), + excluded_magic_mcp_server_ids=data.get('excluded_magic_mcp_server_ids', []), + excluded_skill_ids=data.get('excluded_skill_ids', []) + ) + + @staticmethod + def to_dict(value: Union[ConsumerDevicesClientsUpdateOutputClients, Dict[str, Any], None]) -> Optional[Dict[str, Any]]: + if value is None: + return None + if isinstance(value, dict): + return value + return dataclasses.asdict(value) + +class mapConsumerDevicesClientsUpdateOutput: + @staticmethod + def from_dict(data: Dict[str, Any]) -> ConsumerDevicesClientsUpdateOutput: + return ConsumerDevicesClientsUpdateOutput( + object=data.get('object'), + id=data.get('id'), + status=data.get('status'), + consumer_profile_id=data.get('consumer_profile_id'), + name=data.get('name'), + os=data.get('os'), + arch=data.get('arch'), + app_version=data.get('app_version'), + clients=[mapConsumerDevicesClientsUpdateOutputClients.from_dict(item) for item in data.get('clients', []) if item], + last_seen_at=datetime.fromisoformat(data.get('last_seen_at').replace('Z', '+00:00')) if data.get('last_seen_at') else None, + revoked_at=datetime.fromisoformat(data.get('revoked_at').replace('Z', '+00:00')) if data.get('revoked_at') else None, + created_at=datetime.fromisoformat(data.get('created_at').replace('Z', '+00:00')) if data.get('created_at') else None, + updated_at=datetime.fromisoformat(data.get('updated_at').replace('Z', '+00:00')) if data.get('updated_at') else None + ) + + @staticmethod + def to_dict(value: Union[ConsumerDevicesClientsUpdateOutput, Dict[str, Any], None]) -> Optional[Dict[str, Any]]: + if value is None: + return None + if isinstance(value, dict): + return value + # assume dataclass for generated models + return dataclasses.asdict(value) + +@dataclass +class ConsumerDevicesClientsUpdateBody: + enabled: Optional[bool] = None + excluded_magic_mcp_server_ids: Optional[List[str]] = None + excluded_skill_ids: Optional[List[str]] = None + + +class mapConsumerDevicesClientsUpdateBody: + @staticmethod + def from_dict(data: Dict[str, Any]) -> ConsumerDevicesClientsUpdateBody: + return ConsumerDevicesClientsUpdateBody( + enabled=data.get('enabled'), + excluded_magic_mcp_server_ids=data.get('excluded_magic_mcp_server_ids', []), + excluded_skill_ids=data.get('excluded_skill_ids', []) + ) + + @staticmethod + def to_dict(value: Union[ConsumerDevicesClientsUpdateBody, Dict[str, Any], None]) -> Optional[Dict[str, Any]]: + if value is None: + return None + if isinstance(value, dict): + return value + # assume dataclass for generated models + return dataclasses.asdict(value) + diff --git a/src/metorial/_generated/magnetar/resources/consumer/devices/get.py b/src/metorial/_generated/magnetar/resources/consumer/devices/get.py new file mode 100644 index 00000000..660ed4a0 --- /dev/null +++ b/src/metorial/_generated/magnetar/resources/consumer/devices/get.py @@ -0,0 +1,84 @@ +from dataclasses import dataclass +from typing import Any, Dict, List, Optional, Union +from datetime import datetime +import dataclasses + +@dataclass +class ConsumerDevicesGetOutputClients: + object: str + key: str + name: str + detected: bool + installable: bool + supports_skills: bool + enabled: bool + excluded_magic_mcp_server_ids: List[str] + excluded_skill_ids: List[str] +@dataclass +class ConsumerDevicesGetOutput: + object: str + id: str + status: str + consumer_profile_id: str + name: str + os: str + arch: str + app_version: str + clients: List[ConsumerDevicesGetOutputClients] + last_seen_at: datetime + created_at: datetime + updated_at: datetime + revoked_at: Optional[datetime] = None + + +class mapConsumerDevicesGetOutputClients: + @staticmethod + def from_dict(data: Dict[str, Any]) -> ConsumerDevicesGetOutputClients: + return ConsumerDevicesGetOutputClients( + object=data.get('object'), + key=data.get('key'), + name=data.get('name'), + detected=data.get('detected'), + installable=data.get('installable'), + supports_skills=data.get('supports_skills'), + enabled=data.get('enabled'), + excluded_magic_mcp_server_ids=data.get('excluded_magic_mcp_server_ids', []), + excluded_skill_ids=data.get('excluded_skill_ids', []) + ) + + @staticmethod + def to_dict(value: Union[ConsumerDevicesGetOutputClients, Dict[str, Any], None]) -> Optional[Dict[str, Any]]: + if value is None: + return None + if isinstance(value, dict): + return value + return dataclasses.asdict(value) + +class mapConsumerDevicesGetOutput: + @staticmethod + def from_dict(data: Dict[str, Any]) -> ConsumerDevicesGetOutput: + return ConsumerDevicesGetOutput( + object=data.get('object'), + id=data.get('id'), + status=data.get('status'), + consumer_profile_id=data.get('consumer_profile_id'), + name=data.get('name'), + os=data.get('os'), + arch=data.get('arch'), + app_version=data.get('app_version'), + clients=[mapConsumerDevicesGetOutputClients.from_dict(item) for item in data.get('clients', []) if item], + last_seen_at=datetime.fromisoformat(data.get('last_seen_at').replace('Z', '+00:00')) if data.get('last_seen_at') else None, + revoked_at=datetime.fromisoformat(data.get('revoked_at').replace('Z', '+00:00')) if data.get('revoked_at') else None, + created_at=datetime.fromisoformat(data.get('created_at').replace('Z', '+00:00')) if data.get('created_at') else None, + updated_at=datetime.fromisoformat(data.get('updated_at').replace('Z', '+00:00')) if data.get('updated_at') else None + ) + + @staticmethod + def to_dict(value: Union[ConsumerDevicesGetOutput, Dict[str, Any], None]) -> Optional[Dict[str, Any]]: + if value is None: + return None + if isinstance(value, dict): + return value + # assume dataclass for generated models + return dataclasses.asdict(value) + diff --git a/src/metorial/_generated/magnetar/resources/consumer/devices/list.py b/src/metorial/_generated/magnetar/resources/consumer/devices/list.py new file mode 100644 index 00000000..dfdded4a --- /dev/null +++ b/src/metorial/_generated/magnetar/resources/consumer/devices/list.py @@ -0,0 +1,155 @@ +from dataclasses import dataclass +from typing import Any, Dict, List, Optional, Union +from datetime import datetime +import dataclasses + +@dataclass +class ConsumerDevicesListOutputItemsClients: + object: str + key: str + name: str + detected: bool + installable: bool + supports_skills: bool + enabled: bool + excluded_magic_mcp_server_ids: List[str] + excluded_skill_ids: List[str] +@dataclass +class ConsumerDevicesListOutputItems: + object: str + id: str + status: str + consumer_profile_id: str + name: str + os: str + arch: str + app_version: str + clients: List[ConsumerDevicesListOutputItemsClients] + last_seen_at: datetime + created_at: datetime + updated_at: datetime + revoked_at: Optional[datetime] = None +@dataclass +class ConsumerDevicesListOutputPagination: + has_more_before: bool + has_more_after: bool +@dataclass +class ConsumerDevicesListOutput: + items: List[ConsumerDevicesListOutputItems] + pagination: ConsumerDevicesListOutputPagination + + +class mapConsumerDevicesListOutputItemsClients: + @staticmethod + def from_dict(data: Dict[str, Any]) -> ConsumerDevicesListOutputItemsClients: + return ConsumerDevicesListOutputItemsClients( + object=data.get('object'), + key=data.get('key'), + name=data.get('name'), + detected=data.get('detected'), + installable=data.get('installable'), + supports_skills=data.get('supports_skills'), + enabled=data.get('enabled'), + excluded_magic_mcp_server_ids=data.get('excluded_magic_mcp_server_ids', []), + excluded_skill_ids=data.get('excluded_skill_ids', []) + ) + + @staticmethod + def to_dict(value: Union[ConsumerDevicesListOutputItemsClients, Dict[str, Any], None]) -> Optional[Dict[str, Any]]: + if value is None: + return None + if isinstance(value, dict): + return value + return dataclasses.asdict(value) + +class mapConsumerDevicesListOutputItems: + @staticmethod + def from_dict(data: Dict[str, Any]) -> ConsumerDevicesListOutputItems: + return ConsumerDevicesListOutputItems( + object=data.get('object'), + id=data.get('id'), + status=data.get('status'), + consumer_profile_id=data.get('consumer_profile_id'), + name=data.get('name'), + os=data.get('os'), + arch=data.get('arch'), + app_version=data.get('app_version'), + clients=[mapConsumerDevicesListOutputItemsClients.from_dict(item) for item in data.get('clients', []) if item], + last_seen_at=datetime.fromisoformat(data.get('last_seen_at').replace('Z', '+00:00')) if data.get('last_seen_at') else None, + revoked_at=datetime.fromisoformat(data.get('revoked_at').replace('Z', '+00:00')) if data.get('revoked_at') else None, + created_at=datetime.fromisoformat(data.get('created_at').replace('Z', '+00:00')) if data.get('created_at') else None, + updated_at=datetime.fromisoformat(data.get('updated_at').replace('Z', '+00:00')) if data.get('updated_at') else None + ) + + @staticmethod + def to_dict(value: Union[ConsumerDevicesListOutputItems, Dict[str, Any], None]) -> Optional[Dict[str, Any]]: + if value is None: + return None + if isinstance(value, dict): + return value + return dataclasses.asdict(value) + +class mapConsumerDevicesListOutputPagination: + @staticmethod + def from_dict(data: Dict[str, Any]) -> ConsumerDevicesListOutputPagination: + return ConsumerDevicesListOutputPagination( + has_more_before=data.get('has_more_before'), + has_more_after=data.get('has_more_after') + ) + + @staticmethod + def to_dict(value: Union[ConsumerDevicesListOutputPagination, Dict[str, Any], None]) -> Optional[Dict[str, Any]]: + if value is None: + return None + if isinstance(value, dict): + return value + return dataclasses.asdict(value) + +class mapConsumerDevicesListOutput: + @staticmethod + def from_dict(data: Dict[str, Any]) -> ConsumerDevicesListOutput: + return ConsumerDevicesListOutput( + items=[mapConsumerDevicesListOutputItems.from_dict(item) for item in data.get('items', []) if item], + pagination=mapConsumerDevicesListOutputPagination.from_dict(data.get('pagination')) if data.get('pagination') else None + ) + + @staticmethod + def to_dict(value: Union[ConsumerDevicesListOutput, Dict[str, Any], None]) -> Optional[Dict[str, Any]]: + if value is None: + return None + if isinstance(value, dict): + return value + # assume dataclass for generated models + return dataclasses.asdict(value) + +@dataclass +class ConsumerDevicesListQuery: + 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 + + +class mapConsumerDevicesListQuery: + @staticmethod + def from_dict(data: Dict[str, Any]) -> ConsumerDevicesListQuery: + return ConsumerDevicesListQuery( + limit=data.get('limit'), + after=data.get('after'), + before=data.get('before'), + cursor=data.get('cursor'), + order=data.get('order'), + status=data.get('status') + ) + + @staticmethod + def to_dict(value: Union[ConsumerDevicesListQuery, Dict[str, Any], None]) -> Optional[Dict[str, Any]]: + if value is None: + return None + if isinstance(value, dict): + return value + # assume dataclass for generated models + return dataclasses.asdict(value) + diff --git a/src/metorial/_generated/magnetar/resources/consumer/devices/revoke.py b/src/metorial/_generated/magnetar/resources/consumer/devices/revoke.py new file mode 100644 index 00000000..6716cba2 --- /dev/null +++ b/src/metorial/_generated/magnetar/resources/consumer/devices/revoke.py @@ -0,0 +1,84 @@ +from dataclasses import dataclass +from typing import Any, Dict, List, Optional, Union +from datetime import datetime +import dataclasses + +@dataclass +class ConsumerDevicesRevokeOutputClients: + object: str + key: str + name: str + detected: bool + installable: bool + supports_skills: bool + enabled: bool + excluded_magic_mcp_server_ids: List[str] + excluded_skill_ids: List[str] +@dataclass +class ConsumerDevicesRevokeOutput: + object: str + id: str + status: str + consumer_profile_id: str + name: str + os: str + arch: str + app_version: str + clients: List[ConsumerDevicesRevokeOutputClients] + last_seen_at: datetime + created_at: datetime + updated_at: datetime + revoked_at: Optional[datetime] = None + + +class mapConsumerDevicesRevokeOutputClients: + @staticmethod + def from_dict(data: Dict[str, Any]) -> ConsumerDevicesRevokeOutputClients: + return ConsumerDevicesRevokeOutputClients( + object=data.get('object'), + key=data.get('key'), + name=data.get('name'), + detected=data.get('detected'), + installable=data.get('installable'), + supports_skills=data.get('supports_skills'), + enabled=data.get('enabled'), + excluded_magic_mcp_server_ids=data.get('excluded_magic_mcp_server_ids', []), + excluded_skill_ids=data.get('excluded_skill_ids', []) + ) + + @staticmethod + def to_dict(value: Union[ConsumerDevicesRevokeOutputClients, Dict[str, Any], None]) -> Optional[Dict[str, Any]]: + if value is None: + return None + if isinstance(value, dict): + return value + return dataclasses.asdict(value) + +class mapConsumerDevicesRevokeOutput: + @staticmethod + def from_dict(data: Dict[str, Any]) -> ConsumerDevicesRevokeOutput: + return ConsumerDevicesRevokeOutput( + object=data.get('object'), + id=data.get('id'), + status=data.get('status'), + consumer_profile_id=data.get('consumer_profile_id'), + name=data.get('name'), + os=data.get('os'), + arch=data.get('arch'), + app_version=data.get('app_version'), + clients=[mapConsumerDevicesRevokeOutputClients.from_dict(item) for item in data.get('clients', []) if item], + last_seen_at=datetime.fromisoformat(data.get('last_seen_at').replace('Z', '+00:00')) if data.get('last_seen_at') else None, + revoked_at=datetime.fromisoformat(data.get('revoked_at').replace('Z', '+00:00')) if data.get('revoked_at') else None, + created_at=datetime.fromisoformat(data.get('created_at').replace('Z', '+00:00')) if data.get('created_at') else None, + updated_at=datetime.fromisoformat(data.get('updated_at').replace('Z', '+00:00')) if data.get('updated_at') else None + ) + + @staticmethod + def to_dict(value: Union[ConsumerDevicesRevokeOutput, Dict[str, Any], None]) -> Optional[Dict[str, Any]]: + if value is None: + return None + if isinstance(value, dict): + return value + # assume dataclass for generated models + return dataclasses.asdict(value) + diff --git a/src/metorial/_generated/magnetar/resources/consumer/devices/sign_out.py b/src/metorial/_generated/magnetar/resources/consumer/devices/sign_out.py new file mode 100644 index 00000000..6c185cf7 --- /dev/null +++ b/src/metorial/_generated/magnetar/resources/consumer/devices/sign_out.py @@ -0,0 +1,84 @@ +from dataclasses import dataclass +from typing import Any, Dict, List, Optional, Union +from datetime import datetime +import dataclasses + +@dataclass +class ConsumerDevicesSignOutOutputClients: + object: str + key: str + name: str + detected: bool + installable: bool + supports_skills: bool + enabled: bool + excluded_magic_mcp_server_ids: List[str] + excluded_skill_ids: List[str] +@dataclass +class ConsumerDevicesSignOutOutput: + object: str + id: str + status: str + consumer_profile_id: str + name: str + os: str + arch: str + app_version: str + clients: List[ConsumerDevicesSignOutOutputClients] + last_seen_at: datetime + created_at: datetime + updated_at: datetime + revoked_at: Optional[datetime] = None + + +class mapConsumerDevicesSignOutOutputClients: + @staticmethod + def from_dict(data: Dict[str, Any]) -> ConsumerDevicesSignOutOutputClients: + return ConsumerDevicesSignOutOutputClients( + object=data.get('object'), + key=data.get('key'), + name=data.get('name'), + detected=data.get('detected'), + installable=data.get('installable'), + supports_skills=data.get('supports_skills'), + enabled=data.get('enabled'), + excluded_magic_mcp_server_ids=data.get('excluded_magic_mcp_server_ids', []), + excluded_skill_ids=data.get('excluded_skill_ids', []) + ) + + @staticmethod + def to_dict(value: Union[ConsumerDevicesSignOutOutputClients, Dict[str, Any], None]) -> Optional[Dict[str, Any]]: + if value is None: + return None + if isinstance(value, dict): + return value + return dataclasses.asdict(value) + +class mapConsumerDevicesSignOutOutput: + @staticmethod + def from_dict(data: Dict[str, Any]) -> ConsumerDevicesSignOutOutput: + return ConsumerDevicesSignOutOutput( + object=data.get('object'), + id=data.get('id'), + status=data.get('status'), + consumer_profile_id=data.get('consumer_profile_id'), + name=data.get('name'), + os=data.get('os'), + arch=data.get('arch'), + app_version=data.get('app_version'), + clients=[mapConsumerDevicesSignOutOutputClients.from_dict(item) for item in data.get('clients', []) if item], + last_seen_at=datetime.fromisoformat(data.get('last_seen_at').replace('Z', '+00:00')) if data.get('last_seen_at') else None, + revoked_at=datetime.fromisoformat(data.get('revoked_at').replace('Z', '+00:00')) if data.get('revoked_at') else None, + created_at=datetime.fromisoformat(data.get('created_at').replace('Z', '+00:00')) if data.get('created_at') else None, + updated_at=datetime.fromisoformat(data.get('updated_at').replace('Z', '+00:00')) if data.get('updated_at') else None + ) + + @staticmethod + def to_dict(value: Union[ConsumerDevicesSignOutOutput, Dict[str, Any], None]) -> Optional[Dict[str, Any]]: + if value is None: + return None + if isinstance(value, dict): + return value + # assume dataclass for generated models + return dataclasses.asdict(value) + diff --git a/src/metorial/_generated/magnetar/resources/consumers/__init__.py b/src/metorial/_generated/magnetar/resources/consumers/__init__.py index 16e3415d..5d55e3f7 100644 --- a/src/metorial/_generated/magnetar/resources/consumers/__init__.py +++ b/src/metorial/_generated/magnetar/resources/consumers/__init__.py @@ -1,4 +1,6 @@ from .create import * +from .create_member_session import * +from .devices import * from .get import * from .get_member_consumer import * from .list import * diff --git a/src/metorial/_generated/magnetar/resources/consumers/create_member_session.py b/src/metorial/_generated/magnetar/resources/consumers/create_member_session.py new file mode 100644 index 00000000..82c1749d --- /dev/null +++ b/src/metorial/_generated/magnetar/resources/consumers/create_member_session.py @@ -0,0 +1,49 @@ +from dataclasses import dataclass +from typing import Any, Dict, List, Optional, Union +from datetime import datetime +import dataclasses + +@dataclass +class ConsumersCreateMemberSessionOutput: + access_token: str + catalog_item_id: Optional[str] = None + + +class mapConsumersCreateMemberSessionOutput: + @staticmethod + def from_dict(data: Dict[str, Any]) -> ConsumersCreateMemberSessionOutput: + return ConsumersCreateMemberSessionOutput( + access_token=data.get('access_token'), + catalog_item_id=data.get('catalog_item_id') + ) + + @staticmethod + def to_dict(value: Union[ConsumersCreateMemberSessionOutput, Dict[str, Any], None]) -> Optional[Dict[str, Any]]: + if value is None: + return None + if isinstance(value, dict): + return value + # assume dataclass for generated models + return dataclasses.asdict(value) + +@dataclass +class ConsumersCreateMemberSessionBody: + integration_id: Optional[str] = None + + +class mapConsumersCreateMemberSessionBody: + @staticmethod + def from_dict(data: Dict[str, Any]) -> ConsumersCreateMemberSessionBody: + return ConsumersCreateMemberSessionBody( + integration_id=data.get('integration_id') + ) + + @staticmethod + def to_dict(value: Union[ConsumersCreateMemberSessionBody, Dict[str, Any], None]) -> Optional[Dict[str, Any]]: + if value is None: + return None + if isinstance(value, dict): + return value + # assume dataclass for generated models + return dataclasses.asdict(value) + diff --git a/src/metorial/_generated/magnetar/resources/consumers/devices/__init__.py b/src/metorial/_generated/magnetar/resources/consumers/devices/__init__.py new file mode 100644 index 00000000..d0873f42 --- /dev/null +++ b/src/metorial/_generated/magnetar/resources/consumers/devices/__init__.py @@ -0,0 +1,3 @@ +from .get import * +from .list import * +from .revoke import * \ No newline at end of file diff --git a/src/metorial/_generated/magnetar/resources/consumers/devices/get.py b/src/metorial/_generated/magnetar/resources/consumers/devices/get.py new file mode 100644 index 00000000..195b7b3c --- /dev/null +++ b/src/metorial/_generated/magnetar/resources/consumers/devices/get.py @@ -0,0 +1,84 @@ +from dataclasses import dataclass +from typing import Any, Dict, List, Optional, Union +from datetime import datetime +import dataclasses + +@dataclass +class ConsumersDevicesGetOutputClients: + object: str + key: str + name: str + detected: bool + installable: bool + supports_skills: bool + enabled: bool + excluded_magic_mcp_server_ids: List[str] + excluded_skill_ids: List[str] +@dataclass +class ConsumersDevicesGetOutput: + object: str + id: str + status: str + consumer_profile_id: str + name: str + os: str + arch: str + app_version: str + clients: List[ConsumersDevicesGetOutputClients] + last_seen_at: datetime + created_at: datetime + updated_at: datetime + revoked_at: Optional[datetime] = None + + +class mapConsumersDevicesGetOutputClients: + @staticmethod + def from_dict(data: Dict[str, Any]) -> ConsumersDevicesGetOutputClients: + return ConsumersDevicesGetOutputClients( + object=data.get('object'), + key=data.get('key'), + name=data.get('name'), + detected=data.get('detected'), + installable=data.get('installable'), + supports_skills=data.get('supports_skills'), + enabled=data.get('enabled'), + excluded_magic_mcp_server_ids=data.get('excluded_magic_mcp_server_ids', []), + excluded_skill_ids=data.get('excluded_skill_ids', []) + ) + + @staticmethod + def to_dict(value: Union[ConsumersDevicesGetOutputClients, Dict[str, Any], None]) -> Optional[Dict[str, Any]]: + if value is None: + return None + if isinstance(value, dict): + return value + return dataclasses.asdict(value) + +class mapConsumersDevicesGetOutput: + @staticmethod + def from_dict(data: Dict[str, Any]) -> ConsumersDevicesGetOutput: + return ConsumersDevicesGetOutput( + object=data.get('object'), + id=data.get('id'), + status=data.get('status'), + consumer_profile_id=data.get('consumer_profile_id'), + name=data.get('name'), + os=data.get('os'), + arch=data.get('arch'), + app_version=data.get('app_version'), + clients=[mapConsumersDevicesGetOutputClients.from_dict(item) for item in data.get('clients', []) if item], + last_seen_at=datetime.fromisoformat(data.get('last_seen_at').replace('Z', '+00:00')) if data.get('last_seen_at') else None, + revoked_at=datetime.fromisoformat(data.get('revoked_at').replace('Z', '+00:00')) if data.get('revoked_at') else None, + created_at=datetime.fromisoformat(data.get('created_at').replace('Z', '+00:00')) if data.get('created_at') else None, + updated_at=datetime.fromisoformat(data.get('updated_at').replace('Z', '+00:00')) if data.get('updated_at') else None + ) + + @staticmethod + def to_dict(value: Union[ConsumersDevicesGetOutput, Dict[str, Any], None]) -> Optional[Dict[str, Any]]: + if value is None: + return None + if isinstance(value, dict): + return value + # assume dataclass for generated models + return dataclasses.asdict(value) + diff --git a/src/metorial/_generated/magnetar/resources/consumers/devices/list.py b/src/metorial/_generated/magnetar/resources/consumers/devices/list.py new file mode 100644 index 00000000..6f9469e7 --- /dev/null +++ b/src/metorial/_generated/magnetar/resources/consumers/devices/list.py @@ -0,0 +1,159 @@ +from dataclasses import dataclass +from typing import Any, Dict, List, Optional, Union +from datetime import datetime +import dataclasses + +@dataclass +class ConsumersDevicesListOutputItemsClients: + object: str + key: str + name: str + detected: bool + installable: bool + supports_skills: bool + enabled: bool + excluded_magic_mcp_server_ids: List[str] + excluded_skill_ids: List[str] +@dataclass +class ConsumersDevicesListOutputItems: + object: str + id: str + status: str + consumer_profile_id: str + name: str + os: str + arch: str + app_version: str + clients: List[ConsumersDevicesListOutputItemsClients] + last_seen_at: datetime + created_at: datetime + updated_at: datetime + revoked_at: Optional[datetime] = None +@dataclass +class ConsumersDevicesListOutputPagination: + has_more_before: bool + has_more_after: bool +@dataclass +class ConsumersDevicesListOutput: + items: List[ConsumersDevicesListOutputItems] + pagination: ConsumersDevicesListOutputPagination + + +class mapConsumersDevicesListOutputItemsClients: + @staticmethod + def from_dict(data: Dict[str, Any]) -> ConsumersDevicesListOutputItemsClients: + return ConsumersDevicesListOutputItemsClients( + object=data.get('object'), + key=data.get('key'), + name=data.get('name'), + detected=data.get('detected'), + installable=data.get('installable'), + supports_skills=data.get('supports_skills'), + enabled=data.get('enabled'), + excluded_magic_mcp_server_ids=data.get('excluded_magic_mcp_server_ids', []), + excluded_skill_ids=data.get('excluded_skill_ids', []) + ) + + @staticmethod + def to_dict(value: Union[ConsumersDevicesListOutputItemsClients, Dict[str, Any], None]) -> Optional[Dict[str, Any]]: + if value is None: + return None + if isinstance(value, dict): + return value + return dataclasses.asdict(value) + +class mapConsumersDevicesListOutputItems: + @staticmethod + def from_dict(data: Dict[str, Any]) -> ConsumersDevicesListOutputItems: + return ConsumersDevicesListOutputItems( + object=data.get('object'), + id=data.get('id'), + status=data.get('status'), + consumer_profile_id=data.get('consumer_profile_id'), + name=data.get('name'), + os=data.get('os'), + arch=data.get('arch'), + app_version=data.get('app_version'), + clients=[mapConsumersDevicesListOutputItemsClients.from_dict(item) for item in data.get('clients', []) if item], + last_seen_at=datetime.fromisoformat(data.get('last_seen_at').replace('Z', '+00:00')) if data.get('last_seen_at') else None, + revoked_at=datetime.fromisoformat(data.get('revoked_at').replace('Z', '+00:00')) if data.get('revoked_at') else None, + created_at=datetime.fromisoformat(data.get('created_at').replace('Z', '+00:00')) if data.get('created_at') else None, + updated_at=datetime.fromisoformat(data.get('updated_at').replace('Z', '+00:00')) if data.get('updated_at') else None + ) + + @staticmethod + def to_dict(value: Union[ConsumersDevicesListOutputItems, Dict[str, Any], None]) -> Optional[Dict[str, Any]]: + if value is None: + return None + if isinstance(value, dict): + return value + return dataclasses.asdict(value) + +class mapConsumersDevicesListOutputPagination: + @staticmethod + def from_dict(data: Dict[str, Any]) -> ConsumersDevicesListOutputPagination: + return ConsumersDevicesListOutputPagination( + has_more_before=data.get('has_more_before'), + has_more_after=data.get('has_more_after') + ) + + @staticmethod + def to_dict(value: Union[ConsumersDevicesListOutputPagination, Dict[str, Any], None]) -> Optional[Dict[str, Any]]: + if value is None: + return None + if isinstance(value, dict): + return value + return dataclasses.asdict(value) + +class mapConsumersDevicesListOutput: + @staticmethod + def from_dict(data: Dict[str, Any]) -> ConsumersDevicesListOutput: + return ConsumersDevicesListOutput( + items=[mapConsumersDevicesListOutputItems.from_dict(item) for item in data.get('items', []) if item], + pagination=mapConsumersDevicesListOutputPagination.from_dict(data.get('pagination')) if data.get('pagination') else None + ) + + @staticmethod + def to_dict(value: Union[ConsumersDevicesListOutput, Dict[str, Any], None]) -> Optional[Dict[str, Any]]: + if value is None: + return None + if isinstance(value, dict): + return value + # assume dataclass for generated models + return dataclasses.asdict(value) + +@dataclass +class ConsumersDevicesListQuery: + limit: Optional[float] = None + after: Optional[str] = None + before: Optional[str] = None + cursor: Optional[str] = None + order: Optional[str] = None + consumer_profile_id: Optional[Union[str, List[str]]] = None + consumer_id: Optional[Union[str, List[str]]] = None + status: Optional[Union[str, List[str]]] = None + + +class mapConsumersDevicesListQuery: + @staticmethod + def from_dict(data: Dict[str, Any]) -> ConsumersDevicesListQuery: + return ConsumersDevicesListQuery( + limit=data.get('limit'), + after=data.get('after'), + before=data.get('before'), + cursor=data.get('cursor'), + order=data.get('order'), + consumer_profile_id=data.get('consumer_profile_id'), + consumer_id=data.get('consumer_id'), + status=data.get('status') + ) + + @staticmethod + def to_dict(value: Union[ConsumersDevicesListQuery, Dict[str, Any], None]) -> Optional[Dict[str, Any]]: + if value is None: + return None + if isinstance(value, dict): + return value + # assume dataclass for generated models + return dataclasses.asdict(value) + diff --git a/src/metorial/_generated/magnetar/resources/consumers/devices/revoke.py b/src/metorial/_generated/magnetar/resources/consumers/devices/revoke.py new file mode 100644 index 00000000..3a6d6e3a --- /dev/null +++ b/src/metorial/_generated/magnetar/resources/consumers/devices/revoke.py @@ -0,0 +1,84 @@ +from dataclasses import dataclass +from typing import Any, Dict, List, Optional, Union +from datetime import datetime +import dataclasses + +@dataclass +class ConsumersDevicesRevokeOutputClients: + object: str + key: str + name: str + detected: bool + installable: bool + supports_skills: bool + enabled: bool + excluded_magic_mcp_server_ids: List[str] + excluded_skill_ids: List[str] +@dataclass +class ConsumersDevicesRevokeOutput: + object: str + id: str + status: str + consumer_profile_id: str + name: str + os: str + arch: str + app_version: str + clients: List[ConsumersDevicesRevokeOutputClients] + last_seen_at: datetime + created_at: datetime + updated_at: datetime + revoked_at: Optional[datetime] = None + + +class mapConsumersDevicesRevokeOutputClients: + @staticmethod + def from_dict(data: Dict[str, Any]) -> ConsumersDevicesRevokeOutputClients: + return ConsumersDevicesRevokeOutputClients( + object=data.get('object'), + key=data.get('key'), + name=data.get('name'), + detected=data.get('detected'), + installable=data.get('installable'), + supports_skills=data.get('supports_skills'), + enabled=data.get('enabled'), + excluded_magic_mcp_server_ids=data.get('excluded_magic_mcp_server_ids', []), + excluded_skill_ids=data.get('excluded_skill_ids', []) + ) + + @staticmethod + def to_dict(value: Union[ConsumersDevicesRevokeOutputClients, Dict[str, Any], None]) -> Optional[Dict[str, Any]]: + if value is None: + return None + if isinstance(value, dict): + return value + return dataclasses.asdict(value) + +class mapConsumersDevicesRevokeOutput: + @staticmethod + def from_dict(data: Dict[str, Any]) -> ConsumersDevicesRevokeOutput: + return ConsumersDevicesRevokeOutput( + object=data.get('object'), + id=data.get('id'), + status=data.get('status'), + consumer_profile_id=data.get('consumer_profile_id'), + name=data.get('name'), + os=data.get('os'), + arch=data.get('arch'), + app_version=data.get('app_version'), + clients=[mapConsumersDevicesRevokeOutputClients.from_dict(item) for item in data.get('clients', []) if item], + last_seen_at=datetime.fromisoformat(data.get('last_seen_at').replace('Z', '+00:00')) if data.get('last_seen_at') else None, + revoked_at=datetime.fromisoformat(data.get('revoked_at').replace('Z', '+00:00')) if data.get('revoked_at') else None, + created_at=datetime.fromisoformat(data.get('created_at').replace('Z', '+00:00')) if data.get('created_at') else None, + updated_at=datetime.fromisoformat(data.get('updated_at').replace('Z', '+00:00')) if data.get('updated_at') else None + ) + + @staticmethod + def to_dict(value: Union[ConsumersDevicesRevokeOutput, Dict[str, Any], None]) -> Optional[Dict[str, Any]]: + if value is None: + return None + if isinstance(value, dict): + return value + # assume dataclass for generated models + return dataclasses.asdict(value) + diff --git a/src/metorial/_generated/magnetar/resources/dashboard/instance/callbacks/create.py b/src/metorial/_generated/magnetar/resources/dashboard/instance/callbacks/create.py index 8c4f3a10..20d03938 100644 --- a/src/metorial/_generated/magnetar/resources/dashboard/instance/callbacks/create.py +++ b/src/metorial/_generated/magnetar/resources/dashboard/instance/callbacks/create.py @@ -13,6 +13,14 @@ class DashboardInstanceCallbacksCreateOutputProvider: updated_at: datetime description: Optional[str] = None @dataclass +class DashboardInstanceCallbacksCreateOutputTriggerGroups: + object: str + key: str + name: str + selection_schema: Dict[str, Any] + status: str + description: Optional[str] = None +@dataclass class DashboardInstanceCallbacksCreateOutput: object: str id: str @@ -21,10 +29,12 @@ class DashboardInstanceCallbacksCreateOutput: integration_id: str integration_provider_id: str provider: DashboardInstanceCallbacksCreateOutputProvider + trigger_groups: List[DashboardInstanceCallbacksCreateOutputTriggerGroups] created_at: datetime updated_at: datetime description: Optional[str] = None metadata: Optional[Dict[str, Any]] = None + trigger_group_selections: Optional[Dict[str, Dict[str, Any]]] = None class mapDashboardInstanceCallbacksCreateOutputProvider: @@ -48,6 +58,26 @@ def to_dict(value: Union[DashboardInstanceCallbacksCreateOutputProvider, Dict[st return value return dataclasses.asdict(value) +class mapDashboardInstanceCallbacksCreateOutputTriggerGroups: + @staticmethod + def from_dict(data: Dict[str, Any]) -> DashboardInstanceCallbacksCreateOutputTriggerGroups: + return DashboardInstanceCallbacksCreateOutputTriggerGroups( + object=data.get('object'), + key=data.get('key'), + name=data.get('name'), + description=data.get('description'), + selection_schema=data.get('selection_schema'), + status=data.get('status') + ) + + @staticmethod + def to_dict(value: Union[DashboardInstanceCallbacksCreateOutputTriggerGroups, Dict[str, Any], None]) -> Optional[Dict[str, Any]]: + if value is None: + return None + if isinstance(value, dict): + return value + return dataclasses.asdict(value) + class mapDashboardInstanceCallbacksCreateOutput: @staticmethod def from_dict(data: Dict[str, Any]) -> DashboardInstanceCallbacksCreateOutput: @@ -61,6 +91,8 @@ def from_dict(data: Dict[str, Any]) -> DashboardInstanceCallbacksCreateOutput: integration_id=data.get('integration_id'), integration_provider_id=data.get('integration_provider_id'), provider=mapDashboardInstanceCallbacksCreateOutputProvider.from_dict(data.get('provider')) if data.get('provider') else None, + trigger_group_selections=data.get('trigger_group_selections'), + trigger_groups=[mapDashboardInstanceCallbacksCreateOutputTriggerGroups.from_dict(item) for item in data.get('trigger_groups', []) if item], created_at=datetime.fromisoformat(data.get('created_at').replace('Z', '+00:00')) if data.get('created_at') else None, updated_at=datetime.fromisoformat(data.get('updated_at').replace('Z', '+00:00')) if data.get('updated_at') else None ) @@ -80,6 +112,7 @@ class DashboardInstanceCallbacksCreateBody: integration_provider_id: str name: Optional[str] = None description: Optional[str] = None + trigger_group_selections: Optional[Dict[str, Dict[str, Any]]] = None class mapDashboardInstanceCallbacksCreateBody: @@ -89,7 +122,8 @@ def from_dict(data: Dict[str, Any]) -> DashboardInstanceCallbacksCreateBody: integration_id=data.get('integration_id'), integration_provider_id=data.get('integration_provider_id'), name=data.get('name'), - description=data.get('description') + description=data.get('description'), + trigger_group_selections=data.get('trigger_group_selections') ) @staticmethod diff --git a/src/metorial/_generated/magnetar/resources/dashboard/instance/callbacks/delete.py b/src/metorial/_generated/magnetar/resources/dashboard/instance/callbacks/delete.py index 1a93253a..d340ef3b 100644 --- a/src/metorial/_generated/magnetar/resources/dashboard/instance/callbacks/delete.py +++ b/src/metorial/_generated/magnetar/resources/dashboard/instance/callbacks/delete.py @@ -13,6 +13,14 @@ class DashboardInstanceCallbacksDeleteOutputProvider: updated_at: datetime description: Optional[str] = None @dataclass +class DashboardInstanceCallbacksDeleteOutputTriggerGroups: + object: str + key: str + name: str + selection_schema: Dict[str, Any] + status: str + description: Optional[str] = None +@dataclass class DashboardInstanceCallbacksDeleteOutput: object: str id: str @@ -21,10 +29,12 @@ class DashboardInstanceCallbacksDeleteOutput: integration_id: str integration_provider_id: str provider: DashboardInstanceCallbacksDeleteOutputProvider + trigger_groups: List[DashboardInstanceCallbacksDeleteOutputTriggerGroups] created_at: datetime updated_at: datetime description: Optional[str] = None metadata: Optional[Dict[str, Any]] = None + trigger_group_selections: Optional[Dict[str, Dict[str, Any]]] = None class mapDashboardInstanceCallbacksDeleteOutputProvider: @@ -48,6 +58,26 @@ def to_dict(value: Union[DashboardInstanceCallbacksDeleteOutputProvider, Dict[st return value return dataclasses.asdict(value) +class mapDashboardInstanceCallbacksDeleteOutputTriggerGroups: + @staticmethod + def from_dict(data: Dict[str, Any]) -> DashboardInstanceCallbacksDeleteOutputTriggerGroups: + return DashboardInstanceCallbacksDeleteOutputTriggerGroups( + object=data.get('object'), + key=data.get('key'), + name=data.get('name'), + description=data.get('description'), + selection_schema=data.get('selection_schema'), + status=data.get('status') + ) + + @staticmethod + def to_dict(value: Union[DashboardInstanceCallbacksDeleteOutputTriggerGroups, Dict[str, Any], None]) -> Optional[Dict[str, Any]]: + if value is None: + return None + if isinstance(value, dict): + return value + return dataclasses.asdict(value) + class mapDashboardInstanceCallbacksDeleteOutput: @staticmethod def from_dict(data: Dict[str, Any]) -> DashboardInstanceCallbacksDeleteOutput: @@ -61,6 +91,8 @@ def from_dict(data: Dict[str, Any]) -> DashboardInstanceCallbacksDeleteOutput: integration_id=data.get('integration_id'), integration_provider_id=data.get('integration_provider_id'), provider=mapDashboardInstanceCallbacksDeleteOutputProvider.from_dict(data.get('provider')) if data.get('provider') else None, + trigger_group_selections=data.get('trigger_group_selections'), + trigger_groups=[mapDashboardInstanceCallbacksDeleteOutputTriggerGroups.from_dict(item) for item in data.get('trigger_groups', []) if item], created_at=datetime.fromisoformat(data.get('created_at').replace('Z', '+00:00')) if data.get('created_at') else None, updated_at=datetime.fromisoformat(data.get('updated_at').replace('Z', '+00:00')) if data.get('updated_at') else None ) diff --git a/src/metorial/_generated/magnetar/resources/dashboard/instance/callbacks/get.py b/src/metorial/_generated/magnetar/resources/dashboard/instance/callbacks/get.py index 35236f8a..d0bc2a58 100644 --- a/src/metorial/_generated/magnetar/resources/dashboard/instance/callbacks/get.py +++ b/src/metorial/_generated/magnetar/resources/dashboard/instance/callbacks/get.py @@ -13,6 +13,14 @@ class DashboardInstanceCallbacksGetOutputProvider: updated_at: datetime description: Optional[str] = None @dataclass +class DashboardInstanceCallbacksGetOutputTriggerGroups: + object: str + key: str + name: str + selection_schema: Dict[str, Any] + status: str + description: Optional[str] = None +@dataclass class DashboardInstanceCallbacksGetOutput: object: str id: str @@ -21,10 +29,12 @@ class DashboardInstanceCallbacksGetOutput: integration_id: str integration_provider_id: str provider: DashboardInstanceCallbacksGetOutputProvider + trigger_groups: List[DashboardInstanceCallbacksGetOutputTriggerGroups] created_at: datetime updated_at: datetime description: Optional[str] = None metadata: Optional[Dict[str, Any]] = None + trigger_group_selections: Optional[Dict[str, Dict[str, Any]]] = None class mapDashboardInstanceCallbacksGetOutputProvider: @@ -48,6 +58,26 @@ def to_dict(value: Union[DashboardInstanceCallbacksGetOutputProvider, Dict[str, return value return dataclasses.asdict(value) +class mapDashboardInstanceCallbacksGetOutputTriggerGroups: + @staticmethod + def from_dict(data: Dict[str, Any]) -> DashboardInstanceCallbacksGetOutputTriggerGroups: + return DashboardInstanceCallbacksGetOutputTriggerGroups( + object=data.get('object'), + key=data.get('key'), + name=data.get('name'), + description=data.get('description'), + selection_schema=data.get('selection_schema'), + status=data.get('status') + ) + + @staticmethod + def to_dict(value: Union[DashboardInstanceCallbacksGetOutputTriggerGroups, Dict[str, Any], None]) -> Optional[Dict[str, Any]]: + if value is None: + return None + if isinstance(value, dict): + return value + return dataclasses.asdict(value) + class mapDashboardInstanceCallbacksGetOutput: @staticmethod def from_dict(data: Dict[str, Any]) -> DashboardInstanceCallbacksGetOutput: @@ -61,6 +91,8 @@ def from_dict(data: Dict[str, Any]) -> DashboardInstanceCallbacksGetOutput: integration_id=data.get('integration_id'), integration_provider_id=data.get('integration_provider_id'), provider=mapDashboardInstanceCallbacksGetOutputProvider.from_dict(data.get('provider')) if data.get('provider') else None, + trigger_group_selections=data.get('trigger_group_selections'), + trigger_groups=[mapDashboardInstanceCallbacksGetOutputTriggerGroups.from_dict(item) for item in data.get('trigger_groups', []) if item], created_at=datetime.fromisoformat(data.get('created_at').replace('Z', '+00:00')) if data.get('created_at') else None, updated_at=datetime.fromisoformat(data.get('updated_at').replace('Z', '+00:00')) if data.get('updated_at') else None ) diff --git a/src/metorial/_generated/magnetar/resources/dashboard/instance/callbacks/list.py b/src/metorial/_generated/magnetar/resources/dashboard/instance/callbacks/list.py index 8f520c5e..8653d4a8 100644 --- a/src/metorial/_generated/magnetar/resources/dashboard/instance/callbacks/list.py +++ b/src/metorial/_generated/magnetar/resources/dashboard/instance/callbacks/list.py @@ -13,6 +13,14 @@ class DashboardInstanceCallbacksListOutputItemsProvider: updated_at: datetime description: Optional[str] = None @dataclass +class DashboardInstanceCallbacksListOutputItemsTriggerGroups: + object: str + key: str + name: str + selection_schema: Dict[str, Any] + status: str + description: Optional[str] = None +@dataclass class DashboardInstanceCallbacksListOutputItems: object: str id: str @@ -21,10 +29,12 @@ class DashboardInstanceCallbacksListOutputItems: integration_id: str integration_provider_id: str provider: DashboardInstanceCallbacksListOutputItemsProvider + trigger_groups: List[DashboardInstanceCallbacksListOutputItemsTriggerGroups] created_at: datetime updated_at: datetime description: Optional[str] = None metadata: Optional[Dict[str, Any]] = None + trigger_group_selections: Optional[Dict[str, Dict[str, Any]]] = None @dataclass class DashboardInstanceCallbacksListOutputPagination: has_more_before: bool @@ -56,6 +66,26 @@ def to_dict(value: Union[DashboardInstanceCallbacksListOutputItemsProvider, Dict return value return dataclasses.asdict(value) +class mapDashboardInstanceCallbacksListOutputItemsTriggerGroups: + @staticmethod + def from_dict(data: Dict[str, Any]) -> DashboardInstanceCallbacksListOutputItemsTriggerGroups: + return DashboardInstanceCallbacksListOutputItemsTriggerGroups( + object=data.get('object'), + key=data.get('key'), + name=data.get('name'), + description=data.get('description'), + selection_schema=data.get('selection_schema'), + status=data.get('status') + ) + + @staticmethod + def to_dict(value: Union[DashboardInstanceCallbacksListOutputItemsTriggerGroups, Dict[str, Any], None]) -> Optional[Dict[str, Any]]: + if value is None: + return None + if isinstance(value, dict): + return value + return dataclasses.asdict(value) + class mapDashboardInstanceCallbacksListOutputItems: @staticmethod def from_dict(data: Dict[str, Any]) -> DashboardInstanceCallbacksListOutputItems: @@ -69,6 +99,8 @@ def from_dict(data: Dict[str, Any]) -> DashboardInstanceCallbacksListOutputItems integration_id=data.get('integration_id'), integration_provider_id=data.get('integration_provider_id'), provider=mapDashboardInstanceCallbacksListOutputItemsProvider.from_dict(data.get('provider')) if data.get('provider') else None, + trigger_group_selections=data.get('trigger_group_selections'), + trigger_groups=[mapDashboardInstanceCallbacksListOutputItemsTriggerGroups.from_dict(item) for item in data.get('trigger_groups', []) if item], created_at=datetime.fromisoformat(data.get('created_at').replace('Z', '+00:00')) if data.get('created_at') else None, updated_at=datetime.fromisoformat(data.get('updated_at').replace('Z', '+00:00')) if data.get('updated_at') else None ) diff --git a/src/metorial/_generated/magnetar/resources/dashboard/instance/callbacks/update.py b/src/metorial/_generated/magnetar/resources/dashboard/instance/callbacks/update.py index 6f2effe5..0b7e4a9c 100644 --- a/src/metorial/_generated/magnetar/resources/dashboard/instance/callbacks/update.py +++ b/src/metorial/_generated/magnetar/resources/dashboard/instance/callbacks/update.py @@ -13,6 +13,14 @@ class DashboardInstanceCallbacksUpdateOutputProvider: updated_at: datetime description: Optional[str] = None @dataclass +class DashboardInstanceCallbacksUpdateOutputTriggerGroups: + object: str + key: str + name: str + selection_schema: Dict[str, Any] + status: str + description: Optional[str] = None +@dataclass class DashboardInstanceCallbacksUpdateOutput: object: str id: str @@ -21,10 +29,12 @@ class DashboardInstanceCallbacksUpdateOutput: integration_id: str integration_provider_id: str provider: DashboardInstanceCallbacksUpdateOutputProvider + trigger_groups: List[DashboardInstanceCallbacksUpdateOutputTriggerGroups] created_at: datetime updated_at: datetime description: Optional[str] = None metadata: Optional[Dict[str, Any]] = None + trigger_group_selections: Optional[Dict[str, Dict[str, Any]]] = None class mapDashboardInstanceCallbacksUpdateOutputProvider: @@ -48,6 +58,26 @@ def to_dict(value: Union[DashboardInstanceCallbacksUpdateOutputProvider, Dict[st return value return dataclasses.asdict(value) +class mapDashboardInstanceCallbacksUpdateOutputTriggerGroups: + @staticmethod + def from_dict(data: Dict[str, Any]) -> DashboardInstanceCallbacksUpdateOutputTriggerGroups: + return DashboardInstanceCallbacksUpdateOutputTriggerGroups( + object=data.get('object'), + key=data.get('key'), + name=data.get('name'), + description=data.get('description'), + selection_schema=data.get('selection_schema'), + status=data.get('status') + ) + + @staticmethod + def to_dict(value: Union[DashboardInstanceCallbacksUpdateOutputTriggerGroups, Dict[str, Any], None]) -> Optional[Dict[str, Any]]: + if value is None: + return None + if isinstance(value, dict): + return value + return dataclasses.asdict(value) + class mapDashboardInstanceCallbacksUpdateOutput: @staticmethod def from_dict(data: Dict[str, Any]) -> DashboardInstanceCallbacksUpdateOutput: @@ -61,6 +91,8 @@ def from_dict(data: Dict[str, Any]) -> DashboardInstanceCallbacksUpdateOutput: integration_id=data.get('integration_id'), integration_provider_id=data.get('integration_provider_id'), provider=mapDashboardInstanceCallbacksUpdateOutputProvider.from_dict(data.get('provider')) if data.get('provider') else None, + trigger_group_selections=data.get('trigger_group_selections'), + trigger_groups=[mapDashboardInstanceCallbacksUpdateOutputTriggerGroups.from_dict(item) for item in data.get('trigger_groups', []) if item], created_at=datetime.fromisoformat(data.get('created_at').replace('Z', '+00:00')) if data.get('created_at') else None, updated_at=datetime.fromisoformat(data.get('updated_at').replace('Z', '+00:00')) if data.get('updated_at') else None ) @@ -79,6 +111,7 @@ class DashboardInstanceCallbacksUpdateBody: name: Optional[str] = None description: Optional[str] = None metadata: Optional[Dict[str, Any]] = None + trigger_group_selections: Optional[Dict[str, Dict[str, Any]]] = None class mapDashboardInstanceCallbacksUpdateBody: @@ -87,7 +120,8 @@ def from_dict(data: Dict[str, Any]) -> DashboardInstanceCallbacksUpdateBody: return DashboardInstanceCallbacksUpdateBody( name=data.get('name'), description=data.get('description'), - metadata=data.get('metadata') + metadata=data.get('metadata'), + trigger_group_selections=data.get('trigger_group_selections') ) @staticmethod diff --git a/src/metorial/_generated/magnetar/resources/dashboard/instance/consumers/__init__.py b/src/metorial/_generated/magnetar/resources/dashboard/instance/consumers/__init__.py index 16e3415d..5d55e3f7 100644 --- a/src/metorial/_generated/magnetar/resources/dashboard/instance/consumers/__init__.py +++ b/src/metorial/_generated/magnetar/resources/dashboard/instance/consumers/__init__.py @@ -1,4 +1,6 @@ from .create import * +from .create_member_session import * +from .devices import * from .get import * from .get_member_consumer import * from .list import * diff --git a/src/metorial/_generated/magnetar/resources/dashboard/instance/consumers/create_member_session.py b/src/metorial/_generated/magnetar/resources/dashboard/instance/consumers/create_member_session.py new file mode 100644 index 00000000..3938ca66 --- /dev/null +++ b/src/metorial/_generated/magnetar/resources/dashboard/instance/consumers/create_member_session.py @@ -0,0 +1,49 @@ +from dataclasses import dataclass +from typing import Any, Dict, List, Optional, Union +from datetime import datetime +import dataclasses + +@dataclass +class DashboardInstanceConsumersCreateMemberSessionOutput: + access_token: str + catalog_item_id: Optional[str] = None + + +class mapDashboardInstanceConsumersCreateMemberSessionOutput: + @staticmethod + def from_dict(data: Dict[str, Any]) -> DashboardInstanceConsumersCreateMemberSessionOutput: + return DashboardInstanceConsumersCreateMemberSessionOutput( + access_token=data.get('access_token'), + catalog_item_id=data.get('catalog_item_id') + ) + + @staticmethod + def to_dict(value: Union[DashboardInstanceConsumersCreateMemberSessionOutput, Dict[str, Any], None]) -> Optional[Dict[str, Any]]: + if value is None: + return None + if isinstance(value, dict): + return value + # assume dataclass for generated models + return dataclasses.asdict(value) + +@dataclass +class DashboardInstanceConsumersCreateMemberSessionBody: + integration_id: Optional[str] = None + + +class mapDashboardInstanceConsumersCreateMemberSessionBody: + @staticmethod + def from_dict(data: Dict[str, Any]) -> DashboardInstanceConsumersCreateMemberSessionBody: + return DashboardInstanceConsumersCreateMemberSessionBody( + integration_id=data.get('integration_id') + ) + + @staticmethod + def to_dict(value: Union[DashboardInstanceConsumersCreateMemberSessionBody, Dict[str, Any], None]) -> Optional[Dict[str, Any]]: + if value is None: + return None + if isinstance(value, dict): + return value + # assume dataclass for generated models + return dataclasses.asdict(value) + diff --git a/src/metorial/_generated/magnetar/resources/dashboard/instance/consumers/devices/__init__.py b/src/metorial/_generated/magnetar/resources/dashboard/instance/consumers/devices/__init__.py new file mode 100644 index 00000000..d0873f42 --- /dev/null +++ b/src/metorial/_generated/magnetar/resources/dashboard/instance/consumers/devices/__init__.py @@ -0,0 +1,3 @@ +from .get import * +from .list import * +from .revoke import * \ No newline at end of file diff --git a/src/metorial/_generated/magnetar/resources/dashboard/instance/consumers/devices/get.py b/src/metorial/_generated/magnetar/resources/dashboard/instance/consumers/devices/get.py new file mode 100644 index 00000000..3a1ecbec --- /dev/null +++ b/src/metorial/_generated/magnetar/resources/dashboard/instance/consumers/devices/get.py @@ -0,0 +1,84 @@ +from dataclasses import dataclass +from typing import Any, Dict, List, Optional, Union +from datetime import datetime +import dataclasses + +@dataclass +class DashboardInstanceConsumersDevicesGetOutputClients: + object: str + key: str + name: str + detected: bool + installable: bool + supports_skills: bool + enabled: bool + excluded_magic_mcp_server_ids: List[str] + excluded_skill_ids: List[str] +@dataclass +class DashboardInstanceConsumersDevicesGetOutput: + object: str + id: str + status: str + consumer_profile_id: str + name: str + os: str + arch: str + app_version: str + clients: List[DashboardInstanceConsumersDevicesGetOutputClients] + last_seen_at: datetime + created_at: datetime + updated_at: datetime + revoked_at: Optional[datetime] = None + + +class mapDashboardInstanceConsumersDevicesGetOutputClients: + @staticmethod + def from_dict(data: Dict[str, Any]) -> DashboardInstanceConsumersDevicesGetOutputClients: + return DashboardInstanceConsumersDevicesGetOutputClients( + object=data.get('object'), + key=data.get('key'), + name=data.get('name'), + detected=data.get('detected'), + installable=data.get('installable'), + supports_skills=data.get('supports_skills'), + enabled=data.get('enabled'), + excluded_magic_mcp_server_ids=data.get('excluded_magic_mcp_server_ids', []), + excluded_skill_ids=data.get('excluded_skill_ids', []) + ) + + @staticmethod + def to_dict(value: Union[DashboardInstanceConsumersDevicesGetOutputClients, Dict[str, Any], None]) -> Optional[Dict[str, Any]]: + if value is None: + return None + if isinstance(value, dict): + return value + return dataclasses.asdict(value) + +class mapDashboardInstanceConsumersDevicesGetOutput: + @staticmethod + def from_dict(data: Dict[str, Any]) -> DashboardInstanceConsumersDevicesGetOutput: + return DashboardInstanceConsumersDevicesGetOutput( + object=data.get('object'), + id=data.get('id'), + status=data.get('status'), + consumer_profile_id=data.get('consumer_profile_id'), + name=data.get('name'), + os=data.get('os'), + arch=data.get('arch'), + app_version=data.get('app_version'), + clients=[mapDashboardInstanceConsumersDevicesGetOutputClients.from_dict(item) for item in data.get('clients', []) if item], + last_seen_at=datetime.fromisoformat(data.get('last_seen_at').replace('Z', '+00:00')) if data.get('last_seen_at') else None, + revoked_at=datetime.fromisoformat(data.get('revoked_at').replace('Z', '+00:00')) if data.get('revoked_at') else None, + created_at=datetime.fromisoformat(data.get('created_at').replace('Z', '+00:00')) if data.get('created_at') else None, + updated_at=datetime.fromisoformat(data.get('updated_at').replace('Z', '+00:00')) if data.get('updated_at') else None + ) + + @staticmethod + def to_dict(value: Union[DashboardInstanceConsumersDevicesGetOutput, Dict[str, Any], None]) -> Optional[Dict[str, Any]]: + if value is None: + return None + if isinstance(value, dict): + return value + # assume dataclass for generated models + return dataclasses.asdict(value) + diff --git a/src/metorial/_generated/magnetar/resources/dashboard/instance/consumers/devices/list.py b/src/metorial/_generated/magnetar/resources/dashboard/instance/consumers/devices/list.py new file mode 100644 index 00000000..8adda408 --- /dev/null +++ b/src/metorial/_generated/magnetar/resources/dashboard/instance/consumers/devices/list.py @@ -0,0 +1,159 @@ +from dataclasses import dataclass +from typing import Any, Dict, List, Optional, Union +from datetime import datetime +import dataclasses + +@dataclass +class DashboardInstanceConsumersDevicesListOutputItemsClients: + object: str + key: str + name: str + detected: bool + installable: bool + supports_skills: bool + enabled: bool + excluded_magic_mcp_server_ids: List[str] + excluded_skill_ids: List[str] +@dataclass +class DashboardInstanceConsumersDevicesListOutputItems: + object: str + id: str + status: str + consumer_profile_id: str + name: str + os: str + arch: str + app_version: str + clients: List[DashboardInstanceConsumersDevicesListOutputItemsClients] + last_seen_at: datetime + created_at: datetime + updated_at: datetime + revoked_at: Optional[datetime] = None +@dataclass +class DashboardInstanceConsumersDevicesListOutputPagination: + has_more_before: bool + has_more_after: bool +@dataclass +class DashboardInstanceConsumersDevicesListOutput: + items: List[DashboardInstanceConsumersDevicesListOutputItems] + pagination: DashboardInstanceConsumersDevicesListOutputPagination + + +class mapDashboardInstanceConsumersDevicesListOutputItemsClients: + @staticmethod + def from_dict(data: Dict[str, Any]) -> DashboardInstanceConsumersDevicesListOutputItemsClients: + return DashboardInstanceConsumersDevicesListOutputItemsClients( + object=data.get('object'), + key=data.get('key'), + name=data.get('name'), + detected=data.get('detected'), + installable=data.get('installable'), + supports_skills=data.get('supports_skills'), + enabled=data.get('enabled'), + excluded_magic_mcp_server_ids=data.get('excluded_magic_mcp_server_ids', []), + excluded_skill_ids=data.get('excluded_skill_ids', []) + ) + + @staticmethod + def to_dict(value: Union[DashboardInstanceConsumersDevicesListOutputItemsClients, Dict[str, Any], None]) -> Optional[Dict[str, Any]]: + if value is None: + return None + if isinstance(value, dict): + return value + return dataclasses.asdict(value) + +class mapDashboardInstanceConsumersDevicesListOutputItems: + @staticmethod + def from_dict(data: Dict[str, Any]) -> DashboardInstanceConsumersDevicesListOutputItems: + return DashboardInstanceConsumersDevicesListOutputItems( + object=data.get('object'), + id=data.get('id'), + status=data.get('status'), + consumer_profile_id=data.get('consumer_profile_id'), + name=data.get('name'), + os=data.get('os'), + arch=data.get('arch'), + app_version=data.get('app_version'), + clients=[mapDashboardInstanceConsumersDevicesListOutputItemsClients.from_dict(item) for item in data.get('clients', []) if item], + last_seen_at=datetime.fromisoformat(data.get('last_seen_at').replace('Z', '+00:00')) if data.get('last_seen_at') else None, + revoked_at=datetime.fromisoformat(data.get('revoked_at').replace('Z', '+00:00')) if data.get('revoked_at') else None, + created_at=datetime.fromisoformat(data.get('created_at').replace('Z', '+00:00')) if data.get('created_at') else None, + updated_at=datetime.fromisoformat(data.get('updated_at').replace('Z', '+00:00')) if data.get('updated_at') else None + ) + + @staticmethod + def to_dict(value: Union[DashboardInstanceConsumersDevicesListOutputItems, Dict[str, Any], None]) -> Optional[Dict[str, Any]]: + if value is None: + return None + if isinstance(value, dict): + return value + return dataclasses.asdict(value) + +class mapDashboardInstanceConsumersDevicesListOutputPagination: + @staticmethod + def from_dict(data: Dict[str, Any]) -> DashboardInstanceConsumersDevicesListOutputPagination: + return DashboardInstanceConsumersDevicesListOutputPagination( + has_more_before=data.get('has_more_before'), + has_more_after=data.get('has_more_after') + ) + + @staticmethod + def to_dict(value: Union[DashboardInstanceConsumersDevicesListOutputPagination, Dict[str, Any], None]) -> Optional[Dict[str, Any]]: + if value is None: + return None + if isinstance(value, dict): + return value + return dataclasses.asdict(value) + +class mapDashboardInstanceConsumersDevicesListOutput: + @staticmethod + def from_dict(data: Dict[str, Any]) -> DashboardInstanceConsumersDevicesListOutput: + return DashboardInstanceConsumersDevicesListOutput( + items=[mapDashboardInstanceConsumersDevicesListOutputItems.from_dict(item) for item in data.get('items', []) if item], + pagination=mapDashboardInstanceConsumersDevicesListOutputPagination.from_dict(data.get('pagination')) if data.get('pagination') else None + ) + + @staticmethod + def to_dict(value: Union[DashboardInstanceConsumersDevicesListOutput, Dict[str, Any], None]) -> Optional[Dict[str, Any]]: + if value is None: + return None + if isinstance(value, dict): + return value + # assume dataclass for generated models + return dataclasses.asdict(value) + +@dataclass +class DashboardInstanceConsumersDevicesListQuery: + limit: Optional[float] = None + after: Optional[str] = None + before: Optional[str] = None + cursor: Optional[str] = None + order: Optional[str] = None + consumer_profile_id: Optional[Union[str, List[str]]] = None + consumer_id: Optional[Union[str, List[str]]] = None + status: Optional[Union[str, List[str]]] = None + + +class mapDashboardInstanceConsumersDevicesListQuery: + @staticmethod + def from_dict(data: Dict[str, Any]) -> DashboardInstanceConsumersDevicesListQuery: + return DashboardInstanceConsumersDevicesListQuery( + limit=data.get('limit'), + after=data.get('after'), + before=data.get('before'), + cursor=data.get('cursor'), + order=data.get('order'), + consumer_profile_id=data.get('consumer_profile_id'), + consumer_id=data.get('consumer_id'), + status=data.get('status') + ) + + @staticmethod + def to_dict(value: Union[DashboardInstanceConsumersDevicesListQuery, Dict[str, Any], None]) -> Optional[Dict[str, Any]]: + if value is None: + return None + if isinstance(value, dict): + return value + # assume dataclass for generated models + return dataclasses.asdict(value) + diff --git a/src/metorial/_generated/magnetar/resources/dashboard/instance/consumers/devices/revoke.py b/src/metorial/_generated/magnetar/resources/dashboard/instance/consumers/devices/revoke.py new file mode 100644 index 00000000..f428966e --- /dev/null +++ b/src/metorial/_generated/magnetar/resources/dashboard/instance/consumers/devices/revoke.py @@ -0,0 +1,84 @@ +from dataclasses import dataclass +from typing import Any, Dict, List, Optional, Union +from datetime import datetime +import dataclasses + +@dataclass +class DashboardInstanceConsumersDevicesRevokeOutputClients: + object: str + key: str + name: str + detected: bool + installable: bool + supports_skills: bool + enabled: bool + excluded_magic_mcp_server_ids: List[str] + excluded_skill_ids: List[str] +@dataclass +class DashboardInstanceConsumersDevicesRevokeOutput: + object: str + id: str + status: str + consumer_profile_id: str + name: str + os: str + arch: str + app_version: str + clients: List[DashboardInstanceConsumersDevicesRevokeOutputClients] + last_seen_at: datetime + created_at: datetime + updated_at: datetime + revoked_at: Optional[datetime] = None + + +class mapDashboardInstanceConsumersDevicesRevokeOutputClients: + @staticmethod + def from_dict(data: Dict[str, Any]) -> DashboardInstanceConsumersDevicesRevokeOutputClients: + return DashboardInstanceConsumersDevicesRevokeOutputClients( + object=data.get('object'), + key=data.get('key'), + name=data.get('name'), + detected=data.get('detected'), + installable=data.get('installable'), + supports_skills=data.get('supports_skills'), + enabled=data.get('enabled'), + excluded_magic_mcp_server_ids=data.get('excluded_magic_mcp_server_ids', []), + excluded_skill_ids=data.get('excluded_skill_ids', []) + ) + + @staticmethod + def to_dict(value: Union[DashboardInstanceConsumersDevicesRevokeOutputClients, Dict[str, Any], None]) -> Optional[Dict[str, Any]]: + if value is None: + return None + if isinstance(value, dict): + return value + return dataclasses.asdict(value) + +class mapDashboardInstanceConsumersDevicesRevokeOutput: + @staticmethod + def from_dict(data: Dict[str, Any]) -> DashboardInstanceConsumersDevicesRevokeOutput: + return DashboardInstanceConsumersDevicesRevokeOutput( + object=data.get('object'), + id=data.get('id'), + status=data.get('status'), + consumer_profile_id=data.get('consumer_profile_id'), + name=data.get('name'), + os=data.get('os'), + arch=data.get('arch'), + app_version=data.get('app_version'), + clients=[mapDashboardInstanceConsumersDevicesRevokeOutputClients.from_dict(item) for item in data.get('clients', []) if item], + last_seen_at=datetime.fromisoformat(data.get('last_seen_at').replace('Z', '+00:00')) if data.get('last_seen_at') else None, + revoked_at=datetime.fromisoformat(data.get('revoked_at').replace('Z', '+00:00')) if data.get('revoked_at') else None, + created_at=datetime.fromisoformat(data.get('created_at').replace('Z', '+00:00')) if data.get('created_at') else None, + updated_at=datetime.fromisoformat(data.get('updated_at').replace('Z', '+00:00')) if data.get('updated_at') else None + ) + + @staticmethod + def to_dict(value: Union[DashboardInstanceConsumersDevicesRevokeOutput, Dict[str, Any], None]) -> Optional[Dict[str, Any]]: + if value is None: + return None + if isinstance(value, dict): + return value + # assume dataclass for generated models + return dataclasses.asdict(value) + diff --git a/src/metorial/_generated/magnetar/resources/management/instance/callbacks/create.py b/src/metorial/_generated/magnetar/resources/management/instance/callbacks/create.py index aaf1fe2c..90d4b553 100644 --- a/src/metorial/_generated/magnetar/resources/management/instance/callbacks/create.py +++ b/src/metorial/_generated/magnetar/resources/management/instance/callbacks/create.py @@ -13,6 +13,14 @@ class ManagementInstanceCallbacksCreateOutputProvider: updated_at: datetime description: Optional[str] = None @dataclass +class ManagementInstanceCallbacksCreateOutputTriggerGroups: + object: str + key: str + name: str + selection_schema: Dict[str, Any] + status: str + description: Optional[str] = None +@dataclass class ManagementInstanceCallbacksCreateOutput: object: str id: str @@ -21,10 +29,12 @@ class ManagementInstanceCallbacksCreateOutput: integration_id: str integration_provider_id: str provider: ManagementInstanceCallbacksCreateOutputProvider + trigger_groups: List[ManagementInstanceCallbacksCreateOutputTriggerGroups] created_at: datetime updated_at: datetime description: Optional[str] = None metadata: Optional[Dict[str, Any]] = None + trigger_group_selections: Optional[Dict[str, Dict[str, Any]]] = None class mapManagementInstanceCallbacksCreateOutputProvider: @@ -48,6 +58,26 @@ def to_dict(value: Union[ManagementInstanceCallbacksCreateOutputProvider, Dict[s return value return dataclasses.asdict(value) +class mapManagementInstanceCallbacksCreateOutputTriggerGroups: + @staticmethod + def from_dict(data: Dict[str, Any]) -> ManagementInstanceCallbacksCreateOutputTriggerGroups: + return ManagementInstanceCallbacksCreateOutputTriggerGroups( + object=data.get('object'), + key=data.get('key'), + name=data.get('name'), + description=data.get('description'), + selection_schema=data.get('selection_schema'), + status=data.get('status') + ) + + @staticmethod + def to_dict(value: Union[ManagementInstanceCallbacksCreateOutputTriggerGroups, Dict[str, Any], None]) -> Optional[Dict[str, Any]]: + if value is None: + return None + if isinstance(value, dict): + return value + return dataclasses.asdict(value) + class mapManagementInstanceCallbacksCreateOutput: @staticmethod def from_dict(data: Dict[str, Any]) -> ManagementInstanceCallbacksCreateOutput: @@ -61,6 +91,8 @@ def from_dict(data: Dict[str, Any]) -> ManagementInstanceCallbacksCreateOutput: integration_id=data.get('integration_id'), integration_provider_id=data.get('integration_provider_id'), provider=mapManagementInstanceCallbacksCreateOutputProvider.from_dict(data.get('provider')) if data.get('provider') else None, + trigger_group_selections=data.get('trigger_group_selections'), + trigger_groups=[mapManagementInstanceCallbacksCreateOutputTriggerGroups.from_dict(item) for item in data.get('trigger_groups', []) if item], created_at=datetime.fromisoformat(data.get('created_at').replace('Z', '+00:00')) if data.get('created_at') else None, updated_at=datetime.fromisoformat(data.get('updated_at').replace('Z', '+00:00')) if data.get('updated_at') else None ) @@ -80,6 +112,7 @@ class ManagementInstanceCallbacksCreateBody: integration_provider_id: str name: Optional[str] = None description: Optional[str] = None + trigger_group_selections: Optional[Dict[str, Dict[str, Any]]] = None class mapManagementInstanceCallbacksCreateBody: @@ -89,7 +122,8 @@ def from_dict(data: Dict[str, Any]) -> ManagementInstanceCallbacksCreateBody: integration_id=data.get('integration_id'), integration_provider_id=data.get('integration_provider_id'), name=data.get('name'), - description=data.get('description') + description=data.get('description'), + trigger_group_selections=data.get('trigger_group_selections') ) @staticmethod diff --git a/src/metorial/_generated/magnetar/resources/management/instance/callbacks/delete.py b/src/metorial/_generated/magnetar/resources/management/instance/callbacks/delete.py index c4b24812..62dcfa39 100644 --- a/src/metorial/_generated/magnetar/resources/management/instance/callbacks/delete.py +++ b/src/metorial/_generated/magnetar/resources/management/instance/callbacks/delete.py @@ -13,6 +13,14 @@ class ManagementInstanceCallbacksDeleteOutputProvider: updated_at: datetime description: Optional[str] = None @dataclass +class ManagementInstanceCallbacksDeleteOutputTriggerGroups: + object: str + key: str + name: str + selection_schema: Dict[str, Any] + status: str + description: Optional[str] = None +@dataclass class ManagementInstanceCallbacksDeleteOutput: object: str id: str @@ -21,10 +29,12 @@ class ManagementInstanceCallbacksDeleteOutput: integration_id: str integration_provider_id: str provider: ManagementInstanceCallbacksDeleteOutputProvider + trigger_groups: List[ManagementInstanceCallbacksDeleteOutputTriggerGroups] created_at: datetime updated_at: datetime description: Optional[str] = None metadata: Optional[Dict[str, Any]] = None + trigger_group_selections: Optional[Dict[str, Dict[str, Any]]] = None class mapManagementInstanceCallbacksDeleteOutputProvider: @@ -48,6 +58,26 @@ def to_dict(value: Union[ManagementInstanceCallbacksDeleteOutputProvider, Dict[s return value return dataclasses.asdict(value) +class mapManagementInstanceCallbacksDeleteOutputTriggerGroups: + @staticmethod + def from_dict(data: Dict[str, Any]) -> ManagementInstanceCallbacksDeleteOutputTriggerGroups: + return ManagementInstanceCallbacksDeleteOutputTriggerGroups( + object=data.get('object'), + key=data.get('key'), + name=data.get('name'), + description=data.get('description'), + selection_schema=data.get('selection_schema'), + status=data.get('status') + ) + + @staticmethod + def to_dict(value: Union[ManagementInstanceCallbacksDeleteOutputTriggerGroups, Dict[str, Any], None]) -> Optional[Dict[str, Any]]: + if value is None: + return None + if isinstance(value, dict): + return value + return dataclasses.asdict(value) + class mapManagementInstanceCallbacksDeleteOutput: @staticmethod def from_dict(data: Dict[str, Any]) -> ManagementInstanceCallbacksDeleteOutput: @@ -61,6 +91,8 @@ def from_dict(data: Dict[str, Any]) -> ManagementInstanceCallbacksDeleteOutput: integration_id=data.get('integration_id'), integration_provider_id=data.get('integration_provider_id'), provider=mapManagementInstanceCallbacksDeleteOutputProvider.from_dict(data.get('provider')) if data.get('provider') else None, + trigger_group_selections=data.get('trigger_group_selections'), + trigger_groups=[mapManagementInstanceCallbacksDeleteOutputTriggerGroups.from_dict(item) for item in data.get('trigger_groups', []) if item], created_at=datetime.fromisoformat(data.get('created_at').replace('Z', '+00:00')) if data.get('created_at') else None, updated_at=datetime.fromisoformat(data.get('updated_at').replace('Z', '+00:00')) if data.get('updated_at') else None ) diff --git a/src/metorial/_generated/magnetar/resources/management/instance/callbacks/get.py b/src/metorial/_generated/magnetar/resources/management/instance/callbacks/get.py index 9979cd61..96b3f009 100644 --- a/src/metorial/_generated/magnetar/resources/management/instance/callbacks/get.py +++ b/src/metorial/_generated/magnetar/resources/management/instance/callbacks/get.py @@ -13,6 +13,14 @@ class ManagementInstanceCallbacksGetOutputProvider: updated_at: datetime description: Optional[str] = None @dataclass +class ManagementInstanceCallbacksGetOutputTriggerGroups: + object: str + key: str + name: str + selection_schema: Dict[str, Any] + status: str + description: Optional[str] = None +@dataclass class ManagementInstanceCallbacksGetOutput: object: str id: str @@ -21,10 +29,12 @@ class ManagementInstanceCallbacksGetOutput: integration_id: str integration_provider_id: str provider: ManagementInstanceCallbacksGetOutputProvider + trigger_groups: List[ManagementInstanceCallbacksGetOutputTriggerGroups] created_at: datetime updated_at: datetime description: Optional[str] = None metadata: Optional[Dict[str, Any]] = None + trigger_group_selections: Optional[Dict[str, Dict[str, Any]]] = None class mapManagementInstanceCallbacksGetOutputProvider: @@ -48,6 +58,26 @@ def to_dict(value: Union[ManagementInstanceCallbacksGetOutputProvider, Dict[str, return value return dataclasses.asdict(value) +class mapManagementInstanceCallbacksGetOutputTriggerGroups: + @staticmethod + def from_dict(data: Dict[str, Any]) -> ManagementInstanceCallbacksGetOutputTriggerGroups: + return ManagementInstanceCallbacksGetOutputTriggerGroups( + object=data.get('object'), + key=data.get('key'), + name=data.get('name'), + description=data.get('description'), + selection_schema=data.get('selection_schema'), + status=data.get('status') + ) + + @staticmethod + def to_dict(value: Union[ManagementInstanceCallbacksGetOutputTriggerGroups, Dict[str, Any], None]) -> Optional[Dict[str, Any]]: + if value is None: + return None + if isinstance(value, dict): + return value + return dataclasses.asdict(value) + class mapManagementInstanceCallbacksGetOutput: @staticmethod def from_dict(data: Dict[str, Any]) -> ManagementInstanceCallbacksGetOutput: @@ -61,6 +91,8 @@ def from_dict(data: Dict[str, Any]) -> ManagementInstanceCallbacksGetOutput: integration_id=data.get('integration_id'), integration_provider_id=data.get('integration_provider_id'), provider=mapManagementInstanceCallbacksGetOutputProvider.from_dict(data.get('provider')) if data.get('provider') else None, + trigger_group_selections=data.get('trigger_group_selections'), + trigger_groups=[mapManagementInstanceCallbacksGetOutputTriggerGroups.from_dict(item) for item in data.get('trigger_groups', []) if item], created_at=datetime.fromisoformat(data.get('created_at').replace('Z', '+00:00')) if data.get('created_at') else None, updated_at=datetime.fromisoformat(data.get('updated_at').replace('Z', '+00:00')) if data.get('updated_at') else None ) diff --git a/src/metorial/_generated/magnetar/resources/management/instance/callbacks/list.py b/src/metorial/_generated/magnetar/resources/management/instance/callbacks/list.py index 25029cdc..e273a2e1 100644 --- a/src/metorial/_generated/magnetar/resources/management/instance/callbacks/list.py +++ b/src/metorial/_generated/magnetar/resources/management/instance/callbacks/list.py @@ -13,6 +13,14 @@ class ManagementInstanceCallbacksListOutputItemsProvider: updated_at: datetime description: Optional[str] = None @dataclass +class ManagementInstanceCallbacksListOutputItemsTriggerGroups: + object: str + key: str + name: str + selection_schema: Dict[str, Any] + status: str + description: Optional[str] = None +@dataclass class ManagementInstanceCallbacksListOutputItems: object: str id: str @@ -21,10 +29,12 @@ class ManagementInstanceCallbacksListOutputItems: integration_id: str integration_provider_id: str provider: ManagementInstanceCallbacksListOutputItemsProvider + trigger_groups: List[ManagementInstanceCallbacksListOutputItemsTriggerGroups] created_at: datetime updated_at: datetime description: Optional[str] = None metadata: Optional[Dict[str, Any]] = None + trigger_group_selections: Optional[Dict[str, Dict[str, Any]]] = None @dataclass class ManagementInstanceCallbacksListOutputPagination: has_more_before: bool @@ -56,6 +66,26 @@ def to_dict(value: Union[ManagementInstanceCallbacksListOutputItemsProvider, Dic return value return dataclasses.asdict(value) +class mapManagementInstanceCallbacksListOutputItemsTriggerGroups: + @staticmethod + def from_dict(data: Dict[str, Any]) -> ManagementInstanceCallbacksListOutputItemsTriggerGroups: + return ManagementInstanceCallbacksListOutputItemsTriggerGroups( + object=data.get('object'), + key=data.get('key'), + name=data.get('name'), + description=data.get('description'), + selection_schema=data.get('selection_schema'), + status=data.get('status') + ) + + @staticmethod + def to_dict(value: Union[ManagementInstanceCallbacksListOutputItemsTriggerGroups, Dict[str, Any], None]) -> Optional[Dict[str, Any]]: + if value is None: + return None + if isinstance(value, dict): + return value + return dataclasses.asdict(value) + class mapManagementInstanceCallbacksListOutputItems: @staticmethod def from_dict(data: Dict[str, Any]) -> ManagementInstanceCallbacksListOutputItems: @@ -69,6 +99,8 @@ def from_dict(data: Dict[str, Any]) -> ManagementInstanceCallbacksListOutputItem integration_id=data.get('integration_id'), integration_provider_id=data.get('integration_provider_id'), provider=mapManagementInstanceCallbacksListOutputItemsProvider.from_dict(data.get('provider')) if data.get('provider') else None, + trigger_group_selections=data.get('trigger_group_selections'), + trigger_groups=[mapManagementInstanceCallbacksListOutputItemsTriggerGroups.from_dict(item) for item in data.get('trigger_groups', []) if item], created_at=datetime.fromisoformat(data.get('created_at').replace('Z', '+00:00')) if data.get('created_at') else None, updated_at=datetime.fromisoformat(data.get('updated_at').replace('Z', '+00:00')) if data.get('updated_at') else None ) diff --git a/src/metorial/_generated/magnetar/resources/management/instance/callbacks/update.py b/src/metorial/_generated/magnetar/resources/management/instance/callbacks/update.py index 85637027..fc7d7393 100644 --- a/src/metorial/_generated/magnetar/resources/management/instance/callbacks/update.py +++ b/src/metorial/_generated/magnetar/resources/management/instance/callbacks/update.py @@ -13,6 +13,14 @@ class ManagementInstanceCallbacksUpdateOutputProvider: updated_at: datetime description: Optional[str] = None @dataclass +class ManagementInstanceCallbacksUpdateOutputTriggerGroups: + object: str + key: str + name: str + selection_schema: Dict[str, Any] + status: str + description: Optional[str] = None +@dataclass class ManagementInstanceCallbacksUpdateOutput: object: str id: str @@ -21,10 +29,12 @@ class ManagementInstanceCallbacksUpdateOutput: integration_id: str integration_provider_id: str provider: ManagementInstanceCallbacksUpdateOutputProvider + trigger_groups: List[ManagementInstanceCallbacksUpdateOutputTriggerGroups] created_at: datetime updated_at: datetime description: Optional[str] = None metadata: Optional[Dict[str, Any]] = None + trigger_group_selections: Optional[Dict[str, Dict[str, Any]]] = None class mapManagementInstanceCallbacksUpdateOutputProvider: @@ -48,6 +58,26 @@ def to_dict(value: Union[ManagementInstanceCallbacksUpdateOutputProvider, Dict[s return value return dataclasses.asdict(value) +class mapManagementInstanceCallbacksUpdateOutputTriggerGroups: + @staticmethod + def from_dict(data: Dict[str, Any]) -> ManagementInstanceCallbacksUpdateOutputTriggerGroups: + return ManagementInstanceCallbacksUpdateOutputTriggerGroups( + object=data.get('object'), + key=data.get('key'), + name=data.get('name'), + description=data.get('description'), + selection_schema=data.get('selection_schema'), + status=data.get('status') + ) + + @staticmethod + def to_dict(value: Union[ManagementInstanceCallbacksUpdateOutputTriggerGroups, Dict[str, Any], None]) -> Optional[Dict[str, Any]]: + if value is None: + return None + if isinstance(value, dict): + return value + return dataclasses.asdict(value) + class mapManagementInstanceCallbacksUpdateOutput: @staticmethod def from_dict(data: Dict[str, Any]) -> ManagementInstanceCallbacksUpdateOutput: @@ -61,6 +91,8 @@ def from_dict(data: Dict[str, Any]) -> ManagementInstanceCallbacksUpdateOutput: integration_id=data.get('integration_id'), integration_provider_id=data.get('integration_provider_id'), provider=mapManagementInstanceCallbacksUpdateOutputProvider.from_dict(data.get('provider')) if data.get('provider') else None, + trigger_group_selections=data.get('trigger_group_selections'), + trigger_groups=[mapManagementInstanceCallbacksUpdateOutputTriggerGroups.from_dict(item) for item in data.get('trigger_groups', []) if item], created_at=datetime.fromisoformat(data.get('created_at').replace('Z', '+00:00')) if data.get('created_at') else None, updated_at=datetime.fromisoformat(data.get('updated_at').replace('Z', '+00:00')) if data.get('updated_at') else None ) @@ -79,6 +111,7 @@ class ManagementInstanceCallbacksUpdateBody: name: Optional[str] = None description: Optional[str] = None metadata: Optional[Dict[str, Any]] = None + trigger_group_selections: Optional[Dict[str, Dict[str, Any]]] = None class mapManagementInstanceCallbacksUpdateBody: @@ -87,7 +120,8 @@ def from_dict(data: Dict[str, Any]) -> ManagementInstanceCallbacksUpdateBody: return ManagementInstanceCallbacksUpdateBody( name=data.get('name'), description=data.get('description'), - metadata=data.get('metadata') + metadata=data.get('metadata'), + trigger_group_selections=data.get('trigger_group_selections') ) @staticmethod diff --git a/src/metorial/_generated/magnetar/resources/management/instance/consumers/__init__.py b/src/metorial/_generated/magnetar/resources/management/instance/consumers/__init__.py index 16e3415d..5d55e3f7 100644 --- a/src/metorial/_generated/magnetar/resources/management/instance/consumers/__init__.py +++ b/src/metorial/_generated/magnetar/resources/management/instance/consumers/__init__.py @@ -1,4 +1,6 @@ from .create import * +from .create_member_session import * +from .devices import * from .get import * from .get_member_consumer import * from .list import * diff --git a/src/metorial/_generated/magnetar/resources/management/instance/consumers/create_member_session.py b/src/metorial/_generated/magnetar/resources/management/instance/consumers/create_member_session.py new file mode 100644 index 00000000..d547b76e --- /dev/null +++ b/src/metorial/_generated/magnetar/resources/management/instance/consumers/create_member_session.py @@ -0,0 +1,49 @@ +from dataclasses import dataclass +from typing import Any, Dict, List, Optional, Union +from datetime import datetime +import dataclasses + +@dataclass +class ManagementInstanceConsumersCreateMemberSessionOutput: + access_token: str + catalog_item_id: Optional[str] = None + + +class mapManagementInstanceConsumersCreateMemberSessionOutput: + @staticmethod + def from_dict(data: Dict[str, Any]) -> ManagementInstanceConsumersCreateMemberSessionOutput: + return ManagementInstanceConsumersCreateMemberSessionOutput( + access_token=data.get('access_token'), + catalog_item_id=data.get('catalog_item_id') + ) + + @staticmethod + def to_dict(value: Union[ManagementInstanceConsumersCreateMemberSessionOutput, Dict[str, Any], None]) -> Optional[Dict[str, Any]]: + if value is None: + return None + if isinstance(value, dict): + return value + # assume dataclass for generated models + return dataclasses.asdict(value) + +@dataclass +class ManagementInstanceConsumersCreateMemberSessionBody: + integration_id: Optional[str] = None + + +class mapManagementInstanceConsumersCreateMemberSessionBody: + @staticmethod + def from_dict(data: Dict[str, Any]) -> ManagementInstanceConsumersCreateMemberSessionBody: + return ManagementInstanceConsumersCreateMemberSessionBody( + integration_id=data.get('integration_id') + ) + + @staticmethod + def to_dict(value: Union[ManagementInstanceConsumersCreateMemberSessionBody, Dict[str, Any], None]) -> Optional[Dict[str, Any]]: + if value is None: + return None + if isinstance(value, dict): + return value + # assume dataclass for generated models + return dataclasses.asdict(value) + diff --git a/src/metorial/_generated/magnetar/resources/management/instance/consumers/devices/__init__.py b/src/metorial/_generated/magnetar/resources/management/instance/consumers/devices/__init__.py new file mode 100644 index 00000000..d0873f42 --- /dev/null +++ b/src/metorial/_generated/magnetar/resources/management/instance/consumers/devices/__init__.py @@ -0,0 +1,3 @@ +from .get import * +from .list import * +from .revoke import * \ No newline at end of file diff --git a/src/metorial/_generated/magnetar/resources/management/instance/consumers/devices/get.py b/src/metorial/_generated/magnetar/resources/management/instance/consumers/devices/get.py new file mode 100644 index 00000000..2f6070cc --- /dev/null +++ b/src/metorial/_generated/magnetar/resources/management/instance/consumers/devices/get.py @@ -0,0 +1,84 @@ +from dataclasses import dataclass +from typing import Any, Dict, List, Optional, Union +from datetime import datetime +import dataclasses + +@dataclass +class ManagementInstanceConsumersDevicesGetOutputClients: + object: str + key: str + name: str + detected: bool + installable: bool + supports_skills: bool + enabled: bool + excluded_magic_mcp_server_ids: List[str] + excluded_skill_ids: List[str] +@dataclass +class ManagementInstanceConsumersDevicesGetOutput: + object: str + id: str + status: str + consumer_profile_id: str + name: str + os: str + arch: str + app_version: str + clients: List[ManagementInstanceConsumersDevicesGetOutputClients] + last_seen_at: datetime + created_at: datetime + updated_at: datetime + revoked_at: Optional[datetime] = None + + +class mapManagementInstanceConsumersDevicesGetOutputClients: + @staticmethod + def from_dict(data: Dict[str, Any]) -> ManagementInstanceConsumersDevicesGetOutputClients: + return ManagementInstanceConsumersDevicesGetOutputClients( + object=data.get('object'), + key=data.get('key'), + name=data.get('name'), + detected=data.get('detected'), + installable=data.get('installable'), + supports_skills=data.get('supports_skills'), + enabled=data.get('enabled'), + excluded_magic_mcp_server_ids=data.get('excluded_magic_mcp_server_ids', []), + excluded_skill_ids=data.get('excluded_skill_ids', []) + ) + + @staticmethod + def to_dict(value: Union[ManagementInstanceConsumersDevicesGetOutputClients, Dict[str, Any], None]) -> Optional[Dict[str, Any]]: + if value is None: + return None + if isinstance(value, dict): + return value + return dataclasses.asdict(value) + +class mapManagementInstanceConsumersDevicesGetOutput: + @staticmethod + def from_dict(data: Dict[str, Any]) -> ManagementInstanceConsumersDevicesGetOutput: + return ManagementInstanceConsumersDevicesGetOutput( + object=data.get('object'), + id=data.get('id'), + status=data.get('status'), + consumer_profile_id=data.get('consumer_profile_id'), + name=data.get('name'), + os=data.get('os'), + arch=data.get('arch'), + app_version=data.get('app_version'), + clients=[mapManagementInstanceConsumersDevicesGetOutputClients.from_dict(item) for item in data.get('clients', []) if item], + last_seen_at=datetime.fromisoformat(data.get('last_seen_at').replace('Z', '+00:00')) if data.get('last_seen_at') else None, + revoked_at=datetime.fromisoformat(data.get('revoked_at').replace('Z', '+00:00')) if data.get('revoked_at') else None, + created_at=datetime.fromisoformat(data.get('created_at').replace('Z', '+00:00')) if data.get('created_at') else None, + updated_at=datetime.fromisoformat(data.get('updated_at').replace('Z', '+00:00')) if data.get('updated_at') else None + ) + + @staticmethod + def to_dict(value: Union[ManagementInstanceConsumersDevicesGetOutput, Dict[str, Any], None]) -> Optional[Dict[str, Any]]: + if value is None: + return None + if isinstance(value, dict): + return value + # assume dataclass for generated models + return dataclasses.asdict(value) + diff --git a/src/metorial/_generated/magnetar/resources/management/instance/consumers/devices/list.py b/src/metorial/_generated/magnetar/resources/management/instance/consumers/devices/list.py new file mode 100644 index 00000000..1b8b9aa2 --- /dev/null +++ b/src/metorial/_generated/magnetar/resources/management/instance/consumers/devices/list.py @@ -0,0 +1,159 @@ +from dataclasses import dataclass +from typing import Any, Dict, List, Optional, Union +from datetime import datetime +import dataclasses + +@dataclass +class ManagementInstanceConsumersDevicesListOutputItemsClients: + object: str + key: str + name: str + detected: bool + installable: bool + supports_skills: bool + enabled: bool + excluded_magic_mcp_server_ids: List[str] + excluded_skill_ids: List[str] +@dataclass +class ManagementInstanceConsumersDevicesListOutputItems: + object: str + id: str + status: str + consumer_profile_id: str + name: str + os: str + arch: str + app_version: str + clients: List[ManagementInstanceConsumersDevicesListOutputItemsClients] + last_seen_at: datetime + created_at: datetime + updated_at: datetime + revoked_at: Optional[datetime] = None +@dataclass +class ManagementInstanceConsumersDevicesListOutputPagination: + has_more_before: bool + has_more_after: bool +@dataclass +class ManagementInstanceConsumersDevicesListOutput: + items: List[ManagementInstanceConsumersDevicesListOutputItems] + pagination: ManagementInstanceConsumersDevicesListOutputPagination + + +class mapManagementInstanceConsumersDevicesListOutputItemsClients: + @staticmethod + def from_dict(data: Dict[str, Any]) -> ManagementInstanceConsumersDevicesListOutputItemsClients: + return ManagementInstanceConsumersDevicesListOutputItemsClients( + object=data.get('object'), + key=data.get('key'), + name=data.get('name'), + detected=data.get('detected'), + installable=data.get('installable'), + supports_skills=data.get('supports_skills'), + enabled=data.get('enabled'), + excluded_magic_mcp_server_ids=data.get('excluded_magic_mcp_server_ids', []), + excluded_skill_ids=data.get('excluded_skill_ids', []) + ) + + @staticmethod + def to_dict(value: Union[ManagementInstanceConsumersDevicesListOutputItemsClients, Dict[str, Any], None]) -> Optional[Dict[str, Any]]: + if value is None: + return None + if isinstance(value, dict): + return value + return dataclasses.asdict(value) + +class mapManagementInstanceConsumersDevicesListOutputItems: + @staticmethod + def from_dict(data: Dict[str, Any]) -> ManagementInstanceConsumersDevicesListOutputItems: + return ManagementInstanceConsumersDevicesListOutputItems( + object=data.get('object'), + id=data.get('id'), + status=data.get('status'), + consumer_profile_id=data.get('consumer_profile_id'), + name=data.get('name'), + os=data.get('os'), + arch=data.get('arch'), + app_version=data.get('app_version'), + clients=[mapManagementInstanceConsumersDevicesListOutputItemsClients.from_dict(item) for item in data.get('clients', []) if item], + last_seen_at=datetime.fromisoformat(data.get('last_seen_at').replace('Z', '+00:00')) if data.get('last_seen_at') else None, + revoked_at=datetime.fromisoformat(data.get('revoked_at').replace('Z', '+00:00')) if data.get('revoked_at') else None, + created_at=datetime.fromisoformat(data.get('created_at').replace('Z', '+00:00')) if data.get('created_at') else None, + updated_at=datetime.fromisoformat(data.get('updated_at').replace('Z', '+00:00')) if data.get('updated_at') else None + ) + + @staticmethod + def to_dict(value: Union[ManagementInstanceConsumersDevicesListOutputItems, Dict[str, Any], None]) -> Optional[Dict[str, Any]]: + if value is None: + return None + if isinstance(value, dict): + return value + return dataclasses.asdict(value) + +class mapManagementInstanceConsumersDevicesListOutputPagination: + @staticmethod + def from_dict(data: Dict[str, Any]) -> ManagementInstanceConsumersDevicesListOutputPagination: + return ManagementInstanceConsumersDevicesListOutputPagination( + has_more_before=data.get('has_more_before'), + has_more_after=data.get('has_more_after') + ) + + @staticmethod + def to_dict(value: Union[ManagementInstanceConsumersDevicesListOutputPagination, Dict[str, Any], None]) -> Optional[Dict[str, Any]]: + if value is None: + return None + if isinstance(value, dict): + return value + return dataclasses.asdict(value) + +class mapManagementInstanceConsumersDevicesListOutput: + @staticmethod + def from_dict(data: Dict[str, Any]) -> ManagementInstanceConsumersDevicesListOutput: + return ManagementInstanceConsumersDevicesListOutput( + items=[mapManagementInstanceConsumersDevicesListOutputItems.from_dict(item) for item in data.get('items', []) if item], + pagination=mapManagementInstanceConsumersDevicesListOutputPagination.from_dict(data.get('pagination')) if data.get('pagination') else None + ) + + @staticmethod + def to_dict(value: Union[ManagementInstanceConsumersDevicesListOutput, Dict[str, Any], None]) -> Optional[Dict[str, Any]]: + if value is None: + return None + if isinstance(value, dict): + return value + # assume dataclass for generated models + return dataclasses.asdict(value) + +@dataclass +class ManagementInstanceConsumersDevicesListQuery: + limit: Optional[float] = None + after: Optional[str] = None + before: Optional[str] = None + cursor: Optional[str] = None + order: Optional[str] = None + consumer_profile_id: Optional[Union[str, List[str]]] = None + consumer_id: Optional[Union[str, List[str]]] = None + status: Optional[Union[str, List[str]]] = None + + +class mapManagementInstanceConsumersDevicesListQuery: + @staticmethod + def from_dict(data: Dict[str, Any]) -> ManagementInstanceConsumersDevicesListQuery: + return ManagementInstanceConsumersDevicesListQuery( + limit=data.get('limit'), + after=data.get('after'), + before=data.get('before'), + cursor=data.get('cursor'), + order=data.get('order'), + consumer_profile_id=data.get('consumer_profile_id'), + consumer_id=data.get('consumer_id'), + status=data.get('status') + ) + + @staticmethod + def to_dict(value: Union[ManagementInstanceConsumersDevicesListQuery, Dict[str, Any], None]) -> Optional[Dict[str, Any]]: + if value is None: + return None + if isinstance(value, dict): + return value + # assume dataclass for generated models + return dataclasses.asdict(value) + diff --git a/src/metorial/_generated/magnetar/resources/management/instance/consumers/devices/revoke.py b/src/metorial/_generated/magnetar/resources/management/instance/consumers/devices/revoke.py new file mode 100644 index 00000000..81197e6d --- /dev/null +++ b/src/metorial/_generated/magnetar/resources/management/instance/consumers/devices/revoke.py @@ -0,0 +1,84 @@ +from dataclasses import dataclass +from typing import Any, Dict, List, Optional, Union +from datetime import datetime +import dataclasses + +@dataclass +class ManagementInstanceConsumersDevicesRevokeOutputClients: + object: str + key: str + name: str + detected: bool + installable: bool + supports_skills: bool + enabled: bool + excluded_magic_mcp_server_ids: List[str] + excluded_skill_ids: List[str] +@dataclass +class ManagementInstanceConsumersDevicesRevokeOutput: + object: str + id: str + status: str + consumer_profile_id: str + name: str + os: str + arch: str + app_version: str + clients: List[ManagementInstanceConsumersDevicesRevokeOutputClients] + last_seen_at: datetime + created_at: datetime + updated_at: datetime + revoked_at: Optional[datetime] = None + + +class mapManagementInstanceConsumersDevicesRevokeOutputClients: + @staticmethod + def from_dict(data: Dict[str, Any]) -> ManagementInstanceConsumersDevicesRevokeOutputClients: + return ManagementInstanceConsumersDevicesRevokeOutputClients( + object=data.get('object'), + key=data.get('key'), + name=data.get('name'), + detected=data.get('detected'), + installable=data.get('installable'), + supports_skills=data.get('supports_skills'), + enabled=data.get('enabled'), + excluded_magic_mcp_server_ids=data.get('excluded_magic_mcp_server_ids', []), + excluded_skill_ids=data.get('excluded_skill_ids', []) + ) + + @staticmethod + def to_dict(value: Union[ManagementInstanceConsumersDevicesRevokeOutputClients, Dict[str, Any], None]) -> Optional[Dict[str, Any]]: + if value is None: + return None + if isinstance(value, dict): + return value + return dataclasses.asdict(value) + +class mapManagementInstanceConsumersDevicesRevokeOutput: + @staticmethod + def from_dict(data: Dict[str, Any]) -> ManagementInstanceConsumersDevicesRevokeOutput: + return ManagementInstanceConsumersDevicesRevokeOutput( + object=data.get('object'), + id=data.get('id'), + status=data.get('status'), + consumer_profile_id=data.get('consumer_profile_id'), + name=data.get('name'), + os=data.get('os'), + arch=data.get('arch'), + app_version=data.get('app_version'), + clients=[mapManagementInstanceConsumersDevicesRevokeOutputClients.from_dict(item) for item in data.get('clients', []) if item], + last_seen_at=datetime.fromisoformat(data.get('last_seen_at').replace('Z', '+00:00')) if data.get('last_seen_at') else None, + revoked_at=datetime.fromisoformat(data.get('revoked_at').replace('Z', '+00:00')) if data.get('revoked_at') else None, + created_at=datetime.fromisoformat(data.get('created_at').replace('Z', '+00:00')) if data.get('created_at') else None, + updated_at=datetime.fromisoformat(data.get('updated_at').replace('Z', '+00:00')) if data.get('updated_at') else None + ) + + @staticmethod + def to_dict(value: Union[ManagementInstanceConsumersDevicesRevokeOutput, Dict[str, Any], None]) -> Optional[Dict[str, Any]]: + if value is None: + return None + if isinstance(value, dict): + return value + # assume dataclass for generated models + return dataclasses.asdict(value) +