|
| 1 | +// GENERATED CODE -- DO NOT EDIT! |
| 2 | + |
| 3 | +'use strict'; |
| 4 | +var grpc = require('@grpc/grpc-js'); |
| 5 | +var proto_document_v1_document_pb = require('../../../proto/document/v1/document_pb.js'); |
| 6 | +var google_protobuf_struct_pb = require('google-protobuf/google/protobuf/struct_pb.js'); |
| 7 | +var validate_validate_pb = require('../../../validate/validate_pb.js'); |
| 8 | + |
| 9 | +function serialize_nitric_document_v1_DocumentDeleteRequest(arg) { |
| 10 | + if (!(arg instanceof proto_document_v1_document_pb.DocumentDeleteRequest)) { |
| 11 | + throw new Error('Expected argument of type nitric.document.v1.DocumentDeleteRequest'); |
| 12 | + } |
| 13 | + return Buffer.from(arg.serializeBinary()); |
| 14 | +} |
| 15 | + |
| 16 | +function deserialize_nitric_document_v1_DocumentDeleteRequest(buffer_arg) { |
| 17 | + return proto_document_v1_document_pb.DocumentDeleteRequest.deserializeBinary(new Uint8Array(buffer_arg)); |
| 18 | +} |
| 19 | + |
| 20 | +function serialize_nitric_document_v1_DocumentDeleteResponse(arg) { |
| 21 | + if (!(arg instanceof proto_document_v1_document_pb.DocumentDeleteResponse)) { |
| 22 | + throw new Error('Expected argument of type nitric.document.v1.DocumentDeleteResponse'); |
| 23 | + } |
| 24 | + return Buffer.from(arg.serializeBinary()); |
| 25 | +} |
| 26 | + |
| 27 | +function deserialize_nitric_document_v1_DocumentDeleteResponse(buffer_arg) { |
| 28 | + return proto_document_v1_document_pb.DocumentDeleteResponse.deserializeBinary(new Uint8Array(buffer_arg)); |
| 29 | +} |
| 30 | + |
| 31 | +function serialize_nitric_document_v1_DocumentGetRequest(arg) { |
| 32 | + if (!(arg instanceof proto_document_v1_document_pb.DocumentGetRequest)) { |
| 33 | + throw new Error('Expected argument of type nitric.document.v1.DocumentGetRequest'); |
| 34 | + } |
| 35 | + return Buffer.from(arg.serializeBinary()); |
| 36 | +} |
| 37 | + |
| 38 | +function deserialize_nitric_document_v1_DocumentGetRequest(buffer_arg) { |
| 39 | + return proto_document_v1_document_pb.DocumentGetRequest.deserializeBinary(new Uint8Array(buffer_arg)); |
| 40 | +} |
| 41 | + |
| 42 | +function serialize_nitric_document_v1_DocumentGetResponse(arg) { |
| 43 | + if (!(arg instanceof proto_document_v1_document_pb.DocumentGetResponse)) { |
| 44 | + throw new Error('Expected argument of type nitric.document.v1.DocumentGetResponse'); |
| 45 | + } |
| 46 | + return Buffer.from(arg.serializeBinary()); |
| 47 | +} |
| 48 | + |
| 49 | +function deserialize_nitric_document_v1_DocumentGetResponse(buffer_arg) { |
| 50 | + return proto_document_v1_document_pb.DocumentGetResponse.deserializeBinary(new Uint8Array(buffer_arg)); |
| 51 | +} |
| 52 | + |
| 53 | +function serialize_nitric_document_v1_DocumentQueryRequest(arg) { |
| 54 | + if (!(arg instanceof proto_document_v1_document_pb.DocumentQueryRequest)) { |
| 55 | + throw new Error('Expected argument of type nitric.document.v1.DocumentQueryRequest'); |
| 56 | + } |
| 57 | + return Buffer.from(arg.serializeBinary()); |
| 58 | +} |
| 59 | + |
| 60 | +function deserialize_nitric_document_v1_DocumentQueryRequest(buffer_arg) { |
| 61 | + return proto_document_v1_document_pb.DocumentQueryRequest.deserializeBinary(new Uint8Array(buffer_arg)); |
| 62 | +} |
| 63 | + |
| 64 | +function serialize_nitric_document_v1_DocumentQueryResponse(arg) { |
| 65 | + if (!(arg instanceof proto_document_v1_document_pb.DocumentQueryResponse)) { |
| 66 | + throw new Error('Expected argument of type nitric.document.v1.DocumentQueryResponse'); |
| 67 | + } |
| 68 | + return Buffer.from(arg.serializeBinary()); |
| 69 | +} |
| 70 | + |
| 71 | +function deserialize_nitric_document_v1_DocumentQueryResponse(buffer_arg) { |
| 72 | + return proto_document_v1_document_pb.DocumentQueryResponse.deserializeBinary(new Uint8Array(buffer_arg)); |
| 73 | +} |
| 74 | + |
| 75 | +function serialize_nitric_document_v1_DocumentQueryStreamRequest(arg) { |
| 76 | + if (!(arg instanceof proto_document_v1_document_pb.DocumentQueryStreamRequest)) { |
| 77 | + throw new Error('Expected argument of type nitric.document.v1.DocumentQueryStreamRequest'); |
| 78 | + } |
| 79 | + return Buffer.from(arg.serializeBinary()); |
| 80 | +} |
| 81 | + |
| 82 | +function deserialize_nitric_document_v1_DocumentQueryStreamRequest(buffer_arg) { |
| 83 | + return proto_document_v1_document_pb.DocumentQueryStreamRequest.deserializeBinary(new Uint8Array(buffer_arg)); |
| 84 | +} |
| 85 | + |
| 86 | +function serialize_nitric_document_v1_DocumentQueryStreamResponse(arg) { |
| 87 | + if (!(arg instanceof proto_document_v1_document_pb.DocumentQueryStreamResponse)) { |
| 88 | + throw new Error('Expected argument of type nitric.document.v1.DocumentQueryStreamResponse'); |
| 89 | + } |
| 90 | + return Buffer.from(arg.serializeBinary()); |
| 91 | +} |
| 92 | + |
| 93 | +function deserialize_nitric_document_v1_DocumentQueryStreamResponse(buffer_arg) { |
| 94 | + return proto_document_v1_document_pb.DocumentQueryStreamResponse.deserializeBinary(new Uint8Array(buffer_arg)); |
| 95 | +} |
| 96 | + |
| 97 | +function serialize_nitric_document_v1_DocumentSetRequest(arg) { |
| 98 | + if (!(arg instanceof proto_document_v1_document_pb.DocumentSetRequest)) { |
| 99 | + throw new Error('Expected argument of type nitric.document.v1.DocumentSetRequest'); |
| 100 | + } |
| 101 | + return Buffer.from(arg.serializeBinary()); |
| 102 | +} |
| 103 | + |
| 104 | +function deserialize_nitric_document_v1_DocumentSetRequest(buffer_arg) { |
| 105 | + return proto_document_v1_document_pb.DocumentSetRequest.deserializeBinary(new Uint8Array(buffer_arg)); |
| 106 | +} |
| 107 | + |
| 108 | +function serialize_nitric_document_v1_DocumentSetResponse(arg) { |
| 109 | + if (!(arg instanceof proto_document_v1_document_pb.DocumentSetResponse)) { |
| 110 | + throw new Error('Expected argument of type nitric.document.v1.DocumentSetResponse'); |
| 111 | + } |
| 112 | + return Buffer.from(arg.serializeBinary()); |
| 113 | +} |
| 114 | + |
| 115 | +function deserialize_nitric_document_v1_DocumentSetResponse(buffer_arg) { |
| 116 | + return proto_document_v1_document_pb.DocumentSetResponse.deserializeBinary(new Uint8Array(buffer_arg)); |
| 117 | +} |
| 118 | + |
| 119 | + |
| 120 | +// Service for storage and retrieval of simple JSON keyValue |
| 121 | +var DocumentServiceService = exports.DocumentServiceService = { |
| 122 | + // Get an existing document |
| 123 | +get: { |
| 124 | + path: '/nitric.document.v1.DocumentService/Get', |
| 125 | + requestStream: false, |
| 126 | + responseStream: false, |
| 127 | + requestType: proto_document_v1_document_pb.DocumentGetRequest, |
| 128 | + responseType: proto_document_v1_document_pb.DocumentGetResponse, |
| 129 | + requestSerialize: serialize_nitric_document_v1_DocumentGetRequest, |
| 130 | + requestDeserialize: deserialize_nitric_document_v1_DocumentGetRequest, |
| 131 | + responseSerialize: serialize_nitric_document_v1_DocumentGetResponse, |
| 132 | + responseDeserialize: deserialize_nitric_document_v1_DocumentGetResponse, |
| 133 | + }, |
| 134 | + // Create a new or overwrite an existing document |
| 135 | +set: { |
| 136 | + path: '/nitric.document.v1.DocumentService/Set', |
| 137 | + requestStream: false, |
| 138 | + responseStream: false, |
| 139 | + requestType: proto_document_v1_document_pb.DocumentSetRequest, |
| 140 | + responseType: proto_document_v1_document_pb.DocumentSetResponse, |
| 141 | + requestSerialize: serialize_nitric_document_v1_DocumentSetRequest, |
| 142 | + requestDeserialize: deserialize_nitric_document_v1_DocumentSetRequest, |
| 143 | + responseSerialize: serialize_nitric_document_v1_DocumentSetResponse, |
| 144 | + responseDeserialize: deserialize_nitric_document_v1_DocumentSetResponse, |
| 145 | + }, |
| 146 | + // Delete an existing document |
| 147 | +delete: { |
| 148 | + path: '/nitric.document.v1.DocumentService/Delete', |
| 149 | + requestStream: false, |
| 150 | + responseStream: false, |
| 151 | + requestType: proto_document_v1_document_pb.DocumentDeleteRequest, |
| 152 | + responseType: proto_document_v1_document_pb.DocumentDeleteResponse, |
| 153 | + requestSerialize: serialize_nitric_document_v1_DocumentDeleteRequest, |
| 154 | + requestDeserialize: deserialize_nitric_document_v1_DocumentDeleteRequest, |
| 155 | + responseSerialize: serialize_nitric_document_v1_DocumentDeleteResponse, |
| 156 | + responseDeserialize: deserialize_nitric_document_v1_DocumentDeleteResponse, |
| 157 | + }, |
| 158 | + // Query the document collection (supports pagination) |
| 159 | +query: { |
| 160 | + path: '/nitric.document.v1.DocumentService/Query', |
| 161 | + requestStream: false, |
| 162 | + responseStream: false, |
| 163 | + requestType: proto_document_v1_document_pb.DocumentQueryRequest, |
| 164 | + responseType: proto_document_v1_document_pb.DocumentQueryResponse, |
| 165 | + requestSerialize: serialize_nitric_document_v1_DocumentQueryRequest, |
| 166 | + requestDeserialize: deserialize_nitric_document_v1_DocumentQueryRequest, |
| 167 | + responseSerialize: serialize_nitric_document_v1_DocumentQueryResponse, |
| 168 | + responseDeserialize: deserialize_nitric_document_v1_DocumentQueryResponse, |
| 169 | + }, |
| 170 | + // Query the document collection (supports streaming) |
| 171 | +queryStream: { |
| 172 | + path: '/nitric.document.v1.DocumentService/QueryStream', |
| 173 | + requestStream: false, |
| 174 | + responseStream: true, |
| 175 | + requestType: proto_document_v1_document_pb.DocumentQueryStreamRequest, |
| 176 | + responseType: proto_document_v1_document_pb.DocumentQueryStreamResponse, |
| 177 | + requestSerialize: serialize_nitric_document_v1_DocumentQueryStreamRequest, |
| 178 | + requestDeserialize: deserialize_nitric_document_v1_DocumentQueryStreamRequest, |
| 179 | + responseSerialize: serialize_nitric_document_v1_DocumentQueryStreamResponse, |
| 180 | + responseDeserialize: deserialize_nitric_document_v1_DocumentQueryStreamResponse, |
| 181 | + }, |
| 182 | +}; |
| 183 | + |
| 184 | +exports.DocumentServiceClient = grpc.makeGenericClientConstructor(DocumentServiceService); |
0 commit comments