-from collections import namedtuple
import re
+from collections import namedtuple
+from . import _client, _definitions
from .facade import ReturnMapping, Type, TypeEncoder
-from .import _client
-from .import _definitions
-
__all__ = [
'Delta',
__patches__ = [
'ResourcesFacade',
'AllWatcherFacade',
+ 'ActionFacade',
]
return result
+class ActionFacade(Type):
+
+ class _FindTagsResults(Type):
+ _toSchema = {'matches': 'matches'}
+ _toPy = {'matches': 'matches'}
+
+ def __init__(self, matches=None, **unknown_fields):
+ '''
+ FindTagsResults wraps the mapping between the requested prefix and the
+ matching tags for each requested prefix.
+
+ Matches map[string][]Entity `json:"matches"`
+ '''
+ self.matches = {}
+ matches = matches or {}
+ for prefix, tags in matches.items():
+ self.matches[prefix] = [_definitions.Entity.from_json(r)
+ for r in tags]
+
+ @ReturnMapping(_FindTagsResults)
+ async def FindActionTagsByPrefix(self, prefixes):
+ '''
+ prefixes : typing.Sequence[str]
+ Returns -> typing.Sequence[~Entity]
+ '''
+ # map input types to rpc msg
+ _params = dict()
+ msg = dict(type='Action',
+ request='FindActionTagsByPrefix',
+ version=2,
+ params=_params)
+ _params['prefixes'] = prefixes
+ reply = await self.rpc(msg)
+ return reply
+
+
class Number(_definitions.Number):
"""
This type represents a semver string.
def __str__(self):
return self.serialize()
+ @property
+ def _cmp(self):
+ return (self.major, self.minor, self.tag, self.patch, self.build)
+
def __eq__(self, other):
- return (
- isinstance(other, type(self)) and
- other.major == self.major and
- other.minor == self.minor and
- other.tag == self.tag and
- other.patch == self.patch and
- other.build == self.build)
+ return isinstance(other, type(self)) and self._cmp == other._cmp
+
+ def __lt__(self, other):
+ return self._cmp < other._cmp
+
+ def __le__(self, other):
+ return self._cmp <= other._cmp
+
+ def __gt__(self, other):
+ return self._cmp > other._cmp
+
+ def __ge__(self, other):
+ return self._cmp >= other._cmp
@classmethod
def from_json(cls, data):