diff --git a/examples/contentcollections_client.py b/examples/contentcollections_client.py new file mode 100644 index 0000000000000000000000000000000000000000..d0760c8a14e26412c6de6d7ac23aa50fb358fdec --- /dev/null +++ b/examples/contentcollections_client.py @@ -0,0 +1,22 @@ + +import asyncio +import logging + +import grpc + +from contentcollections.collections_pb2 import GetRequest +from contentcollections.collections_pb2_grpc import CollectionsStub + + +async def main() -> None: + async with grpc.aio.insecure_channel('localhost:50051') as channel: + stub = CollectionsStub(channel) + collections = await stub.List() + print('List collections', collections) + collection = await stub.Get(GetRequest(space_id='1', env_id='1', collection_id='1')) + print('Retrieve collection', collection) + + +if __name__ == '__main__': + logging.basicConfig(level=logging.INFO) + asyncio.get_event_loop().run_until_complete(main()) diff --git a/perxis/collections/__init__.py b/perxis/contentcollections/__init__.py similarity index 100% rename from perxis/collections/__init__.py rename to perxis/contentcollections/__init__.py diff --git a/perxis/collections/collections_pb2.py b/perxis/contentcollections/collections_pb2.py similarity index 100% rename from perxis/collections/collections_pb2.py rename to perxis/contentcollections/collections_pb2.py diff --git a/perxis/collections/collections_pb2_grpc.py b/perxis/contentcollections/collections_pb2_grpc.py similarity index 99% rename from perxis/collections/collections_pb2_grpc.py rename to perxis/contentcollections/collections_pb2_grpc.py index d8ebb26602e319a7001498fe19d1abd32417d95f..d1bb1c48dfefeba62b06f4d307e8b4a22fad25eb 100644 --- a/perxis/collections/collections_pb2_grpc.py +++ b/perxis/contentcollections/collections_pb2_grpc.py @@ -2,7 +2,7 @@ """Client and server classes corresponding to protobuf-defined services.""" import grpc -from collections import collections_pb2 as collections_dot_collections__pb2 +from contentcollections import collections_pb2 as collections_dot_collections__pb2 from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 diff --git a/proto/collections/collections.proto b/proto/contentcollections/collections.proto similarity index 100% rename from proto/collections/collections.proto rename to proto/contentcollections/collections.proto