# Generated from soulfire/instance.proto. DO NOT EDIT.
# Generated by protoc-gen-connectrpc-py v0.13.0 with parameter "protobuf=google".
# ruff: noqa: PGH004
# ruff: noqa
# pyright: reportDeprecated=false
# ty: ignore[unused-ignore-comment]
# ty: ignore[deprecated, unused-ignore-comment]
# fmt: off
from __future__ import annotations
from typing import Protocol, TYPE_CHECKING
from connectrpc.client import ConnectClient, ConnectClientSync
from connectrpc.code import Code
from connectrpc.compat import google_protobuf_binary_codec, google_protobuf_codecs
from connectrpc.compression.gzip import GzipCompression
from connectrpc.errors import ConnectError
from connectrpc.method import IdempotencyLevel, MethodInfo, StreamType
from connectrpc.protocol import ProtocolType
from connectrpc.server import ConnectASGIApplication, ConnectWSGIApplication, DEFAULT_READ_MAX_BYTES, Endpoint, EndpointSync
from pyqwest import Client, SyncClient
from .instance_pb2 import DeleteAccountMetadataEntryRequest, DeleteAccountMetadataEntryResponse, DeleteInstanceMetadataEntryRequest, DeleteInstanceMetadataEntryResponse, GetAccountMetadataRequest, GetAccountMetadataResponse, GetInstanceMetadataRequest, GetInstanceMetadataResponse, InstanceAddAccountRequest, InstanceAddAccountResponse, InstanceAddAccountsBatchRequest, InstanceAddAccountsBatchResponse, InstanceAddProxiesBatchRequest, InstanceAddProxiesBatchResponse, InstanceAddProxyRequest, InstanceAddProxyResponse, InstanceAuditLogRequest, InstanceAuditLogResponse, InstanceCreateRequest, InstanceCreateResponse, InstanceDeleteRequest, InstanceDeleteResponse, InstanceDuplicateRequest, InstanceDuplicateResponse, InstanceGetOrCreateBotRequest, InstanceGetOrCreateBotResponse, InstanceGetOrCreateRequest, InstanceGetOrCreateResponse, InstanceInfoRequest, InstanceInfoResponse, InstanceListRequest, InstanceListResponse, InstanceRemoveAccountRequest, InstanceRemoveAccountResponse, InstanceRemoveAccountsBatchRequest, InstanceRemoveAccountsBatchResponse, InstanceRemoveProxiesBatchRequest, InstanceRemoveProxiesBatchResponse, InstanceRemoveProxyEntriesRequest, InstanceRemoveProxyEntriesResponse, InstanceRemoveProxyRequest, InstanceRemoveProxyResponse, InstanceReplaceAccountsRequest, InstanceReplaceAccountsResponse, InstanceUpdateAccountRequest, InstanceUpdateAccountResponse, InstanceUpdateConfigEntryRequest, InstanceUpdateConfigEntryResponse, InstanceUpdateConfigRequest, InstanceUpdateConfigResponse, InstanceUpdateMetaRequest, InstanceUpdateMetaResponse, InstanceUpdateProxyRequest, InstanceUpdateProxyResponse, SetAccountMetadataEntryRequest, SetAccountMetadataEntryResponse, SetInstanceMetadataEntryRequest, SetInstanceMetadataEntryResponse
if TYPE_CHECKING:
from collections.abc import AsyncGenerator, Iterable, Mapping
from connectrpc.codec import Codec
from connectrpc.compression import Compression
from connectrpc.interceptor import Interceptor, InterceptorSync
from connectrpc.request import Headers, RequestContext
_DEFAULT_CODECS = google_protobuf_codecs()
_PROTO_BINARY_CODEC = google_protobuf_binary_codec()
_GZIP_COMPRESSION = GzipCompression()
[docs]
class InstanceService(Protocol):
"""
Service for managing SoulFire instances.
An instance is a permission and configuration compartment for independently
controlled Minecraft bots, settings, accounts, proxies, and remote clients.
All operations require appropriate permissions:
- CREATE_INSTANCE (global): Required to create new instances
- READ_INSTANCE: Required to list and view instance details
- UPDATE_INSTANCE_META: Required to change instance name/icon
- UPDATE_INSTANCE_CONFIG: Required to modify settings, accounts, and proxies
- DELETE_INSTANCE: Required to delete an instance
- READ_INSTANCE_AUDIT_LOGS: Required to view audit logs
- READ_BOT_INFO: Required to read account metadata
"""
[docs]
async def get_or_create_instance(self, request: InstanceGetOrCreateRequest, ctx: RequestContext[InstanceGetOrCreateRequest, InstanceGetOrCreateResponse], /) -> InstanceGetOrCreateResponse:
"""
Gets or creates an instance owned by the caller without a list/create race.
"""
raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented')
[docs]
async def get_or_create_bot(self, request: InstanceGetOrCreateBotRequest, ctx: RequestContext[InstanceGetOrCreateBotRequest, InstanceGetOrCreateBotResponse], /) -> InstanceGetOrCreateBotResponse:
"""
Gets or creates a named bot account. Does not change its desired state.
"""
raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented')
[docs]
async def create_instance(self, request: InstanceCreateRequest, ctx: RequestContext[InstanceCreateRequest, InstanceCreateResponse], /) -> InstanceCreateResponse:
"""
Creates a new instance with the given friendly name.
Requires: CREATE_INSTANCE global permission
Returns: The UUID of the newly created instance
Errors: INTERNAL if creation fails
"""
raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented')
[docs]
async def duplicate_instance(self, request: InstanceDuplicateRequest, ctx: RequestContext[InstanceDuplicateRequest, InstanceDuplicateResponse], /) -> InstanceDuplicateResponse:
"""
Copies the source configuration and icon into a new instance in one write.
Includes accounts, proxies, and persistent metadata. Bots start stopped.
Does not copy permissions, files, scripts, audit logs, or runtime state.
Requires: CREATE_INSTANCE globally and READ_INSTANCE on the source.
Errors: INVALID_ARGUMENT for invalid input, NOT_FOUND for a missing source.
"""
raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented')
[docs]
async def delete_instance(self, request: InstanceDeleteRequest, ctx: RequestContext[InstanceDeleteRequest, InstanceDeleteResponse], /) -> InstanceDeleteResponse:
"""
Permanently deletes an instance and all its data.
Connected bots are stopped before the instance is deleted.
This operation cannot be undone.
Requires: DELETE_INSTANCE permission on the instance
Errors: NOT_FOUND if instance does not exist
"""
raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented')
[docs]
async def list_instances(self, request: InstanceListRequest, ctx: RequestContext[InstanceListRequest, InstanceListResponse], /) -> InstanceListResponse:
"""
Lists all instances the current user has permission to view.
Only instances where the user has READ_INSTANCE permission are returned.
Returns summary information for each instance.
"""
raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented')
[docs]
async def get_instance_info(self, request: InstanceInfoRequest, ctx: RequestContext[InstanceInfoRequest, InstanceInfoResponse], /) -> InstanceInfoResponse:
"""
Gets detailed information about a specific instance.
Supports conditional requests via if_modified_since to reduce bandwidth.
Requires: READ_INSTANCE permission on the instance
Returns: Full instance info or not_modified status
Errors: NOT_FOUND if instance does not exist
"""
raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented')
[docs]
async def update_instance_config(self, request: InstanceUpdateConfigRequest, ctx: RequestContext[InstanceUpdateConfigRequest, InstanceUpdateConfigResponse], /) -> InstanceUpdateConfigResponse:
"""
Replaces the entire instance configuration.
Used primarily for profile import operations.
For individual setting changes, use UpdateInstanceConfigEntry instead.
Requires: UPDATE_INSTANCE_CONFIG permission on the instance
Errors: NOT_FOUND if instance does not exist
"""
raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented')
[docs]
async def update_instance_config_entry(self, request: InstanceUpdateConfigEntryRequest, ctx: RequestContext[InstanceUpdateConfigEntryRequest, InstanceUpdateConfigEntryResponse], /) -> InstanceUpdateConfigEntryResponse:
"""
Updates a single configuration entry by namespace and key.
More efficient than UpdateInstanceConfig for individual changes.
Requires: UPDATE_INSTANCE_CONFIG permission on the instance
Errors: NOT_FOUND if instance does not exist
"""
raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented')
[docs]
async def add_instance_account(self, request: InstanceAddAccountRequest, ctx: RequestContext[InstanceAddAccountRequest, InstanceAddAccountResponse], /) -> InstanceAddAccountResponse:
"""
Adds a Minecraft account to the instance.
The account's profile_id must be unique within the instance.
Requires: UPDATE_INSTANCE_CONFIG permission on the instance
Errors: NOT_FOUND if instance does not exist
"""
raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented')
[docs]
async def remove_instance_account(self, request: InstanceRemoveAccountRequest, ctx: RequestContext[InstanceRemoveAccountRequest, InstanceRemoveAccountResponse], /) -> InstanceRemoveAccountResponse:
"""
Removes a Minecraft account from the instance by profile_id.
Requires: UPDATE_INSTANCE_CONFIG permission on the instance
Errors: NOT_FOUND if instance does not exist
"""
raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented')
[docs]
async def update_instance_account(self, request: InstanceUpdateAccountRequest, ctx: RequestContext[InstanceUpdateAccountRequest, InstanceUpdateAccountResponse], /) -> InstanceUpdateAccountResponse:
"""
Updates an existing Minecraft account in the instance.
The account is matched by profile_id and replaced.
Requires: UPDATE_INSTANCE_CONFIG permission on the instance
Errors: NOT_FOUND if instance does not exist
"""
raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented')
[docs]
async def add_instance_accounts_batch(self, request: InstanceAddAccountsBatchRequest, ctx: RequestContext[InstanceAddAccountsBatchRequest, InstanceAddAccountsBatchResponse], /) -> InstanceAddAccountsBatchResponse:
"""
Adds multiple Minecraft accounts to the instance in a single operation.
More efficient than multiple AddInstanceAccount calls.
Requires: UPDATE_INSTANCE_CONFIG permission on the instance
Errors: NOT_FOUND if instance does not exist
"""
raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented')
[docs]
async def replace_instance_accounts(self, request: InstanceReplaceAccountsRequest, ctx: RequestContext[InstanceReplaceAccountsRequest, InstanceReplaceAccountsResponse], /) -> InstanceReplaceAccountsResponse:
"""
Atomically replaces the account list and stops bots whose accounts were removed.
Other instance configuration remains unchanged.
Requires: UPDATE_INSTANCE_CONFIG permission on the instance
Errors: NOT_FOUND if the instance does not exist; INVALID_ARGUMENT for invalid accounts
"""
raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented')
[docs]
async def remove_instance_accounts_batch(self, request: InstanceRemoveAccountsBatchRequest, ctx: RequestContext[InstanceRemoveAccountsBatchRequest, InstanceRemoveAccountsBatchResponse], /) -> InstanceRemoveAccountsBatchResponse:
"""
Removes multiple Minecraft accounts from the instance by their profile_ids.
More efficient than multiple RemoveInstanceAccount calls.
Requires: UPDATE_INSTANCE_CONFIG permission on the instance
Errors: NOT_FOUND if instance does not exist
"""
raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented')
[docs]
async def add_instance_proxy(self, request: InstanceAddProxyRequest, ctx: RequestContext[InstanceAddProxyRequest, InstanceAddProxyResponse], /) -> InstanceAddProxyResponse:
"""
Adds a proxy to the instance.
Requires: UPDATE_INSTANCE_CONFIG permission on the instance
Errors: NOT_FOUND if instance does not exist
"""
raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented')
[docs]
async def remove_instance_proxy(self, request: InstanceRemoveProxyRequest, ctx: RequestContext[InstanceRemoveProxyRequest, InstanceRemoveProxyResponse], /) -> InstanceRemoveProxyResponse:
"""
Removes a proxy from the instance by its index.
Requires: UPDATE_INSTANCE_CONFIG permission on the instance
Errors: NOT_FOUND if instance does not exist
Errors: INVALID_ARGUMENT if index is out of bounds
"""
raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented')
[docs]
async def update_instance_proxy(self, request: InstanceUpdateProxyRequest, ctx: RequestContext[InstanceUpdateProxyRequest, InstanceUpdateProxyResponse], /) -> InstanceUpdateProxyResponse:
"""
Updates an existing proxy in the instance by its index.
Requires: UPDATE_INSTANCE_CONFIG permission on the instance
Errors: NOT_FOUND if instance does not exist
Errors: INVALID_ARGUMENT if index is out of bounds
"""
raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented')
[docs]
async def add_instance_proxies_batch(self, request: InstanceAddProxiesBatchRequest, ctx: RequestContext[InstanceAddProxiesBatchRequest, InstanceAddProxiesBatchResponse], /) -> InstanceAddProxiesBatchResponse:
"""
Adds multiple proxies to the instance in a single operation.
More efficient than multiple AddInstanceProxy calls.
Requires: UPDATE_INSTANCE_CONFIG permission on the instance
Errors: NOT_FOUND if instance does not exist
"""
raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented')
[docs]
async def remove_instance_proxies_batch(self, request: InstanceRemoveProxiesBatchRequest, ctx: RequestContext[InstanceRemoveProxiesBatchRequest, InstanceRemoveProxiesBatchResponse], /) -> InstanceRemoveProxiesBatchResponse:
"""
Removes multiple proxies from the instance by their addresses.
More efficient than multiple RemoveInstanceProxy calls.
Requires: UPDATE_INSTANCE_CONFIG permission on the instance
Errors: NOT_FOUND if instance does not exist
"""
raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented')
[docs]
async def remove_instance_proxy_entries(self, request: InstanceRemoveProxyEntriesRequest, ctx: RequestContext[InstanceRemoveProxyEntriesRequest, InstanceRemoveProxyEntriesResponse], /) -> InstanceRemoveProxyEntriesResponse:
"""
Removes one matching occurrence of each requested proxy entry.
Requires: UPDATE_INSTANCE_CONFIG permission on the instance
Errors: NOT_FOUND if the instance does not exist; INVALID_ARGUMENT for invalid proxies
"""
raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented')
[docs]
async def get_audit_log(self, request: InstanceAuditLogRequest, ctx: RequestContext[InstanceAuditLogRequest, InstanceAuditLogResponse], /) -> InstanceAuditLogResponse:
"""
Retrieves the audit log for an instance.
Returns a list of recorded actions ordered by timestamp (newest first).
Requires: READ_INSTANCE_AUDIT_LOGS permission on the instance
Errors: NOT_FOUND if instance does not exist
"""
raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented')
[docs]
async def set_account_metadata_entry(self, request: SetAccountMetadataEntryRequest, ctx: RequestContext[SetAccountMetadataEntryRequest, SetAccountMetadataEntryResponse], /) -> SetAccountMetadataEntryResponse:
"""
Sets a single persistent metadata entry for a Minecraft account.
Creates the namespace and key if they don't exist, or updates if they do.
Requires: UPDATE_INSTANCE_CONFIG permission on the instance
Errors: NOT_FOUND if instance does not exist
"""
raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented')
[docs]
async def delete_account_metadata_entry(self, request: DeleteAccountMetadataEntryRequest, ctx: RequestContext[DeleteAccountMetadataEntryRequest, DeleteAccountMetadataEntryResponse], /) -> DeleteAccountMetadataEntryResponse:
"""
Deletes a persistent metadata entry from a Minecraft account.
Requires: UPDATE_INSTANCE_CONFIG permission on the instance
Errors: NOT_FOUND if instance does not exist
"""
raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented')
[docs]
async def set_instance_metadata_entry(self, request: SetInstanceMetadataEntryRequest, ctx: RequestContext[SetInstanceMetadataEntryRequest, SetInstanceMetadataEntryResponse], /) -> SetInstanceMetadataEntryResponse:
"""
Sets a single persistent metadata entry for the instance.
Creates the namespace and key if they don't exist, or updates if they do.
Requires: UPDATE_INSTANCE_META permission on the instance
Errors: NOT_FOUND if instance does not exist
"""
raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented')
[docs]
async def delete_instance_metadata_entry(self, request: DeleteInstanceMetadataEntryRequest, ctx: RequestContext[DeleteInstanceMetadataEntryRequest, DeleteInstanceMetadataEntryResponse], /) -> DeleteInstanceMetadataEntryResponse:
"""
Deletes a persistent metadata entry from the instance.
Requires: UPDATE_INSTANCE_META permission on the instance
Errors: NOT_FOUND if instance does not exist
"""
raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented')
[docs]
class InstanceServiceASGIApplication(ConnectASGIApplication[InstanceService]):
def __init__(
self,
service: InstanceService | AsyncGenerator[InstanceService],
*,
interceptors: Iterable[Interceptor] = (),
read_max_bytes: int | None = DEFAULT_READ_MAX_BYTES,
compressions: Iterable[Compression] | None = None,
codecs: Iterable[Codec] | None = _DEFAULT_CODECS,
) -> None:
super().__init__(
service=service,
endpoints=lambda svc: {
"/soulfire.v1.InstanceService/GetOrCreateInstance": Endpoint.unary(
method=MethodInfo(
name="GetOrCreateInstance",
service_name="soulfire.v1.InstanceService",
input=InstanceGetOrCreateRequest,
output=InstanceGetOrCreateResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
function=svc.get_or_create_instance,
),
"/soulfire.v1.InstanceService/GetOrCreateBot": Endpoint.unary(
method=MethodInfo(
name="GetOrCreateBot",
service_name="soulfire.v1.InstanceService",
input=InstanceGetOrCreateBotRequest,
output=InstanceGetOrCreateBotResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
function=svc.get_or_create_bot,
),
"/soulfire.v1.InstanceService/CreateInstance": Endpoint.unary(
method=MethodInfo(
name="CreateInstance",
service_name="soulfire.v1.InstanceService",
input=InstanceCreateRequest,
output=InstanceCreateResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
function=svc.create_instance,
),
"/soulfire.v1.InstanceService/DuplicateInstance": Endpoint.unary(
method=MethodInfo(
name="DuplicateInstance",
service_name="soulfire.v1.InstanceService",
input=InstanceDuplicateRequest,
output=InstanceDuplicateResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
function=svc.duplicate_instance,
),
"/soulfire.v1.InstanceService/DeleteInstance": Endpoint.unary(
method=MethodInfo(
name="DeleteInstance",
service_name="soulfire.v1.InstanceService",
input=InstanceDeleteRequest,
output=InstanceDeleteResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
function=svc.delete_instance,
),
"/soulfire.v1.InstanceService/ListInstances": Endpoint.unary(
method=MethodInfo(
name="ListInstances",
service_name="soulfire.v1.InstanceService",
input=InstanceListRequest,
output=InstanceListResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
function=svc.list_instances,
),
"/soulfire.v1.InstanceService/GetInstanceInfo": Endpoint.unary(
method=MethodInfo(
name="GetInstanceInfo",
service_name="soulfire.v1.InstanceService",
input=InstanceInfoRequest,
output=InstanceInfoResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
function=svc.get_instance_info,
),
"/soulfire.v1.InstanceService/UpdateInstanceMeta": Endpoint.unary(
method=MethodInfo(
name="UpdateInstanceMeta",
service_name="soulfire.v1.InstanceService",
input=InstanceUpdateMetaRequest,
output=InstanceUpdateMetaResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
function=svc.update_instance_meta,
),
"/soulfire.v1.InstanceService/UpdateInstanceConfig": Endpoint.unary(
method=MethodInfo(
name="UpdateInstanceConfig",
service_name="soulfire.v1.InstanceService",
input=InstanceUpdateConfigRequest,
output=InstanceUpdateConfigResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
function=svc.update_instance_config,
),
"/soulfire.v1.InstanceService/UpdateInstanceConfigEntry": Endpoint.unary(
method=MethodInfo(
name="UpdateInstanceConfigEntry",
service_name="soulfire.v1.InstanceService",
input=InstanceUpdateConfigEntryRequest,
output=InstanceUpdateConfigEntryResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
function=svc.update_instance_config_entry,
),
"/soulfire.v1.InstanceService/AddInstanceAccount": Endpoint.unary(
method=MethodInfo(
name="AddInstanceAccount",
service_name="soulfire.v1.InstanceService",
input=InstanceAddAccountRequest,
output=InstanceAddAccountResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
function=svc.add_instance_account,
),
"/soulfire.v1.InstanceService/RemoveInstanceAccount": Endpoint.unary(
method=MethodInfo(
name="RemoveInstanceAccount",
service_name="soulfire.v1.InstanceService",
input=InstanceRemoveAccountRequest,
output=InstanceRemoveAccountResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
function=svc.remove_instance_account,
),
"/soulfire.v1.InstanceService/UpdateInstanceAccount": Endpoint.unary(
method=MethodInfo(
name="UpdateInstanceAccount",
service_name="soulfire.v1.InstanceService",
input=InstanceUpdateAccountRequest,
output=InstanceUpdateAccountResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
function=svc.update_instance_account,
),
"/soulfire.v1.InstanceService/AddInstanceAccountsBatch": Endpoint.unary(
method=MethodInfo(
name="AddInstanceAccountsBatch",
service_name="soulfire.v1.InstanceService",
input=InstanceAddAccountsBatchRequest,
output=InstanceAddAccountsBatchResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
function=svc.add_instance_accounts_batch,
),
"/soulfire.v1.InstanceService/ReplaceInstanceAccounts": Endpoint.unary(
method=MethodInfo(
name="ReplaceInstanceAccounts",
service_name="soulfire.v1.InstanceService",
input=InstanceReplaceAccountsRequest,
output=InstanceReplaceAccountsResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
function=svc.replace_instance_accounts,
),
"/soulfire.v1.InstanceService/RemoveInstanceAccountsBatch": Endpoint.unary(
method=MethodInfo(
name="RemoveInstanceAccountsBatch",
service_name="soulfire.v1.InstanceService",
input=InstanceRemoveAccountsBatchRequest,
output=InstanceRemoveAccountsBatchResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
function=svc.remove_instance_accounts_batch,
),
"/soulfire.v1.InstanceService/AddInstanceProxy": Endpoint.unary(
method=MethodInfo(
name="AddInstanceProxy",
service_name="soulfire.v1.InstanceService",
input=InstanceAddProxyRequest,
output=InstanceAddProxyResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
function=svc.add_instance_proxy,
),
"/soulfire.v1.InstanceService/RemoveInstanceProxy": Endpoint.unary(
method=MethodInfo(
name="RemoveInstanceProxy",
service_name="soulfire.v1.InstanceService",
input=InstanceRemoveProxyRequest,
output=InstanceRemoveProxyResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
function=svc.remove_instance_proxy,
),
"/soulfire.v1.InstanceService/UpdateInstanceProxy": Endpoint.unary(
method=MethodInfo(
name="UpdateInstanceProxy",
service_name="soulfire.v1.InstanceService",
input=InstanceUpdateProxyRequest,
output=InstanceUpdateProxyResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
function=svc.update_instance_proxy,
),
"/soulfire.v1.InstanceService/AddInstanceProxiesBatch": Endpoint.unary(
method=MethodInfo(
name="AddInstanceProxiesBatch",
service_name="soulfire.v1.InstanceService",
input=InstanceAddProxiesBatchRequest,
output=InstanceAddProxiesBatchResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
function=svc.add_instance_proxies_batch,
),
"/soulfire.v1.InstanceService/RemoveInstanceProxiesBatch": Endpoint.unary(
method=MethodInfo(
name="RemoveInstanceProxiesBatch",
service_name="soulfire.v1.InstanceService",
input=InstanceRemoveProxiesBatchRequest,
output=InstanceRemoveProxiesBatchResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
function=svc.remove_instance_proxies_batch,
),
"/soulfire.v1.InstanceService/RemoveInstanceProxyEntries": Endpoint.unary(
method=MethodInfo(
name="RemoveInstanceProxyEntries",
service_name="soulfire.v1.InstanceService",
input=InstanceRemoveProxyEntriesRequest,
output=InstanceRemoveProxyEntriesResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
function=svc.remove_instance_proxy_entries,
),
"/soulfire.v1.InstanceService/GetAuditLog": Endpoint.unary(
method=MethodInfo(
name="GetAuditLog",
service_name="soulfire.v1.InstanceService",
input=InstanceAuditLogRequest,
output=InstanceAuditLogResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
function=svc.get_audit_log,
),
"/soulfire.v1.InstanceService/GetAccountMetadata": Endpoint.unary(
method=MethodInfo(
name="GetAccountMetadata",
service_name="soulfire.v1.InstanceService",
input=GetAccountMetadataRequest,
output=GetAccountMetadataResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
function=svc.get_account_metadata,
),
"/soulfire.v1.InstanceService/SetAccountMetadataEntry": Endpoint.unary(
method=MethodInfo(
name="SetAccountMetadataEntry",
service_name="soulfire.v1.InstanceService",
input=SetAccountMetadataEntryRequest,
output=SetAccountMetadataEntryResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
function=svc.set_account_metadata_entry,
),
"/soulfire.v1.InstanceService/DeleteAccountMetadataEntry": Endpoint.unary(
method=MethodInfo(
name="DeleteAccountMetadataEntry",
service_name="soulfire.v1.InstanceService",
input=DeleteAccountMetadataEntryRequest,
output=DeleteAccountMetadataEntryResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
function=svc.delete_account_metadata_entry,
),
"/soulfire.v1.InstanceService/GetInstanceMetadata": Endpoint.unary(
method=MethodInfo(
name="GetInstanceMetadata",
service_name="soulfire.v1.InstanceService",
input=GetInstanceMetadataRequest,
output=GetInstanceMetadataResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
function=svc.get_instance_metadata,
),
"/soulfire.v1.InstanceService/SetInstanceMetadataEntry": Endpoint.unary(
method=MethodInfo(
name="SetInstanceMetadataEntry",
service_name="soulfire.v1.InstanceService",
input=SetInstanceMetadataEntryRequest,
output=SetInstanceMetadataEntryResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
function=svc.set_instance_metadata_entry,
),
"/soulfire.v1.InstanceService/DeleteInstanceMetadataEntry": Endpoint.unary(
method=MethodInfo(
name="DeleteInstanceMetadataEntry",
service_name="soulfire.v1.InstanceService",
input=DeleteInstanceMetadataEntryRequest,
output=DeleteInstanceMetadataEntryResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
function=svc.delete_instance_metadata_entry,
),
},
interceptors=interceptors,
read_max_bytes=read_max_bytes,
compressions=compressions,
codecs=codecs,
)
@property
def path(self) -> str:
"""Returns the URL path to mount the application to when serving multiple applications."""
return "/soulfire.v1.InstanceService"
[docs]
class InstanceServiceClient(ConnectClient):
"""
Service for managing SoulFire instances.
An instance is a permission and configuration compartment for independently
controlled Minecraft bots, settings, accounts, proxies, and remote clients.
All operations require appropriate permissions:
- CREATE_INSTANCE (global): Required to create new instances
- READ_INSTANCE: Required to list and view instance details
- UPDATE_INSTANCE_META: Required to change instance name/icon
- UPDATE_INSTANCE_CONFIG: Required to modify settings, accounts, and proxies
- DELETE_INSTANCE: Required to delete an instance
- READ_INSTANCE_AUDIT_LOGS: Required to view audit logs
- READ_BOT_INFO: Required to read account metadata
"""
def __init__(
self,
address: str,
*,
codec: Codec | None = _PROTO_BINARY_CODEC,
protocol: ProtocolType = ProtocolType.CONNECT,
accept_compression: Iterable[Compression] | None = None,
send_compression: Compression | None = _GZIP_COMPRESSION,
timeout_ms: int | None = None,
read_max_bytes: int | None = None,
interceptors: Iterable[Interceptor] = (),
http_client: Client | None = None,
) -> None:
super().__init__(
address=address,
codec=codec,
protocol=protocol,
accept_compression=accept_compression,
send_compression=send_compression,
timeout_ms=timeout_ms,
read_max_bytes=read_max_bytes,
interceptors=interceptors,
http_client=http_client,
)
[docs]
async def get_or_create_instance(
self,
request: InstanceGetOrCreateRequest,
*,
headers: Headers | Mapping[str, str] | None = None,
timeout_ms: int | None = None,
) -> InstanceGetOrCreateResponse:
"""
Gets or creates an instance owned by the caller without a list/create race.
"""
return await self.execute_unary(
request=request,
method=MethodInfo(
name="GetOrCreateInstance",
service_name="soulfire.v1.InstanceService",
input=InstanceGetOrCreateRequest,
output=InstanceGetOrCreateResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
headers=headers,
timeout_ms=timeout_ms,
)
[docs]
async def get_or_create_bot(
self,
request: InstanceGetOrCreateBotRequest,
*,
headers: Headers | Mapping[str, str] | None = None,
timeout_ms: int | None = None,
) -> InstanceGetOrCreateBotResponse:
"""
Gets or creates a named bot account. Does not change its desired state.
"""
return await self.execute_unary(
request=request,
method=MethodInfo(
name="GetOrCreateBot",
service_name="soulfire.v1.InstanceService",
input=InstanceGetOrCreateBotRequest,
output=InstanceGetOrCreateBotResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
headers=headers,
timeout_ms=timeout_ms,
)
[docs]
async def create_instance(
self,
request: InstanceCreateRequest,
*,
headers: Headers | Mapping[str, str] | None = None,
timeout_ms: int | None = None,
) -> InstanceCreateResponse:
"""
Creates a new instance with the given friendly name.
Requires: CREATE_INSTANCE global permission
Returns: The UUID of the newly created instance
Errors: INTERNAL if creation fails
"""
return await self.execute_unary(
request=request,
method=MethodInfo(
name="CreateInstance",
service_name="soulfire.v1.InstanceService",
input=InstanceCreateRequest,
output=InstanceCreateResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
headers=headers,
timeout_ms=timeout_ms,
)
[docs]
async def duplicate_instance(
self,
request: InstanceDuplicateRequest,
*,
headers: Headers | Mapping[str, str] | None = None,
timeout_ms: int | None = None,
) -> InstanceDuplicateResponse:
"""
Copies the source configuration and icon into a new instance in one write.
Includes accounts, proxies, and persistent metadata. Bots start stopped.
Does not copy permissions, files, scripts, audit logs, or runtime state.
Requires: CREATE_INSTANCE globally and READ_INSTANCE on the source.
Errors: INVALID_ARGUMENT for invalid input, NOT_FOUND for a missing source.
"""
return await self.execute_unary(
request=request,
method=MethodInfo(
name="DuplicateInstance",
service_name="soulfire.v1.InstanceService",
input=InstanceDuplicateRequest,
output=InstanceDuplicateResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
headers=headers,
timeout_ms=timeout_ms,
)
[docs]
async def delete_instance(
self,
request: InstanceDeleteRequest,
*,
headers: Headers | Mapping[str, str] | None = None,
timeout_ms: int | None = None,
) -> InstanceDeleteResponse:
"""
Permanently deletes an instance and all its data.
Connected bots are stopped before the instance is deleted.
This operation cannot be undone.
Requires: DELETE_INSTANCE permission on the instance
Errors: NOT_FOUND if instance does not exist
"""
return await self.execute_unary(
request=request,
method=MethodInfo(
name="DeleteInstance",
service_name="soulfire.v1.InstanceService",
input=InstanceDeleteRequest,
output=InstanceDeleteResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
headers=headers,
timeout_ms=timeout_ms,
)
[docs]
async def list_instances(
self,
request: InstanceListRequest,
*,
headers: Headers | Mapping[str, str] | None = None,
timeout_ms: int | None = None,
) -> InstanceListResponse:
"""
Lists all instances the current user has permission to view.
Only instances where the user has READ_INSTANCE permission are returned.
Returns summary information for each instance.
"""
return await self.execute_unary(
request=request,
method=MethodInfo(
name="ListInstances",
service_name="soulfire.v1.InstanceService",
input=InstanceListRequest,
output=InstanceListResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
headers=headers,
timeout_ms=timeout_ms,
)
[docs]
async def get_instance_info(
self,
request: InstanceInfoRequest,
*,
headers: Headers | Mapping[str, str] | None = None,
timeout_ms: int | None = None,
) -> InstanceInfoResponse:
"""
Gets detailed information about a specific instance.
Supports conditional requests via if_modified_since to reduce bandwidth.
Requires: READ_INSTANCE permission on the instance
Returns: Full instance info or not_modified status
Errors: NOT_FOUND if instance does not exist
"""
return await self.execute_unary(
request=request,
method=MethodInfo(
name="GetInstanceInfo",
service_name="soulfire.v1.InstanceService",
input=InstanceInfoRequest,
output=InstanceInfoResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
headers=headers,
timeout_ms=timeout_ms,
)
[docs]
async def update_instance_config(
self,
request: InstanceUpdateConfigRequest,
*,
headers: Headers | Mapping[str, str] | None = None,
timeout_ms: int | None = None,
) -> InstanceUpdateConfigResponse:
"""
Replaces the entire instance configuration.
Used primarily for profile import operations.
For individual setting changes, use UpdateInstanceConfigEntry instead.
Requires: UPDATE_INSTANCE_CONFIG permission on the instance
Errors: NOT_FOUND if instance does not exist
"""
return await self.execute_unary(
request=request,
method=MethodInfo(
name="UpdateInstanceConfig",
service_name="soulfire.v1.InstanceService",
input=InstanceUpdateConfigRequest,
output=InstanceUpdateConfigResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
headers=headers,
timeout_ms=timeout_ms,
)
[docs]
async def update_instance_config_entry(
self,
request: InstanceUpdateConfigEntryRequest,
*,
headers: Headers | Mapping[str, str] | None = None,
timeout_ms: int | None = None,
) -> InstanceUpdateConfigEntryResponse:
"""
Updates a single configuration entry by namespace and key.
More efficient than UpdateInstanceConfig for individual changes.
Requires: UPDATE_INSTANCE_CONFIG permission on the instance
Errors: NOT_FOUND if instance does not exist
"""
return await self.execute_unary(
request=request,
method=MethodInfo(
name="UpdateInstanceConfigEntry",
service_name="soulfire.v1.InstanceService",
input=InstanceUpdateConfigEntryRequest,
output=InstanceUpdateConfigEntryResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
headers=headers,
timeout_ms=timeout_ms,
)
[docs]
async def add_instance_account(
self,
request: InstanceAddAccountRequest,
*,
headers: Headers | Mapping[str, str] | None = None,
timeout_ms: int | None = None,
) -> InstanceAddAccountResponse:
"""
Adds a Minecraft account to the instance.
The account's profile_id must be unique within the instance.
Requires: UPDATE_INSTANCE_CONFIG permission on the instance
Errors: NOT_FOUND if instance does not exist
"""
return await self.execute_unary(
request=request,
method=MethodInfo(
name="AddInstanceAccount",
service_name="soulfire.v1.InstanceService",
input=InstanceAddAccountRequest,
output=InstanceAddAccountResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
headers=headers,
timeout_ms=timeout_ms,
)
[docs]
async def remove_instance_account(
self,
request: InstanceRemoveAccountRequest,
*,
headers: Headers | Mapping[str, str] | None = None,
timeout_ms: int | None = None,
) -> InstanceRemoveAccountResponse:
"""
Removes a Minecraft account from the instance by profile_id.
Requires: UPDATE_INSTANCE_CONFIG permission on the instance
Errors: NOT_FOUND if instance does not exist
"""
return await self.execute_unary(
request=request,
method=MethodInfo(
name="RemoveInstanceAccount",
service_name="soulfire.v1.InstanceService",
input=InstanceRemoveAccountRequest,
output=InstanceRemoveAccountResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
headers=headers,
timeout_ms=timeout_ms,
)
[docs]
async def update_instance_account(
self,
request: InstanceUpdateAccountRequest,
*,
headers: Headers | Mapping[str, str] | None = None,
timeout_ms: int | None = None,
) -> InstanceUpdateAccountResponse:
"""
Updates an existing Minecraft account in the instance.
The account is matched by profile_id and replaced.
Requires: UPDATE_INSTANCE_CONFIG permission on the instance
Errors: NOT_FOUND if instance does not exist
"""
return await self.execute_unary(
request=request,
method=MethodInfo(
name="UpdateInstanceAccount",
service_name="soulfire.v1.InstanceService",
input=InstanceUpdateAccountRequest,
output=InstanceUpdateAccountResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
headers=headers,
timeout_ms=timeout_ms,
)
[docs]
async def add_instance_accounts_batch(
self,
request: InstanceAddAccountsBatchRequest,
*,
headers: Headers | Mapping[str, str] | None = None,
timeout_ms: int | None = None,
) -> InstanceAddAccountsBatchResponse:
"""
Adds multiple Minecraft accounts to the instance in a single operation.
More efficient than multiple AddInstanceAccount calls.
Requires: UPDATE_INSTANCE_CONFIG permission on the instance
Errors: NOT_FOUND if instance does not exist
"""
return await self.execute_unary(
request=request,
method=MethodInfo(
name="AddInstanceAccountsBatch",
service_name="soulfire.v1.InstanceService",
input=InstanceAddAccountsBatchRequest,
output=InstanceAddAccountsBatchResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
headers=headers,
timeout_ms=timeout_ms,
)
[docs]
async def replace_instance_accounts(
self,
request: InstanceReplaceAccountsRequest,
*,
headers: Headers | Mapping[str, str] | None = None,
timeout_ms: int | None = None,
) -> InstanceReplaceAccountsResponse:
"""
Atomically replaces the account list and stops bots whose accounts were removed.
Other instance configuration remains unchanged.
Requires: UPDATE_INSTANCE_CONFIG permission on the instance
Errors: NOT_FOUND if the instance does not exist; INVALID_ARGUMENT for invalid accounts
"""
return await self.execute_unary(
request=request,
method=MethodInfo(
name="ReplaceInstanceAccounts",
service_name="soulfire.v1.InstanceService",
input=InstanceReplaceAccountsRequest,
output=InstanceReplaceAccountsResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
headers=headers,
timeout_ms=timeout_ms,
)
[docs]
async def remove_instance_accounts_batch(
self,
request: InstanceRemoveAccountsBatchRequest,
*,
headers: Headers | Mapping[str, str] | None = None,
timeout_ms: int | None = None,
) -> InstanceRemoveAccountsBatchResponse:
"""
Removes multiple Minecraft accounts from the instance by their profile_ids.
More efficient than multiple RemoveInstanceAccount calls.
Requires: UPDATE_INSTANCE_CONFIG permission on the instance
Errors: NOT_FOUND if instance does not exist
"""
return await self.execute_unary(
request=request,
method=MethodInfo(
name="RemoveInstanceAccountsBatch",
service_name="soulfire.v1.InstanceService",
input=InstanceRemoveAccountsBatchRequest,
output=InstanceRemoveAccountsBatchResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
headers=headers,
timeout_ms=timeout_ms,
)
[docs]
async def add_instance_proxy(
self,
request: InstanceAddProxyRequest,
*,
headers: Headers | Mapping[str, str] | None = None,
timeout_ms: int | None = None,
) -> InstanceAddProxyResponse:
"""
Adds a proxy to the instance.
Requires: UPDATE_INSTANCE_CONFIG permission on the instance
Errors: NOT_FOUND if instance does not exist
"""
return await self.execute_unary(
request=request,
method=MethodInfo(
name="AddInstanceProxy",
service_name="soulfire.v1.InstanceService",
input=InstanceAddProxyRequest,
output=InstanceAddProxyResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
headers=headers,
timeout_ms=timeout_ms,
)
[docs]
async def remove_instance_proxy(
self,
request: InstanceRemoveProxyRequest,
*,
headers: Headers | Mapping[str, str] | None = None,
timeout_ms: int | None = None,
) -> InstanceRemoveProxyResponse:
"""
Removes a proxy from the instance by its index.
Requires: UPDATE_INSTANCE_CONFIG permission on the instance
Errors: NOT_FOUND if instance does not exist
Errors: INVALID_ARGUMENT if index is out of bounds
"""
return await self.execute_unary(
request=request,
method=MethodInfo(
name="RemoveInstanceProxy",
service_name="soulfire.v1.InstanceService",
input=InstanceRemoveProxyRequest,
output=InstanceRemoveProxyResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
headers=headers,
timeout_ms=timeout_ms,
)
[docs]
async def update_instance_proxy(
self,
request: InstanceUpdateProxyRequest,
*,
headers: Headers | Mapping[str, str] | None = None,
timeout_ms: int | None = None,
) -> InstanceUpdateProxyResponse:
"""
Updates an existing proxy in the instance by its index.
Requires: UPDATE_INSTANCE_CONFIG permission on the instance
Errors: NOT_FOUND if instance does not exist
Errors: INVALID_ARGUMENT if index is out of bounds
"""
return await self.execute_unary(
request=request,
method=MethodInfo(
name="UpdateInstanceProxy",
service_name="soulfire.v1.InstanceService",
input=InstanceUpdateProxyRequest,
output=InstanceUpdateProxyResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
headers=headers,
timeout_ms=timeout_ms,
)
[docs]
async def add_instance_proxies_batch(
self,
request: InstanceAddProxiesBatchRequest,
*,
headers: Headers | Mapping[str, str] | None = None,
timeout_ms: int | None = None,
) -> InstanceAddProxiesBatchResponse:
"""
Adds multiple proxies to the instance in a single operation.
More efficient than multiple AddInstanceProxy calls.
Requires: UPDATE_INSTANCE_CONFIG permission on the instance
Errors: NOT_FOUND if instance does not exist
"""
return await self.execute_unary(
request=request,
method=MethodInfo(
name="AddInstanceProxiesBatch",
service_name="soulfire.v1.InstanceService",
input=InstanceAddProxiesBatchRequest,
output=InstanceAddProxiesBatchResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
headers=headers,
timeout_ms=timeout_ms,
)
[docs]
async def remove_instance_proxies_batch(
self,
request: InstanceRemoveProxiesBatchRequest,
*,
headers: Headers | Mapping[str, str] | None = None,
timeout_ms: int | None = None,
) -> InstanceRemoveProxiesBatchResponse:
"""
Removes multiple proxies from the instance by their addresses.
More efficient than multiple RemoveInstanceProxy calls.
Requires: UPDATE_INSTANCE_CONFIG permission on the instance
Errors: NOT_FOUND if instance does not exist
"""
return await self.execute_unary(
request=request,
method=MethodInfo(
name="RemoveInstanceProxiesBatch",
service_name="soulfire.v1.InstanceService",
input=InstanceRemoveProxiesBatchRequest,
output=InstanceRemoveProxiesBatchResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
headers=headers,
timeout_ms=timeout_ms,
)
[docs]
async def remove_instance_proxy_entries(
self,
request: InstanceRemoveProxyEntriesRequest,
*,
headers: Headers | Mapping[str, str] | None = None,
timeout_ms: int | None = None,
) -> InstanceRemoveProxyEntriesResponse:
"""
Removes one matching occurrence of each requested proxy entry.
Requires: UPDATE_INSTANCE_CONFIG permission on the instance
Errors: NOT_FOUND if the instance does not exist; INVALID_ARGUMENT for invalid proxies
"""
return await self.execute_unary(
request=request,
method=MethodInfo(
name="RemoveInstanceProxyEntries",
service_name="soulfire.v1.InstanceService",
input=InstanceRemoveProxyEntriesRequest,
output=InstanceRemoveProxyEntriesResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
headers=headers,
timeout_ms=timeout_ms,
)
[docs]
async def get_audit_log(
self,
request: InstanceAuditLogRequest,
*,
headers: Headers | Mapping[str, str] | None = None,
timeout_ms: int | None = None,
) -> InstanceAuditLogResponse:
"""
Retrieves the audit log for an instance.
Returns a list of recorded actions ordered by timestamp (newest first).
Requires: READ_INSTANCE_AUDIT_LOGS permission on the instance
Errors: NOT_FOUND if instance does not exist
"""
return await self.execute_unary(
request=request,
method=MethodInfo(
name="GetAuditLog",
service_name="soulfire.v1.InstanceService",
input=InstanceAuditLogRequest,
output=InstanceAuditLogResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
headers=headers,
timeout_ms=timeout_ms,
)
[docs]
async def set_account_metadata_entry(
self,
request: SetAccountMetadataEntryRequest,
*,
headers: Headers | Mapping[str, str] | None = None,
timeout_ms: int | None = None,
) -> SetAccountMetadataEntryResponse:
"""
Sets a single persistent metadata entry for a Minecraft account.
Creates the namespace and key if they don't exist, or updates if they do.
Requires: UPDATE_INSTANCE_CONFIG permission on the instance
Errors: NOT_FOUND if instance does not exist
"""
return await self.execute_unary(
request=request,
method=MethodInfo(
name="SetAccountMetadataEntry",
service_name="soulfire.v1.InstanceService",
input=SetAccountMetadataEntryRequest,
output=SetAccountMetadataEntryResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
headers=headers,
timeout_ms=timeout_ms,
)
[docs]
async def delete_account_metadata_entry(
self,
request: DeleteAccountMetadataEntryRequest,
*,
headers: Headers | Mapping[str, str] | None = None,
timeout_ms: int | None = None,
) -> DeleteAccountMetadataEntryResponse:
"""
Deletes a persistent metadata entry from a Minecraft account.
Requires: UPDATE_INSTANCE_CONFIG permission on the instance
Errors: NOT_FOUND if instance does not exist
"""
return await self.execute_unary(
request=request,
method=MethodInfo(
name="DeleteAccountMetadataEntry",
service_name="soulfire.v1.InstanceService",
input=DeleteAccountMetadataEntryRequest,
output=DeleteAccountMetadataEntryResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
headers=headers,
timeout_ms=timeout_ms,
)
[docs]
async def set_instance_metadata_entry(
self,
request: SetInstanceMetadataEntryRequest,
*,
headers: Headers | Mapping[str, str] | None = None,
timeout_ms: int | None = None,
) -> SetInstanceMetadataEntryResponse:
"""
Sets a single persistent metadata entry for the instance.
Creates the namespace and key if they don't exist, or updates if they do.
Requires: UPDATE_INSTANCE_META permission on the instance
Errors: NOT_FOUND if instance does not exist
"""
return await self.execute_unary(
request=request,
method=MethodInfo(
name="SetInstanceMetadataEntry",
service_name="soulfire.v1.InstanceService",
input=SetInstanceMetadataEntryRequest,
output=SetInstanceMetadataEntryResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
headers=headers,
timeout_ms=timeout_ms,
)
[docs]
async def delete_instance_metadata_entry(
self,
request: DeleteInstanceMetadataEntryRequest,
*,
headers: Headers | Mapping[str, str] | None = None,
timeout_ms: int | None = None,
) -> DeleteInstanceMetadataEntryResponse:
"""
Deletes a persistent metadata entry from the instance.
Requires: UPDATE_INSTANCE_META permission on the instance
Errors: NOT_FOUND if instance does not exist
"""
return await self.execute_unary(
request=request,
method=MethodInfo(
name="DeleteInstanceMetadataEntry",
service_name="soulfire.v1.InstanceService",
input=DeleteInstanceMetadataEntryRequest,
output=DeleteInstanceMetadataEntryResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
headers=headers,
timeout_ms=timeout_ms,
)
[docs]
class InstanceServiceSync(Protocol):
"""
Service for managing SoulFire instances.
An instance is a permission and configuration compartment for independently
controlled Minecraft bots, settings, accounts, proxies, and remote clients.
All operations require appropriate permissions:
- CREATE_INSTANCE (global): Required to create new instances
- READ_INSTANCE: Required to list and view instance details
- UPDATE_INSTANCE_META: Required to change instance name/icon
- UPDATE_INSTANCE_CONFIG: Required to modify settings, accounts, and proxies
- DELETE_INSTANCE: Required to delete an instance
- READ_INSTANCE_AUDIT_LOGS: Required to view audit logs
- READ_BOT_INFO: Required to read account metadata
"""
[docs]
def get_or_create_instance(self, request: InstanceGetOrCreateRequest, ctx: RequestContext[InstanceGetOrCreateRequest, InstanceGetOrCreateResponse], /) -> InstanceGetOrCreateResponse:
"""
Gets or creates an instance owned by the caller without a list/create race.
"""
raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented')
[docs]
def get_or_create_bot(self, request: InstanceGetOrCreateBotRequest, ctx: RequestContext[InstanceGetOrCreateBotRequest, InstanceGetOrCreateBotResponse], /) -> InstanceGetOrCreateBotResponse:
"""
Gets or creates a named bot account. Does not change its desired state.
"""
raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented')
[docs]
def create_instance(self, request: InstanceCreateRequest, ctx: RequestContext[InstanceCreateRequest, InstanceCreateResponse], /) -> InstanceCreateResponse:
"""
Creates a new instance with the given friendly name.
Requires: CREATE_INSTANCE global permission
Returns: The UUID of the newly created instance
Errors: INTERNAL if creation fails
"""
raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented')
[docs]
def duplicate_instance(self, request: InstanceDuplicateRequest, ctx: RequestContext[InstanceDuplicateRequest, InstanceDuplicateResponse], /) -> InstanceDuplicateResponse:
"""
Copies the source configuration and icon into a new instance in one write.
Includes accounts, proxies, and persistent metadata. Bots start stopped.
Does not copy permissions, files, scripts, audit logs, or runtime state.
Requires: CREATE_INSTANCE globally and READ_INSTANCE on the source.
Errors: INVALID_ARGUMENT for invalid input, NOT_FOUND for a missing source.
"""
raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented')
[docs]
def delete_instance(self, request: InstanceDeleteRequest, ctx: RequestContext[InstanceDeleteRequest, InstanceDeleteResponse], /) -> InstanceDeleteResponse:
"""
Permanently deletes an instance and all its data.
Connected bots are stopped before the instance is deleted.
This operation cannot be undone.
Requires: DELETE_INSTANCE permission on the instance
Errors: NOT_FOUND if instance does not exist
"""
raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented')
[docs]
def list_instances(self, request: InstanceListRequest, ctx: RequestContext[InstanceListRequest, InstanceListResponse], /) -> InstanceListResponse:
"""
Lists all instances the current user has permission to view.
Only instances where the user has READ_INSTANCE permission are returned.
Returns summary information for each instance.
"""
raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented')
[docs]
def get_instance_info(self, request: InstanceInfoRequest, ctx: RequestContext[InstanceInfoRequest, InstanceInfoResponse], /) -> InstanceInfoResponse:
"""
Gets detailed information about a specific instance.
Supports conditional requests via if_modified_since to reduce bandwidth.
Requires: READ_INSTANCE permission on the instance
Returns: Full instance info or not_modified status
Errors: NOT_FOUND if instance does not exist
"""
raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented')
[docs]
def update_instance_config(self, request: InstanceUpdateConfigRequest, ctx: RequestContext[InstanceUpdateConfigRequest, InstanceUpdateConfigResponse], /) -> InstanceUpdateConfigResponse:
"""
Replaces the entire instance configuration.
Used primarily for profile import operations.
For individual setting changes, use UpdateInstanceConfigEntry instead.
Requires: UPDATE_INSTANCE_CONFIG permission on the instance
Errors: NOT_FOUND if instance does not exist
"""
raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented')
[docs]
def update_instance_config_entry(self, request: InstanceUpdateConfigEntryRequest, ctx: RequestContext[InstanceUpdateConfigEntryRequest, InstanceUpdateConfigEntryResponse], /) -> InstanceUpdateConfigEntryResponse:
"""
Updates a single configuration entry by namespace and key.
More efficient than UpdateInstanceConfig for individual changes.
Requires: UPDATE_INSTANCE_CONFIG permission on the instance
Errors: NOT_FOUND if instance does not exist
"""
raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented')
[docs]
def add_instance_account(self, request: InstanceAddAccountRequest, ctx: RequestContext[InstanceAddAccountRequest, InstanceAddAccountResponse], /) -> InstanceAddAccountResponse:
"""
Adds a Minecraft account to the instance.
The account's profile_id must be unique within the instance.
Requires: UPDATE_INSTANCE_CONFIG permission on the instance
Errors: NOT_FOUND if instance does not exist
"""
raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented')
[docs]
def remove_instance_account(self, request: InstanceRemoveAccountRequest, ctx: RequestContext[InstanceRemoveAccountRequest, InstanceRemoveAccountResponse], /) -> InstanceRemoveAccountResponse:
"""
Removes a Minecraft account from the instance by profile_id.
Requires: UPDATE_INSTANCE_CONFIG permission on the instance
Errors: NOT_FOUND if instance does not exist
"""
raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented')
[docs]
def update_instance_account(self, request: InstanceUpdateAccountRequest, ctx: RequestContext[InstanceUpdateAccountRequest, InstanceUpdateAccountResponse], /) -> InstanceUpdateAccountResponse:
"""
Updates an existing Minecraft account in the instance.
The account is matched by profile_id and replaced.
Requires: UPDATE_INSTANCE_CONFIG permission on the instance
Errors: NOT_FOUND if instance does not exist
"""
raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented')
[docs]
def add_instance_accounts_batch(self, request: InstanceAddAccountsBatchRequest, ctx: RequestContext[InstanceAddAccountsBatchRequest, InstanceAddAccountsBatchResponse], /) -> InstanceAddAccountsBatchResponse:
"""
Adds multiple Minecraft accounts to the instance in a single operation.
More efficient than multiple AddInstanceAccount calls.
Requires: UPDATE_INSTANCE_CONFIG permission on the instance
Errors: NOT_FOUND if instance does not exist
"""
raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented')
[docs]
def replace_instance_accounts(self, request: InstanceReplaceAccountsRequest, ctx: RequestContext[InstanceReplaceAccountsRequest, InstanceReplaceAccountsResponse], /) -> InstanceReplaceAccountsResponse:
"""
Atomically replaces the account list and stops bots whose accounts were removed.
Other instance configuration remains unchanged.
Requires: UPDATE_INSTANCE_CONFIG permission on the instance
Errors: NOT_FOUND if the instance does not exist; INVALID_ARGUMENT for invalid accounts
"""
raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented')
[docs]
def remove_instance_accounts_batch(self, request: InstanceRemoveAccountsBatchRequest, ctx: RequestContext[InstanceRemoveAccountsBatchRequest, InstanceRemoveAccountsBatchResponse], /) -> InstanceRemoveAccountsBatchResponse:
"""
Removes multiple Minecraft accounts from the instance by their profile_ids.
More efficient than multiple RemoveInstanceAccount calls.
Requires: UPDATE_INSTANCE_CONFIG permission on the instance
Errors: NOT_FOUND if instance does not exist
"""
raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented')
[docs]
def add_instance_proxy(self, request: InstanceAddProxyRequest, ctx: RequestContext[InstanceAddProxyRequest, InstanceAddProxyResponse], /) -> InstanceAddProxyResponse:
"""
Adds a proxy to the instance.
Requires: UPDATE_INSTANCE_CONFIG permission on the instance
Errors: NOT_FOUND if instance does not exist
"""
raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented')
[docs]
def remove_instance_proxy(self, request: InstanceRemoveProxyRequest, ctx: RequestContext[InstanceRemoveProxyRequest, InstanceRemoveProxyResponse], /) -> InstanceRemoveProxyResponse:
"""
Removes a proxy from the instance by its index.
Requires: UPDATE_INSTANCE_CONFIG permission on the instance
Errors: NOT_FOUND if instance does not exist
Errors: INVALID_ARGUMENT if index is out of bounds
"""
raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented')
[docs]
def update_instance_proxy(self, request: InstanceUpdateProxyRequest, ctx: RequestContext[InstanceUpdateProxyRequest, InstanceUpdateProxyResponse], /) -> InstanceUpdateProxyResponse:
"""
Updates an existing proxy in the instance by its index.
Requires: UPDATE_INSTANCE_CONFIG permission on the instance
Errors: NOT_FOUND if instance does not exist
Errors: INVALID_ARGUMENT if index is out of bounds
"""
raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented')
[docs]
def add_instance_proxies_batch(self, request: InstanceAddProxiesBatchRequest, ctx: RequestContext[InstanceAddProxiesBatchRequest, InstanceAddProxiesBatchResponse], /) -> InstanceAddProxiesBatchResponse:
"""
Adds multiple proxies to the instance in a single operation.
More efficient than multiple AddInstanceProxy calls.
Requires: UPDATE_INSTANCE_CONFIG permission on the instance
Errors: NOT_FOUND if instance does not exist
"""
raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented')
[docs]
def remove_instance_proxies_batch(self, request: InstanceRemoveProxiesBatchRequest, ctx: RequestContext[InstanceRemoveProxiesBatchRequest, InstanceRemoveProxiesBatchResponse], /) -> InstanceRemoveProxiesBatchResponse:
"""
Removes multiple proxies from the instance by their addresses.
More efficient than multiple RemoveInstanceProxy calls.
Requires: UPDATE_INSTANCE_CONFIG permission on the instance
Errors: NOT_FOUND if instance does not exist
"""
raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented')
[docs]
def remove_instance_proxy_entries(self, request: InstanceRemoveProxyEntriesRequest, ctx: RequestContext[InstanceRemoveProxyEntriesRequest, InstanceRemoveProxyEntriesResponse], /) -> InstanceRemoveProxyEntriesResponse:
"""
Removes one matching occurrence of each requested proxy entry.
Requires: UPDATE_INSTANCE_CONFIG permission on the instance
Errors: NOT_FOUND if the instance does not exist; INVALID_ARGUMENT for invalid proxies
"""
raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented')
[docs]
def get_audit_log(self, request: InstanceAuditLogRequest, ctx: RequestContext[InstanceAuditLogRequest, InstanceAuditLogResponse], /) -> InstanceAuditLogResponse:
"""
Retrieves the audit log for an instance.
Returns a list of recorded actions ordered by timestamp (newest first).
Requires: READ_INSTANCE_AUDIT_LOGS permission on the instance
Errors: NOT_FOUND if instance does not exist
"""
raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented')
[docs]
def set_account_metadata_entry(self, request: SetAccountMetadataEntryRequest, ctx: RequestContext[SetAccountMetadataEntryRequest, SetAccountMetadataEntryResponse], /) -> SetAccountMetadataEntryResponse:
"""
Sets a single persistent metadata entry for a Minecraft account.
Creates the namespace and key if they don't exist, or updates if they do.
Requires: UPDATE_INSTANCE_CONFIG permission on the instance
Errors: NOT_FOUND if instance does not exist
"""
raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented')
[docs]
def delete_account_metadata_entry(self, request: DeleteAccountMetadataEntryRequest, ctx: RequestContext[DeleteAccountMetadataEntryRequest, DeleteAccountMetadataEntryResponse], /) -> DeleteAccountMetadataEntryResponse:
"""
Deletes a persistent metadata entry from a Minecraft account.
Requires: UPDATE_INSTANCE_CONFIG permission on the instance
Errors: NOT_FOUND if instance does not exist
"""
raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented')
[docs]
def set_instance_metadata_entry(self, request: SetInstanceMetadataEntryRequest, ctx: RequestContext[SetInstanceMetadataEntryRequest, SetInstanceMetadataEntryResponse], /) -> SetInstanceMetadataEntryResponse:
"""
Sets a single persistent metadata entry for the instance.
Creates the namespace and key if they don't exist, or updates if they do.
Requires: UPDATE_INSTANCE_META permission on the instance
Errors: NOT_FOUND if instance does not exist
"""
raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented')
[docs]
def delete_instance_metadata_entry(self, request: DeleteInstanceMetadataEntryRequest, ctx: RequestContext[DeleteInstanceMetadataEntryRequest, DeleteInstanceMetadataEntryResponse], /) -> DeleteInstanceMetadataEntryResponse:
"""
Deletes a persistent metadata entry from the instance.
Requires: UPDATE_INSTANCE_META permission on the instance
Errors: NOT_FOUND if instance does not exist
"""
raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented')
[docs]
class InstanceServiceWSGIApplication(ConnectWSGIApplication):
def __init__(
self,
service: InstanceServiceSync,
interceptors: Iterable[InterceptorSync] = (),
read_max_bytes: int | None = DEFAULT_READ_MAX_BYTES,
compressions: Iterable[Compression] | None = None,
codecs: Iterable[Codec] | None = _DEFAULT_CODECS,
) -> None:
super().__init__(
endpoints={
"/soulfire.v1.InstanceService/GetOrCreateInstance": EndpointSync.unary(
method=MethodInfo(
name="GetOrCreateInstance",
service_name="soulfire.v1.InstanceService",
input=InstanceGetOrCreateRequest,
output=InstanceGetOrCreateResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
function=service.get_or_create_instance,
),
"/soulfire.v1.InstanceService/GetOrCreateBot": EndpointSync.unary(
method=MethodInfo(
name="GetOrCreateBot",
service_name="soulfire.v1.InstanceService",
input=InstanceGetOrCreateBotRequest,
output=InstanceGetOrCreateBotResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
function=service.get_or_create_bot,
),
"/soulfire.v1.InstanceService/CreateInstance": EndpointSync.unary(
method=MethodInfo(
name="CreateInstance",
service_name="soulfire.v1.InstanceService",
input=InstanceCreateRequest,
output=InstanceCreateResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
function=service.create_instance,
),
"/soulfire.v1.InstanceService/DuplicateInstance": EndpointSync.unary(
method=MethodInfo(
name="DuplicateInstance",
service_name="soulfire.v1.InstanceService",
input=InstanceDuplicateRequest,
output=InstanceDuplicateResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
function=service.duplicate_instance,
),
"/soulfire.v1.InstanceService/DeleteInstance": EndpointSync.unary(
method=MethodInfo(
name="DeleteInstance",
service_name="soulfire.v1.InstanceService",
input=InstanceDeleteRequest,
output=InstanceDeleteResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
function=service.delete_instance,
),
"/soulfire.v1.InstanceService/ListInstances": EndpointSync.unary(
method=MethodInfo(
name="ListInstances",
service_name="soulfire.v1.InstanceService",
input=InstanceListRequest,
output=InstanceListResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
function=service.list_instances,
),
"/soulfire.v1.InstanceService/GetInstanceInfo": EndpointSync.unary(
method=MethodInfo(
name="GetInstanceInfo",
service_name="soulfire.v1.InstanceService",
input=InstanceInfoRequest,
output=InstanceInfoResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
function=service.get_instance_info,
),
"/soulfire.v1.InstanceService/UpdateInstanceMeta": EndpointSync.unary(
method=MethodInfo(
name="UpdateInstanceMeta",
service_name="soulfire.v1.InstanceService",
input=InstanceUpdateMetaRequest,
output=InstanceUpdateMetaResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
function=service.update_instance_meta,
),
"/soulfire.v1.InstanceService/UpdateInstanceConfig": EndpointSync.unary(
method=MethodInfo(
name="UpdateInstanceConfig",
service_name="soulfire.v1.InstanceService",
input=InstanceUpdateConfigRequest,
output=InstanceUpdateConfigResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
function=service.update_instance_config,
),
"/soulfire.v1.InstanceService/UpdateInstanceConfigEntry": EndpointSync.unary(
method=MethodInfo(
name="UpdateInstanceConfigEntry",
service_name="soulfire.v1.InstanceService",
input=InstanceUpdateConfigEntryRequest,
output=InstanceUpdateConfigEntryResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
function=service.update_instance_config_entry,
),
"/soulfire.v1.InstanceService/AddInstanceAccount": EndpointSync.unary(
method=MethodInfo(
name="AddInstanceAccount",
service_name="soulfire.v1.InstanceService",
input=InstanceAddAccountRequest,
output=InstanceAddAccountResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
function=service.add_instance_account,
),
"/soulfire.v1.InstanceService/RemoveInstanceAccount": EndpointSync.unary(
method=MethodInfo(
name="RemoveInstanceAccount",
service_name="soulfire.v1.InstanceService",
input=InstanceRemoveAccountRequest,
output=InstanceRemoveAccountResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
function=service.remove_instance_account,
),
"/soulfire.v1.InstanceService/UpdateInstanceAccount": EndpointSync.unary(
method=MethodInfo(
name="UpdateInstanceAccount",
service_name="soulfire.v1.InstanceService",
input=InstanceUpdateAccountRequest,
output=InstanceUpdateAccountResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
function=service.update_instance_account,
),
"/soulfire.v1.InstanceService/AddInstanceAccountsBatch": EndpointSync.unary(
method=MethodInfo(
name="AddInstanceAccountsBatch",
service_name="soulfire.v1.InstanceService",
input=InstanceAddAccountsBatchRequest,
output=InstanceAddAccountsBatchResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
function=service.add_instance_accounts_batch,
),
"/soulfire.v1.InstanceService/ReplaceInstanceAccounts": EndpointSync.unary(
method=MethodInfo(
name="ReplaceInstanceAccounts",
service_name="soulfire.v1.InstanceService",
input=InstanceReplaceAccountsRequest,
output=InstanceReplaceAccountsResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
function=service.replace_instance_accounts,
),
"/soulfire.v1.InstanceService/RemoveInstanceAccountsBatch": EndpointSync.unary(
method=MethodInfo(
name="RemoveInstanceAccountsBatch",
service_name="soulfire.v1.InstanceService",
input=InstanceRemoveAccountsBatchRequest,
output=InstanceRemoveAccountsBatchResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
function=service.remove_instance_accounts_batch,
),
"/soulfire.v1.InstanceService/AddInstanceProxy": EndpointSync.unary(
method=MethodInfo(
name="AddInstanceProxy",
service_name="soulfire.v1.InstanceService",
input=InstanceAddProxyRequest,
output=InstanceAddProxyResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
function=service.add_instance_proxy,
),
"/soulfire.v1.InstanceService/RemoveInstanceProxy": EndpointSync.unary(
method=MethodInfo(
name="RemoveInstanceProxy",
service_name="soulfire.v1.InstanceService",
input=InstanceRemoveProxyRequest,
output=InstanceRemoveProxyResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
function=service.remove_instance_proxy,
),
"/soulfire.v1.InstanceService/UpdateInstanceProxy": EndpointSync.unary(
method=MethodInfo(
name="UpdateInstanceProxy",
service_name="soulfire.v1.InstanceService",
input=InstanceUpdateProxyRequest,
output=InstanceUpdateProxyResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
function=service.update_instance_proxy,
),
"/soulfire.v1.InstanceService/AddInstanceProxiesBatch": EndpointSync.unary(
method=MethodInfo(
name="AddInstanceProxiesBatch",
service_name="soulfire.v1.InstanceService",
input=InstanceAddProxiesBatchRequest,
output=InstanceAddProxiesBatchResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
function=service.add_instance_proxies_batch,
),
"/soulfire.v1.InstanceService/RemoveInstanceProxiesBatch": EndpointSync.unary(
method=MethodInfo(
name="RemoveInstanceProxiesBatch",
service_name="soulfire.v1.InstanceService",
input=InstanceRemoveProxiesBatchRequest,
output=InstanceRemoveProxiesBatchResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
function=service.remove_instance_proxies_batch,
),
"/soulfire.v1.InstanceService/RemoveInstanceProxyEntries": EndpointSync.unary(
method=MethodInfo(
name="RemoveInstanceProxyEntries",
service_name="soulfire.v1.InstanceService",
input=InstanceRemoveProxyEntriesRequest,
output=InstanceRemoveProxyEntriesResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
function=service.remove_instance_proxy_entries,
),
"/soulfire.v1.InstanceService/GetAuditLog": EndpointSync.unary(
method=MethodInfo(
name="GetAuditLog",
service_name="soulfire.v1.InstanceService",
input=InstanceAuditLogRequest,
output=InstanceAuditLogResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
function=service.get_audit_log,
),
"/soulfire.v1.InstanceService/GetAccountMetadata": EndpointSync.unary(
method=MethodInfo(
name="GetAccountMetadata",
service_name="soulfire.v1.InstanceService",
input=GetAccountMetadataRequest,
output=GetAccountMetadataResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
function=service.get_account_metadata,
),
"/soulfire.v1.InstanceService/SetAccountMetadataEntry": EndpointSync.unary(
method=MethodInfo(
name="SetAccountMetadataEntry",
service_name="soulfire.v1.InstanceService",
input=SetAccountMetadataEntryRequest,
output=SetAccountMetadataEntryResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
function=service.set_account_metadata_entry,
),
"/soulfire.v1.InstanceService/DeleteAccountMetadataEntry": EndpointSync.unary(
method=MethodInfo(
name="DeleteAccountMetadataEntry",
service_name="soulfire.v1.InstanceService",
input=DeleteAccountMetadataEntryRequest,
output=DeleteAccountMetadataEntryResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
function=service.delete_account_metadata_entry,
),
"/soulfire.v1.InstanceService/GetInstanceMetadata": EndpointSync.unary(
method=MethodInfo(
name="GetInstanceMetadata",
service_name="soulfire.v1.InstanceService",
input=GetInstanceMetadataRequest,
output=GetInstanceMetadataResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
function=service.get_instance_metadata,
),
"/soulfire.v1.InstanceService/SetInstanceMetadataEntry": EndpointSync.unary(
method=MethodInfo(
name="SetInstanceMetadataEntry",
service_name="soulfire.v1.InstanceService",
input=SetInstanceMetadataEntryRequest,
output=SetInstanceMetadataEntryResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
function=service.set_instance_metadata_entry,
),
"/soulfire.v1.InstanceService/DeleteInstanceMetadataEntry": EndpointSync.unary(
method=MethodInfo(
name="DeleteInstanceMetadataEntry",
service_name="soulfire.v1.InstanceService",
input=DeleteInstanceMetadataEntryRequest,
output=DeleteInstanceMetadataEntryResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
function=service.delete_instance_metadata_entry,
),
},
interceptors=interceptors,
read_max_bytes=read_max_bytes,
compressions=compressions,
codecs=codecs,
)
@property
def path(self) -> str:
"""Returns the URL path to mount the application to when serving multiple applications."""
return "/soulfire.v1.InstanceService"
[docs]
class InstanceServiceClientSync(ConnectClientSync):
"""
Service for managing SoulFire instances.
An instance is a permission and configuration compartment for independently
controlled Minecraft bots, settings, accounts, proxies, and remote clients.
All operations require appropriate permissions:
- CREATE_INSTANCE (global): Required to create new instances
- READ_INSTANCE: Required to list and view instance details
- UPDATE_INSTANCE_META: Required to change instance name/icon
- UPDATE_INSTANCE_CONFIG: Required to modify settings, accounts, and proxies
- DELETE_INSTANCE: Required to delete an instance
- READ_INSTANCE_AUDIT_LOGS: Required to view audit logs
- READ_BOT_INFO: Required to read account metadata
"""
def __init__(
self,
address: str,
*,
codec: Codec | None = _PROTO_BINARY_CODEC,
protocol: ProtocolType = ProtocolType.CONNECT,
accept_compression: Iterable[Compression] | None = None,
send_compression: Compression | None = _GZIP_COMPRESSION,
timeout_ms: int | None = None,
read_max_bytes: int | None = None,
interceptors: Iterable[InterceptorSync] = (),
http_client: SyncClient | None = None,
) -> None:
super().__init__(
address=address,
codec=codec,
protocol=protocol,
accept_compression=accept_compression,
send_compression=send_compression,
timeout_ms=timeout_ms,
read_max_bytes=read_max_bytes,
interceptors=interceptors,
http_client=http_client,
)
[docs]
def get_or_create_instance(
self,
request: InstanceGetOrCreateRequest,
*,
headers: Headers | Mapping[str, str] | None = None,
timeout_ms: int | None = None,
) -> InstanceGetOrCreateResponse:
"""
Gets or creates an instance owned by the caller without a list/create race.
"""
return self.execute_unary(
request=request,
method=MethodInfo(
name="GetOrCreateInstance",
service_name="soulfire.v1.InstanceService",
input=InstanceGetOrCreateRequest,
output=InstanceGetOrCreateResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
headers=headers,
timeout_ms=timeout_ms,
)
[docs]
def get_or_create_bot(
self,
request: InstanceGetOrCreateBotRequest,
*,
headers: Headers | Mapping[str, str] | None = None,
timeout_ms: int | None = None,
) -> InstanceGetOrCreateBotResponse:
"""
Gets or creates a named bot account. Does not change its desired state.
"""
return self.execute_unary(
request=request,
method=MethodInfo(
name="GetOrCreateBot",
service_name="soulfire.v1.InstanceService",
input=InstanceGetOrCreateBotRequest,
output=InstanceGetOrCreateBotResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
headers=headers,
timeout_ms=timeout_ms,
)
[docs]
def create_instance(
self,
request: InstanceCreateRequest,
*,
headers: Headers | Mapping[str, str] | None = None,
timeout_ms: int | None = None,
) -> InstanceCreateResponse:
"""
Creates a new instance with the given friendly name.
Requires: CREATE_INSTANCE global permission
Returns: The UUID of the newly created instance
Errors: INTERNAL if creation fails
"""
return self.execute_unary(
request=request,
method=MethodInfo(
name="CreateInstance",
service_name="soulfire.v1.InstanceService",
input=InstanceCreateRequest,
output=InstanceCreateResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
headers=headers,
timeout_ms=timeout_ms,
)
[docs]
def duplicate_instance(
self,
request: InstanceDuplicateRequest,
*,
headers: Headers | Mapping[str, str] | None = None,
timeout_ms: int | None = None,
) -> InstanceDuplicateResponse:
"""
Copies the source configuration and icon into a new instance in one write.
Includes accounts, proxies, and persistent metadata. Bots start stopped.
Does not copy permissions, files, scripts, audit logs, or runtime state.
Requires: CREATE_INSTANCE globally and READ_INSTANCE on the source.
Errors: INVALID_ARGUMENT for invalid input, NOT_FOUND for a missing source.
"""
return self.execute_unary(
request=request,
method=MethodInfo(
name="DuplicateInstance",
service_name="soulfire.v1.InstanceService",
input=InstanceDuplicateRequest,
output=InstanceDuplicateResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
headers=headers,
timeout_ms=timeout_ms,
)
[docs]
def delete_instance(
self,
request: InstanceDeleteRequest,
*,
headers: Headers | Mapping[str, str] | None = None,
timeout_ms: int | None = None,
) -> InstanceDeleteResponse:
"""
Permanently deletes an instance and all its data.
Connected bots are stopped before the instance is deleted.
This operation cannot be undone.
Requires: DELETE_INSTANCE permission on the instance
Errors: NOT_FOUND if instance does not exist
"""
return self.execute_unary(
request=request,
method=MethodInfo(
name="DeleteInstance",
service_name="soulfire.v1.InstanceService",
input=InstanceDeleteRequest,
output=InstanceDeleteResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
headers=headers,
timeout_ms=timeout_ms,
)
[docs]
def list_instances(
self,
request: InstanceListRequest,
*,
headers: Headers | Mapping[str, str] | None = None,
timeout_ms: int | None = None,
) -> InstanceListResponse:
"""
Lists all instances the current user has permission to view.
Only instances where the user has READ_INSTANCE permission are returned.
Returns summary information for each instance.
"""
return self.execute_unary(
request=request,
method=MethodInfo(
name="ListInstances",
service_name="soulfire.v1.InstanceService",
input=InstanceListRequest,
output=InstanceListResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
headers=headers,
timeout_ms=timeout_ms,
)
[docs]
def get_instance_info(
self,
request: InstanceInfoRequest,
*,
headers: Headers | Mapping[str, str] | None = None,
timeout_ms: int | None = None,
) -> InstanceInfoResponse:
"""
Gets detailed information about a specific instance.
Supports conditional requests via if_modified_since to reduce bandwidth.
Requires: READ_INSTANCE permission on the instance
Returns: Full instance info or not_modified status
Errors: NOT_FOUND if instance does not exist
"""
return self.execute_unary(
request=request,
method=MethodInfo(
name="GetInstanceInfo",
service_name="soulfire.v1.InstanceService",
input=InstanceInfoRequest,
output=InstanceInfoResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
headers=headers,
timeout_ms=timeout_ms,
)
[docs]
def update_instance_config(
self,
request: InstanceUpdateConfigRequest,
*,
headers: Headers | Mapping[str, str] | None = None,
timeout_ms: int | None = None,
) -> InstanceUpdateConfigResponse:
"""
Replaces the entire instance configuration.
Used primarily for profile import operations.
For individual setting changes, use UpdateInstanceConfigEntry instead.
Requires: UPDATE_INSTANCE_CONFIG permission on the instance
Errors: NOT_FOUND if instance does not exist
"""
return self.execute_unary(
request=request,
method=MethodInfo(
name="UpdateInstanceConfig",
service_name="soulfire.v1.InstanceService",
input=InstanceUpdateConfigRequest,
output=InstanceUpdateConfigResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
headers=headers,
timeout_ms=timeout_ms,
)
[docs]
def update_instance_config_entry(
self,
request: InstanceUpdateConfigEntryRequest,
*,
headers: Headers | Mapping[str, str] | None = None,
timeout_ms: int | None = None,
) -> InstanceUpdateConfigEntryResponse:
"""
Updates a single configuration entry by namespace and key.
More efficient than UpdateInstanceConfig for individual changes.
Requires: UPDATE_INSTANCE_CONFIG permission on the instance
Errors: NOT_FOUND if instance does not exist
"""
return self.execute_unary(
request=request,
method=MethodInfo(
name="UpdateInstanceConfigEntry",
service_name="soulfire.v1.InstanceService",
input=InstanceUpdateConfigEntryRequest,
output=InstanceUpdateConfigEntryResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
headers=headers,
timeout_ms=timeout_ms,
)
[docs]
def add_instance_account(
self,
request: InstanceAddAccountRequest,
*,
headers: Headers | Mapping[str, str] | None = None,
timeout_ms: int | None = None,
) -> InstanceAddAccountResponse:
"""
Adds a Minecraft account to the instance.
The account's profile_id must be unique within the instance.
Requires: UPDATE_INSTANCE_CONFIG permission on the instance
Errors: NOT_FOUND if instance does not exist
"""
return self.execute_unary(
request=request,
method=MethodInfo(
name="AddInstanceAccount",
service_name="soulfire.v1.InstanceService",
input=InstanceAddAccountRequest,
output=InstanceAddAccountResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
headers=headers,
timeout_ms=timeout_ms,
)
[docs]
def remove_instance_account(
self,
request: InstanceRemoveAccountRequest,
*,
headers: Headers | Mapping[str, str] | None = None,
timeout_ms: int | None = None,
) -> InstanceRemoveAccountResponse:
"""
Removes a Minecraft account from the instance by profile_id.
Requires: UPDATE_INSTANCE_CONFIG permission on the instance
Errors: NOT_FOUND if instance does not exist
"""
return self.execute_unary(
request=request,
method=MethodInfo(
name="RemoveInstanceAccount",
service_name="soulfire.v1.InstanceService",
input=InstanceRemoveAccountRequest,
output=InstanceRemoveAccountResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
headers=headers,
timeout_ms=timeout_ms,
)
[docs]
def update_instance_account(
self,
request: InstanceUpdateAccountRequest,
*,
headers: Headers | Mapping[str, str] | None = None,
timeout_ms: int | None = None,
) -> InstanceUpdateAccountResponse:
"""
Updates an existing Minecraft account in the instance.
The account is matched by profile_id and replaced.
Requires: UPDATE_INSTANCE_CONFIG permission on the instance
Errors: NOT_FOUND if instance does not exist
"""
return self.execute_unary(
request=request,
method=MethodInfo(
name="UpdateInstanceAccount",
service_name="soulfire.v1.InstanceService",
input=InstanceUpdateAccountRequest,
output=InstanceUpdateAccountResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
headers=headers,
timeout_ms=timeout_ms,
)
[docs]
def add_instance_accounts_batch(
self,
request: InstanceAddAccountsBatchRequest,
*,
headers: Headers | Mapping[str, str] | None = None,
timeout_ms: int | None = None,
) -> InstanceAddAccountsBatchResponse:
"""
Adds multiple Minecraft accounts to the instance in a single operation.
More efficient than multiple AddInstanceAccount calls.
Requires: UPDATE_INSTANCE_CONFIG permission on the instance
Errors: NOT_FOUND if instance does not exist
"""
return self.execute_unary(
request=request,
method=MethodInfo(
name="AddInstanceAccountsBatch",
service_name="soulfire.v1.InstanceService",
input=InstanceAddAccountsBatchRequest,
output=InstanceAddAccountsBatchResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
headers=headers,
timeout_ms=timeout_ms,
)
[docs]
def replace_instance_accounts(
self,
request: InstanceReplaceAccountsRequest,
*,
headers: Headers | Mapping[str, str] | None = None,
timeout_ms: int | None = None,
) -> InstanceReplaceAccountsResponse:
"""
Atomically replaces the account list and stops bots whose accounts were removed.
Other instance configuration remains unchanged.
Requires: UPDATE_INSTANCE_CONFIG permission on the instance
Errors: NOT_FOUND if the instance does not exist; INVALID_ARGUMENT for invalid accounts
"""
return self.execute_unary(
request=request,
method=MethodInfo(
name="ReplaceInstanceAccounts",
service_name="soulfire.v1.InstanceService",
input=InstanceReplaceAccountsRequest,
output=InstanceReplaceAccountsResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
headers=headers,
timeout_ms=timeout_ms,
)
[docs]
def remove_instance_accounts_batch(
self,
request: InstanceRemoveAccountsBatchRequest,
*,
headers: Headers | Mapping[str, str] | None = None,
timeout_ms: int | None = None,
) -> InstanceRemoveAccountsBatchResponse:
"""
Removes multiple Minecraft accounts from the instance by their profile_ids.
More efficient than multiple RemoveInstanceAccount calls.
Requires: UPDATE_INSTANCE_CONFIG permission on the instance
Errors: NOT_FOUND if instance does not exist
"""
return self.execute_unary(
request=request,
method=MethodInfo(
name="RemoveInstanceAccountsBatch",
service_name="soulfire.v1.InstanceService",
input=InstanceRemoveAccountsBatchRequest,
output=InstanceRemoveAccountsBatchResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
headers=headers,
timeout_ms=timeout_ms,
)
[docs]
def add_instance_proxy(
self,
request: InstanceAddProxyRequest,
*,
headers: Headers | Mapping[str, str] | None = None,
timeout_ms: int | None = None,
) -> InstanceAddProxyResponse:
"""
Adds a proxy to the instance.
Requires: UPDATE_INSTANCE_CONFIG permission on the instance
Errors: NOT_FOUND if instance does not exist
"""
return self.execute_unary(
request=request,
method=MethodInfo(
name="AddInstanceProxy",
service_name="soulfire.v1.InstanceService",
input=InstanceAddProxyRequest,
output=InstanceAddProxyResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
headers=headers,
timeout_ms=timeout_ms,
)
[docs]
def remove_instance_proxy(
self,
request: InstanceRemoveProxyRequest,
*,
headers: Headers | Mapping[str, str] | None = None,
timeout_ms: int | None = None,
) -> InstanceRemoveProxyResponse:
"""
Removes a proxy from the instance by its index.
Requires: UPDATE_INSTANCE_CONFIG permission on the instance
Errors: NOT_FOUND if instance does not exist
Errors: INVALID_ARGUMENT if index is out of bounds
"""
return self.execute_unary(
request=request,
method=MethodInfo(
name="RemoveInstanceProxy",
service_name="soulfire.v1.InstanceService",
input=InstanceRemoveProxyRequest,
output=InstanceRemoveProxyResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
headers=headers,
timeout_ms=timeout_ms,
)
[docs]
def update_instance_proxy(
self,
request: InstanceUpdateProxyRequest,
*,
headers: Headers | Mapping[str, str] | None = None,
timeout_ms: int | None = None,
) -> InstanceUpdateProxyResponse:
"""
Updates an existing proxy in the instance by its index.
Requires: UPDATE_INSTANCE_CONFIG permission on the instance
Errors: NOT_FOUND if instance does not exist
Errors: INVALID_ARGUMENT if index is out of bounds
"""
return self.execute_unary(
request=request,
method=MethodInfo(
name="UpdateInstanceProxy",
service_name="soulfire.v1.InstanceService",
input=InstanceUpdateProxyRequest,
output=InstanceUpdateProxyResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
headers=headers,
timeout_ms=timeout_ms,
)
[docs]
def add_instance_proxies_batch(
self,
request: InstanceAddProxiesBatchRequest,
*,
headers: Headers | Mapping[str, str] | None = None,
timeout_ms: int | None = None,
) -> InstanceAddProxiesBatchResponse:
"""
Adds multiple proxies to the instance in a single operation.
More efficient than multiple AddInstanceProxy calls.
Requires: UPDATE_INSTANCE_CONFIG permission on the instance
Errors: NOT_FOUND if instance does not exist
"""
return self.execute_unary(
request=request,
method=MethodInfo(
name="AddInstanceProxiesBatch",
service_name="soulfire.v1.InstanceService",
input=InstanceAddProxiesBatchRequest,
output=InstanceAddProxiesBatchResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
headers=headers,
timeout_ms=timeout_ms,
)
[docs]
def remove_instance_proxies_batch(
self,
request: InstanceRemoveProxiesBatchRequest,
*,
headers: Headers | Mapping[str, str] | None = None,
timeout_ms: int | None = None,
) -> InstanceRemoveProxiesBatchResponse:
"""
Removes multiple proxies from the instance by their addresses.
More efficient than multiple RemoveInstanceProxy calls.
Requires: UPDATE_INSTANCE_CONFIG permission on the instance
Errors: NOT_FOUND if instance does not exist
"""
return self.execute_unary(
request=request,
method=MethodInfo(
name="RemoveInstanceProxiesBatch",
service_name="soulfire.v1.InstanceService",
input=InstanceRemoveProxiesBatchRequest,
output=InstanceRemoveProxiesBatchResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
headers=headers,
timeout_ms=timeout_ms,
)
[docs]
def remove_instance_proxy_entries(
self,
request: InstanceRemoveProxyEntriesRequest,
*,
headers: Headers | Mapping[str, str] | None = None,
timeout_ms: int | None = None,
) -> InstanceRemoveProxyEntriesResponse:
"""
Removes one matching occurrence of each requested proxy entry.
Requires: UPDATE_INSTANCE_CONFIG permission on the instance
Errors: NOT_FOUND if the instance does not exist; INVALID_ARGUMENT for invalid proxies
"""
return self.execute_unary(
request=request,
method=MethodInfo(
name="RemoveInstanceProxyEntries",
service_name="soulfire.v1.InstanceService",
input=InstanceRemoveProxyEntriesRequest,
output=InstanceRemoveProxyEntriesResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
headers=headers,
timeout_ms=timeout_ms,
)
[docs]
def get_audit_log(
self,
request: InstanceAuditLogRequest,
*,
headers: Headers | Mapping[str, str] | None = None,
timeout_ms: int | None = None,
) -> InstanceAuditLogResponse:
"""
Retrieves the audit log for an instance.
Returns a list of recorded actions ordered by timestamp (newest first).
Requires: READ_INSTANCE_AUDIT_LOGS permission on the instance
Errors: NOT_FOUND if instance does not exist
"""
return self.execute_unary(
request=request,
method=MethodInfo(
name="GetAuditLog",
service_name="soulfire.v1.InstanceService",
input=InstanceAuditLogRequest,
output=InstanceAuditLogResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
headers=headers,
timeout_ms=timeout_ms,
)
[docs]
def set_account_metadata_entry(
self,
request: SetAccountMetadataEntryRequest,
*,
headers: Headers | Mapping[str, str] | None = None,
timeout_ms: int | None = None,
) -> SetAccountMetadataEntryResponse:
"""
Sets a single persistent metadata entry for a Minecraft account.
Creates the namespace and key if they don't exist, or updates if they do.
Requires: UPDATE_INSTANCE_CONFIG permission on the instance
Errors: NOT_FOUND if instance does not exist
"""
return self.execute_unary(
request=request,
method=MethodInfo(
name="SetAccountMetadataEntry",
service_name="soulfire.v1.InstanceService",
input=SetAccountMetadataEntryRequest,
output=SetAccountMetadataEntryResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
headers=headers,
timeout_ms=timeout_ms,
)
[docs]
def delete_account_metadata_entry(
self,
request: DeleteAccountMetadataEntryRequest,
*,
headers: Headers | Mapping[str, str] | None = None,
timeout_ms: int | None = None,
) -> DeleteAccountMetadataEntryResponse:
"""
Deletes a persistent metadata entry from a Minecraft account.
Requires: UPDATE_INSTANCE_CONFIG permission on the instance
Errors: NOT_FOUND if instance does not exist
"""
return self.execute_unary(
request=request,
method=MethodInfo(
name="DeleteAccountMetadataEntry",
service_name="soulfire.v1.InstanceService",
input=DeleteAccountMetadataEntryRequest,
output=DeleteAccountMetadataEntryResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
headers=headers,
timeout_ms=timeout_ms,
)
[docs]
def set_instance_metadata_entry(
self,
request: SetInstanceMetadataEntryRequest,
*,
headers: Headers | Mapping[str, str] | None = None,
timeout_ms: int | None = None,
) -> SetInstanceMetadataEntryResponse:
"""
Sets a single persistent metadata entry for the instance.
Creates the namespace and key if they don't exist, or updates if they do.
Requires: UPDATE_INSTANCE_META permission on the instance
Errors: NOT_FOUND if instance does not exist
"""
return self.execute_unary(
request=request,
method=MethodInfo(
name="SetInstanceMetadataEntry",
service_name="soulfire.v1.InstanceService",
input=SetInstanceMetadataEntryRequest,
output=SetInstanceMetadataEntryResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
headers=headers,
timeout_ms=timeout_ms,
)
[docs]
def delete_instance_metadata_entry(
self,
request: DeleteInstanceMetadataEntryRequest,
*,
headers: Headers | Mapping[str, str] | None = None,
timeout_ms: int | None = None,
) -> DeleteInstanceMetadataEntryResponse:
"""
Deletes a persistent metadata entry from the instance.
Requires: UPDATE_INSTANCE_META permission on the instance
Errors: NOT_FOUND if instance does not exist
"""
return self.execute_unary(
request=request,
method=MethodInfo(
name="DeleteInstanceMetadataEntry",
service_name="soulfire.v1.InstanceService",
input=DeleteInstanceMetadataEntryRequest,
output=DeleteInstanceMetadataEntryResponse,
idempotency_level=IdempotencyLevel.UNKNOWN,
stream_type=StreamType.UNARY,
),
headers=headers,
timeout_ms=timeout_ms,
)