diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..5880e07 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,48 @@ +name: Publish Python 🐍 distribution 📦 to PyPI + +on: push + +jobs: + build: + name: Build distribution 📦 + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.x" + - name: Install pypa/build + run: >- + python3 -m + pip install + build + --user + - name: Build a binary wheel and a source tarball + run: python3 -m build + - name: Store the distribution packages + uses: actions/upload-artifact@v3 + with: + name: python-package-distributions + path: dist/ + + publish-to-pypi: + name: >- + Publish Python 🐍 distribution 📦 to PyPI + needs: + - build + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/kes-RHDHV + permissions: + id-token: write + steps: + - name: Download all the dists + uses: actions/download-artifact@v3 + with: + name: python-package-distributions + path: dist/ + - name: Publish distribution 📦 to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 \ No newline at end of file diff --git a/setup.cfg b/setup.cfg index 1020755..58824e5 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = kes-RHDHV -version = 1.dev10 +version = 1.dev12 author = RoyalHaskoningDHV author_email = roel.de.jong@rhdhv.com description = KES python client diff --git a/src/__init__.py b/src/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/kes/proto/.gitignore b/src/kes/proto/.gitignore deleted file mode 100644 index 690cdf0..0000000 --- a/src/kes/proto/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -* -*/ -!.gitignore -!__init__.py diff --git a/src/kes/proto/project_pb2.py b/src/kes/proto/project_pb2.py new file mode 100644 index 0000000..27ffffc --- /dev/null +++ b/src/kes/proto/project_pb2.py @@ -0,0 +1,128 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: project.proto +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\rproject.proto\x12\x03kes\"\x15\n\x13ListProjectsRequest\"3\n\x11ListProjectsReply\x12\x1e\n\x08projects\x18\x01 \x03(\x0b\x32\x0c.kes.Project\"/\n\x14LookupProjectRequest\x12\x17\n\x0fmasterProjectId\x18\x01 \x01(\t\"4\n\x12LookupProjectReply\x12\x1e\n\x08projects\x18\x01 \x03(\x0b\x32\x0c.kes.Project\"*\n\x15ReadActivitiesRequest\x12\x11\n\tprojectId\x18\x01 \x01(\t\"8\n\x13ReadActivitiesReply\x12!\n\nactivities\x18\x01 \x03(\x0b\x32\r.kes.Activity\"C\n\x08\x41\x63tivity\x12\n\n\x02id\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x16\n\x0etableLibraryId\x18\x03 \x01(\t\"S\n\x07Project\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x15\n\rprojectNumber\x18\x03 \x01(\t\x12\x17\n\x0fmasterProjectId\x18\x04 \x01(\t\"+\n\x15\x44ownloadReportRequest\x12\x12\n\nactivityId\x18\x01 \x01(\t\"$\n\x13\x44ownloadReportReply\x12\r\n\x05\x63hunk\x18\x01 \x01(\x0c\x32\xb0\x02\n\rProjectDetail\x12\x42\n\x0clistProjects\x12\x18.kes.ListProjectsRequest\x1a\x16.kes.ListProjectsReply\"\x00\x12\x45\n\rlookupProject\x12\x19.kes.LookupProjectRequest\x1a\x17.kes.LookupProjectReply\"\x00\x12H\n\x0ereadActivities\x12\x1a.kes.ReadActivitiesRequest\x1a\x18.kes.ReadActivitiesReply\"\x00\x12J\n\x0e\x64ownloadReport\x12\x1a.kes.DownloadReportRequest\x1a\x18.kes.DownloadReportReply\"\x00\x30\x01\x42\x0bZ\tkes/protob\x06proto3') + + + +_LISTPROJECTSREQUEST = DESCRIPTOR.message_types_by_name['ListProjectsRequest'] +_LISTPROJECTSREPLY = DESCRIPTOR.message_types_by_name['ListProjectsReply'] +_LOOKUPPROJECTREQUEST = DESCRIPTOR.message_types_by_name['LookupProjectRequest'] +_LOOKUPPROJECTREPLY = DESCRIPTOR.message_types_by_name['LookupProjectReply'] +_READACTIVITIESREQUEST = DESCRIPTOR.message_types_by_name['ReadActivitiesRequest'] +_READACTIVITIESREPLY = DESCRIPTOR.message_types_by_name['ReadActivitiesReply'] +_ACTIVITY = DESCRIPTOR.message_types_by_name['Activity'] +_PROJECT = DESCRIPTOR.message_types_by_name['Project'] +_DOWNLOADREPORTREQUEST = DESCRIPTOR.message_types_by_name['DownloadReportRequest'] +_DOWNLOADREPORTREPLY = DESCRIPTOR.message_types_by_name['DownloadReportReply'] +ListProjectsRequest = _reflection.GeneratedProtocolMessageType('ListProjectsRequest', (_message.Message,), { + 'DESCRIPTOR' : _LISTPROJECTSREQUEST, + '__module__' : 'project_pb2' + # @@protoc_insertion_point(class_scope:kes.ListProjectsRequest) + }) +_sym_db.RegisterMessage(ListProjectsRequest) + +ListProjectsReply = _reflection.GeneratedProtocolMessageType('ListProjectsReply', (_message.Message,), { + 'DESCRIPTOR' : _LISTPROJECTSREPLY, + '__module__' : 'project_pb2' + # @@protoc_insertion_point(class_scope:kes.ListProjectsReply) + }) +_sym_db.RegisterMessage(ListProjectsReply) + +LookupProjectRequest = _reflection.GeneratedProtocolMessageType('LookupProjectRequest', (_message.Message,), { + 'DESCRIPTOR' : _LOOKUPPROJECTREQUEST, + '__module__' : 'project_pb2' + # @@protoc_insertion_point(class_scope:kes.LookupProjectRequest) + }) +_sym_db.RegisterMessage(LookupProjectRequest) + +LookupProjectReply = _reflection.GeneratedProtocolMessageType('LookupProjectReply', (_message.Message,), { + 'DESCRIPTOR' : _LOOKUPPROJECTREPLY, + '__module__' : 'project_pb2' + # @@protoc_insertion_point(class_scope:kes.LookupProjectReply) + }) +_sym_db.RegisterMessage(LookupProjectReply) + +ReadActivitiesRequest = _reflection.GeneratedProtocolMessageType('ReadActivitiesRequest', (_message.Message,), { + 'DESCRIPTOR' : _READACTIVITIESREQUEST, + '__module__' : 'project_pb2' + # @@protoc_insertion_point(class_scope:kes.ReadActivitiesRequest) + }) +_sym_db.RegisterMessage(ReadActivitiesRequest) + +ReadActivitiesReply = _reflection.GeneratedProtocolMessageType('ReadActivitiesReply', (_message.Message,), { + 'DESCRIPTOR' : _READACTIVITIESREPLY, + '__module__' : 'project_pb2' + # @@protoc_insertion_point(class_scope:kes.ReadActivitiesReply) + }) +_sym_db.RegisterMessage(ReadActivitiesReply) + +Activity = _reflection.GeneratedProtocolMessageType('Activity', (_message.Message,), { + 'DESCRIPTOR' : _ACTIVITY, + '__module__' : 'project_pb2' + # @@protoc_insertion_point(class_scope:kes.Activity) + }) +_sym_db.RegisterMessage(Activity) + +Project = _reflection.GeneratedProtocolMessageType('Project', (_message.Message,), { + 'DESCRIPTOR' : _PROJECT, + '__module__' : 'project_pb2' + # @@protoc_insertion_point(class_scope:kes.Project) + }) +_sym_db.RegisterMessage(Project) + +DownloadReportRequest = _reflection.GeneratedProtocolMessageType('DownloadReportRequest', (_message.Message,), { + 'DESCRIPTOR' : _DOWNLOADREPORTREQUEST, + '__module__' : 'project_pb2' + # @@protoc_insertion_point(class_scope:kes.DownloadReportRequest) + }) +_sym_db.RegisterMessage(DownloadReportRequest) + +DownloadReportReply = _reflection.GeneratedProtocolMessageType('DownloadReportReply', (_message.Message,), { + 'DESCRIPTOR' : _DOWNLOADREPORTREPLY, + '__module__' : 'project_pb2' + # @@protoc_insertion_point(class_scope:kes.DownloadReportReply) + }) +_sym_db.RegisterMessage(DownloadReportReply) + +_PROJECTDETAIL = DESCRIPTOR.services_by_name['ProjectDetail'] +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'Z\tkes/proto' + _LISTPROJECTSREQUEST._serialized_start=22 + _LISTPROJECTSREQUEST._serialized_end=43 + _LISTPROJECTSREPLY._serialized_start=45 + _LISTPROJECTSREPLY._serialized_end=96 + _LOOKUPPROJECTREQUEST._serialized_start=98 + _LOOKUPPROJECTREQUEST._serialized_end=145 + _LOOKUPPROJECTREPLY._serialized_start=147 + _LOOKUPPROJECTREPLY._serialized_end=199 + _READACTIVITIESREQUEST._serialized_start=201 + _READACTIVITIESREQUEST._serialized_end=243 + _READACTIVITIESREPLY._serialized_start=245 + _READACTIVITIESREPLY._serialized_end=301 + _ACTIVITY._serialized_start=303 + _ACTIVITY._serialized_end=370 + _PROJECT._serialized_start=372 + _PROJECT._serialized_end=455 + _DOWNLOADREPORTREQUEST._serialized_start=457 + _DOWNLOADREPORTREQUEST._serialized_end=500 + _DOWNLOADREPORTREPLY._serialized_start=502 + _DOWNLOADREPORTREPLY._serialized_end=538 + _PROJECTDETAIL._serialized_start=541 + _PROJECTDETAIL._serialized_end=845 +# @@protoc_insertion_point(module_scope) diff --git a/src/kes/proto/project_pb2.pyi b/src/kes/proto/project_pb2.pyi new file mode 100644 index 0000000..1505316 --- /dev/null +++ b/src/kes/proto/project_pb2.pyi @@ -0,0 +1,135 @@ +""" +@generated by mypy-protobuf. Do not edit manually! +isort:skip_file +""" +import builtins +import google.protobuf.descriptor +import google.protobuf.internal.containers +import google.protobuf.message +import typing +import typing_extensions + +DESCRIPTOR: google.protobuf.descriptor.FileDescriptor + +class ListProjectsRequest(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + def __init__(self, + ) -> None: ... +global___ListProjectsRequest = ListProjectsRequest + +class ListProjectsReply(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + PROJECTS_FIELD_NUMBER: builtins.int + @property + def projects(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Project]: ... + def __init__(self, + *, + projects: typing.Optional[typing.Iterable[global___Project]] = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["projects",b"projects"]) -> None: ... +global___ListProjectsReply = ListProjectsReply + +class LookupProjectRequest(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + MASTERPROJECTID_FIELD_NUMBER: builtins.int + masterProjectId: typing.Text + def __init__(self, + *, + masterProjectId: typing.Text = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["masterProjectId",b"masterProjectId"]) -> None: ... +global___LookupProjectRequest = LookupProjectRequest + +class LookupProjectReply(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + PROJECTS_FIELD_NUMBER: builtins.int + @property + def projects(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Project]: ... + def __init__(self, + *, + projects: typing.Optional[typing.Iterable[global___Project]] = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["projects",b"projects"]) -> None: ... +global___LookupProjectReply = LookupProjectReply + +class ReadActivitiesRequest(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + PROJECTID_FIELD_NUMBER: builtins.int + projectId: typing.Text + def __init__(self, + *, + projectId: typing.Text = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["projectId",b"projectId"]) -> None: ... +global___ReadActivitiesRequest = ReadActivitiesRequest + +class ReadActivitiesReply(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + ACTIVITIES_FIELD_NUMBER: builtins.int + @property + def activities(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Activity]: ... + def __init__(self, + *, + activities: typing.Optional[typing.Iterable[global___Activity]] = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["activities",b"activities"]) -> None: ... +global___ReadActivitiesReply = ReadActivitiesReply + +class Activity(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + ID_FIELD_NUMBER: builtins.int + DESCRIPTION_FIELD_NUMBER: builtins.int + TABLELIBRARYID_FIELD_NUMBER: builtins.int + id: typing.Text + description: typing.Text + tableLibraryId: typing.Text + def __init__(self, + *, + id: typing.Text = ..., + description: typing.Text = ..., + tableLibraryId: typing.Text = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["description",b"description","id",b"id","tableLibraryId",b"tableLibraryId"]) -> None: ... +global___Activity = Activity + +class Project(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + ID_FIELD_NUMBER: builtins.int + NAME_FIELD_NUMBER: builtins.int + PROJECTNUMBER_FIELD_NUMBER: builtins.int + MASTERPROJECTID_FIELD_NUMBER: builtins.int + id: typing.Text + name: typing.Text + projectNumber: typing.Text + masterProjectId: typing.Text + def __init__(self, + *, + id: typing.Text = ..., + name: typing.Text = ..., + projectNumber: typing.Text = ..., + masterProjectId: typing.Text = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["id",b"id","masterProjectId",b"masterProjectId","name",b"name","projectNumber",b"projectNumber"]) -> None: ... +global___Project = Project + +class DownloadReportRequest(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + ACTIVITYID_FIELD_NUMBER: builtins.int + activityId: typing.Text + def __init__(self, + *, + activityId: typing.Text = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["activityId",b"activityId"]) -> None: ... +global___DownloadReportRequest = DownloadReportRequest + +class DownloadReportReply(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + CHUNK_FIELD_NUMBER: builtins.int + chunk: builtins.bytes + def __init__(self, + *, + chunk: builtins.bytes = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["chunk",b"chunk"]) -> None: ... +global___DownloadReportReply = DownloadReportReply diff --git a/src/kes/proto/project_pb2_grpc.py b/src/kes/proto/project_pb2_grpc.py new file mode 100644 index 0000000..50bd08b --- /dev/null +++ b/src/kes/proto/project_pb2_grpc.py @@ -0,0 +1,165 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc + +import project_pb2 as project__pb2 + + +class ProjectDetailStub(object): + """Missing associated documentation comment in .proto file.""" + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.listProjects = channel.unary_unary( + '/kes.ProjectDetail/listProjects', + request_serializer=project__pb2.ListProjectsRequest.SerializeToString, + response_deserializer=project__pb2.ListProjectsReply.FromString, + ) + self.lookupProject = channel.unary_unary( + '/kes.ProjectDetail/lookupProject', + request_serializer=project__pb2.LookupProjectRequest.SerializeToString, + response_deserializer=project__pb2.LookupProjectReply.FromString, + ) + self.readActivities = channel.unary_unary( + '/kes.ProjectDetail/readActivities', + request_serializer=project__pb2.ReadActivitiesRequest.SerializeToString, + response_deserializer=project__pb2.ReadActivitiesReply.FromString, + ) + self.downloadReport = channel.unary_stream( + '/kes.ProjectDetail/downloadReport', + request_serializer=project__pb2.DownloadReportRequest.SerializeToString, + response_deserializer=project__pb2.DownloadReportReply.FromString, + ) + + +class ProjectDetailServicer(object): + """Missing associated documentation comment in .proto file.""" + + def listProjects(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def lookupProject(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def readActivities(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def downloadReport(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + +def add_ProjectDetailServicer_to_server(servicer, server): + rpc_method_handlers = { + 'listProjects': grpc.unary_unary_rpc_method_handler( + servicer.listProjects, + request_deserializer=project__pb2.ListProjectsRequest.FromString, + response_serializer=project__pb2.ListProjectsReply.SerializeToString, + ), + 'lookupProject': grpc.unary_unary_rpc_method_handler( + servicer.lookupProject, + request_deserializer=project__pb2.LookupProjectRequest.FromString, + response_serializer=project__pb2.LookupProjectReply.SerializeToString, + ), + 'readActivities': grpc.unary_unary_rpc_method_handler( + servicer.readActivities, + request_deserializer=project__pb2.ReadActivitiesRequest.FromString, + response_serializer=project__pb2.ReadActivitiesReply.SerializeToString, + ), + 'downloadReport': grpc.unary_stream_rpc_method_handler( + servicer.downloadReport, + request_deserializer=project__pb2.DownloadReportRequest.FromString, + response_serializer=project__pb2.DownloadReportReply.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'kes.ProjectDetail', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) + + + # This class is part of an EXPERIMENTAL API. +class ProjectDetail(object): + """Missing associated documentation comment in .proto file.""" + + @staticmethod + def listProjects(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/kes.ProjectDetail/listProjects', + project__pb2.ListProjectsRequest.SerializeToString, + project__pb2.ListProjectsReply.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def lookupProject(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/kes.ProjectDetail/lookupProject', + project__pb2.LookupProjectRequest.SerializeToString, + project__pb2.LookupProjectReply.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def readActivities(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/kes.ProjectDetail/readActivities', + project__pb2.ReadActivitiesRequest.SerializeToString, + project__pb2.ReadActivitiesReply.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def downloadReport(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_stream(request, target, '/kes.ProjectDetail/downloadReport', + project__pb2.DownloadReportRequest.SerializeToString, + project__pb2.DownloadReportReply.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) diff --git a/src/kes/proto/project_pb2_grpc.pyi b/src/kes/proto/project_pb2_grpc.pyi new file mode 100644 index 0000000..8eff2d2 --- /dev/null +++ b/src/kes/proto/project_pb2_grpc.pyi @@ -0,0 +1,55 @@ +""" +@generated by mypy-protobuf. Do not edit manually! +isort:skip_file +""" +import abc +import grpc +import project_pb2 +import typing + +class ProjectDetailStub: + def __init__(self, channel: grpc.Channel) -> None: ... + listProjects: grpc.UnaryUnaryMultiCallable[ + project_pb2.ListProjectsRequest, + project_pb2.ListProjectsReply] + + lookupProject: grpc.UnaryUnaryMultiCallable[ + project_pb2.LookupProjectRequest, + project_pb2.LookupProjectReply] + + readActivities: grpc.UnaryUnaryMultiCallable[ + project_pb2.ReadActivitiesRequest, + project_pb2.ReadActivitiesReply] + + downloadReport: grpc.UnaryStreamMultiCallable[ + project_pb2.DownloadReportRequest, + project_pb2.DownloadReportReply] + + +class ProjectDetailServicer(metaclass=abc.ABCMeta): + @abc.abstractmethod + def listProjects(self, + request: project_pb2.ListProjectsRequest, + context: grpc.ServicerContext, + ) -> project_pb2.ListProjectsReply: ... + + @abc.abstractmethod + def lookupProject(self, + request: project_pb2.LookupProjectRequest, + context: grpc.ServicerContext, + ) -> project_pb2.LookupProjectReply: ... + + @abc.abstractmethod + def readActivities(self, + request: project_pb2.ReadActivitiesRequest, + context: grpc.ServicerContext, + ) -> project_pb2.ReadActivitiesReply: ... + + @abc.abstractmethod + def downloadReport(self, + request: project_pb2.DownloadReportRequest, + context: grpc.ServicerContext, + ) -> typing.Iterator[project_pb2.DownloadReportReply]: ... + + +def add_ProjectDetailServicer_to_server(servicer: ProjectDetailServicer, server: grpc.Server) -> None: ... diff --git a/src/kes/proto/table_pb2.py b/src/kes/proto/table_pb2.py new file mode 100644 index 0000000..bea4fe7 --- /dev/null +++ b/src/kes/proto/table_pb2.py @@ -0,0 +1,210 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: table.proto +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 +from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0btable.proto\x12\x03kes\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"7\n\x10ReadTableRequest\x12\x12\n\nactivityId\x18\x01 \x01(\t\x12\x0f\n\x07tableId\x18\x02 \x01(\t\"M\n\x0e\x41\x64\x64RowsRequest\x12\x12\n\nactivityId\x18\x01 \x01(\t\x12\x0f\n\x07tableId\x18\x02 \x01(\t\x12\x16\n\x04rows\x18\x03 \x03(\x0b\x32\x08.kes.Row\";\n\x14\x44\x65leteAllRowsRequest\x12\x12\n\nactivityId\x18\x01 \x01(\t\x12\x0f\n\x07tableId\x18\x02 \x01(\t\"7\n\x11\x44\x65leteRowsRequest\x12\x12\n\nactivityId\x18\x01 \x01(\t\x12\x0e\n\x06rowIds\x18\x02 \x03(\t\"\x1e\n\x04Rows\x12\x16\n\x04rows\x18\x01 \x03(\x0b\x32\x08.kes.Row\"2\n\x03Row\x12\x0f\n\x07\x61ssetId\x18\x01 \x01(\t\x12\x1a\n\x06\x66ields\x18\x02 \x03(\x0b\x32\n.kes.Field\"\xd4\x02\n\x05\x46ield\x12\x12\n\npropertyId\x18\x01 \x01(\t\x12\r\n\x05multi\x18\x02 \x01(\x08\x12$\n\x07numbers\x18\x03 \x01(\x0b\x32\x11.kes.NumberValuesH\x00\x12$\n\x07strings\x18\x04 \x01(\x0b\x32\x11.kes.StringValuesH\x00\x12)\n\x07members\x18\x05 \x01(\x0b\x32\x16.kes.EnumerationValuesH\x00\x12\x30\n\rrowReferences\x18\x06 \x01(\x0b\x32\x17.kes.RelationshipValuesH\x00\x12 \n\x05image\x18\x07 \x01(\x0b\x32\x0f.kes.ImageValueH\x00\x12(\n\tlocations\x18\x08 \x01(\x0b\x32\x13.kes.LocationValuesH\x00\x12*\n\x04\x64\x61te\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00\x42\x07\n\x05value\" \n\x0cNumberValues\x12\x10\n\x08\x65lements\x18\x01 \x03(\x01\" \n\x0cStringValues\x12\x10\n\x08\x65lements\x18\x01 \x03(\t\"%\n\x11\x45numerationValues\x12\x10\n\x08\x65lements\x18\x01 \x03(\x05\"&\n\x12RelationshipValues\x12\x10\n\x08\x65lements\x18\x01 \x03(\t\";\n\nImageValue\x12\n\n\x02id\x18\x01 \x01(\t\x12\x10\n\x08\x66ileName\x18\x02 \x01(\t\x12\x0f\n\x07tempKey\x18\x03 \x01(\t\"6\n\x0eLocationValues\x12$\n\x08\x65lements\x18\x01 \x03(\x0b\x32\x12.kes.LocationPoint\"S\n\rLocationPoint\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x10\n\x08latitude\x18\x02 \x01(\x01\x12\x11\n\tlongitude\x18\x03 \x01(\x01\x12\x0f\n\x07\x61\x64\x64ress\x18\x04 \x01(\t\":\n\x10LoadImageRequest\x12\x14\n\x0cimageValueId\x18\x01 \x01(\t\x12\x10\n\x08\x66ileName\x18\x02 \x01(\t\"\x1f\n\x0eLoadImageReply\x12\r\n\x05\x63hunk\x18\x01 \x01(\x0c\"!\n\x10SaveImageRequest\x12\r\n\x05\x63hunk\x18\x01 \x01(\x0c\"!\n\x0eSaveImageReply\x12\x0f\n\x07tempKey\x18\x01 \x01(\t2\xf2\x02\n\x05Table\x12/\n\treadTable\x12\x15.kes.ReadTableRequest\x1a\t.kes.Rows\"\x00\x12\x38\n\x07\x61\x64\x64Rows\x12\x13.kes.AddRowsRequest\x1a\x16.google.protobuf.Empty\"\x00\x12>\n\ndeleteRows\x12\x16.kes.DeleteRowsRequest\x1a\x16.google.protobuf.Empty\"\x00\x12\x44\n\rdeleteAllRows\x12\x19.kes.DeleteAllRowsRequest\x1a\x16.google.protobuf.Empty\"\x00\x12;\n\tloadImage\x12\x15.kes.LoadImageRequest\x1a\x13.kes.LoadImageReply\"\x00\x30\x01\x12;\n\tsaveImage\x12\x15.kes.SaveImageRequest\x1a\x13.kes.SaveImageReply\"\x00(\x01\x42\x0bZ\tkes/protob\x06proto3') + + + +_READTABLEREQUEST = DESCRIPTOR.message_types_by_name['ReadTableRequest'] +_ADDROWSREQUEST = DESCRIPTOR.message_types_by_name['AddRowsRequest'] +_DELETEALLROWSREQUEST = DESCRIPTOR.message_types_by_name['DeleteAllRowsRequest'] +_DELETEROWSREQUEST = DESCRIPTOR.message_types_by_name['DeleteRowsRequest'] +_ROWS = DESCRIPTOR.message_types_by_name['Rows'] +_ROW = DESCRIPTOR.message_types_by_name['Row'] +_FIELD = DESCRIPTOR.message_types_by_name['Field'] +_NUMBERVALUES = DESCRIPTOR.message_types_by_name['NumberValues'] +_STRINGVALUES = DESCRIPTOR.message_types_by_name['StringValues'] +_ENUMERATIONVALUES = DESCRIPTOR.message_types_by_name['EnumerationValues'] +_RELATIONSHIPVALUES = DESCRIPTOR.message_types_by_name['RelationshipValues'] +_IMAGEVALUE = DESCRIPTOR.message_types_by_name['ImageValue'] +_LOCATIONVALUES = DESCRIPTOR.message_types_by_name['LocationValues'] +_LOCATIONPOINT = DESCRIPTOR.message_types_by_name['LocationPoint'] +_LOADIMAGEREQUEST = DESCRIPTOR.message_types_by_name['LoadImageRequest'] +_LOADIMAGEREPLY = DESCRIPTOR.message_types_by_name['LoadImageReply'] +_SAVEIMAGEREQUEST = DESCRIPTOR.message_types_by_name['SaveImageRequest'] +_SAVEIMAGEREPLY = DESCRIPTOR.message_types_by_name['SaveImageReply'] +ReadTableRequest = _reflection.GeneratedProtocolMessageType('ReadTableRequest', (_message.Message,), { + 'DESCRIPTOR' : _READTABLEREQUEST, + '__module__' : 'table_pb2' + # @@protoc_insertion_point(class_scope:kes.ReadTableRequest) + }) +_sym_db.RegisterMessage(ReadTableRequest) + +AddRowsRequest = _reflection.GeneratedProtocolMessageType('AddRowsRequest', (_message.Message,), { + 'DESCRIPTOR' : _ADDROWSREQUEST, + '__module__' : 'table_pb2' + # @@protoc_insertion_point(class_scope:kes.AddRowsRequest) + }) +_sym_db.RegisterMessage(AddRowsRequest) + +DeleteAllRowsRequest = _reflection.GeneratedProtocolMessageType('DeleteAllRowsRequest', (_message.Message,), { + 'DESCRIPTOR' : _DELETEALLROWSREQUEST, + '__module__' : 'table_pb2' + # @@protoc_insertion_point(class_scope:kes.DeleteAllRowsRequest) + }) +_sym_db.RegisterMessage(DeleteAllRowsRequest) + +DeleteRowsRequest = _reflection.GeneratedProtocolMessageType('DeleteRowsRequest', (_message.Message,), { + 'DESCRIPTOR' : _DELETEROWSREQUEST, + '__module__' : 'table_pb2' + # @@protoc_insertion_point(class_scope:kes.DeleteRowsRequest) + }) +_sym_db.RegisterMessage(DeleteRowsRequest) + +Rows = _reflection.GeneratedProtocolMessageType('Rows', (_message.Message,), { + 'DESCRIPTOR' : _ROWS, + '__module__' : 'table_pb2' + # @@protoc_insertion_point(class_scope:kes.Rows) + }) +_sym_db.RegisterMessage(Rows) + +Row = _reflection.GeneratedProtocolMessageType('Row', (_message.Message,), { + 'DESCRIPTOR' : _ROW, + '__module__' : 'table_pb2' + # @@protoc_insertion_point(class_scope:kes.Row) + }) +_sym_db.RegisterMessage(Row) + +Field = _reflection.GeneratedProtocolMessageType('Field', (_message.Message,), { + 'DESCRIPTOR' : _FIELD, + '__module__' : 'table_pb2' + # @@protoc_insertion_point(class_scope:kes.Field) + }) +_sym_db.RegisterMessage(Field) + +NumberValues = _reflection.GeneratedProtocolMessageType('NumberValues', (_message.Message,), { + 'DESCRIPTOR' : _NUMBERVALUES, + '__module__' : 'table_pb2' + # @@protoc_insertion_point(class_scope:kes.NumberValues) + }) +_sym_db.RegisterMessage(NumberValues) + +StringValues = _reflection.GeneratedProtocolMessageType('StringValues', (_message.Message,), { + 'DESCRIPTOR' : _STRINGVALUES, + '__module__' : 'table_pb2' + # @@protoc_insertion_point(class_scope:kes.StringValues) + }) +_sym_db.RegisterMessage(StringValues) + +EnumerationValues = _reflection.GeneratedProtocolMessageType('EnumerationValues', (_message.Message,), { + 'DESCRIPTOR' : _ENUMERATIONVALUES, + '__module__' : 'table_pb2' + # @@protoc_insertion_point(class_scope:kes.EnumerationValues) + }) +_sym_db.RegisterMessage(EnumerationValues) + +RelationshipValues = _reflection.GeneratedProtocolMessageType('RelationshipValues', (_message.Message,), { + 'DESCRIPTOR' : _RELATIONSHIPVALUES, + '__module__' : 'table_pb2' + # @@protoc_insertion_point(class_scope:kes.RelationshipValues) + }) +_sym_db.RegisterMessage(RelationshipValues) + +ImageValue = _reflection.GeneratedProtocolMessageType('ImageValue', (_message.Message,), { + 'DESCRIPTOR' : _IMAGEVALUE, + '__module__' : 'table_pb2' + # @@protoc_insertion_point(class_scope:kes.ImageValue) + }) +_sym_db.RegisterMessage(ImageValue) + +LocationValues = _reflection.GeneratedProtocolMessageType('LocationValues', (_message.Message,), { + 'DESCRIPTOR' : _LOCATIONVALUES, + '__module__' : 'table_pb2' + # @@protoc_insertion_point(class_scope:kes.LocationValues) + }) +_sym_db.RegisterMessage(LocationValues) + +LocationPoint = _reflection.GeneratedProtocolMessageType('LocationPoint', (_message.Message,), { + 'DESCRIPTOR' : _LOCATIONPOINT, + '__module__' : 'table_pb2' + # @@protoc_insertion_point(class_scope:kes.LocationPoint) + }) +_sym_db.RegisterMessage(LocationPoint) + +LoadImageRequest = _reflection.GeneratedProtocolMessageType('LoadImageRequest', (_message.Message,), { + 'DESCRIPTOR' : _LOADIMAGEREQUEST, + '__module__' : 'table_pb2' + # @@protoc_insertion_point(class_scope:kes.LoadImageRequest) + }) +_sym_db.RegisterMessage(LoadImageRequest) + +LoadImageReply = _reflection.GeneratedProtocolMessageType('LoadImageReply', (_message.Message,), { + 'DESCRIPTOR' : _LOADIMAGEREPLY, + '__module__' : 'table_pb2' + # @@protoc_insertion_point(class_scope:kes.LoadImageReply) + }) +_sym_db.RegisterMessage(LoadImageReply) + +SaveImageRequest = _reflection.GeneratedProtocolMessageType('SaveImageRequest', (_message.Message,), { + 'DESCRIPTOR' : _SAVEIMAGEREQUEST, + '__module__' : 'table_pb2' + # @@protoc_insertion_point(class_scope:kes.SaveImageRequest) + }) +_sym_db.RegisterMessage(SaveImageRequest) + +SaveImageReply = _reflection.GeneratedProtocolMessageType('SaveImageReply', (_message.Message,), { + 'DESCRIPTOR' : _SAVEIMAGEREPLY, + '__module__' : 'table_pb2' + # @@protoc_insertion_point(class_scope:kes.SaveImageReply) + }) +_sym_db.RegisterMessage(SaveImageReply) + +_TABLE = DESCRIPTOR.services_by_name['Table'] +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'Z\tkes/proto' + _READTABLEREQUEST._serialized_start=82 + _READTABLEREQUEST._serialized_end=137 + _ADDROWSREQUEST._serialized_start=139 + _ADDROWSREQUEST._serialized_end=216 + _DELETEALLROWSREQUEST._serialized_start=218 + _DELETEALLROWSREQUEST._serialized_end=277 + _DELETEROWSREQUEST._serialized_start=279 + _DELETEROWSREQUEST._serialized_end=334 + _ROWS._serialized_start=336 + _ROWS._serialized_end=366 + _ROW._serialized_start=368 + _ROW._serialized_end=418 + _FIELD._serialized_start=421 + _FIELD._serialized_end=761 + _NUMBERVALUES._serialized_start=763 + _NUMBERVALUES._serialized_end=795 + _STRINGVALUES._serialized_start=797 + _STRINGVALUES._serialized_end=829 + _ENUMERATIONVALUES._serialized_start=831 + _ENUMERATIONVALUES._serialized_end=868 + _RELATIONSHIPVALUES._serialized_start=870 + _RELATIONSHIPVALUES._serialized_end=908 + _IMAGEVALUE._serialized_start=910 + _IMAGEVALUE._serialized_end=969 + _LOCATIONVALUES._serialized_start=971 + _LOCATIONVALUES._serialized_end=1025 + _LOCATIONPOINT._serialized_start=1027 + _LOCATIONPOINT._serialized_end=1110 + _LOADIMAGEREQUEST._serialized_start=1112 + _LOADIMAGEREQUEST._serialized_end=1170 + _LOADIMAGEREPLY._serialized_start=1172 + _LOADIMAGEREPLY._serialized_end=1203 + _SAVEIMAGEREQUEST._serialized_start=1205 + _SAVEIMAGEREQUEST._serialized_end=1238 + _SAVEIMAGEREPLY._serialized_start=1240 + _SAVEIMAGEREPLY._serialized_end=1273 + _TABLE._serialized_start=1276 + _TABLE._serialized_end=1646 +# @@protoc_insertion_point(module_scope) diff --git a/src/kes/proto/table_pb2.pyi b/src/kes/proto/table_pb2.pyi new file mode 100644 index 0000000..006c085 --- /dev/null +++ b/src/kes/proto/table_pb2.pyi @@ -0,0 +1,289 @@ +""" +@generated by mypy-protobuf. Do not edit manually! +isort:skip_file +""" +import builtins +import google.protobuf.descriptor +import google.protobuf.internal.containers +import google.protobuf.message +import google.protobuf.timestamp_pb2 +import typing +import typing_extensions + +DESCRIPTOR: google.protobuf.descriptor.FileDescriptor + +class ReadTableRequest(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + ACTIVITYID_FIELD_NUMBER: builtins.int + TABLEID_FIELD_NUMBER: builtins.int + activityId: typing.Text + tableId: typing.Text + def __init__(self, + *, + activityId: typing.Text = ..., + tableId: typing.Text = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["activityId",b"activityId","tableId",b"tableId"]) -> None: ... +global___ReadTableRequest = ReadTableRequest + +class AddRowsRequest(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + ACTIVITYID_FIELD_NUMBER: builtins.int + TABLEID_FIELD_NUMBER: builtins.int + ROWS_FIELD_NUMBER: builtins.int + activityId: typing.Text + tableId: typing.Text + @property + def rows(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Row]: ... + def __init__(self, + *, + activityId: typing.Text = ..., + tableId: typing.Text = ..., + rows: typing.Optional[typing.Iterable[global___Row]] = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["activityId",b"activityId","rows",b"rows","tableId",b"tableId"]) -> None: ... +global___AddRowsRequest = AddRowsRequest + +class DeleteAllRowsRequest(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + ACTIVITYID_FIELD_NUMBER: builtins.int + TABLEID_FIELD_NUMBER: builtins.int + activityId: typing.Text + tableId: typing.Text + def __init__(self, + *, + activityId: typing.Text = ..., + tableId: typing.Text = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["activityId",b"activityId","tableId",b"tableId"]) -> None: ... +global___DeleteAllRowsRequest = DeleteAllRowsRequest + +class DeleteRowsRequest(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + ACTIVITYID_FIELD_NUMBER: builtins.int + ROWIDS_FIELD_NUMBER: builtins.int + activityId: typing.Text + @property + def rowIds(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[typing.Text]: ... + def __init__(self, + *, + activityId: typing.Text = ..., + rowIds: typing.Optional[typing.Iterable[typing.Text]] = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["activityId",b"activityId","rowIds",b"rowIds"]) -> None: ... +global___DeleteRowsRequest = DeleteRowsRequest + +class Rows(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + ROWS_FIELD_NUMBER: builtins.int + @property + def rows(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Row]: ... + def __init__(self, + *, + rows: typing.Optional[typing.Iterable[global___Row]] = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["rows",b"rows"]) -> None: ... +global___Rows = Rows + +class Row(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + ASSETID_FIELD_NUMBER: builtins.int + FIELDS_FIELD_NUMBER: builtins.int + assetId: typing.Text + @property + def fields(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Field]: ... + def __init__(self, + *, + assetId: typing.Text = ..., + fields: typing.Optional[typing.Iterable[global___Field]] = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["assetId",b"assetId","fields",b"fields"]) -> None: ... +global___Row = Row + +class Field(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + PROPERTYID_FIELD_NUMBER: builtins.int + MULTI_FIELD_NUMBER: builtins.int + NUMBERS_FIELD_NUMBER: builtins.int + STRINGS_FIELD_NUMBER: builtins.int + MEMBERS_FIELD_NUMBER: builtins.int + ROWREFERENCES_FIELD_NUMBER: builtins.int + IMAGE_FIELD_NUMBER: builtins.int + LOCATIONS_FIELD_NUMBER: builtins.int + DATE_FIELD_NUMBER: builtins.int + propertyId: typing.Text + multi: builtins.bool + @property + def numbers(self) -> global___NumberValues: ... + @property + def strings(self) -> global___StringValues: ... + @property + def members(self) -> global___EnumerationValues: ... + @property + def rowReferences(self) -> global___RelationshipValues: ... + @property + def image(self) -> global___ImageValue: ... + @property + def locations(self) -> global___LocationValues: ... + @property + def date(self) -> google.protobuf.timestamp_pb2.Timestamp: ... + def __init__(self, + *, + propertyId: typing.Text = ..., + multi: builtins.bool = ..., + numbers: typing.Optional[global___NumberValues] = ..., + strings: typing.Optional[global___StringValues] = ..., + members: typing.Optional[global___EnumerationValues] = ..., + rowReferences: typing.Optional[global___RelationshipValues] = ..., + image: typing.Optional[global___ImageValue] = ..., + locations: typing.Optional[global___LocationValues] = ..., + date: typing.Optional[google.protobuf.timestamp_pb2.Timestamp] = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["date",b"date","image",b"image","locations",b"locations","members",b"members","numbers",b"numbers","rowReferences",b"rowReferences","strings",b"strings","value",b"value"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["date",b"date","image",b"image","locations",b"locations","members",b"members","multi",b"multi","numbers",b"numbers","propertyId",b"propertyId","rowReferences",b"rowReferences","strings",b"strings","value",b"value"]) -> None: ... + def WhichOneof(self, oneof_group: typing_extensions.Literal["value",b"value"]) -> typing.Optional[typing_extensions.Literal["numbers","strings","members","rowReferences","image","locations","date"]]: ... +global___Field = Field + +class NumberValues(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + ELEMENTS_FIELD_NUMBER: builtins.int + @property + def elements(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.float]: ... + def __init__(self, + *, + elements: typing.Optional[typing.Iterable[builtins.float]] = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["elements",b"elements"]) -> None: ... +global___NumberValues = NumberValues + +class StringValues(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + ELEMENTS_FIELD_NUMBER: builtins.int + @property + def elements(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[typing.Text]: ... + def __init__(self, + *, + elements: typing.Optional[typing.Iterable[typing.Text]] = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["elements",b"elements"]) -> None: ... +global___StringValues = StringValues + +class EnumerationValues(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + ELEMENTS_FIELD_NUMBER: builtins.int + @property + def elements(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.int]: ... + def __init__(self, + *, + elements: typing.Optional[typing.Iterable[builtins.int]] = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["elements",b"elements"]) -> None: ... +global___EnumerationValues = EnumerationValues + +class RelationshipValues(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + ELEMENTS_FIELD_NUMBER: builtins.int + @property + def elements(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[typing.Text]: ... + def __init__(self, + *, + elements: typing.Optional[typing.Iterable[typing.Text]] = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["elements",b"elements"]) -> None: ... +global___RelationshipValues = RelationshipValues + +class ImageValue(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + ID_FIELD_NUMBER: builtins.int + FILENAME_FIELD_NUMBER: builtins.int + TEMPKEY_FIELD_NUMBER: builtins.int + id: typing.Text + fileName: typing.Text + tempKey: typing.Text + def __init__(self, + *, + id: typing.Text = ..., + fileName: typing.Text = ..., + tempKey: typing.Text = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["fileName",b"fileName","id",b"id","tempKey",b"tempKey"]) -> None: ... +global___ImageValue = ImageValue + +class LocationValues(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + ELEMENTS_FIELD_NUMBER: builtins.int + @property + def elements(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___LocationPoint]: ... + def __init__(self, + *, + elements: typing.Optional[typing.Iterable[global___LocationPoint]] = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["elements",b"elements"]) -> None: ... +global___LocationValues = LocationValues + +class LocationPoint(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + NAME_FIELD_NUMBER: builtins.int + LATITUDE_FIELD_NUMBER: builtins.int + LONGITUDE_FIELD_NUMBER: builtins.int + ADDRESS_FIELD_NUMBER: builtins.int + name: typing.Text + latitude: builtins.float + longitude: builtins.float + address: typing.Text + def __init__(self, + *, + name: typing.Text = ..., + latitude: builtins.float = ..., + longitude: builtins.float = ..., + address: typing.Text = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["address",b"address","latitude",b"latitude","longitude",b"longitude","name",b"name"]) -> None: ... +global___LocationPoint = LocationPoint + +class LoadImageRequest(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + IMAGEVALUEID_FIELD_NUMBER: builtins.int + FILENAME_FIELD_NUMBER: builtins.int + imageValueId: typing.Text + fileName: typing.Text + def __init__(self, + *, + imageValueId: typing.Text = ..., + fileName: typing.Text = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["fileName",b"fileName","imageValueId",b"imageValueId"]) -> None: ... +global___LoadImageRequest = LoadImageRequest + +class LoadImageReply(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + CHUNK_FIELD_NUMBER: builtins.int + chunk: builtins.bytes + def __init__(self, + *, + chunk: builtins.bytes = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["chunk",b"chunk"]) -> None: ... +global___LoadImageReply = LoadImageReply + +class SaveImageRequest(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + CHUNK_FIELD_NUMBER: builtins.int + chunk: builtins.bytes + def __init__(self, + *, + chunk: builtins.bytes = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["chunk",b"chunk"]) -> None: ... +global___SaveImageRequest = SaveImageRequest + +class SaveImageReply(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + TEMPKEY_FIELD_NUMBER: builtins.int + tempKey: typing.Text + def __init__(self, + *, + tempKey: typing.Text = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["tempKey",b"tempKey"]) -> None: ... +global___SaveImageReply = SaveImageReply diff --git a/src/kes/proto/table_pb2_grpc.py b/src/kes/proto/table_pb2_grpc.py new file mode 100644 index 0000000..8f7166d --- /dev/null +++ b/src/kes/proto/table_pb2_grpc.py @@ -0,0 +1,232 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc + +from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 +import table_pb2 as table__pb2 + + +class TableStub(object): + """Missing associated documentation comment in .proto file.""" + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.readTable = channel.unary_unary( + '/kes.Table/readTable', + request_serializer=table__pb2.ReadTableRequest.SerializeToString, + response_deserializer=table__pb2.Rows.FromString, + ) + self.addRows = channel.unary_unary( + '/kes.Table/addRows', + request_serializer=table__pb2.AddRowsRequest.SerializeToString, + response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, + ) + self.deleteRows = channel.unary_unary( + '/kes.Table/deleteRows', + request_serializer=table__pb2.DeleteRowsRequest.SerializeToString, + response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, + ) + self.deleteAllRows = channel.unary_unary( + '/kes.Table/deleteAllRows', + request_serializer=table__pb2.DeleteAllRowsRequest.SerializeToString, + response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, + ) + self.loadImage = channel.unary_stream( + '/kes.Table/loadImage', + request_serializer=table__pb2.LoadImageRequest.SerializeToString, + response_deserializer=table__pb2.LoadImageReply.FromString, + ) + self.saveImage = channel.stream_unary( + '/kes.Table/saveImage', + request_serializer=table__pb2.SaveImageRequest.SerializeToString, + response_deserializer=table__pb2.SaveImageReply.FromString, + ) + + +class TableServicer(object): + """Missing associated documentation comment in .proto file.""" + + def readTable(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def addRows(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def deleteRows(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def deleteAllRows(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def loadImage(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def saveImage(self, request_iterator, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + +def add_TableServicer_to_server(servicer, server): + rpc_method_handlers = { + 'readTable': grpc.unary_unary_rpc_method_handler( + servicer.readTable, + request_deserializer=table__pb2.ReadTableRequest.FromString, + response_serializer=table__pb2.Rows.SerializeToString, + ), + 'addRows': grpc.unary_unary_rpc_method_handler( + servicer.addRows, + request_deserializer=table__pb2.AddRowsRequest.FromString, + response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + ), + 'deleteRows': grpc.unary_unary_rpc_method_handler( + servicer.deleteRows, + request_deserializer=table__pb2.DeleteRowsRequest.FromString, + response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + ), + 'deleteAllRows': grpc.unary_unary_rpc_method_handler( + servicer.deleteAllRows, + request_deserializer=table__pb2.DeleteAllRowsRequest.FromString, + response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + ), + 'loadImage': grpc.unary_stream_rpc_method_handler( + servicer.loadImage, + request_deserializer=table__pb2.LoadImageRequest.FromString, + response_serializer=table__pb2.LoadImageReply.SerializeToString, + ), + 'saveImage': grpc.stream_unary_rpc_method_handler( + servicer.saveImage, + request_deserializer=table__pb2.SaveImageRequest.FromString, + response_serializer=table__pb2.SaveImageReply.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'kes.Table', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) + + + # This class is part of an EXPERIMENTAL API. +class Table(object): + """Missing associated documentation comment in .proto file.""" + + @staticmethod + def readTable(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/kes.Table/readTable', + table__pb2.ReadTableRequest.SerializeToString, + table__pb2.Rows.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def addRows(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/kes.Table/addRows', + table__pb2.AddRowsRequest.SerializeToString, + google_dot_protobuf_dot_empty__pb2.Empty.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def deleteRows(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/kes.Table/deleteRows', + table__pb2.DeleteRowsRequest.SerializeToString, + google_dot_protobuf_dot_empty__pb2.Empty.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def deleteAllRows(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/kes.Table/deleteAllRows', + table__pb2.DeleteAllRowsRequest.SerializeToString, + google_dot_protobuf_dot_empty__pb2.Empty.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def loadImage(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_stream(request, target, '/kes.Table/loadImage', + table__pb2.LoadImageRequest.SerializeToString, + table__pb2.LoadImageReply.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def saveImage(request_iterator, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.stream_unary(request_iterator, target, '/kes.Table/saveImage', + table__pb2.SaveImageRequest.SerializeToString, + table__pb2.SaveImageReply.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) diff --git a/src/kes/proto/table_pb2_grpc.pyi b/src/kes/proto/table_pb2_grpc.pyi new file mode 100644 index 0000000..d3da796 --- /dev/null +++ b/src/kes/proto/table_pb2_grpc.pyi @@ -0,0 +1,76 @@ +""" +@generated by mypy-protobuf. Do not edit manually! +isort:skip_file +""" +import abc +import google.protobuf.empty_pb2 +import grpc +import table_pb2 +import typing + +class TableStub: + def __init__(self, channel: grpc.Channel) -> None: ... + readTable: grpc.UnaryUnaryMultiCallable[ + table_pb2.ReadTableRequest, + table_pb2.Rows] + + addRows: grpc.UnaryUnaryMultiCallable[ + table_pb2.AddRowsRequest, + google.protobuf.empty_pb2.Empty] + + deleteRows: grpc.UnaryUnaryMultiCallable[ + table_pb2.DeleteRowsRequest, + google.protobuf.empty_pb2.Empty] + + deleteAllRows: grpc.UnaryUnaryMultiCallable[ + table_pb2.DeleteAllRowsRequest, + google.protobuf.empty_pb2.Empty] + + loadImage: grpc.UnaryStreamMultiCallable[ + table_pb2.LoadImageRequest, + table_pb2.LoadImageReply] + + saveImage: grpc.StreamUnaryMultiCallable[ + table_pb2.SaveImageRequest, + table_pb2.SaveImageReply] + + +class TableServicer(metaclass=abc.ABCMeta): + @abc.abstractmethod + def readTable(self, + request: table_pb2.ReadTableRequest, + context: grpc.ServicerContext, + ) -> table_pb2.Rows: ... + + @abc.abstractmethod + def addRows(self, + request: table_pb2.AddRowsRequest, + context: grpc.ServicerContext, + ) -> google.protobuf.empty_pb2.Empty: ... + + @abc.abstractmethod + def deleteRows(self, + request: table_pb2.DeleteRowsRequest, + context: grpc.ServicerContext, + ) -> google.protobuf.empty_pb2.Empty: ... + + @abc.abstractmethod + def deleteAllRows(self, + request: table_pb2.DeleteAllRowsRequest, + context: grpc.ServicerContext, + ) -> google.protobuf.empty_pb2.Empty: ... + + @abc.abstractmethod + def loadImage(self, + request: table_pb2.LoadImageRequest, + context: grpc.ServicerContext, + ) -> typing.Iterator[table_pb2.LoadImageReply]: ... + + @abc.abstractmethod + def saveImage(self, + request_iterator: typing.Iterator[table_pb2.SaveImageRequest], + context: grpc.ServicerContext, + ) -> table_pb2.SaveImageReply: ... + + +def add_TableServicer_to_server(servicer: TableServicer, server: grpc.Server) -> None: ...