You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

133 lines
5.1 KiB

  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 schema_pb2 as schema__pb2
  5. class DatabaseStub(object):
  6. """Missing associated documentation comment in .proto file."""
  7. def __init__(self, channel):
  8. """Constructor.
  9. Args:
  10. channel: A grpc.Channel.
  11. """
  12. self.GetUsers = channel.unary_unary(
  13. '/Database/GetUsers',
  14. request_serializer=schema__pb2.EmptyMessage.SerializeToString,
  15. response_deserializer=schema__pb2.UsersResponse.FromString,
  16. )
  17. self.DeleteUser = channel.unary_unary(
  18. '/Database/DeleteUser',
  19. request_serializer=schema__pb2.User.SerializeToString,
  20. response_deserializer=schema__pb2.Response.FromString,
  21. )
  22. self.PutUser = channel.unary_unary(
  23. '/Database/PutUser',
  24. request_serializer=schema__pb2.User.SerializeToString,
  25. response_deserializer=schema__pb2.Response.FromString,
  26. )
  27. class DatabaseServicer(object):
  28. """Missing associated documentation comment in .proto file."""
  29. def GetUsers(self, request, context):
  30. """Missing associated documentation comment in .proto file."""
  31. context.set_code(grpc.StatusCode.UNIMPLEMENTED)
  32. context.set_details('Method not implemented!')
  33. raise NotImplementedError('Method not implemented!')
  34. def DeleteUser(self, request, context):
  35. """Missing associated documentation comment in .proto file."""
  36. context.set_code(grpc.StatusCode.UNIMPLEMENTED)
  37. context.set_details('Method not implemented!')
  38. raise NotImplementedError('Method not implemented!')
  39. def PutUser(self, request, context):
  40. """Missing associated documentation comment in .proto file."""
  41. context.set_code(grpc.StatusCode.UNIMPLEMENTED)
  42. context.set_details('Method not implemented!')
  43. raise NotImplementedError('Method not implemented!')
  44. def add_DatabaseServicer_to_server(servicer, server):
  45. rpc_method_handlers = {
  46. 'GetUsers': grpc.unary_unary_rpc_method_handler(
  47. servicer.GetUsers,
  48. request_deserializer=schema__pb2.EmptyMessage.FromString,
  49. response_serializer=schema__pb2.UsersResponse.SerializeToString,
  50. ),
  51. 'DeleteUser': grpc.unary_unary_rpc_method_handler(
  52. servicer.DeleteUser,
  53. request_deserializer=schema__pb2.User.FromString,
  54. response_serializer=schema__pb2.Response.SerializeToString,
  55. ),
  56. 'PutUser': grpc.unary_unary_rpc_method_handler(
  57. servicer.PutUser,
  58. request_deserializer=schema__pb2.User.FromString,
  59. response_serializer=schema__pb2.Response.SerializeToString,
  60. ),
  61. }
  62. generic_handler = grpc.method_handlers_generic_handler(
  63. 'Database', rpc_method_handlers)
  64. server.add_generic_rpc_handlers((generic_handler,))
  65. # This class is part of an EXPERIMENTAL API.
  66. class Database(object):
  67. """Missing associated documentation comment in .proto file."""
  68. @staticmethod
  69. def GetUsers(request,
  70. target,
  71. options=(),
  72. channel_credentials=None,
  73. call_credentials=None,
  74. insecure=False,
  75. compression=None,
  76. wait_for_ready=None,
  77. timeout=None,
  78. metadata=None):
  79. return grpc.experimental.unary_unary(request, target, '/Database/GetUsers',
  80. schema__pb2.EmptyMessage.SerializeToString,
  81. schema__pb2.UsersResponse.FromString,
  82. options, channel_credentials,
  83. insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
  84. @staticmethod
  85. def DeleteUser(request,
  86. target,
  87. options=(),
  88. channel_credentials=None,
  89. call_credentials=None,
  90. insecure=False,
  91. compression=None,
  92. wait_for_ready=None,
  93. timeout=None,
  94. metadata=None):
  95. return grpc.experimental.unary_unary(request, target, '/Database/DeleteUser',
  96. schema__pb2.User.SerializeToString,
  97. schema__pb2.Response.FromString,
  98. options, channel_credentials,
  99. insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
  100. @staticmethod
  101. def PutUser(request,
  102. target,
  103. options=(),
  104. channel_credentials=None,
  105. call_credentials=None,
  106. insecure=False,
  107. compression=None,
  108. wait_for_ready=None,
  109. timeout=None,
  110. metadata=None):
  111. return grpc.experimental.unary_unary(request, target, '/Database/PutUser',
  112. schema__pb2.User.SerializeToString,
  113. schema__pb2.Response.FromString,
  114. options, channel_credentials,
  115. insecure, call_credentials, compression, wait_for_ready, timeout, metadata)