class CredentialsCheckResponse(Response): """Info returned when checking credentials.""" verified: Annotated[bool, IOAttrs('v')] # Current account tag (good time to check if it has changed). tag: Annotated[str, IOAttrs('t')]
class _PeerInfo: # So we can gracefully evolve how we communicate in the future. protocol: Annotated[int, IOAttrs('p')] # How often we'll be sending out keepalives (in seconds). keepalive_interval: Annotated[float, IOAttrs('k')]
class LoginProxyStateQueryMessage(Message): """Soo.. how is that login proxy going?""" proxyid: Annotated[str, IOAttrs('p')] proxykey: Annotated[str, IOAttrs('k')] @classmethod def get_response_types(cls) -> list[type[Response]]: return [LoginProxyStateQueryResponse]
class ErrorResponse(Response): """Message saying some error has occurred on the other end. This type is unique in that it is not returned to the user; it instead results in a local exception being raised. """ error_message: Annotated[str, IOAttrs('m')] error_type: Annotated[ErrorType, IOAttrs('t')]
class ServerNodeQueryResponse: """A response to a query about server-nodes.""" # If present, something went wrong, and this describes it. error: Annotated[Optional[str], IOAttrs('e', store_default=False)] = None # The set of servernodes. servers: Annotated[list[ServerNodeEntry], IOAttrs('s', store_default=False)] = field( default_factory=list)
class LoginProxyRequestResponse(Response): """Response to a request for a login proxy.""" # URL to direct the user to for login. url: Annotated[str, IOAttrs('u')] # Proxy-Login id for querying results. proxyid: Annotated[str, IOAttrs('p')] # Proxy-Login key for querying results. proxykey: Annotated[str, IOAttrs('k')]
class LoginProxyStateQueryResponse(Response): """Here's the info on that login-proxy you asked about, boss.""" class State(Enum): """States a login-proxy can be in.""" WAITING = 'waiting' SUCCESS = 'success' FAIL = 'fail' state: Annotated[State, IOAttrs('s')] # On success, these will be filled out. credentials: Annotated[Optional[str], IOAttrs('tk')]
class AssetPackageBuildState: """Contains info about an in-progress asset cloud build.""" # Asset names still being built. in_progress_builds: Annotated[list[str], IOAttrs('b')] = field(default_factory=list) # The initial number of assets needing to be built. initial_build_count: Annotated[int, IOAttrs('c')] = 0 # Build error string. If this is present, it should be presented # to the user and they should required to explicitly restart the build # in some way if desired. error: Annotated[Optional[str], IOAttrs('e')] = None
class _TestClass: @dataclass class _TestSubClass: val1: int = 0 val2: Annotated[int, IOAttrs('v2')] = 0 sub1: _TestSubClass = field(default_factory=_TestSubClass) sub2: Annotated[_TestSubClass, IOAttrs('s2')] = field(default_factory=_TestSubClass)
class Entry: """Info about a particular build.""" filename: Annotated[str, IOAttrs('fname')] size: Annotated[int, IOAttrs('size')] version: Annotated[str, IOAttrs('version')] build_number: Annotated[int, IOAttrs('build')] checksum: Annotated[str, IOAttrs('checksum')] createtime: Annotated[datetime.datetime, IOAttrs('createtime')]
class BuildInfoSet: """Set of build infos.""" @dataclass class Entry: """Info about a particular build.""" filename: Annotated[str, IOAttrs('fname')] size: Annotated[int, IOAttrs('size')] version: Annotated[str, IOAttrs('version')] build_number: Annotated[int, IOAttrs('build')] checksum: Annotated[str, IOAttrs('checksum')] createtime: Annotated[datetime.datetime, IOAttrs('createtime')] builds: Annotated[list[Entry], IOAttrs('builds')] = field(default_factory=list)
class _SPTestClass1: barf: int = 5 eep: str = 'blah' barf2: Annotated[int, IOAttrs('b')] = 5
class _TestClass3: ival: Annotated[int, IOAttrs(store_default=False)] = 4 ival2: Annotated[int, IOAttrs('ival')] = 5
class _TestClass2: ival: int = 4 ival2: Annotated[int, IOAttrs('ival')] = 5
class BoolResponse(Response): """A simple bool value response.""" value: Annotated[bool, IOAttrs('v')]
class _TestClass2: tval: Annotated[datetime.datetime, IOAttrs(whole_days=True)]
class _TestSubClass: val1: int = 0 val2: Annotated[int, IOAttrs('v2')] = 0
class State: """Holds all persistent state for the asset-manager.""" files: Annotated[dict[str, FileValue], IOAttrs('files')] = field(default_factory=dict)
class _TestClassE: lval: Annotated[int, IOAttrs(soft_default='')]
class AssetPackageFlavorManifest: """A manifest of asset info for a specific flavor of an asset package.""" cloudfiles: Annotated[dict[str, str], IOAttrs('cloudfiles')] = field(default_factory=dict)
class StringResponse(Response): """A simple string value response.""" value: Annotated[str, IOAttrs('v')]
class _SPTestClass2: rah: bool = False subc: _SPTestClass1 = field(default_factory=_SPTestClass1) subc2: Annotated[_SPTestClass1, IOAttrs('s')] = field(default_factory=_SPTestClass1)
class _TestClass: tval: Annotated[datetime.datetime, IOAttrs(whole_hours=True)]
class _TestClassD3: lval: Annotated[dict, IOAttrs(soft_default={})]
class _TestClass2: dval: Annotated[Dict, IOAttrs('d', store_default=False)]
class _TestClass3: dval: Annotated[Dict, IOAttrs('d', store_default=False)] = field( default_factory=dict) ival: Annotated[int, IOAttrs('i', store_default=False)] = 123
class ServerNodeEntry: """Information about a specific server.""" region: Annotated[str, IOAttrs('r')] address: Annotated[str, IOAttrs('a')] port: Annotated[int, IOAttrs('p')]
class _TestClass: ival: Annotated[int, IOAttrs('i')] = 4 ival2: Annotated[int, IOAttrs('i')] = 5
class _TestClass: dval: Annotated[Dict, IOAttrs('d')]
class _TestClassE2: lval: Annotated[str, IOAttrs(soft_default=45)]