|
1 | 1 | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
|
2 | 2 | import grpc
|
3 | 3 |
|
4 |
| -from google.cloud.videointelligence_v1beta1.proto import video_intelligence_pb2 as google_dot_cloud_dot_videointelligence__v1beta1_dot_proto_dot_video__intelligence__pb2 |
5 |
| -from google.longrunning import operations_pb2 as google_dot_longrunning_dot_operations__pb2 |
| 4 | +from google.cloud.videointelligence_v1beta1.proto import ( |
| 5 | + video_intelligence_pb2 as google_dot_cloud_dot_videointelligence__v1beta1_dot_proto_dot_video__intelligence__pb2, |
| 6 | +) |
| 7 | +from google.longrunning import ( |
| 8 | + operations_pb2 as google_dot_longrunning_dot_operations__pb2, |
| 9 | +) |
6 | 10 |
|
7 | 11 |
|
8 | 12 | class VideoIntelligenceServiceStub(object):
|
9 |
| - """Service that implements Google Cloud Video Intelligence API. |
| 13 | + """Service that implements Google Cloud Video Intelligence API. |
10 | 14 | """
|
11 | 15 |
|
12 |
| - def __init__(self, channel): |
13 |
| - """Constructor. |
| 16 | + def __init__(self, channel): |
| 17 | + """Constructor. |
14 | 18 |
|
15 | 19 | Args:
|
16 | 20 | channel: A grpc.Channel.
|
17 | 21 | """
|
18 |
| - self.AnnotateVideo = channel.unary_unary( |
19 |
| - '/google.cloud.videointelligence.v1beta1.VideoIntelligenceService/AnnotateVideo', |
20 |
| - request_serializer=google_dot_cloud_dot_videointelligence__v1beta1_dot_proto_dot_video__intelligence__pb2.AnnotateVideoRequest.SerializeToString, |
21 |
| - response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, |
| 22 | + self.AnnotateVideo = channel.unary_unary( |
| 23 | + "/google.cloud.videointelligence.v1beta1.VideoIntelligenceService/AnnotateVideo", |
| 24 | + request_serializer=google_dot_cloud_dot_videointelligence__v1beta1_dot_proto_dot_video__intelligence__pb2.AnnotateVideoRequest.SerializeToString, |
| 25 | + response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, |
22 | 26 | )
|
23 | 27 |
|
24 | 28 |
|
25 | 29 | class VideoIntelligenceServiceServicer(object):
|
26 |
| - """Service that implements Google Cloud Video Intelligence API. |
| 30 | + """Service that implements Google Cloud Video Intelligence API. |
27 | 31 | """
|
28 | 32 |
|
29 |
| - def AnnotateVideo(self, request, context): |
30 |
| - """Performs asynchronous video annotation. Progress and results can be |
| 33 | + def AnnotateVideo(self, request, context): |
| 34 | + """Performs asynchronous video annotation. Progress and results can be |
31 | 35 | retrieved through the `google.longrunning.Operations` interface.
|
32 | 36 | `Operation.metadata` contains `AnnotateVideoProgress` (progress).
|
33 | 37 | `Operation.response` contains `AnnotateVideoResponse` (results).
|
34 | 38 | """
|
35 |
| - context.set_code(grpc.StatusCode.UNIMPLEMENTED) |
36 |
| - context.set_details('Method not implemented!') |
37 |
| - raise NotImplementedError('Method not implemented!') |
| 39 | + context.set_code(grpc.StatusCode.UNIMPLEMENTED) |
| 40 | + context.set_details("Method not implemented!") |
| 41 | + raise NotImplementedError("Method not implemented!") |
38 | 42 |
|
39 | 43 |
|
40 | 44 | def add_VideoIntelligenceServiceServicer_to_server(servicer, server):
|
41 |
| - rpc_method_handlers = { |
42 |
| - 'AnnotateVideo': grpc.unary_unary_rpc_method_handler( |
43 |
| - servicer.AnnotateVideo, |
44 |
| - request_deserializer=google_dot_cloud_dot_videointelligence__v1beta1_dot_proto_dot_video__intelligence__pb2.AnnotateVideoRequest.FromString, |
45 |
| - response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, |
46 |
| - ), |
47 |
| - } |
48 |
| - generic_handler = grpc.method_handlers_generic_handler( |
49 |
| - 'google.cloud.videointelligence.v1beta1.VideoIntelligenceService', rpc_method_handlers) |
50 |
| - server.add_generic_rpc_handlers((generic_handler,)) |
| 45 | + rpc_method_handlers = { |
| 46 | + "AnnotateVideo": grpc.unary_unary_rpc_method_handler( |
| 47 | + servicer.AnnotateVideo, |
| 48 | + request_deserializer=google_dot_cloud_dot_videointelligence__v1beta1_dot_proto_dot_video__intelligence__pb2.AnnotateVideoRequest.FromString, |
| 49 | + response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, |
| 50 | + ) |
| 51 | + } |
| 52 | + generic_handler = grpc.method_handlers_generic_handler( |
| 53 | + "google.cloud.videointelligence.v1beta1.VideoIntelligenceService", |
| 54 | + rpc_method_handlers, |
| 55 | + ) |
| 56 | + server.add_generic_rpc_handlers((generic_handler,)) |
0 commit comments