Esempio n. 1
0
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')]
Esempio n. 2
0
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')]
Esempio n. 3
0
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]
Esempio n. 4
0
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)
Esempio n. 6
0
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')]
Esempio n. 7
0
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
Esempio n. 9
0
    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)
Esempio n. 10
0
 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')]
Esempio n. 11
0
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)
Esempio n. 12
0
class _SPTestClass1:
    barf: int = 5
    eep: str = 'blah'
    barf2: Annotated[int, IOAttrs('b')] = 5
Esempio n. 13
0
 class _TestClass3:
     ival: Annotated[int, IOAttrs(store_default=False)] = 4
     ival2: Annotated[int, IOAttrs('ival')] = 5
Esempio n. 14
0
 class _TestClass2:
     ival: int = 4
     ival2: Annotated[int, IOAttrs('ival')] = 5
Esempio n. 15
0
class BoolResponse(Response):
    """A simple bool value response."""

    value: Annotated[bool, IOAttrs('v')]
Esempio n. 16
0
 class _TestClass2:
     tval: Annotated[datetime.datetime, IOAttrs(whole_days=True)]
Esempio n. 17
0
 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)
Esempio n. 19
0
 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)
Esempio n. 21
0
class StringResponse(Response):
    """A simple string value response."""

    value: Annotated[str, IOAttrs('v')]
Esempio n. 22
0
class _SPTestClass2:
    rah: bool = False
    subc: _SPTestClass1 = field(default_factory=_SPTestClass1)
    subc2: Annotated[_SPTestClass1,
                     IOAttrs('s')] = field(default_factory=_SPTestClass1)
Esempio n. 23
0
 class _TestClass:
     tval: Annotated[datetime.datetime, IOAttrs(whole_hours=True)]
Esempio n. 24
0
 class _TestClassD3:
     lval: Annotated[dict, IOAttrs(soft_default={})]
Esempio n. 25
0
 class _TestClass2:
     dval: Annotated[Dict, IOAttrs('d', store_default=False)]
Esempio n. 26
0
 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')]
Esempio n. 28
0
 class _TestClass:
     ival: Annotated[int, IOAttrs('i')] = 4
     ival2: Annotated[int, IOAttrs('i')] = 5
Esempio n. 29
0
 class _TestClass:
     dval: Annotated[Dict, IOAttrs('d')]
Esempio n. 30
0
 class _TestClassE2:
     lval: Annotated[str, IOAttrs(soft_default=45)]