|
1 | 1 | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! |
2 | | -"""Client and server classes corresponding to protobuf-defined services.""" |
3 | 2 | import grpc |
4 | 3 |
|
5 | 4 | import hook_pb2 as hook__pb2 |
6 | 5 |
|
7 | 6 |
|
8 | 7 | class HookHandlerStub(object): |
9 | | - """The hook service definition. |
10 | | - """ |
| 8 | + """The hook service definition. |
| 9 | + """ |
11 | 10 |
|
12 | | - def __init__(self, channel): |
13 | | - """Constructor. |
| 11 | + def __init__(self, channel): |
| 12 | + """Constructor. |
14 | 13 |
|
15 | | - Args: |
16 | | - channel: A grpc.Channel. |
17 | | - """ |
18 | | - self.InvokeHook = channel.unary_unary( |
19 | | - '/v2.HookHandler/InvokeHook', |
20 | | - request_serializer=hook__pb2.HookRequest.SerializeToString, |
21 | | - response_deserializer=hook__pb2.HookResponse.FromString, |
22 | | - ) |
| 14 | + Args: |
| 15 | + channel: A grpc.Channel. |
| 16 | + """ |
| 17 | + self.InvokeHook = channel.unary_unary( |
| 18 | + '/proto.HookHandler/InvokeHook', |
| 19 | + request_serializer=hook__pb2.HookRequest.SerializeToString, |
| 20 | + response_deserializer=hook__pb2.HookResponse.FromString, |
| 21 | + ) |
23 | 22 |
|
24 | 23 |
|
25 | 24 | class HookHandlerServicer(object): |
26 | | - """The hook service definition. |
| 25 | + """The hook service definition. |
| 26 | + """ |
| 27 | + |
| 28 | + def InvokeHook(self, request, context): |
| 29 | + """InvokeHook is invoked for every hook that is executed. HookRequest contains the |
| 30 | + corresponding information about the hook type, the involved upload, and |
| 31 | + causing HTTP request. |
| 32 | + The return value HookResponse allows to stop or reject an upload, as well as modifying |
| 33 | + the HTTP response. See the documentation for HookResponse for more details. |
27 | 34 | """ |
28 | | - |
29 | | - def InvokeHook(self, request, context): |
30 | | - """InvokeHook is invoked for every hook that is executed. HookRequest contains the |
31 | | - corresponding information about the hook type, the involved upload, and |
32 | | - causing HTTP request. |
33 | | - The return value HookResponse allows to stop or reject an upload, as well as modifying |
34 | | - the HTTP response. See the documentation for HookResponse for more details. |
35 | | - """ |
36 | | - context.set_code(grpc.StatusCode.UNIMPLEMENTED) |
37 | | - context.set_details('Method not implemented!') |
38 | | - raise NotImplementedError('Method not implemented!') |
| 35 | + context.set_code(grpc.StatusCode.UNIMPLEMENTED) |
| 36 | + context.set_details('Method not implemented!') |
| 37 | + raise NotImplementedError('Method not implemented!') |
39 | 38 |
|
40 | 39 |
|
41 | 40 | def add_HookHandlerServicer_to_server(servicer, server): |
42 | | - rpc_method_handlers = { |
43 | | - 'InvokeHook': grpc.unary_unary_rpc_method_handler( |
44 | | - servicer.InvokeHook, |
45 | | - request_deserializer=hook__pb2.HookRequest.FromString, |
46 | | - response_serializer=hook__pb2.HookResponse.SerializeToString, |
47 | | - ), |
48 | | - } |
49 | | - generic_handler = grpc.method_handlers_generic_handler( |
50 | | - 'v2.HookHandler', rpc_method_handlers) |
51 | | - server.add_generic_rpc_handlers((generic_handler,)) |
52 | | - |
53 | | - |
54 | | - # This class is part of an EXPERIMENTAL API. |
55 | | -class HookHandler(object): |
56 | | - """The hook service definition. |
57 | | - """ |
58 | | - |
59 | | - @staticmethod |
60 | | - def InvokeHook(request, |
61 | | - target, |
62 | | - options=(), |
63 | | - channel_credentials=None, |
64 | | - call_credentials=None, |
65 | | - insecure=False, |
66 | | - compression=None, |
67 | | - wait_for_ready=None, |
68 | | - timeout=None, |
69 | | - metadata=None): |
70 | | - return grpc.experimental.unary_unary(request, target, '/v2.HookHandler/InvokeHook', |
71 | | - hook__pb2.HookRequest.SerializeToString, |
72 | | - hook__pb2.HookResponse.FromString, |
73 | | - options, channel_credentials, |
74 | | - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) |
| 41 | + rpc_method_handlers = { |
| 42 | + 'InvokeHook': grpc.unary_unary_rpc_method_handler( |
| 43 | + servicer.InvokeHook, |
| 44 | + request_deserializer=hook__pb2.HookRequest.FromString, |
| 45 | + response_serializer=hook__pb2.HookResponse.SerializeToString, |
| 46 | + ), |
| 47 | + } |
| 48 | + generic_handler = grpc.method_handlers_generic_handler( |
| 49 | + 'proto.HookHandler', rpc_method_handlers) |
| 50 | + server.add_generic_rpc_handlers((generic_handler,)) |
0 commit comments