1# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! 2"""Client and server classes corresponding to protobuf-defined services.""" 3import grpc 4 5from chromiumos.longrunning import operations_pb2 as chromiumos_dot_longrunning_dot_operations__pb2 6from chromiumos.test.api import publish_service_pb2 as chromiumos_dot_test_dot_api_dot_publish__service__pb2 7 8 9class PublishServiceStub(object): 10 """Provides the ability to upload files to GS and publish results. 11 Publishing and upload require a more complex workflow than simple 12 file copy, and as such we require a service to simplify. 13 """ 14 15 def __init__(self, channel): 16 """Constructor. 17 18 Args: 19 channel: A grpc.Channel. 20 """ 21 self.UploadToGS = channel.unary_unary( 22 '/chromiumos.test.api.PublishService/UploadToGS', 23 request_serializer=chromiumos_dot_test_dot_api_dot_publish__service__pb2.UploadToGSRequest.SerializeToString, 24 response_deserializer=chromiumos_dot_longrunning_dot_operations__pb2.Operation.FromString, 25 ) 26 27 28class PublishServiceServicer(object): 29 """Provides the ability to upload files to GS and publish results. 30 Publishing and upload require a more complex workflow than simple 31 file copy, and as such we require a service to simplify. 32 """ 33 34 def UploadToGS(self, request, context): 35 """UploadToGS uploads a folder to Google Cloud Storage 36 37 Effectively this should function as a thin wrapper around the GCS API. 38 """ 39 context.set_code(grpc.StatusCode.UNIMPLEMENTED) 40 context.set_details('Method not implemented!') 41 raise NotImplementedError('Method not implemented!') 42 43 44def add_PublishServiceServicer_to_server(servicer, server): 45 rpc_method_handlers = { 46 'UploadToGS': grpc.unary_unary_rpc_method_handler( 47 servicer.UploadToGS, 48 request_deserializer=chromiumos_dot_test_dot_api_dot_publish__service__pb2.UploadToGSRequest.FromString, 49 response_serializer=chromiumos_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, 50 ), 51 } 52 generic_handler = grpc.method_handlers_generic_handler( 53 'chromiumos.test.api.PublishService', rpc_method_handlers) 54 server.add_generic_rpc_handlers((generic_handler,)) 55 56 57 # This class is part of an EXPERIMENTAL API. 58class PublishService(object): 59 """Provides the ability to upload files to GS and publish results. 60 Publishing and upload require a more complex workflow than simple 61 file copy, and as such we require a service to simplify. 62 """ 63 64 @staticmethod 65 def UploadToGS(request, 66 target, 67 options=(), 68 channel_credentials=None, 69 call_credentials=None, 70 insecure=False, 71 compression=None, 72 wait_for_ready=None, 73 timeout=None, 74 metadata=None): 75 return grpc.experimental.unary_unary(request, target, '/chromiumos.test.api.PublishService/UploadToGS', 76 chromiumos_dot_test_dot_api_dot_publish__service__pb2.UploadToGSRequest.SerializeToString, 77 chromiumos_dot_longrunning_dot_operations__pb2.Operation.FromString, 78 options, channel_credentials, 79 insecure, call_credentials, compression, wait_for_ready, timeout, metadata) 80