|
| 1 | +// GENERATED CODE -- DO NOT EDIT! |
| 2 | + |
| 3 | +'use strict'; |
| 4 | +var grpc = require('@grpc/grpc-js'); |
| 5 | +var nitric_proto_batch_v1_batch_pb = require('../../../../nitric/proto/batch/v1/batch_pb.js'); |
| 6 | +var google_protobuf_struct_pb = require('google-protobuf/google/protobuf/struct_pb.js'); |
| 7 | + |
| 8 | +function serialize_nitric_proto_batch_v1_ClientMessage(arg) { |
| 9 | + if (!(arg instanceof nitric_proto_batch_v1_batch_pb.ClientMessage)) { |
| 10 | + throw new Error('Expected argument of type nitric.proto.batch.v1.ClientMessage'); |
| 11 | + } |
| 12 | + return Buffer.from(arg.serializeBinary()); |
| 13 | +} |
| 14 | + |
| 15 | +function deserialize_nitric_proto_batch_v1_ClientMessage(buffer_arg) { |
| 16 | + return nitric_proto_batch_v1_batch_pb.ClientMessage.deserializeBinary(new Uint8Array(buffer_arg)); |
| 17 | +} |
| 18 | + |
| 19 | +function serialize_nitric_proto_batch_v1_JobSubmitRequest(arg) { |
| 20 | + if (!(arg instanceof nitric_proto_batch_v1_batch_pb.JobSubmitRequest)) { |
| 21 | + throw new Error('Expected argument of type nitric.proto.batch.v1.JobSubmitRequest'); |
| 22 | + } |
| 23 | + return Buffer.from(arg.serializeBinary()); |
| 24 | +} |
| 25 | + |
| 26 | +function deserialize_nitric_proto_batch_v1_JobSubmitRequest(buffer_arg) { |
| 27 | + return nitric_proto_batch_v1_batch_pb.JobSubmitRequest.deserializeBinary(new Uint8Array(buffer_arg)); |
| 28 | +} |
| 29 | + |
| 30 | +function serialize_nitric_proto_batch_v1_JobSubmitResponse(arg) { |
| 31 | + if (!(arg instanceof nitric_proto_batch_v1_batch_pb.JobSubmitResponse)) { |
| 32 | + throw new Error('Expected argument of type nitric.proto.batch.v1.JobSubmitResponse'); |
| 33 | + } |
| 34 | + return Buffer.from(arg.serializeBinary()); |
| 35 | +} |
| 36 | + |
| 37 | +function deserialize_nitric_proto_batch_v1_JobSubmitResponse(buffer_arg) { |
| 38 | + return nitric_proto_batch_v1_batch_pb.JobSubmitResponse.deserializeBinary(new Uint8Array(buffer_arg)); |
| 39 | +} |
| 40 | + |
| 41 | +function serialize_nitric_proto_batch_v1_ServerMessage(arg) { |
| 42 | + if (!(arg instanceof nitric_proto_batch_v1_batch_pb.ServerMessage)) { |
| 43 | + throw new Error('Expected argument of type nitric.proto.batch.v1.ServerMessage'); |
| 44 | + } |
| 45 | + return Buffer.from(arg.serializeBinary()); |
| 46 | +} |
| 47 | + |
| 48 | +function deserialize_nitric_proto_batch_v1_ServerMessage(buffer_arg) { |
| 49 | + return nitric_proto_batch_v1_batch_pb.ServerMessage.deserializeBinary(new Uint8Array(buffer_arg)); |
| 50 | +} |
| 51 | + |
| 52 | + |
| 53 | +// Service for processing jobs |
| 54 | +var JobService = exports.JobService = { |
| 55 | + handleJob: { |
| 56 | + path: '/nitric.proto.batch.v1.Job/HandleJob', |
| 57 | + requestStream: true, |
| 58 | + responseStream: true, |
| 59 | + requestType: nitric_proto_batch_v1_batch_pb.ClientMessage, |
| 60 | + responseType: nitric_proto_batch_v1_batch_pb.ServerMessage, |
| 61 | + requestSerialize: serialize_nitric_proto_batch_v1_ClientMessage, |
| 62 | + requestDeserialize: deserialize_nitric_proto_batch_v1_ClientMessage, |
| 63 | + responseSerialize: serialize_nitric_proto_batch_v1_ServerMessage, |
| 64 | + responseDeserialize: deserialize_nitric_proto_batch_v1_ServerMessage, |
| 65 | + }, |
| 66 | +}; |
| 67 | + |
| 68 | +exports.JobClient = grpc.makeGenericClientConstructor(JobService); |
| 69 | +// Service for submitting jobs to be processed |
| 70 | +var BatchService = exports.BatchService = { |
| 71 | + submitJob: { |
| 72 | + path: '/nitric.proto.batch.v1.Batch/SubmitJob', |
| 73 | + requestStream: false, |
| 74 | + responseStream: false, |
| 75 | + requestType: nitric_proto_batch_v1_batch_pb.JobSubmitRequest, |
| 76 | + responseType: nitric_proto_batch_v1_batch_pb.JobSubmitResponse, |
| 77 | + requestSerialize: serialize_nitric_proto_batch_v1_JobSubmitRequest, |
| 78 | + requestDeserialize: deserialize_nitric_proto_batch_v1_JobSubmitRequest, |
| 79 | + responseSerialize: serialize_nitric_proto_batch_v1_JobSubmitResponse, |
| 80 | + responseDeserialize: deserialize_nitric_proto_batch_v1_JobSubmitResponse, |
| 81 | + }, |
| 82 | +}; |
| 83 | + |
| 84 | +exports.BatchClient = grpc.makeGenericClientConstructor(BatchService); |
0 commit comments