hermers 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- hermers/__init__.py +18 -0
- hermers/client.py +3 -0
- hermers/crypto.py +16 -0
- hermers/errors.py +70 -0
- hermers/generated/__init__.py +10 -0
- hermers/generated/contact_pb2.py +57 -0
- hermers/generated/contact_pb2_grpc.py +312 -0
- hermers/generated/feeds_pb2.py +56 -0
- hermers/generated/feeds_pb2_grpc.py +312 -0
- hermers/generated/mail_pb2.py +77 -0
- hermers/generated/mail_pb2_grpc.py +484 -0
- hermers/generated/security_pb2.py +48 -0
- hermers/generated/security_pb2_grpc.py +97 -0
- hermers/generated/session_pb2.py +65 -0
- hermers/generated/session_pb2_grpc.py +398 -0
- hermers/generated/spam_pb2.py +48 -0
- hermers/generated/spam_pb2_grpc.py +140 -0
- hermers/generated/storage_pb2.py +50 -0
- hermers/generated/storage_pb2_grpc.py +183 -0
- hermers/generated/sync_pb2.py +45 -0
- hermers/generated/sync_pb2_grpc.py +140 -0
- hermers/generated/tier_pb2.py +48 -0
- hermers/generated/tier_pb2_grpc.py +140 -0
- hermers/generated/usage_pb2.py +52 -0
- hermers/generated/usage_pb2_grpc.py +226 -0
- hermers/grpc/__init__.py +9 -0
- hermers/grpc/client.py +361 -0
- hermers/grpc/errors.py +3 -0
- hermers/grpc_client.py +361 -0
- hermers/rest/__init__.py +10 -0
- hermers/rest/calendar.py +34 -0
- hermers/rest/client.py +249 -0
- hermers/rest/contacts.py +44 -0
- hermers/rest/errors.py +3 -0
- hermers/rest/feeds.py +18 -0
- hermers/rest/keys.py +42 -0
- hermers/rest/mail.py +54 -0
- hermers/rest/scheduling.py +31 -0
- hermers/rest/tenant.py +92 -0
- hermers/rest/types.py +649 -0
- hermers/rest/user.py +29 -0
- hermers/rest_types.py +651 -0
- hermers-0.1.0.dist-info/METADATA +154 -0
- hermers-0.1.0.dist-info/RECORD +47 -0
- hermers-0.1.0.dist-info/WHEEL +5 -0
- hermers-0.1.0.dist-info/licenses/LICENSE +21 -0
- hermers-0.1.0.dist-info/top_level.txt +1 -0
hermers/__init__.py
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
from .client import BASE_URL, Hermes, HermesOptions, Identity, new
|
|
2
|
+
from .errors import HermesError, HermesGrpcError
|
|
3
|
+
from .grpc.client import BASE_ENDPOINT, GrpcIdentity, HermesGrpc, HermesGrpcOptions, connect
|
|
4
|
+
|
|
5
|
+
__all__ = [
|
|
6
|
+
"BASE_ENDPOINT",
|
|
7
|
+
"BASE_URL",
|
|
8
|
+
"GrpcIdentity",
|
|
9
|
+
"Hermes",
|
|
10
|
+
"HermesError",
|
|
11
|
+
"HermesGrpc",
|
|
12
|
+
"HermesGrpcError",
|
|
13
|
+
"HermesGrpcOptions",
|
|
14
|
+
"HermesOptions",
|
|
15
|
+
"Identity",
|
|
16
|
+
"connect",
|
|
17
|
+
"new",
|
|
18
|
+
]
|
hermers/client.py
ADDED
hermers/crypto.py
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import hashlib
|
|
4
|
+
import secrets
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def generate_key() -> str:
|
|
8
|
+
return f"hm_live_{secrets.token_urlsafe(24)}"
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def hash_key(raw_key: str) -> str:
|
|
12
|
+
return hashlib.sha256(raw_key.encode("utf-8")).hexdigest()
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def prefix_key(raw_key: str, *, limit: int = 16) -> str:
|
|
16
|
+
return raw_key[:limit]
|
hermers/errors.py
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from dataclasses import dataclass
|
|
4
|
+
from typing import Any
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
@dataclass(slots=True)
|
|
8
|
+
class ErrorPayload:
|
|
9
|
+
message: str
|
|
10
|
+
status: int = 0
|
|
11
|
+
code: str = "unknown_error"
|
|
12
|
+
field: str | None = None
|
|
13
|
+
request_id: str | None = None
|
|
14
|
+
body: Any = None
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class HermesError(Exception):
|
|
18
|
+
def __init__(
|
|
19
|
+
self,
|
|
20
|
+
message: str,
|
|
21
|
+
*,
|
|
22
|
+
status: int = 0,
|
|
23
|
+
code: str = "unknown_error",
|
|
24
|
+
field: str | None = None,
|
|
25
|
+
request_id: str | None = None,
|
|
26
|
+
body: Any = None,
|
|
27
|
+
) -> None:
|
|
28
|
+
super().__init__(message)
|
|
29
|
+
self.message = message
|
|
30
|
+
self.status = status
|
|
31
|
+
self.code = code
|
|
32
|
+
self.field = field
|
|
33
|
+
self.request_id = request_id
|
|
34
|
+
self.body = body
|
|
35
|
+
|
|
36
|
+
@classmethod
|
|
37
|
+
def from_http(cls, status: int, status_text: str, body: Any) -> "HermesError":
|
|
38
|
+
if isinstance(body, dict) and isinstance(body.get("error"), dict):
|
|
39
|
+
error = body["error"]
|
|
40
|
+
return cls(
|
|
41
|
+
str(error.get("message") or status_text or "Request failed"),
|
|
42
|
+
status=status,
|
|
43
|
+
code=str(error.get("code") or "request_failed"),
|
|
44
|
+
field=error.get("field"),
|
|
45
|
+
request_id=error.get("request_id"),
|
|
46
|
+
body=body,
|
|
47
|
+
)
|
|
48
|
+
return cls(status_text or "Request failed", status=status, code="request_failed", body=body)
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
class HermesGrpcError(Exception):
|
|
52
|
+
def __init__(
|
|
53
|
+
self,
|
|
54
|
+
message: str,
|
|
55
|
+
*,
|
|
56
|
+
code: str = "UNKNOWN",
|
|
57
|
+
details: str | None = None,
|
|
58
|
+
body: Any = None,
|
|
59
|
+
) -> None:
|
|
60
|
+
super().__init__(message)
|
|
61
|
+
self.message = message
|
|
62
|
+
self.code = code
|
|
63
|
+
self.details = details
|
|
64
|
+
self.body = body
|
|
65
|
+
|
|
66
|
+
@classmethod
|
|
67
|
+
def from_rpc_error(cls, err: Exception) -> "HermesGrpcError":
|
|
68
|
+
code = getattr(getattr(err, "code", lambda: None)(), "name", "UNKNOWN")
|
|
69
|
+
details = getattr(err, "details", lambda: None)()
|
|
70
|
+
return cls(details or str(err), code=code, details=details, body=err)
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import sys
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
|
|
6
|
+
# grpc_tools generates sibling imports like `import contact_pb2`.
|
|
7
|
+
# Put this package directory on sys.path so those imports resolve.
|
|
8
|
+
pkg_dir = str(Path(__file__).resolve().parent)
|
|
9
|
+
if pkg_dir not in sys.path:
|
|
10
|
+
sys.path.append(pkg_dir)
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
|
+
# NO CHECKED-IN PROTOBUF GENCODE
|
|
4
|
+
# source: contact.proto
|
|
5
|
+
# Protobuf Python Version: 7.35.1
|
|
6
|
+
"""Generated protocol buffer code."""
|
|
7
|
+
from google.protobuf import descriptor as _descriptor
|
|
8
|
+
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
9
|
+
from google.protobuf import runtime_version as _runtime_version
|
|
10
|
+
from google.protobuf import symbol_database as _symbol_database
|
|
11
|
+
from google.protobuf.internal import builder as _builder
|
|
12
|
+
_runtime_version.ValidateProtobufRuntimeVersion(
|
|
13
|
+
_runtime_version.Domain.PUBLIC,
|
|
14
|
+
7,
|
|
15
|
+
35,
|
|
16
|
+
1,
|
|
17
|
+
'',
|
|
18
|
+
'contact.proto'
|
|
19
|
+
)
|
|
20
|
+
# @@protoc_insertion_point(imports)
|
|
21
|
+
|
|
22
|
+
_sym_db = _symbol_database.Default()
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\rcontact.proto\x12\x0ehermes.contact\x1a\x1fgoogle/protobuf/timestamp.proto\"\xac\x01\n\x07\x43ontact\x12\x0b\n\x03hex\x18\x01 \x01(\t\x12\x0e\n\x06tenant\x18\x02 \x01(\t\x12\r\n\x05owner\x18\x03 \x01(\t\x12\r\n\x05vcard\x18\x04 \x01(\t\x12\x0c\n\x04\x65tag\x18\x05 \x01(\t\x12+\n\x07\x63reated\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12+\n\x07updated\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"8\n\x07ListReq\x12\x0e\n\x06tenant\x18\x01 \x01(\t\x12\x0e\n\x06\x63ursor\x18\x02 \x01(\t\x12\r\n\x05limit\x18\x03 \x01(\r\"@\n\x08ListResp\x12&\n\x05items\x18\x01 \x03(\x0b\x32\x17.hermes.contact.Contact\x12\x0c\n\x04next\x18\x02 \x01(\t\"\x15\n\x06GetReq\x12\x0b\n\x03hex\x18\x01 \x01(\t\"9\n\tCreateReq\x12\x0e\n\x06tenant\x18\x01 \x01(\t\x12\r\n\x05owner\x18\x02 \x01(\t\x12\r\n\x05vcard\x18\x03 \x01(\t\"5\n\tUpdateReq\x12\x0b\n\x03hex\x18\x01 \x01(\t\x12\r\n\x05vcard\x18\x02 \x01(\t\x12\x0c\n\x04\x65tag\x18\x03 \x01(\t\"\x18\n\tRemoveReq\x12\x0b\n\x03hex\x18\x01 \x01(\t\"\x0c\n\nRemoveResp\"D\n\x07SyncReq\x12\x0e\n\x06tenant\x18\x01 \x01(\t\x12)\n\x05since\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"E\n\x08SyncResp\x12(\n\x07\x63hanged\x18\x01 \x03(\x0b\x32\x17.hermes.contact.Contact\x12\x0f\n\x07removed\x18\x02 \x03(\t2\xfb\x02\n\x0e\x43ontactService\x12\x39\n\x04List\x12\x17.hermes.contact.ListReq\x1a\x18.hermes.contact.ListResp\x12\x36\n\x03Get\x12\x16.hermes.contact.GetReq\x1a\x17.hermes.contact.Contact\x12<\n\x06\x43reate\x12\x19.hermes.contact.CreateReq\x1a\x17.hermes.contact.Contact\x12<\n\x06Update\x12\x19.hermes.contact.UpdateReq\x1a\x17.hermes.contact.Contact\x12?\n\x06Remove\x12\x19.hermes.contact.RemoveReq\x1a\x1a.hermes.contact.RemoveResp\x12\x39\n\x04Sync\x12\x17.hermes.contact.SyncReq\x1a\x18.hermes.contact.SyncRespb\x06proto3')
|
|
29
|
+
|
|
30
|
+
_globals = globals()
|
|
31
|
+
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
|
32
|
+
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'contact_pb2', _globals)
|
|
33
|
+
if not _descriptor._USE_C_DESCRIPTORS:
|
|
34
|
+
DESCRIPTOR._loaded_options = None
|
|
35
|
+
_globals['_CONTACT']._serialized_start=67
|
|
36
|
+
_globals['_CONTACT']._serialized_end=239
|
|
37
|
+
_globals['_LISTREQ']._serialized_start=241
|
|
38
|
+
_globals['_LISTREQ']._serialized_end=297
|
|
39
|
+
_globals['_LISTRESP']._serialized_start=299
|
|
40
|
+
_globals['_LISTRESP']._serialized_end=363
|
|
41
|
+
_globals['_GETREQ']._serialized_start=365
|
|
42
|
+
_globals['_GETREQ']._serialized_end=386
|
|
43
|
+
_globals['_CREATEREQ']._serialized_start=388
|
|
44
|
+
_globals['_CREATEREQ']._serialized_end=445
|
|
45
|
+
_globals['_UPDATEREQ']._serialized_start=447
|
|
46
|
+
_globals['_UPDATEREQ']._serialized_end=500
|
|
47
|
+
_globals['_REMOVEREQ']._serialized_start=502
|
|
48
|
+
_globals['_REMOVEREQ']._serialized_end=526
|
|
49
|
+
_globals['_REMOVERESP']._serialized_start=528
|
|
50
|
+
_globals['_REMOVERESP']._serialized_end=540
|
|
51
|
+
_globals['_SYNCREQ']._serialized_start=542
|
|
52
|
+
_globals['_SYNCREQ']._serialized_end=610
|
|
53
|
+
_globals['_SYNCRESP']._serialized_start=612
|
|
54
|
+
_globals['_SYNCRESP']._serialized_end=681
|
|
55
|
+
_globals['_CONTACTSERVICE']._serialized_start=684
|
|
56
|
+
_globals['_CONTACTSERVICE']._serialized_end=1063
|
|
57
|
+
# @@protoc_insertion_point(module_scope)
|
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
|
|
2
|
+
"""Client and server classes corresponding to protobuf-defined services."""
|
|
3
|
+
import grpc
|
|
4
|
+
import warnings
|
|
5
|
+
|
|
6
|
+
import contact_pb2 as contact__pb2
|
|
7
|
+
|
|
8
|
+
GRPC_GENERATED_VERSION = '1.83.0'
|
|
9
|
+
GRPC_VERSION = grpc.__version__
|
|
10
|
+
_version_not_supported = False
|
|
11
|
+
|
|
12
|
+
try:
|
|
13
|
+
from grpc._utilities import first_version_is_lower
|
|
14
|
+
_version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
|
|
15
|
+
except ImportError:
|
|
16
|
+
_version_not_supported = True
|
|
17
|
+
|
|
18
|
+
if _version_not_supported:
|
|
19
|
+
raise RuntimeError(
|
|
20
|
+
f'The grpc package installed is at version {GRPC_VERSION},'
|
|
21
|
+
+ ' but the generated code in contact_pb2_grpc.py depends on'
|
|
22
|
+
+ f' grpcio>={GRPC_GENERATED_VERSION}.'
|
|
23
|
+
+ f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
|
|
24
|
+
+ f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class ContactServiceStub:
|
|
29
|
+
"""Missing associated documentation comment in .proto file."""
|
|
30
|
+
|
|
31
|
+
def __init__(self, channel):
|
|
32
|
+
"""Constructor.
|
|
33
|
+
|
|
34
|
+
Args:
|
|
35
|
+
channel: A grpc.Channel.
|
|
36
|
+
"""
|
|
37
|
+
self.List = channel.unary_unary(
|
|
38
|
+
'/hermes.contact.ContactService/List',
|
|
39
|
+
request_serializer=contact__pb2.ListReq.SerializeToString,
|
|
40
|
+
response_deserializer=contact__pb2.ListResp.FromString,
|
|
41
|
+
_registered_method=True)
|
|
42
|
+
self.Get = channel.unary_unary(
|
|
43
|
+
'/hermes.contact.ContactService/Get',
|
|
44
|
+
request_serializer=contact__pb2.GetReq.SerializeToString,
|
|
45
|
+
response_deserializer=contact__pb2.Contact.FromString,
|
|
46
|
+
_registered_method=True)
|
|
47
|
+
self.Create = channel.unary_unary(
|
|
48
|
+
'/hermes.contact.ContactService/Create',
|
|
49
|
+
request_serializer=contact__pb2.CreateReq.SerializeToString,
|
|
50
|
+
response_deserializer=contact__pb2.Contact.FromString,
|
|
51
|
+
_registered_method=True)
|
|
52
|
+
self.Update = channel.unary_unary(
|
|
53
|
+
'/hermes.contact.ContactService/Update',
|
|
54
|
+
request_serializer=contact__pb2.UpdateReq.SerializeToString,
|
|
55
|
+
response_deserializer=contact__pb2.Contact.FromString,
|
|
56
|
+
_registered_method=True)
|
|
57
|
+
self.Remove = channel.unary_unary(
|
|
58
|
+
'/hermes.contact.ContactService/Remove',
|
|
59
|
+
request_serializer=contact__pb2.RemoveReq.SerializeToString,
|
|
60
|
+
response_deserializer=contact__pb2.RemoveResp.FromString,
|
|
61
|
+
_registered_method=True)
|
|
62
|
+
self.Sync = channel.unary_unary(
|
|
63
|
+
'/hermes.contact.ContactService/Sync',
|
|
64
|
+
request_serializer=contact__pb2.SyncReq.SerializeToString,
|
|
65
|
+
response_deserializer=contact__pb2.SyncResp.FromString,
|
|
66
|
+
_registered_method=True)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
class ContactServiceServicer:
|
|
70
|
+
"""Missing associated documentation comment in .proto file."""
|
|
71
|
+
|
|
72
|
+
def List(self, request, context):
|
|
73
|
+
"""Missing associated documentation comment in .proto file."""
|
|
74
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
75
|
+
context.set_details('Method not implemented!')
|
|
76
|
+
raise NotImplementedError('Method not implemented!')
|
|
77
|
+
|
|
78
|
+
def Get(self, request, context):
|
|
79
|
+
"""Missing associated documentation comment in .proto file."""
|
|
80
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
81
|
+
context.set_details('Method not implemented!')
|
|
82
|
+
raise NotImplementedError('Method not implemented!')
|
|
83
|
+
|
|
84
|
+
def Create(self, request, context):
|
|
85
|
+
"""Missing associated documentation comment in .proto file."""
|
|
86
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
87
|
+
context.set_details('Method not implemented!')
|
|
88
|
+
raise NotImplementedError('Method not implemented!')
|
|
89
|
+
|
|
90
|
+
def Update(self, request, context):
|
|
91
|
+
"""Missing associated documentation comment in .proto file."""
|
|
92
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
93
|
+
context.set_details('Method not implemented!')
|
|
94
|
+
raise NotImplementedError('Method not implemented!')
|
|
95
|
+
|
|
96
|
+
def Remove(self, request, context):
|
|
97
|
+
"""Missing associated documentation comment in .proto file."""
|
|
98
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
99
|
+
context.set_details('Method not implemented!')
|
|
100
|
+
raise NotImplementedError('Method not implemented!')
|
|
101
|
+
|
|
102
|
+
def Sync(self, request, context):
|
|
103
|
+
"""Missing associated documentation comment in .proto file."""
|
|
104
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
105
|
+
context.set_details('Method not implemented!')
|
|
106
|
+
raise NotImplementedError('Method not implemented!')
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
def add_ContactServiceServicer_to_server(servicer, server):
|
|
110
|
+
rpc_method_handlers = {
|
|
111
|
+
'List': grpc.unary_unary_rpc_method_handler(
|
|
112
|
+
servicer.List,
|
|
113
|
+
request_deserializer=contact__pb2.ListReq.FromString,
|
|
114
|
+
response_serializer=contact__pb2.ListResp.SerializeToString,
|
|
115
|
+
),
|
|
116
|
+
'Get': grpc.unary_unary_rpc_method_handler(
|
|
117
|
+
servicer.Get,
|
|
118
|
+
request_deserializer=contact__pb2.GetReq.FromString,
|
|
119
|
+
response_serializer=contact__pb2.Contact.SerializeToString,
|
|
120
|
+
),
|
|
121
|
+
'Create': grpc.unary_unary_rpc_method_handler(
|
|
122
|
+
servicer.Create,
|
|
123
|
+
request_deserializer=contact__pb2.CreateReq.FromString,
|
|
124
|
+
response_serializer=contact__pb2.Contact.SerializeToString,
|
|
125
|
+
),
|
|
126
|
+
'Update': grpc.unary_unary_rpc_method_handler(
|
|
127
|
+
servicer.Update,
|
|
128
|
+
request_deserializer=contact__pb2.UpdateReq.FromString,
|
|
129
|
+
response_serializer=contact__pb2.Contact.SerializeToString,
|
|
130
|
+
),
|
|
131
|
+
'Remove': grpc.unary_unary_rpc_method_handler(
|
|
132
|
+
servicer.Remove,
|
|
133
|
+
request_deserializer=contact__pb2.RemoveReq.FromString,
|
|
134
|
+
response_serializer=contact__pb2.RemoveResp.SerializeToString,
|
|
135
|
+
),
|
|
136
|
+
'Sync': grpc.unary_unary_rpc_method_handler(
|
|
137
|
+
servicer.Sync,
|
|
138
|
+
request_deserializer=contact__pb2.SyncReq.FromString,
|
|
139
|
+
response_serializer=contact__pb2.SyncResp.SerializeToString,
|
|
140
|
+
),
|
|
141
|
+
}
|
|
142
|
+
generic_handler = grpc.method_handlers_generic_handler(
|
|
143
|
+
'hermes.contact.ContactService', rpc_method_handlers)
|
|
144
|
+
server.add_generic_rpc_handlers((generic_handler,))
|
|
145
|
+
server.add_registered_method_handlers('hermes.contact.ContactService', rpc_method_handlers)
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
# This class is part of an EXPERIMENTAL API.
|
|
149
|
+
class ContactService:
|
|
150
|
+
"""Missing associated documentation comment in .proto file."""
|
|
151
|
+
|
|
152
|
+
@staticmethod
|
|
153
|
+
def List(request,
|
|
154
|
+
target,
|
|
155
|
+
options=(),
|
|
156
|
+
channel_credentials=None,
|
|
157
|
+
call_credentials=None,
|
|
158
|
+
insecure=False,
|
|
159
|
+
compression=None,
|
|
160
|
+
wait_for_ready=None,
|
|
161
|
+
timeout=None,
|
|
162
|
+
metadata=None):
|
|
163
|
+
return grpc.experimental.unary_unary(
|
|
164
|
+
request,
|
|
165
|
+
target,
|
|
166
|
+
'/hermes.contact.ContactService/List',
|
|
167
|
+
contact__pb2.ListReq.SerializeToString,
|
|
168
|
+
contact__pb2.ListResp.FromString,
|
|
169
|
+
options,
|
|
170
|
+
channel_credentials,
|
|
171
|
+
insecure,
|
|
172
|
+
call_credentials,
|
|
173
|
+
compression,
|
|
174
|
+
wait_for_ready,
|
|
175
|
+
timeout,
|
|
176
|
+
metadata,
|
|
177
|
+
_registered_method=True)
|
|
178
|
+
|
|
179
|
+
@staticmethod
|
|
180
|
+
def Get(request,
|
|
181
|
+
target,
|
|
182
|
+
options=(),
|
|
183
|
+
channel_credentials=None,
|
|
184
|
+
call_credentials=None,
|
|
185
|
+
insecure=False,
|
|
186
|
+
compression=None,
|
|
187
|
+
wait_for_ready=None,
|
|
188
|
+
timeout=None,
|
|
189
|
+
metadata=None):
|
|
190
|
+
return grpc.experimental.unary_unary(
|
|
191
|
+
request,
|
|
192
|
+
target,
|
|
193
|
+
'/hermes.contact.ContactService/Get',
|
|
194
|
+
contact__pb2.GetReq.SerializeToString,
|
|
195
|
+
contact__pb2.Contact.FromString,
|
|
196
|
+
options,
|
|
197
|
+
channel_credentials,
|
|
198
|
+
insecure,
|
|
199
|
+
call_credentials,
|
|
200
|
+
compression,
|
|
201
|
+
wait_for_ready,
|
|
202
|
+
timeout,
|
|
203
|
+
metadata,
|
|
204
|
+
_registered_method=True)
|
|
205
|
+
|
|
206
|
+
@staticmethod
|
|
207
|
+
def Create(request,
|
|
208
|
+
target,
|
|
209
|
+
options=(),
|
|
210
|
+
channel_credentials=None,
|
|
211
|
+
call_credentials=None,
|
|
212
|
+
insecure=False,
|
|
213
|
+
compression=None,
|
|
214
|
+
wait_for_ready=None,
|
|
215
|
+
timeout=None,
|
|
216
|
+
metadata=None):
|
|
217
|
+
return grpc.experimental.unary_unary(
|
|
218
|
+
request,
|
|
219
|
+
target,
|
|
220
|
+
'/hermes.contact.ContactService/Create',
|
|
221
|
+
contact__pb2.CreateReq.SerializeToString,
|
|
222
|
+
contact__pb2.Contact.FromString,
|
|
223
|
+
options,
|
|
224
|
+
channel_credentials,
|
|
225
|
+
insecure,
|
|
226
|
+
call_credentials,
|
|
227
|
+
compression,
|
|
228
|
+
wait_for_ready,
|
|
229
|
+
timeout,
|
|
230
|
+
metadata,
|
|
231
|
+
_registered_method=True)
|
|
232
|
+
|
|
233
|
+
@staticmethod
|
|
234
|
+
def Update(request,
|
|
235
|
+
target,
|
|
236
|
+
options=(),
|
|
237
|
+
channel_credentials=None,
|
|
238
|
+
call_credentials=None,
|
|
239
|
+
insecure=False,
|
|
240
|
+
compression=None,
|
|
241
|
+
wait_for_ready=None,
|
|
242
|
+
timeout=None,
|
|
243
|
+
metadata=None):
|
|
244
|
+
return grpc.experimental.unary_unary(
|
|
245
|
+
request,
|
|
246
|
+
target,
|
|
247
|
+
'/hermes.contact.ContactService/Update',
|
|
248
|
+
contact__pb2.UpdateReq.SerializeToString,
|
|
249
|
+
contact__pb2.Contact.FromString,
|
|
250
|
+
options,
|
|
251
|
+
channel_credentials,
|
|
252
|
+
insecure,
|
|
253
|
+
call_credentials,
|
|
254
|
+
compression,
|
|
255
|
+
wait_for_ready,
|
|
256
|
+
timeout,
|
|
257
|
+
metadata,
|
|
258
|
+
_registered_method=True)
|
|
259
|
+
|
|
260
|
+
@staticmethod
|
|
261
|
+
def Remove(request,
|
|
262
|
+
target,
|
|
263
|
+
options=(),
|
|
264
|
+
channel_credentials=None,
|
|
265
|
+
call_credentials=None,
|
|
266
|
+
insecure=False,
|
|
267
|
+
compression=None,
|
|
268
|
+
wait_for_ready=None,
|
|
269
|
+
timeout=None,
|
|
270
|
+
metadata=None):
|
|
271
|
+
return grpc.experimental.unary_unary(
|
|
272
|
+
request,
|
|
273
|
+
target,
|
|
274
|
+
'/hermes.contact.ContactService/Remove',
|
|
275
|
+
contact__pb2.RemoveReq.SerializeToString,
|
|
276
|
+
contact__pb2.RemoveResp.FromString,
|
|
277
|
+
options,
|
|
278
|
+
channel_credentials,
|
|
279
|
+
insecure,
|
|
280
|
+
call_credentials,
|
|
281
|
+
compression,
|
|
282
|
+
wait_for_ready,
|
|
283
|
+
timeout,
|
|
284
|
+
metadata,
|
|
285
|
+
_registered_method=True)
|
|
286
|
+
|
|
287
|
+
@staticmethod
|
|
288
|
+
def Sync(request,
|
|
289
|
+
target,
|
|
290
|
+
options=(),
|
|
291
|
+
channel_credentials=None,
|
|
292
|
+
call_credentials=None,
|
|
293
|
+
insecure=False,
|
|
294
|
+
compression=None,
|
|
295
|
+
wait_for_ready=None,
|
|
296
|
+
timeout=None,
|
|
297
|
+
metadata=None):
|
|
298
|
+
return grpc.experimental.unary_unary(
|
|
299
|
+
request,
|
|
300
|
+
target,
|
|
301
|
+
'/hermes.contact.ContactService/Sync',
|
|
302
|
+
contact__pb2.SyncReq.SerializeToString,
|
|
303
|
+
contact__pb2.SyncResp.FromString,
|
|
304
|
+
options,
|
|
305
|
+
channel_credentials,
|
|
306
|
+
insecure,
|
|
307
|
+
call_credentials,
|
|
308
|
+
compression,
|
|
309
|
+
wait_for_ready,
|
|
310
|
+
timeout,
|
|
311
|
+
metadata,
|
|
312
|
+
_registered_method=True)
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
|
+
# NO CHECKED-IN PROTOBUF GENCODE
|
|
4
|
+
# source: feeds.proto
|
|
5
|
+
# Protobuf Python Version: 7.35.1
|
|
6
|
+
"""Generated protocol buffer code."""
|
|
7
|
+
from google.protobuf import descriptor as _descriptor
|
|
8
|
+
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
9
|
+
from google.protobuf import runtime_version as _runtime_version
|
|
10
|
+
from google.protobuf import symbol_database as _symbol_database
|
|
11
|
+
from google.protobuf.internal import builder as _builder
|
|
12
|
+
_runtime_version.ValidateProtobufRuntimeVersion(
|
|
13
|
+
_runtime_version.Domain.PUBLIC,
|
|
14
|
+
7,
|
|
15
|
+
35,
|
|
16
|
+
1,
|
|
17
|
+
'',
|
|
18
|
+
'feeds.proto'
|
|
19
|
+
)
|
|
20
|
+
# @@protoc_insertion_point(imports)
|
|
21
|
+
|
|
22
|
+
_sym_db = _symbol_database.Default()
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0b\x66\x65\x65\x64s.proto\x12\x0chermes.feeds\"\xbc\x01\n\x04\x46\x65\x65\x64\x12\x0b\n\x03hex\x18\x01 \x01(\t\x12\x0e\n\x06tenant\x18\x02 \x01(\t\x12\x0c\n\x04user\x18\x03 \x01(\t\x12\x12\n\nconnection\x18\x04 \x01(\t\x12\x0e\n\x06remote\x18\x05 \x01(\t\x12\x0c\n\x04name\x18\x06 \x01(\t\x12\x12\n\x05\x63olor\x18\x07 \x01(\tH\x00\x88\x01\x01\x12\r\n\x05\x62lock\x18\x08 \x01(\x08\x12\x0e\n\x06\x61\x63tive\x18\t \x01(\x08\x12\x11\n\x04last\x18\n \x01(\tH\x01\x88\x01\x01\x42\x08\n\x06_colorB\x07\n\x05_last\"j\n\tCreateReq\x12\x12\n\nconnection\x18\x01 \x01(\t\x12\x0e\n\x06remote\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\x12\n\x05\x63olor\x18\x04 \x01(\tH\x00\x88\x01\x01\x12\r\n\x05\x62lock\x18\x05 \x01(\x08\x42\x08\n\x06_color\"\t\n\x07ListReq\"-\n\x08ListResp\x12!\n\x05items\x18\x01 \x03(\x0b\x32\x12.hermes.feeds.Feed\"\x15\n\x06GetReq\x12\x0b\n\x03hex\x18\x01 \x01(\t\"\x90\x01\n\tUpdateReq\x12\x0b\n\x03hex\x18\x01 \x01(\t\x12\x12\n\x05\x63olor\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x12\n\x05\x62lock\x18\x03 \x01(\x08H\x01\x88\x01\x01\x12\x13\n\x06\x61\x63tive\x18\x04 \x01(\x08H\x02\x88\x01\x01\x12\x11\n\x04name\x18\x05 \x01(\tH\x03\x88\x01\x01\x42\x08\n\x06_colorB\x08\n\x06_blockB\t\n\x07_activeB\x07\n\x05_name\"\x18\n\tRemoveReq\x12\x0b\n\x03hex\x18\x01 \x01(\t\"\x1d\n\nRemoveResp\x12\x0f\n\x07removed\x18\x01 \x01(\x08\"\x16\n\x07SyncReq\x12\x0b\n\x03hex\x18\x01 \x01(\t\"9\n\x08SyncResp\x12\n\n\x02ok\x18\x01 \x01(\x08\x12\x10\n\x08inserted\x18\x02 \x01(\r\x12\x0f\n\x07updated\x18\x03 \x01(\r2\xd7\x02\n\x0b\x46\x65\x65\x64Service\x12\x35\n\x06\x43reate\x12\x17.hermes.feeds.CreateReq\x1a\x12.hermes.feeds.Feed\x12\x35\n\x04List\x12\x15.hermes.feeds.ListReq\x1a\x16.hermes.feeds.ListResp\x12/\n\x03Get\x12\x14.hermes.feeds.GetReq\x1a\x12.hermes.feeds.Feed\x12\x35\n\x06Update\x12\x17.hermes.feeds.UpdateReq\x1a\x12.hermes.feeds.Feed\x12;\n\x06Remove\x12\x17.hermes.feeds.RemoveReq\x1a\x18.hermes.feeds.RemoveResp\x12\x35\n\x04Sync\x12\x15.hermes.feeds.SyncReq\x1a\x16.hermes.feeds.SyncRespb\x06proto3')
|
|
28
|
+
|
|
29
|
+
_globals = globals()
|
|
30
|
+
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
|
31
|
+
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'feeds_pb2', _globals)
|
|
32
|
+
if not _descriptor._USE_C_DESCRIPTORS:
|
|
33
|
+
DESCRIPTOR._loaded_options = None
|
|
34
|
+
_globals['_FEED']._serialized_start=30
|
|
35
|
+
_globals['_FEED']._serialized_end=218
|
|
36
|
+
_globals['_CREATEREQ']._serialized_start=220
|
|
37
|
+
_globals['_CREATEREQ']._serialized_end=326
|
|
38
|
+
_globals['_LISTREQ']._serialized_start=328
|
|
39
|
+
_globals['_LISTREQ']._serialized_end=337
|
|
40
|
+
_globals['_LISTRESP']._serialized_start=339
|
|
41
|
+
_globals['_LISTRESP']._serialized_end=384
|
|
42
|
+
_globals['_GETREQ']._serialized_start=386
|
|
43
|
+
_globals['_GETREQ']._serialized_end=407
|
|
44
|
+
_globals['_UPDATEREQ']._serialized_start=410
|
|
45
|
+
_globals['_UPDATEREQ']._serialized_end=554
|
|
46
|
+
_globals['_REMOVEREQ']._serialized_start=556
|
|
47
|
+
_globals['_REMOVEREQ']._serialized_end=580
|
|
48
|
+
_globals['_REMOVERESP']._serialized_start=582
|
|
49
|
+
_globals['_REMOVERESP']._serialized_end=611
|
|
50
|
+
_globals['_SYNCREQ']._serialized_start=613
|
|
51
|
+
_globals['_SYNCREQ']._serialized_end=635
|
|
52
|
+
_globals['_SYNCRESP']._serialized_start=637
|
|
53
|
+
_globals['_SYNCRESP']._serialized_end=694
|
|
54
|
+
_globals['_FEEDSERVICE']._serialized_start=697
|
|
55
|
+
_globals['_FEEDSERVICE']._serialized_end=1040
|
|
56
|
+
# @@protoc_insertion_point(module_scope)
|