1 | // Copyright 2021 Google LLC
|
2 | //
|
3 | // Licensed under the Apache License, Version 2.0 (the "License");
|
4 | // you may not use this file except in compliance with the License.
|
5 | // You may obtain a copy of the License at
|
6 | //
|
7 | // http://www.apache.org/licenses/LICENSE-2.0
|
8 | //
|
9 | // Unless required by applicable law or agreed to in writing, software
|
10 | // distributed under the License is distributed on an "AS IS" BASIS,
|
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12 | // See the License for the specific language governing permissions and
|
13 | // limitations under the License.
|
14 |
|
15 | /*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/
|
16 | (function(global, factory) { /* global define, require, module */
|
17 |
|
18 | /* AMD */ if (typeof define === 'function' && define.amd)
|
19 | define(["protobufjs/minimal"], factory);
|
20 |
|
21 | /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports)
|
22 | module.exports = factory(require("google-gax").protobufMinimal);
|
23 |
|
24 | })(this, function($protobuf) {
|
25 | ;
|
26 |
|
27 | // Common aliases
|
28 | var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;
|
29 |
|
30 | // Exported root namespace
|
31 | var $root = $protobuf.roots._google_cloud_speech_protos || ($protobuf.roots._google_cloud_speech_protos = {});
|
32 |
|
33 | $root.google = (function() {
|
34 |
|
35 | /**
|
36 | * Namespace google.
|
37 | * @exports google
|
38 | * @namespace
|
39 | */
|
40 | var google = {};
|
41 |
|
42 | google.cloud = (function() {
|
43 |
|
44 | /**
|
45 | * Namespace cloud.
|
46 | * @memberof google
|
47 | * @namespace
|
48 | */
|
49 | var cloud = {};
|
50 |
|
51 | cloud.speech = (function() {
|
52 |
|
53 | /**
|
54 | * Namespace speech.
|
55 | * @memberof google.cloud
|
56 | * @namespace
|
57 | */
|
58 | var speech = {};
|
59 |
|
60 | speech.v1 = (function() {
|
61 |
|
62 | /**
|
63 | * Namespace v1.
|
64 | * @memberof google.cloud.speech
|
65 | * @namespace
|
66 | */
|
67 | var v1 = {};
|
68 |
|
69 | v1.Speech = (function() {
|
70 |
|
71 | /**
|
72 | * Constructs a new Speech service.
|
73 | * @memberof google.cloud.speech.v1
|
74 | * @classdesc Represents a Speech
|
75 | * @extends $protobuf.rpc.Service
|
76 | * @constructor
|
77 | * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
|
78 | * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
|
79 | * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
|
80 | */
|
81 | function Speech(rpcImpl, requestDelimited, responseDelimited) {
|
82 | $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);
|
83 | }
|
84 |
|
85 | (Speech.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Speech;
|
86 |
|
87 | /**
|
88 | * Creates new Speech service using the specified rpc implementation.
|
89 | * @function create
|
90 | * @memberof google.cloud.speech.v1.Speech
|
91 | * @static
|
92 | * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
|
93 | * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
|
94 | * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
|
95 | * @returns {Speech} RPC service. Useful where requests and/or responses are streamed.
|
96 | */
|
97 | Speech.create = function create(rpcImpl, requestDelimited, responseDelimited) {
|
98 | return new this(rpcImpl, requestDelimited, responseDelimited);
|
99 | };
|
100 |
|
101 | /**
|
102 | * Callback as used by {@link google.cloud.speech.v1.Speech#recognize}.
|
103 | * @memberof google.cloud.speech.v1.Speech
|
104 | * @typedef RecognizeCallback
|
105 | * @type {function}
|
106 | * @param {Error|null} error Error, if any
|
107 | * @param {google.cloud.speech.v1.RecognizeResponse} [response] RecognizeResponse
|
108 | */
|
109 |
|
110 | /**
|
111 | * Calls Recognize.
|
112 | * @function recognize
|
113 | * @memberof google.cloud.speech.v1.Speech
|
114 | * @instance
|
115 | * @param {google.cloud.speech.v1.IRecognizeRequest} request RecognizeRequest message or plain object
|
116 | * @param {google.cloud.speech.v1.Speech.RecognizeCallback} callback Node-style callback called with the error, if any, and RecognizeResponse
|
117 | * @returns {undefined}
|
118 | * @variation 1
|
119 | */
|
120 | Object.defineProperty(Speech.prototype.recognize = function recognize(request, callback) {
|
121 | return this.rpcCall(recognize, $root.google.cloud.speech.v1.RecognizeRequest, $root.google.cloud.speech.v1.RecognizeResponse, request, callback);
|
122 | }, "name", { value: "Recognize" });
|
123 |
|
124 | /**
|
125 | * Calls Recognize.
|
126 | * @function recognize
|
127 | * @memberof google.cloud.speech.v1.Speech
|
128 | * @instance
|
129 | * @param {google.cloud.speech.v1.IRecognizeRequest} request RecognizeRequest message or plain object
|
130 | * @returns {Promise<google.cloud.speech.v1.RecognizeResponse>} Promise
|
131 | * @variation 2
|
132 | */
|
133 |
|
134 | /**
|
135 | * Callback as used by {@link google.cloud.speech.v1.Speech#longRunningRecognize}.
|
136 | * @memberof google.cloud.speech.v1.Speech
|
137 | * @typedef LongRunningRecognizeCallback
|
138 | * @type {function}
|
139 | * @param {Error|null} error Error, if any
|
140 | * @param {google.longrunning.Operation} [response] Operation
|
141 | */
|
142 |
|
143 | /**
|
144 | * Calls LongRunningRecognize.
|
145 | * @function longRunningRecognize
|
146 | * @memberof google.cloud.speech.v1.Speech
|
147 | * @instance
|
148 | * @param {google.cloud.speech.v1.ILongRunningRecognizeRequest} request LongRunningRecognizeRequest message or plain object
|
149 | * @param {google.cloud.speech.v1.Speech.LongRunningRecognizeCallback} callback Node-style callback called with the error, if any, and Operation
|
150 | * @returns {undefined}
|
151 | * @variation 1
|
152 | */
|
153 | Object.defineProperty(Speech.prototype.longRunningRecognize = function longRunningRecognize(request, callback) {
|
154 | return this.rpcCall(longRunningRecognize, $root.google.cloud.speech.v1.LongRunningRecognizeRequest, $root.google.longrunning.Operation, request, callback);
|
155 | }, "name", { value: "LongRunningRecognize" });
|
156 |
|
157 | /**
|
158 | * Calls LongRunningRecognize.
|
159 | * @function longRunningRecognize
|
160 | * @memberof google.cloud.speech.v1.Speech
|
161 | * @instance
|
162 | * @param {google.cloud.speech.v1.ILongRunningRecognizeRequest} request LongRunningRecognizeRequest message or plain object
|
163 | * @returns {Promise<google.longrunning.Operation>} Promise
|
164 | * @variation 2
|
165 | */
|
166 |
|
167 | /**
|
168 | * Callback as used by {@link google.cloud.speech.v1.Speech#streamingRecognize}.
|
169 | * @memberof google.cloud.speech.v1.Speech
|
170 | * @typedef StreamingRecognizeCallback
|
171 | * @type {function}
|
172 | * @param {Error|null} error Error, if any
|
173 | * @param {google.cloud.speech.v1.StreamingRecognizeResponse} [response] StreamingRecognizeResponse
|
174 | */
|
175 |
|
176 | /**
|
177 | * Calls StreamingRecognize.
|
178 | * @function streamingRecognize
|
179 | * @memberof google.cloud.speech.v1.Speech
|
180 | * @instance
|
181 | * @param {google.cloud.speech.v1.IStreamingRecognizeRequest} request StreamingRecognizeRequest message or plain object
|
182 | * @param {google.cloud.speech.v1.Speech.StreamingRecognizeCallback} callback Node-style callback called with the error, if any, and StreamingRecognizeResponse
|
183 | * @returns {undefined}
|
184 | * @variation 1
|
185 | */
|
186 | Object.defineProperty(Speech.prototype.streamingRecognize = function streamingRecognize(request, callback) {
|
187 | return this.rpcCall(streamingRecognize, $root.google.cloud.speech.v1.StreamingRecognizeRequest, $root.google.cloud.speech.v1.StreamingRecognizeResponse, request, callback);
|
188 | }, "name", { value: "StreamingRecognize" });
|
189 |
|
190 | /**
|
191 | * Calls StreamingRecognize.
|
192 | * @function streamingRecognize
|
193 | * @memberof google.cloud.speech.v1.Speech
|
194 | * @instance
|
195 | * @param {google.cloud.speech.v1.IStreamingRecognizeRequest} request StreamingRecognizeRequest message or plain object
|
196 | * @returns {Promise<google.cloud.speech.v1.StreamingRecognizeResponse>} Promise
|
197 | * @variation 2
|
198 | */
|
199 |
|
200 | return Speech;
|
201 | })();
|
202 |
|
203 | v1.RecognizeRequest = (function() {
|
204 |
|
205 | /**
|
206 | * Properties of a RecognizeRequest.
|
207 | * @memberof google.cloud.speech.v1
|
208 | * @interface IRecognizeRequest
|
209 | * @property {google.cloud.speech.v1.IRecognitionConfig|null} [config] RecognizeRequest config
|
210 | * @property {google.cloud.speech.v1.IRecognitionAudio|null} [audio] RecognizeRequest audio
|
211 | */
|
212 |
|
213 | /**
|
214 | * Constructs a new RecognizeRequest.
|
215 | * @memberof google.cloud.speech.v1
|
216 | * @classdesc Represents a RecognizeRequest.
|
217 | * @implements IRecognizeRequest
|
218 | * @constructor
|
219 | * @param {google.cloud.speech.v1.IRecognizeRequest=} [properties] Properties to set
|
220 | */
|
221 | function RecognizeRequest(properties) {
|
222 | if (properties)
|
223 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
224 | if (properties[keys[i]] != null)
|
225 | this[keys[i]] = properties[keys[i]];
|
226 | }
|
227 |
|
228 | /**
|
229 | * RecognizeRequest config.
|
230 | * @member {google.cloud.speech.v1.IRecognitionConfig|null|undefined} config
|
231 | * @memberof google.cloud.speech.v1.RecognizeRequest
|
232 | * @instance
|
233 | */
|
234 | RecognizeRequest.prototype.config = null;
|
235 |
|
236 | /**
|
237 | * RecognizeRequest audio.
|
238 | * @member {google.cloud.speech.v1.IRecognitionAudio|null|undefined} audio
|
239 | * @memberof google.cloud.speech.v1.RecognizeRequest
|
240 | * @instance
|
241 | */
|
242 | RecognizeRequest.prototype.audio = null;
|
243 |
|
244 | /**
|
245 | * Creates a new RecognizeRequest instance using the specified properties.
|
246 | * @function create
|
247 | * @memberof google.cloud.speech.v1.RecognizeRequest
|
248 | * @static
|
249 | * @param {google.cloud.speech.v1.IRecognizeRequest=} [properties] Properties to set
|
250 | * @returns {google.cloud.speech.v1.RecognizeRequest} RecognizeRequest instance
|
251 | */
|
252 | RecognizeRequest.create = function create(properties) {
|
253 | return new RecognizeRequest(properties);
|
254 | };
|
255 |
|
256 | /**
|
257 | * Encodes the specified RecognizeRequest message. Does not implicitly {@link google.cloud.speech.v1.RecognizeRequest.verify|verify} messages.
|
258 | * @function encode
|
259 | * @memberof google.cloud.speech.v1.RecognizeRequest
|
260 | * @static
|
261 | * @param {google.cloud.speech.v1.IRecognizeRequest} message RecognizeRequest message or plain object to encode
|
262 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
263 | * @returns {$protobuf.Writer} Writer
|
264 | */
|
265 | RecognizeRequest.encode = function encode(message, writer) {
|
266 | if (!writer)
|
267 | writer = $Writer.create();
|
268 | if (message.config != null && Object.hasOwnProperty.call(message, "config"))
|
269 | $root.google.cloud.speech.v1.RecognitionConfig.encode(message.config, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
270 | if (message.audio != null && Object.hasOwnProperty.call(message, "audio"))
|
271 | $root.google.cloud.speech.v1.RecognitionAudio.encode(message.audio, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
272 | return writer;
|
273 | };
|
274 |
|
275 | /**
|
276 | * Encodes the specified RecognizeRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1.RecognizeRequest.verify|verify} messages.
|
277 | * @function encodeDelimited
|
278 | * @memberof google.cloud.speech.v1.RecognizeRequest
|
279 | * @static
|
280 | * @param {google.cloud.speech.v1.IRecognizeRequest} message RecognizeRequest message or plain object to encode
|
281 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
282 | * @returns {$protobuf.Writer} Writer
|
283 | */
|
284 | RecognizeRequest.encodeDelimited = function encodeDelimited(message, writer) {
|
285 | return this.encode(message, writer).ldelim();
|
286 | };
|
287 |
|
288 | /**
|
289 | * Decodes a RecognizeRequest message from the specified reader or buffer.
|
290 | * @function decode
|
291 | * @memberof google.cloud.speech.v1.RecognizeRequest
|
292 | * @static
|
293 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
294 | * @param {number} [length] Message length if known beforehand
|
295 | * @returns {google.cloud.speech.v1.RecognizeRequest} RecognizeRequest
|
296 | * @throws {Error} If the payload is not a reader or valid buffer
|
297 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
298 | */
|
299 | RecognizeRequest.decode = function decode(reader, length) {
|
300 | if (!(reader instanceof $Reader))
|
301 | reader = $Reader.create(reader);
|
302 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.RecognizeRequest();
|
303 | while (reader.pos < end) {
|
304 | var tag = reader.uint32();
|
305 | switch (tag >>> 3) {
|
306 | case 1:
|
307 | message.config = $root.google.cloud.speech.v1.RecognitionConfig.decode(reader, reader.uint32());
|
308 | break;
|
309 | case 2:
|
310 | message.audio = $root.google.cloud.speech.v1.RecognitionAudio.decode(reader, reader.uint32());
|
311 | break;
|
312 | default:
|
313 | reader.skipType(tag & 7);
|
314 | break;
|
315 | }
|
316 | }
|
317 | return message;
|
318 | };
|
319 |
|
320 | /**
|
321 | * Decodes a RecognizeRequest message from the specified reader or buffer, length delimited.
|
322 | * @function decodeDelimited
|
323 | * @memberof google.cloud.speech.v1.RecognizeRequest
|
324 | * @static
|
325 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
326 | * @returns {google.cloud.speech.v1.RecognizeRequest} RecognizeRequest
|
327 | * @throws {Error} If the payload is not a reader or valid buffer
|
328 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
329 | */
|
330 | RecognizeRequest.decodeDelimited = function decodeDelimited(reader) {
|
331 | if (!(reader instanceof $Reader))
|
332 | reader = new $Reader(reader);
|
333 | return this.decode(reader, reader.uint32());
|
334 | };
|
335 |
|
336 | /**
|
337 | * Verifies a RecognizeRequest message.
|
338 | * @function verify
|
339 | * @memberof google.cloud.speech.v1.RecognizeRequest
|
340 | * @static
|
341 | * @param {Object.<string,*>} message Plain object to verify
|
342 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
343 | */
|
344 | RecognizeRequest.verify = function verify(message) {
|
345 | if (typeof message !== "object" || message === null)
|
346 | return "object expected";
|
347 | if (message.config != null && message.hasOwnProperty("config")) {
|
348 | var error = $root.google.cloud.speech.v1.RecognitionConfig.verify(message.config);
|
349 | if (error)
|
350 | return "config." + error;
|
351 | }
|
352 | if (message.audio != null && message.hasOwnProperty("audio")) {
|
353 | var error = $root.google.cloud.speech.v1.RecognitionAudio.verify(message.audio);
|
354 | if (error)
|
355 | return "audio." + error;
|
356 | }
|
357 | return null;
|
358 | };
|
359 |
|
360 | /**
|
361 | * Creates a RecognizeRequest message from a plain object. Also converts values to their respective internal types.
|
362 | * @function fromObject
|
363 | * @memberof google.cloud.speech.v1.RecognizeRequest
|
364 | * @static
|
365 | * @param {Object.<string,*>} object Plain object
|
366 | * @returns {google.cloud.speech.v1.RecognizeRequest} RecognizeRequest
|
367 | */
|
368 | RecognizeRequest.fromObject = function fromObject(object) {
|
369 | if (object instanceof $root.google.cloud.speech.v1.RecognizeRequest)
|
370 | return object;
|
371 | var message = new $root.google.cloud.speech.v1.RecognizeRequest();
|
372 | if (object.config != null) {
|
373 | if (typeof object.config !== "object")
|
374 | throw TypeError(".google.cloud.speech.v1.RecognizeRequest.config: object expected");
|
375 | message.config = $root.google.cloud.speech.v1.RecognitionConfig.fromObject(object.config);
|
376 | }
|
377 | if (object.audio != null) {
|
378 | if (typeof object.audio !== "object")
|
379 | throw TypeError(".google.cloud.speech.v1.RecognizeRequest.audio: object expected");
|
380 | message.audio = $root.google.cloud.speech.v1.RecognitionAudio.fromObject(object.audio);
|
381 | }
|
382 | return message;
|
383 | };
|
384 |
|
385 | /**
|
386 | * Creates a plain object from a RecognizeRequest message. Also converts values to other types if specified.
|
387 | * @function toObject
|
388 | * @memberof google.cloud.speech.v1.RecognizeRequest
|
389 | * @static
|
390 | * @param {google.cloud.speech.v1.RecognizeRequest} message RecognizeRequest
|
391 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
392 | * @returns {Object.<string,*>} Plain object
|
393 | */
|
394 | RecognizeRequest.toObject = function toObject(message, options) {
|
395 | if (!options)
|
396 | options = {};
|
397 | var object = {};
|
398 | if (options.defaults) {
|
399 | object.config = null;
|
400 | object.audio = null;
|
401 | }
|
402 | if (message.config != null && message.hasOwnProperty("config"))
|
403 | object.config = $root.google.cloud.speech.v1.RecognitionConfig.toObject(message.config, options);
|
404 | if (message.audio != null && message.hasOwnProperty("audio"))
|
405 | object.audio = $root.google.cloud.speech.v1.RecognitionAudio.toObject(message.audio, options);
|
406 | return object;
|
407 | };
|
408 |
|
409 | /**
|
410 | * Converts this RecognizeRequest to JSON.
|
411 | * @function toJSON
|
412 | * @memberof google.cloud.speech.v1.RecognizeRequest
|
413 | * @instance
|
414 | * @returns {Object.<string,*>} JSON object
|
415 | */
|
416 | RecognizeRequest.prototype.toJSON = function toJSON() {
|
417 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
418 | };
|
419 |
|
420 | return RecognizeRequest;
|
421 | })();
|
422 |
|
423 | v1.LongRunningRecognizeRequest = (function() {
|
424 |
|
425 | /**
|
426 | * Properties of a LongRunningRecognizeRequest.
|
427 | * @memberof google.cloud.speech.v1
|
428 | * @interface ILongRunningRecognizeRequest
|
429 | * @property {google.cloud.speech.v1.IRecognitionConfig|null} [config] LongRunningRecognizeRequest config
|
430 | * @property {google.cloud.speech.v1.IRecognitionAudio|null} [audio] LongRunningRecognizeRequest audio
|
431 | */
|
432 |
|
433 | /**
|
434 | * Constructs a new LongRunningRecognizeRequest.
|
435 | * @memberof google.cloud.speech.v1
|
436 | * @classdesc Represents a LongRunningRecognizeRequest.
|
437 | * @implements ILongRunningRecognizeRequest
|
438 | * @constructor
|
439 | * @param {google.cloud.speech.v1.ILongRunningRecognizeRequest=} [properties] Properties to set
|
440 | */
|
441 | function LongRunningRecognizeRequest(properties) {
|
442 | if (properties)
|
443 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
444 | if (properties[keys[i]] != null)
|
445 | this[keys[i]] = properties[keys[i]];
|
446 | }
|
447 |
|
448 | /**
|
449 | * LongRunningRecognizeRequest config.
|
450 | * @member {google.cloud.speech.v1.IRecognitionConfig|null|undefined} config
|
451 | * @memberof google.cloud.speech.v1.LongRunningRecognizeRequest
|
452 | * @instance
|
453 | */
|
454 | LongRunningRecognizeRequest.prototype.config = null;
|
455 |
|
456 | /**
|
457 | * LongRunningRecognizeRequest audio.
|
458 | * @member {google.cloud.speech.v1.IRecognitionAudio|null|undefined} audio
|
459 | * @memberof google.cloud.speech.v1.LongRunningRecognizeRequest
|
460 | * @instance
|
461 | */
|
462 | LongRunningRecognizeRequest.prototype.audio = null;
|
463 |
|
464 | /**
|
465 | * Creates a new LongRunningRecognizeRequest instance using the specified properties.
|
466 | * @function create
|
467 | * @memberof google.cloud.speech.v1.LongRunningRecognizeRequest
|
468 | * @static
|
469 | * @param {google.cloud.speech.v1.ILongRunningRecognizeRequest=} [properties] Properties to set
|
470 | * @returns {google.cloud.speech.v1.LongRunningRecognizeRequest} LongRunningRecognizeRequest instance
|
471 | */
|
472 | LongRunningRecognizeRequest.create = function create(properties) {
|
473 | return new LongRunningRecognizeRequest(properties);
|
474 | };
|
475 |
|
476 | /**
|
477 | * Encodes the specified LongRunningRecognizeRequest message. Does not implicitly {@link google.cloud.speech.v1.LongRunningRecognizeRequest.verify|verify} messages.
|
478 | * @function encode
|
479 | * @memberof google.cloud.speech.v1.LongRunningRecognizeRequest
|
480 | * @static
|
481 | * @param {google.cloud.speech.v1.ILongRunningRecognizeRequest} message LongRunningRecognizeRequest message or plain object to encode
|
482 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
483 | * @returns {$protobuf.Writer} Writer
|
484 | */
|
485 | LongRunningRecognizeRequest.encode = function encode(message, writer) {
|
486 | if (!writer)
|
487 | writer = $Writer.create();
|
488 | if (message.config != null && Object.hasOwnProperty.call(message, "config"))
|
489 | $root.google.cloud.speech.v1.RecognitionConfig.encode(message.config, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
490 | if (message.audio != null && Object.hasOwnProperty.call(message, "audio"))
|
491 | $root.google.cloud.speech.v1.RecognitionAudio.encode(message.audio, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
492 | return writer;
|
493 | };
|
494 |
|
495 | /**
|
496 | * Encodes the specified LongRunningRecognizeRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1.LongRunningRecognizeRequest.verify|verify} messages.
|
497 | * @function encodeDelimited
|
498 | * @memberof google.cloud.speech.v1.LongRunningRecognizeRequest
|
499 | * @static
|
500 | * @param {google.cloud.speech.v1.ILongRunningRecognizeRequest} message LongRunningRecognizeRequest message or plain object to encode
|
501 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
502 | * @returns {$protobuf.Writer} Writer
|
503 | */
|
504 | LongRunningRecognizeRequest.encodeDelimited = function encodeDelimited(message, writer) {
|
505 | return this.encode(message, writer).ldelim();
|
506 | };
|
507 |
|
508 | /**
|
509 | * Decodes a LongRunningRecognizeRequest message from the specified reader or buffer.
|
510 | * @function decode
|
511 | * @memberof google.cloud.speech.v1.LongRunningRecognizeRequest
|
512 | * @static
|
513 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
514 | * @param {number} [length] Message length if known beforehand
|
515 | * @returns {google.cloud.speech.v1.LongRunningRecognizeRequest} LongRunningRecognizeRequest
|
516 | * @throws {Error} If the payload is not a reader or valid buffer
|
517 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
518 | */
|
519 | LongRunningRecognizeRequest.decode = function decode(reader, length) {
|
520 | if (!(reader instanceof $Reader))
|
521 | reader = $Reader.create(reader);
|
522 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.LongRunningRecognizeRequest();
|
523 | while (reader.pos < end) {
|
524 | var tag = reader.uint32();
|
525 | switch (tag >>> 3) {
|
526 | case 1:
|
527 | message.config = $root.google.cloud.speech.v1.RecognitionConfig.decode(reader, reader.uint32());
|
528 | break;
|
529 | case 2:
|
530 | message.audio = $root.google.cloud.speech.v1.RecognitionAudio.decode(reader, reader.uint32());
|
531 | break;
|
532 | default:
|
533 | reader.skipType(tag & 7);
|
534 | break;
|
535 | }
|
536 | }
|
537 | return message;
|
538 | };
|
539 |
|
540 | /**
|
541 | * Decodes a LongRunningRecognizeRequest message from the specified reader or buffer, length delimited.
|
542 | * @function decodeDelimited
|
543 | * @memberof google.cloud.speech.v1.LongRunningRecognizeRequest
|
544 | * @static
|
545 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
546 | * @returns {google.cloud.speech.v1.LongRunningRecognizeRequest} LongRunningRecognizeRequest
|
547 | * @throws {Error} If the payload is not a reader or valid buffer
|
548 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
549 | */
|
550 | LongRunningRecognizeRequest.decodeDelimited = function decodeDelimited(reader) {
|
551 | if (!(reader instanceof $Reader))
|
552 | reader = new $Reader(reader);
|
553 | return this.decode(reader, reader.uint32());
|
554 | };
|
555 |
|
556 | /**
|
557 | * Verifies a LongRunningRecognizeRequest message.
|
558 | * @function verify
|
559 | * @memberof google.cloud.speech.v1.LongRunningRecognizeRequest
|
560 | * @static
|
561 | * @param {Object.<string,*>} message Plain object to verify
|
562 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
563 | */
|
564 | LongRunningRecognizeRequest.verify = function verify(message) {
|
565 | if (typeof message !== "object" || message === null)
|
566 | return "object expected";
|
567 | if (message.config != null && message.hasOwnProperty("config")) {
|
568 | var error = $root.google.cloud.speech.v1.RecognitionConfig.verify(message.config);
|
569 | if (error)
|
570 | return "config." + error;
|
571 | }
|
572 | if (message.audio != null && message.hasOwnProperty("audio")) {
|
573 | var error = $root.google.cloud.speech.v1.RecognitionAudio.verify(message.audio);
|
574 | if (error)
|
575 | return "audio." + error;
|
576 | }
|
577 | return null;
|
578 | };
|
579 |
|
580 | /**
|
581 | * Creates a LongRunningRecognizeRequest message from a plain object. Also converts values to their respective internal types.
|
582 | * @function fromObject
|
583 | * @memberof google.cloud.speech.v1.LongRunningRecognizeRequest
|
584 | * @static
|
585 | * @param {Object.<string,*>} object Plain object
|
586 | * @returns {google.cloud.speech.v1.LongRunningRecognizeRequest} LongRunningRecognizeRequest
|
587 | */
|
588 | LongRunningRecognizeRequest.fromObject = function fromObject(object) {
|
589 | if (object instanceof $root.google.cloud.speech.v1.LongRunningRecognizeRequest)
|
590 | return object;
|
591 | var message = new $root.google.cloud.speech.v1.LongRunningRecognizeRequest();
|
592 | if (object.config != null) {
|
593 | if (typeof object.config !== "object")
|
594 | throw TypeError(".google.cloud.speech.v1.LongRunningRecognizeRequest.config: object expected");
|
595 | message.config = $root.google.cloud.speech.v1.RecognitionConfig.fromObject(object.config);
|
596 | }
|
597 | if (object.audio != null) {
|
598 | if (typeof object.audio !== "object")
|
599 | throw TypeError(".google.cloud.speech.v1.LongRunningRecognizeRequest.audio: object expected");
|
600 | message.audio = $root.google.cloud.speech.v1.RecognitionAudio.fromObject(object.audio);
|
601 | }
|
602 | return message;
|
603 | };
|
604 |
|
605 | /**
|
606 | * Creates a plain object from a LongRunningRecognizeRequest message. Also converts values to other types if specified.
|
607 | * @function toObject
|
608 | * @memberof google.cloud.speech.v1.LongRunningRecognizeRequest
|
609 | * @static
|
610 | * @param {google.cloud.speech.v1.LongRunningRecognizeRequest} message LongRunningRecognizeRequest
|
611 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
612 | * @returns {Object.<string,*>} Plain object
|
613 | */
|
614 | LongRunningRecognizeRequest.toObject = function toObject(message, options) {
|
615 | if (!options)
|
616 | options = {};
|
617 | var object = {};
|
618 | if (options.defaults) {
|
619 | object.config = null;
|
620 | object.audio = null;
|
621 | }
|
622 | if (message.config != null && message.hasOwnProperty("config"))
|
623 | object.config = $root.google.cloud.speech.v1.RecognitionConfig.toObject(message.config, options);
|
624 | if (message.audio != null && message.hasOwnProperty("audio"))
|
625 | object.audio = $root.google.cloud.speech.v1.RecognitionAudio.toObject(message.audio, options);
|
626 | return object;
|
627 | };
|
628 |
|
629 | /**
|
630 | * Converts this LongRunningRecognizeRequest to JSON.
|
631 | * @function toJSON
|
632 | * @memberof google.cloud.speech.v1.LongRunningRecognizeRequest
|
633 | * @instance
|
634 | * @returns {Object.<string,*>} JSON object
|
635 | */
|
636 | LongRunningRecognizeRequest.prototype.toJSON = function toJSON() {
|
637 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
638 | };
|
639 |
|
640 | return LongRunningRecognizeRequest;
|
641 | })();
|
642 |
|
643 | v1.StreamingRecognizeRequest = (function() {
|
644 |
|
645 | /**
|
646 | * Properties of a StreamingRecognizeRequest.
|
647 | * @memberof google.cloud.speech.v1
|
648 | * @interface IStreamingRecognizeRequest
|
649 | * @property {google.cloud.speech.v1.IStreamingRecognitionConfig|null} [streamingConfig] StreamingRecognizeRequest streamingConfig
|
650 | * @property {Uint8Array|null} [audioContent] StreamingRecognizeRequest audioContent
|
651 | */
|
652 |
|
653 | /**
|
654 | * Constructs a new StreamingRecognizeRequest.
|
655 | * @memberof google.cloud.speech.v1
|
656 | * @classdesc Represents a StreamingRecognizeRequest.
|
657 | * @implements IStreamingRecognizeRequest
|
658 | * @constructor
|
659 | * @param {google.cloud.speech.v1.IStreamingRecognizeRequest=} [properties] Properties to set
|
660 | */
|
661 | function StreamingRecognizeRequest(properties) {
|
662 | if (properties)
|
663 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
664 | if (properties[keys[i]] != null)
|
665 | this[keys[i]] = properties[keys[i]];
|
666 | }
|
667 |
|
668 | /**
|
669 | * StreamingRecognizeRequest streamingConfig.
|
670 | * @member {google.cloud.speech.v1.IStreamingRecognitionConfig|null|undefined} streamingConfig
|
671 | * @memberof google.cloud.speech.v1.StreamingRecognizeRequest
|
672 | * @instance
|
673 | */
|
674 | StreamingRecognizeRequest.prototype.streamingConfig = null;
|
675 |
|
676 | /**
|
677 | * StreamingRecognizeRequest audioContent.
|
678 | * @member {Uint8Array|null|undefined} audioContent
|
679 | * @memberof google.cloud.speech.v1.StreamingRecognizeRequest
|
680 | * @instance
|
681 | */
|
682 | StreamingRecognizeRequest.prototype.audioContent = null;
|
683 |
|
684 | // OneOf field names bound to virtual getters and setters
|
685 | var $oneOfFields;
|
686 |
|
687 | /**
|
688 | * StreamingRecognizeRequest streamingRequest.
|
689 | * @member {"streamingConfig"|"audioContent"|undefined} streamingRequest
|
690 | * @memberof google.cloud.speech.v1.StreamingRecognizeRequest
|
691 | * @instance
|
692 | */
|
693 | Object.defineProperty(StreamingRecognizeRequest.prototype, "streamingRequest", {
|
694 | get: $util.oneOfGetter($oneOfFields = ["streamingConfig", "audioContent"]),
|
695 | set: $util.oneOfSetter($oneOfFields)
|
696 | });
|
697 |
|
698 | /**
|
699 | * Creates a new StreamingRecognizeRequest instance using the specified properties.
|
700 | * @function create
|
701 | * @memberof google.cloud.speech.v1.StreamingRecognizeRequest
|
702 | * @static
|
703 | * @param {google.cloud.speech.v1.IStreamingRecognizeRequest=} [properties] Properties to set
|
704 | * @returns {google.cloud.speech.v1.StreamingRecognizeRequest} StreamingRecognizeRequest instance
|
705 | */
|
706 | StreamingRecognizeRequest.create = function create(properties) {
|
707 | return new StreamingRecognizeRequest(properties);
|
708 | };
|
709 |
|
710 | /**
|
711 | * Encodes the specified StreamingRecognizeRequest message. Does not implicitly {@link google.cloud.speech.v1.StreamingRecognizeRequest.verify|verify} messages.
|
712 | * @function encode
|
713 | * @memberof google.cloud.speech.v1.StreamingRecognizeRequest
|
714 | * @static
|
715 | * @param {google.cloud.speech.v1.IStreamingRecognizeRequest} message StreamingRecognizeRequest message or plain object to encode
|
716 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
717 | * @returns {$protobuf.Writer} Writer
|
718 | */
|
719 | StreamingRecognizeRequest.encode = function encode(message, writer) {
|
720 | if (!writer)
|
721 | writer = $Writer.create();
|
722 | if (message.streamingConfig != null && Object.hasOwnProperty.call(message, "streamingConfig"))
|
723 | $root.google.cloud.speech.v1.StreamingRecognitionConfig.encode(message.streamingConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
724 | if (message.audioContent != null && Object.hasOwnProperty.call(message, "audioContent"))
|
725 | writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.audioContent);
|
726 | return writer;
|
727 | };
|
728 |
|
729 | /**
|
730 | * Encodes the specified StreamingRecognizeRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1.StreamingRecognizeRequest.verify|verify} messages.
|
731 | * @function encodeDelimited
|
732 | * @memberof google.cloud.speech.v1.StreamingRecognizeRequest
|
733 | * @static
|
734 | * @param {google.cloud.speech.v1.IStreamingRecognizeRequest} message StreamingRecognizeRequest message or plain object to encode
|
735 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
736 | * @returns {$protobuf.Writer} Writer
|
737 | */
|
738 | StreamingRecognizeRequest.encodeDelimited = function encodeDelimited(message, writer) {
|
739 | return this.encode(message, writer).ldelim();
|
740 | };
|
741 |
|
742 | /**
|
743 | * Decodes a StreamingRecognizeRequest message from the specified reader or buffer.
|
744 | * @function decode
|
745 | * @memberof google.cloud.speech.v1.StreamingRecognizeRequest
|
746 | * @static
|
747 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
748 | * @param {number} [length] Message length if known beforehand
|
749 | * @returns {google.cloud.speech.v1.StreamingRecognizeRequest} StreamingRecognizeRequest
|
750 | * @throws {Error} If the payload is not a reader or valid buffer
|
751 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
752 | */
|
753 | StreamingRecognizeRequest.decode = function decode(reader, length) {
|
754 | if (!(reader instanceof $Reader))
|
755 | reader = $Reader.create(reader);
|
756 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.StreamingRecognizeRequest();
|
757 | while (reader.pos < end) {
|
758 | var tag = reader.uint32();
|
759 | switch (tag >>> 3) {
|
760 | case 1:
|
761 | message.streamingConfig = $root.google.cloud.speech.v1.StreamingRecognitionConfig.decode(reader, reader.uint32());
|
762 | break;
|
763 | case 2:
|
764 | message.audioContent = reader.bytes();
|
765 | break;
|
766 | default:
|
767 | reader.skipType(tag & 7);
|
768 | break;
|
769 | }
|
770 | }
|
771 | return message;
|
772 | };
|
773 |
|
774 | /**
|
775 | * Decodes a StreamingRecognizeRequest message from the specified reader or buffer, length delimited.
|
776 | * @function decodeDelimited
|
777 | * @memberof google.cloud.speech.v1.StreamingRecognizeRequest
|
778 | * @static
|
779 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
780 | * @returns {google.cloud.speech.v1.StreamingRecognizeRequest} StreamingRecognizeRequest
|
781 | * @throws {Error} If the payload is not a reader or valid buffer
|
782 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
783 | */
|
784 | StreamingRecognizeRequest.decodeDelimited = function decodeDelimited(reader) {
|
785 | if (!(reader instanceof $Reader))
|
786 | reader = new $Reader(reader);
|
787 | return this.decode(reader, reader.uint32());
|
788 | };
|
789 |
|
790 | /**
|
791 | * Verifies a StreamingRecognizeRequest message.
|
792 | * @function verify
|
793 | * @memberof google.cloud.speech.v1.StreamingRecognizeRequest
|
794 | * @static
|
795 | * @param {Object.<string,*>} message Plain object to verify
|
796 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
797 | */
|
798 | StreamingRecognizeRequest.verify = function verify(message) {
|
799 | if (typeof message !== "object" || message === null)
|
800 | return "object expected";
|
801 | var properties = {};
|
802 | if (message.streamingConfig != null && message.hasOwnProperty("streamingConfig")) {
|
803 | properties.streamingRequest = 1;
|
804 | {
|
805 | var error = $root.google.cloud.speech.v1.StreamingRecognitionConfig.verify(message.streamingConfig);
|
806 | if (error)
|
807 | return "streamingConfig." + error;
|
808 | }
|
809 | }
|
810 | if (message.audioContent != null && message.hasOwnProperty("audioContent")) {
|
811 | if (properties.streamingRequest === 1)
|
812 | return "streamingRequest: multiple values";
|
813 | properties.streamingRequest = 1;
|
814 | if (!(message.audioContent && typeof message.audioContent.length === "number" || $util.isString(message.audioContent)))
|
815 | return "audioContent: buffer expected";
|
816 | }
|
817 | return null;
|
818 | };
|
819 |
|
820 | /**
|
821 | * Creates a StreamingRecognizeRequest message from a plain object. Also converts values to their respective internal types.
|
822 | * @function fromObject
|
823 | * @memberof google.cloud.speech.v1.StreamingRecognizeRequest
|
824 | * @static
|
825 | * @param {Object.<string,*>} object Plain object
|
826 | * @returns {google.cloud.speech.v1.StreamingRecognizeRequest} StreamingRecognizeRequest
|
827 | */
|
828 | StreamingRecognizeRequest.fromObject = function fromObject(object) {
|
829 | if (object instanceof $root.google.cloud.speech.v1.StreamingRecognizeRequest)
|
830 | return object;
|
831 | var message = new $root.google.cloud.speech.v1.StreamingRecognizeRequest();
|
832 | if (object.streamingConfig != null) {
|
833 | if (typeof object.streamingConfig !== "object")
|
834 | throw TypeError(".google.cloud.speech.v1.StreamingRecognizeRequest.streamingConfig: object expected");
|
835 | message.streamingConfig = $root.google.cloud.speech.v1.StreamingRecognitionConfig.fromObject(object.streamingConfig);
|
836 | }
|
837 | if (object.audioContent != null)
|
838 | if (typeof object.audioContent === "string")
|
839 | $util.base64.decode(object.audioContent, message.audioContent = $util.newBuffer($util.base64.length(object.audioContent)), 0);
|
840 | else if (object.audioContent.length)
|
841 | message.audioContent = object.audioContent;
|
842 | return message;
|
843 | };
|
844 |
|
845 | /**
|
846 | * Creates a plain object from a StreamingRecognizeRequest message. Also converts values to other types if specified.
|
847 | * @function toObject
|
848 | * @memberof google.cloud.speech.v1.StreamingRecognizeRequest
|
849 | * @static
|
850 | * @param {google.cloud.speech.v1.StreamingRecognizeRequest} message StreamingRecognizeRequest
|
851 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
852 | * @returns {Object.<string,*>} Plain object
|
853 | */
|
854 | StreamingRecognizeRequest.toObject = function toObject(message, options) {
|
855 | if (!options)
|
856 | options = {};
|
857 | var object = {};
|
858 | if (message.streamingConfig != null && message.hasOwnProperty("streamingConfig")) {
|
859 | object.streamingConfig = $root.google.cloud.speech.v1.StreamingRecognitionConfig.toObject(message.streamingConfig, options);
|
860 | if (options.oneofs)
|
861 | object.streamingRequest = "streamingConfig";
|
862 | }
|
863 | if (message.audioContent != null && message.hasOwnProperty("audioContent")) {
|
864 | object.audioContent = options.bytes === String ? $util.base64.encode(message.audioContent, 0, message.audioContent.length) : options.bytes === Array ? Array.prototype.slice.call(message.audioContent) : message.audioContent;
|
865 | if (options.oneofs)
|
866 | object.streamingRequest = "audioContent";
|
867 | }
|
868 | return object;
|
869 | };
|
870 |
|
871 | /**
|
872 | * Converts this StreamingRecognizeRequest to JSON.
|
873 | * @function toJSON
|
874 | * @memberof google.cloud.speech.v1.StreamingRecognizeRequest
|
875 | * @instance
|
876 | * @returns {Object.<string,*>} JSON object
|
877 | */
|
878 | StreamingRecognizeRequest.prototype.toJSON = function toJSON() {
|
879 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
880 | };
|
881 |
|
882 | return StreamingRecognizeRequest;
|
883 | })();
|
884 |
|
885 | v1.StreamingRecognitionConfig = (function() {
|
886 |
|
887 | /**
|
888 | * Properties of a StreamingRecognitionConfig.
|
889 | * @memberof google.cloud.speech.v1
|
890 | * @interface IStreamingRecognitionConfig
|
891 | * @property {google.cloud.speech.v1.IRecognitionConfig|null} [config] StreamingRecognitionConfig config
|
892 | * @property {boolean|null} [singleUtterance] StreamingRecognitionConfig singleUtterance
|
893 | * @property {boolean|null} [interimResults] StreamingRecognitionConfig interimResults
|
894 | */
|
895 |
|
896 | /**
|
897 | * Constructs a new StreamingRecognitionConfig.
|
898 | * @memberof google.cloud.speech.v1
|
899 | * @classdesc Represents a StreamingRecognitionConfig.
|
900 | * @implements IStreamingRecognitionConfig
|
901 | * @constructor
|
902 | * @param {google.cloud.speech.v1.IStreamingRecognitionConfig=} [properties] Properties to set
|
903 | */
|
904 | function StreamingRecognitionConfig(properties) {
|
905 | if (properties)
|
906 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
907 | if (properties[keys[i]] != null)
|
908 | this[keys[i]] = properties[keys[i]];
|
909 | }
|
910 |
|
911 | /**
|
912 | * StreamingRecognitionConfig config.
|
913 | * @member {google.cloud.speech.v1.IRecognitionConfig|null|undefined} config
|
914 | * @memberof google.cloud.speech.v1.StreamingRecognitionConfig
|
915 | * @instance
|
916 | */
|
917 | StreamingRecognitionConfig.prototype.config = null;
|
918 |
|
919 | /**
|
920 | * StreamingRecognitionConfig singleUtterance.
|
921 | * @member {boolean} singleUtterance
|
922 | * @memberof google.cloud.speech.v1.StreamingRecognitionConfig
|
923 | * @instance
|
924 | */
|
925 | StreamingRecognitionConfig.prototype.singleUtterance = false;
|
926 |
|
927 | /**
|
928 | * StreamingRecognitionConfig interimResults.
|
929 | * @member {boolean} interimResults
|
930 | * @memberof google.cloud.speech.v1.StreamingRecognitionConfig
|
931 | * @instance
|
932 | */
|
933 | StreamingRecognitionConfig.prototype.interimResults = false;
|
934 |
|
935 | /**
|
936 | * Creates a new StreamingRecognitionConfig instance using the specified properties.
|
937 | * @function create
|
938 | * @memberof google.cloud.speech.v1.StreamingRecognitionConfig
|
939 | * @static
|
940 | * @param {google.cloud.speech.v1.IStreamingRecognitionConfig=} [properties] Properties to set
|
941 | * @returns {google.cloud.speech.v1.StreamingRecognitionConfig} StreamingRecognitionConfig instance
|
942 | */
|
943 | StreamingRecognitionConfig.create = function create(properties) {
|
944 | return new StreamingRecognitionConfig(properties);
|
945 | };
|
946 |
|
947 | /**
|
948 | * Encodes the specified StreamingRecognitionConfig message. Does not implicitly {@link google.cloud.speech.v1.StreamingRecognitionConfig.verify|verify} messages.
|
949 | * @function encode
|
950 | * @memberof google.cloud.speech.v1.StreamingRecognitionConfig
|
951 | * @static
|
952 | * @param {google.cloud.speech.v1.IStreamingRecognitionConfig} message StreamingRecognitionConfig message or plain object to encode
|
953 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
954 | * @returns {$protobuf.Writer} Writer
|
955 | */
|
956 | StreamingRecognitionConfig.encode = function encode(message, writer) {
|
957 | if (!writer)
|
958 | writer = $Writer.create();
|
959 | if (message.config != null && Object.hasOwnProperty.call(message, "config"))
|
960 | $root.google.cloud.speech.v1.RecognitionConfig.encode(message.config, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
961 | if (message.singleUtterance != null && Object.hasOwnProperty.call(message, "singleUtterance"))
|
962 | writer.uint32(/* id 2, wireType 0 =*/16).bool(message.singleUtterance);
|
963 | if (message.interimResults != null && Object.hasOwnProperty.call(message, "interimResults"))
|
964 | writer.uint32(/* id 3, wireType 0 =*/24).bool(message.interimResults);
|
965 | return writer;
|
966 | };
|
967 |
|
968 | /**
|
969 | * Encodes the specified StreamingRecognitionConfig message, length delimited. Does not implicitly {@link google.cloud.speech.v1.StreamingRecognitionConfig.verify|verify} messages.
|
970 | * @function encodeDelimited
|
971 | * @memberof google.cloud.speech.v1.StreamingRecognitionConfig
|
972 | * @static
|
973 | * @param {google.cloud.speech.v1.IStreamingRecognitionConfig} message StreamingRecognitionConfig message or plain object to encode
|
974 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
975 | * @returns {$protobuf.Writer} Writer
|
976 | */
|
977 | StreamingRecognitionConfig.encodeDelimited = function encodeDelimited(message, writer) {
|
978 | return this.encode(message, writer).ldelim();
|
979 | };
|
980 |
|
981 | /**
|
982 | * Decodes a StreamingRecognitionConfig message from the specified reader or buffer.
|
983 | * @function decode
|
984 | * @memberof google.cloud.speech.v1.StreamingRecognitionConfig
|
985 | * @static
|
986 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
987 | * @param {number} [length] Message length if known beforehand
|
988 | * @returns {google.cloud.speech.v1.StreamingRecognitionConfig} StreamingRecognitionConfig
|
989 | * @throws {Error} If the payload is not a reader or valid buffer
|
990 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
991 | */
|
992 | StreamingRecognitionConfig.decode = function decode(reader, length) {
|
993 | if (!(reader instanceof $Reader))
|
994 | reader = $Reader.create(reader);
|
995 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.StreamingRecognitionConfig();
|
996 | while (reader.pos < end) {
|
997 | var tag = reader.uint32();
|
998 | switch (tag >>> 3) {
|
999 | case 1:
|
1000 | message.config = $root.google.cloud.speech.v1.RecognitionConfig.decode(reader, reader.uint32());
|
1001 | break;
|
1002 | case 2:
|
1003 | message.singleUtterance = reader.bool();
|
1004 | break;
|
1005 | case 3:
|
1006 | message.interimResults = reader.bool();
|
1007 | break;
|
1008 | default:
|
1009 | reader.skipType(tag & 7);
|
1010 | break;
|
1011 | }
|
1012 | }
|
1013 | return message;
|
1014 | };
|
1015 |
|
1016 | /**
|
1017 | * Decodes a StreamingRecognitionConfig message from the specified reader or buffer, length delimited.
|
1018 | * @function decodeDelimited
|
1019 | * @memberof google.cloud.speech.v1.StreamingRecognitionConfig
|
1020 | * @static
|
1021 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
1022 | * @returns {google.cloud.speech.v1.StreamingRecognitionConfig} StreamingRecognitionConfig
|
1023 | * @throws {Error} If the payload is not a reader or valid buffer
|
1024 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
1025 | */
|
1026 | StreamingRecognitionConfig.decodeDelimited = function decodeDelimited(reader) {
|
1027 | if (!(reader instanceof $Reader))
|
1028 | reader = new $Reader(reader);
|
1029 | return this.decode(reader, reader.uint32());
|
1030 | };
|
1031 |
|
1032 | /**
|
1033 | * Verifies a StreamingRecognitionConfig message.
|
1034 | * @function verify
|
1035 | * @memberof google.cloud.speech.v1.StreamingRecognitionConfig
|
1036 | * @static
|
1037 | * @param {Object.<string,*>} message Plain object to verify
|
1038 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
1039 | */
|
1040 | StreamingRecognitionConfig.verify = function verify(message) {
|
1041 | if (typeof message !== "object" || message === null)
|
1042 | return "object expected";
|
1043 | if (message.config != null && message.hasOwnProperty("config")) {
|
1044 | var error = $root.google.cloud.speech.v1.RecognitionConfig.verify(message.config);
|
1045 | if (error)
|
1046 | return "config." + error;
|
1047 | }
|
1048 | if (message.singleUtterance != null && message.hasOwnProperty("singleUtterance"))
|
1049 | if (typeof message.singleUtterance !== "boolean")
|
1050 | return "singleUtterance: boolean expected";
|
1051 | if (message.interimResults != null && message.hasOwnProperty("interimResults"))
|
1052 | if (typeof message.interimResults !== "boolean")
|
1053 | return "interimResults: boolean expected";
|
1054 | return null;
|
1055 | };
|
1056 |
|
1057 | /**
|
1058 | * Creates a StreamingRecognitionConfig message from a plain object. Also converts values to their respective internal types.
|
1059 | * @function fromObject
|
1060 | * @memberof google.cloud.speech.v1.StreamingRecognitionConfig
|
1061 | * @static
|
1062 | * @param {Object.<string,*>} object Plain object
|
1063 | * @returns {google.cloud.speech.v1.StreamingRecognitionConfig} StreamingRecognitionConfig
|
1064 | */
|
1065 | StreamingRecognitionConfig.fromObject = function fromObject(object) {
|
1066 | if (object instanceof $root.google.cloud.speech.v1.StreamingRecognitionConfig)
|
1067 | return object;
|
1068 | var message = new $root.google.cloud.speech.v1.StreamingRecognitionConfig();
|
1069 | if (object.config != null) {
|
1070 | if (typeof object.config !== "object")
|
1071 | throw TypeError(".google.cloud.speech.v1.StreamingRecognitionConfig.config: object expected");
|
1072 | message.config = $root.google.cloud.speech.v1.RecognitionConfig.fromObject(object.config);
|
1073 | }
|
1074 | if (object.singleUtterance != null)
|
1075 | message.singleUtterance = Boolean(object.singleUtterance);
|
1076 | if (object.interimResults != null)
|
1077 | message.interimResults = Boolean(object.interimResults);
|
1078 | return message;
|
1079 | };
|
1080 |
|
1081 | /**
|
1082 | * Creates a plain object from a StreamingRecognitionConfig message. Also converts values to other types if specified.
|
1083 | * @function toObject
|
1084 | * @memberof google.cloud.speech.v1.StreamingRecognitionConfig
|
1085 | * @static
|
1086 | * @param {google.cloud.speech.v1.StreamingRecognitionConfig} message StreamingRecognitionConfig
|
1087 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
1088 | * @returns {Object.<string,*>} Plain object
|
1089 | */
|
1090 | StreamingRecognitionConfig.toObject = function toObject(message, options) {
|
1091 | if (!options)
|
1092 | options = {};
|
1093 | var object = {};
|
1094 | if (options.defaults) {
|
1095 | object.config = null;
|
1096 | object.singleUtterance = false;
|
1097 | object.interimResults = false;
|
1098 | }
|
1099 | if (message.config != null && message.hasOwnProperty("config"))
|
1100 | object.config = $root.google.cloud.speech.v1.RecognitionConfig.toObject(message.config, options);
|
1101 | if (message.singleUtterance != null && message.hasOwnProperty("singleUtterance"))
|
1102 | object.singleUtterance = message.singleUtterance;
|
1103 | if (message.interimResults != null && message.hasOwnProperty("interimResults"))
|
1104 | object.interimResults = message.interimResults;
|
1105 | return object;
|
1106 | };
|
1107 |
|
1108 | /**
|
1109 | * Converts this StreamingRecognitionConfig to JSON.
|
1110 | * @function toJSON
|
1111 | * @memberof google.cloud.speech.v1.StreamingRecognitionConfig
|
1112 | * @instance
|
1113 | * @returns {Object.<string,*>} JSON object
|
1114 | */
|
1115 | StreamingRecognitionConfig.prototype.toJSON = function toJSON() {
|
1116 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
1117 | };
|
1118 |
|
1119 | return StreamingRecognitionConfig;
|
1120 | })();
|
1121 |
|
1122 | v1.RecognitionConfig = (function() {
|
1123 |
|
1124 | /**
|
1125 | * Properties of a RecognitionConfig.
|
1126 | * @memberof google.cloud.speech.v1
|
1127 | * @interface IRecognitionConfig
|
1128 | * @property {google.cloud.speech.v1.RecognitionConfig.AudioEncoding|null} [encoding] RecognitionConfig encoding
|
1129 | * @property {number|null} [sampleRateHertz] RecognitionConfig sampleRateHertz
|
1130 | * @property {number|null} [audioChannelCount] RecognitionConfig audioChannelCount
|
1131 | * @property {boolean|null} [enableSeparateRecognitionPerChannel] RecognitionConfig enableSeparateRecognitionPerChannel
|
1132 | * @property {string|null} [languageCode] RecognitionConfig languageCode
|
1133 | * @property {number|null} [maxAlternatives] RecognitionConfig maxAlternatives
|
1134 | * @property {boolean|null} [profanityFilter] RecognitionConfig profanityFilter
|
1135 | * @property {Array.<google.cloud.speech.v1.ISpeechContext>|null} [speechContexts] RecognitionConfig speechContexts
|
1136 | * @property {boolean|null} [enableWordTimeOffsets] RecognitionConfig enableWordTimeOffsets
|
1137 | * @property {boolean|null} [enableAutomaticPunctuation] RecognitionConfig enableAutomaticPunctuation
|
1138 | * @property {google.cloud.speech.v1.ISpeakerDiarizationConfig|null} [diarizationConfig] RecognitionConfig diarizationConfig
|
1139 | * @property {google.cloud.speech.v1.IRecognitionMetadata|null} [metadata] RecognitionConfig metadata
|
1140 | * @property {string|null} [model] RecognitionConfig model
|
1141 | * @property {boolean|null} [useEnhanced] RecognitionConfig useEnhanced
|
1142 | */
|
1143 |
|
1144 | /**
|
1145 | * Constructs a new RecognitionConfig.
|
1146 | * @memberof google.cloud.speech.v1
|
1147 | * @classdesc Represents a RecognitionConfig.
|
1148 | * @implements IRecognitionConfig
|
1149 | * @constructor
|
1150 | * @param {google.cloud.speech.v1.IRecognitionConfig=} [properties] Properties to set
|
1151 | */
|
1152 | function RecognitionConfig(properties) {
|
1153 | this.speechContexts = [];
|
1154 | if (properties)
|
1155 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
1156 | if (properties[keys[i]] != null)
|
1157 | this[keys[i]] = properties[keys[i]];
|
1158 | }
|
1159 |
|
1160 | /**
|
1161 | * RecognitionConfig encoding.
|
1162 | * @member {google.cloud.speech.v1.RecognitionConfig.AudioEncoding} encoding
|
1163 | * @memberof google.cloud.speech.v1.RecognitionConfig
|
1164 | * @instance
|
1165 | */
|
1166 | RecognitionConfig.prototype.encoding = 0;
|
1167 |
|
1168 | /**
|
1169 | * RecognitionConfig sampleRateHertz.
|
1170 | * @member {number} sampleRateHertz
|
1171 | * @memberof google.cloud.speech.v1.RecognitionConfig
|
1172 | * @instance
|
1173 | */
|
1174 | RecognitionConfig.prototype.sampleRateHertz = 0;
|
1175 |
|
1176 | /**
|
1177 | * RecognitionConfig audioChannelCount.
|
1178 | * @member {number} audioChannelCount
|
1179 | * @memberof google.cloud.speech.v1.RecognitionConfig
|
1180 | * @instance
|
1181 | */
|
1182 | RecognitionConfig.prototype.audioChannelCount = 0;
|
1183 |
|
1184 | /**
|
1185 | * RecognitionConfig enableSeparateRecognitionPerChannel.
|
1186 | * @member {boolean} enableSeparateRecognitionPerChannel
|
1187 | * @memberof google.cloud.speech.v1.RecognitionConfig
|
1188 | * @instance
|
1189 | */
|
1190 | RecognitionConfig.prototype.enableSeparateRecognitionPerChannel = false;
|
1191 |
|
1192 | /**
|
1193 | * RecognitionConfig languageCode.
|
1194 | * @member {string} languageCode
|
1195 | * @memberof google.cloud.speech.v1.RecognitionConfig
|
1196 | * @instance
|
1197 | */
|
1198 | RecognitionConfig.prototype.languageCode = "";
|
1199 |
|
1200 | /**
|
1201 | * RecognitionConfig maxAlternatives.
|
1202 | * @member {number} maxAlternatives
|
1203 | * @memberof google.cloud.speech.v1.RecognitionConfig
|
1204 | * @instance
|
1205 | */
|
1206 | RecognitionConfig.prototype.maxAlternatives = 0;
|
1207 |
|
1208 | /**
|
1209 | * RecognitionConfig profanityFilter.
|
1210 | * @member {boolean} profanityFilter
|
1211 | * @memberof google.cloud.speech.v1.RecognitionConfig
|
1212 | * @instance
|
1213 | */
|
1214 | RecognitionConfig.prototype.profanityFilter = false;
|
1215 |
|
1216 | /**
|
1217 | * RecognitionConfig speechContexts.
|
1218 | * @member {Array.<google.cloud.speech.v1.ISpeechContext>} speechContexts
|
1219 | * @memberof google.cloud.speech.v1.RecognitionConfig
|
1220 | * @instance
|
1221 | */
|
1222 | RecognitionConfig.prototype.speechContexts = $util.emptyArray;
|
1223 |
|
1224 | /**
|
1225 | * RecognitionConfig enableWordTimeOffsets.
|
1226 | * @member {boolean} enableWordTimeOffsets
|
1227 | * @memberof google.cloud.speech.v1.RecognitionConfig
|
1228 | * @instance
|
1229 | */
|
1230 | RecognitionConfig.prototype.enableWordTimeOffsets = false;
|
1231 |
|
1232 | /**
|
1233 | * RecognitionConfig enableAutomaticPunctuation.
|
1234 | * @member {boolean} enableAutomaticPunctuation
|
1235 | * @memberof google.cloud.speech.v1.RecognitionConfig
|
1236 | * @instance
|
1237 | */
|
1238 | RecognitionConfig.prototype.enableAutomaticPunctuation = false;
|
1239 |
|
1240 | /**
|
1241 | * RecognitionConfig diarizationConfig.
|
1242 | * @member {google.cloud.speech.v1.ISpeakerDiarizationConfig|null|undefined} diarizationConfig
|
1243 | * @memberof google.cloud.speech.v1.RecognitionConfig
|
1244 | * @instance
|
1245 | */
|
1246 | RecognitionConfig.prototype.diarizationConfig = null;
|
1247 |
|
1248 | /**
|
1249 | * RecognitionConfig metadata.
|
1250 | * @member {google.cloud.speech.v1.IRecognitionMetadata|null|undefined} metadata
|
1251 | * @memberof google.cloud.speech.v1.RecognitionConfig
|
1252 | * @instance
|
1253 | */
|
1254 | RecognitionConfig.prototype.metadata = null;
|
1255 |
|
1256 | /**
|
1257 | * RecognitionConfig model.
|
1258 | * @member {string} model
|
1259 | * @memberof google.cloud.speech.v1.RecognitionConfig
|
1260 | * @instance
|
1261 | */
|
1262 | RecognitionConfig.prototype.model = "";
|
1263 |
|
1264 | /**
|
1265 | * RecognitionConfig useEnhanced.
|
1266 | * @member {boolean} useEnhanced
|
1267 | * @memberof google.cloud.speech.v1.RecognitionConfig
|
1268 | * @instance
|
1269 | */
|
1270 | RecognitionConfig.prototype.useEnhanced = false;
|
1271 |
|
1272 | /**
|
1273 | * Creates a new RecognitionConfig instance using the specified properties.
|
1274 | * @function create
|
1275 | * @memberof google.cloud.speech.v1.RecognitionConfig
|
1276 | * @static
|
1277 | * @param {google.cloud.speech.v1.IRecognitionConfig=} [properties] Properties to set
|
1278 | * @returns {google.cloud.speech.v1.RecognitionConfig} RecognitionConfig instance
|
1279 | */
|
1280 | RecognitionConfig.create = function create(properties) {
|
1281 | return new RecognitionConfig(properties);
|
1282 | };
|
1283 |
|
1284 | /**
|
1285 | * Encodes the specified RecognitionConfig message. Does not implicitly {@link google.cloud.speech.v1.RecognitionConfig.verify|verify} messages.
|
1286 | * @function encode
|
1287 | * @memberof google.cloud.speech.v1.RecognitionConfig
|
1288 | * @static
|
1289 | * @param {google.cloud.speech.v1.IRecognitionConfig} message RecognitionConfig message or plain object to encode
|
1290 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
1291 | * @returns {$protobuf.Writer} Writer
|
1292 | */
|
1293 | RecognitionConfig.encode = function encode(message, writer) {
|
1294 | if (!writer)
|
1295 | writer = $Writer.create();
|
1296 | if (message.encoding != null && Object.hasOwnProperty.call(message, "encoding"))
|
1297 | writer.uint32(/* id 1, wireType 0 =*/8).int32(message.encoding);
|
1298 | if (message.sampleRateHertz != null && Object.hasOwnProperty.call(message, "sampleRateHertz"))
|
1299 | writer.uint32(/* id 2, wireType 0 =*/16).int32(message.sampleRateHertz);
|
1300 | if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode"))
|
1301 | writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCode);
|
1302 | if (message.maxAlternatives != null && Object.hasOwnProperty.call(message, "maxAlternatives"))
|
1303 | writer.uint32(/* id 4, wireType 0 =*/32).int32(message.maxAlternatives);
|
1304 | if (message.profanityFilter != null && Object.hasOwnProperty.call(message, "profanityFilter"))
|
1305 | writer.uint32(/* id 5, wireType 0 =*/40).bool(message.profanityFilter);
|
1306 | if (message.speechContexts != null && message.speechContexts.length)
|
1307 | for (var i = 0; i < message.speechContexts.length; ++i)
|
1308 | $root.google.cloud.speech.v1.SpeechContext.encode(message.speechContexts[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
|
1309 | if (message.audioChannelCount != null && Object.hasOwnProperty.call(message, "audioChannelCount"))
|
1310 | writer.uint32(/* id 7, wireType 0 =*/56).int32(message.audioChannelCount);
|
1311 | if (message.enableWordTimeOffsets != null && Object.hasOwnProperty.call(message, "enableWordTimeOffsets"))
|
1312 | writer.uint32(/* id 8, wireType 0 =*/64).bool(message.enableWordTimeOffsets);
|
1313 | if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata"))
|
1314 | $root.google.cloud.speech.v1.RecognitionMetadata.encode(message.metadata, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim();
|
1315 | if (message.enableAutomaticPunctuation != null && Object.hasOwnProperty.call(message, "enableAutomaticPunctuation"))
|
1316 | writer.uint32(/* id 11, wireType 0 =*/88).bool(message.enableAutomaticPunctuation);
|
1317 | if (message.enableSeparateRecognitionPerChannel != null && Object.hasOwnProperty.call(message, "enableSeparateRecognitionPerChannel"))
|
1318 | writer.uint32(/* id 12, wireType 0 =*/96).bool(message.enableSeparateRecognitionPerChannel);
|
1319 | if (message.model != null && Object.hasOwnProperty.call(message, "model"))
|
1320 | writer.uint32(/* id 13, wireType 2 =*/106).string(message.model);
|
1321 | if (message.useEnhanced != null && Object.hasOwnProperty.call(message, "useEnhanced"))
|
1322 | writer.uint32(/* id 14, wireType 0 =*/112).bool(message.useEnhanced);
|
1323 | if (message.diarizationConfig != null && Object.hasOwnProperty.call(message, "diarizationConfig"))
|
1324 | $root.google.cloud.speech.v1.SpeakerDiarizationConfig.encode(message.diarizationConfig, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim();
|
1325 | return writer;
|
1326 | };
|
1327 |
|
1328 | /**
|
1329 | * Encodes the specified RecognitionConfig message, length delimited. Does not implicitly {@link google.cloud.speech.v1.RecognitionConfig.verify|verify} messages.
|
1330 | * @function encodeDelimited
|
1331 | * @memberof google.cloud.speech.v1.RecognitionConfig
|
1332 | * @static
|
1333 | * @param {google.cloud.speech.v1.IRecognitionConfig} message RecognitionConfig message or plain object to encode
|
1334 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
1335 | * @returns {$protobuf.Writer} Writer
|
1336 | */
|
1337 | RecognitionConfig.encodeDelimited = function encodeDelimited(message, writer) {
|
1338 | return this.encode(message, writer).ldelim();
|
1339 | };
|
1340 |
|
1341 | /**
|
1342 | * Decodes a RecognitionConfig message from the specified reader or buffer.
|
1343 | * @function decode
|
1344 | * @memberof google.cloud.speech.v1.RecognitionConfig
|
1345 | * @static
|
1346 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
1347 | * @param {number} [length] Message length if known beforehand
|
1348 | * @returns {google.cloud.speech.v1.RecognitionConfig} RecognitionConfig
|
1349 | * @throws {Error} If the payload is not a reader or valid buffer
|
1350 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
1351 | */
|
1352 | RecognitionConfig.decode = function decode(reader, length) {
|
1353 | if (!(reader instanceof $Reader))
|
1354 | reader = $Reader.create(reader);
|
1355 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.RecognitionConfig();
|
1356 | while (reader.pos < end) {
|
1357 | var tag = reader.uint32();
|
1358 | switch (tag >>> 3) {
|
1359 | case 1:
|
1360 | message.encoding = reader.int32();
|
1361 | break;
|
1362 | case 2:
|
1363 | message.sampleRateHertz = reader.int32();
|
1364 | break;
|
1365 | case 7:
|
1366 | message.audioChannelCount = reader.int32();
|
1367 | break;
|
1368 | case 12:
|
1369 | message.enableSeparateRecognitionPerChannel = reader.bool();
|
1370 | break;
|
1371 | case 3:
|
1372 | message.languageCode = reader.string();
|
1373 | break;
|
1374 | case 4:
|
1375 | message.maxAlternatives = reader.int32();
|
1376 | break;
|
1377 | case 5:
|
1378 | message.profanityFilter = reader.bool();
|
1379 | break;
|
1380 | case 6:
|
1381 | if (!(message.speechContexts && message.speechContexts.length))
|
1382 | message.speechContexts = [];
|
1383 | message.speechContexts.push($root.google.cloud.speech.v1.SpeechContext.decode(reader, reader.uint32()));
|
1384 | break;
|
1385 | case 8:
|
1386 | message.enableWordTimeOffsets = reader.bool();
|
1387 | break;
|
1388 | case 11:
|
1389 | message.enableAutomaticPunctuation = reader.bool();
|
1390 | break;
|
1391 | case 19:
|
1392 | message.diarizationConfig = $root.google.cloud.speech.v1.SpeakerDiarizationConfig.decode(reader, reader.uint32());
|
1393 | break;
|
1394 | case 9:
|
1395 | message.metadata = $root.google.cloud.speech.v1.RecognitionMetadata.decode(reader, reader.uint32());
|
1396 | break;
|
1397 | case 13:
|
1398 | message.model = reader.string();
|
1399 | break;
|
1400 | case 14:
|
1401 | message.useEnhanced = reader.bool();
|
1402 | break;
|
1403 | default:
|
1404 | reader.skipType(tag & 7);
|
1405 | break;
|
1406 | }
|
1407 | }
|
1408 | return message;
|
1409 | };
|
1410 |
|
1411 | /**
|
1412 | * Decodes a RecognitionConfig message from the specified reader or buffer, length delimited.
|
1413 | * @function decodeDelimited
|
1414 | * @memberof google.cloud.speech.v1.RecognitionConfig
|
1415 | * @static
|
1416 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
1417 | * @returns {google.cloud.speech.v1.RecognitionConfig} RecognitionConfig
|
1418 | * @throws {Error} If the payload is not a reader or valid buffer
|
1419 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
1420 | */
|
1421 | RecognitionConfig.decodeDelimited = function decodeDelimited(reader) {
|
1422 | if (!(reader instanceof $Reader))
|
1423 | reader = new $Reader(reader);
|
1424 | return this.decode(reader, reader.uint32());
|
1425 | };
|
1426 |
|
1427 | /**
|
1428 | * Verifies a RecognitionConfig message.
|
1429 | * @function verify
|
1430 | * @memberof google.cloud.speech.v1.RecognitionConfig
|
1431 | * @static
|
1432 | * @param {Object.<string,*>} message Plain object to verify
|
1433 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
1434 | */
|
1435 | RecognitionConfig.verify = function verify(message) {
|
1436 | if (typeof message !== "object" || message === null)
|
1437 | return "object expected";
|
1438 | if (message.encoding != null && message.hasOwnProperty("encoding"))
|
1439 | switch (message.encoding) {
|
1440 | default:
|
1441 | return "encoding: enum value expected";
|
1442 | case 0:
|
1443 | case 1:
|
1444 | case 2:
|
1445 | case 3:
|
1446 | case 4:
|
1447 | case 5:
|
1448 | case 6:
|
1449 | case 7:
|
1450 | break;
|
1451 | }
|
1452 | if (message.sampleRateHertz != null && message.hasOwnProperty("sampleRateHertz"))
|
1453 | if (!$util.isInteger(message.sampleRateHertz))
|
1454 | return "sampleRateHertz: integer expected";
|
1455 | if (message.audioChannelCount != null && message.hasOwnProperty("audioChannelCount"))
|
1456 | if (!$util.isInteger(message.audioChannelCount))
|
1457 | return "audioChannelCount: integer expected";
|
1458 | if (message.enableSeparateRecognitionPerChannel != null && message.hasOwnProperty("enableSeparateRecognitionPerChannel"))
|
1459 | if (typeof message.enableSeparateRecognitionPerChannel !== "boolean")
|
1460 | return "enableSeparateRecognitionPerChannel: boolean expected";
|
1461 | if (message.languageCode != null && message.hasOwnProperty("languageCode"))
|
1462 | if (!$util.isString(message.languageCode))
|
1463 | return "languageCode: string expected";
|
1464 | if (message.maxAlternatives != null && message.hasOwnProperty("maxAlternatives"))
|
1465 | if (!$util.isInteger(message.maxAlternatives))
|
1466 | return "maxAlternatives: integer expected";
|
1467 | if (message.profanityFilter != null && message.hasOwnProperty("profanityFilter"))
|
1468 | if (typeof message.profanityFilter !== "boolean")
|
1469 | return "profanityFilter: boolean expected";
|
1470 | if (message.speechContexts != null && message.hasOwnProperty("speechContexts")) {
|
1471 | if (!Array.isArray(message.speechContexts))
|
1472 | return "speechContexts: array expected";
|
1473 | for (var i = 0; i < message.speechContexts.length; ++i) {
|
1474 | var error = $root.google.cloud.speech.v1.SpeechContext.verify(message.speechContexts[i]);
|
1475 | if (error)
|
1476 | return "speechContexts." + error;
|
1477 | }
|
1478 | }
|
1479 | if (message.enableWordTimeOffsets != null && message.hasOwnProperty("enableWordTimeOffsets"))
|
1480 | if (typeof message.enableWordTimeOffsets !== "boolean")
|
1481 | return "enableWordTimeOffsets: boolean expected";
|
1482 | if (message.enableAutomaticPunctuation != null && message.hasOwnProperty("enableAutomaticPunctuation"))
|
1483 | if (typeof message.enableAutomaticPunctuation !== "boolean")
|
1484 | return "enableAutomaticPunctuation: boolean expected";
|
1485 | if (message.diarizationConfig != null && message.hasOwnProperty("diarizationConfig")) {
|
1486 | var error = $root.google.cloud.speech.v1.SpeakerDiarizationConfig.verify(message.diarizationConfig);
|
1487 | if (error)
|
1488 | return "diarizationConfig." + error;
|
1489 | }
|
1490 | if (message.metadata != null && message.hasOwnProperty("metadata")) {
|
1491 | var error = $root.google.cloud.speech.v1.RecognitionMetadata.verify(message.metadata);
|
1492 | if (error)
|
1493 | return "metadata." + error;
|
1494 | }
|
1495 | if (message.model != null && message.hasOwnProperty("model"))
|
1496 | if (!$util.isString(message.model))
|
1497 | return "model: string expected";
|
1498 | if (message.useEnhanced != null && message.hasOwnProperty("useEnhanced"))
|
1499 | if (typeof message.useEnhanced !== "boolean")
|
1500 | return "useEnhanced: boolean expected";
|
1501 | return null;
|
1502 | };
|
1503 |
|
1504 | /**
|
1505 | * Creates a RecognitionConfig message from a plain object. Also converts values to their respective internal types.
|
1506 | * @function fromObject
|
1507 | * @memberof google.cloud.speech.v1.RecognitionConfig
|
1508 | * @static
|
1509 | * @param {Object.<string,*>} object Plain object
|
1510 | * @returns {google.cloud.speech.v1.RecognitionConfig} RecognitionConfig
|
1511 | */
|
1512 | RecognitionConfig.fromObject = function fromObject(object) {
|
1513 | if (object instanceof $root.google.cloud.speech.v1.RecognitionConfig)
|
1514 | return object;
|
1515 | var message = new $root.google.cloud.speech.v1.RecognitionConfig();
|
1516 | switch (object.encoding) {
|
1517 | case "ENCODING_UNSPECIFIED":
|
1518 | case 0:
|
1519 | message.encoding = 0;
|
1520 | break;
|
1521 | case "LINEAR16":
|
1522 | case 1:
|
1523 | message.encoding = 1;
|
1524 | break;
|
1525 | case "FLAC":
|
1526 | case 2:
|
1527 | message.encoding = 2;
|
1528 | break;
|
1529 | case "MULAW":
|
1530 | case 3:
|
1531 | message.encoding = 3;
|
1532 | break;
|
1533 | case "AMR":
|
1534 | case 4:
|
1535 | message.encoding = 4;
|
1536 | break;
|
1537 | case "AMR_WB":
|
1538 | case 5:
|
1539 | message.encoding = 5;
|
1540 | break;
|
1541 | case "OGG_OPUS":
|
1542 | case 6:
|
1543 | message.encoding = 6;
|
1544 | break;
|
1545 | case "SPEEX_WITH_HEADER_BYTE":
|
1546 | case 7:
|
1547 | message.encoding = 7;
|
1548 | break;
|
1549 | }
|
1550 | if (object.sampleRateHertz != null)
|
1551 | message.sampleRateHertz = object.sampleRateHertz | 0;
|
1552 | if (object.audioChannelCount != null)
|
1553 | message.audioChannelCount = object.audioChannelCount | 0;
|
1554 | if (object.enableSeparateRecognitionPerChannel != null)
|
1555 | message.enableSeparateRecognitionPerChannel = Boolean(object.enableSeparateRecognitionPerChannel);
|
1556 | if (object.languageCode != null)
|
1557 | message.languageCode = String(object.languageCode);
|
1558 | if (object.maxAlternatives != null)
|
1559 | message.maxAlternatives = object.maxAlternatives | 0;
|
1560 | if (object.profanityFilter != null)
|
1561 | message.profanityFilter = Boolean(object.profanityFilter);
|
1562 | if (object.speechContexts) {
|
1563 | if (!Array.isArray(object.speechContexts))
|
1564 | throw TypeError(".google.cloud.speech.v1.RecognitionConfig.speechContexts: array expected");
|
1565 | message.speechContexts = [];
|
1566 | for (var i = 0; i < object.speechContexts.length; ++i) {
|
1567 | if (typeof object.speechContexts[i] !== "object")
|
1568 | throw TypeError(".google.cloud.speech.v1.RecognitionConfig.speechContexts: object expected");
|
1569 | message.speechContexts[i] = $root.google.cloud.speech.v1.SpeechContext.fromObject(object.speechContexts[i]);
|
1570 | }
|
1571 | }
|
1572 | if (object.enableWordTimeOffsets != null)
|
1573 | message.enableWordTimeOffsets = Boolean(object.enableWordTimeOffsets);
|
1574 | if (object.enableAutomaticPunctuation != null)
|
1575 | message.enableAutomaticPunctuation = Boolean(object.enableAutomaticPunctuation);
|
1576 | if (object.diarizationConfig != null) {
|
1577 | if (typeof object.diarizationConfig !== "object")
|
1578 | throw TypeError(".google.cloud.speech.v1.RecognitionConfig.diarizationConfig: object expected");
|
1579 | message.diarizationConfig = $root.google.cloud.speech.v1.SpeakerDiarizationConfig.fromObject(object.diarizationConfig);
|
1580 | }
|
1581 | if (object.metadata != null) {
|
1582 | if (typeof object.metadata !== "object")
|
1583 | throw TypeError(".google.cloud.speech.v1.RecognitionConfig.metadata: object expected");
|
1584 | message.metadata = $root.google.cloud.speech.v1.RecognitionMetadata.fromObject(object.metadata);
|
1585 | }
|
1586 | if (object.model != null)
|
1587 | message.model = String(object.model);
|
1588 | if (object.useEnhanced != null)
|
1589 | message.useEnhanced = Boolean(object.useEnhanced);
|
1590 | return message;
|
1591 | };
|
1592 |
|
1593 | /**
|
1594 | * Creates a plain object from a RecognitionConfig message. Also converts values to other types if specified.
|
1595 | * @function toObject
|
1596 | * @memberof google.cloud.speech.v1.RecognitionConfig
|
1597 | * @static
|
1598 | * @param {google.cloud.speech.v1.RecognitionConfig} message RecognitionConfig
|
1599 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
1600 | * @returns {Object.<string,*>} Plain object
|
1601 | */
|
1602 | RecognitionConfig.toObject = function toObject(message, options) {
|
1603 | if (!options)
|
1604 | options = {};
|
1605 | var object = {};
|
1606 | if (options.arrays || options.defaults)
|
1607 | object.speechContexts = [];
|
1608 | if (options.defaults) {
|
1609 | object.encoding = options.enums === String ? "ENCODING_UNSPECIFIED" : 0;
|
1610 | object.sampleRateHertz = 0;
|
1611 | object.languageCode = "";
|
1612 | object.maxAlternatives = 0;
|
1613 | object.profanityFilter = false;
|
1614 | object.audioChannelCount = 0;
|
1615 | object.enableWordTimeOffsets = false;
|
1616 | object.metadata = null;
|
1617 | object.enableAutomaticPunctuation = false;
|
1618 | object.enableSeparateRecognitionPerChannel = false;
|
1619 | object.model = "";
|
1620 | object.useEnhanced = false;
|
1621 | object.diarizationConfig = null;
|
1622 | }
|
1623 | if (message.encoding != null && message.hasOwnProperty("encoding"))
|
1624 | object.encoding = options.enums === String ? $root.google.cloud.speech.v1.RecognitionConfig.AudioEncoding[message.encoding] : message.encoding;
|
1625 | if (message.sampleRateHertz != null && message.hasOwnProperty("sampleRateHertz"))
|
1626 | object.sampleRateHertz = message.sampleRateHertz;
|
1627 | if (message.languageCode != null && message.hasOwnProperty("languageCode"))
|
1628 | object.languageCode = message.languageCode;
|
1629 | if (message.maxAlternatives != null && message.hasOwnProperty("maxAlternatives"))
|
1630 | object.maxAlternatives = message.maxAlternatives;
|
1631 | if (message.profanityFilter != null && message.hasOwnProperty("profanityFilter"))
|
1632 | object.profanityFilter = message.profanityFilter;
|
1633 | if (message.speechContexts && message.speechContexts.length) {
|
1634 | object.speechContexts = [];
|
1635 | for (var j = 0; j < message.speechContexts.length; ++j)
|
1636 | object.speechContexts[j] = $root.google.cloud.speech.v1.SpeechContext.toObject(message.speechContexts[j], options);
|
1637 | }
|
1638 | if (message.audioChannelCount != null && message.hasOwnProperty("audioChannelCount"))
|
1639 | object.audioChannelCount = message.audioChannelCount;
|
1640 | if (message.enableWordTimeOffsets != null && message.hasOwnProperty("enableWordTimeOffsets"))
|
1641 | object.enableWordTimeOffsets = message.enableWordTimeOffsets;
|
1642 | if (message.metadata != null && message.hasOwnProperty("metadata"))
|
1643 | object.metadata = $root.google.cloud.speech.v1.RecognitionMetadata.toObject(message.metadata, options);
|
1644 | if (message.enableAutomaticPunctuation != null && message.hasOwnProperty("enableAutomaticPunctuation"))
|
1645 | object.enableAutomaticPunctuation = message.enableAutomaticPunctuation;
|
1646 | if (message.enableSeparateRecognitionPerChannel != null && message.hasOwnProperty("enableSeparateRecognitionPerChannel"))
|
1647 | object.enableSeparateRecognitionPerChannel = message.enableSeparateRecognitionPerChannel;
|
1648 | if (message.model != null && message.hasOwnProperty("model"))
|
1649 | object.model = message.model;
|
1650 | if (message.useEnhanced != null && message.hasOwnProperty("useEnhanced"))
|
1651 | object.useEnhanced = message.useEnhanced;
|
1652 | if (message.diarizationConfig != null && message.hasOwnProperty("diarizationConfig"))
|
1653 | object.diarizationConfig = $root.google.cloud.speech.v1.SpeakerDiarizationConfig.toObject(message.diarizationConfig, options);
|
1654 | return object;
|
1655 | };
|
1656 |
|
1657 | /**
|
1658 | * Converts this RecognitionConfig to JSON.
|
1659 | * @function toJSON
|
1660 | * @memberof google.cloud.speech.v1.RecognitionConfig
|
1661 | * @instance
|
1662 | * @returns {Object.<string,*>} JSON object
|
1663 | */
|
1664 | RecognitionConfig.prototype.toJSON = function toJSON() {
|
1665 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
1666 | };
|
1667 |
|
1668 | /**
|
1669 | * AudioEncoding enum.
|
1670 | * @name google.cloud.speech.v1.RecognitionConfig.AudioEncoding
|
1671 | * @enum {number}
|
1672 | * @property {number} ENCODING_UNSPECIFIED=0 ENCODING_UNSPECIFIED value
|
1673 | * @property {number} LINEAR16=1 LINEAR16 value
|
1674 | * @property {number} FLAC=2 FLAC value
|
1675 | * @property {number} MULAW=3 MULAW value
|
1676 | * @property {number} AMR=4 AMR value
|
1677 | * @property {number} AMR_WB=5 AMR_WB value
|
1678 | * @property {number} OGG_OPUS=6 OGG_OPUS value
|
1679 | * @property {number} SPEEX_WITH_HEADER_BYTE=7 SPEEX_WITH_HEADER_BYTE value
|
1680 | */
|
1681 | RecognitionConfig.AudioEncoding = (function() {
|
1682 | var valuesById = {}, values = Object.create(valuesById);
|
1683 | values[valuesById[0] = "ENCODING_UNSPECIFIED"] = 0;
|
1684 | values[valuesById[1] = "LINEAR16"] = 1;
|
1685 | values[valuesById[2] = "FLAC"] = 2;
|
1686 | values[valuesById[3] = "MULAW"] = 3;
|
1687 | values[valuesById[4] = "AMR"] = 4;
|
1688 | values[valuesById[5] = "AMR_WB"] = 5;
|
1689 | values[valuesById[6] = "OGG_OPUS"] = 6;
|
1690 | values[valuesById[7] = "SPEEX_WITH_HEADER_BYTE"] = 7;
|
1691 | return values;
|
1692 | })();
|
1693 |
|
1694 | return RecognitionConfig;
|
1695 | })();
|
1696 |
|
1697 | v1.SpeakerDiarizationConfig = (function() {
|
1698 |
|
1699 | /**
|
1700 | * Properties of a SpeakerDiarizationConfig.
|
1701 | * @memberof google.cloud.speech.v1
|
1702 | * @interface ISpeakerDiarizationConfig
|
1703 | * @property {boolean|null} [enableSpeakerDiarization] SpeakerDiarizationConfig enableSpeakerDiarization
|
1704 | * @property {number|null} [minSpeakerCount] SpeakerDiarizationConfig minSpeakerCount
|
1705 | * @property {number|null} [maxSpeakerCount] SpeakerDiarizationConfig maxSpeakerCount
|
1706 | * @property {number|null} [speakerTag] SpeakerDiarizationConfig speakerTag
|
1707 | */
|
1708 |
|
1709 | /**
|
1710 | * Constructs a new SpeakerDiarizationConfig.
|
1711 | * @memberof google.cloud.speech.v1
|
1712 | * @classdesc Represents a SpeakerDiarizationConfig.
|
1713 | * @implements ISpeakerDiarizationConfig
|
1714 | * @constructor
|
1715 | * @param {google.cloud.speech.v1.ISpeakerDiarizationConfig=} [properties] Properties to set
|
1716 | */
|
1717 | function SpeakerDiarizationConfig(properties) {
|
1718 | if (properties)
|
1719 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
1720 | if (properties[keys[i]] != null)
|
1721 | this[keys[i]] = properties[keys[i]];
|
1722 | }
|
1723 |
|
1724 | /**
|
1725 | * SpeakerDiarizationConfig enableSpeakerDiarization.
|
1726 | * @member {boolean} enableSpeakerDiarization
|
1727 | * @memberof google.cloud.speech.v1.SpeakerDiarizationConfig
|
1728 | * @instance
|
1729 | */
|
1730 | SpeakerDiarizationConfig.prototype.enableSpeakerDiarization = false;
|
1731 |
|
1732 | /**
|
1733 | * SpeakerDiarizationConfig minSpeakerCount.
|
1734 | * @member {number} minSpeakerCount
|
1735 | * @memberof google.cloud.speech.v1.SpeakerDiarizationConfig
|
1736 | * @instance
|
1737 | */
|
1738 | SpeakerDiarizationConfig.prototype.minSpeakerCount = 0;
|
1739 |
|
1740 | /**
|
1741 | * SpeakerDiarizationConfig maxSpeakerCount.
|
1742 | * @member {number} maxSpeakerCount
|
1743 | * @memberof google.cloud.speech.v1.SpeakerDiarizationConfig
|
1744 | * @instance
|
1745 | */
|
1746 | SpeakerDiarizationConfig.prototype.maxSpeakerCount = 0;
|
1747 |
|
1748 | /**
|
1749 | * SpeakerDiarizationConfig speakerTag.
|
1750 | * @member {number} speakerTag
|
1751 | * @memberof google.cloud.speech.v1.SpeakerDiarizationConfig
|
1752 | * @instance
|
1753 | */
|
1754 | SpeakerDiarizationConfig.prototype.speakerTag = 0;
|
1755 |
|
1756 | /**
|
1757 | * Creates a new SpeakerDiarizationConfig instance using the specified properties.
|
1758 | * @function create
|
1759 | * @memberof google.cloud.speech.v1.SpeakerDiarizationConfig
|
1760 | * @static
|
1761 | * @param {google.cloud.speech.v1.ISpeakerDiarizationConfig=} [properties] Properties to set
|
1762 | * @returns {google.cloud.speech.v1.SpeakerDiarizationConfig} SpeakerDiarizationConfig instance
|
1763 | */
|
1764 | SpeakerDiarizationConfig.create = function create(properties) {
|
1765 | return new SpeakerDiarizationConfig(properties);
|
1766 | };
|
1767 |
|
1768 | /**
|
1769 | * Encodes the specified SpeakerDiarizationConfig message. Does not implicitly {@link google.cloud.speech.v1.SpeakerDiarizationConfig.verify|verify} messages.
|
1770 | * @function encode
|
1771 | * @memberof google.cloud.speech.v1.SpeakerDiarizationConfig
|
1772 | * @static
|
1773 | * @param {google.cloud.speech.v1.ISpeakerDiarizationConfig} message SpeakerDiarizationConfig message or plain object to encode
|
1774 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
1775 | * @returns {$protobuf.Writer} Writer
|
1776 | */
|
1777 | SpeakerDiarizationConfig.encode = function encode(message, writer) {
|
1778 | if (!writer)
|
1779 | writer = $Writer.create();
|
1780 | if (message.enableSpeakerDiarization != null && Object.hasOwnProperty.call(message, "enableSpeakerDiarization"))
|
1781 | writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enableSpeakerDiarization);
|
1782 | if (message.minSpeakerCount != null && Object.hasOwnProperty.call(message, "minSpeakerCount"))
|
1783 | writer.uint32(/* id 2, wireType 0 =*/16).int32(message.minSpeakerCount);
|
1784 | if (message.maxSpeakerCount != null && Object.hasOwnProperty.call(message, "maxSpeakerCount"))
|
1785 | writer.uint32(/* id 3, wireType 0 =*/24).int32(message.maxSpeakerCount);
|
1786 | if (message.speakerTag != null && Object.hasOwnProperty.call(message, "speakerTag"))
|
1787 | writer.uint32(/* id 5, wireType 0 =*/40).int32(message.speakerTag);
|
1788 | return writer;
|
1789 | };
|
1790 |
|
1791 | /**
|
1792 | * Encodes the specified SpeakerDiarizationConfig message, length delimited. Does not implicitly {@link google.cloud.speech.v1.SpeakerDiarizationConfig.verify|verify} messages.
|
1793 | * @function encodeDelimited
|
1794 | * @memberof google.cloud.speech.v1.SpeakerDiarizationConfig
|
1795 | * @static
|
1796 | * @param {google.cloud.speech.v1.ISpeakerDiarizationConfig} message SpeakerDiarizationConfig message or plain object to encode
|
1797 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
1798 | * @returns {$protobuf.Writer} Writer
|
1799 | */
|
1800 | SpeakerDiarizationConfig.encodeDelimited = function encodeDelimited(message, writer) {
|
1801 | return this.encode(message, writer).ldelim();
|
1802 | };
|
1803 |
|
1804 | /**
|
1805 | * Decodes a SpeakerDiarizationConfig message from the specified reader or buffer.
|
1806 | * @function decode
|
1807 | * @memberof google.cloud.speech.v1.SpeakerDiarizationConfig
|
1808 | * @static
|
1809 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
1810 | * @param {number} [length] Message length if known beforehand
|
1811 | * @returns {google.cloud.speech.v1.SpeakerDiarizationConfig} SpeakerDiarizationConfig
|
1812 | * @throws {Error} If the payload is not a reader or valid buffer
|
1813 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
1814 | */
|
1815 | SpeakerDiarizationConfig.decode = function decode(reader, length) {
|
1816 | if (!(reader instanceof $Reader))
|
1817 | reader = $Reader.create(reader);
|
1818 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.SpeakerDiarizationConfig();
|
1819 | while (reader.pos < end) {
|
1820 | var tag = reader.uint32();
|
1821 | switch (tag >>> 3) {
|
1822 | case 1:
|
1823 | message.enableSpeakerDiarization = reader.bool();
|
1824 | break;
|
1825 | case 2:
|
1826 | message.minSpeakerCount = reader.int32();
|
1827 | break;
|
1828 | case 3:
|
1829 | message.maxSpeakerCount = reader.int32();
|
1830 | break;
|
1831 | case 5:
|
1832 | message.speakerTag = reader.int32();
|
1833 | break;
|
1834 | default:
|
1835 | reader.skipType(tag & 7);
|
1836 | break;
|
1837 | }
|
1838 | }
|
1839 | return message;
|
1840 | };
|
1841 |
|
1842 | /**
|
1843 | * Decodes a SpeakerDiarizationConfig message from the specified reader or buffer, length delimited.
|
1844 | * @function decodeDelimited
|
1845 | * @memberof google.cloud.speech.v1.SpeakerDiarizationConfig
|
1846 | * @static
|
1847 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
1848 | * @returns {google.cloud.speech.v1.SpeakerDiarizationConfig} SpeakerDiarizationConfig
|
1849 | * @throws {Error} If the payload is not a reader or valid buffer
|
1850 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
1851 | */
|
1852 | SpeakerDiarizationConfig.decodeDelimited = function decodeDelimited(reader) {
|
1853 | if (!(reader instanceof $Reader))
|
1854 | reader = new $Reader(reader);
|
1855 | return this.decode(reader, reader.uint32());
|
1856 | };
|
1857 |
|
1858 | /**
|
1859 | * Verifies a SpeakerDiarizationConfig message.
|
1860 | * @function verify
|
1861 | * @memberof google.cloud.speech.v1.SpeakerDiarizationConfig
|
1862 | * @static
|
1863 | * @param {Object.<string,*>} message Plain object to verify
|
1864 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
1865 | */
|
1866 | SpeakerDiarizationConfig.verify = function verify(message) {
|
1867 | if (typeof message !== "object" || message === null)
|
1868 | return "object expected";
|
1869 | if (message.enableSpeakerDiarization != null && message.hasOwnProperty("enableSpeakerDiarization"))
|
1870 | if (typeof message.enableSpeakerDiarization !== "boolean")
|
1871 | return "enableSpeakerDiarization: boolean expected";
|
1872 | if (message.minSpeakerCount != null && message.hasOwnProperty("minSpeakerCount"))
|
1873 | if (!$util.isInteger(message.minSpeakerCount))
|
1874 | return "minSpeakerCount: integer expected";
|
1875 | if (message.maxSpeakerCount != null && message.hasOwnProperty("maxSpeakerCount"))
|
1876 | if (!$util.isInteger(message.maxSpeakerCount))
|
1877 | return "maxSpeakerCount: integer expected";
|
1878 | if (message.speakerTag != null && message.hasOwnProperty("speakerTag"))
|
1879 | if (!$util.isInteger(message.speakerTag))
|
1880 | return "speakerTag: integer expected";
|
1881 | return null;
|
1882 | };
|
1883 |
|
1884 | /**
|
1885 | * Creates a SpeakerDiarizationConfig message from a plain object. Also converts values to their respective internal types.
|
1886 | * @function fromObject
|
1887 | * @memberof google.cloud.speech.v1.SpeakerDiarizationConfig
|
1888 | * @static
|
1889 | * @param {Object.<string,*>} object Plain object
|
1890 | * @returns {google.cloud.speech.v1.SpeakerDiarizationConfig} SpeakerDiarizationConfig
|
1891 | */
|
1892 | SpeakerDiarizationConfig.fromObject = function fromObject(object) {
|
1893 | if (object instanceof $root.google.cloud.speech.v1.SpeakerDiarizationConfig)
|
1894 | return object;
|
1895 | var message = new $root.google.cloud.speech.v1.SpeakerDiarizationConfig();
|
1896 | if (object.enableSpeakerDiarization != null)
|
1897 | message.enableSpeakerDiarization = Boolean(object.enableSpeakerDiarization);
|
1898 | if (object.minSpeakerCount != null)
|
1899 | message.minSpeakerCount = object.minSpeakerCount | 0;
|
1900 | if (object.maxSpeakerCount != null)
|
1901 | message.maxSpeakerCount = object.maxSpeakerCount | 0;
|
1902 | if (object.speakerTag != null)
|
1903 | message.speakerTag = object.speakerTag | 0;
|
1904 | return message;
|
1905 | };
|
1906 |
|
1907 | /**
|
1908 | * Creates a plain object from a SpeakerDiarizationConfig message. Also converts values to other types if specified.
|
1909 | * @function toObject
|
1910 | * @memberof google.cloud.speech.v1.SpeakerDiarizationConfig
|
1911 | * @static
|
1912 | * @param {google.cloud.speech.v1.SpeakerDiarizationConfig} message SpeakerDiarizationConfig
|
1913 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
1914 | * @returns {Object.<string,*>} Plain object
|
1915 | */
|
1916 | SpeakerDiarizationConfig.toObject = function toObject(message, options) {
|
1917 | if (!options)
|
1918 | options = {};
|
1919 | var object = {};
|
1920 | if (options.defaults) {
|
1921 | object.enableSpeakerDiarization = false;
|
1922 | object.minSpeakerCount = 0;
|
1923 | object.maxSpeakerCount = 0;
|
1924 | object.speakerTag = 0;
|
1925 | }
|
1926 | if (message.enableSpeakerDiarization != null && message.hasOwnProperty("enableSpeakerDiarization"))
|
1927 | object.enableSpeakerDiarization = message.enableSpeakerDiarization;
|
1928 | if (message.minSpeakerCount != null && message.hasOwnProperty("minSpeakerCount"))
|
1929 | object.minSpeakerCount = message.minSpeakerCount;
|
1930 | if (message.maxSpeakerCount != null && message.hasOwnProperty("maxSpeakerCount"))
|
1931 | object.maxSpeakerCount = message.maxSpeakerCount;
|
1932 | if (message.speakerTag != null && message.hasOwnProperty("speakerTag"))
|
1933 | object.speakerTag = message.speakerTag;
|
1934 | return object;
|
1935 | };
|
1936 |
|
1937 | /**
|
1938 | * Converts this SpeakerDiarizationConfig to JSON.
|
1939 | * @function toJSON
|
1940 | * @memberof google.cloud.speech.v1.SpeakerDiarizationConfig
|
1941 | * @instance
|
1942 | * @returns {Object.<string,*>} JSON object
|
1943 | */
|
1944 | SpeakerDiarizationConfig.prototype.toJSON = function toJSON() {
|
1945 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
1946 | };
|
1947 |
|
1948 | return SpeakerDiarizationConfig;
|
1949 | })();
|
1950 |
|
1951 | v1.RecognitionMetadata = (function() {
|
1952 |
|
1953 | /**
|
1954 | * Properties of a RecognitionMetadata.
|
1955 | * @memberof google.cloud.speech.v1
|
1956 | * @interface IRecognitionMetadata
|
1957 | * @property {google.cloud.speech.v1.RecognitionMetadata.InteractionType|null} [interactionType] RecognitionMetadata interactionType
|
1958 | * @property {number|null} [industryNaicsCodeOfAudio] RecognitionMetadata industryNaicsCodeOfAudio
|
1959 | * @property {google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance|null} [microphoneDistance] RecognitionMetadata microphoneDistance
|
1960 | * @property {google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType|null} [originalMediaType] RecognitionMetadata originalMediaType
|
1961 | * @property {google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType|null} [recordingDeviceType] RecognitionMetadata recordingDeviceType
|
1962 | * @property {string|null} [recordingDeviceName] RecognitionMetadata recordingDeviceName
|
1963 | * @property {string|null} [originalMimeType] RecognitionMetadata originalMimeType
|
1964 | * @property {string|null} [audioTopic] RecognitionMetadata audioTopic
|
1965 | */
|
1966 |
|
1967 | /**
|
1968 | * Constructs a new RecognitionMetadata.
|
1969 | * @memberof google.cloud.speech.v1
|
1970 | * @classdesc Represents a RecognitionMetadata.
|
1971 | * @implements IRecognitionMetadata
|
1972 | * @constructor
|
1973 | * @param {google.cloud.speech.v1.IRecognitionMetadata=} [properties] Properties to set
|
1974 | */
|
1975 | function RecognitionMetadata(properties) {
|
1976 | if (properties)
|
1977 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
1978 | if (properties[keys[i]] != null)
|
1979 | this[keys[i]] = properties[keys[i]];
|
1980 | }
|
1981 |
|
1982 | /**
|
1983 | * RecognitionMetadata interactionType.
|
1984 | * @member {google.cloud.speech.v1.RecognitionMetadata.InteractionType} interactionType
|
1985 | * @memberof google.cloud.speech.v1.RecognitionMetadata
|
1986 | * @instance
|
1987 | */
|
1988 | RecognitionMetadata.prototype.interactionType = 0;
|
1989 |
|
1990 | /**
|
1991 | * RecognitionMetadata industryNaicsCodeOfAudio.
|
1992 | * @member {number} industryNaicsCodeOfAudio
|
1993 | * @memberof google.cloud.speech.v1.RecognitionMetadata
|
1994 | * @instance
|
1995 | */
|
1996 | RecognitionMetadata.prototype.industryNaicsCodeOfAudio = 0;
|
1997 |
|
1998 | /**
|
1999 | * RecognitionMetadata microphoneDistance.
|
2000 | * @member {google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance} microphoneDistance
|
2001 | * @memberof google.cloud.speech.v1.RecognitionMetadata
|
2002 | * @instance
|
2003 | */
|
2004 | RecognitionMetadata.prototype.microphoneDistance = 0;
|
2005 |
|
2006 | /**
|
2007 | * RecognitionMetadata originalMediaType.
|
2008 | * @member {google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType} originalMediaType
|
2009 | * @memberof google.cloud.speech.v1.RecognitionMetadata
|
2010 | * @instance
|
2011 | */
|
2012 | RecognitionMetadata.prototype.originalMediaType = 0;
|
2013 |
|
2014 | /**
|
2015 | * RecognitionMetadata recordingDeviceType.
|
2016 | * @member {google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType} recordingDeviceType
|
2017 | * @memberof google.cloud.speech.v1.RecognitionMetadata
|
2018 | * @instance
|
2019 | */
|
2020 | RecognitionMetadata.prototype.recordingDeviceType = 0;
|
2021 |
|
2022 | /**
|
2023 | * RecognitionMetadata recordingDeviceName.
|
2024 | * @member {string} recordingDeviceName
|
2025 | * @memberof google.cloud.speech.v1.RecognitionMetadata
|
2026 | * @instance
|
2027 | */
|
2028 | RecognitionMetadata.prototype.recordingDeviceName = "";
|
2029 |
|
2030 | /**
|
2031 | * RecognitionMetadata originalMimeType.
|
2032 | * @member {string} originalMimeType
|
2033 | * @memberof google.cloud.speech.v1.RecognitionMetadata
|
2034 | * @instance
|
2035 | */
|
2036 | RecognitionMetadata.prototype.originalMimeType = "";
|
2037 |
|
2038 | /**
|
2039 | * RecognitionMetadata audioTopic.
|
2040 | * @member {string} audioTopic
|
2041 | * @memberof google.cloud.speech.v1.RecognitionMetadata
|
2042 | * @instance
|
2043 | */
|
2044 | RecognitionMetadata.prototype.audioTopic = "";
|
2045 |
|
2046 | /**
|
2047 | * Creates a new RecognitionMetadata instance using the specified properties.
|
2048 | * @function create
|
2049 | * @memberof google.cloud.speech.v1.RecognitionMetadata
|
2050 | * @static
|
2051 | * @param {google.cloud.speech.v1.IRecognitionMetadata=} [properties] Properties to set
|
2052 | * @returns {google.cloud.speech.v1.RecognitionMetadata} RecognitionMetadata instance
|
2053 | */
|
2054 | RecognitionMetadata.create = function create(properties) {
|
2055 | return new RecognitionMetadata(properties);
|
2056 | };
|
2057 |
|
2058 | /**
|
2059 | * Encodes the specified RecognitionMetadata message. Does not implicitly {@link google.cloud.speech.v1.RecognitionMetadata.verify|verify} messages.
|
2060 | * @function encode
|
2061 | * @memberof google.cloud.speech.v1.RecognitionMetadata
|
2062 | * @static
|
2063 | * @param {google.cloud.speech.v1.IRecognitionMetadata} message RecognitionMetadata message or plain object to encode
|
2064 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
2065 | * @returns {$protobuf.Writer} Writer
|
2066 | */
|
2067 | RecognitionMetadata.encode = function encode(message, writer) {
|
2068 | if (!writer)
|
2069 | writer = $Writer.create();
|
2070 | if (message.interactionType != null && Object.hasOwnProperty.call(message, "interactionType"))
|
2071 | writer.uint32(/* id 1, wireType 0 =*/8).int32(message.interactionType);
|
2072 | if (message.industryNaicsCodeOfAudio != null && Object.hasOwnProperty.call(message, "industryNaicsCodeOfAudio"))
|
2073 | writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.industryNaicsCodeOfAudio);
|
2074 | if (message.microphoneDistance != null && Object.hasOwnProperty.call(message, "microphoneDistance"))
|
2075 | writer.uint32(/* id 4, wireType 0 =*/32).int32(message.microphoneDistance);
|
2076 | if (message.originalMediaType != null && Object.hasOwnProperty.call(message, "originalMediaType"))
|
2077 | writer.uint32(/* id 5, wireType 0 =*/40).int32(message.originalMediaType);
|
2078 | if (message.recordingDeviceType != null && Object.hasOwnProperty.call(message, "recordingDeviceType"))
|
2079 | writer.uint32(/* id 6, wireType 0 =*/48).int32(message.recordingDeviceType);
|
2080 | if (message.recordingDeviceName != null && Object.hasOwnProperty.call(message, "recordingDeviceName"))
|
2081 | writer.uint32(/* id 7, wireType 2 =*/58).string(message.recordingDeviceName);
|
2082 | if (message.originalMimeType != null && Object.hasOwnProperty.call(message, "originalMimeType"))
|
2083 | writer.uint32(/* id 8, wireType 2 =*/66).string(message.originalMimeType);
|
2084 | if (message.audioTopic != null && Object.hasOwnProperty.call(message, "audioTopic"))
|
2085 | writer.uint32(/* id 10, wireType 2 =*/82).string(message.audioTopic);
|
2086 | return writer;
|
2087 | };
|
2088 |
|
2089 | /**
|
2090 | * Encodes the specified RecognitionMetadata message, length delimited. Does not implicitly {@link google.cloud.speech.v1.RecognitionMetadata.verify|verify} messages.
|
2091 | * @function encodeDelimited
|
2092 | * @memberof google.cloud.speech.v1.RecognitionMetadata
|
2093 | * @static
|
2094 | * @param {google.cloud.speech.v1.IRecognitionMetadata} message RecognitionMetadata message or plain object to encode
|
2095 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
2096 | * @returns {$protobuf.Writer} Writer
|
2097 | */
|
2098 | RecognitionMetadata.encodeDelimited = function encodeDelimited(message, writer) {
|
2099 | return this.encode(message, writer).ldelim();
|
2100 | };
|
2101 |
|
2102 | /**
|
2103 | * Decodes a RecognitionMetadata message from the specified reader or buffer.
|
2104 | * @function decode
|
2105 | * @memberof google.cloud.speech.v1.RecognitionMetadata
|
2106 | * @static
|
2107 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
2108 | * @param {number} [length] Message length if known beforehand
|
2109 | * @returns {google.cloud.speech.v1.RecognitionMetadata} RecognitionMetadata
|
2110 | * @throws {Error} If the payload is not a reader or valid buffer
|
2111 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
2112 | */
|
2113 | RecognitionMetadata.decode = function decode(reader, length) {
|
2114 | if (!(reader instanceof $Reader))
|
2115 | reader = $Reader.create(reader);
|
2116 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.RecognitionMetadata();
|
2117 | while (reader.pos < end) {
|
2118 | var tag = reader.uint32();
|
2119 | switch (tag >>> 3) {
|
2120 | case 1:
|
2121 | message.interactionType = reader.int32();
|
2122 | break;
|
2123 | case 3:
|
2124 | message.industryNaicsCodeOfAudio = reader.uint32();
|
2125 | break;
|
2126 | case 4:
|
2127 | message.microphoneDistance = reader.int32();
|
2128 | break;
|
2129 | case 5:
|
2130 | message.originalMediaType = reader.int32();
|
2131 | break;
|
2132 | case 6:
|
2133 | message.recordingDeviceType = reader.int32();
|
2134 | break;
|
2135 | case 7:
|
2136 | message.recordingDeviceName = reader.string();
|
2137 | break;
|
2138 | case 8:
|
2139 | message.originalMimeType = reader.string();
|
2140 | break;
|
2141 | case 10:
|
2142 | message.audioTopic = reader.string();
|
2143 | break;
|
2144 | default:
|
2145 | reader.skipType(tag & 7);
|
2146 | break;
|
2147 | }
|
2148 | }
|
2149 | return message;
|
2150 | };
|
2151 |
|
2152 | /**
|
2153 | * Decodes a RecognitionMetadata message from the specified reader or buffer, length delimited.
|
2154 | * @function decodeDelimited
|
2155 | * @memberof google.cloud.speech.v1.RecognitionMetadata
|
2156 | * @static
|
2157 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
2158 | * @returns {google.cloud.speech.v1.RecognitionMetadata} RecognitionMetadata
|
2159 | * @throws {Error} If the payload is not a reader or valid buffer
|
2160 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
2161 | */
|
2162 | RecognitionMetadata.decodeDelimited = function decodeDelimited(reader) {
|
2163 | if (!(reader instanceof $Reader))
|
2164 | reader = new $Reader(reader);
|
2165 | return this.decode(reader, reader.uint32());
|
2166 | };
|
2167 |
|
2168 | /**
|
2169 | * Verifies a RecognitionMetadata message.
|
2170 | * @function verify
|
2171 | * @memberof google.cloud.speech.v1.RecognitionMetadata
|
2172 | * @static
|
2173 | * @param {Object.<string,*>} message Plain object to verify
|
2174 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
2175 | */
|
2176 | RecognitionMetadata.verify = function verify(message) {
|
2177 | if (typeof message !== "object" || message === null)
|
2178 | return "object expected";
|
2179 | if (message.interactionType != null && message.hasOwnProperty("interactionType"))
|
2180 | switch (message.interactionType) {
|
2181 | default:
|
2182 | return "interactionType: enum value expected";
|
2183 | case 0:
|
2184 | case 1:
|
2185 | case 2:
|
2186 | case 3:
|
2187 | case 4:
|
2188 | case 5:
|
2189 | case 6:
|
2190 | case 7:
|
2191 | case 8:
|
2192 | break;
|
2193 | }
|
2194 | if (message.industryNaicsCodeOfAudio != null && message.hasOwnProperty("industryNaicsCodeOfAudio"))
|
2195 | if (!$util.isInteger(message.industryNaicsCodeOfAudio))
|
2196 | return "industryNaicsCodeOfAudio: integer expected";
|
2197 | if (message.microphoneDistance != null && message.hasOwnProperty("microphoneDistance"))
|
2198 | switch (message.microphoneDistance) {
|
2199 | default:
|
2200 | return "microphoneDistance: enum value expected";
|
2201 | case 0:
|
2202 | case 1:
|
2203 | case 2:
|
2204 | case 3:
|
2205 | break;
|
2206 | }
|
2207 | if (message.originalMediaType != null && message.hasOwnProperty("originalMediaType"))
|
2208 | switch (message.originalMediaType) {
|
2209 | default:
|
2210 | return "originalMediaType: enum value expected";
|
2211 | case 0:
|
2212 | case 1:
|
2213 | case 2:
|
2214 | break;
|
2215 | }
|
2216 | if (message.recordingDeviceType != null && message.hasOwnProperty("recordingDeviceType"))
|
2217 | switch (message.recordingDeviceType) {
|
2218 | default:
|
2219 | return "recordingDeviceType: enum value expected";
|
2220 | case 0:
|
2221 | case 1:
|
2222 | case 2:
|
2223 | case 3:
|
2224 | case 4:
|
2225 | case 5:
|
2226 | case 6:
|
2227 | break;
|
2228 | }
|
2229 | if (message.recordingDeviceName != null && message.hasOwnProperty("recordingDeviceName"))
|
2230 | if (!$util.isString(message.recordingDeviceName))
|
2231 | return "recordingDeviceName: string expected";
|
2232 | if (message.originalMimeType != null && message.hasOwnProperty("originalMimeType"))
|
2233 | if (!$util.isString(message.originalMimeType))
|
2234 | return "originalMimeType: string expected";
|
2235 | if (message.audioTopic != null && message.hasOwnProperty("audioTopic"))
|
2236 | if (!$util.isString(message.audioTopic))
|
2237 | return "audioTopic: string expected";
|
2238 | return null;
|
2239 | };
|
2240 |
|
2241 | /**
|
2242 | * Creates a RecognitionMetadata message from a plain object. Also converts values to their respective internal types.
|
2243 | * @function fromObject
|
2244 | * @memberof google.cloud.speech.v1.RecognitionMetadata
|
2245 | * @static
|
2246 | * @param {Object.<string,*>} object Plain object
|
2247 | * @returns {google.cloud.speech.v1.RecognitionMetadata} RecognitionMetadata
|
2248 | */
|
2249 | RecognitionMetadata.fromObject = function fromObject(object) {
|
2250 | if (object instanceof $root.google.cloud.speech.v1.RecognitionMetadata)
|
2251 | return object;
|
2252 | var message = new $root.google.cloud.speech.v1.RecognitionMetadata();
|
2253 | switch (object.interactionType) {
|
2254 | case "INTERACTION_TYPE_UNSPECIFIED":
|
2255 | case 0:
|
2256 | message.interactionType = 0;
|
2257 | break;
|
2258 | case "DISCUSSION":
|
2259 | case 1:
|
2260 | message.interactionType = 1;
|
2261 | break;
|
2262 | case "PRESENTATION":
|
2263 | case 2:
|
2264 | message.interactionType = 2;
|
2265 | break;
|
2266 | case "PHONE_CALL":
|
2267 | case 3:
|
2268 | message.interactionType = 3;
|
2269 | break;
|
2270 | case "VOICEMAIL":
|
2271 | case 4:
|
2272 | message.interactionType = 4;
|
2273 | break;
|
2274 | case "PROFESSIONALLY_PRODUCED":
|
2275 | case 5:
|
2276 | message.interactionType = 5;
|
2277 | break;
|
2278 | case "VOICE_SEARCH":
|
2279 | case 6:
|
2280 | message.interactionType = 6;
|
2281 | break;
|
2282 | case "VOICE_COMMAND":
|
2283 | case 7:
|
2284 | message.interactionType = 7;
|
2285 | break;
|
2286 | case "DICTATION":
|
2287 | case 8:
|
2288 | message.interactionType = 8;
|
2289 | break;
|
2290 | }
|
2291 | if (object.industryNaicsCodeOfAudio != null)
|
2292 | message.industryNaicsCodeOfAudio = object.industryNaicsCodeOfAudio >>> 0;
|
2293 | switch (object.microphoneDistance) {
|
2294 | case "MICROPHONE_DISTANCE_UNSPECIFIED":
|
2295 | case 0:
|
2296 | message.microphoneDistance = 0;
|
2297 | break;
|
2298 | case "NEARFIELD":
|
2299 | case 1:
|
2300 | message.microphoneDistance = 1;
|
2301 | break;
|
2302 | case "MIDFIELD":
|
2303 | case 2:
|
2304 | message.microphoneDistance = 2;
|
2305 | break;
|
2306 | case "FARFIELD":
|
2307 | case 3:
|
2308 | message.microphoneDistance = 3;
|
2309 | break;
|
2310 | }
|
2311 | switch (object.originalMediaType) {
|
2312 | case "ORIGINAL_MEDIA_TYPE_UNSPECIFIED":
|
2313 | case 0:
|
2314 | message.originalMediaType = 0;
|
2315 | break;
|
2316 | case "AUDIO":
|
2317 | case 1:
|
2318 | message.originalMediaType = 1;
|
2319 | break;
|
2320 | case "VIDEO":
|
2321 | case 2:
|
2322 | message.originalMediaType = 2;
|
2323 | break;
|
2324 | }
|
2325 | switch (object.recordingDeviceType) {
|
2326 | case "RECORDING_DEVICE_TYPE_UNSPECIFIED":
|
2327 | case 0:
|
2328 | message.recordingDeviceType = 0;
|
2329 | break;
|
2330 | case "SMARTPHONE":
|
2331 | case 1:
|
2332 | message.recordingDeviceType = 1;
|
2333 | break;
|
2334 | case "PC":
|
2335 | case 2:
|
2336 | message.recordingDeviceType = 2;
|
2337 | break;
|
2338 | case "PHONE_LINE":
|
2339 | case 3:
|
2340 | message.recordingDeviceType = 3;
|
2341 | break;
|
2342 | case "VEHICLE":
|
2343 | case 4:
|
2344 | message.recordingDeviceType = 4;
|
2345 | break;
|
2346 | case "OTHER_OUTDOOR_DEVICE":
|
2347 | case 5:
|
2348 | message.recordingDeviceType = 5;
|
2349 | break;
|
2350 | case "OTHER_INDOOR_DEVICE":
|
2351 | case 6:
|
2352 | message.recordingDeviceType = 6;
|
2353 | break;
|
2354 | }
|
2355 | if (object.recordingDeviceName != null)
|
2356 | message.recordingDeviceName = String(object.recordingDeviceName);
|
2357 | if (object.originalMimeType != null)
|
2358 | message.originalMimeType = String(object.originalMimeType);
|
2359 | if (object.audioTopic != null)
|
2360 | message.audioTopic = String(object.audioTopic);
|
2361 | return message;
|
2362 | };
|
2363 |
|
2364 | /**
|
2365 | * Creates a plain object from a RecognitionMetadata message. Also converts values to other types if specified.
|
2366 | * @function toObject
|
2367 | * @memberof google.cloud.speech.v1.RecognitionMetadata
|
2368 | * @static
|
2369 | * @param {google.cloud.speech.v1.RecognitionMetadata} message RecognitionMetadata
|
2370 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
2371 | * @returns {Object.<string,*>} Plain object
|
2372 | */
|
2373 | RecognitionMetadata.toObject = function toObject(message, options) {
|
2374 | if (!options)
|
2375 | options = {};
|
2376 | var object = {};
|
2377 | if (options.defaults) {
|
2378 | object.interactionType = options.enums === String ? "INTERACTION_TYPE_UNSPECIFIED" : 0;
|
2379 | object.industryNaicsCodeOfAudio = 0;
|
2380 | object.microphoneDistance = options.enums === String ? "MICROPHONE_DISTANCE_UNSPECIFIED" : 0;
|
2381 | object.originalMediaType = options.enums === String ? "ORIGINAL_MEDIA_TYPE_UNSPECIFIED" : 0;
|
2382 | object.recordingDeviceType = options.enums === String ? "RECORDING_DEVICE_TYPE_UNSPECIFIED" : 0;
|
2383 | object.recordingDeviceName = "";
|
2384 | object.originalMimeType = "";
|
2385 | object.audioTopic = "";
|
2386 | }
|
2387 | if (message.interactionType != null && message.hasOwnProperty("interactionType"))
|
2388 | object.interactionType = options.enums === String ? $root.google.cloud.speech.v1.RecognitionMetadata.InteractionType[message.interactionType] : message.interactionType;
|
2389 | if (message.industryNaicsCodeOfAudio != null && message.hasOwnProperty("industryNaicsCodeOfAudio"))
|
2390 | object.industryNaicsCodeOfAudio = message.industryNaicsCodeOfAudio;
|
2391 | if (message.microphoneDistance != null && message.hasOwnProperty("microphoneDistance"))
|
2392 | object.microphoneDistance = options.enums === String ? $root.google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance[message.microphoneDistance] : message.microphoneDistance;
|
2393 | if (message.originalMediaType != null && message.hasOwnProperty("originalMediaType"))
|
2394 | object.originalMediaType = options.enums === String ? $root.google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType[message.originalMediaType] : message.originalMediaType;
|
2395 | if (message.recordingDeviceType != null && message.hasOwnProperty("recordingDeviceType"))
|
2396 | object.recordingDeviceType = options.enums === String ? $root.google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType[message.recordingDeviceType] : message.recordingDeviceType;
|
2397 | if (message.recordingDeviceName != null && message.hasOwnProperty("recordingDeviceName"))
|
2398 | object.recordingDeviceName = message.recordingDeviceName;
|
2399 | if (message.originalMimeType != null && message.hasOwnProperty("originalMimeType"))
|
2400 | object.originalMimeType = message.originalMimeType;
|
2401 | if (message.audioTopic != null && message.hasOwnProperty("audioTopic"))
|
2402 | object.audioTopic = message.audioTopic;
|
2403 | return object;
|
2404 | };
|
2405 |
|
2406 | /**
|
2407 | * Converts this RecognitionMetadata to JSON.
|
2408 | * @function toJSON
|
2409 | * @memberof google.cloud.speech.v1.RecognitionMetadata
|
2410 | * @instance
|
2411 | * @returns {Object.<string,*>} JSON object
|
2412 | */
|
2413 | RecognitionMetadata.prototype.toJSON = function toJSON() {
|
2414 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
2415 | };
|
2416 |
|
2417 | /**
|
2418 | * InteractionType enum.
|
2419 | * @name google.cloud.speech.v1.RecognitionMetadata.InteractionType
|
2420 | * @enum {number}
|
2421 | * @property {number} INTERACTION_TYPE_UNSPECIFIED=0 INTERACTION_TYPE_UNSPECIFIED value
|
2422 | * @property {number} DISCUSSION=1 DISCUSSION value
|
2423 | * @property {number} PRESENTATION=2 PRESENTATION value
|
2424 | * @property {number} PHONE_CALL=3 PHONE_CALL value
|
2425 | * @property {number} VOICEMAIL=4 VOICEMAIL value
|
2426 | * @property {number} PROFESSIONALLY_PRODUCED=5 PROFESSIONALLY_PRODUCED value
|
2427 | * @property {number} VOICE_SEARCH=6 VOICE_SEARCH value
|
2428 | * @property {number} VOICE_COMMAND=7 VOICE_COMMAND value
|
2429 | * @property {number} DICTATION=8 DICTATION value
|
2430 | */
|
2431 | RecognitionMetadata.InteractionType = (function() {
|
2432 | var valuesById = {}, values = Object.create(valuesById);
|
2433 | values[valuesById[0] = "INTERACTION_TYPE_UNSPECIFIED"] = 0;
|
2434 | values[valuesById[1] = "DISCUSSION"] = 1;
|
2435 | values[valuesById[2] = "PRESENTATION"] = 2;
|
2436 | values[valuesById[3] = "PHONE_CALL"] = 3;
|
2437 | values[valuesById[4] = "VOICEMAIL"] = 4;
|
2438 | values[valuesById[5] = "PROFESSIONALLY_PRODUCED"] = 5;
|
2439 | values[valuesById[6] = "VOICE_SEARCH"] = 6;
|
2440 | values[valuesById[7] = "VOICE_COMMAND"] = 7;
|
2441 | values[valuesById[8] = "DICTATION"] = 8;
|
2442 | return values;
|
2443 | })();
|
2444 |
|
2445 | /**
|
2446 | * MicrophoneDistance enum.
|
2447 | * @name google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance
|
2448 | * @enum {number}
|
2449 | * @property {number} MICROPHONE_DISTANCE_UNSPECIFIED=0 MICROPHONE_DISTANCE_UNSPECIFIED value
|
2450 | * @property {number} NEARFIELD=1 NEARFIELD value
|
2451 | * @property {number} MIDFIELD=2 MIDFIELD value
|
2452 | * @property {number} FARFIELD=3 FARFIELD value
|
2453 | */
|
2454 | RecognitionMetadata.MicrophoneDistance = (function() {
|
2455 | var valuesById = {}, values = Object.create(valuesById);
|
2456 | values[valuesById[0] = "MICROPHONE_DISTANCE_UNSPECIFIED"] = 0;
|
2457 | values[valuesById[1] = "NEARFIELD"] = 1;
|
2458 | values[valuesById[2] = "MIDFIELD"] = 2;
|
2459 | values[valuesById[3] = "FARFIELD"] = 3;
|
2460 | return values;
|
2461 | })();
|
2462 |
|
2463 | /**
|
2464 | * OriginalMediaType enum.
|
2465 | * @name google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType
|
2466 | * @enum {number}
|
2467 | * @property {number} ORIGINAL_MEDIA_TYPE_UNSPECIFIED=0 ORIGINAL_MEDIA_TYPE_UNSPECIFIED value
|
2468 | * @property {number} AUDIO=1 AUDIO value
|
2469 | * @property {number} VIDEO=2 VIDEO value
|
2470 | */
|
2471 | RecognitionMetadata.OriginalMediaType = (function() {
|
2472 | var valuesById = {}, values = Object.create(valuesById);
|
2473 | values[valuesById[0] = "ORIGINAL_MEDIA_TYPE_UNSPECIFIED"] = 0;
|
2474 | values[valuesById[1] = "AUDIO"] = 1;
|
2475 | values[valuesById[2] = "VIDEO"] = 2;
|
2476 | return values;
|
2477 | })();
|
2478 |
|
2479 | /**
|
2480 | * RecordingDeviceType enum.
|
2481 | * @name google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType
|
2482 | * @enum {number}
|
2483 | * @property {number} RECORDING_DEVICE_TYPE_UNSPECIFIED=0 RECORDING_DEVICE_TYPE_UNSPECIFIED value
|
2484 | * @property {number} SMARTPHONE=1 SMARTPHONE value
|
2485 | * @property {number} PC=2 PC value
|
2486 | * @property {number} PHONE_LINE=3 PHONE_LINE value
|
2487 | * @property {number} VEHICLE=4 VEHICLE value
|
2488 | * @property {number} OTHER_OUTDOOR_DEVICE=5 OTHER_OUTDOOR_DEVICE value
|
2489 | * @property {number} OTHER_INDOOR_DEVICE=6 OTHER_INDOOR_DEVICE value
|
2490 | */
|
2491 | RecognitionMetadata.RecordingDeviceType = (function() {
|
2492 | var valuesById = {}, values = Object.create(valuesById);
|
2493 | values[valuesById[0] = "RECORDING_DEVICE_TYPE_UNSPECIFIED"] = 0;
|
2494 | values[valuesById[1] = "SMARTPHONE"] = 1;
|
2495 | values[valuesById[2] = "PC"] = 2;
|
2496 | values[valuesById[3] = "PHONE_LINE"] = 3;
|
2497 | values[valuesById[4] = "VEHICLE"] = 4;
|
2498 | values[valuesById[5] = "OTHER_OUTDOOR_DEVICE"] = 5;
|
2499 | values[valuesById[6] = "OTHER_INDOOR_DEVICE"] = 6;
|
2500 | return values;
|
2501 | })();
|
2502 |
|
2503 | return RecognitionMetadata;
|
2504 | })();
|
2505 |
|
2506 | v1.SpeechContext = (function() {
|
2507 |
|
2508 | /**
|
2509 | * Properties of a SpeechContext.
|
2510 | * @memberof google.cloud.speech.v1
|
2511 | * @interface ISpeechContext
|
2512 | * @property {Array.<string>|null} [phrases] SpeechContext phrases
|
2513 | */
|
2514 |
|
2515 | /**
|
2516 | * Constructs a new SpeechContext.
|
2517 | * @memberof google.cloud.speech.v1
|
2518 | * @classdesc Represents a SpeechContext.
|
2519 | * @implements ISpeechContext
|
2520 | * @constructor
|
2521 | * @param {google.cloud.speech.v1.ISpeechContext=} [properties] Properties to set
|
2522 | */
|
2523 | function SpeechContext(properties) {
|
2524 | this.phrases = [];
|
2525 | if (properties)
|
2526 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
2527 | if (properties[keys[i]] != null)
|
2528 | this[keys[i]] = properties[keys[i]];
|
2529 | }
|
2530 |
|
2531 | /**
|
2532 | * SpeechContext phrases.
|
2533 | * @member {Array.<string>} phrases
|
2534 | * @memberof google.cloud.speech.v1.SpeechContext
|
2535 | * @instance
|
2536 | */
|
2537 | SpeechContext.prototype.phrases = $util.emptyArray;
|
2538 |
|
2539 | /**
|
2540 | * Creates a new SpeechContext instance using the specified properties.
|
2541 | * @function create
|
2542 | * @memberof google.cloud.speech.v1.SpeechContext
|
2543 | * @static
|
2544 | * @param {google.cloud.speech.v1.ISpeechContext=} [properties] Properties to set
|
2545 | * @returns {google.cloud.speech.v1.SpeechContext} SpeechContext instance
|
2546 | */
|
2547 | SpeechContext.create = function create(properties) {
|
2548 | return new SpeechContext(properties);
|
2549 | };
|
2550 |
|
2551 | /**
|
2552 | * Encodes the specified SpeechContext message. Does not implicitly {@link google.cloud.speech.v1.SpeechContext.verify|verify} messages.
|
2553 | * @function encode
|
2554 | * @memberof google.cloud.speech.v1.SpeechContext
|
2555 | * @static
|
2556 | * @param {google.cloud.speech.v1.ISpeechContext} message SpeechContext message or plain object to encode
|
2557 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
2558 | * @returns {$protobuf.Writer} Writer
|
2559 | */
|
2560 | SpeechContext.encode = function encode(message, writer) {
|
2561 | if (!writer)
|
2562 | writer = $Writer.create();
|
2563 | if (message.phrases != null && message.phrases.length)
|
2564 | for (var i = 0; i < message.phrases.length; ++i)
|
2565 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.phrases[i]);
|
2566 | return writer;
|
2567 | };
|
2568 |
|
2569 | /**
|
2570 | * Encodes the specified SpeechContext message, length delimited. Does not implicitly {@link google.cloud.speech.v1.SpeechContext.verify|verify} messages.
|
2571 | * @function encodeDelimited
|
2572 | * @memberof google.cloud.speech.v1.SpeechContext
|
2573 | * @static
|
2574 | * @param {google.cloud.speech.v1.ISpeechContext} message SpeechContext message or plain object to encode
|
2575 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
2576 | * @returns {$protobuf.Writer} Writer
|
2577 | */
|
2578 | SpeechContext.encodeDelimited = function encodeDelimited(message, writer) {
|
2579 | return this.encode(message, writer).ldelim();
|
2580 | };
|
2581 |
|
2582 | /**
|
2583 | * Decodes a SpeechContext message from the specified reader or buffer.
|
2584 | * @function decode
|
2585 | * @memberof google.cloud.speech.v1.SpeechContext
|
2586 | * @static
|
2587 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
2588 | * @param {number} [length] Message length if known beforehand
|
2589 | * @returns {google.cloud.speech.v1.SpeechContext} SpeechContext
|
2590 | * @throws {Error} If the payload is not a reader or valid buffer
|
2591 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
2592 | */
|
2593 | SpeechContext.decode = function decode(reader, length) {
|
2594 | if (!(reader instanceof $Reader))
|
2595 | reader = $Reader.create(reader);
|
2596 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.SpeechContext();
|
2597 | while (reader.pos < end) {
|
2598 | var tag = reader.uint32();
|
2599 | switch (tag >>> 3) {
|
2600 | case 1:
|
2601 | if (!(message.phrases && message.phrases.length))
|
2602 | message.phrases = [];
|
2603 | message.phrases.push(reader.string());
|
2604 | break;
|
2605 | default:
|
2606 | reader.skipType(tag & 7);
|
2607 | break;
|
2608 | }
|
2609 | }
|
2610 | return message;
|
2611 | };
|
2612 |
|
2613 | /**
|
2614 | * Decodes a SpeechContext message from the specified reader or buffer, length delimited.
|
2615 | * @function decodeDelimited
|
2616 | * @memberof google.cloud.speech.v1.SpeechContext
|
2617 | * @static
|
2618 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
2619 | * @returns {google.cloud.speech.v1.SpeechContext} SpeechContext
|
2620 | * @throws {Error} If the payload is not a reader or valid buffer
|
2621 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
2622 | */
|
2623 | SpeechContext.decodeDelimited = function decodeDelimited(reader) {
|
2624 | if (!(reader instanceof $Reader))
|
2625 | reader = new $Reader(reader);
|
2626 | return this.decode(reader, reader.uint32());
|
2627 | };
|
2628 |
|
2629 | /**
|
2630 | * Verifies a SpeechContext message.
|
2631 | * @function verify
|
2632 | * @memberof google.cloud.speech.v1.SpeechContext
|
2633 | * @static
|
2634 | * @param {Object.<string,*>} message Plain object to verify
|
2635 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
2636 | */
|
2637 | SpeechContext.verify = function verify(message) {
|
2638 | if (typeof message !== "object" || message === null)
|
2639 | return "object expected";
|
2640 | if (message.phrases != null && message.hasOwnProperty("phrases")) {
|
2641 | if (!Array.isArray(message.phrases))
|
2642 | return "phrases: array expected";
|
2643 | for (var i = 0; i < message.phrases.length; ++i)
|
2644 | if (!$util.isString(message.phrases[i]))
|
2645 | return "phrases: string[] expected";
|
2646 | }
|
2647 | return null;
|
2648 | };
|
2649 |
|
2650 | /**
|
2651 | * Creates a SpeechContext message from a plain object. Also converts values to their respective internal types.
|
2652 | * @function fromObject
|
2653 | * @memberof google.cloud.speech.v1.SpeechContext
|
2654 | * @static
|
2655 | * @param {Object.<string,*>} object Plain object
|
2656 | * @returns {google.cloud.speech.v1.SpeechContext} SpeechContext
|
2657 | */
|
2658 | SpeechContext.fromObject = function fromObject(object) {
|
2659 | if (object instanceof $root.google.cloud.speech.v1.SpeechContext)
|
2660 | return object;
|
2661 | var message = new $root.google.cloud.speech.v1.SpeechContext();
|
2662 | if (object.phrases) {
|
2663 | if (!Array.isArray(object.phrases))
|
2664 | throw TypeError(".google.cloud.speech.v1.SpeechContext.phrases: array expected");
|
2665 | message.phrases = [];
|
2666 | for (var i = 0; i < object.phrases.length; ++i)
|
2667 | message.phrases[i] = String(object.phrases[i]);
|
2668 | }
|
2669 | return message;
|
2670 | };
|
2671 |
|
2672 | /**
|
2673 | * Creates a plain object from a SpeechContext message. Also converts values to other types if specified.
|
2674 | * @function toObject
|
2675 | * @memberof google.cloud.speech.v1.SpeechContext
|
2676 | * @static
|
2677 | * @param {google.cloud.speech.v1.SpeechContext} message SpeechContext
|
2678 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
2679 | * @returns {Object.<string,*>} Plain object
|
2680 | */
|
2681 | SpeechContext.toObject = function toObject(message, options) {
|
2682 | if (!options)
|
2683 | options = {};
|
2684 | var object = {};
|
2685 | if (options.arrays || options.defaults)
|
2686 | object.phrases = [];
|
2687 | if (message.phrases && message.phrases.length) {
|
2688 | object.phrases = [];
|
2689 | for (var j = 0; j < message.phrases.length; ++j)
|
2690 | object.phrases[j] = message.phrases[j];
|
2691 | }
|
2692 | return object;
|
2693 | };
|
2694 |
|
2695 | /**
|
2696 | * Converts this SpeechContext to JSON.
|
2697 | * @function toJSON
|
2698 | * @memberof google.cloud.speech.v1.SpeechContext
|
2699 | * @instance
|
2700 | * @returns {Object.<string,*>} JSON object
|
2701 | */
|
2702 | SpeechContext.prototype.toJSON = function toJSON() {
|
2703 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
2704 | };
|
2705 |
|
2706 | return SpeechContext;
|
2707 | })();
|
2708 |
|
2709 | v1.RecognitionAudio = (function() {
|
2710 |
|
2711 | /**
|
2712 | * Properties of a RecognitionAudio.
|
2713 | * @memberof google.cloud.speech.v1
|
2714 | * @interface IRecognitionAudio
|
2715 | * @property {Uint8Array|null} [content] RecognitionAudio content
|
2716 | * @property {string|null} [uri] RecognitionAudio uri
|
2717 | */
|
2718 |
|
2719 | /**
|
2720 | * Constructs a new RecognitionAudio.
|
2721 | * @memberof google.cloud.speech.v1
|
2722 | * @classdesc Represents a RecognitionAudio.
|
2723 | * @implements IRecognitionAudio
|
2724 | * @constructor
|
2725 | * @param {google.cloud.speech.v1.IRecognitionAudio=} [properties] Properties to set
|
2726 | */
|
2727 | function RecognitionAudio(properties) {
|
2728 | if (properties)
|
2729 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
2730 | if (properties[keys[i]] != null)
|
2731 | this[keys[i]] = properties[keys[i]];
|
2732 | }
|
2733 |
|
2734 | /**
|
2735 | * RecognitionAudio content.
|
2736 | * @member {Uint8Array|null|undefined} content
|
2737 | * @memberof google.cloud.speech.v1.RecognitionAudio
|
2738 | * @instance
|
2739 | */
|
2740 | RecognitionAudio.prototype.content = null;
|
2741 |
|
2742 | /**
|
2743 | * RecognitionAudio uri.
|
2744 | * @member {string|null|undefined} uri
|
2745 | * @memberof google.cloud.speech.v1.RecognitionAudio
|
2746 | * @instance
|
2747 | */
|
2748 | RecognitionAudio.prototype.uri = null;
|
2749 |
|
2750 | // OneOf field names bound to virtual getters and setters
|
2751 | var $oneOfFields;
|
2752 |
|
2753 | /**
|
2754 | * RecognitionAudio audioSource.
|
2755 | * @member {"content"|"uri"|undefined} audioSource
|
2756 | * @memberof google.cloud.speech.v1.RecognitionAudio
|
2757 | * @instance
|
2758 | */
|
2759 | Object.defineProperty(RecognitionAudio.prototype, "audioSource", {
|
2760 | get: $util.oneOfGetter($oneOfFields = ["content", "uri"]),
|
2761 | set: $util.oneOfSetter($oneOfFields)
|
2762 | });
|
2763 |
|
2764 | /**
|
2765 | * Creates a new RecognitionAudio instance using the specified properties.
|
2766 | * @function create
|
2767 | * @memberof google.cloud.speech.v1.RecognitionAudio
|
2768 | * @static
|
2769 | * @param {google.cloud.speech.v1.IRecognitionAudio=} [properties] Properties to set
|
2770 | * @returns {google.cloud.speech.v1.RecognitionAudio} RecognitionAudio instance
|
2771 | */
|
2772 | RecognitionAudio.create = function create(properties) {
|
2773 | return new RecognitionAudio(properties);
|
2774 | };
|
2775 |
|
2776 | /**
|
2777 | * Encodes the specified RecognitionAudio message. Does not implicitly {@link google.cloud.speech.v1.RecognitionAudio.verify|verify} messages.
|
2778 | * @function encode
|
2779 | * @memberof google.cloud.speech.v1.RecognitionAudio
|
2780 | * @static
|
2781 | * @param {google.cloud.speech.v1.IRecognitionAudio} message RecognitionAudio message or plain object to encode
|
2782 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
2783 | * @returns {$protobuf.Writer} Writer
|
2784 | */
|
2785 | RecognitionAudio.encode = function encode(message, writer) {
|
2786 | if (!writer)
|
2787 | writer = $Writer.create();
|
2788 | if (message.content != null && Object.hasOwnProperty.call(message, "content"))
|
2789 | writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.content);
|
2790 | if (message.uri != null && Object.hasOwnProperty.call(message, "uri"))
|
2791 | writer.uint32(/* id 2, wireType 2 =*/18).string(message.uri);
|
2792 | return writer;
|
2793 | };
|
2794 |
|
2795 | /**
|
2796 | * Encodes the specified RecognitionAudio message, length delimited. Does not implicitly {@link google.cloud.speech.v1.RecognitionAudio.verify|verify} messages.
|
2797 | * @function encodeDelimited
|
2798 | * @memberof google.cloud.speech.v1.RecognitionAudio
|
2799 | * @static
|
2800 | * @param {google.cloud.speech.v1.IRecognitionAudio} message RecognitionAudio message or plain object to encode
|
2801 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
2802 | * @returns {$protobuf.Writer} Writer
|
2803 | */
|
2804 | RecognitionAudio.encodeDelimited = function encodeDelimited(message, writer) {
|
2805 | return this.encode(message, writer).ldelim();
|
2806 | };
|
2807 |
|
2808 | /**
|
2809 | * Decodes a RecognitionAudio message from the specified reader or buffer.
|
2810 | * @function decode
|
2811 | * @memberof google.cloud.speech.v1.RecognitionAudio
|
2812 | * @static
|
2813 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
2814 | * @param {number} [length] Message length if known beforehand
|
2815 | * @returns {google.cloud.speech.v1.RecognitionAudio} RecognitionAudio
|
2816 | * @throws {Error} If the payload is not a reader or valid buffer
|
2817 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
2818 | */
|
2819 | RecognitionAudio.decode = function decode(reader, length) {
|
2820 | if (!(reader instanceof $Reader))
|
2821 | reader = $Reader.create(reader);
|
2822 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.RecognitionAudio();
|
2823 | while (reader.pos < end) {
|
2824 | var tag = reader.uint32();
|
2825 | switch (tag >>> 3) {
|
2826 | case 1:
|
2827 | message.content = reader.bytes();
|
2828 | break;
|
2829 | case 2:
|
2830 | message.uri = reader.string();
|
2831 | break;
|
2832 | default:
|
2833 | reader.skipType(tag & 7);
|
2834 | break;
|
2835 | }
|
2836 | }
|
2837 | return message;
|
2838 | };
|
2839 |
|
2840 | /**
|
2841 | * Decodes a RecognitionAudio message from the specified reader or buffer, length delimited.
|
2842 | * @function decodeDelimited
|
2843 | * @memberof google.cloud.speech.v1.RecognitionAudio
|
2844 | * @static
|
2845 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
2846 | * @returns {google.cloud.speech.v1.RecognitionAudio} RecognitionAudio
|
2847 | * @throws {Error} If the payload is not a reader or valid buffer
|
2848 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
2849 | */
|
2850 | RecognitionAudio.decodeDelimited = function decodeDelimited(reader) {
|
2851 | if (!(reader instanceof $Reader))
|
2852 | reader = new $Reader(reader);
|
2853 | return this.decode(reader, reader.uint32());
|
2854 | };
|
2855 |
|
2856 | /**
|
2857 | * Verifies a RecognitionAudio message.
|
2858 | * @function verify
|
2859 | * @memberof google.cloud.speech.v1.RecognitionAudio
|
2860 | * @static
|
2861 | * @param {Object.<string,*>} message Plain object to verify
|
2862 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
2863 | */
|
2864 | RecognitionAudio.verify = function verify(message) {
|
2865 | if (typeof message !== "object" || message === null)
|
2866 | return "object expected";
|
2867 | var properties = {};
|
2868 | if (message.content != null && message.hasOwnProperty("content")) {
|
2869 | properties.audioSource = 1;
|
2870 | if (!(message.content && typeof message.content.length === "number" || $util.isString(message.content)))
|
2871 | return "content: buffer expected";
|
2872 | }
|
2873 | if (message.uri != null && message.hasOwnProperty("uri")) {
|
2874 | if (properties.audioSource === 1)
|
2875 | return "audioSource: multiple values";
|
2876 | properties.audioSource = 1;
|
2877 | if (!$util.isString(message.uri))
|
2878 | return "uri: string expected";
|
2879 | }
|
2880 | return null;
|
2881 | };
|
2882 |
|
2883 | /**
|
2884 | * Creates a RecognitionAudio message from a plain object. Also converts values to their respective internal types.
|
2885 | * @function fromObject
|
2886 | * @memberof google.cloud.speech.v1.RecognitionAudio
|
2887 | * @static
|
2888 | * @param {Object.<string,*>} object Plain object
|
2889 | * @returns {google.cloud.speech.v1.RecognitionAudio} RecognitionAudio
|
2890 | */
|
2891 | RecognitionAudio.fromObject = function fromObject(object) {
|
2892 | if (object instanceof $root.google.cloud.speech.v1.RecognitionAudio)
|
2893 | return object;
|
2894 | var message = new $root.google.cloud.speech.v1.RecognitionAudio();
|
2895 | if (object.content != null)
|
2896 | if (typeof object.content === "string")
|
2897 | $util.base64.decode(object.content, message.content = $util.newBuffer($util.base64.length(object.content)), 0);
|
2898 | else if (object.content.length)
|
2899 | message.content = object.content;
|
2900 | if (object.uri != null)
|
2901 | message.uri = String(object.uri);
|
2902 | return message;
|
2903 | };
|
2904 |
|
2905 | /**
|
2906 | * Creates a plain object from a RecognitionAudio message. Also converts values to other types if specified.
|
2907 | * @function toObject
|
2908 | * @memberof google.cloud.speech.v1.RecognitionAudio
|
2909 | * @static
|
2910 | * @param {google.cloud.speech.v1.RecognitionAudio} message RecognitionAudio
|
2911 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
2912 | * @returns {Object.<string,*>} Plain object
|
2913 | */
|
2914 | RecognitionAudio.toObject = function toObject(message, options) {
|
2915 | if (!options)
|
2916 | options = {};
|
2917 | var object = {};
|
2918 | if (message.content != null && message.hasOwnProperty("content")) {
|
2919 | object.content = options.bytes === String ? $util.base64.encode(message.content, 0, message.content.length) : options.bytes === Array ? Array.prototype.slice.call(message.content) : message.content;
|
2920 | if (options.oneofs)
|
2921 | object.audioSource = "content";
|
2922 | }
|
2923 | if (message.uri != null && message.hasOwnProperty("uri")) {
|
2924 | object.uri = message.uri;
|
2925 | if (options.oneofs)
|
2926 | object.audioSource = "uri";
|
2927 | }
|
2928 | return object;
|
2929 | };
|
2930 |
|
2931 | /**
|
2932 | * Converts this RecognitionAudio to JSON.
|
2933 | * @function toJSON
|
2934 | * @memberof google.cloud.speech.v1.RecognitionAudio
|
2935 | * @instance
|
2936 | * @returns {Object.<string,*>} JSON object
|
2937 | */
|
2938 | RecognitionAudio.prototype.toJSON = function toJSON() {
|
2939 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
2940 | };
|
2941 |
|
2942 | return RecognitionAudio;
|
2943 | })();
|
2944 |
|
2945 | v1.RecognizeResponse = (function() {
|
2946 |
|
2947 | /**
|
2948 | * Properties of a RecognizeResponse.
|
2949 | * @memberof google.cloud.speech.v1
|
2950 | * @interface IRecognizeResponse
|
2951 | * @property {Array.<google.cloud.speech.v1.ISpeechRecognitionResult>|null} [results] RecognizeResponse results
|
2952 | */
|
2953 |
|
2954 | /**
|
2955 | * Constructs a new RecognizeResponse.
|
2956 | * @memberof google.cloud.speech.v1
|
2957 | * @classdesc Represents a RecognizeResponse.
|
2958 | * @implements IRecognizeResponse
|
2959 | * @constructor
|
2960 | * @param {google.cloud.speech.v1.IRecognizeResponse=} [properties] Properties to set
|
2961 | */
|
2962 | function RecognizeResponse(properties) {
|
2963 | this.results = [];
|
2964 | if (properties)
|
2965 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
2966 | if (properties[keys[i]] != null)
|
2967 | this[keys[i]] = properties[keys[i]];
|
2968 | }
|
2969 |
|
2970 | /**
|
2971 | * RecognizeResponse results.
|
2972 | * @member {Array.<google.cloud.speech.v1.ISpeechRecognitionResult>} results
|
2973 | * @memberof google.cloud.speech.v1.RecognizeResponse
|
2974 | * @instance
|
2975 | */
|
2976 | RecognizeResponse.prototype.results = $util.emptyArray;
|
2977 |
|
2978 | /**
|
2979 | * Creates a new RecognizeResponse instance using the specified properties.
|
2980 | * @function create
|
2981 | * @memberof google.cloud.speech.v1.RecognizeResponse
|
2982 | * @static
|
2983 | * @param {google.cloud.speech.v1.IRecognizeResponse=} [properties] Properties to set
|
2984 | * @returns {google.cloud.speech.v1.RecognizeResponse} RecognizeResponse instance
|
2985 | */
|
2986 | RecognizeResponse.create = function create(properties) {
|
2987 | return new RecognizeResponse(properties);
|
2988 | };
|
2989 |
|
2990 | /**
|
2991 | * Encodes the specified RecognizeResponse message. Does not implicitly {@link google.cloud.speech.v1.RecognizeResponse.verify|verify} messages.
|
2992 | * @function encode
|
2993 | * @memberof google.cloud.speech.v1.RecognizeResponse
|
2994 | * @static
|
2995 | * @param {google.cloud.speech.v1.IRecognizeResponse} message RecognizeResponse message or plain object to encode
|
2996 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
2997 | * @returns {$protobuf.Writer} Writer
|
2998 | */
|
2999 | RecognizeResponse.encode = function encode(message, writer) {
|
3000 | if (!writer)
|
3001 | writer = $Writer.create();
|
3002 | if (message.results != null && message.results.length)
|
3003 | for (var i = 0; i < message.results.length; ++i)
|
3004 | $root.google.cloud.speech.v1.SpeechRecognitionResult.encode(message.results[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
3005 | return writer;
|
3006 | };
|
3007 |
|
3008 | /**
|
3009 | * Encodes the specified RecognizeResponse message, length delimited. Does not implicitly {@link google.cloud.speech.v1.RecognizeResponse.verify|verify} messages.
|
3010 | * @function encodeDelimited
|
3011 | * @memberof google.cloud.speech.v1.RecognizeResponse
|
3012 | * @static
|
3013 | * @param {google.cloud.speech.v1.IRecognizeResponse} message RecognizeResponse message or plain object to encode
|
3014 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
3015 | * @returns {$protobuf.Writer} Writer
|
3016 | */
|
3017 | RecognizeResponse.encodeDelimited = function encodeDelimited(message, writer) {
|
3018 | return this.encode(message, writer).ldelim();
|
3019 | };
|
3020 |
|
3021 | /**
|
3022 | * Decodes a RecognizeResponse message from the specified reader or buffer.
|
3023 | * @function decode
|
3024 | * @memberof google.cloud.speech.v1.RecognizeResponse
|
3025 | * @static
|
3026 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
3027 | * @param {number} [length] Message length if known beforehand
|
3028 | * @returns {google.cloud.speech.v1.RecognizeResponse} RecognizeResponse
|
3029 | * @throws {Error} If the payload is not a reader or valid buffer
|
3030 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
3031 | */
|
3032 | RecognizeResponse.decode = function decode(reader, length) {
|
3033 | if (!(reader instanceof $Reader))
|
3034 | reader = $Reader.create(reader);
|
3035 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.RecognizeResponse();
|
3036 | while (reader.pos < end) {
|
3037 | var tag = reader.uint32();
|
3038 | switch (tag >>> 3) {
|
3039 | case 2:
|
3040 | if (!(message.results && message.results.length))
|
3041 | message.results = [];
|
3042 | message.results.push($root.google.cloud.speech.v1.SpeechRecognitionResult.decode(reader, reader.uint32()));
|
3043 | break;
|
3044 | default:
|
3045 | reader.skipType(tag & 7);
|
3046 | break;
|
3047 | }
|
3048 | }
|
3049 | return message;
|
3050 | };
|
3051 |
|
3052 | /**
|
3053 | * Decodes a RecognizeResponse message from the specified reader or buffer, length delimited.
|
3054 | * @function decodeDelimited
|
3055 | * @memberof google.cloud.speech.v1.RecognizeResponse
|
3056 | * @static
|
3057 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
3058 | * @returns {google.cloud.speech.v1.RecognizeResponse} RecognizeResponse
|
3059 | * @throws {Error} If the payload is not a reader or valid buffer
|
3060 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
3061 | */
|
3062 | RecognizeResponse.decodeDelimited = function decodeDelimited(reader) {
|
3063 | if (!(reader instanceof $Reader))
|
3064 | reader = new $Reader(reader);
|
3065 | return this.decode(reader, reader.uint32());
|
3066 | };
|
3067 |
|
3068 | /**
|
3069 | * Verifies a RecognizeResponse message.
|
3070 | * @function verify
|
3071 | * @memberof google.cloud.speech.v1.RecognizeResponse
|
3072 | * @static
|
3073 | * @param {Object.<string,*>} message Plain object to verify
|
3074 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
3075 | */
|
3076 | RecognizeResponse.verify = function verify(message) {
|
3077 | if (typeof message !== "object" || message === null)
|
3078 | return "object expected";
|
3079 | if (message.results != null && message.hasOwnProperty("results")) {
|
3080 | if (!Array.isArray(message.results))
|
3081 | return "results: array expected";
|
3082 | for (var i = 0; i < message.results.length; ++i) {
|
3083 | var error = $root.google.cloud.speech.v1.SpeechRecognitionResult.verify(message.results[i]);
|
3084 | if (error)
|
3085 | return "results." + error;
|
3086 | }
|
3087 | }
|
3088 | return null;
|
3089 | };
|
3090 |
|
3091 | /**
|
3092 | * Creates a RecognizeResponse message from a plain object. Also converts values to their respective internal types.
|
3093 | * @function fromObject
|
3094 | * @memberof google.cloud.speech.v1.RecognizeResponse
|
3095 | * @static
|
3096 | * @param {Object.<string,*>} object Plain object
|
3097 | * @returns {google.cloud.speech.v1.RecognizeResponse} RecognizeResponse
|
3098 | */
|
3099 | RecognizeResponse.fromObject = function fromObject(object) {
|
3100 | if (object instanceof $root.google.cloud.speech.v1.RecognizeResponse)
|
3101 | return object;
|
3102 | var message = new $root.google.cloud.speech.v1.RecognizeResponse();
|
3103 | if (object.results) {
|
3104 | if (!Array.isArray(object.results))
|
3105 | throw TypeError(".google.cloud.speech.v1.RecognizeResponse.results: array expected");
|
3106 | message.results = [];
|
3107 | for (var i = 0; i < object.results.length; ++i) {
|
3108 | if (typeof object.results[i] !== "object")
|
3109 | throw TypeError(".google.cloud.speech.v1.RecognizeResponse.results: object expected");
|
3110 | message.results[i] = $root.google.cloud.speech.v1.SpeechRecognitionResult.fromObject(object.results[i]);
|
3111 | }
|
3112 | }
|
3113 | return message;
|
3114 | };
|
3115 |
|
3116 | /**
|
3117 | * Creates a plain object from a RecognizeResponse message. Also converts values to other types if specified.
|
3118 | * @function toObject
|
3119 | * @memberof google.cloud.speech.v1.RecognizeResponse
|
3120 | * @static
|
3121 | * @param {google.cloud.speech.v1.RecognizeResponse} message RecognizeResponse
|
3122 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
3123 | * @returns {Object.<string,*>} Plain object
|
3124 | */
|
3125 | RecognizeResponse.toObject = function toObject(message, options) {
|
3126 | if (!options)
|
3127 | options = {};
|
3128 | var object = {};
|
3129 | if (options.arrays || options.defaults)
|
3130 | object.results = [];
|
3131 | if (message.results && message.results.length) {
|
3132 | object.results = [];
|
3133 | for (var j = 0; j < message.results.length; ++j)
|
3134 | object.results[j] = $root.google.cloud.speech.v1.SpeechRecognitionResult.toObject(message.results[j], options);
|
3135 | }
|
3136 | return object;
|
3137 | };
|
3138 |
|
3139 | /**
|
3140 | * Converts this RecognizeResponse to JSON.
|
3141 | * @function toJSON
|
3142 | * @memberof google.cloud.speech.v1.RecognizeResponse
|
3143 | * @instance
|
3144 | * @returns {Object.<string,*>} JSON object
|
3145 | */
|
3146 | RecognizeResponse.prototype.toJSON = function toJSON() {
|
3147 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
3148 | };
|
3149 |
|
3150 | return RecognizeResponse;
|
3151 | })();
|
3152 |
|
3153 | v1.LongRunningRecognizeResponse = (function() {
|
3154 |
|
3155 | /**
|
3156 | * Properties of a LongRunningRecognizeResponse.
|
3157 | * @memberof google.cloud.speech.v1
|
3158 | * @interface ILongRunningRecognizeResponse
|
3159 | * @property {Array.<google.cloud.speech.v1.ISpeechRecognitionResult>|null} [results] LongRunningRecognizeResponse results
|
3160 | */
|
3161 |
|
3162 | /**
|
3163 | * Constructs a new LongRunningRecognizeResponse.
|
3164 | * @memberof google.cloud.speech.v1
|
3165 | * @classdesc Represents a LongRunningRecognizeResponse.
|
3166 | * @implements ILongRunningRecognizeResponse
|
3167 | * @constructor
|
3168 | * @param {google.cloud.speech.v1.ILongRunningRecognizeResponse=} [properties] Properties to set
|
3169 | */
|
3170 | function LongRunningRecognizeResponse(properties) {
|
3171 | this.results = [];
|
3172 | if (properties)
|
3173 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
3174 | if (properties[keys[i]] != null)
|
3175 | this[keys[i]] = properties[keys[i]];
|
3176 | }
|
3177 |
|
3178 | /**
|
3179 | * LongRunningRecognizeResponse results.
|
3180 | * @member {Array.<google.cloud.speech.v1.ISpeechRecognitionResult>} results
|
3181 | * @memberof google.cloud.speech.v1.LongRunningRecognizeResponse
|
3182 | * @instance
|
3183 | */
|
3184 | LongRunningRecognizeResponse.prototype.results = $util.emptyArray;
|
3185 |
|
3186 | /**
|
3187 | * Creates a new LongRunningRecognizeResponse instance using the specified properties.
|
3188 | * @function create
|
3189 | * @memberof google.cloud.speech.v1.LongRunningRecognizeResponse
|
3190 | * @static
|
3191 | * @param {google.cloud.speech.v1.ILongRunningRecognizeResponse=} [properties] Properties to set
|
3192 | * @returns {google.cloud.speech.v1.LongRunningRecognizeResponse} LongRunningRecognizeResponse instance
|
3193 | */
|
3194 | LongRunningRecognizeResponse.create = function create(properties) {
|
3195 | return new LongRunningRecognizeResponse(properties);
|
3196 | };
|
3197 |
|
3198 | /**
|
3199 | * Encodes the specified LongRunningRecognizeResponse message. Does not implicitly {@link google.cloud.speech.v1.LongRunningRecognizeResponse.verify|verify} messages.
|
3200 | * @function encode
|
3201 | * @memberof google.cloud.speech.v1.LongRunningRecognizeResponse
|
3202 | * @static
|
3203 | * @param {google.cloud.speech.v1.ILongRunningRecognizeResponse} message LongRunningRecognizeResponse message or plain object to encode
|
3204 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
3205 | * @returns {$protobuf.Writer} Writer
|
3206 | */
|
3207 | LongRunningRecognizeResponse.encode = function encode(message, writer) {
|
3208 | if (!writer)
|
3209 | writer = $Writer.create();
|
3210 | if (message.results != null && message.results.length)
|
3211 | for (var i = 0; i < message.results.length; ++i)
|
3212 | $root.google.cloud.speech.v1.SpeechRecognitionResult.encode(message.results[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
3213 | return writer;
|
3214 | };
|
3215 |
|
3216 | /**
|
3217 | * Encodes the specified LongRunningRecognizeResponse message, length delimited. Does not implicitly {@link google.cloud.speech.v1.LongRunningRecognizeResponse.verify|verify} messages.
|
3218 | * @function encodeDelimited
|
3219 | * @memberof google.cloud.speech.v1.LongRunningRecognizeResponse
|
3220 | * @static
|
3221 | * @param {google.cloud.speech.v1.ILongRunningRecognizeResponse} message LongRunningRecognizeResponse message or plain object to encode
|
3222 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
3223 | * @returns {$protobuf.Writer} Writer
|
3224 | */
|
3225 | LongRunningRecognizeResponse.encodeDelimited = function encodeDelimited(message, writer) {
|
3226 | return this.encode(message, writer).ldelim();
|
3227 | };
|
3228 |
|
3229 | /**
|
3230 | * Decodes a LongRunningRecognizeResponse message from the specified reader or buffer.
|
3231 | * @function decode
|
3232 | * @memberof google.cloud.speech.v1.LongRunningRecognizeResponse
|
3233 | * @static
|
3234 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
3235 | * @param {number} [length] Message length if known beforehand
|
3236 | * @returns {google.cloud.speech.v1.LongRunningRecognizeResponse} LongRunningRecognizeResponse
|
3237 | * @throws {Error} If the payload is not a reader or valid buffer
|
3238 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
3239 | */
|
3240 | LongRunningRecognizeResponse.decode = function decode(reader, length) {
|
3241 | if (!(reader instanceof $Reader))
|
3242 | reader = $Reader.create(reader);
|
3243 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.LongRunningRecognizeResponse();
|
3244 | while (reader.pos < end) {
|
3245 | var tag = reader.uint32();
|
3246 | switch (tag >>> 3) {
|
3247 | case 2:
|
3248 | if (!(message.results && message.results.length))
|
3249 | message.results = [];
|
3250 | message.results.push($root.google.cloud.speech.v1.SpeechRecognitionResult.decode(reader, reader.uint32()));
|
3251 | break;
|
3252 | default:
|
3253 | reader.skipType(tag & 7);
|
3254 | break;
|
3255 | }
|
3256 | }
|
3257 | return message;
|
3258 | };
|
3259 |
|
3260 | /**
|
3261 | * Decodes a LongRunningRecognizeResponse message from the specified reader or buffer, length delimited.
|
3262 | * @function decodeDelimited
|
3263 | * @memberof google.cloud.speech.v1.LongRunningRecognizeResponse
|
3264 | * @static
|
3265 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
3266 | * @returns {google.cloud.speech.v1.LongRunningRecognizeResponse} LongRunningRecognizeResponse
|
3267 | * @throws {Error} If the payload is not a reader or valid buffer
|
3268 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
3269 | */
|
3270 | LongRunningRecognizeResponse.decodeDelimited = function decodeDelimited(reader) {
|
3271 | if (!(reader instanceof $Reader))
|
3272 | reader = new $Reader(reader);
|
3273 | return this.decode(reader, reader.uint32());
|
3274 | };
|
3275 |
|
3276 | /**
|
3277 | * Verifies a LongRunningRecognizeResponse message.
|
3278 | * @function verify
|
3279 | * @memberof google.cloud.speech.v1.LongRunningRecognizeResponse
|
3280 | * @static
|
3281 | * @param {Object.<string,*>} message Plain object to verify
|
3282 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
3283 | */
|
3284 | LongRunningRecognizeResponse.verify = function verify(message) {
|
3285 | if (typeof message !== "object" || message === null)
|
3286 | return "object expected";
|
3287 | if (message.results != null && message.hasOwnProperty("results")) {
|
3288 | if (!Array.isArray(message.results))
|
3289 | return "results: array expected";
|
3290 | for (var i = 0; i < message.results.length; ++i) {
|
3291 | var error = $root.google.cloud.speech.v1.SpeechRecognitionResult.verify(message.results[i]);
|
3292 | if (error)
|
3293 | return "results." + error;
|
3294 | }
|
3295 | }
|
3296 | return null;
|
3297 | };
|
3298 |
|
3299 | /**
|
3300 | * Creates a LongRunningRecognizeResponse message from a plain object. Also converts values to their respective internal types.
|
3301 | * @function fromObject
|
3302 | * @memberof google.cloud.speech.v1.LongRunningRecognizeResponse
|
3303 | * @static
|
3304 | * @param {Object.<string,*>} object Plain object
|
3305 | * @returns {google.cloud.speech.v1.LongRunningRecognizeResponse} LongRunningRecognizeResponse
|
3306 | */
|
3307 | LongRunningRecognizeResponse.fromObject = function fromObject(object) {
|
3308 | if (object instanceof $root.google.cloud.speech.v1.LongRunningRecognizeResponse)
|
3309 | return object;
|
3310 | var message = new $root.google.cloud.speech.v1.LongRunningRecognizeResponse();
|
3311 | if (object.results) {
|
3312 | if (!Array.isArray(object.results))
|
3313 | throw TypeError(".google.cloud.speech.v1.LongRunningRecognizeResponse.results: array expected");
|
3314 | message.results = [];
|
3315 | for (var i = 0; i < object.results.length; ++i) {
|
3316 | if (typeof object.results[i] !== "object")
|
3317 | throw TypeError(".google.cloud.speech.v1.LongRunningRecognizeResponse.results: object expected");
|
3318 | message.results[i] = $root.google.cloud.speech.v1.SpeechRecognitionResult.fromObject(object.results[i]);
|
3319 | }
|
3320 | }
|
3321 | return message;
|
3322 | };
|
3323 |
|
3324 | /**
|
3325 | * Creates a plain object from a LongRunningRecognizeResponse message. Also converts values to other types if specified.
|
3326 | * @function toObject
|
3327 | * @memberof google.cloud.speech.v1.LongRunningRecognizeResponse
|
3328 | * @static
|
3329 | * @param {google.cloud.speech.v1.LongRunningRecognizeResponse} message LongRunningRecognizeResponse
|
3330 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
3331 | * @returns {Object.<string,*>} Plain object
|
3332 | */
|
3333 | LongRunningRecognizeResponse.toObject = function toObject(message, options) {
|
3334 | if (!options)
|
3335 | options = {};
|
3336 | var object = {};
|
3337 | if (options.arrays || options.defaults)
|
3338 | object.results = [];
|
3339 | if (message.results && message.results.length) {
|
3340 | object.results = [];
|
3341 | for (var j = 0; j < message.results.length; ++j)
|
3342 | object.results[j] = $root.google.cloud.speech.v1.SpeechRecognitionResult.toObject(message.results[j], options);
|
3343 | }
|
3344 | return object;
|
3345 | };
|
3346 |
|
3347 | /**
|
3348 | * Converts this LongRunningRecognizeResponse to JSON.
|
3349 | * @function toJSON
|
3350 | * @memberof google.cloud.speech.v1.LongRunningRecognizeResponse
|
3351 | * @instance
|
3352 | * @returns {Object.<string,*>} JSON object
|
3353 | */
|
3354 | LongRunningRecognizeResponse.prototype.toJSON = function toJSON() {
|
3355 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
3356 | };
|
3357 |
|
3358 | return LongRunningRecognizeResponse;
|
3359 | })();
|
3360 |
|
3361 | v1.LongRunningRecognizeMetadata = (function() {
|
3362 |
|
3363 | /**
|
3364 | * Properties of a LongRunningRecognizeMetadata.
|
3365 | * @memberof google.cloud.speech.v1
|
3366 | * @interface ILongRunningRecognizeMetadata
|
3367 | * @property {number|null} [progressPercent] LongRunningRecognizeMetadata progressPercent
|
3368 | * @property {google.protobuf.ITimestamp|null} [startTime] LongRunningRecognizeMetadata startTime
|
3369 | * @property {google.protobuf.ITimestamp|null} [lastUpdateTime] LongRunningRecognizeMetadata lastUpdateTime
|
3370 | */
|
3371 |
|
3372 | /**
|
3373 | * Constructs a new LongRunningRecognizeMetadata.
|
3374 | * @memberof google.cloud.speech.v1
|
3375 | * @classdesc Represents a LongRunningRecognizeMetadata.
|
3376 | * @implements ILongRunningRecognizeMetadata
|
3377 | * @constructor
|
3378 | * @param {google.cloud.speech.v1.ILongRunningRecognizeMetadata=} [properties] Properties to set
|
3379 | */
|
3380 | function LongRunningRecognizeMetadata(properties) {
|
3381 | if (properties)
|
3382 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
3383 | if (properties[keys[i]] != null)
|
3384 | this[keys[i]] = properties[keys[i]];
|
3385 | }
|
3386 |
|
3387 | /**
|
3388 | * LongRunningRecognizeMetadata progressPercent.
|
3389 | * @member {number} progressPercent
|
3390 | * @memberof google.cloud.speech.v1.LongRunningRecognizeMetadata
|
3391 | * @instance
|
3392 | */
|
3393 | LongRunningRecognizeMetadata.prototype.progressPercent = 0;
|
3394 |
|
3395 | /**
|
3396 | * LongRunningRecognizeMetadata startTime.
|
3397 | * @member {google.protobuf.ITimestamp|null|undefined} startTime
|
3398 | * @memberof google.cloud.speech.v1.LongRunningRecognizeMetadata
|
3399 | * @instance
|
3400 | */
|
3401 | LongRunningRecognizeMetadata.prototype.startTime = null;
|
3402 |
|
3403 | /**
|
3404 | * LongRunningRecognizeMetadata lastUpdateTime.
|
3405 | * @member {google.protobuf.ITimestamp|null|undefined} lastUpdateTime
|
3406 | * @memberof google.cloud.speech.v1.LongRunningRecognizeMetadata
|
3407 | * @instance
|
3408 | */
|
3409 | LongRunningRecognizeMetadata.prototype.lastUpdateTime = null;
|
3410 |
|
3411 | /**
|
3412 | * Creates a new LongRunningRecognizeMetadata instance using the specified properties.
|
3413 | * @function create
|
3414 | * @memberof google.cloud.speech.v1.LongRunningRecognizeMetadata
|
3415 | * @static
|
3416 | * @param {google.cloud.speech.v1.ILongRunningRecognizeMetadata=} [properties] Properties to set
|
3417 | * @returns {google.cloud.speech.v1.LongRunningRecognizeMetadata} LongRunningRecognizeMetadata instance
|
3418 | */
|
3419 | LongRunningRecognizeMetadata.create = function create(properties) {
|
3420 | return new LongRunningRecognizeMetadata(properties);
|
3421 | };
|
3422 |
|
3423 | /**
|
3424 | * Encodes the specified LongRunningRecognizeMetadata message. Does not implicitly {@link google.cloud.speech.v1.LongRunningRecognizeMetadata.verify|verify} messages.
|
3425 | * @function encode
|
3426 | * @memberof google.cloud.speech.v1.LongRunningRecognizeMetadata
|
3427 | * @static
|
3428 | * @param {google.cloud.speech.v1.ILongRunningRecognizeMetadata} message LongRunningRecognizeMetadata message or plain object to encode
|
3429 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
3430 | * @returns {$protobuf.Writer} Writer
|
3431 | */
|
3432 | LongRunningRecognizeMetadata.encode = function encode(message, writer) {
|
3433 | if (!writer)
|
3434 | writer = $Writer.create();
|
3435 | if (message.progressPercent != null && Object.hasOwnProperty.call(message, "progressPercent"))
|
3436 | writer.uint32(/* id 1, wireType 0 =*/8).int32(message.progressPercent);
|
3437 | if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime"))
|
3438 | $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
3439 | if (message.lastUpdateTime != null && Object.hasOwnProperty.call(message, "lastUpdateTime"))
|
3440 | $root.google.protobuf.Timestamp.encode(message.lastUpdateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
|
3441 | return writer;
|
3442 | };
|
3443 |
|
3444 | /**
|
3445 | * Encodes the specified LongRunningRecognizeMetadata message, length delimited. Does not implicitly {@link google.cloud.speech.v1.LongRunningRecognizeMetadata.verify|verify} messages.
|
3446 | * @function encodeDelimited
|
3447 | * @memberof google.cloud.speech.v1.LongRunningRecognizeMetadata
|
3448 | * @static
|
3449 | * @param {google.cloud.speech.v1.ILongRunningRecognizeMetadata} message LongRunningRecognizeMetadata message or plain object to encode
|
3450 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
3451 | * @returns {$protobuf.Writer} Writer
|
3452 | */
|
3453 | LongRunningRecognizeMetadata.encodeDelimited = function encodeDelimited(message, writer) {
|
3454 | return this.encode(message, writer).ldelim();
|
3455 | };
|
3456 |
|
3457 | /**
|
3458 | * Decodes a LongRunningRecognizeMetadata message from the specified reader or buffer.
|
3459 | * @function decode
|
3460 | * @memberof google.cloud.speech.v1.LongRunningRecognizeMetadata
|
3461 | * @static
|
3462 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
3463 | * @param {number} [length] Message length if known beforehand
|
3464 | * @returns {google.cloud.speech.v1.LongRunningRecognizeMetadata} LongRunningRecognizeMetadata
|
3465 | * @throws {Error} If the payload is not a reader or valid buffer
|
3466 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
3467 | */
|
3468 | LongRunningRecognizeMetadata.decode = function decode(reader, length) {
|
3469 | if (!(reader instanceof $Reader))
|
3470 | reader = $Reader.create(reader);
|
3471 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.LongRunningRecognizeMetadata();
|
3472 | while (reader.pos < end) {
|
3473 | var tag = reader.uint32();
|
3474 | switch (tag >>> 3) {
|
3475 | case 1:
|
3476 | message.progressPercent = reader.int32();
|
3477 | break;
|
3478 | case 2:
|
3479 | message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
|
3480 | break;
|
3481 | case 3:
|
3482 | message.lastUpdateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
|
3483 | break;
|
3484 | default:
|
3485 | reader.skipType(tag & 7);
|
3486 | break;
|
3487 | }
|
3488 | }
|
3489 | return message;
|
3490 | };
|
3491 |
|
3492 | /**
|
3493 | * Decodes a LongRunningRecognizeMetadata message from the specified reader or buffer, length delimited.
|
3494 | * @function decodeDelimited
|
3495 | * @memberof google.cloud.speech.v1.LongRunningRecognizeMetadata
|
3496 | * @static
|
3497 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
3498 | * @returns {google.cloud.speech.v1.LongRunningRecognizeMetadata} LongRunningRecognizeMetadata
|
3499 | * @throws {Error} If the payload is not a reader or valid buffer
|
3500 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
3501 | */
|
3502 | LongRunningRecognizeMetadata.decodeDelimited = function decodeDelimited(reader) {
|
3503 | if (!(reader instanceof $Reader))
|
3504 | reader = new $Reader(reader);
|
3505 | return this.decode(reader, reader.uint32());
|
3506 | };
|
3507 |
|
3508 | /**
|
3509 | * Verifies a LongRunningRecognizeMetadata message.
|
3510 | * @function verify
|
3511 | * @memberof google.cloud.speech.v1.LongRunningRecognizeMetadata
|
3512 | * @static
|
3513 | * @param {Object.<string,*>} message Plain object to verify
|
3514 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
3515 | */
|
3516 | LongRunningRecognizeMetadata.verify = function verify(message) {
|
3517 | if (typeof message !== "object" || message === null)
|
3518 | return "object expected";
|
3519 | if (message.progressPercent != null && message.hasOwnProperty("progressPercent"))
|
3520 | if (!$util.isInteger(message.progressPercent))
|
3521 | return "progressPercent: integer expected";
|
3522 | if (message.startTime != null && message.hasOwnProperty("startTime")) {
|
3523 | var error = $root.google.protobuf.Timestamp.verify(message.startTime);
|
3524 | if (error)
|
3525 | return "startTime." + error;
|
3526 | }
|
3527 | if (message.lastUpdateTime != null && message.hasOwnProperty("lastUpdateTime")) {
|
3528 | var error = $root.google.protobuf.Timestamp.verify(message.lastUpdateTime);
|
3529 | if (error)
|
3530 | return "lastUpdateTime." + error;
|
3531 | }
|
3532 | return null;
|
3533 | };
|
3534 |
|
3535 | /**
|
3536 | * Creates a LongRunningRecognizeMetadata message from a plain object. Also converts values to their respective internal types.
|
3537 | * @function fromObject
|
3538 | * @memberof google.cloud.speech.v1.LongRunningRecognizeMetadata
|
3539 | * @static
|
3540 | * @param {Object.<string,*>} object Plain object
|
3541 | * @returns {google.cloud.speech.v1.LongRunningRecognizeMetadata} LongRunningRecognizeMetadata
|
3542 | */
|
3543 | LongRunningRecognizeMetadata.fromObject = function fromObject(object) {
|
3544 | if (object instanceof $root.google.cloud.speech.v1.LongRunningRecognizeMetadata)
|
3545 | return object;
|
3546 | var message = new $root.google.cloud.speech.v1.LongRunningRecognizeMetadata();
|
3547 | if (object.progressPercent != null)
|
3548 | message.progressPercent = object.progressPercent | 0;
|
3549 | if (object.startTime != null) {
|
3550 | if (typeof object.startTime !== "object")
|
3551 | throw TypeError(".google.cloud.speech.v1.LongRunningRecognizeMetadata.startTime: object expected");
|
3552 | message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime);
|
3553 | }
|
3554 | if (object.lastUpdateTime != null) {
|
3555 | if (typeof object.lastUpdateTime !== "object")
|
3556 | throw TypeError(".google.cloud.speech.v1.LongRunningRecognizeMetadata.lastUpdateTime: object expected");
|
3557 | message.lastUpdateTime = $root.google.protobuf.Timestamp.fromObject(object.lastUpdateTime);
|
3558 | }
|
3559 | return message;
|
3560 | };
|
3561 |
|
3562 | /**
|
3563 | * Creates a plain object from a LongRunningRecognizeMetadata message. Also converts values to other types if specified.
|
3564 | * @function toObject
|
3565 | * @memberof google.cloud.speech.v1.LongRunningRecognizeMetadata
|
3566 | * @static
|
3567 | * @param {google.cloud.speech.v1.LongRunningRecognizeMetadata} message LongRunningRecognizeMetadata
|
3568 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
3569 | * @returns {Object.<string,*>} Plain object
|
3570 | */
|
3571 | LongRunningRecognizeMetadata.toObject = function toObject(message, options) {
|
3572 | if (!options)
|
3573 | options = {};
|
3574 | var object = {};
|
3575 | if (options.defaults) {
|
3576 | object.progressPercent = 0;
|
3577 | object.startTime = null;
|
3578 | object.lastUpdateTime = null;
|
3579 | }
|
3580 | if (message.progressPercent != null && message.hasOwnProperty("progressPercent"))
|
3581 | object.progressPercent = message.progressPercent;
|
3582 | if (message.startTime != null && message.hasOwnProperty("startTime"))
|
3583 | object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options);
|
3584 | if (message.lastUpdateTime != null && message.hasOwnProperty("lastUpdateTime"))
|
3585 | object.lastUpdateTime = $root.google.protobuf.Timestamp.toObject(message.lastUpdateTime, options);
|
3586 | return object;
|
3587 | };
|
3588 |
|
3589 | /**
|
3590 | * Converts this LongRunningRecognizeMetadata to JSON.
|
3591 | * @function toJSON
|
3592 | * @memberof google.cloud.speech.v1.LongRunningRecognizeMetadata
|
3593 | * @instance
|
3594 | * @returns {Object.<string,*>} JSON object
|
3595 | */
|
3596 | LongRunningRecognizeMetadata.prototype.toJSON = function toJSON() {
|
3597 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
3598 | };
|
3599 |
|
3600 | return LongRunningRecognizeMetadata;
|
3601 | })();
|
3602 |
|
3603 | v1.StreamingRecognizeResponse = (function() {
|
3604 |
|
3605 | /**
|
3606 | * Properties of a StreamingRecognizeResponse.
|
3607 | * @memberof google.cloud.speech.v1
|
3608 | * @interface IStreamingRecognizeResponse
|
3609 | * @property {google.rpc.IStatus|null} [error] StreamingRecognizeResponse error
|
3610 | * @property {Array.<google.cloud.speech.v1.IStreamingRecognitionResult>|null} [results] StreamingRecognizeResponse results
|
3611 | * @property {google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType|null} [speechEventType] StreamingRecognizeResponse speechEventType
|
3612 | */
|
3613 |
|
3614 | /**
|
3615 | * Constructs a new StreamingRecognizeResponse.
|
3616 | * @memberof google.cloud.speech.v1
|
3617 | * @classdesc Represents a StreamingRecognizeResponse.
|
3618 | * @implements IStreamingRecognizeResponse
|
3619 | * @constructor
|
3620 | * @param {google.cloud.speech.v1.IStreamingRecognizeResponse=} [properties] Properties to set
|
3621 | */
|
3622 | function StreamingRecognizeResponse(properties) {
|
3623 | this.results = [];
|
3624 | if (properties)
|
3625 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
3626 | if (properties[keys[i]] != null)
|
3627 | this[keys[i]] = properties[keys[i]];
|
3628 | }
|
3629 |
|
3630 | /**
|
3631 | * StreamingRecognizeResponse error.
|
3632 | * @member {google.rpc.IStatus|null|undefined} error
|
3633 | * @memberof google.cloud.speech.v1.StreamingRecognizeResponse
|
3634 | * @instance
|
3635 | */
|
3636 | StreamingRecognizeResponse.prototype.error = null;
|
3637 |
|
3638 | /**
|
3639 | * StreamingRecognizeResponse results.
|
3640 | * @member {Array.<google.cloud.speech.v1.IStreamingRecognitionResult>} results
|
3641 | * @memberof google.cloud.speech.v1.StreamingRecognizeResponse
|
3642 | * @instance
|
3643 | */
|
3644 | StreamingRecognizeResponse.prototype.results = $util.emptyArray;
|
3645 |
|
3646 | /**
|
3647 | * StreamingRecognizeResponse speechEventType.
|
3648 | * @member {google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType} speechEventType
|
3649 | * @memberof google.cloud.speech.v1.StreamingRecognizeResponse
|
3650 | * @instance
|
3651 | */
|
3652 | StreamingRecognizeResponse.prototype.speechEventType = 0;
|
3653 |
|
3654 | /**
|
3655 | * Creates a new StreamingRecognizeResponse instance using the specified properties.
|
3656 | * @function create
|
3657 | * @memberof google.cloud.speech.v1.StreamingRecognizeResponse
|
3658 | * @static
|
3659 | * @param {google.cloud.speech.v1.IStreamingRecognizeResponse=} [properties] Properties to set
|
3660 | * @returns {google.cloud.speech.v1.StreamingRecognizeResponse} StreamingRecognizeResponse instance
|
3661 | */
|
3662 | StreamingRecognizeResponse.create = function create(properties) {
|
3663 | return new StreamingRecognizeResponse(properties);
|
3664 | };
|
3665 |
|
3666 | /**
|
3667 | * Encodes the specified StreamingRecognizeResponse message. Does not implicitly {@link google.cloud.speech.v1.StreamingRecognizeResponse.verify|verify} messages.
|
3668 | * @function encode
|
3669 | * @memberof google.cloud.speech.v1.StreamingRecognizeResponse
|
3670 | * @static
|
3671 | * @param {google.cloud.speech.v1.IStreamingRecognizeResponse} message StreamingRecognizeResponse message or plain object to encode
|
3672 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
3673 | * @returns {$protobuf.Writer} Writer
|
3674 | */
|
3675 | StreamingRecognizeResponse.encode = function encode(message, writer) {
|
3676 | if (!writer)
|
3677 | writer = $Writer.create();
|
3678 | if (message.error != null && Object.hasOwnProperty.call(message, "error"))
|
3679 | $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
3680 | if (message.results != null && message.results.length)
|
3681 | for (var i = 0; i < message.results.length; ++i)
|
3682 | $root.google.cloud.speech.v1.StreamingRecognitionResult.encode(message.results[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
3683 | if (message.speechEventType != null && Object.hasOwnProperty.call(message, "speechEventType"))
|
3684 | writer.uint32(/* id 4, wireType 0 =*/32).int32(message.speechEventType);
|
3685 | return writer;
|
3686 | };
|
3687 |
|
3688 | /**
|
3689 | * Encodes the specified StreamingRecognizeResponse message, length delimited. Does not implicitly {@link google.cloud.speech.v1.StreamingRecognizeResponse.verify|verify} messages.
|
3690 | * @function encodeDelimited
|
3691 | * @memberof google.cloud.speech.v1.StreamingRecognizeResponse
|
3692 | * @static
|
3693 | * @param {google.cloud.speech.v1.IStreamingRecognizeResponse} message StreamingRecognizeResponse message or plain object to encode
|
3694 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
3695 | * @returns {$protobuf.Writer} Writer
|
3696 | */
|
3697 | StreamingRecognizeResponse.encodeDelimited = function encodeDelimited(message, writer) {
|
3698 | return this.encode(message, writer).ldelim();
|
3699 | };
|
3700 |
|
3701 | /**
|
3702 | * Decodes a StreamingRecognizeResponse message from the specified reader or buffer.
|
3703 | * @function decode
|
3704 | * @memberof google.cloud.speech.v1.StreamingRecognizeResponse
|
3705 | * @static
|
3706 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
3707 | * @param {number} [length] Message length if known beforehand
|
3708 | * @returns {google.cloud.speech.v1.StreamingRecognizeResponse} StreamingRecognizeResponse
|
3709 | * @throws {Error} If the payload is not a reader or valid buffer
|
3710 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
3711 | */
|
3712 | StreamingRecognizeResponse.decode = function decode(reader, length) {
|
3713 | if (!(reader instanceof $Reader))
|
3714 | reader = $Reader.create(reader);
|
3715 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.StreamingRecognizeResponse();
|
3716 | while (reader.pos < end) {
|
3717 | var tag = reader.uint32();
|
3718 | switch (tag >>> 3) {
|
3719 | case 1:
|
3720 | message.error = $root.google.rpc.Status.decode(reader, reader.uint32());
|
3721 | break;
|
3722 | case 2:
|
3723 | if (!(message.results && message.results.length))
|
3724 | message.results = [];
|
3725 | message.results.push($root.google.cloud.speech.v1.StreamingRecognitionResult.decode(reader, reader.uint32()));
|
3726 | break;
|
3727 | case 4:
|
3728 | message.speechEventType = reader.int32();
|
3729 | break;
|
3730 | default:
|
3731 | reader.skipType(tag & 7);
|
3732 | break;
|
3733 | }
|
3734 | }
|
3735 | return message;
|
3736 | };
|
3737 |
|
3738 | /**
|
3739 | * Decodes a StreamingRecognizeResponse message from the specified reader or buffer, length delimited.
|
3740 | * @function decodeDelimited
|
3741 | * @memberof google.cloud.speech.v1.StreamingRecognizeResponse
|
3742 | * @static
|
3743 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
3744 | * @returns {google.cloud.speech.v1.StreamingRecognizeResponse} StreamingRecognizeResponse
|
3745 | * @throws {Error} If the payload is not a reader or valid buffer
|
3746 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
3747 | */
|
3748 | StreamingRecognizeResponse.decodeDelimited = function decodeDelimited(reader) {
|
3749 | if (!(reader instanceof $Reader))
|
3750 | reader = new $Reader(reader);
|
3751 | return this.decode(reader, reader.uint32());
|
3752 | };
|
3753 |
|
3754 | /**
|
3755 | * Verifies a StreamingRecognizeResponse message.
|
3756 | * @function verify
|
3757 | * @memberof google.cloud.speech.v1.StreamingRecognizeResponse
|
3758 | * @static
|
3759 | * @param {Object.<string,*>} message Plain object to verify
|
3760 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
3761 | */
|
3762 | StreamingRecognizeResponse.verify = function verify(message) {
|
3763 | if (typeof message !== "object" || message === null)
|
3764 | return "object expected";
|
3765 | if (message.error != null && message.hasOwnProperty("error")) {
|
3766 | var error = $root.google.rpc.Status.verify(message.error);
|
3767 | if (error)
|
3768 | return "error." + error;
|
3769 | }
|
3770 | if (message.results != null && message.hasOwnProperty("results")) {
|
3771 | if (!Array.isArray(message.results))
|
3772 | return "results: array expected";
|
3773 | for (var i = 0; i < message.results.length; ++i) {
|
3774 | var error = $root.google.cloud.speech.v1.StreamingRecognitionResult.verify(message.results[i]);
|
3775 | if (error)
|
3776 | return "results." + error;
|
3777 | }
|
3778 | }
|
3779 | if (message.speechEventType != null && message.hasOwnProperty("speechEventType"))
|
3780 | switch (message.speechEventType) {
|
3781 | default:
|
3782 | return "speechEventType: enum value expected";
|
3783 | case 0:
|
3784 | case 1:
|
3785 | break;
|
3786 | }
|
3787 | return null;
|
3788 | };
|
3789 |
|
3790 | /**
|
3791 | * Creates a StreamingRecognizeResponse message from a plain object. Also converts values to their respective internal types.
|
3792 | * @function fromObject
|
3793 | * @memberof google.cloud.speech.v1.StreamingRecognizeResponse
|
3794 | * @static
|
3795 | * @param {Object.<string,*>} object Plain object
|
3796 | * @returns {google.cloud.speech.v1.StreamingRecognizeResponse} StreamingRecognizeResponse
|
3797 | */
|
3798 | StreamingRecognizeResponse.fromObject = function fromObject(object) {
|
3799 | if (object instanceof $root.google.cloud.speech.v1.StreamingRecognizeResponse)
|
3800 | return object;
|
3801 | var message = new $root.google.cloud.speech.v1.StreamingRecognizeResponse();
|
3802 | if (object.error != null) {
|
3803 | if (typeof object.error !== "object")
|
3804 | throw TypeError(".google.cloud.speech.v1.StreamingRecognizeResponse.error: object expected");
|
3805 | message.error = $root.google.rpc.Status.fromObject(object.error);
|
3806 | }
|
3807 | if (object.results) {
|
3808 | if (!Array.isArray(object.results))
|
3809 | throw TypeError(".google.cloud.speech.v1.StreamingRecognizeResponse.results: array expected");
|
3810 | message.results = [];
|
3811 | for (var i = 0; i < object.results.length; ++i) {
|
3812 | if (typeof object.results[i] !== "object")
|
3813 | throw TypeError(".google.cloud.speech.v1.StreamingRecognizeResponse.results: object expected");
|
3814 | message.results[i] = $root.google.cloud.speech.v1.StreamingRecognitionResult.fromObject(object.results[i]);
|
3815 | }
|
3816 | }
|
3817 | switch (object.speechEventType) {
|
3818 | case "SPEECH_EVENT_UNSPECIFIED":
|
3819 | case 0:
|
3820 | message.speechEventType = 0;
|
3821 | break;
|
3822 | case "END_OF_SINGLE_UTTERANCE":
|
3823 | case 1:
|
3824 | message.speechEventType = 1;
|
3825 | break;
|
3826 | }
|
3827 | return message;
|
3828 | };
|
3829 |
|
3830 | /**
|
3831 | * Creates a plain object from a StreamingRecognizeResponse message. Also converts values to other types if specified.
|
3832 | * @function toObject
|
3833 | * @memberof google.cloud.speech.v1.StreamingRecognizeResponse
|
3834 | * @static
|
3835 | * @param {google.cloud.speech.v1.StreamingRecognizeResponse} message StreamingRecognizeResponse
|
3836 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
3837 | * @returns {Object.<string,*>} Plain object
|
3838 | */
|
3839 | StreamingRecognizeResponse.toObject = function toObject(message, options) {
|
3840 | if (!options)
|
3841 | options = {};
|
3842 | var object = {};
|
3843 | if (options.arrays || options.defaults)
|
3844 | object.results = [];
|
3845 | if (options.defaults) {
|
3846 | object.error = null;
|
3847 | object.speechEventType = options.enums === String ? "SPEECH_EVENT_UNSPECIFIED" : 0;
|
3848 | }
|
3849 | if (message.error != null && message.hasOwnProperty("error"))
|
3850 | object.error = $root.google.rpc.Status.toObject(message.error, options);
|
3851 | if (message.results && message.results.length) {
|
3852 | object.results = [];
|
3853 | for (var j = 0; j < message.results.length; ++j)
|
3854 | object.results[j] = $root.google.cloud.speech.v1.StreamingRecognitionResult.toObject(message.results[j], options);
|
3855 | }
|
3856 | if (message.speechEventType != null && message.hasOwnProperty("speechEventType"))
|
3857 | object.speechEventType = options.enums === String ? $root.google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType[message.speechEventType] : message.speechEventType;
|
3858 | return object;
|
3859 | };
|
3860 |
|
3861 | /**
|
3862 | * Converts this StreamingRecognizeResponse to JSON.
|
3863 | * @function toJSON
|
3864 | * @memberof google.cloud.speech.v1.StreamingRecognizeResponse
|
3865 | * @instance
|
3866 | * @returns {Object.<string,*>} JSON object
|
3867 | */
|
3868 | StreamingRecognizeResponse.prototype.toJSON = function toJSON() {
|
3869 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
3870 | };
|
3871 |
|
3872 | /**
|
3873 | * SpeechEventType enum.
|
3874 | * @name google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType
|
3875 | * @enum {number}
|
3876 | * @property {number} SPEECH_EVENT_UNSPECIFIED=0 SPEECH_EVENT_UNSPECIFIED value
|
3877 | * @property {number} END_OF_SINGLE_UTTERANCE=1 END_OF_SINGLE_UTTERANCE value
|
3878 | */
|
3879 | StreamingRecognizeResponse.SpeechEventType = (function() {
|
3880 | var valuesById = {}, values = Object.create(valuesById);
|
3881 | values[valuesById[0] = "SPEECH_EVENT_UNSPECIFIED"] = 0;
|
3882 | values[valuesById[1] = "END_OF_SINGLE_UTTERANCE"] = 1;
|
3883 | return values;
|
3884 | })();
|
3885 |
|
3886 | return StreamingRecognizeResponse;
|
3887 | })();
|
3888 |
|
3889 | v1.StreamingRecognitionResult = (function() {
|
3890 |
|
3891 | /**
|
3892 | * Properties of a StreamingRecognitionResult.
|
3893 | * @memberof google.cloud.speech.v1
|
3894 | * @interface IStreamingRecognitionResult
|
3895 | * @property {Array.<google.cloud.speech.v1.ISpeechRecognitionAlternative>|null} [alternatives] StreamingRecognitionResult alternatives
|
3896 | * @property {boolean|null} [isFinal] StreamingRecognitionResult isFinal
|
3897 | * @property {number|null} [stability] StreamingRecognitionResult stability
|
3898 | * @property {google.protobuf.IDuration|null} [resultEndTime] StreamingRecognitionResult resultEndTime
|
3899 | * @property {number|null} [channelTag] StreamingRecognitionResult channelTag
|
3900 | * @property {string|null} [languageCode] StreamingRecognitionResult languageCode
|
3901 | */
|
3902 |
|
3903 | /**
|
3904 | * Constructs a new StreamingRecognitionResult.
|
3905 | * @memberof google.cloud.speech.v1
|
3906 | * @classdesc Represents a StreamingRecognitionResult.
|
3907 | * @implements IStreamingRecognitionResult
|
3908 | * @constructor
|
3909 | * @param {google.cloud.speech.v1.IStreamingRecognitionResult=} [properties] Properties to set
|
3910 | */
|
3911 | function StreamingRecognitionResult(properties) {
|
3912 | this.alternatives = [];
|
3913 | if (properties)
|
3914 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
3915 | if (properties[keys[i]] != null)
|
3916 | this[keys[i]] = properties[keys[i]];
|
3917 | }
|
3918 |
|
3919 | /**
|
3920 | * StreamingRecognitionResult alternatives.
|
3921 | * @member {Array.<google.cloud.speech.v1.ISpeechRecognitionAlternative>} alternatives
|
3922 | * @memberof google.cloud.speech.v1.StreamingRecognitionResult
|
3923 | * @instance
|
3924 | */
|
3925 | StreamingRecognitionResult.prototype.alternatives = $util.emptyArray;
|
3926 |
|
3927 | /**
|
3928 | * StreamingRecognitionResult isFinal.
|
3929 | * @member {boolean} isFinal
|
3930 | * @memberof google.cloud.speech.v1.StreamingRecognitionResult
|
3931 | * @instance
|
3932 | */
|
3933 | StreamingRecognitionResult.prototype.isFinal = false;
|
3934 |
|
3935 | /**
|
3936 | * StreamingRecognitionResult stability.
|
3937 | * @member {number} stability
|
3938 | * @memberof google.cloud.speech.v1.StreamingRecognitionResult
|
3939 | * @instance
|
3940 | */
|
3941 | StreamingRecognitionResult.prototype.stability = 0;
|
3942 |
|
3943 | /**
|
3944 | * StreamingRecognitionResult resultEndTime.
|
3945 | * @member {google.protobuf.IDuration|null|undefined} resultEndTime
|
3946 | * @memberof google.cloud.speech.v1.StreamingRecognitionResult
|
3947 | * @instance
|
3948 | */
|
3949 | StreamingRecognitionResult.prototype.resultEndTime = null;
|
3950 |
|
3951 | /**
|
3952 | * StreamingRecognitionResult channelTag.
|
3953 | * @member {number} channelTag
|
3954 | * @memberof google.cloud.speech.v1.StreamingRecognitionResult
|
3955 | * @instance
|
3956 | */
|
3957 | StreamingRecognitionResult.prototype.channelTag = 0;
|
3958 |
|
3959 | /**
|
3960 | * StreamingRecognitionResult languageCode.
|
3961 | * @member {string} languageCode
|
3962 | * @memberof google.cloud.speech.v1.StreamingRecognitionResult
|
3963 | * @instance
|
3964 | */
|
3965 | StreamingRecognitionResult.prototype.languageCode = "";
|
3966 |
|
3967 | /**
|
3968 | * Creates a new StreamingRecognitionResult instance using the specified properties.
|
3969 | * @function create
|
3970 | * @memberof google.cloud.speech.v1.StreamingRecognitionResult
|
3971 | * @static
|
3972 | * @param {google.cloud.speech.v1.IStreamingRecognitionResult=} [properties] Properties to set
|
3973 | * @returns {google.cloud.speech.v1.StreamingRecognitionResult} StreamingRecognitionResult instance
|
3974 | */
|
3975 | StreamingRecognitionResult.create = function create(properties) {
|
3976 | return new StreamingRecognitionResult(properties);
|
3977 | };
|
3978 |
|
3979 | /**
|
3980 | * Encodes the specified StreamingRecognitionResult message. Does not implicitly {@link google.cloud.speech.v1.StreamingRecognitionResult.verify|verify} messages.
|
3981 | * @function encode
|
3982 | * @memberof google.cloud.speech.v1.StreamingRecognitionResult
|
3983 | * @static
|
3984 | * @param {google.cloud.speech.v1.IStreamingRecognitionResult} message StreamingRecognitionResult message or plain object to encode
|
3985 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
3986 | * @returns {$protobuf.Writer} Writer
|
3987 | */
|
3988 | StreamingRecognitionResult.encode = function encode(message, writer) {
|
3989 | if (!writer)
|
3990 | writer = $Writer.create();
|
3991 | if (message.alternatives != null && message.alternatives.length)
|
3992 | for (var i = 0; i < message.alternatives.length; ++i)
|
3993 | $root.google.cloud.speech.v1.SpeechRecognitionAlternative.encode(message.alternatives[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
3994 | if (message.isFinal != null && Object.hasOwnProperty.call(message, "isFinal"))
|
3995 | writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isFinal);
|
3996 | if (message.stability != null && Object.hasOwnProperty.call(message, "stability"))
|
3997 | writer.uint32(/* id 3, wireType 5 =*/29).float(message.stability);
|
3998 | if (message.resultEndTime != null && Object.hasOwnProperty.call(message, "resultEndTime"))
|
3999 | $root.google.protobuf.Duration.encode(message.resultEndTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
|
4000 | if (message.channelTag != null && Object.hasOwnProperty.call(message, "channelTag"))
|
4001 | writer.uint32(/* id 5, wireType 0 =*/40).int32(message.channelTag);
|
4002 | if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode"))
|
4003 | writer.uint32(/* id 6, wireType 2 =*/50).string(message.languageCode);
|
4004 | return writer;
|
4005 | };
|
4006 |
|
4007 | /**
|
4008 | * Encodes the specified StreamingRecognitionResult message, length delimited. Does not implicitly {@link google.cloud.speech.v1.StreamingRecognitionResult.verify|verify} messages.
|
4009 | * @function encodeDelimited
|
4010 | * @memberof google.cloud.speech.v1.StreamingRecognitionResult
|
4011 | * @static
|
4012 | * @param {google.cloud.speech.v1.IStreamingRecognitionResult} message StreamingRecognitionResult message or plain object to encode
|
4013 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
4014 | * @returns {$protobuf.Writer} Writer
|
4015 | */
|
4016 | StreamingRecognitionResult.encodeDelimited = function encodeDelimited(message, writer) {
|
4017 | return this.encode(message, writer).ldelim();
|
4018 | };
|
4019 |
|
4020 | /**
|
4021 | * Decodes a StreamingRecognitionResult message from the specified reader or buffer.
|
4022 | * @function decode
|
4023 | * @memberof google.cloud.speech.v1.StreamingRecognitionResult
|
4024 | * @static
|
4025 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
4026 | * @param {number} [length] Message length if known beforehand
|
4027 | * @returns {google.cloud.speech.v1.StreamingRecognitionResult} StreamingRecognitionResult
|
4028 | * @throws {Error} If the payload is not a reader or valid buffer
|
4029 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
4030 | */
|
4031 | StreamingRecognitionResult.decode = function decode(reader, length) {
|
4032 | if (!(reader instanceof $Reader))
|
4033 | reader = $Reader.create(reader);
|
4034 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.StreamingRecognitionResult();
|
4035 | while (reader.pos < end) {
|
4036 | var tag = reader.uint32();
|
4037 | switch (tag >>> 3) {
|
4038 | case 1:
|
4039 | if (!(message.alternatives && message.alternatives.length))
|
4040 | message.alternatives = [];
|
4041 | message.alternatives.push($root.google.cloud.speech.v1.SpeechRecognitionAlternative.decode(reader, reader.uint32()));
|
4042 | break;
|
4043 | case 2:
|
4044 | message.isFinal = reader.bool();
|
4045 | break;
|
4046 | case 3:
|
4047 | message.stability = reader.float();
|
4048 | break;
|
4049 | case 4:
|
4050 | message.resultEndTime = $root.google.protobuf.Duration.decode(reader, reader.uint32());
|
4051 | break;
|
4052 | case 5:
|
4053 | message.channelTag = reader.int32();
|
4054 | break;
|
4055 | case 6:
|
4056 | message.languageCode = reader.string();
|
4057 | break;
|
4058 | default:
|
4059 | reader.skipType(tag & 7);
|
4060 | break;
|
4061 | }
|
4062 | }
|
4063 | return message;
|
4064 | };
|
4065 |
|
4066 | /**
|
4067 | * Decodes a StreamingRecognitionResult message from the specified reader or buffer, length delimited.
|
4068 | * @function decodeDelimited
|
4069 | * @memberof google.cloud.speech.v1.StreamingRecognitionResult
|
4070 | * @static
|
4071 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
4072 | * @returns {google.cloud.speech.v1.StreamingRecognitionResult} StreamingRecognitionResult
|
4073 | * @throws {Error} If the payload is not a reader or valid buffer
|
4074 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
4075 | */
|
4076 | StreamingRecognitionResult.decodeDelimited = function decodeDelimited(reader) {
|
4077 | if (!(reader instanceof $Reader))
|
4078 | reader = new $Reader(reader);
|
4079 | return this.decode(reader, reader.uint32());
|
4080 | };
|
4081 |
|
4082 | /**
|
4083 | * Verifies a StreamingRecognitionResult message.
|
4084 | * @function verify
|
4085 | * @memberof google.cloud.speech.v1.StreamingRecognitionResult
|
4086 | * @static
|
4087 | * @param {Object.<string,*>} message Plain object to verify
|
4088 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
4089 | */
|
4090 | StreamingRecognitionResult.verify = function verify(message) {
|
4091 | if (typeof message !== "object" || message === null)
|
4092 | return "object expected";
|
4093 | if (message.alternatives != null && message.hasOwnProperty("alternatives")) {
|
4094 | if (!Array.isArray(message.alternatives))
|
4095 | return "alternatives: array expected";
|
4096 | for (var i = 0; i < message.alternatives.length; ++i) {
|
4097 | var error = $root.google.cloud.speech.v1.SpeechRecognitionAlternative.verify(message.alternatives[i]);
|
4098 | if (error)
|
4099 | return "alternatives." + error;
|
4100 | }
|
4101 | }
|
4102 | if (message.isFinal != null && message.hasOwnProperty("isFinal"))
|
4103 | if (typeof message.isFinal !== "boolean")
|
4104 | return "isFinal: boolean expected";
|
4105 | if (message.stability != null && message.hasOwnProperty("stability"))
|
4106 | if (typeof message.stability !== "number")
|
4107 | return "stability: number expected";
|
4108 | if (message.resultEndTime != null && message.hasOwnProperty("resultEndTime")) {
|
4109 | var error = $root.google.protobuf.Duration.verify(message.resultEndTime);
|
4110 | if (error)
|
4111 | return "resultEndTime." + error;
|
4112 | }
|
4113 | if (message.channelTag != null && message.hasOwnProperty("channelTag"))
|
4114 | if (!$util.isInteger(message.channelTag))
|
4115 | return "channelTag: integer expected";
|
4116 | if (message.languageCode != null && message.hasOwnProperty("languageCode"))
|
4117 | if (!$util.isString(message.languageCode))
|
4118 | return "languageCode: string expected";
|
4119 | return null;
|
4120 | };
|
4121 |
|
4122 | /**
|
4123 | * Creates a StreamingRecognitionResult message from a plain object. Also converts values to their respective internal types.
|
4124 | * @function fromObject
|
4125 | * @memberof google.cloud.speech.v1.StreamingRecognitionResult
|
4126 | * @static
|
4127 | * @param {Object.<string,*>} object Plain object
|
4128 | * @returns {google.cloud.speech.v1.StreamingRecognitionResult} StreamingRecognitionResult
|
4129 | */
|
4130 | StreamingRecognitionResult.fromObject = function fromObject(object) {
|
4131 | if (object instanceof $root.google.cloud.speech.v1.StreamingRecognitionResult)
|
4132 | return object;
|
4133 | var message = new $root.google.cloud.speech.v1.StreamingRecognitionResult();
|
4134 | if (object.alternatives) {
|
4135 | if (!Array.isArray(object.alternatives))
|
4136 | throw TypeError(".google.cloud.speech.v1.StreamingRecognitionResult.alternatives: array expected");
|
4137 | message.alternatives = [];
|
4138 | for (var i = 0; i < object.alternatives.length; ++i) {
|
4139 | if (typeof object.alternatives[i] !== "object")
|
4140 | throw TypeError(".google.cloud.speech.v1.StreamingRecognitionResult.alternatives: object expected");
|
4141 | message.alternatives[i] = $root.google.cloud.speech.v1.SpeechRecognitionAlternative.fromObject(object.alternatives[i]);
|
4142 | }
|
4143 | }
|
4144 | if (object.isFinal != null)
|
4145 | message.isFinal = Boolean(object.isFinal);
|
4146 | if (object.stability != null)
|
4147 | message.stability = Number(object.stability);
|
4148 | if (object.resultEndTime != null) {
|
4149 | if (typeof object.resultEndTime !== "object")
|
4150 | throw TypeError(".google.cloud.speech.v1.StreamingRecognitionResult.resultEndTime: object expected");
|
4151 | message.resultEndTime = $root.google.protobuf.Duration.fromObject(object.resultEndTime);
|
4152 | }
|
4153 | if (object.channelTag != null)
|
4154 | message.channelTag = object.channelTag | 0;
|
4155 | if (object.languageCode != null)
|
4156 | message.languageCode = String(object.languageCode);
|
4157 | return message;
|
4158 | };
|
4159 |
|
4160 | /**
|
4161 | * Creates a plain object from a StreamingRecognitionResult message. Also converts values to other types if specified.
|
4162 | * @function toObject
|
4163 | * @memberof google.cloud.speech.v1.StreamingRecognitionResult
|
4164 | * @static
|
4165 | * @param {google.cloud.speech.v1.StreamingRecognitionResult} message StreamingRecognitionResult
|
4166 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
4167 | * @returns {Object.<string,*>} Plain object
|
4168 | */
|
4169 | StreamingRecognitionResult.toObject = function toObject(message, options) {
|
4170 | if (!options)
|
4171 | options = {};
|
4172 | var object = {};
|
4173 | if (options.arrays || options.defaults)
|
4174 | object.alternatives = [];
|
4175 | if (options.defaults) {
|
4176 | object.isFinal = false;
|
4177 | object.stability = 0;
|
4178 | object.resultEndTime = null;
|
4179 | object.channelTag = 0;
|
4180 | object.languageCode = "";
|
4181 | }
|
4182 | if (message.alternatives && message.alternatives.length) {
|
4183 | object.alternatives = [];
|
4184 | for (var j = 0; j < message.alternatives.length; ++j)
|
4185 | object.alternatives[j] = $root.google.cloud.speech.v1.SpeechRecognitionAlternative.toObject(message.alternatives[j], options);
|
4186 | }
|
4187 | if (message.isFinal != null && message.hasOwnProperty("isFinal"))
|
4188 | object.isFinal = message.isFinal;
|
4189 | if (message.stability != null && message.hasOwnProperty("stability"))
|
4190 | object.stability = options.json && !isFinite(message.stability) ? String(message.stability) : message.stability;
|
4191 | if (message.resultEndTime != null && message.hasOwnProperty("resultEndTime"))
|
4192 | object.resultEndTime = $root.google.protobuf.Duration.toObject(message.resultEndTime, options);
|
4193 | if (message.channelTag != null && message.hasOwnProperty("channelTag"))
|
4194 | object.channelTag = message.channelTag;
|
4195 | if (message.languageCode != null && message.hasOwnProperty("languageCode"))
|
4196 | object.languageCode = message.languageCode;
|
4197 | return object;
|
4198 | };
|
4199 |
|
4200 | /**
|
4201 | * Converts this StreamingRecognitionResult to JSON.
|
4202 | * @function toJSON
|
4203 | * @memberof google.cloud.speech.v1.StreamingRecognitionResult
|
4204 | * @instance
|
4205 | * @returns {Object.<string,*>} JSON object
|
4206 | */
|
4207 | StreamingRecognitionResult.prototype.toJSON = function toJSON() {
|
4208 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
4209 | };
|
4210 |
|
4211 | return StreamingRecognitionResult;
|
4212 | })();
|
4213 |
|
4214 | v1.SpeechRecognitionResult = (function() {
|
4215 |
|
4216 | /**
|
4217 | * Properties of a SpeechRecognitionResult.
|
4218 | * @memberof google.cloud.speech.v1
|
4219 | * @interface ISpeechRecognitionResult
|
4220 | * @property {Array.<google.cloud.speech.v1.ISpeechRecognitionAlternative>|null} [alternatives] SpeechRecognitionResult alternatives
|
4221 | * @property {number|null} [channelTag] SpeechRecognitionResult channelTag
|
4222 | */
|
4223 |
|
4224 | /**
|
4225 | * Constructs a new SpeechRecognitionResult.
|
4226 | * @memberof google.cloud.speech.v1
|
4227 | * @classdesc Represents a SpeechRecognitionResult.
|
4228 | * @implements ISpeechRecognitionResult
|
4229 | * @constructor
|
4230 | * @param {google.cloud.speech.v1.ISpeechRecognitionResult=} [properties] Properties to set
|
4231 | */
|
4232 | function SpeechRecognitionResult(properties) {
|
4233 | this.alternatives = [];
|
4234 | if (properties)
|
4235 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
4236 | if (properties[keys[i]] != null)
|
4237 | this[keys[i]] = properties[keys[i]];
|
4238 | }
|
4239 |
|
4240 | /**
|
4241 | * SpeechRecognitionResult alternatives.
|
4242 | * @member {Array.<google.cloud.speech.v1.ISpeechRecognitionAlternative>} alternatives
|
4243 | * @memberof google.cloud.speech.v1.SpeechRecognitionResult
|
4244 | * @instance
|
4245 | */
|
4246 | SpeechRecognitionResult.prototype.alternatives = $util.emptyArray;
|
4247 |
|
4248 | /**
|
4249 | * SpeechRecognitionResult channelTag.
|
4250 | * @member {number} channelTag
|
4251 | * @memberof google.cloud.speech.v1.SpeechRecognitionResult
|
4252 | * @instance
|
4253 | */
|
4254 | SpeechRecognitionResult.prototype.channelTag = 0;
|
4255 |
|
4256 | /**
|
4257 | * Creates a new SpeechRecognitionResult instance using the specified properties.
|
4258 | * @function create
|
4259 | * @memberof google.cloud.speech.v1.SpeechRecognitionResult
|
4260 | * @static
|
4261 | * @param {google.cloud.speech.v1.ISpeechRecognitionResult=} [properties] Properties to set
|
4262 | * @returns {google.cloud.speech.v1.SpeechRecognitionResult} SpeechRecognitionResult instance
|
4263 | */
|
4264 | SpeechRecognitionResult.create = function create(properties) {
|
4265 | return new SpeechRecognitionResult(properties);
|
4266 | };
|
4267 |
|
4268 | /**
|
4269 | * Encodes the specified SpeechRecognitionResult message. Does not implicitly {@link google.cloud.speech.v1.SpeechRecognitionResult.verify|verify} messages.
|
4270 | * @function encode
|
4271 | * @memberof google.cloud.speech.v1.SpeechRecognitionResult
|
4272 | * @static
|
4273 | * @param {google.cloud.speech.v1.ISpeechRecognitionResult} message SpeechRecognitionResult message or plain object to encode
|
4274 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
4275 | * @returns {$protobuf.Writer} Writer
|
4276 | */
|
4277 | SpeechRecognitionResult.encode = function encode(message, writer) {
|
4278 | if (!writer)
|
4279 | writer = $Writer.create();
|
4280 | if (message.alternatives != null && message.alternatives.length)
|
4281 | for (var i = 0; i < message.alternatives.length; ++i)
|
4282 | $root.google.cloud.speech.v1.SpeechRecognitionAlternative.encode(message.alternatives[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
4283 | if (message.channelTag != null && Object.hasOwnProperty.call(message, "channelTag"))
|
4284 | writer.uint32(/* id 2, wireType 0 =*/16).int32(message.channelTag);
|
4285 | return writer;
|
4286 | };
|
4287 |
|
4288 | /**
|
4289 | * Encodes the specified SpeechRecognitionResult message, length delimited. Does not implicitly {@link google.cloud.speech.v1.SpeechRecognitionResult.verify|verify} messages.
|
4290 | * @function encodeDelimited
|
4291 | * @memberof google.cloud.speech.v1.SpeechRecognitionResult
|
4292 | * @static
|
4293 | * @param {google.cloud.speech.v1.ISpeechRecognitionResult} message SpeechRecognitionResult message or plain object to encode
|
4294 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
4295 | * @returns {$protobuf.Writer} Writer
|
4296 | */
|
4297 | SpeechRecognitionResult.encodeDelimited = function encodeDelimited(message, writer) {
|
4298 | return this.encode(message, writer).ldelim();
|
4299 | };
|
4300 |
|
4301 | /**
|
4302 | * Decodes a SpeechRecognitionResult message from the specified reader or buffer.
|
4303 | * @function decode
|
4304 | * @memberof google.cloud.speech.v1.SpeechRecognitionResult
|
4305 | * @static
|
4306 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
4307 | * @param {number} [length] Message length if known beforehand
|
4308 | * @returns {google.cloud.speech.v1.SpeechRecognitionResult} SpeechRecognitionResult
|
4309 | * @throws {Error} If the payload is not a reader or valid buffer
|
4310 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
4311 | */
|
4312 | SpeechRecognitionResult.decode = function decode(reader, length) {
|
4313 | if (!(reader instanceof $Reader))
|
4314 | reader = $Reader.create(reader);
|
4315 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.SpeechRecognitionResult();
|
4316 | while (reader.pos < end) {
|
4317 | var tag = reader.uint32();
|
4318 | switch (tag >>> 3) {
|
4319 | case 1:
|
4320 | if (!(message.alternatives && message.alternatives.length))
|
4321 | message.alternatives = [];
|
4322 | message.alternatives.push($root.google.cloud.speech.v1.SpeechRecognitionAlternative.decode(reader, reader.uint32()));
|
4323 | break;
|
4324 | case 2:
|
4325 | message.channelTag = reader.int32();
|
4326 | break;
|
4327 | default:
|
4328 | reader.skipType(tag & 7);
|
4329 | break;
|
4330 | }
|
4331 | }
|
4332 | return message;
|
4333 | };
|
4334 |
|
4335 | /**
|
4336 | * Decodes a SpeechRecognitionResult message from the specified reader or buffer, length delimited.
|
4337 | * @function decodeDelimited
|
4338 | * @memberof google.cloud.speech.v1.SpeechRecognitionResult
|
4339 | * @static
|
4340 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
4341 | * @returns {google.cloud.speech.v1.SpeechRecognitionResult} SpeechRecognitionResult
|
4342 | * @throws {Error} If the payload is not a reader or valid buffer
|
4343 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
4344 | */
|
4345 | SpeechRecognitionResult.decodeDelimited = function decodeDelimited(reader) {
|
4346 | if (!(reader instanceof $Reader))
|
4347 | reader = new $Reader(reader);
|
4348 | return this.decode(reader, reader.uint32());
|
4349 | };
|
4350 |
|
4351 | /**
|
4352 | * Verifies a SpeechRecognitionResult message.
|
4353 | * @function verify
|
4354 | * @memberof google.cloud.speech.v1.SpeechRecognitionResult
|
4355 | * @static
|
4356 | * @param {Object.<string,*>} message Plain object to verify
|
4357 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
4358 | */
|
4359 | SpeechRecognitionResult.verify = function verify(message) {
|
4360 | if (typeof message !== "object" || message === null)
|
4361 | return "object expected";
|
4362 | if (message.alternatives != null && message.hasOwnProperty("alternatives")) {
|
4363 | if (!Array.isArray(message.alternatives))
|
4364 | return "alternatives: array expected";
|
4365 | for (var i = 0; i < message.alternatives.length; ++i) {
|
4366 | var error = $root.google.cloud.speech.v1.SpeechRecognitionAlternative.verify(message.alternatives[i]);
|
4367 | if (error)
|
4368 | return "alternatives." + error;
|
4369 | }
|
4370 | }
|
4371 | if (message.channelTag != null && message.hasOwnProperty("channelTag"))
|
4372 | if (!$util.isInteger(message.channelTag))
|
4373 | return "channelTag: integer expected";
|
4374 | return null;
|
4375 | };
|
4376 |
|
4377 | /**
|
4378 | * Creates a SpeechRecognitionResult message from a plain object. Also converts values to their respective internal types.
|
4379 | * @function fromObject
|
4380 | * @memberof google.cloud.speech.v1.SpeechRecognitionResult
|
4381 | * @static
|
4382 | * @param {Object.<string,*>} object Plain object
|
4383 | * @returns {google.cloud.speech.v1.SpeechRecognitionResult} SpeechRecognitionResult
|
4384 | */
|
4385 | SpeechRecognitionResult.fromObject = function fromObject(object) {
|
4386 | if (object instanceof $root.google.cloud.speech.v1.SpeechRecognitionResult)
|
4387 | return object;
|
4388 | var message = new $root.google.cloud.speech.v1.SpeechRecognitionResult();
|
4389 | if (object.alternatives) {
|
4390 | if (!Array.isArray(object.alternatives))
|
4391 | throw TypeError(".google.cloud.speech.v1.SpeechRecognitionResult.alternatives: array expected");
|
4392 | message.alternatives = [];
|
4393 | for (var i = 0; i < object.alternatives.length; ++i) {
|
4394 | if (typeof object.alternatives[i] !== "object")
|
4395 | throw TypeError(".google.cloud.speech.v1.SpeechRecognitionResult.alternatives: object expected");
|
4396 | message.alternatives[i] = $root.google.cloud.speech.v1.SpeechRecognitionAlternative.fromObject(object.alternatives[i]);
|
4397 | }
|
4398 | }
|
4399 | if (object.channelTag != null)
|
4400 | message.channelTag = object.channelTag | 0;
|
4401 | return message;
|
4402 | };
|
4403 |
|
4404 | /**
|
4405 | * Creates a plain object from a SpeechRecognitionResult message. Also converts values to other types if specified.
|
4406 | * @function toObject
|
4407 | * @memberof google.cloud.speech.v1.SpeechRecognitionResult
|
4408 | * @static
|
4409 | * @param {google.cloud.speech.v1.SpeechRecognitionResult} message SpeechRecognitionResult
|
4410 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
4411 | * @returns {Object.<string,*>} Plain object
|
4412 | */
|
4413 | SpeechRecognitionResult.toObject = function toObject(message, options) {
|
4414 | if (!options)
|
4415 | options = {};
|
4416 | var object = {};
|
4417 | if (options.arrays || options.defaults)
|
4418 | object.alternatives = [];
|
4419 | if (options.defaults)
|
4420 | object.channelTag = 0;
|
4421 | if (message.alternatives && message.alternatives.length) {
|
4422 | object.alternatives = [];
|
4423 | for (var j = 0; j < message.alternatives.length; ++j)
|
4424 | object.alternatives[j] = $root.google.cloud.speech.v1.SpeechRecognitionAlternative.toObject(message.alternatives[j], options);
|
4425 | }
|
4426 | if (message.channelTag != null && message.hasOwnProperty("channelTag"))
|
4427 | object.channelTag = message.channelTag;
|
4428 | return object;
|
4429 | };
|
4430 |
|
4431 | /**
|
4432 | * Converts this SpeechRecognitionResult to JSON.
|
4433 | * @function toJSON
|
4434 | * @memberof google.cloud.speech.v1.SpeechRecognitionResult
|
4435 | * @instance
|
4436 | * @returns {Object.<string,*>} JSON object
|
4437 | */
|
4438 | SpeechRecognitionResult.prototype.toJSON = function toJSON() {
|
4439 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
4440 | };
|
4441 |
|
4442 | return SpeechRecognitionResult;
|
4443 | })();
|
4444 |
|
4445 | v1.SpeechRecognitionAlternative = (function() {
|
4446 |
|
4447 | /**
|
4448 | * Properties of a SpeechRecognitionAlternative.
|
4449 | * @memberof google.cloud.speech.v1
|
4450 | * @interface ISpeechRecognitionAlternative
|
4451 | * @property {string|null} [transcript] SpeechRecognitionAlternative transcript
|
4452 | * @property {number|null} [confidence] SpeechRecognitionAlternative confidence
|
4453 | * @property {Array.<google.cloud.speech.v1.IWordInfo>|null} [words] SpeechRecognitionAlternative words
|
4454 | */
|
4455 |
|
4456 | /**
|
4457 | * Constructs a new SpeechRecognitionAlternative.
|
4458 | * @memberof google.cloud.speech.v1
|
4459 | * @classdesc Represents a SpeechRecognitionAlternative.
|
4460 | * @implements ISpeechRecognitionAlternative
|
4461 | * @constructor
|
4462 | * @param {google.cloud.speech.v1.ISpeechRecognitionAlternative=} [properties] Properties to set
|
4463 | */
|
4464 | function SpeechRecognitionAlternative(properties) {
|
4465 | this.words = [];
|
4466 | if (properties)
|
4467 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
4468 | if (properties[keys[i]] != null)
|
4469 | this[keys[i]] = properties[keys[i]];
|
4470 | }
|
4471 |
|
4472 | /**
|
4473 | * SpeechRecognitionAlternative transcript.
|
4474 | * @member {string} transcript
|
4475 | * @memberof google.cloud.speech.v1.SpeechRecognitionAlternative
|
4476 | * @instance
|
4477 | */
|
4478 | SpeechRecognitionAlternative.prototype.transcript = "";
|
4479 |
|
4480 | /**
|
4481 | * SpeechRecognitionAlternative confidence.
|
4482 | * @member {number} confidence
|
4483 | * @memberof google.cloud.speech.v1.SpeechRecognitionAlternative
|
4484 | * @instance
|
4485 | */
|
4486 | SpeechRecognitionAlternative.prototype.confidence = 0;
|
4487 |
|
4488 | /**
|
4489 | * SpeechRecognitionAlternative words.
|
4490 | * @member {Array.<google.cloud.speech.v1.IWordInfo>} words
|
4491 | * @memberof google.cloud.speech.v1.SpeechRecognitionAlternative
|
4492 | * @instance
|
4493 | */
|
4494 | SpeechRecognitionAlternative.prototype.words = $util.emptyArray;
|
4495 |
|
4496 | /**
|
4497 | * Creates a new SpeechRecognitionAlternative instance using the specified properties.
|
4498 | * @function create
|
4499 | * @memberof google.cloud.speech.v1.SpeechRecognitionAlternative
|
4500 | * @static
|
4501 | * @param {google.cloud.speech.v1.ISpeechRecognitionAlternative=} [properties] Properties to set
|
4502 | * @returns {google.cloud.speech.v1.SpeechRecognitionAlternative} SpeechRecognitionAlternative instance
|
4503 | */
|
4504 | SpeechRecognitionAlternative.create = function create(properties) {
|
4505 | return new SpeechRecognitionAlternative(properties);
|
4506 | };
|
4507 |
|
4508 | /**
|
4509 | * Encodes the specified SpeechRecognitionAlternative message. Does not implicitly {@link google.cloud.speech.v1.SpeechRecognitionAlternative.verify|verify} messages.
|
4510 | * @function encode
|
4511 | * @memberof google.cloud.speech.v1.SpeechRecognitionAlternative
|
4512 | * @static
|
4513 | * @param {google.cloud.speech.v1.ISpeechRecognitionAlternative} message SpeechRecognitionAlternative message or plain object to encode
|
4514 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
4515 | * @returns {$protobuf.Writer} Writer
|
4516 | */
|
4517 | SpeechRecognitionAlternative.encode = function encode(message, writer) {
|
4518 | if (!writer)
|
4519 | writer = $Writer.create();
|
4520 | if (message.transcript != null && Object.hasOwnProperty.call(message, "transcript"))
|
4521 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.transcript);
|
4522 | if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence"))
|
4523 | writer.uint32(/* id 2, wireType 5 =*/21).float(message.confidence);
|
4524 | if (message.words != null && message.words.length)
|
4525 | for (var i = 0; i < message.words.length; ++i)
|
4526 | $root.google.cloud.speech.v1.WordInfo.encode(message.words[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
|
4527 | return writer;
|
4528 | };
|
4529 |
|
4530 | /**
|
4531 | * Encodes the specified SpeechRecognitionAlternative message, length delimited. Does not implicitly {@link google.cloud.speech.v1.SpeechRecognitionAlternative.verify|verify} messages.
|
4532 | * @function encodeDelimited
|
4533 | * @memberof google.cloud.speech.v1.SpeechRecognitionAlternative
|
4534 | * @static
|
4535 | * @param {google.cloud.speech.v1.ISpeechRecognitionAlternative} message SpeechRecognitionAlternative message or plain object to encode
|
4536 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
4537 | * @returns {$protobuf.Writer} Writer
|
4538 | */
|
4539 | SpeechRecognitionAlternative.encodeDelimited = function encodeDelimited(message, writer) {
|
4540 | return this.encode(message, writer).ldelim();
|
4541 | };
|
4542 |
|
4543 | /**
|
4544 | * Decodes a SpeechRecognitionAlternative message from the specified reader or buffer.
|
4545 | * @function decode
|
4546 | * @memberof google.cloud.speech.v1.SpeechRecognitionAlternative
|
4547 | * @static
|
4548 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
4549 | * @param {number} [length] Message length if known beforehand
|
4550 | * @returns {google.cloud.speech.v1.SpeechRecognitionAlternative} SpeechRecognitionAlternative
|
4551 | * @throws {Error} If the payload is not a reader or valid buffer
|
4552 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
4553 | */
|
4554 | SpeechRecognitionAlternative.decode = function decode(reader, length) {
|
4555 | if (!(reader instanceof $Reader))
|
4556 | reader = $Reader.create(reader);
|
4557 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.SpeechRecognitionAlternative();
|
4558 | while (reader.pos < end) {
|
4559 | var tag = reader.uint32();
|
4560 | switch (tag >>> 3) {
|
4561 | case 1:
|
4562 | message.transcript = reader.string();
|
4563 | break;
|
4564 | case 2:
|
4565 | message.confidence = reader.float();
|
4566 | break;
|
4567 | case 3:
|
4568 | if (!(message.words && message.words.length))
|
4569 | message.words = [];
|
4570 | message.words.push($root.google.cloud.speech.v1.WordInfo.decode(reader, reader.uint32()));
|
4571 | break;
|
4572 | default:
|
4573 | reader.skipType(tag & 7);
|
4574 | break;
|
4575 | }
|
4576 | }
|
4577 | return message;
|
4578 | };
|
4579 |
|
4580 | /**
|
4581 | * Decodes a SpeechRecognitionAlternative message from the specified reader or buffer, length delimited.
|
4582 | * @function decodeDelimited
|
4583 | * @memberof google.cloud.speech.v1.SpeechRecognitionAlternative
|
4584 | * @static
|
4585 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
4586 | * @returns {google.cloud.speech.v1.SpeechRecognitionAlternative} SpeechRecognitionAlternative
|
4587 | * @throws {Error} If the payload is not a reader or valid buffer
|
4588 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
4589 | */
|
4590 | SpeechRecognitionAlternative.decodeDelimited = function decodeDelimited(reader) {
|
4591 | if (!(reader instanceof $Reader))
|
4592 | reader = new $Reader(reader);
|
4593 | return this.decode(reader, reader.uint32());
|
4594 | };
|
4595 |
|
4596 | /**
|
4597 | * Verifies a SpeechRecognitionAlternative message.
|
4598 | * @function verify
|
4599 | * @memberof google.cloud.speech.v1.SpeechRecognitionAlternative
|
4600 | * @static
|
4601 | * @param {Object.<string,*>} message Plain object to verify
|
4602 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
4603 | */
|
4604 | SpeechRecognitionAlternative.verify = function verify(message) {
|
4605 | if (typeof message !== "object" || message === null)
|
4606 | return "object expected";
|
4607 | if (message.transcript != null && message.hasOwnProperty("transcript"))
|
4608 | if (!$util.isString(message.transcript))
|
4609 | return "transcript: string expected";
|
4610 | if (message.confidence != null && message.hasOwnProperty("confidence"))
|
4611 | if (typeof message.confidence !== "number")
|
4612 | return "confidence: number expected";
|
4613 | if (message.words != null && message.hasOwnProperty("words")) {
|
4614 | if (!Array.isArray(message.words))
|
4615 | return "words: array expected";
|
4616 | for (var i = 0; i < message.words.length; ++i) {
|
4617 | var error = $root.google.cloud.speech.v1.WordInfo.verify(message.words[i]);
|
4618 | if (error)
|
4619 | return "words." + error;
|
4620 | }
|
4621 | }
|
4622 | return null;
|
4623 | };
|
4624 |
|
4625 | /**
|
4626 | * Creates a SpeechRecognitionAlternative message from a plain object. Also converts values to their respective internal types.
|
4627 | * @function fromObject
|
4628 | * @memberof google.cloud.speech.v1.SpeechRecognitionAlternative
|
4629 | * @static
|
4630 | * @param {Object.<string,*>} object Plain object
|
4631 | * @returns {google.cloud.speech.v1.SpeechRecognitionAlternative} SpeechRecognitionAlternative
|
4632 | */
|
4633 | SpeechRecognitionAlternative.fromObject = function fromObject(object) {
|
4634 | if (object instanceof $root.google.cloud.speech.v1.SpeechRecognitionAlternative)
|
4635 | return object;
|
4636 | var message = new $root.google.cloud.speech.v1.SpeechRecognitionAlternative();
|
4637 | if (object.transcript != null)
|
4638 | message.transcript = String(object.transcript);
|
4639 | if (object.confidence != null)
|
4640 | message.confidence = Number(object.confidence);
|
4641 | if (object.words) {
|
4642 | if (!Array.isArray(object.words))
|
4643 | throw TypeError(".google.cloud.speech.v1.SpeechRecognitionAlternative.words: array expected");
|
4644 | message.words = [];
|
4645 | for (var i = 0; i < object.words.length; ++i) {
|
4646 | if (typeof object.words[i] !== "object")
|
4647 | throw TypeError(".google.cloud.speech.v1.SpeechRecognitionAlternative.words: object expected");
|
4648 | message.words[i] = $root.google.cloud.speech.v1.WordInfo.fromObject(object.words[i]);
|
4649 | }
|
4650 | }
|
4651 | return message;
|
4652 | };
|
4653 |
|
4654 | /**
|
4655 | * Creates a plain object from a SpeechRecognitionAlternative message. Also converts values to other types if specified.
|
4656 | * @function toObject
|
4657 | * @memberof google.cloud.speech.v1.SpeechRecognitionAlternative
|
4658 | * @static
|
4659 | * @param {google.cloud.speech.v1.SpeechRecognitionAlternative} message SpeechRecognitionAlternative
|
4660 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
4661 | * @returns {Object.<string,*>} Plain object
|
4662 | */
|
4663 | SpeechRecognitionAlternative.toObject = function toObject(message, options) {
|
4664 | if (!options)
|
4665 | options = {};
|
4666 | var object = {};
|
4667 | if (options.arrays || options.defaults)
|
4668 | object.words = [];
|
4669 | if (options.defaults) {
|
4670 | object.transcript = "";
|
4671 | object.confidence = 0;
|
4672 | }
|
4673 | if (message.transcript != null && message.hasOwnProperty("transcript"))
|
4674 | object.transcript = message.transcript;
|
4675 | if (message.confidence != null && message.hasOwnProperty("confidence"))
|
4676 | object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence;
|
4677 | if (message.words && message.words.length) {
|
4678 | object.words = [];
|
4679 | for (var j = 0; j < message.words.length; ++j)
|
4680 | object.words[j] = $root.google.cloud.speech.v1.WordInfo.toObject(message.words[j], options);
|
4681 | }
|
4682 | return object;
|
4683 | };
|
4684 |
|
4685 | /**
|
4686 | * Converts this SpeechRecognitionAlternative to JSON.
|
4687 | * @function toJSON
|
4688 | * @memberof google.cloud.speech.v1.SpeechRecognitionAlternative
|
4689 | * @instance
|
4690 | * @returns {Object.<string,*>} JSON object
|
4691 | */
|
4692 | SpeechRecognitionAlternative.prototype.toJSON = function toJSON() {
|
4693 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
4694 | };
|
4695 |
|
4696 | return SpeechRecognitionAlternative;
|
4697 | })();
|
4698 |
|
4699 | v1.WordInfo = (function() {
|
4700 |
|
4701 | /**
|
4702 | * Properties of a WordInfo.
|
4703 | * @memberof google.cloud.speech.v1
|
4704 | * @interface IWordInfo
|
4705 | * @property {google.protobuf.IDuration|null} [startTime] WordInfo startTime
|
4706 | * @property {google.protobuf.IDuration|null} [endTime] WordInfo endTime
|
4707 | * @property {string|null} [word] WordInfo word
|
4708 | * @property {number|null} [speakerTag] WordInfo speakerTag
|
4709 | */
|
4710 |
|
4711 | /**
|
4712 | * Constructs a new WordInfo.
|
4713 | * @memberof google.cloud.speech.v1
|
4714 | * @classdesc Represents a WordInfo.
|
4715 | * @implements IWordInfo
|
4716 | * @constructor
|
4717 | * @param {google.cloud.speech.v1.IWordInfo=} [properties] Properties to set
|
4718 | */
|
4719 | function WordInfo(properties) {
|
4720 | if (properties)
|
4721 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
4722 | if (properties[keys[i]] != null)
|
4723 | this[keys[i]] = properties[keys[i]];
|
4724 | }
|
4725 |
|
4726 | /**
|
4727 | * WordInfo startTime.
|
4728 | * @member {google.protobuf.IDuration|null|undefined} startTime
|
4729 | * @memberof google.cloud.speech.v1.WordInfo
|
4730 | * @instance
|
4731 | */
|
4732 | WordInfo.prototype.startTime = null;
|
4733 |
|
4734 | /**
|
4735 | * WordInfo endTime.
|
4736 | * @member {google.protobuf.IDuration|null|undefined} endTime
|
4737 | * @memberof google.cloud.speech.v1.WordInfo
|
4738 | * @instance
|
4739 | */
|
4740 | WordInfo.prototype.endTime = null;
|
4741 |
|
4742 | /**
|
4743 | * WordInfo word.
|
4744 | * @member {string} word
|
4745 | * @memberof google.cloud.speech.v1.WordInfo
|
4746 | * @instance
|
4747 | */
|
4748 | WordInfo.prototype.word = "";
|
4749 |
|
4750 | /**
|
4751 | * WordInfo speakerTag.
|
4752 | * @member {number} speakerTag
|
4753 | * @memberof google.cloud.speech.v1.WordInfo
|
4754 | * @instance
|
4755 | */
|
4756 | WordInfo.prototype.speakerTag = 0;
|
4757 |
|
4758 | /**
|
4759 | * Creates a new WordInfo instance using the specified properties.
|
4760 | * @function create
|
4761 | * @memberof google.cloud.speech.v1.WordInfo
|
4762 | * @static
|
4763 | * @param {google.cloud.speech.v1.IWordInfo=} [properties] Properties to set
|
4764 | * @returns {google.cloud.speech.v1.WordInfo} WordInfo instance
|
4765 | */
|
4766 | WordInfo.create = function create(properties) {
|
4767 | return new WordInfo(properties);
|
4768 | };
|
4769 |
|
4770 | /**
|
4771 | * Encodes the specified WordInfo message. Does not implicitly {@link google.cloud.speech.v1.WordInfo.verify|verify} messages.
|
4772 | * @function encode
|
4773 | * @memberof google.cloud.speech.v1.WordInfo
|
4774 | * @static
|
4775 | * @param {google.cloud.speech.v1.IWordInfo} message WordInfo message or plain object to encode
|
4776 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
4777 | * @returns {$protobuf.Writer} Writer
|
4778 | */
|
4779 | WordInfo.encode = function encode(message, writer) {
|
4780 | if (!writer)
|
4781 | writer = $Writer.create();
|
4782 | if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime"))
|
4783 | $root.google.protobuf.Duration.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
4784 | if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime"))
|
4785 | $root.google.protobuf.Duration.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
4786 | if (message.word != null && Object.hasOwnProperty.call(message, "word"))
|
4787 | writer.uint32(/* id 3, wireType 2 =*/26).string(message.word);
|
4788 | if (message.speakerTag != null && Object.hasOwnProperty.call(message, "speakerTag"))
|
4789 | writer.uint32(/* id 5, wireType 0 =*/40).int32(message.speakerTag);
|
4790 | return writer;
|
4791 | };
|
4792 |
|
4793 | /**
|
4794 | * Encodes the specified WordInfo message, length delimited. Does not implicitly {@link google.cloud.speech.v1.WordInfo.verify|verify} messages.
|
4795 | * @function encodeDelimited
|
4796 | * @memberof google.cloud.speech.v1.WordInfo
|
4797 | * @static
|
4798 | * @param {google.cloud.speech.v1.IWordInfo} message WordInfo message or plain object to encode
|
4799 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
4800 | * @returns {$protobuf.Writer} Writer
|
4801 | */
|
4802 | WordInfo.encodeDelimited = function encodeDelimited(message, writer) {
|
4803 | return this.encode(message, writer).ldelim();
|
4804 | };
|
4805 |
|
4806 | /**
|
4807 | * Decodes a WordInfo message from the specified reader or buffer.
|
4808 | * @function decode
|
4809 | * @memberof google.cloud.speech.v1.WordInfo
|
4810 | * @static
|
4811 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
4812 | * @param {number} [length] Message length if known beforehand
|
4813 | * @returns {google.cloud.speech.v1.WordInfo} WordInfo
|
4814 | * @throws {Error} If the payload is not a reader or valid buffer
|
4815 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
4816 | */
|
4817 | WordInfo.decode = function decode(reader, length) {
|
4818 | if (!(reader instanceof $Reader))
|
4819 | reader = $Reader.create(reader);
|
4820 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.WordInfo();
|
4821 | while (reader.pos < end) {
|
4822 | var tag = reader.uint32();
|
4823 | switch (tag >>> 3) {
|
4824 | case 1:
|
4825 | message.startTime = $root.google.protobuf.Duration.decode(reader, reader.uint32());
|
4826 | break;
|
4827 | case 2:
|
4828 | message.endTime = $root.google.protobuf.Duration.decode(reader, reader.uint32());
|
4829 | break;
|
4830 | case 3:
|
4831 | message.word = reader.string();
|
4832 | break;
|
4833 | case 5:
|
4834 | message.speakerTag = reader.int32();
|
4835 | break;
|
4836 | default:
|
4837 | reader.skipType(tag & 7);
|
4838 | break;
|
4839 | }
|
4840 | }
|
4841 | return message;
|
4842 | };
|
4843 |
|
4844 | /**
|
4845 | * Decodes a WordInfo message from the specified reader or buffer, length delimited.
|
4846 | * @function decodeDelimited
|
4847 | * @memberof google.cloud.speech.v1.WordInfo
|
4848 | * @static
|
4849 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
4850 | * @returns {google.cloud.speech.v1.WordInfo} WordInfo
|
4851 | * @throws {Error} If the payload is not a reader or valid buffer
|
4852 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
4853 | */
|
4854 | WordInfo.decodeDelimited = function decodeDelimited(reader) {
|
4855 | if (!(reader instanceof $Reader))
|
4856 | reader = new $Reader(reader);
|
4857 | return this.decode(reader, reader.uint32());
|
4858 | };
|
4859 |
|
4860 | /**
|
4861 | * Verifies a WordInfo message.
|
4862 | * @function verify
|
4863 | * @memberof google.cloud.speech.v1.WordInfo
|
4864 | * @static
|
4865 | * @param {Object.<string,*>} message Plain object to verify
|
4866 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
4867 | */
|
4868 | WordInfo.verify = function verify(message) {
|
4869 | if (typeof message !== "object" || message === null)
|
4870 | return "object expected";
|
4871 | if (message.startTime != null && message.hasOwnProperty("startTime")) {
|
4872 | var error = $root.google.protobuf.Duration.verify(message.startTime);
|
4873 | if (error)
|
4874 | return "startTime." + error;
|
4875 | }
|
4876 | if (message.endTime != null && message.hasOwnProperty("endTime")) {
|
4877 | var error = $root.google.protobuf.Duration.verify(message.endTime);
|
4878 | if (error)
|
4879 | return "endTime." + error;
|
4880 | }
|
4881 | if (message.word != null && message.hasOwnProperty("word"))
|
4882 | if (!$util.isString(message.word))
|
4883 | return "word: string expected";
|
4884 | if (message.speakerTag != null && message.hasOwnProperty("speakerTag"))
|
4885 | if (!$util.isInteger(message.speakerTag))
|
4886 | return "speakerTag: integer expected";
|
4887 | return null;
|
4888 | };
|
4889 |
|
4890 | /**
|
4891 | * Creates a WordInfo message from a plain object. Also converts values to their respective internal types.
|
4892 | * @function fromObject
|
4893 | * @memberof google.cloud.speech.v1.WordInfo
|
4894 | * @static
|
4895 | * @param {Object.<string,*>} object Plain object
|
4896 | * @returns {google.cloud.speech.v1.WordInfo} WordInfo
|
4897 | */
|
4898 | WordInfo.fromObject = function fromObject(object) {
|
4899 | if (object instanceof $root.google.cloud.speech.v1.WordInfo)
|
4900 | return object;
|
4901 | var message = new $root.google.cloud.speech.v1.WordInfo();
|
4902 | if (object.startTime != null) {
|
4903 | if (typeof object.startTime !== "object")
|
4904 | throw TypeError(".google.cloud.speech.v1.WordInfo.startTime: object expected");
|
4905 | message.startTime = $root.google.protobuf.Duration.fromObject(object.startTime);
|
4906 | }
|
4907 | if (object.endTime != null) {
|
4908 | if (typeof object.endTime !== "object")
|
4909 | throw TypeError(".google.cloud.speech.v1.WordInfo.endTime: object expected");
|
4910 | message.endTime = $root.google.protobuf.Duration.fromObject(object.endTime);
|
4911 | }
|
4912 | if (object.word != null)
|
4913 | message.word = String(object.word);
|
4914 | if (object.speakerTag != null)
|
4915 | message.speakerTag = object.speakerTag | 0;
|
4916 | return message;
|
4917 | };
|
4918 |
|
4919 | /**
|
4920 | * Creates a plain object from a WordInfo message. Also converts values to other types if specified.
|
4921 | * @function toObject
|
4922 | * @memberof google.cloud.speech.v1.WordInfo
|
4923 | * @static
|
4924 | * @param {google.cloud.speech.v1.WordInfo} message WordInfo
|
4925 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
4926 | * @returns {Object.<string,*>} Plain object
|
4927 | */
|
4928 | WordInfo.toObject = function toObject(message, options) {
|
4929 | if (!options)
|
4930 | options = {};
|
4931 | var object = {};
|
4932 | if (options.defaults) {
|
4933 | object.startTime = null;
|
4934 | object.endTime = null;
|
4935 | object.word = "";
|
4936 | object.speakerTag = 0;
|
4937 | }
|
4938 | if (message.startTime != null && message.hasOwnProperty("startTime"))
|
4939 | object.startTime = $root.google.protobuf.Duration.toObject(message.startTime, options);
|
4940 | if (message.endTime != null && message.hasOwnProperty("endTime"))
|
4941 | object.endTime = $root.google.protobuf.Duration.toObject(message.endTime, options);
|
4942 | if (message.word != null && message.hasOwnProperty("word"))
|
4943 | object.word = message.word;
|
4944 | if (message.speakerTag != null && message.hasOwnProperty("speakerTag"))
|
4945 | object.speakerTag = message.speakerTag;
|
4946 | return object;
|
4947 | };
|
4948 |
|
4949 | /**
|
4950 | * Converts this WordInfo to JSON.
|
4951 | * @function toJSON
|
4952 | * @memberof google.cloud.speech.v1.WordInfo
|
4953 | * @instance
|
4954 | * @returns {Object.<string,*>} JSON object
|
4955 | */
|
4956 | WordInfo.prototype.toJSON = function toJSON() {
|
4957 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
4958 | };
|
4959 |
|
4960 | return WordInfo;
|
4961 | })();
|
4962 |
|
4963 | return v1;
|
4964 | })();
|
4965 |
|
4966 | speech.v1p1beta1 = (function() {
|
4967 |
|
4968 | /**
|
4969 | * Namespace v1p1beta1.
|
4970 | * @memberof google.cloud.speech
|
4971 | * @namespace
|
4972 | */
|
4973 | var v1p1beta1 = {};
|
4974 |
|
4975 | v1p1beta1.Speech = (function() {
|
4976 |
|
4977 | /**
|
4978 | * Constructs a new Speech service.
|
4979 | * @memberof google.cloud.speech.v1p1beta1
|
4980 | * @classdesc Represents a Speech
|
4981 | * @extends $protobuf.rpc.Service
|
4982 | * @constructor
|
4983 | * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
|
4984 | * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
|
4985 | * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
|
4986 | */
|
4987 | function Speech(rpcImpl, requestDelimited, responseDelimited) {
|
4988 | $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);
|
4989 | }
|
4990 |
|
4991 | (Speech.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Speech;
|
4992 |
|
4993 | /**
|
4994 | * Creates new Speech service using the specified rpc implementation.
|
4995 | * @function create
|
4996 | * @memberof google.cloud.speech.v1p1beta1.Speech
|
4997 | * @static
|
4998 | * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
|
4999 | * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
|
5000 | * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
|
5001 | * @returns {Speech} RPC service. Useful where requests and/or responses are streamed.
|
5002 | */
|
5003 | Speech.create = function create(rpcImpl, requestDelimited, responseDelimited) {
|
5004 | return new this(rpcImpl, requestDelimited, responseDelimited);
|
5005 | };
|
5006 |
|
5007 | /**
|
5008 | * Callback as used by {@link google.cloud.speech.v1p1beta1.Speech#recognize}.
|
5009 | * @memberof google.cloud.speech.v1p1beta1.Speech
|
5010 | * @typedef RecognizeCallback
|
5011 | * @type {function}
|
5012 | * @param {Error|null} error Error, if any
|
5013 | * @param {google.cloud.speech.v1p1beta1.RecognizeResponse} [response] RecognizeResponse
|
5014 | */
|
5015 |
|
5016 | /**
|
5017 | * Calls Recognize.
|
5018 | * @function recognize
|
5019 | * @memberof google.cloud.speech.v1p1beta1.Speech
|
5020 | * @instance
|
5021 | * @param {google.cloud.speech.v1p1beta1.IRecognizeRequest} request RecognizeRequest message or plain object
|
5022 | * @param {google.cloud.speech.v1p1beta1.Speech.RecognizeCallback} callback Node-style callback called with the error, if any, and RecognizeResponse
|
5023 | * @returns {undefined}
|
5024 | * @variation 1
|
5025 | */
|
5026 | Object.defineProperty(Speech.prototype.recognize = function recognize(request, callback) {
|
5027 | return this.rpcCall(recognize, $root.google.cloud.speech.v1p1beta1.RecognizeRequest, $root.google.cloud.speech.v1p1beta1.RecognizeResponse, request, callback);
|
5028 | }, "name", { value: "Recognize" });
|
5029 |
|
5030 | /**
|
5031 | * Calls Recognize.
|
5032 | * @function recognize
|
5033 | * @memberof google.cloud.speech.v1p1beta1.Speech
|
5034 | * @instance
|
5035 | * @param {google.cloud.speech.v1p1beta1.IRecognizeRequest} request RecognizeRequest message or plain object
|
5036 | * @returns {Promise<google.cloud.speech.v1p1beta1.RecognizeResponse>} Promise
|
5037 | * @variation 2
|
5038 | */
|
5039 |
|
5040 | /**
|
5041 | * Callback as used by {@link google.cloud.speech.v1p1beta1.Speech#longRunningRecognize}.
|
5042 | * @memberof google.cloud.speech.v1p1beta1.Speech
|
5043 | * @typedef LongRunningRecognizeCallback
|
5044 | * @type {function}
|
5045 | * @param {Error|null} error Error, if any
|
5046 | * @param {google.longrunning.Operation} [response] Operation
|
5047 | */
|
5048 |
|
5049 | /**
|
5050 | * Calls LongRunningRecognize.
|
5051 | * @function longRunningRecognize
|
5052 | * @memberof google.cloud.speech.v1p1beta1.Speech
|
5053 | * @instance
|
5054 | * @param {google.cloud.speech.v1p1beta1.ILongRunningRecognizeRequest} request LongRunningRecognizeRequest message or plain object
|
5055 | * @param {google.cloud.speech.v1p1beta1.Speech.LongRunningRecognizeCallback} callback Node-style callback called with the error, if any, and Operation
|
5056 | * @returns {undefined}
|
5057 | * @variation 1
|
5058 | */
|
5059 | Object.defineProperty(Speech.prototype.longRunningRecognize = function longRunningRecognize(request, callback) {
|
5060 | return this.rpcCall(longRunningRecognize, $root.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest, $root.google.longrunning.Operation, request, callback);
|
5061 | }, "name", { value: "LongRunningRecognize" });
|
5062 |
|
5063 | /**
|
5064 | * Calls LongRunningRecognize.
|
5065 | * @function longRunningRecognize
|
5066 | * @memberof google.cloud.speech.v1p1beta1.Speech
|
5067 | * @instance
|
5068 | * @param {google.cloud.speech.v1p1beta1.ILongRunningRecognizeRequest} request LongRunningRecognizeRequest message or plain object
|
5069 | * @returns {Promise<google.longrunning.Operation>} Promise
|
5070 | * @variation 2
|
5071 | */
|
5072 |
|
5073 | /**
|
5074 | * Callback as used by {@link google.cloud.speech.v1p1beta1.Speech#streamingRecognize}.
|
5075 | * @memberof google.cloud.speech.v1p1beta1.Speech
|
5076 | * @typedef StreamingRecognizeCallback
|
5077 | * @type {function}
|
5078 | * @param {Error|null} error Error, if any
|
5079 | * @param {google.cloud.speech.v1p1beta1.StreamingRecognizeResponse} [response] StreamingRecognizeResponse
|
5080 | */
|
5081 |
|
5082 | /**
|
5083 | * Calls StreamingRecognize.
|
5084 | * @function streamingRecognize
|
5085 | * @memberof google.cloud.speech.v1p1beta1.Speech
|
5086 | * @instance
|
5087 | * @param {google.cloud.speech.v1p1beta1.IStreamingRecognizeRequest} request StreamingRecognizeRequest message or plain object
|
5088 | * @param {google.cloud.speech.v1p1beta1.Speech.StreamingRecognizeCallback} callback Node-style callback called with the error, if any, and StreamingRecognizeResponse
|
5089 | * @returns {undefined}
|
5090 | * @variation 1
|
5091 | */
|
5092 | Object.defineProperty(Speech.prototype.streamingRecognize = function streamingRecognize(request, callback) {
|
5093 | return this.rpcCall(streamingRecognize, $root.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest, $root.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse, request, callback);
|
5094 | }, "name", { value: "StreamingRecognize" });
|
5095 |
|
5096 | /**
|
5097 | * Calls StreamingRecognize.
|
5098 | * @function streamingRecognize
|
5099 | * @memberof google.cloud.speech.v1p1beta1.Speech
|
5100 | * @instance
|
5101 | * @param {google.cloud.speech.v1p1beta1.IStreamingRecognizeRequest} request StreamingRecognizeRequest message or plain object
|
5102 | * @returns {Promise<google.cloud.speech.v1p1beta1.StreamingRecognizeResponse>} Promise
|
5103 | * @variation 2
|
5104 | */
|
5105 |
|
5106 | return Speech;
|
5107 | })();
|
5108 |
|
5109 | v1p1beta1.RecognizeRequest = (function() {
|
5110 |
|
5111 | /**
|
5112 | * Properties of a RecognizeRequest.
|
5113 | * @memberof google.cloud.speech.v1p1beta1
|
5114 | * @interface IRecognizeRequest
|
5115 | * @property {google.cloud.speech.v1p1beta1.IRecognitionConfig|null} [config] RecognizeRequest config
|
5116 | * @property {google.cloud.speech.v1p1beta1.IRecognitionAudio|null} [audio] RecognizeRequest audio
|
5117 | */
|
5118 |
|
5119 | /**
|
5120 | * Constructs a new RecognizeRequest.
|
5121 | * @memberof google.cloud.speech.v1p1beta1
|
5122 | * @classdesc Represents a RecognizeRequest.
|
5123 | * @implements IRecognizeRequest
|
5124 | * @constructor
|
5125 | * @param {google.cloud.speech.v1p1beta1.IRecognizeRequest=} [properties] Properties to set
|
5126 | */
|
5127 | function RecognizeRequest(properties) {
|
5128 | if (properties)
|
5129 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
5130 | if (properties[keys[i]] != null)
|
5131 | this[keys[i]] = properties[keys[i]];
|
5132 | }
|
5133 |
|
5134 | /**
|
5135 | * RecognizeRequest config.
|
5136 | * @member {google.cloud.speech.v1p1beta1.IRecognitionConfig|null|undefined} config
|
5137 | * @memberof google.cloud.speech.v1p1beta1.RecognizeRequest
|
5138 | * @instance
|
5139 | */
|
5140 | RecognizeRequest.prototype.config = null;
|
5141 |
|
5142 | /**
|
5143 | * RecognizeRequest audio.
|
5144 | * @member {google.cloud.speech.v1p1beta1.IRecognitionAudio|null|undefined} audio
|
5145 | * @memberof google.cloud.speech.v1p1beta1.RecognizeRequest
|
5146 | * @instance
|
5147 | */
|
5148 | RecognizeRequest.prototype.audio = null;
|
5149 |
|
5150 | /**
|
5151 | * Creates a new RecognizeRequest instance using the specified properties.
|
5152 | * @function create
|
5153 | * @memberof google.cloud.speech.v1p1beta1.RecognizeRequest
|
5154 | * @static
|
5155 | * @param {google.cloud.speech.v1p1beta1.IRecognizeRequest=} [properties] Properties to set
|
5156 | * @returns {google.cloud.speech.v1p1beta1.RecognizeRequest} RecognizeRequest instance
|
5157 | */
|
5158 | RecognizeRequest.create = function create(properties) {
|
5159 | return new RecognizeRequest(properties);
|
5160 | };
|
5161 |
|
5162 | /**
|
5163 | * Encodes the specified RecognizeRequest message. Does not implicitly {@link google.cloud.speech.v1p1beta1.RecognizeRequest.verify|verify} messages.
|
5164 | * @function encode
|
5165 | * @memberof google.cloud.speech.v1p1beta1.RecognizeRequest
|
5166 | * @static
|
5167 | * @param {google.cloud.speech.v1p1beta1.IRecognizeRequest} message RecognizeRequest message or plain object to encode
|
5168 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
5169 | * @returns {$protobuf.Writer} Writer
|
5170 | */
|
5171 | RecognizeRequest.encode = function encode(message, writer) {
|
5172 | if (!writer)
|
5173 | writer = $Writer.create();
|
5174 | if (message.config != null && Object.hasOwnProperty.call(message, "config"))
|
5175 | $root.google.cloud.speech.v1p1beta1.RecognitionConfig.encode(message.config, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
5176 | if (message.audio != null && Object.hasOwnProperty.call(message, "audio"))
|
5177 | $root.google.cloud.speech.v1p1beta1.RecognitionAudio.encode(message.audio, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
5178 | return writer;
|
5179 | };
|
5180 |
|
5181 | /**
|
5182 | * Encodes the specified RecognizeRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.RecognizeRequest.verify|verify} messages.
|
5183 | * @function encodeDelimited
|
5184 | * @memberof google.cloud.speech.v1p1beta1.RecognizeRequest
|
5185 | * @static
|
5186 | * @param {google.cloud.speech.v1p1beta1.IRecognizeRequest} message RecognizeRequest message or plain object to encode
|
5187 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
5188 | * @returns {$protobuf.Writer} Writer
|
5189 | */
|
5190 | RecognizeRequest.encodeDelimited = function encodeDelimited(message, writer) {
|
5191 | return this.encode(message, writer).ldelim();
|
5192 | };
|
5193 |
|
5194 | /**
|
5195 | * Decodes a RecognizeRequest message from the specified reader or buffer.
|
5196 | * @function decode
|
5197 | * @memberof google.cloud.speech.v1p1beta1.RecognizeRequest
|
5198 | * @static
|
5199 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
5200 | * @param {number} [length] Message length if known beforehand
|
5201 | * @returns {google.cloud.speech.v1p1beta1.RecognizeRequest} RecognizeRequest
|
5202 | * @throws {Error} If the payload is not a reader or valid buffer
|
5203 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
5204 | */
|
5205 | RecognizeRequest.decode = function decode(reader, length) {
|
5206 | if (!(reader instanceof $Reader))
|
5207 | reader = $Reader.create(reader);
|
5208 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.RecognizeRequest();
|
5209 | while (reader.pos < end) {
|
5210 | var tag = reader.uint32();
|
5211 | switch (tag >>> 3) {
|
5212 | case 1:
|
5213 | message.config = $root.google.cloud.speech.v1p1beta1.RecognitionConfig.decode(reader, reader.uint32());
|
5214 | break;
|
5215 | case 2:
|
5216 | message.audio = $root.google.cloud.speech.v1p1beta1.RecognitionAudio.decode(reader, reader.uint32());
|
5217 | break;
|
5218 | default:
|
5219 | reader.skipType(tag & 7);
|
5220 | break;
|
5221 | }
|
5222 | }
|
5223 | return message;
|
5224 | };
|
5225 |
|
5226 | /**
|
5227 | * Decodes a RecognizeRequest message from the specified reader or buffer, length delimited.
|
5228 | * @function decodeDelimited
|
5229 | * @memberof google.cloud.speech.v1p1beta1.RecognizeRequest
|
5230 | * @static
|
5231 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
5232 | * @returns {google.cloud.speech.v1p1beta1.RecognizeRequest} RecognizeRequest
|
5233 | * @throws {Error} If the payload is not a reader or valid buffer
|
5234 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
5235 | */
|
5236 | RecognizeRequest.decodeDelimited = function decodeDelimited(reader) {
|
5237 | if (!(reader instanceof $Reader))
|
5238 | reader = new $Reader(reader);
|
5239 | return this.decode(reader, reader.uint32());
|
5240 | };
|
5241 |
|
5242 | /**
|
5243 | * Verifies a RecognizeRequest message.
|
5244 | * @function verify
|
5245 | * @memberof google.cloud.speech.v1p1beta1.RecognizeRequest
|
5246 | * @static
|
5247 | * @param {Object.<string,*>} message Plain object to verify
|
5248 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
5249 | */
|
5250 | RecognizeRequest.verify = function verify(message) {
|
5251 | if (typeof message !== "object" || message === null)
|
5252 | return "object expected";
|
5253 | if (message.config != null && message.hasOwnProperty("config")) {
|
5254 | var error = $root.google.cloud.speech.v1p1beta1.RecognitionConfig.verify(message.config);
|
5255 | if (error)
|
5256 | return "config." + error;
|
5257 | }
|
5258 | if (message.audio != null && message.hasOwnProperty("audio")) {
|
5259 | var error = $root.google.cloud.speech.v1p1beta1.RecognitionAudio.verify(message.audio);
|
5260 | if (error)
|
5261 | return "audio." + error;
|
5262 | }
|
5263 | return null;
|
5264 | };
|
5265 |
|
5266 | /**
|
5267 | * Creates a RecognizeRequest message from a plain object. Also converts values to their respective internal types.
|
5268 | * @function fromObject
|
5269 | * @memberof google.cloud.speech.v1p1beta1.RecognizeRequest
|
5270 | * @static
|
5271 | * @param {Object.<string,*>} object Plain object
|
5272 | * @returns {google.cloud.speech.v1p1beta1.RecognizeRequest} RecognizeRequest
|
5273 | */
|
5274 | RecognizeRequest.fromObject = function fromObject(object) {
|
5275 | if (object instanceof $root.google.cloud.speech.v1p1beta1.RecognizeRequest)
|
5276 | return object;
|
5277 | var message = new $root.google.cloud.speech.v1p1beta1.RecognizeRequest();
|
5278 | if (object.config != null) {
|
5279 | if (typeof object.config !== "object")
|
5280 | throw TypeError(".google.cloud.speech.v1p1beta1.RecognizeRequest.config: object expected");
|
5281 | message.config = $root.google.cloud.speech.v1p1beta1.RecognitionConfig.fromObject(object.config);
|
5282 | }
|
5283 | if (object.audio != null) {
|
5284 | if (typeof object.audio !== "object")
|
5285 | throw TypeError(".google.cloud.speech.v1p1beta1.RecognizeRequest.audio: object expected");
|
5286 | message.audio = $root.google.cloud.speech.v1p1beta1.RecognitionAudio.fromObject(object.audio);
|
5287 | }
|
5288 | return message;
|
5289 | };
|
5290 |
|
5291 | /**
|
5292 | * Creates a plain object from a RecognizeRequest message. Also converts values to other types if specified.
|
5293 | * @function toObject
|
5294 | * @memberof google.cloud.speech.v1p1beta1.RecognizeRequest
|
5295 | * @static
|
5296 | * @param {google.cloud.speech.v1p1beta1.RecognizeRequest} message RecognizeRequest
|
5297 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
5298 | * @returns {Object.<string,*>} Plain object
|
5299 | */
|
5300 | RecognizeRequest.toObject = function toObject(message, options) {
|
5301 | if (!options)
|
5302 | options = {};
|
5303 | var object = {};
|
5304 | if (options.defaults) {
|
5305 | object.config = null;
|
5306 | object.audio = null;
|
5307 | }
|
5308 | if (message.config != null && message.hasOwnProperty("config"))
|
5309 | object.config = $root.google.cloud.speech.v1p1beta1.RecognitionConfig.toObject(message.config, options);
|
5310 | if (message.audio != null && message.hasOwnProperty("audio"))
|
5311 | object.audio = $root.google.cloud.speech.v1p1beta1.RecognitionAudio.toObject(message.audio, options);
|
5312 | return object;
|
5313 | };
|
5314 |
|
5315 | /**
|
5316 | * Converts this RecognizeRequest to JSON.
|
5317 | * @function toJSON
|
5318 | * @memberof google.cloud.speech.v1p1beta1.RecognizeRequest
|
5319 | * @instance
|
5320 | * @returns {Object.<string,*>} JSON object
|
5321 | */
|
5322 | RecognizeRequest.prototype.toJSON = function toJSON() {
|
5323 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
5324 | };
|
5325 |
|
5326 | return RecognizeRequest;
|
5327 | })();
|
5328 |
|
5329 | v1p1beta1.LongRunningRecognizeRequest = (function() {
|
5330 |
|
5331 | /**
|
5332 | * Properties of a LongRunningRecognizeRequest.
|
5333 | * @memberof google.cloud.speech.v1p1beta1
|
5334 | * @interface ILongRunningRecognizeRequest
|
5335 | * @property {google.cloud.speech.v1p1beta1.IRecognitionConfig|null} [config] LongRunningRecognizeRequest config
|
5336 | * @property {google.cloud.speech.v1p1beta1.IRecognitionAudio|null} [audio] LongRunningRecognizeRequest audio
|
5337 | * @property {google.cloud.speech.v1p1beta1.ITranscriptOutputConfig|null} [outputConfig] LongRunningRecognizeRequest outputConfig
|
5338 | */
|
5339 |
|
5340 | /**
|
5341 | * Constructs a new LongRunningRecognizeRequest.
|
5342 | * @memberof google.cloud.speech.v1p1beta1
|
5343 | * @classdesc Represents a LongRunningRecognizeRequest.
|
5344 | * @implements ILongRunningRecognizeRequest
|
5345 | * @constructor
|
5346 | * @param {google.cloud.speech.v1p1beta1.ILongRunningRecognizeRequest=} [properties] Properties to set
|
5347 | */
|
5348 | function LongRunningRecognizeRequest(properties) {
|
5349 | if (properties)
|
5350 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
5351 | if (properties[keys[i]] != null)
|
5352 | this[keys[i]] = properties[keys[i]];
|
5353 | }
|
5354 |
|
5355 | /**
|
5356 | * LongRunningRecognizeRequest config.
|
5357 | * @member {google.cloud.speech.v1p1beta1.IRecognitionConfig|null|undefined} config
|
5358 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest
|
5359 | * @instance
|
5360 | */
|
5361 | LongRunningRecognizeRequest.prototype.config = null;
|
5362 |
|
5363 | /**
|
5364 | * LongRunningRecognizeRequest audio.
|
5365 | * @member {google.cloud.speech.v1p1beta1.IRecognitionAudio|null|undefined} audio
|
5366 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest
|
5367 | * @instance
|
5368 | */
|
5369 | LongRunningRecognizeRequest.prototype.audio = null;
|
5370 |
|
5371 | /**
|
5372 | * LongRunningRecognizeRequest outputConfig.
|
5373 | * @member {google.cloud.speech.v1p1beta1.ITranscriptOutputConfig|null|undefined} outputConfig
|
5374 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest
|
5375 | * @instance
|
5376 | */
|
5377 | LongRunningRecognizeRequest.prototype.outputConfig = null;
|
5378 |
|
5379 | /**
|
5380 | * Creates a new LongRunningRecognizeRequest instance using the specified properties.
|
5381 | * @function create
|
5382 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest
|
5383 | * @static
|
5384 | * @param {google.cloud.speech.v1p1beta1.ILongRunningRecognizeRequest=} [properties] Properties to set
|
5385 | * @returns {google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest} LongRunningRecognizeRequest instance
|
5386 | */
|
5387 | LongRunningRecognizeRequest.create = function create(properties) {
|
5388 | return new LongRunningRecognizeRequest(properties);
|
5389 | };
|
5390 |
|
5391 | /**
|
5392 | * Encodes the specified LongRunningRecognizeRequest message. Does not implicitly {@link google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest.verify|verify} messages.
|
5393 | * @function encode
|
5394 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest
|
5395 | * @static
|
5396 | * @param {google.cloud.speech.v1p1beta1.ILongRunningRecognizeRequest} message LongRunningRecognizeRequest message or plain object to encode
|
5397 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
5398 | * @returns {$protobuf.Writer} Writer
|
5399 | */
|
5400 | LongRunningRecognizeRequest.encode = function encode(message, writer) {
|
5401 | if (!writer)
|
5402 | writer = $Writer.create();
|
5403 | if (message.config != null && Object.hasOwnProperty.call(message, "config"))
|
5404 | $root.google.cloud.speech.v1p1beta1.RecognitionConfig.encode(message.config, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
5405 | if (message.audio != null && Object.hasOwnProperty.call(message, "audio"))
|
5406 | $root.google.cloud.speech.v1p1beta1.RecognitionAudio.encode(message.audio, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
5407 | if (message.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig"))
|
5408 | $root.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.encode(message.outputConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
|
5409 | return writer;
|
5410 | };
|
5411 |
|
5412 | /**
|
5413 | * Encodes the specified LongRunningRecognizeRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest.verify|verify} messages.
|
5414 | * @function encodeDelimited
|
5415 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest
|
5416 | * @static
|
5417 | * @param {google.cloud.speech.v1p1beta1.ILongRunningRecognizeRequest} message LongRunningRecognizeRequest message or plain object to encode
|
5418 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
5419 | * @returns {$protobuf.Writer} Writer
|
5420 | */
|
5421 | LongRunningRecognizeRequest.encodeDelimited = function encodeDelimited(message, writer) {
|
5422 | return this.encode(message, writer).ldelim();
|
5423 | };
|
5424 |
|
5425 | /**
|
5426 | * Decodes a LongRunningRecognizeRequest message from the specified reader or buffer.
|
5427 | * @function decode
|
5428 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest
|
5429 | * @static
|
5430 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
5431 | * @param {number} [length] Message length if known beforehand
|
5432 | * @returns {google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest} LongRunningRecognizeRequest
|
5433 | * @throws {Error} If the payload is not a reader or valid buffer
|
5434 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
5435 | */
|
5436 | LongRunningRecognizeRequest.decode = function decode(reader, length) {
|
5437 | if (!(reader instanceof $Reader))
|
5438 | reader = $Reader.create(reader);
|
5439 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest();
|
5440 | while (reader.pos < end) {
|
5441 | var tag = reader.uint32();
|
5442 | switch (tag >>> 3) {
|
5443 | case 1:
|
5444 | message.config = $root.google.cloud.speech.v1p1beta1.RecognitionConfig.decode(reader, reader.uint32());
|
5445 | break;
|
5446 | case 2:
|
5447 | message.audio = $root.google.cloud.speech.v1p1beta1.RecognitionAudio.decode(reader, reader.uint32());
|
5448 | break;
|
5449 | case 4:
|
5450 | message.outputConfig = $root.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.decode(reader, reader.uint32());
|
5451 | break;
|
5452 | default:
|
5453 | reader.skipType(tag & 7);
|
5454 | break;
|
5455 | }
|
5456 | }
|
5457 | return message;
|
5458 | };
|
5459 |
|
5460 | /**
|
5461 | * Decodes a LongRunningRecognizeRequest message from the specified reader or buffer, length delimited.
|
5462 | * @function decodeDelimited
|
5463 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest
|
5464 | * @static
|
5465 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
5466 | * @returns {google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest} LongRunningRecognizeRequest
|
5467 | * @throws {Error} If the payload is not a reader or valid buffer
|
5468 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
5469 | */
|
5470 | LongRunningRecognizeRequest.decodeDelimited = function decodeDelimited(reader) {
|
5471 | if (!(reader instanceof $Reader))
|
5472 | reader = new $Reader(reader);
|
5473 | return this.decode(reader, reader.uint32());
|
5474 | };
|
5475 |
|
5476 | /**
|
5477 | * Verifies a LongRunningRecognizeRequest message.
|
5478 | * @function verify
|
5479 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest
|
5480 | * @static
|
5481 | * @param {Object.<string,*>} message Plain object to verify
|
5482 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
5483 | */
|
5484 | LongRunningRecognizeRequest.verify = function verify(message) {
|
5485 | if (typeof message !== "object" || message === null)
|
5486 | return "object expected";
|
5487 | if (message.config != null && message.hasOwnProperty("config")) {
|
5488 | var error = $root.google.cloud.speech.v1p1beta1.RecognitionConfig.verify(message.config);
|
5489 | if (error)
|
5490 | return "config." + error;
|
5491 | }
|
5492 | if (message.audio != null && message.hasOwnProperty("audio")) {
|
5493 | var error = $root.google.cloud.speech.v1p1beta1.RecognitionAudio.verify(message.audio);
|
5494 | if (error)
|
5495 | return "audio." + error;
|
5496 | }
|
5497 | if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) {
|
5498 | var error = $root.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.verify(message.outputConfig);
|
5499 | if (error)
|
5500 | return "outputConfig." + error;
|
5501 | }
|
5502 | return null;
|
5503 | };
|
5504 |
|
5505 | /**
|
5506 | * Creates a LongRunningRecognizeRequest message from a plain object. Also converts values to their respective internal types.
|
5507 | * @function fromObject
|
5508 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest
|
5509 | * @static
|
5510 | * @param {Object.<string,*>} object Plain object
|
5511 | * @returns {google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest} LongRunningRecognizeRequest
|
5512 | */
|
5513 | LongRunningRecognizeRequest.fromObject = function fromObject(object) {
|
5514 | if (object instanceof $root.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest)
|
5515 | return object;
|
5516 | var message = new $root.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest();
|
5517 | if (object.config != null) {
|
5518 | if (typeof object.config !== "object")
|
5519 | throw TypeError(".google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest.config: object expected");
|
5520 | message.config = $root.google.cloud.speech.v1p1beta1.RecognitionConfig.fromObject(object.config);
|
5521 | }
|
5522 | if (object.audio != null) {
|
5523 | if (typeof object.audio !== "object")
|
5524 | throw TypeError(".google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest.audio: object expected");
|
5525 | message.audio = $root.google.cloud.speech.v1p1beta1.RecognitionAudio.fromObject(object.audio);
|
5526 | }
|
5527 | if (object.outputConfig != null) {
|
5528 | if (typeof object.outputConfig !== "object")
|
5529 | throw TypeError(".google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest.outputConfig: object expected");
|
5530 | message.outputConfig = $root.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.fromObject(object.outputConfig);
|
5531 | }
|
5532 | return message;
|
5533 | };
|
5534 |
|
5535 | /**
|
5536 | * Creates a plain object from a LongRunningRecognizeRequest message. Also converts values to other types if specified.
|
5537 | * @function toObject
|
5538 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest
|
5539 | * @static
|
5540 | * @param {google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest} message LongRunningRecognizeRequest
|
5541 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
5542 | * @returns {Object.<string,*>} Plain object
|
5543 | */
|
5544 | LongRunningRecognizeRequest.toObject = function toObject(message, options) {
|
5545 | if (!options)
|
5546 | options = {};
|
5547 | var object = {};
|
5548 | if (options.defaults) {
|
5549 | object.config = null;
|
5550 | object.audio = null;
|
5551 | object.outputConfig = null;
|
5552 | }
|
5553 | if (message.config != null && message.hasOwnProperty("config"))
|
5554 | object.config = $root.google.cloud.speech.v1p1beta1.RecognitionConfig.toObject(message.config, options);
|
5555 | if (message.audio != null && message.hasOwnProperty("audio"))
|
5556 | object.audio = $root.google.cloud.speech.v1p1beta1.RecognitionAudio.toObject(message.audio, options);
|
5557 | if (message.outputConfig != null && message.hasOwnProperty("outputConfig"))
|
5558 | object.outputConfig = $root.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.toObject(message.outputConfig, options);
|
5559 | return object;
|
5560 | };
|
5561 |
|
5562 | /**
|
5563 | * Converts this LongRunningRecognizeRequest to JSON.
|
5564 | * @function toJSON
|
5565 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest
|
5566 | * @instance
|
5567 | * @returns {Object.<string,*>} JSON object
|
5568 | */
|
5569 | LongRunningRecognizeRequest.prototype.toJSON = function toJSON() {
|
5570 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
5571 | };
|
5572 |
|
5573 | return LongRunningRecognizeRequest;
|
5574 | })();
|
5575 |
|
5576 | v1p1beta1.TranscriptOutputConfig = (function() {
|
5577 |
|
5578 | /**
|
5579 | * Properties of a TranscriptOutputConfig.
|
5580 | * @memberof google.cloud.speech.v1p1beta1
|
5581 | * @interface ITranscriptOutputConfig
|
5582 | * @property {string|null} [gcsUri] TranscriptOutputConfig gcsUri
|
5583 | */
|
5584 |
|
5585 | /**
|
5586 | * Constructs a new TranscriptOutputConfig.
|
5587 | * @memberof google.cloud.speech.v1p1beta1
|
5588 | * @classdesc Represents a TranscriptOutputConfig.
|
5589 | * @implements ITranscriptOutputConfig
|
5590 | * @constructor
|
5591 | * @param {google.cloud.speech.v1p1beta1.ITranscriptOutputConfig=} [properties] Properties to set
|
5592 | */
|
5593 | function TranscriptOutputConfig(properties) {
|
5594 | if (properties)
|
5595 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
5596 | if (properties[keys[i]] != null)
|
5597 | this[keys[i]] = properties[keys[i]];
|
5598 | }
|
5599 |
|
5600 | /**
|
5601 | * TranscriptOutputConfig gcsUri.
|
5602 | * @member {string|null|undefined} gcsUri
|
5603 | * @memberof google.cloud.speech.v1p1beta1.TranscriptOutputConfig
|
5604 | * @instance
|
5605 | */
|
5606 | TranscriptOutputConfig.prototype.gcsUri = null;
|
5607 |
|
5608 | // OneOf field names bound to virtual getters and setters
|
5609 | var $oneOfFields;
|
5610 |
|
5611 | /**
|
5612 | * TranscriptOutputConfig outputType.
|
5613 | * @member {"gcsUri"|undefined} outputType
|
5614 | * @memberof google.cloud.speech.v1p1beta1.TranscriptOutputConfig
|
5615 | * @instance
|
5616 | */
|
5617 | Object.defineProperty(TranscriptOutputConfig.prototype, "outputType", {
|
5618 | get: $util.oneOfGetter($oneOfFields = ["gcsUri"]),
|
5619 | set: $util.oneOfSetter($oneOfFields)
|
5620 | });
|
5621 |
|
5622 | /**
|
5623 | * Creates a new TranscriptOutputConfig instance using the specified properties.
|
5624 | * @function create
|
5625 | * @memberof google.cloud.speech.v1p1beta1.TranscriptOutputConfig
|
5626 | * @static
|
5627 | * @param {google.cloud.speech.v1p1beta1.ITranscriptOutputConfig=} [properties] Properties to set
|
5628 | * @returns {google.cloud.speech.v1p1beta1.TranscriptOutputConfig} TranscriptOutputConfig instance
|
5629 | */
|
5630 | TranscriptOutputConfig.create = function create(properties) {
|
5631 | return new TranscriptOutputConfig(properties);
|
5632 | };
|
5633 |
|
5634 | /**
|
5635 | * Encodes the specified TranscriptOutputConfig message. Does not implicitly {@link google.cloud.speech.v1p1beta1.TranscriptOutputConfig.verify|verify} messages.
|
5636 | * @function encode
|
5637 | * @memberof google.cloud.speech.v1p1beta1.TranscriptOutputConfig
|
5638 | * @static
|
5639 | * @param {google.cloud.speech.v1p1beta1.ITranscriptOutputConfig} message TranscriptOutputConfig message or plain object to encode
|
5640 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
5641 | * @returns {$protobuf.Writer} Writer
|
5642 | */
|
5643 | TranscriptOutputConfig.encode = function encode(message, writer) {
|
5644 | if (!writer)
|
5645 | writer = $Writer.create();
|
5646 | if (message.gcsUri != null && Object.hasOwnProperty.call(message, "gcsUri"))
|
5647 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcsUri);
|
5648 | return writer;
|
5649 | };
|
5650 |
|
5651 | /**
|
5652 | * Encodes the specified TranscriptOutputConfig message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.TranscriptOutputConfig.verify|verify} messages.
|
5653 | * @function encodeDelimited
|
5654 | * @memberof google.cloud.speech.v1p1beta1.TranscriptOutputConfig
|
5655 | * @static
|
5656 | * @param {google.cloud.speech.v1p1beta1.ITranscriptOutputConfig} message TranscriptOutputConfig message or plain object to encode
|
5657 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
5658 | * @returns {$protobuf.Writer} Writer
|
5659 | */
|
5660 | TranscriptOutputConfig.encodeDelimited = function encodeDelimited(message, writer) {
|
5661 | return this.encode(message, writer).ldelim();
|
5662 | };
|
5663 |
|
5664 | /**
|
5665 | * Decodes a TranscriptOutputConfig message from the specified reader or buffer.
|
5666 | * @function decode
|
5667 | * @memberof google.cloud.speech.v1p1beta1.TranscriptOutputConfig
|
5668 | * @static
|
5669 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
5670 | * @param {number} [length] Message length if known beforehand
|
5671 | * @returns {google.cloud.speech.v1p1beta1.TranscriptOutputConfig} TranscriptOutputConfig
|
5672 | * @throws {Error} If the payload is not a reader or valid buffer
|
5673 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
5674 | */
|
5675 | TranscriptOutputConfig.decode = function decode(reader, length) {
|
5676 | if (!(reader instanceof $Reader))
|
5677 | reader = $Reader.create(reader);
|
5678 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.TranscriptOutputConfig();
|
5679 | while (reader.pos < end) {
|
5680 | var tag = reader.uint32();
|
5681 | switch (tag >>> 3) {
|
5682 | case 1:
|
5683 | message.gcsUri = reader.string();
|
5684 | break;
|
5685 | default:
|
5686 | reader.skipType(tag & 7);
|
5687 | break;
|
5688 | }
|
5689 | }
|
5690 | return message;
|
5691 | };
|
5692 |
|
5693 | /**
|
5694 | * Decodes a TranscriptOutputConfig message from the specified reader or buffer, length delimited.
|
5695 | * @function decodeDelimited
|
5696 | * @memberof google.cloud.speech.v1p1beta1.TranscriptOutputConfig
|
5697 | * @static
|
5698 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
5699 | * @returns {google.cloud.speech.v1p1beta1.TranscriptOutputConfig} TranscriptOutputConfig
|
5700 | * @throws {Error} If the payload is not a reader or valid buffer
|
5701 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
5702 | */
|
5703 | TranscriptOutputConfig.decodeDelimited = function decodeDelimited(reader) {
|
5704 | if (!(reader instanceof $Reader))
|
5705 | reader = new $Reader(reader);
|
5706 | return this.decode(reader, reader.uint32());
|
5707 | };
|
5708 |
|
5709 | /**
|
5710 | * Verifies a TranscriptOutputConfig message.
|
5711 | * @function verify
|
5712 | * @memberof google.cloud.speech.v1p1beta1.TranscriptOutputConfig
|
5713 | * @static
|
5714 | * @param {Object.<string,*>} message Plain object to verify
|
5715 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
5716 | */
|
5717 | TranscriptOutputConfig.verify = function verify(message) {
|
5718 | if (typeof message !== "object" || message === null)
|
5719 | return "object expected";
|
5720 | var properties = {};
|
5721 | if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) {
|
5722 | properties.outputType = 1;
|
5723 | if (!$util.isString(message.gcsUri))
|
5724 | return "gcsUri: string expected";
|
5725 | }
|
5726 | return null;
|
5727 | };
|
5728 |
|
5729 | /**
|
5730 | * Creates a TranscriptOutputConfig message from a plain object. Also converts values to their respective internal types.
|
5731 | * @function fromObject
|
5732 | * @memberof google.cloud.speech.v1p1beta1.TranscriptOutputConfig
|
5733 | * @static
|
5734 | * @param {Object.<string,*>} object Plain object
|
5735 | * @returns {google.cloud.speech.v1p1beta1.TranscriptOutputConfig} TranscriptOutputConfig
|
5736 | */
|
5737 | TranscriptOutputConfig.fromObject = function fromObject(object) {
|
5738 | if (object instanceof $root.google.cloud.speech.v1p1beta1.TranscriptOutputConfig)
|
5739 | return object;
|
5740 | var message = new $root.google.cloud.speech.v1p1beta1.TranscriptOutputConfig();
|
5741 | if (object.gcsUri != null)
|
5742 | message.gcsUri = String(object.gcsUri);
|
5743 | return message;
|
5744 | };
|
5745 |
|
5746 | /**
|
5747 | * Creates a plain object from a TranscriptOutputConfig message. Also converts values to other types if specified.
|
5748 | * @function toObject
|
5749 | * @memberof google.cloud.speech.v1p1beta1.TranscriptOutputConfig
|
5750 | * @static
|
5751 | * @param {google.cloud.speech.v1p1beta1.TranscriptOutputConfig} message TranscriptOutputConfig
|
5752 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
5753 | * @returns {Object.<string,*>} Plain object
|
5754 | */
|
5755 | TranscriptOutputConfig.toObject = function toObject(message, options) {
|
5756 | if (!options)
|
5757 | options = {};
|
5758 | var object = {};
|
5759 | if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) {
|
5760 | object.gcsUri = message.gcsUri;
|
5761 | if (options.oneofs)
|
5762 | object.outputType = "gcsUri";
|
5763 | }
|
5764 | return object;
|
5765 | };
|
5766 |
|
5767 | /**
|
5768 | * Converts this TranscriptOutputConfig to JSON.
|
5769 | * @function toJSON
|
5770 | * @memberof google.cloud.speech.v1p1beta1.TranscriptOutputConfig
|
5771 | * @instance
|
5772 | * @returns {Object.<string,*>} JSON object
|
5773 | */
|
5774 | TranscriptOutputConfig.prototype.toJSON = function toJSON() {
|
5775 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
5776 | };
|
5777 |
|
5778 | return TranscriptOutputConfig;
|
5779 | })();
|
5780 |
|
5781 | v1p1beta1.StreamingRecognizeRequest = (function() {
|
5782 |
|
5783 | /**
|
5784 | * Properties of a StreamingRecognizeRequest.
|
5785 | * @memberof google.cloud.speech.v1p1beta1
|
5786 | * @interface IStreamingRecognizeRequest
|
5787 | * @property {google.cloud.speech.v1p1beta1.IStreamingRecognitionConfig|null} [streamingConfig] StreamingRecognizeRequest streamingConfig
|
5788 | * @property {Uint8Array|null} [audioContent] StreamingRecognizeRequest audioContent
|
5789 | */
|
5790 |
|
5791 | /**
|
5792 | * Constructs a new StreamingRecognizeRequest.
|
5793 | * @memberof google.cloud.speech.v1p1beta1
|
5794 | * @classdesc Represents a StreamingRecognizeRequest.
|
5795 | * @implements IStreamingRecognizeRequest
|
5796 | * @constructor
|
5797 | * @param {google.cloud.speech.v1p1beta1.IStreamingRecognizeRequest=} [properties] Properties to set
|
5798 | */
|
5799 | function StreamingRecognizeRequest(properties) {
|
5800 | if (properties)
|
5801 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
5802 | if (properties[keys[i]] != null)
|
5803 | this[keys[i]] = properties[keys[i]];
|
5804 | }
|
5805 |
|
5806 | /**
|
5807 | * StreamingRecognizeRequest streamingConfig.
|
5808 | * @member {google.cloud.speech.v1p1beta1.IStreamingRecognitionConfig|null|undefined} streamingConfig
|
5809 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeRequest
|
5810 | * @instance
|
5811 | */
|
5812 | StreamingRecognizeRequest.prototype.streamingConfig = null;
|
5813 |
|
5814 | /**
|
5815 | * StreamingRecognizeRequest audioContent.
|
5816 | * @member {Uint8Array|null|undefined} audioContent
|
5817 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeRequest
|
5818 | * @instance
|
5819 | */
|
5820 | StreamingRecognizeRequest.prototype.audioContent = null;
|
5821 |
|
5822 | // OneOf field names bound to virtual getters and setters
|
5823 | var $oneOfFields;
|
5824 |
|
5825 | /**
|
5826 | * StreamingRecognizeRequest streamingRequest.
|
5827 | * @member {"streamingConfig"|"audioContent"|undefined} streamingRequest
|
5828 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeRequest
|
5829 | * @instance
|
5830 | */
|
5831 | Object.defineProperty(StreamingRecognizeRequest.prototype, "streamingRequest", {
|
5832 | get: $util.oneOfGetter($oneOfFields = ["streamingConfig", "audioContent"]),
|
5833 | set: $util.oneOfSetter($oneOfFields)
|
5834 | });
|
5835 |
|
5836 | /**
|
5837 | * Creates a new StreamingRecognizeRequest instance using the specified properties.
|
5838 | * @function create
|
5839 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeRequest
|
5840 | * @static
|
5841 | * @param {google.cloud.speech.v1p1beta1.IStreamingRecognizeRequest=} [properties] Properties to set
|
5842 | * @returns {google.cloud.speech.v1p1beta1.StreamingRecognizeRequest} StreamingRecognizeRequest instance
|
5843 | */
|
5844 | StreamingRecognizeRequest.create = function create(properties) {
|
5845 | return new StreamingRecognizeRequest(properties);
|
5846 | };
|
5847 |
|
5848 | /**
|
5849 | * Encodes the specified StreamingRecognizeRequest message. Does not implicitly {@link google.cloud.speech.v1p1beta1.StreamingRecognizeRequest.verify|verify} messages.
|
5850 | * @function encode
|
5851 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeRequest
|
5852 | * @static
|
5853 | * @param {google.cloud.speech.v1p1beta1.IStreamingRecognizeRequest} message StreamingRecognizeRequest message or plain object to encode
|
5854 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
5855 | * @returns {$protobuf.Writer} Writer
|
5856 | */
|
5857 | StreamingRecognizeRequest.encode = function encode(message, writer) {
|
5858 | if (!writer)
|
5859 | writer = $Writer.create();
|
5860 | if (message.streamingConfig != null && Object.hasOwnProperty.call(message, "streamingConfig"))
|
5861 | $root.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.encode(message.streamingConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
5862 | if (message.audioContent != null && Object.hasOwnProperty.call(message, "audioContent"))
|
5863 | writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.audioContent);
|
5864 | return writer;
|
5865 | };
|
5866 |
|
5867 | /**
|
5868 | * Encodes the specified StreamingRecognizeRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.StreamingRecognizeRequest.verify|verify} messages.
|
5869 | * @function encodeDelimited
|
5870 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeRequest
|
5871 | * @static
|
5872 | * @param {google.cloud.speech.v1p1beta1.IStreamingRecognizeRequest} message StreamingRecognizeRequest message or plain object to encode
|
5873 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
5874 | * @returns {$protobuf.Writer} Writer
|
5875 | */
|
5876 | StreamingRecognizeRequest.encodeDelimited = function encodeDelimited(message, writer) {
|
5877 | return this.encode(message, writer).ldelim();
|
5878 | };
|
5879 |
|
5880 | /**
|
5881 | * Decodes a StreamingRecognizeRequest message from the specified reader or buffer.
|
5882 | * @function decode
|
5883 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeRequest
|
5884 | * @static
|
5885 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
5886 | * @param {number} [length] Message length if known beforehand
|
5887 | * @returns {google.cloud.speech.v1p1beta1.StreamingRecognizeRequest} StreamingRecognizeRequest
|
5888 | * @throws {Error} If the payload is not a reader or valid buffer
|
5889 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
5890 | */
|
5891 | StreamingRecognizeRequest.decode = function decode(reader, length) {
|
5892 | if (!(reader instanceof $Reader))
|
5893 | reader = $Reader.create(reader);
|
5894 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest();
|
5895 | while (reader.pos < end) {
|
5896 | var tag = reader.uint32();
|
5897 | switch (tag >>> 3) {
|
5898 | case 1:
|
5899 | message.streamingConfig = $root.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.decode(reader, reader.uint32());
|
5900 | break;
|
5901 | case 2:
|
5902 | message.audioContent = reader.bytes();
|
5903 | break;
|
5904 | default:
|
5905 | reader.skipType(tag & 7);
|
5906 | break;
|
5907 | }
|
5908 | }
|
5909 | return message;
|
5910 | };
|
5911 |
|
5912 | /**
|
5913 | * Decodes a StreamingRecognizeRequest message from the specified reader or buffer, length delimited.
|
5914 | * @function decodeDelimited
|
5915 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeRequest
|
5916 | * @static
|
5917 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
5918 | * @returns {google.cloud.speech.v1p1beta1.StreamingRecognizeRequest} StreamingRecognizeRequest
|
5919 | * @throws {Error} If the payload is not a reader or valid buffer
|
5920 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
5921 | */
|
5922 | StreamingRecognizeRequest.decodeDelimited = function decodeDelimited(reader) {
|
5923 | if (!(reader instanceof $Reader))
|
5924 | reader = new $Reader(reader);
|
5925 | return this.decode(reader, reader.uint32());
|
5926 | };
|
5927 |
|
5928 | /**
|
5929 | * Verifies a StreamingRecognizeRequest message.
|
5930 | * @function verify
|
5931 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeRequest
|
5932 | * @static
|
5933 | * @param {Object.<string,*>} message Plain object to verify
|
5934 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
5935 | */
|
5936 | StreamingRecognizeRequest.verify = function verify(message) {
|
5937 | if (typeof message !== "object" || message === null)
|
5938 | return "object expected";
|
5939 | var properties = {};
|
5940 | if (message.streamingConfig != null && message.hasOwnProperty("streamingConfig")) {
|
5941 | properties.streamingRequest = 1;
|
5942 | {
|
5943 | var error = $root.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.verify(message.streamingConfig);
|
5944 | if (error)
|
5945 | return "streamingConfig." + error;
|
5946 | }
|
5947 | }
|
5948 | if (message.audioContent != null && message.hasOwnProperty("audioContent")) {
|
5949 | if (properties.streamingRequest === 1)
|
5950 | return "streamingRequest: multiple values";
|
5951 | properties.streamingRequest = 1;
|
5952 | if (!(message.audioContent && typeof message.audioContent.length === "number" || $util.isString(message.audioContent)))
|
5953 | return "audioContent: buffer expected";
|
5954 | }
|
5955 | return null;
|
5956 | };
|
5957 |
|
5958 | /**
|
5959 | * Creates a StreamingRecognizeRequest message from a plain object. Also converts values to their respective internal types.
|
5960 | * @function fromObject
|
5961 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeRequest
|
5962 | * @static
|
5963 | * @param {Object.<string,*>} object Plain object
|
5964 | * @returns {google.cloud.speech.v1p1beta1.StreamingRecognizeRequest} StreamingRecognizeRequest
|
5965 | */
|
5966 | StreamingRecognizeRequest.fromObject = function fromObject(object) {
|
5967 | if (object instanceof $root.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest)
|
5968 | return object;
|
5969 | var message = new $root.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest();
|
5970 | if (object.streamingConfig != null) {
|
5971 | if (typeof object.streamingConfig !== "object")
|
5972 | throw TypeError(".google.cloud.speech.v1p1beta1.StreamingRecognizeRequest.streamingConfig: object expected");
|
5973 | message.streamingConfig = $root.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.fromObject(object.streamingConfig);
|
5974 | }
|
5975 | if (object.audioContent != null)
|
5976 | if (typeof object.audioContent === "string")
|
5977 | $util.base64.decode(object.audioContent, message.audioContent = $util.newBuffer($util.base64.length(object.audioContent)), 0);
|
5978 | else if (object.audioContent.length)
|
5979 | message.audioContent = object.audioContent;
|
5980 | return message;
|
5981 | };
|
5982 |
|
5983 | /**
|
5984 | * Creates a plain object from a StreamingRecognizeRequest message. Also converts values to other types if specified.
|
5985 | * @function toObject
|
5986 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeRequest
|
5987 | * @static
|
5988 | * @param {google.cloud.speech.v1p1beta1.StreamingRecognizeRequest} message StreamingRecognizeRequest
|
5989 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
5990 | * @returns {Object.<string,*>} Plain object
|
5991 | */
|
5992 | StreamingRecognizeRequest.toObject = function toObject(message, options) {
|
5993 | if (!options)
|
5994 | options = {};
|
5995 | var object = {};
|
5996 | if (message.streamingConfig != null && message.hasOwnProperty("streamingConfig")) {
|
5997 | object.streamingConfig = $root.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.toObject(message.streamingConfig, options);
|
5998 | if (options.oneofs)
|
5999 | object.streamingRequest = "streamingConfig";
|
6000 | }
|
6001 | if (message.audioContent != null && message.hasOwnProperty("audioContent")) {
|
6002 | object.audioContent = options.bytes === String ? $util.base64.encode(message.audioContent, 0, message.audioContent.length) : options.bytes === Array ? Array.prototype.slice.call(message.audioContent) : message.audioContent;
|
6003 | if (options.oneofs)
|
6004 | object.streamingRequest = "audioContent";
|
6005 | }
|
6006 | return object;
|
6007 | };
|
6008 |
|
6009 | /**
|
6010 | * Converts this StreamingRecognizeRequest to JSON.
|
6011 | * @function toJSON
|
6012 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeRequest
|
6013 | * @instance
|
6014 | * @returns {Object.<string,*>} JSON object
|
6015 | */
|
6016 | StreamingRecognizeRequest.prototype.toJSON = function toJSON() {
|
6017 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
6018 | };
|
6019 |
|
6020 | return StreamingRecognizeRequest;
|
6021 | })();
|
6022 |
|
6023 | v1p1beta1.StreamingRecognitionConfig = (function() {
|
6024 |
|
6025 | /**
|
6026 | * Properties of a StreamingRecognitionConfig.
|
6027 | * @memberof google.cloud.speech.v1p1beta1
|
6028 | * @interface IStreamingRecognitionConfig
|
6029 | * @property {google.cloud.speech.v1p1beta1.IRecognitionConfig|null} [config] StreamingRecognitionConfig config
|
6030 | * @property {boolean|null} [singleUtterance] StreamingRecognitionConfig singleUtterance
|
6031 | * @property {boolean|null} [interimResults] StreamingRecognitionConfig interimResults
|
6032 | */
|
6033 |
|
6034 | /**
|
6035 | * Constructs a new StreamingRecognitionConfig.
|
6036 | * @memberof google.cloud.speech.v1p1beta1
|
6037 | * @classdesc Represents a StreamingRecognitionConfig.
|
6038 | * @implements IStreamingRecognitionConfig
|
6039 | * @constructor
|
6040 | * @param {google.cloud.speech.v1p1beta1.IStreamingRecognitionConfig=} [properties] Properties to set
|
6041 | */
|
6042 | function StreamingRecognitionConfig(properties) {
|
6043 | if (properties)
|
6044 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
6045 | if (properties[keys[i]] != null)
|
6046 | this[keys[i]] = properties[keys[i]];
|
6047 | }
|
6048 |
|
6049 | /**
|
6050 | * StreamingRecognitionConfig config.
|
6051 | * @member {google.cloud.speech.v1p1beta1.IRecognitionConfig|null|undefined} config
|
6052 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionConfig
|
6053 | * @instance
|
6054 | */
|
6055 | StreamingRecognitionConfig.prototype.config = null;
|
6056 |
|
6057 | /**
|
6058 | * StreamingRecognitionConfig singleUtterance.
|
6059 | * @member {boolean} singleUtterance
|
6060 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionConfig
|
6061 | * @instance
|
6062 | */
|
6063 | StreamingRecognitionConfig.prototype.singleUtterance = false;
|
6064 |
|
6065 | /**
|
6066 | * StreamingRecognitionConfig interimResults.
|
6067 | * @member {boolean} interimResults
|
6068 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionConfig
|
6069 | * @instance
|
6070 | */
|
6071 | StreamingRecognitionConfig.prototype.interimResults = false;
|
6072 |
|
6073 | /**
|
6074 | * Creates a new StreamingRecognitionConfig instance using the specified properties.
|
6075 | * @function create
|
6076 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionConfig
|
6077 | * @static
|
6078 | * @param {google.cloud.speech.v1p1beta1.IStreamingRecognitionConfig=} [properties] Properties to set
|
6079 | * @returns {google.cloud.speech.v1p1beta1.StreamingRecognitionConfig} StreamingRecognitionConfig instance
|
6080 | */
|
6081 | StreamingRecognitionConfig.create = function create(properties) {
|
6082 | return new StreamingRecognitionConfig(properties);
|
6083 | };
|
6084 |
|
6085 | /**
|
6086 | * Encodes the specified StreamingRecognitionConfig message. Does not implicitly {@link google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.verify|verify} messages.
|
6087 | * @function encode
|
6088 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionConfig
|
6089 | * @static
|
6090 | * @param {google.cloud.speech.v1p1beta1.IStreamingRecognitionConfig} message StreamingRecognitionConfig message or plain object to encode
|
6091 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
6092 | * @returns {$protobuf.Writer} Writer
|
6093 | */
|
6094 | StreamingRecognitionConfig.encode = function encode(message, writer) {
|
6095 | if (!writer)
|
6096 | writer = $Writer.create();
|
6097 | if (message.config != null && Object.hasOwnProperty.call(message, "config"))
|
6098 | $root.google.cloud.speech.v1p1beta1.RecognitionConfig.encode(message.config, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
6099 | if (message.singleUtterance != null && Object.hasOwnProperty.call(message, "singleUtterance"))
|
6100 | writer.uint32(/* id 2, wireType 0 =*/16).bool(message.singleUtterance);
|
6101 | if (message.interimResults != null && Object.hasOwnProperty.call(message, "interimResults"))
|
6102 | writer.uint32(/* id 3, wireType 0 =*/24).bool(message.interimResults);
|
6103 | return writer;
|
6104 | };
|
6105 |
|
6106 | /**
|
6107 | * Encodes the specified StreamingRecognitionConfig message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.verify|verify} messages.
|
6108 | * @function encodeDelimited
|
6109 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionConfig
|
6110 | * @static
|
6111 | * @param {google.cloud.speech.v1p1beta1.IStreamingRecognitionConfig} message StreamingRecognitionConfig message or plain object to encode
|
6112 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
6113 | * @returns {$protobuf.Writer} Writer
|
6114 | */
|
6115 | StreamingRecognitionConfig.encodeDelimited = function encodeDelimited(message, writer) {
|
6116 | return this.encode(message, writer).ldelim();
|
6117 | };
|
6118 |
|
6119 | /**
|
6120 | * Decodes a StreamingRecognitionConfig message from the specified reader or buffer.
|
6121 | * @function decode
|
6122 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionConfig
|
6123 | * @static
|
6124 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
6125 | * @param {number} [length] Message length if known beforehand
|
6126 | * @returns {google.cloud.speech.v1p1beta1.StreamingRecognitionConfig} StreamingRecognitionConfig
|
6127 | * @throws {Error} If the payload is not a reader or valid buffer
|
6128 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
6129 | */
|
6130 | StreamingRecognitionConfig.decode = function decode(reader, length) {
|
6131 | if (!(reader instanceof $Reader))
|
6132 | reader = $Reader.create(reader);
|
6133 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig();
|
6134 | while (reader.pos < end) {
|
6135 | var tag = reader.uint32();
|
6136 | switch (tag >>> 3) {
|
6137 | case 1:
|
6138 | message.config = $root.google.cloud.speech.v1p1beta1.RecognitionConfig.decode(reader, reader.uint32());
|
6139 | break;
|
6140 | case 2:
|
6141 | message.singleUtterance = reader.bool();
|
6142 | break;
|
6143 | case 3:
|
6144 | message.interimResults = reader.bool();
|
6145 | break;
|
6146 | default:
|
6147 | reader.skipType(tag & 7);
|
6148 | break;
|
6149 | }
|
6150 | }
|
6151 | return message;
|
6152 | };
|
6153 |
|
6154 | /**
|
6155 | * Decodes a StreamingRecognitionConfig message from the specified reader or buffer, length delimited.
|
6156 | * @function decodeDelimited
|
6157 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionConfig
|
6158 | * @static
|
6159 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
6160 | * @returns {google.cloud.speech.v1p1beta1.StreamingRecognitionConfig} StreamingRecognitionConfig
|
6161 | * @throws {Error} If the payload is not a reader or valid buffer
|
6162 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
6163 | */
|
6164 | StreamingRecognitionConfig.decodeDelimited = function decodeDelimited(reader) {
|
6165 | if (!(reader instanceof $Reader))
|
6166 | reader = new $Reader(reader);
|
6167 | return this.decode(reader, reader.uint32());
|
6168 | };
|
6169 |
|
6170 | /**
|
6171 | * Verifies a StreamingRecognitionConfig message.
|
6172 | * @function verify
|
6173 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionConfig
|
6174 | * @static
|
6175 | * @param {Object.<string,*>} message Plain object to verify
|
6176 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
6177 | */
|
6178 | StreamingRecognitionConfig.verify = function verify(message) {
|
6179 | if (typeof message !== "object" || message === null)
|
6180 | return "object expected";
|
6181 | if (message.config != null && message.hasOwnProperty("config")) {
|
6182 | var error = $root.google.cloud.speech.v1p1beta1.RecognitionConfig.verify(message.config);
|
6183 | if (error)
|
6184 | return "config." + error;
|
6185 | }
|
6186 | if (message.singleUtterance != null && message.hasOwnProperty("singleUtterance"))
|
6187 | if (typeof message.singleUtterance !== "boolean")
|
6188 | return "singleUtterance: boolean expected";
|
6189 | if (message.interimResults != null && message.hasOwnProperty("interimResults"))
|
6190 | if (typeof message.interimResults !== "boolean")
|
6191 | return "interimResults: boolean expected";
|
6192 | return null;
|
6193 | };
|
6194 |
|
6195 | /**
|
6196 | * Creates a StreamingRecognitionConfig message from a plain object. Also converts values to their respective internal types.
|
6197 | * @function fromObject
|
6198 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionConfig
|
6199 | * @static
|
6200 | * @param {Object.<string,*>} object Plain object
|
6201 | * @returns {google.cloud.speech.v1p1beta1.StreamingRecognitionConfig} StreamingRecognitionConfig
|
6202 | */
|
6203 | StreamingRecognitionConfig.fromObject = function fromObject(object) {
|
6204 | if (object instanceof $root.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig)
|
6205 | return object;
|
6206 | var message = new $root.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig();
|
6207 | if (object.config != null) {
|
6208 | if (typeof object.config !== "object")
|
6209 | throw TypeError(".google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.config: object expected");
|
6210 | message.config = $root.google.cloud.speech.v1p1beta1.RecognitionConfig.fromObject(object.config);
|
6211 | }
|
6212 | if (object.singleUtterance != null)
|
6213 | message.singleUtterance = Boolean(object.singleUtterance);
|
6214 | if (object.interimResults != null)
|
6215 | message.interimResults = Boolean(object.interimResults);
|
6216 | return message;
|
6217 | };
|
6218 |
|
6219 | /**
|
6220 | * Creates a plain object from a StreamingRecognitionConfig message. Also converts values to other types if specified.
|
6221 | * @function toObject
|
6222 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionConfig
|
6223 | * @static
|
6224 | * @param {google.cloud.speech.v1p1beta1.StreamingRecognitionConfig} message StreamingRecognitionConfig
|
6225 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
6226 | * @returns {Object.<string,*>} Plain object
|
6227 | */
|
6228 | StreamingRecognitionConfig.toObject = function toObject(message, options) {
|
6229 | if (!options)
|
6230 | options = {};
|
6231 | var object = {};
|
6232 | if (options.defaults) {
|
6233 | object.config = null;
|
6234 | object.singleUtterance = false;
|
6235 | object.interimResults = false;
|
6236 | }
|
6237 | if (message.config != null && message.hasOwnProperty("config"))
|
6238 | object.config = $root.google.cloud.speech.v1p1beta1.RecognitionConfig.toObject(message.config, options);
|
6239 | if (message.singleUtterance != null && message.hasOwnProperty("singleUtterance"))
|
6240 | object.singleUtterance = message.singleUtterance;
|
6241 | if (message.interimResults != null && message.hasOwnProperty("interimResults"))
|
6242 | object.interimResults = message.interimResults;
|
6243 | return object;
|
6244 | };
|
6245 |
|
6246 | /**
|
6247 | * Converts this StreamingRecognitionConfig to JSON.
|
6248 | * @function toJSON
|
6249 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionConfig
|
6250 | * @instance
|
6251 | * @returns {Object.<string,*>} JSON object
|
6252 | */
|
6253 | StreamingRecognitionConfig.prototype.toJSON = function toJSON() {
|
6254 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
6255 | };
|
6256 |
|
6257 | return StreamingRecognitionConfig;
|
6258 | })();
|
6259 |
|
6260 | v1p1beta1.RecognitionConfig = (function() {
|
6261 |
|
6262 | /**
|
6263 | * Properties of a RecognitionConfig.
|
6264 | * @memberof google.cloud.speech.v1p1beta1
|
6265 | * @interface IRecognitionConfig
|
6266 | * @property {google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding|null} [encoding] RecognitionConfig encoding
|
6267 | * @property {number|null} [sampleRateHertz] RecognitionConfig sampleRateHertz
|
6268 | * @property {number|null} [audioChannelCount] RecognitionConfig audioChannelCount
|
6269 | * @property {boolean|null} [enableSeparateRecognitionPerChannel] RecognitionConfig enableSeparateRecognitionPerChannel
|
6270 | * @property {string|null} [languageCode] RecognitionConfig languageCode
|
6271 | * @property {Array.<string>|null} [alternativeLanguageCodes] RecognitionConfig alternativeLanguageCodes
|
6272 | * @property {number|null} [maxAlternatives] RecognitionConfig maxAlternatives
|
6273 | * @property {boolean|null} [profanityFilter] RecognitionConfig profanityFilter
|
6274 | * @property {google.cloud.speech.v1p1beta1.ISpeechAdaptation|null} [adaptation] RecognitionConfig adaptation
|
6275 | * @property {Array.<google.cloud.speech.v1p1beta1.ISpeechContext>|null} [speechContexts] RecognitionConfig speechContexts
|
6276 | * @property {boolean|null} [enableWordTimeOffsets] RecognitionConfig enableWordTimeOffsets
|
6277 | * @property {boolean|null} [enableWordConfidence] RecognitionConfig enableWordConfidence
|
6278 | * @property {boolean|null} [enableAutomaticPunctuation] RecognitionConfig enableAutomaticPunctuation
|
6279 | * @property {google.protobuf.IBoolValue|null} [enableSpokenPunctuation] RecognitionConfig enableSpokenPunctuation
|
6280 | * @property {google.protobuf.IBoolValue|null} [enableSpokenEmojis] RecognitionConfig enableSpokenEmojis
|
6281 | * @property {boolean|null} [enableSpeakerDiarization] RecognitionConfig enableSpeakerDiarization
|
6282 | * @property {number|null} [diarizationSpeakerCount] RecognitionConfig diarizationSpeakerCount
|
6283 | * @property {google.cloud.speech.v1p1beta1.ISpeakerDiarizationConfig|null} [diarizationConfig] RecognitionConfig diarizationConfig
|
6284 | * @property {google.cloud.speech.v1p1beta1.IRecognitionMetadata|null} [metadata] RecognitionConfig metadata
|
6285 | * @property {string|null} [model] RecognitionConfig model
|
6286 | * @property {boolean|null} [useEnhanced] RecognitionConfig useEnhanced
|
6287 | */
|
6288 |
|
6289 | /**
|
6290 | * Constructs a new RecognitionConfig.
|
6291 | * @memberof google.cloud.speech.v1p1beta1
|
6292 | * @classdesc Represents a RecognitionConfig.
|
6293 | * @implements IRecognitionConfig
|
6294 | * @constructor
|
6295 | * @param {google.cloud.speech.v1p1beta1.IRecognitionConfig=} [properties] Properties to set
|
6296 | */
|
6297 | function RecognitionConfig(properties) {
|
6298 | this.alternativeLanguageCodes = [];
|
6299 | this.speechContexts = [];
|
6300 | if (properties)
|
6301 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
6302 | if (properties[keys[i]] != null)
|
6303 | this[keys[i]] = properties[keys[i]];
|
6304 | }
|
6305 |
|
6306 | /**
|
6307 | * RecognitionConfig encoding.
|
6308 | * @member {google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding} encoding
|
6309 | * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig
|
6310 | * @instance
|
6311 | */
|
6312 | RecognitionConfig.prototype.encoding = 0;
|
6313 |
|
6314 | /**
|
6315 | * RecognitionConfig sampleRateHertz.
|
6316 | * @member {number} sampleRateHertz
|
6317 | * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig
|
6318 | * @instance
|
6319 | */
|
6320 | RecognitionConfig.prototype.sampleRateHertz = 0;
|
6321 |
|
6322 | /**
|
6323 | * RecognitionConfig audioChannelCount.
|
6324 | * @member {number} audioChannelCount
|
6325 | * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig
|
6326 | * @instance
|
6327 | */
|
6328 | RecognitionConfig.prototype.audioChannelCount = 0;
|
6329 |
|
6330 | /**
|
6331 | * RecognitionConfig enableSeparateRecognitionPerChannel.
|
6332 | * @member {boolean} enableSeparateRecognitionPerChannel
|
6333 | * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig
|
6334 | * @instance
|
6335 | */
|
6336 | RecognitionConfig.prototype.enableSeparateRecognitionPerChannel = false;
|
6337 |
|
6338 | /**
|
6339 | * RecognitionConfig languageCode.
|
6340 | * @member {string} languageCode
|
6341 | * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig
|
6342 | * @instance
|
6343 | */
|
6344 | RecognitionConfig.prototype.languageCode = "";
|
6345 |
|
6346 | /**
|
6347 | * RecognitionConfig alternativeLanguageCodes.
|
6348 | * @member {Array.<string>} alternativeLanguageCodes
|
6349 | * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig
|
6350 | * @instance
|
6351 | */
|
6352 | RecognitionConfig.prototype.alternativeLanguageCodes = $util.emptyArray;
|
6353 |
|
6354 | /**
|
6355 | * RecognitionConfig maxAlternatives.
|
6356 | * @member {number} maxAlternatives
|
6357 | * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig
|
6358 | * @instance
|
6359 | */
|
6360 | RecognitionConfig.prototype.maxAlternatives = 0;
|
6361 |
|
6362 | /**
|
6363 | * RecognitionConfig profanityFilter.
|
6364 | * @member {boolean} profanityFilter
|
6365 | * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig
|
6366 | * @instance
|
6367 | */
|
6368 | RecognitionConfig.prototype.profanityFilter = false;
|
6369 |
|
6370 | /**
|
6371 | * RecognitionConfig adaptation.
|
6372 | * @member {google.cloud.speech.v1p1beta1.ISpeechAdaptation|null|undefined} adaptation
|
6373 | * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig
|
6374 | * @instance
|
6375 | */
|
6376 | RecognitionConfig.prototype.adaptation = null;
|
6377 |
|
6378 | /**
|
6379 | * RecognitionConfig speechContexts.
|
6380 | * @member {Array.<google.cloud.speech.v1p1beta1.ISpeechContext>} speechContexts
|
6381 | * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig
|
6382 | * @instance
|
6383 | */
|
6384 | RecognitionConfig.prototype.speechContexts = $util.emptyArray;
|
6385 |
|
6386 | /**
|
6387 | * RecognitionConfig enableWordTimeOffsets.
|
6388 | * @member {boolean} enableWordTimeOffsets
|
6389 | * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig
|
6390 | * @instance
|
6391 | */
|
6392 | RecognitionConfig.prototype.enableWordTimeOffsets = false;
|
6393 |
|
6394 | /**
|
6395 | * RecognitionConfig enableWordConfidence.
|
6396 | * @member {boolean} enableWordConfidence
|
6397 | * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig
|
6398 | * @instance
|
6399 | */
|
6400 | RecognitionConfig.prototype.enableWordConfidence = false;
|
6401 |
|
6402 | /**
|
6403 | * RecognitionConfig enableAutomaticPunctuation.
|
6404 | * @member {boolean} enableAutomaticPunctuation
|
6405 | * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig
|
6406 | * @instance
|
6407 | */
|
6408 | RecognitionConfig.prototype.enableAutomaticPunctuation = false;
|
6409 |
|
6410 | /**
|
6411 | * RecognitionConfig enableSpokenPunctuation.
|
6412 | * @member {google.protobuf.IBoolValue|null|undefined} enableSpokenPunctuation
|
6413 | * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig
|
6414 | * @instance
|
6415 | */
|
6416 | RecognitionConfig.prototype.enableSpokenPunctuation = null;
|
6417 |
|
6418 | /**
|
6419 | * RecognitionConfig enableSpokenEmojis.
|
6420 | * @member {google.protobuf.IBoolValue|null|undefined} enableSpokenEmojis
|
6421 | * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig
|
6422 | * @instance
|
6423 | */
|
6424 | RecognitionConfig.prototype.enableSpokenEmojis = null;
|
6425 |
|
6426 | /**
|
6427 | * RecognitionConfig enableSpeakerDiarization.
|
6428 | * @member {boolean} enableSpeakerDiarization
|
6429 | * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig
|
6430 | * @instance
|
6431 | */
|
6432 | RecognitionConfig.prototype.enableSpeakerDiarization = false;
|
6433 |
|
6434 | /**
|
6435 | * RecognitionConfig diarizationSpeakerCount.
|
6436 | * @member {number} diarizationSpeakerCount
|
6437 | * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig
|
6438 | * @instance
|
6439 | */
|
6440 | RecognitionConfig.prototype.diarizationSpeakerCount = 0;
|
6441 |
|
6442 | /**
|
6443 | * RecognitionConfig diarizationConfig.
|
6444 | * @member {google.cloud.speech.v1p1beta1.ISpeakerDiarizationConfig|null|undefined} diarizationConfig
|
6445 | * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig
|
6446 | * @instance
|
6447 | */
|
6448 | RecognitionConfig.prototype.diarizationConfig = null;
|
6449 |
|
6450 | /**
|
6451 | * RecognitionConfig metadata.
|
6452 | * @member {google.cloud.speech.v1p1beta1.IRecognitionMetadata|null|undefined} metadata
|
6453 | * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig
|
6454 | * @instance
|
6455 | */
|
6456 | RecognitionConfig.prototype.metadata = null;
|
6457 |
|
6458 | /**
|
6459 | * RecognitionConfig model.
|
6460 | * @member {string} model
|
6461 | * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig
|
6462 | * @instance
|
6463 | */
|
6464 | RecognitionConfig.prototype.model = "";
|
6465 |
|
6466 | /**
|
6467 | * RecognitionConfig useEnhanced.
|
6468 | * @member {boolean} useEnhanced
|
6469 | * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig
|
6470 | * @instance
|
6471 | */
|
6472 | RecognitionConfig.prototype.useEnhanced = false;
|
6473 |
|
6474 | /**
|
6475 | * Creates a new RecognitionConfig instance using the specified properties.
|
6476 | * @function create
|
6477 | * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig
|
6478 | * @static
|
6479 | * @param {google.cloud.speech.v1p1beta1.IRecognitionConfig=} [properties] Properties to set
|
6480 | * @returns {google.cloud.speech.v1p1beta1.RecognitionConfig} RecognitionConfig instance
|
6481 | */
|
6482 | RecognitionConfig.create = function create(properties) {
|
6483 | return new RecognitionConfig(properties);
|
6484 | };
|
6485 |
|
6486 | /**
|
6487 | * Encodes the specified RecognitionConfig message. Does not implicitly {@link google.cloud.speech.v1p1beta1.RecognitionConfig.verify|verify} messages.
|
6488 | * @function encode
|
6489 | * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig
|
6490 | * @static
|
6491 | * @param {google.cloud.speech.v1p1beta1.IRecognitionConfig} message RecognitionConfig message or plain object to encode
|
6492 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
6493 | * @returns {$protobuf.Writer} Writer
|
6494 | */
|
6495 | RecognitionConfig.encode = function encode(message, writer) {
|
6496 | if (!writer)
|
6497 | writer = $Writer.create();
|
6498 | if (message.encoding != null && Object.hasOwnProperty.call(message, "encoding"))
|
6499 | writer.uint32(/* id 1, wireType 0 =*/8).int32(message.encoding);
|
6500 | if (message.sampleRateHertz != null && Object.hasOwnProperty.call(message, "sampleRateHertz"))
|
6501 | writer.uint32(/* id 2, wireType 0 =*/16).int32(message.sampleRateHertz);
|
6502 | if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode"))
|
6503 | writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCode);
|
6504 | if (message.maxAlternatives != null && Object.hasOwnProperty.call(message, "maxAlternatives"))
|
6505 | writer.uint32(/* id 4, wireType 0 =*/32).int32(message.maxAlternatives);
|
6506 | if (message.profanityFilter != null && Object.hasOwnProperty.call(message, "profanityFilter"))
|
6507 | writer.uint32(/* id 5, wireType 0 =*/40).bool(message.profanityFilter);
|
6508 | if (message.speechContexts != null && message.speechContexts.length)
|
6509 | for (var i = 0; i < message.speechContexts.length; ++i)
|
6510 | $root.google.cloud.speech.v1p1beta1.SpeechContext.encode(message.speechContexts[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
|
6511 | if (message.audioChannelCount != null && Object.hasOwnProperty.call(message, "audioChannelCount"))
|
6512 | writer.uint32(/* id 7, wireType 0 =*/56).int32(message.audioChannelCount);
|
6513 | if (message.enableWordTimeOffsets != null && Object.hasOwnProperty.call(message, "enableWordTimeOffsets"))
|
6514 | writer.uint32(/* id 8, wireType 0 =*/64).bool(message.enableWordTimeOffsets);
|
6515 | if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata"))
|
6516 | $root.google.cloud.speech.v1p1beta1.RecognitionMetadata.encode(message.metadata, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim();
|
6517 | if (message.enableAutomaticPunctuation != null && Object.hasOwnProperty.call(message, "enableAutomaticPunctuation"))
|
6518 | writer.uint32(/* id 11, wireType 0 =*/88).bool(message.enableAutomaticPunctuation);
|
6519 | if (message.enableSeparateRecognitionPerChannel != null && Object.hasOwnProperty.call(message, "enableSeparateRecognitionPerChannel"))
|
6520 | writer.uint32(/* id 12, wireType 0 =*/96).bool(message.enableSeparateRecognitionPerChannel);
|
6521 | if (message.model != null && Object.hasOwnProperty.call(message, "model"))
|
6522 | writer.uint32(/* id 13, wireType 2 =*/106).string(message.model);
|
6523 | if (message.useEnhanced != null && Object.hasOwnProperty.call(message, "useEnhanced"))
|
6524 | writer.uint32(/* id 14, wireType 0 =*/112).bool(message.useEnhanced);
|
6525 | if (message.enableWordConfidence != null && Object.hasOwnProperty.call(message, "enableWordConfidence"))
|
6526 | writer.uint32(/* id 15, wireType 0 =*/120).bool(message.enableWordConfidence);
|
6527 | if (message.enableSpeakerDiarization != null && Object.hasOwnProperty.call(message, "enableSpeakerDiarization"))
|
6528 | writer.uint32(/* id 16, wireType 0 =*/128).bool(message.enableSpeakerDiarization);
|
6529 | if (message.diarizationSpeakerCount != null && Object.hasOwnProperty.call(message, "diarizationSpeakerCount"))
|
6530 | writer.uint32(/* id 17, wireType 0 =*/136).int32(message.diarizationSpeakerCount);
|
6531 | if (message.alternativeLanguageCodes != null && message.alternativeLanguageCodes.length)
|
6532 | for (var i = 0; i < message.alternativeLanguageCodes.length; ++i)
|
6533 | writer.uint32(/* id 18, wireType 2 =*/146).string(message.alternativeLanguageCodes[i]);
|
6534 | if (message.diarizationConfig != null && Object.hasOwnProperty.call(message, "diarizationConfig"))
|
6535 | $root.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.encode(message.diarizationConfig, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim();
|
6536 | if (message.adaptation != null && Object.hasOwnProperty.call(message, "adaptation"))
|
6537 | $root.google.cloud.speech.v1p1beta1.SpeechAdaptation.encode(message.adaptation, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim();
|
6538 | if (message.enableSpokenPunctuation != null && Object.hasOwnProperty.call(message, "enableSpokenPunctuation"))
|
6539 | $root.google.protobuf.BoolValue.encode(message.enableSpokenPunctuation, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim();
|
6540 | if (message.enableSpokenEmojis != null && Object.hasOwnProperty.call(message, "enableSpokenEmojis"))
|
6541 | $root.google.protobuf.BoolValue.encode(message.enableSpokenEmojis, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim();
|
6542 | return writer;
|
6543 | };
|
6544 |
|
6545 | /**
|
6546 | * Encodes the specified RecognitionConfig message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.RecognitionConfig.verify|verify} messages.
|
6547 | * @function encodeDelimited
|
6548 | * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig
|
6549 | * @static
|
6550 | * @param {google.cloud.speech.v1p1beta1.IRecognitionConfig} message RecognitionConfig message or plain object to encode
|
6551 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
6552 | * @returns {$protobuf.Writer} Writer
|
6553 | */
|
6554 | RecognitionConfig.encodeDelimited = function encodeDelimited(message, writer) {
|
6555 | return this.encode(message, writer).ldelim();
|
6556 | };
|
6557 |
|
6558 | /**
|
6559 | * Decodes a RecognitionConfig message from the specified reader or buffer.
|
6560 | * @function decode
|
6561 | * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig
|
6562 | * @static
|
6563 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
6564 | * @param {number} [length] Message length if known beforehand
|
6565 | * @returns {google.cloud.speech.v1p1beta1.RecognitionConfig} RecognitionConfig
|
6566 | * @throws {Error} If the payload is not a reader or valid buffer
|
6567 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
6568 | */
|
6569 | RecognitionConfig.decode = function decode(reader, length) {
|
6570 | if (!(reader instanceof $Reader))
|
6571 | reader = $Reader.create(reader);
|
6572 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.RecognitionConfig();
|
6573 | while (reader.pos < end) {
|
6574 | var tag = reader.uint32();
|
6575 | switch (tag >>> 3) {
|
6576 | case 1:
|
6577 | message.encoding = reader.int32();
|
6578 | break;
|
6579 | case 2:
|
6580 | message.sampleRateHertz = reader.int32();
|
6581 | break;
|
6582 | case 7:
|
6583 | message.audioChannelCount = reader.int32();
|
6584 | break;
|
6585 | case 12:
|
6586 | message.enableSeparateRecognitionPerChannel = reader.bool();
|
6587 | break;
|
6588 | case 3:
|
6589 | message.languageCode = reader.string();
|
6590 | break;
|
6591 | case 18:
|
6592 | if (!(message.alternativeLanguageCodes && message.alternativeLanguageCodes.length))
|
6593 | message.alternativeLanguageCodes = [];
|
6594 | message.alternativeLanguageCodes.push(reader.string());
|
6595 | break;
|
6596 | case 4:
|
6597 | message.maxAlternatives = reader.int32();
|
6598 | break;
|
6599 | case 5:
|
6600 | message.profanityFilter = reader.bool();
|
6601 | break;
|
6602 | case 20:
|
6603 | message.adaptation = $root.google.cloud.speech.v1p1beta1.SpeechAdaptation.decode(reader, reader.uint32());
|
6604 | break;
|
6605 | case 6:
|
6606 | if (!(message.speechContexts && message.speechContexts.length))
|
6607 | message.speechContexts = [];
|
6608 | message.speechContexts.push($root.google.cloud.speech.v1p1beta1.SpeechContext.decode(reader, reader.uint32()));
|
6609 | break;
|
6610 | case 8:
|
6611 | message.enableWordTimeOffsets = reader.bool();
|
6612 | break;
|
6613 | case 15:
|
6614 | message.enableWordConfidence = reader.bool();
|
6615 | break;
|
6616 | case 11:
|
6617 | message.enableAutomaticPunctuation = reader.bool();
|
6618 | break;
|
6619 | case 22:
|
6620 | message.enableSpokenPunctuation = $root.google.protobuf.BoolValue.decode(reader, reader.uint32());
|
6621 | break;
|
6622 | case 23:
|
6623 | message.enableSpokenEmojis = $root.google.protobuf.BoolValue.decode(reader, reader.uint32());
|
6624 | break;
|
6625 | case 16:
|
6626 | message.enableSpeakerDiarization = reader.bool();
|
6627 | break;
|
6628 | case 17:
|
6629 | message.diarizationSpeakerCount = reader.int32();
|
6630 | break;
|
6631 | case 19:
|
6632 | message.diarizationConfig = $root.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.decode(reader, reader.uint32());
|
6633 | break;
|
6634 | case 9:
|
6635 | message.metadata = $root.google.cloud.speech.v1p1beta1.RecognitionMetadata.decode(reader, reader.uint32());
|
6636 | break;
|
6637 | case 13:
|
6638 | message.model = reader.string();
|
6639 | break;
|
6640 | case 14:
|
6641 | message.useEnhanced = reader.bool();
|
6642 | break;
|
6643 | default:
|
6644 | reader.skipType(tag & 7);
|
6645 | break;
|
6646 | }
|
6647 | }
|
6648 | return message;
|
6649 | };
|
6650 |
|
6651 | /**
|
6652 | * Decodes a RecognitionConfig message from the specified reader or buffer, length delimited.
|
6653 | * @function decodeDelimited
|
6654 | * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig
|
6655 | * @static
|
6656 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
6657 | * @returns {google.cloud.speech.v1p1beta1.RecognitionConfig} RecognitionConfig
|
6658 | * @throws {Error} If the payload is not a reader or valid buffer
|
6659 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
6660 | */
|
6661 | RecognitionConfig.decodeDelimited = function decodeDelimited(reader) {
|
6662 | if (!(reader instanceof $Reader))
|
6663 | reader = new $Reader(reader);
|
6664 | return this.decode(reader, reader.uint32());
|
6665 | };
|
6666 |
|
6667 | /**
|
6668 | * Verifies a RecognitionConfig message.
|
6669 | * @function verify
|
6670 | * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig
|
6671 | * @static
|
6672 | * @param {Object.<string,*>} message Plain object to verify
|
6673 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
6674 | */
|
6675 | RecognitionConfig.verify = function verify(message) {
|
6676 | if (typeof message !== "object" || message === null)
|
6677 | return "object expected";
|
6678 | if (message.encoding != null && message.hasOwnProperty("encoding"))
|
6679 | switch (message.encoding) {
|
6680 | default:
|
6681 | return "encoding: enum value expected";
|
6682 | case 0:
|
6683 | case 1:
|
6684 | case 2:
|
6685 | case 3:
|
6686 | case 4:
|
6687 | case 5:
|
6688 | case 6:
|
6689 | case 7:
|
6690 | case 8:
|
6691 | case 9:
|
6692 | break;
|
6693 | }
|
6694 | if (message.sampleRateHertz != null && message.hasOwnProperty("sampleRateHertz"))
|
6695 | if (!$util.isInteger(message.sampleRateHertz))
|
6696 | return "sampleRateHertz: integer expected";
|
6697 | if (message.audioChannelCount != null && message.hasOwnProperty("audioChannelCount"))
|
6698 | if (!$util.isInteger(message.audioChannelCount))
|
6699 | return "audioChannelCount: integer expected";
|
6700 | if (message.enableSeparateRecognitionPerChannel != null && message.hasOwnProperty("enableSeparateRecognitionPerChannel"))
|
6701 | if (typeof message.enableSeparateRecognitionPerChannel !== "boolean")
|
6702 | return "enableSeparateRecognitionPerChannel: boolean expected";
|
6703 | if (message.languageCode != null && message.hasOwnProperty("languageCode"))
|
6704 | if (!$util.isString(message.languageCode))
|
6705 | return "languageCode: string expected";
|
6706 | if (message.alternativeLanguageCodes != null && message.hasOwnProperty("alternativeLanguageCodes")) {
|
6707 | if (!Array.isArray(message.alternativeLanguageCodes))
|
6708 | return "alternativeLanguageCodes: array expected";
|
6709 | for (var i = 0; i < message.alternativeLanguageCodes.length; ++i)
|
6710 | if (!$util.isString(message.alternativeLanguageCodes[i]))
|
6711 | return "alternativeLanguageCodes: string[] expected";
|
6712 | }
|
6713 | if (message.maxAlternatives != null && message.hasOwnProperty("maxAlternatives"))
|
6714 | if (!$util.isInteger(message.maxAlternatives))
|
6715 | return "maxAlternatives: integer expected";
|
6716 | if (message.profanityFilter != null && message.hasOwnProperty("profanityFilter"))
|
6717 | if (typeof message.profanityFilter !== "boolean")
|
6718 | return "profanityFilter: boolean expected";
|
6719 | if (message.adaptation != null && message.hasOwnProperty("adaptation")) {
|
6720 | var error = $root.google.cloud.speech.v1p1beta1.SpeechAdaptation.verify(message.adaptation);
|
6721 | if (error)
|
6722 | return "adaptation." + error;
|
6723 | }
|
6724 | if (message.speechContexts != null && message.hasOwnProperty("speechContexts")) {
|
6725 | if (!Array.isArray(message.speechContexts))
|
6726 | return "speechContexts: array expected";
|
6727 | for (var i = 0; i < message.speechContexts.length; ++i) {
|
6728 | var error = $root.google.cloud.speech.v1p1beta1.SpeechContext.verify(message.speechContexts[i]);
|
6729 | if (error)
|
6730 | return "speechContexts." + error;
|
6731 | }
|
6732 | }
|
6733 | if (message.enableWordTimeOffsets != null && message.hasOwnProperty("enableWordTimeOffsets"))
|
6734 | if (typeof message.enableWordTimeOffsets !== "boolean")
|
6735 | return "enableWordTimeOffsets: boolean expected";
|
6736 | if (message.enableWordConfidence != null && message.hasOwnProperty("enableWordConfidence"))
|
6737 | if (typeof message.enableWordConfidence !== "boolean")
|
6738 | return "enableWordConfidence: boolean expected";
|
6739 | if (message.enableAutomaticPunctuation != null && message.hasOwnProperty("enableAutomaticPunctuation"))
|
6740 | if (typeof message.enableAutomaticPunctuation !== "boolean")
|
6741 | return "enableAutomaticPunctuation: boolean expected";
|
6742 | if (message.enableSpokenPunctuation != null && message.hasOwnProperty("enableSpokenPunctuation")) {
|
6743 | var error = $root.google.protobuf.BoolValue.verify(message.enableSpokenPunctuation);
|
6744 | if (error)
|
6745 | return "enableSpokenPunctuation." + error;
|
6746 | }
|
6747 | if (message.enableSpokenEmojis != null && message.hasOwnProperty("enableSpokenEmojis")) {
|
6748 | var error = $root.google.protobuf.BoolValue.verify(message.enableSpokenEmojis);
|
6749 | if (error)
|
6750 | return "enableSpokenEmojis." + error;
|
6751 | }
|
6752 | if (message.enableSpeakerDiarization != null && message.hasOwnProperty("enableSpeakerDiarization"))
|
6753 | if (typeof message.enableSpeakerDiarization !== "boolean")
|
6754 | return "enableSpeakerDiarization: boolean expected";
|
6755 | if (message.diarizationSpeakerCount != null && message.hasOwnProperty("diarizationSpeakerCount"))
|
6756 | if (!$util.isInteger(message.diarizationSpeakerCount))
|
6757 | return "diarizationSpeakerCount: integer expected";
|
6758 | if (message.diarizationConfig != null && message.hasOwnProperty("diarizationConfig")) {
|
6759 | var error = $root.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.verify(message.diarizationConfig);
|
6760 | if (error)
|
6761 | return "diarizationConfig." + error;
|
6762 | }
|
6763 | if (message.metadata != null && message.hasOwnProperty("metadata")) {
|
6764 | var error = $root.google.cloud.speech.v1p1beta1.RecognitionMetadata.verify(message.metadata);
|
6765 | if (error)
|
6766 | return "metadata." + error;
|
6767 | }
|
6768 | if (message.model != null && message.hasOwnProperty("model"))
|
6769 | if (!$util.isString(message.model))
|
6770 | return "model: string expected";
|
6771 | if (message.useEnhanced != null && message.hasOwnProperty("useEnhanced"))
|
6772 | if (typeof message.useEnhanced !== "boolean")
|
6773 | return "useEnhanced: boolean expected";
|
6774 | return null;
|
6775 | };
|
6776 |
|
6777 | /**
|
6778 | * Creates a RecognitionConfig message from a plain object. Also converts values to their respective internal types.
|
6779 | * @function fromObject
|
6780 | * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig
|
6781 | * @static
|
6782 | * @param {Object.<string,*>} object Plain object
|
6783 | * @returns {google.cloud.speech.v1p1beta1.RecognitionConfig} RecognitionConfig
|
6784 | */
|
6785 | RecognitionConfig.fromObject = function fromObject(object) {
|
6786 | if (object instanceof $root.google.cloud.speech.v1p1beta1.RecognitionConfig)
|
6787 | return object;
|
6788 | var message = new $root.google.cloud.speech.v1p1beta1.RecognitionConfig();
|
6789 | switch (object.encoding) {
|
6790 | case "ENCODING_UNSPECIFIED":
|
6791 | case 0:
|
6792 | message.encoding = 0;
|
6793 | break;
|
6794 | case "LINEAR16":
|
6795 | case 1:
|
6796 | message.encoding = 1;
|
6797 | break;
|
6798 | case "FLAC":
|
6799 | case 2:
|
6800 | message.encoding = 2;
|
6801 | break;
|
6802 | case "MULAW":
|
6803 | case 3:
|
6804 | message.encoding = 3;
|
6805 | break;
|
6806 | case "AMR":
|
6807 | case 4:
|
6808 | message.encoding = 4;
|
6809 | break;
|
6810 | case "AMR_WB":
|
6811 | case 5:
|
6812 | message.encoding = 5;
|
6813 | break;
|
6814 | case "OGG_OPUS":
|
6815 | case 6:
|
6816 | message.encoding = 6;
|
6817 | break;
|
6818 | case "SPEEX_WITH_HEADER_BYTE":
|
6819 | case 7:
|
6820 | message.encoding = 7;
|
6821 | break;
|
6822 | case "MP3":
|
6823 | case 8:
|
6824 | message.encoding = 8;
|
6825 | break;
|
6826 | case "WEBM_OPUS":
|
6827 | case 9:
|
6828 | message.encoding = 9;
|
6829 | break;
|
6830 | }
|
6831 | if (object.sampleRateHertz != null)
|
6832 | message.sampleRateHertz = object.sampleRateHertz | 0;
|
6833 | if (object.audioChannelCount != null)
|
6834 | message.audioChannelCount = object.audioChannelCount | 0;
|
6835 | if (object.enableSeparateRecognitionPerChannel != null)
|
6836 | message.enableSeparateRecognitionPerChannel = Boolean(object.enableSeparateRecognitionPerChannel);
|
6837 | if (object.languageCode != null)
|
6838 | message.languageCode = String(object.languageCode);
|
6839 | if (object.alternativeLanguageCodes) {
|
6840 | if (!Array.isArray(object.alternativeLanguageCodes))
|
6841 | throw TypeError(".google.cloud.speech.v1p1beta1.RecognitionConfig.alternativeLanguageCodes: array expected");
|
6842 | message.alternativeLanguageCodes = [];
|
6843 | for (var i = 0; i < object.alternativeLanguageCodes.length; ++i)
|
6844 | message.alternativeLanguageCodes[i] = String(object.alternativeLanguageCodes[i]);
|
6845 | }
|
6846 | if (object.maxAlternatives != null)
|
6847 | message.maxAlternatives = object.maxAlternatives | 0;
|
6848 | if (object.profanityFilter != null)
|
6849 | message.profanityFilter = Boolean(object.profanityFilter);
|
6850 | if (object.adaptation != null) {
|
6851 | if (typeof object.adaptation !== "object")
|
6852 | throw TypeError(".google.cloud.speech.v1p1beta1.RecognitionConfig.adaptation: object expected");
|
6853 | message.adaptation = $root.google.cloud.speech.v1p1beta1.SpeechAdaptation.fromObject(object.adaptation);
|
6854 | }
|
6855 | if (object.speechContexts) {
|
6856 | if (!Array.isArray(object.speechContexts))
|
6857 | throw TypeError(".google.cloud.speech.v1p1beta1.RecognitionConfig.speechContexts: array expected");
|
6858 | message.speechContexts = [];
|
6859 | for (var i = 0; i < object.speechContexts.length; ++i) {
|
6860 | if (typeof object.speechContexts[i] !== "object")
|
6861 | throw TypeError(".google.cloud.speech.v1p1beta1.RecognitionConfig.speechContexts: object expected");
|
6862 | message.speechContexts[i] = $root.google.cloud.speech.v1p1beta1.SpeechContext.fromObject(object.speechContexts[i]);
|
6863 | }
|
6864 | }
|
6865 | if (object.enableWordTimeOffsets != null)
|
6866 | message.enableWordTimeOffsets = Boolean(object.enableWordTimeOffsets);
|
6867 | if (object.enableWordConfidence != null)
|
6868 | message.enableWordConfidence = Boolean(object.enableWordConfidence);
|
6869 | if (object.enableAutomaticPunctuation != null)
|
6870 | message.enableAutomaticPunctuation = Boolean(object.enableAutomaticPunctuation);
|
6871 | if (object.enableSpokenPunctuation != null) {
|
6872 | if (typeof object.enableSpokenPunctuation !== "object")
|
6873 | throw TypeError(".google.cloud.speech.v1p1beta1.RecognitionConfig.enableSpokenPunctuation: object expected");
|
6874 | message.enableSpokenPunctuation = $root.google.protobuf.BoolValue.fromObject(object.enableSpokenPunctuation);
|
6875 | }
|
6876 | if (object.enableSpokenEmojis != null) {
|
6877 | if (typeof object.enableSpokenEmojis !== "object")
|
6878 | throw TypeError(".google.cloud.speech.v1p1beta1.RecognitionConfig.enableSpokenEmojis: object expected");
|
6879 | message.enableSpokenEmojis = $root.google.protobuf.BoolValue.fromObject(object.enableSpokenEmojis);
|
6880 | }
|
6881 | if (object.enableSpeakerDiarization != null)
|
6882 | message.enableSpeakerDiarization = Boolean(object.enableSpeakerDiarization);
|
6883 | if (object.diarizationSpeakerCount != null)
|
6884 | message.diarizationSpeakerCount = object.diarizationSpeakerCount | 0;
|
6885 | if (object.diarizationConfig != null) {
|
6886 | if (typeof object.diarizationConfig !== "object")
|
6887 | throw TypeError(".google.cloud.speech.v1p1beta1.RecognitionConfig.diarizationConfig: object expected");
|
6888 | message.diarizationConfig = $root.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.fromObject(object.diarizationConfig);
|
6889 | }
|
6890 | if (object.metadata != null) {
|
6891 | if (typeof object.metadata !== "object")
|
6892 | throw TypeError(".google.cloud.speech.v1p1beta1.RecognitionConfig.metadata: object expected");
|
6893 | message.metadata = $root.google.cloud.speech.v1p1beta1.RecognitionMetadata.fromObject(object.metadata);
|
6894 | }
|
6895 | if (object.model != null)
|
6896 | message.model = String(object.model);
|
6897 | if (object.useEnhanced != null)
|
6898 | message.useEnhanced = Boolean(object.useEnhanced);
|
6899 | return message;
|
6900 | };
|
6901 |
|
6902 | /**
|
6903 | * Creates a plain object from a RecognitionConfig message. Also converts values to other types if specified.
|
6904 | * @function toObject
|
6905 | * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig
|
6906 | * @static
|
6907 | * @param {google.cloud.speech.v1p1beta1.RecognitionConfig} message RecognitionConfig
|
6908 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
6909 | * @returns {Object.<string,*>} Plain object
|
6910 | */
|
6911 | RecognitionConfig.toObject = function toObject(message, options) {
|
6912 | if (!options)
|
6913 | options = {};
|
6914 | var object = {};
|
6915 | if (options.arrays || options.defaults) {
|
6916 | object.speechContexts = [];
|
6917 | object.alternativeLanguageCodes = [];
|
6918 | }
|
6919 | if (options.defaults) {
|
6920 | object.encoding = options.enums === String ? "ENCODING_UNSPECIFIED" : 0;
|
6921 | object.sampleRateHertz = 0;
|
6922 | object.languageCode = "";
|
6923 | object.maxAlternatives = 0;
|
6924 | object.profanityFilter = false;
|
6925 | object.audioChannelCount = 0;
|
6926 | object.enableWordTimeOffsets = false;
|
6927 | object.metadata = null;
|
6928 | object.enableAutomaticPunctuation = false;
|
6929 | object.enableSeparateRecognitionPerChannel = false;
|
6930 | object.model = "";
|
6931 | object.useEnhanced = false;
|
6932 | object.enableWordConfidence = false;
|
6933 | object.enableSpeakerDiarization = false;
|
6934 | object.diarizationSpeakerCount = 0;
|
6935 | object.diarizationConfig = null;
|
6936 | object.adaptation = null;
|
6937 | object.enableSpokenPunctuation = null;
|
6938 | object.enableSpokenEmojis = null;
|
6939 | }
|
6940 | if (message.encoding != null && message.hasOwnProperty("encoding"))
|
6941 | object.encoding = options.enums === String ? $root.google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding[message.encoding] : message.encoding;
|
6942 | if (message.sampleRateHertz != null && message.hasOwnProperty("sampleRateHertz"))
|
6943 | object.sampleRateHertz = message.sampleRateHertz;
|
6944 | if (message.languageCode != null && message.hasOwnProperty("languageCode"))
|
6945 | object.languageCode = message.languageCode;
|
6946 | if (message.maxAlternatives != null && message.hasOwnProperty("maxAlternatives"))
|
6947 | object.maxAlternatives = message.maxAlternatives;
|
6948 | if (message.profanityFilter != null && message.hasOwnProperty("profanityFilter"))
|
6949 | object.profanityFilter = message.profanityFilter;
|
6950 | if (message.speechContexts && message.speechContexts.length) {
|
6951 | object.speechContexts = [];
|
6952 | for (var j = 0; j < message.speechContexts.length; ++j)
|
6953 | object.speechContexts[j] = $root.google.cloud.speech.v1p1beta1.SpeechContext.toObject(message.speechContexts[j], options);
|
6954 | }
|
6955 | if (message.audioChannelCount != null && message.hasOwnProperty("audioChannelCount"))
|
6956 | object.audioChannelCount = message.audioChannelCount;
|
6957 | if (message.enableWordTimeOffsets != null && message.hasOwnProperty("enableWordTimeOffsets"))
|
6958 | object.enableWordTimeOffsets = message.enableWordTimeOffsets;
|
6959 | if (message.metadata != null && message.hasOwnProperty("metadata"))
|
6960 | object.metadata = $root.google.cloud.speech.v1p1beta1.RecognitionMetadata.toObject(message.metadata, options);
|
6961 | if (message.enableAutomaticPunctuation != null && message.hasOwnProperty("enableAutomaticPunctuation"))
|
6962 | object.enableAutomaticPunctuation = message.enableAutomaticPunctuation;
|
6963 | if (message.enableSeparateRecognitionPerChannel != null && message.hasOwnProperty("enableSeparateRecognitionPerChannel"))
|
6964 | object.enableSeparateRecognitionPerChannel = message.enableSeparateRecognitionPerChannel;
|
6965 | if (message.model != null && message.hasOwnProperty("model"))
|
6966 | object.model = message.model;
|
6967 | if (message.useEnhanced != null && message.hasOwnProperty("useEnhanced"))
|
6968 | object.useEnhanced = message.useEnhanced;
|
6969 | if (message.enableWordConfidence != null && message.hasOwnProperty("enableWordConfidence"))
|
6970 | object.enableWordConfidence = message.enableWordConfidence;
|
6971 | if (message.enableSpeakerDiarization != null && message.hasOwnProperty("enableSpeakerDiarization"))
|
6972 | object.enableSpeakerDiarization = message.enableSpeakerDiarization;
|
6973 | if (message.diarizationSpeakerCount != null && message.hasOwnProperty("diarizationSpeakerCount"))
|
6974 | object.diarizationSpeakerCount = message.diarizationSpeakerCount;
|
6975 | if (message.alternativeLanguageCodes && message.alternativeLanguageCodes.length) {
|
6976 | object.alternativeLanguageCodes = [];
|
6977 | for (var j = 0; j < message.alternativeLanguageCodes.length; ++j)
|
6978 | object.alternativeLanguageCodes[j] = message.alternativeLanguageCodes[j];
|
6979 | }
|
6980 | if (message.diarizationConfig != null && message.hasOwnProperty("diarizationConfig"))
|
6981 | object.diarizationConfig = $root.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.toObject(message.diarizationConfig, options);
|
6982 | if (message.adaptation != null && message.hasOwnProperty("adaptation"))
|
6983 | object.adaptation = $root.google.cloud.speech.v1p1beta1.SpeechAdaptation.toObject(message.adaptation, options);
|
6984 | if (message.enableSpokenPunctuation != null && message.hasOwnProperty("enableSpokenPunctuation"))
|
6985 | object.enableSpokenPunctuation = $root.google.protobuf.BoolValue.toObject(message.enableSpokenPunctuation, options);
|
6986 | if (message.enableSpokenEmojis != null && message.hasOwnProperty("enableSpokenEmojis"))
|
6987 | object.enableSpokenEmojis = $root.google.protobuf.BoolValue.toObject(message.enableSpokenEmojis, options);
|
6988 | return object;
|
6989 | };
|
6990 |
|
6991 | /**
|
6992 | * Converts this RecognitionConfig to JSON.
|
6993 | * @function toJSON
|
6994 | * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig
|
6995 | * @instance
|
6996 | * @returns {Object.<string,*>} JSON object
|
6997 | */
|
6998 | RecognitionConfig.prototype.toJSON = function toJSON() {
|
6999 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
7000 | };
|
7001 |
|
7002 | /**
|
7003 | * AudioEncoding enum.
|
7004 | * @name google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding
|
7005 | * @enum {number}
|
7006 | * @property {number} ENCODING_UNSPECIFIED=0 ENCODING_UNSPECIFIED value
|
7007 | * @property {number} LINEAR16=1 LINEAR16 value
|
7008 | * @property {number} FLAC=2 FLAC value
|
7009 | * @property {number} MULAW=3 MULAW value
|
7010 | * @property {number} AMR=4 AMR value
|
7011 | * @property {number} AMR_WB=5 AMR_WB value
|
7012 | * @property {number} OGG_OPUS=6 OGG_OPUS value
|
7013 | * @property {number} SPEEX_WITH_HEADER_BYTE=7 SPEEX_WITH_HEADER_BYTE value
|
7014 | * @property {number} MP3=8 MP3 value
|
7015 | * @property {number} WEBM_OPUS=9 WEBM_OPUS value
|
7016 | */
|
7017 | RecognitionConfig.AudioEncoding = (function() {
|
7018 | var valuesById = {}, values = Object.create(valuesById);
|
7019 | values[valuesById[0] = "ENCODING_UNSPECIFIED"] = 0;
|
7020 | values[valuesById[1] = "LINEAR16"] = 1;
|
7021 | values[valuesById[2] = "FLAC"] = 2;
|
7022 | values[valuesById[3] = "MULAW"] = 3;
|
7023 | values[valuesById[4] = "AMR"] = 4;
|
7024 | values[valuesById[5] = "AMR_WB"] = 5;
|
7025 | values[valuesById[6] = "OGG_OPUS"] = 6;
|
7026 | values[valuesById[7] = "SPEEX_WITH_HEADER_BYTE"] = 7;
|
7027 | values[valuesById[8] = "MP3"] = 8;
|
7028 | values[valuesById[9] = "WEBM_OPUS"] = 9;
|
7029 | return values;
|
7030 | })();
|
7031 |
|
7032 | return RecognitionConfig;
|
7033 | })();
|
7034 |
|
7035 | v1p1beta1.SpeakerDiarizationConfig = (function() {
|
7036 |
|
7037 | /**
|
7038 | * Properties of a SpeakerDiarizationConfig.
|
7039 | * @memberof google.cloud.speech.v1p1beta1
|
7040 | * @interface ISpeakerDiarizationConfig
|
7041 | * @property {boolean|null} [enableSpeakerDiarization] SpeakerDiarizationConfig enableSpeakerDiarization
|
7042 | * @property {number|null} [minSpeakerCount] SpeakerDiarizationConfig minSpeakerCount
|
7043 | * @property {number|null} [maxSpeakerCount] SpeakerDiarizationConfig maxSpeakerCount
|
7044 | * @property {number|null} [speakerTag] SpeakerDiarizationConfig speakerTag
|
7045 | */
|
7046 |
|
7047 | /**
|
7048 | * Constructs a new SpeakerDiarizationConfig.
|
7049 | * @memberof google.cloud.speech.v1p1beta1
|
7050 | * @classdesc Represents a SpeakerDiarizationConfig.
|
7051 | * @implements ISpeakerDiarizationConfig
|
7052 | * @constructor
|
7053 | * @param {google.cloud.speech.v1p1beta1.ISpeakerDiarizationConfig=} [properties] Properties to set
|
7054 | */
|
7055 | function SpeakerDiarizationConfig(properties) {
|
7056 | if (properties)
|
7057 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
7058 | if (properties[keys[i]] != null)
|
7059 | this[keys[i]] = properties[keys[i]];
|
7060 | }
|
7061 |
|
7062 | /**
|
7063 | * SpeakerDiarizationConfig enableSpeakerDiarization.
|
7064 | * @member {boolean} enableSpeakerDiarization
|
7065 | * @memberof google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig
|
7066 | * @instance
|
7067 | */
|
7068 | SpeakerDiarizationConfig.prototype.enableSpeakerDiarization = false;
|
7069 |
|
7070 | /**
|
7071 | * SpeakerDiarizationConfig minSpeakerCount.
|
7072 | * @member {number} minSpeakerCount
|
7073 | * @memberof google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig
|
7074 | * @instance
|
7075 | */
|
7076 | SpeakerDiarizationConfig.prototype.minSpeakerCount = 0;
|
7077 |
|
7078 | /**
|
7079 | * SpeakerDiarizationConfig maxSpeakerCount.
|
7080 | * @member {number} maxSpeakerCount
|
7081 | * @memberof google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig
|
7082 | * @instance
|
7083 | */
|
7084 | SpeakerDiarizationConfig.prototype.maxSpeakerCount = 0;
|
7085 |
|
7086 | /**
|
7087 | * SpeakerDiarizationConfig speakerTag.
|
7088 | * @member {number} speakerTag
|
7089 | * @memberof google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig
|
7090 | * @instance
|
7091 | */
|
7092 | SpeakerDiarizationConfig.prototype.speakerTag = 0;
|
7093 |
|
7094 | /**
|
7095 | * Creates a new SpeakerDiarizationConfig instance using the specified properties.
|
7096 | * @function create
|
7097 | * @memberof google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig
|
7098 | * @static
|
7099 | * @param {google.cloud.speech.v1p1beta1.ISpeakerDiarizationConfig=} [properties] Properties to set
|
7100 | * @returns {google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig} SpeakerDiarizationConfig instance
|
7101 | */
|
7102 | SpeakerDiarizationConfig.create = function create(properties) {
|
7103 | return new SpeakerDiarizationConfig(properties);
|
7104 | };
|
7105 |
|
7106 | /**
|
7107 | * Encodes the specified SpeakerDiarizationConfig message. Does not implicitly {@link google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.verify|verify} messages.
|
7108 | * @function encode
|
7109 | * @memberof google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig
|
7110 | * @static
|
7111 | * @param {google.cloud.speech.v1p1beta1.ISpeakerDiarizationConfig} message SpeakerDiarizationConfig message or plain object to encode
|
7112 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
7113 | * @returns {$protobuf.Writer} Writer
|
7114 | */
|
7115 | SpeakerDiarizationConfig.encode = function encode(message, writer) {
|
7116 | if (!writer)
|
7117 | writer = $Writer.create();
|
7118 | if (message.enableSpeakerDiarization != null && Object.hasOwnProperty.call(message, "enableSpeakerDiarization"))
|
7119 | writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enableSpeakerDiarization);
|
7120 | if (message.minSpeakerCount != null && Object.hasOwnProperty.call(message, "minSpeakerCount"))
|
7121 | writer.uint32(/* id 2, wireType 0 =*/16).int32(message.minSpeakerCount);
|
7122 | if (message.maxSpeakerCount != null && Object.hasOwnProperty.call(message, "maxSpeakerCount"))
|
7123 | writer.uint32(/* id 3, wireType 0 =*/24).int32(message.maxSpeakerCount);
|
7124 | if (message.speakerTag != null && Object.hasOwnProperty.call(message, "speakerTag"))
|
7125 | writer.uint32(/* id 5, wireType 0 =*/40).int32(message.speakerTag);
|
7126 | return writer;
|
7127 | };
|
7128 |
|
7129 | /**
|
7130 | * Encodes the specified SpeakerDiarizationConfig message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.verify|verify} messages.
|
7131 | * @function encodeDelimited
|
7132 | * @memberof google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig
|
7133 | * @static
|
7134 | * @param {google.cloud.speech.v1p1beta1.ISpeakerDiarizationConfig} message SpeakerDiarizationConfig message or plain object to encode
|
7135 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
7136 | * @returns {$protobuf.Writer} Writer
|
7137 | */
|
7138 | SpeakerDiarizationConfig.encodeDelimited = function encodeDelimited(message, writer) {
|
7139 | return this.encode(message, writer).ldelim();
|
7140 | };
|
7141 |
|
7142 | /**
|
7143 | * Decodes a SpeakerDiarizationConfig message from the specified reader or buffer.
|
7144 | * @function decode
|
7145 | * @memberof google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig
|
7146 | * @static
|
7147 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
7148 | * @param {number} [length] Message length if known beforehand
|
7149 | * @returns {google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig} SpeakerDiarizationConfig
|
7150 | * @throws {Error} If the payload is not a reader or valid buffer
|
7151 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
7152 | */
|
7153 | SpeakerDiarizationConfig.decode = function decode(reader, length) {
|
7154 | if (!(reader instanceof $Reader))
|
7155 | reader = $Reader.create(reader);
|
7156 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig();
|
7157 | while (reader.pos < end) {
|
7158 | var tag = reader.uint32();
|
7159 | switch (tag >>> 3) {
|
7160 | case 1:
|
7161 | message.enableSpeakerDiarization = reader.bool();
|
7162 | break;
|
7163 | case 2:
|
7164 | message.minSpeakerCount = reader.int32();
|
7165 | break;
|
7166 | case 3:
|
7167 | message.maxSpeakerCount = reader.int32();
|
7168 | break;
|
7169 | case 5:
|
7170 | message.speakerTag = reader.int32();
|
7171 | break;
|
7172 | default:
|
7173 | reader.skipType(tag & 7);
|
7174 | break;
|
7175 | }
|
7176 | }
|
7177 | return message;
|
7178 | };
|
7179 |
|
7180 | /**
|
7181 | * Decodes a SpeakerDiarizationConfig message from the specified reader or buffer, length delimited.
|
7182 | * @function decodeDelimited
|
7183 | * @memberof google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig
|
7184 | * @static
|
7185 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
7186 | * @returns {google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig} SpeakerDiarizationConfig
|
7187 | * @throws {Error} If the payload is not a reader or valid buffer
|
7188 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
7189 | */
|
7190 | SpeakerDiarizationConfig.decodeDelimited = function decodeDelimited(reader) {
|
7191 | if (!(reader instanceof $Reader))
|
7192 | reader = new $Reader(reader);
|
7193 | return this.decode(reader, reader.uint32());
|
7194 | };
|
7195 |
|
7196 | /**
|
7197 | * Verifies a SpeakerDiarizationConfig message.
|
7198 | * @function verify
|
7199 | * @memberof google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig
|
7200 | * @static
|
7201 | * @param {Object.<string,*>} message Plain object to verify
|
7202 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
7203 | */
|
7204 | SpeakerDiarizationConfig.verify = function verify(message) {
|
7205 | if (typeof message !== "object" || message === null)
|
7206 | return "object expected";
|
7207 | if (message.enableSpeakerDiarization != null && message.hasOwnProperty("enableSpeakerDiarization"))
|
7208 | if (typeof message.enableSpeakerDiarization !== "boolean")
|
7209 | return "enableSpeakerDiarization: boolean expected";
|
7210 | if (message.minSpeakerCount != null && message.hasOwnProperty("minSpeakerCount"))
|
7211 | if (!$util.isInteger(message.minSpeakerCount))
|
7212 | return "minSpeakerCount: integer expected";
|
7213 | if (message.maxSpeakerCount != null && message.hasOwnProperty("maxSpeakerCount"))
|
7214 | if (!$util.isInteger(message.maxSpeakerCount))
|
7215 | return "maxSpeakerCount: integer expected";
|
7216 | if (message.speakerTag != null && message.hasOwnProperty("speakerTag"))
|
7217 | if (!$util.isInteger(message.speakerTag))
|
7218 | return "speakerTag: integer expected";
|
7219 | return null;
|
7220 | };
|
7221 |
|
7222 | /**
|
7223 | * Creates a SpeakerDiarizationConfig message from a plain object. Also converts values to their respective internal types.
|
7224 | * @function fromObject
|
7225 | * @memberof google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig
|
7226 | * @static
|
7227 | * @param {Object.<string,*>} object Plain object
|
7228 | * @returns {google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig} SpeakerDiarizationConfig
|
7229 | */
|
7230 | SpeakerDiarizationConfig.fromObject = function fromObject(object) {
|
7231 | if (object instanceof $root.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig)
|
7232 | return object;
|
7233 | var message = new $root.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig();
|
7234 | if (object.enableSpeakerDiarization != null)
|
7235 | message.enableSpeakerDiarization = Boolean(object.enableSpeakerDiarization);
|
7236 | if (object.minSpeakerCount != null)
|
7237 | message.minSpeakerCount = object.minSpeakerCount | 0;
|
7238 | if (object.maxSpeakerCount != null)
|
7239 | message.maxSpeakerCount = object.maxSpeakerCount | 0;
|
7240 | if (object.speakerTag != null)
|
7241 | message.speakerTag = object.speakerTag | 0;
|
7242 | return message;
|
7243 | };
|
7244 |
|
7245 | /**
|
7246 | * Creates a plain object from a SpeakerDiarizationConfig message. Also converts values to other types if specified.
|
7247 | * @function toObject
|
7248 | * @memberof google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig
|
7249 | * @static
|
7250 | * @param {google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig} message SpeakerDiarizationConfig
|
7251 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
7252 | * @returns {Object.<string,*>} Plain object
|
7253 | */
|
7254 | SpeakerDiarizationConfig.toObject = function toObject(message, options) {
|
7255 | if (!options)
|
7256 | options = {};
|
7257 | var object = {};
|
7258 | if (options.defaults) {
|
7259 | object.enableSpeakerDiarization = false;
|
7260 | object.minSpeakerCount = 0;
|
7261 | object.maxSpeakerCount = 0;
|
7262 | object.speakerTag = 0;
|
7263 | }
|
7264 | if (message.enableSpeakerDiarization != null && message.hasOwnProperty("enableSpeakerDiarization"))
|
7265 | object.enableSpeakerDiarization = message.enableSpeakerDiarization;
|
7266 | if (message.minSpeakerCount != null && message.hasOwnProperty("minSpeakerCount"))
|
7267 | object.minSpeakerCount = message.minSpeakerCount;
|
7268 | if (message.maxSpeakerCount != null && message.hasOwnProperty("maxSpeakerCount"))
|
7269 | object.maxSpeakerCount = message.maxSpeakerCount;
|
7270 | if (message.speakerTag != null && message.hasOwnProperty("speakerTag"))
|
7271 | object.speakerTag = message.speakerTag;
|
7272 | return object;
|
7273 | };
|
7274 |
|
7275 | /**
|
7276 | * Converts this SpeakerDiarizationConfig to JSON.
|
7277 | * @function toJSON
|
7278 | * @memberof google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig
|
7279 | * @instance
|
7280 | * @returns {Object.<string,*>} JSON object
|
7281 | */
|
7282 | SpeakerDiarizationConfig.prototype.toJSON = function toJSON() {
|
7283 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
7284 | };
|
7285 |
|
7286 | return SpeakerDiarizationConfig;
|
7287 | })();
|
7288 |
|
7289 | v1p1beta1.RecognitionMetadata = (function() {
|
7290 |
|
7291 | /**
|
7292 | * Properties of a RecognitionMetadata.
|
7293 | * @memberof google.cloud.speech.v1p1beta1
|
7294 | * @interface IRecognitionMetadata
|
7295 | * @property {google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType|null} [interactionType] RecognitionMetadata interactionType
|
7296 | * @property {number|null} [industryNaicsCodeOfAudio] RecognitionMetadata industryNaicsCodeOfAudio
|
7297 | * @property {google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance|null} [microphoneDistance] RecognitionMetadata microphoneDistance
|
7298 | * @property {google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType|null} [originalMediaType] RecognitionMetadata originalMediaType
|
7299 | * @property {google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType|null} [recordingDeviceType] RecognitionMetadata recordingDeviceType
|
7300 | * @property {string|null} [recordingDeviceName] RecognitionMetadata recordingDeviceName
|
7301 | * @property {string|null} [originalMimeType] RecognitionMetadata originalMimeType
|
7302 | * @property {number|Long|null} [obfuscatedId] RecognitionMetadata obfuscatedId
|
7303 | * @property {string|null} [audioTopic] RecognitionMetadata audioTopic
|
7304 | */
|
7305 |
|
7306 | /**
|
7307 | * Constructs a new RecognitionMetadata.
|
7308 | * @memberof google.cloud.speech.v1p1beta1
|
7309 | * @classdesc Represents a RecognitionMetadata.
|
7310 | * @implements IRecognitionMetadata
|
7311 | * @constructor
|
7312 | * @param {google.cloud.speech.v1p1beta1.IRecognitionMetadata=} [properties] Properties to set
|
7313 | */
|
7314 | function RecognitionMetadata(properties) {
|
7315 | if (properties)
|
7316 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
7317 | if (properties[keys[i]] != null)
|
7318 | this[keys[i]] = properties[keys[i]];
|
7319 | }
|
7320 |
|
7321 | /**
|
7322 | * RecognitionMetadata interactionType.
|
7323 | * @member {google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType} interactionType
|
7324 | * @memberof google.cloud.speech.v1p1beta1.RecognitionMetadata
|
7325 | * @instance
|
7326 | */
|
7327 | RecognitionMetadata.prototype.interactionType = 0;
|
7328 |
|
7329 | /**
|
7330 | * RecognitionMetadata industryNaicsCodeOfAudio.
|
7331 | * @member {number} industryNaicsCodeOfAudio
|
7332 | * @memberof google.cloud.speech.v1p1beta1.RecognitionMetadata
|
7333 | * @instance
|
7334 | */
|
7335 | RecognitionMetadata.prototype.industryNaicsCodeOfAudio = 0;
|
7336 |
|
7337 | /**
|
7338 | * RecognitionMetadata microphoneDistance.
|
7339 | * @member {google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance} microphoneDistance
|
7340 | * @memberof google.cloud.speech.v1p1beta1.RecognitionMetadata
|
7341 | * @instance
|
7342 | */
|
7343 | RecognitionMetadata.prototype.microphoneDistance = 0;
|
7344 |
|
7345 | /**
|
7346 | * RecognitionMetadata originalMediaType.
|
7347 | * @member {google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType} originalMediaType
|
7348 | * @memberof google.cloud.speech.v1p1beta1.RecognitionMetadata
|
7349 | * @instance
|
7350 | */
|
7351 | RecognitionMetadata.prototype.originalMediaType = 0;
|
7352 |
|
7353 | /**
|
7354 | * RecognitionMetadata recordingDeviceType.
|
7355 | * @member {google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType} recordingDeviceType
|
7356 | * @memberof google.cloud.speech.v1p1beta1.RecognitionMetadata
|
7357 | * @instance
|
7358 | */
|
7359 | RecognitionMetadata.prototype.recordingDeviceType = 0;
|
7360 |
|
7361 | /**
|
7362 | * RecognitionMetadata recordingDeviceName.
|
7363 | * @member {string} recordingDeviceName
|
7364 | * @memberof google.cloud.speech.v1p1beta1.RecognitionMetadata
|
7365 | * @instance
|
7366 | */
|
7367 | RecognitionMetadata.prototype.recordingDeviceName = "";
|
7368 |
|
7369 | /**
|
7370 | * RecognitionMetadata originalMimeType.
|
7371 | * @member {string} originalMimeType
|
7372 | * @memberof google.cloud.speech.v1p1beta1.RecognitionMetadata
|
7373 | * @instance
|
7374 | */
|
7375 | RecognitionMetadata.prototype.originalMimeType = "";
|
7376 |
|
7377 | /**
|
7378 | * RecognitionMetadata obfuscatedId.
|
7379 | * @member {number|Long} obfuscatedId
|
7380 | * @memberof google.cloud.speech.v1p1beta1.RecognitionMetadata
|
7381 | * @instance
|
7382 | */
|
7383 | RecognitionMetadata.prototype.obfuscatedId = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
7384 |
|
7385 | /**
|
7386 | * RecognitionMetadata audioTopic.
|
7387 | * @member {string} audioTopic
|
7388 | * @memberof google.cloud.speech.v1p1beta1.RecognitionMetadata
|
7389 | * @instance
|
7390 | */
|
7391 | RecognitionMetadata.prototype.audioTopic = "";
|
7392 |
|
7393 | /**
|
7394 | * Creates a new RecognitionMetadata instance using the specified properties.
|
7395 | * @function create
|
7396 | * @memberof google.cloud.speech.v1p1beta1.RecognitionMetadata
|
7397 | * @static
|
7398 | * @param {google.cloud.speech.v1p1beta1.IRecognitionMetadata=} [properties] Properties to set
|
7399 | * @returns {google.cloud.speech.v1p1beta1.RecognitionMetadata} RecognitionMetadata instance
|
7400 | */
|
7401 | RecognitionMetadata.create = function create(properties) {
|
7402 | return new RecognitionMetadata(properties);
|
7403 | };
|
7404 |
|
7405 | /**
|
7406 | * Encodes the specified RecognitionMetadata message. Does not implicitly {@link google.cloud.speech.v1p1beta1.RecognitionMetadata.verify|verify} messages.
|
7407 | * @function encode
|
7408 | * @memberof google.cloud.speech.v1p1beta1.RecognitionMetadata
|
7409 | * @static
|
7410 | * @param {google.cloud.speech.v1p1beta1.IRecognitionMetadata} message RecognitionMetadata message or plain object to encode
|
7411 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
7412 | * @returns {$protobuf.Writer} Writer
|
7413 | */
|
7414 | RecognitionMetadata.encode = function encode(message, writer) {
|
7415 | if (!writer)
|
7416 | writer = $Writer.create();
|
7417 | if (message.interactionType != null && Object.hasOwnProperty.call(message, "interactionType"))
|
7418 | writer.uint32(/* id 1, wireType 0 =*/8).int32(message.interactionType);
|
7419 | if (message.industryNaicsCodeOfAudio != null && Object.hasOwnProperty.call(message, "industryNaicsCodeOfAudio"))
|
7420 | writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.industryNaicsCodeOfAudio);
|
7421 | if (message.microphoneDistance != null && Object.hasOwnProperty.call(message, "microphoneDistance"))
|
7422 | writer.uint32(/* id 4, wireType 0 =*/32).int32(message.microphoneDistance);
|
7423 | if (message.originalMediaType != null && Object.hasOwnProperty.call(message, "originalMediaType"))
|
7424 | writer.uint32(/* id 5, wireType 0 =*/40).int32(message.originalMediaType);
|
7425 | if (message.recordingDeviceType != null && Object.hasOwnProperty.call(message, "recordingDeviceType"))
|
7426 | writer.uint32(/* id 6, wireType 0 =*/48).int32(message.recordingDeviceType);
|
7427 | if (message.recordingDeviceName != null && Object.hasOwnProperty.call(message, "recordingDeviceName"))
|
7428 | writer.uint32(/* id 7, wireType 2 =*/58).string(message.recordingDeviceName);
|
7429 | if (message.originalMimeType != null && Object.hasOwnProperty.call(message, "originalMimeType"))
|
7430 | writer.uint32(/* id 8, wireType 2 =*/66).string(message.originalMimeType);
|
7431 | if (message.obfuscatedId != null && Object.hasOwnProperty.call(message, "obfuscatedId"))
|
7432 | writer.uint32(/* id 9, wireType 0 =*/72).int64(message.obfuscatedId);
|
7433 | if (message.audioTopic != null && Object.hasOwnProperty.call(message, "audioTopic"))
|
7434 | writer.uint32(/* id 10, wireType 2 =*/82).string(message.audioTopic);
|
7435 | return writer;
|
7436 | };
|
7437 |
|
7438 | /**
|
7439 | * Encodes the specified RecognitionMetadata message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.RecognitionMetadata.verify|verify} messages.
|
7440 | * @function encodeDelimited
|
7441 | * @memberof google.cloud.speech.v1p1beta1.RecognitionMetadata
|
7442 | * @static
|
7443 | * @param {google.cloud.speech.v1p1beta1.IRecognitionMetadata} message RecognitionMetadata message or plain object to encode
|
7444 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
7445 | * @returns {$protobuf.Writer} Writer
|
7446 | */
|
7447 | RecognitionMetadata.encodeDelimited = function encodeDelimited(message, writer) {
|
7448 | return this.encode(message, writer).ldelim();
|
7449 | };
|
7450 |
|
7451 | /**
|
7452 | * Decodes a RecognitionMetadata message from the specified reader or buffer.
|
7453 | * @function decode
|
7454 | * @memberof google.cloud.speech.v1p1beta1.RecognitionMetadata
|
7455 | * @static
|
7456 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
7457 | * @param {number} [length] Message length if known beforehand
|
7458 | * @returns {google.cloud.speech.v1p1beta1.RecognitionMetadata} RecognitionMetadata
|
7459 | * @throws {Error} If the payload is not a reader or valid buffer
|
7460 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
7461 | */
|
7462 | RecognitionMetadata.decode = function decode(reader, length) {
|
7463 | if (!(reader instanceof $Reader))
|
7464 | reader = $Reader.create(reader);
|
7465 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.RecognitionMetadata();
|
7466 | while (reader.pos < end) {
|
7467 | var tag = reader.uint32();
|
7468 | switch (tag >>> 3) {
|
7469 | case 1:
|
7470 | message.interactionType = reader.int32();
|
7471 | break;
|
7472 | case 3:
|
7473 | message.industryNaicsCodeOfAudio = reader.uint32();
|
7474 | break;
|
7475 | case 4:
|
7476 | message.microphoneDistance = reader.int32();
|
7477 | break;
|
7478 | case 5:
|
7479 | message.originalMediaType = reader.int32();
|
7480 | break;
|
7481 | case 6:
|
7482 | message.recordingDeviceType = reader.int32();
|
7483 | break;
|
7484 | case 7:
|
7485 | message.recordingDeviceName = reader.string();
|
7486 | break;
|
7487 | case 8:
|
7488 | message.originalMimeType = reader.string();
|
7489 | break;
|
7490 | case 9:
|
7491 | message.obfuscatedId = reader.int64();
|
7492 | break;
|
7493 | case 10:
|
7494 | message.audioTopic = reader.string();
|
7495 | break;
|
7496 | default:
|
7497 | reader.skipType(tag & 7);
|
7498 | break;
|
7499 | }
|
7500 | }
|
7501 | return message;
|
7502 | };
|
7503 |
|
7504 | /**
|
7505 | * Decodes a RecognitionMetadata message from the specified reader or buffer, length delimited.
|
7506 | * @function decodeDelimited
|
7507 | * @memberof google.cloud.speech.v1p1beta1.RecognitionMetadata
|
7508 | * @static
|
7509 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
7510 | * @returns {google.cloud.speech.v1p1beta1.RecognitionMetadata} RecognitionMetadata
|
7511 | * @throws {Error} If the payload is not a reader or valid buffer
|
7512 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
7513 | */
|
7514 | RecognitionMetadata.decodeDelimited = function decodeDelimited(reader) {
|
7515 | if (!(reader instanceof $Reader))
|
7516 | reader = new $Reader(reader);
|
7517 | return this.decode(reader, reader.uint32());
|
7518 | };
|
7519 |
|
7520 | /**
|
7521 | * Verifies a RecognitionMetadata message.
|
7522 | * @function verify
|
7523 | * @memberof google.cloud.speech.v1p1beta1.RecognitionMetadata
|
7524 | * @static
|
7525 | * @param {Object.<string,*>} message Plain object to verify
|
7526 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
7527 | */
|
7528 | RecognitionMetadata.verify = function verify(message) {
|
7529 | if (typeof message !== "object" || message === null)
|
7530 | return "object expected";
|
7531 | if (message.interactionType != null && message.hasOwnProperty("interactionType"))
|
7532 | switch (message.interactionType) {
|
7533 | default:
|
7534 | return "interactionType: enum value expected";
|
7535 | case 0:
|
7536 | case 1:
|
7537 | case 2:
|
7538 | case 3:
|
7539 | case 4:
|
7540 | case 5:
|
7541 | case 6:
|
7542 | case 7:
|
7543 | case 8:
|
7544 | break;
|
7545 | }
|
7546 | if (message.industryNaicsCodeOfAudio != null && message.hasOwnProperty("industryNaicsCodeOfAudio"))
|
7547 | if (!$util.isInteger(message.industryNaicsCodeOfAudio))
|
7548 | return "industryNaicsCodeOfAudio: integer expected";
|
7549 | if (message.microphoneDistance != null && message.hasOwnProperty("microphoneDistance"))
|
7550 | switch (message.microphoneDistance) {
|
7551 | default:
|
7552 | return "microphoneDistance: enum value expected";
|
7553 | case 0:
|
7554 | case 1:
|
7555 | case 2:
|
7556 | case 3:
|
7557 | break;
|
7558 | }
|
7559 | if (message.originalMediaType != null && message.hasOwnProperty("originalMediaType"))
|
7560 | switch (message.originalMediaType) {
|
7561 | default:
|
7562 | return "originalMediaType: enum value expected";
|
7563 | case 0:
|
7564 | case 1:
|
7565 | case 2:
|
7566 | break;
|
7567 | }
|
7568 | if (message.recordingDeviceType != null && message.hasOwnProperty("recordingDeviceType"))
|
7569 | switch (message.recordingDeviceType) {
|
7570 | default:
|
7571 | return "recordingDeviceType: enum value expected";
|
7572 | case 0:
|
7573 | case 1:
|
7574 | case 2:
|
7575 | case 3:
|
7576 | case 4:
|
7577 | case 5:
|
7578 | case 6:
|
7579 | break;
|
7580 | }
|
7581 | if (message.recordingDeviceName != null && message.hasOwnProperty("recordingDeviceName"))
|
7582 | if (!$util.isString(message.recordingDeviceName))
|
7583 | return "recordingDeviceName: string expected";
|
7584 | if (message.originalMimeType != null && message.hasOwnProperty("originalMimeType"))
|
7585 | if (!$util.isString(message.originalMimeType))
|
7586 | return "originalMimeType: string expected";
|
7587 | if (message.obfuscatedId != null && message.hasOwnProperty("obfuscatedId"))
|
7588 | if (!$util.isInteger(message.obfuscatedId) && !(message.obfuscatedId && $util.isInteger(message.obfuscatedId.low) && $util.isInteger(message.obfuscatedId.high)))
|
7589 | return "obfuscatedId: integer|Long expected";
|
7590 | if (message.audioTopic != null && message.hasOwnProperty("audioTopic"))
|
7591 | if (!$util.isString(message.audioTopic))
|
7592 | return "audioTopic: string expected";
|
7593 | return null;
|
7594 | };
|
7595 |
|
7596 | /**
|
7597 | * Creates a RecognitionMetadata message from a plain object. Also converts values to their respective internal types.
|
7598 | * @function fromObject
|
7599 | * @memberof google.cloud.speech.v1p1beta1.RecognitionMetadata
|
7600 | * @static
|
7601 | * @param {Object.<string,*>} object Plain object
|
7602 | * @returns {google.cloud.speech.v1p1beta1.RecognitionMetadata} RecognitionMetadata
|
7603 | */
|
7604 | RecognitionMetadata.fromObject = function fromObject(object) {
|
7605 | if (object instanceof $root.google.cloud.speech.v1p1beta1.RecognitionMetadata)
|
7606 | return object;
|
7607 | var message = new $root.google.cloud.speech.v1p1beta1.RecognitionMetadata();
|
7608 | switch (object.interactionType) {
|
7609 | case "INTERACTION_TYPE_UNSPECIFIED":
|
7610 | case 0:
|
7611 | message.interactionType = 0;
|
7612 | break;
|
7613 | case "DISCUSSION":
|
7614 | case 1:
|
7615 | message.interactionType = 1;
|
7616 | break;
|
7617 | case "PRESENTATION":
|
7618 | case 2:
|
7619 | message.interactionType = 2;
|
7620 | break;
|
7621 | case "PHONE_CALL":
|
7622 | case 3:
|
7623 | message.interactionType = 3;
|
7624 | break;
|
7625 | case "VOICEMAIL":
|
7626 | case 4:
|
7627 | message.interactionType = 4;
|
7628 | break;
|
7629 | case "PROFESSIONALLY_PRODUCED":
|
7630 | case 5:
|
7631 | message.interactionType = 5;
|
7632 | break;
|
7633 | case "VOICE_SEARCH":
|
7634 | case 6:
|
7635 | message.interactionType = 6;
|
7636 | break;
|
7637 | case "VOICE_COMMAND":
|
7638 | case 7:
|
7639 | message.interactionType = 7;
|
7640 | break;
|
7641 | case "DICTATION":
|
7642 | case 8:
|
7643 | message.interactionType = 8;
|
7644 | break;
|
7645 | }
|
7646 | if (object.industryNaicsCodeOfAudio != null)
|
7647 | message.industryNaicsCodeOfAudio = object.industryNaicsCodeOfAudio >>> 0;
|
7648 | switch (object.microphoneDistance) {
|
7649 | case "MICROPHONE_DISTANCE_UNSPECIFIED":
|
7650 | case 0:
|
7651 | message.microphoneDistance = 0;
|
7652 | break;
|
7653 | case "NEARFIELD":
|
7654 | case 1:
|
7655 | message.microphoneDistance = 1;
|
7656 | break;
|
7657 | case "MIDFIELD":
|
7658 | case 2:
|
7659 | message.microphoneDistance = 2;
|
7660 | break;
|
7661 | case "FARFIELD":
|
7662 | case 3:
|
7663 | message.microphoneDistance = 3;
|
7664 | break;
|
7665 | }
|
7666 | switch (object.originalMediaType) {
|
7667 | case "ORIGINAL_MEDIA_TYPE_UNSPECIFIED":
|
7668 | case 0:
|
7669 | message.originalMediaType = 0;
|
7670 | break;
|
7671 | case "AUDIO":
|
7672 | case 1:
|
7673 | message.originalMediaType = 1;
|
7674 | break;
|
7675 | case "VIDEO":
|
7676 | case 2:
|
7677 | message.originalMediaType = 2;
|
7678 | break;
|
7679 | }
|
7680 | switch (object.recordingDeviceType) {
|
7681 | case "RECORDING_DEVICE_TYPE_UNSPECIFIED":
|
7682 | case 0:
|
7683 | message.recordingDeviceType = 0;
|
7684 | break;
|
7685 | case "SMARTPHONE":
|
7686 | case 1:
|
7687 | message.recordingDeviceType = 1;
|
7688 | break;
|
7689 | case "PC":
|
7690 | case 2:
|
7691 | message.recordingDeviceType = 2;
|
7692 | break;
|
7693 | case "PHONE_LINE":
|
7694 | case 3:
|
7695 | message.recordingDeviceType = 3;
|
7696 | break;
|
7697 | case "VEHICLE":
|
7698 | case 4:
|
7699 | message.recordingDeviceType = 4;
|
7700 | break;
|
7701 | case "OTHER_OUTDOOR_DEVICE":
|
7702 | case 5:
|
7703 | message.recordingDeviceType = 5;
|
7704 | break;
|
7705 | case "OTHER_INDOOR_DEVICE":
|
7706 | case 6:
|
7707 | message.recordingDeviceType = 6;
|
7708 | break;
|
7709 | }
|
7710 | if (object.recordingDeviceName != null)
|
7711 | message.recordingDeviceName = String(object.recordingDeviceName);
|
7712 | if (object.originalMimeType != null)
|
7713 | message.originalMimeType = String(object.originalMimeType);
|
7714 | if (object.obfuscatedId != null)
|
7715 | if ($util.Long)
|
7716 | (message.obfuscatedId = $util.Long.fromValue(object.obfuscatedId)).unsigned = false;
|
7717 | else if (typeof object.obfuscatedId === "string")
|
7718 | message.obfuscatedId = parseInt(object.obfuscatedId, 10);
|
7719 | else if (typeof object.obfuscatedId === "number")
|
7720 | message.obfuscatedId = object.obfuscatedId;
|
7721 | else if (typeof object.obfuscatedId === "object")
|
7722 | message.obfuscatedId = new $util.LongBits(object.obfuscatedId.low >>> 0, object.obfuscatedId.high >>> 0).toNumber();
|
7723 | if (object.audioTopic != null)
|
7724 | message.audioTopic = String(object.audioTopic);
|
7725 | return message;
|
7726 | };
|
7727 |
|
7728 | /**
|
7729 | * Creates a plain object from a RecognitionMetadata message. Also converts values to other types if specified.
|
7730 | * @function toObject
|
7731 | * @memberof google.cloud.speech.v1p1beta1.RecognitionMetadata
|
7732 | * @static
|
7733 | * @param {google.cloud.speech.v1p1beta1.RecognitionMetadata} message RecognitionMetadata
|
7734 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
7735 | * @returns {Object.<string,*>} Plain object
|
7736 | */
|
7737 | RecognitionMetadata.toObject = function toObject(message, options) {
|
7738 | if (!options)
|
7739 | options = {};
|
7740 | var object = {};
|
7741 | if (options.defaults) {
|
7742 | object.interactionType = options.enums === String ? "INTERACTION_TYPE_UNSPECIFIED" : 0;
|
7743 | object.industryNaicsCodeOfAudio = 0;
|
7744 | object.microphoneDistance = options.enums === String ? "MICROPHONE_DISTANCE_UNSPECIFIED" : 0;
|
7745 | object.originalMediaType = options.enums === String ? "ORIGINAL_MEDIA_TYPE_UNSPECIFIED" : 0;
|
7746 | object.recordingDeviceType = options.enums === String ? "RECORDING_DEVICE_TYPE_UNSPECIFIED" : 0;
|
7747 | object.recordingDeviceName = "";
|
7748 | object.originalMimeType = "";
|
7749 | if ($util.Long) {
|
7750 | var long = new $util.Long(0, 0, false);
|
7751 | object.obfuscatedId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
7752 | } else
|
7753 | object.obfuscatedId = options.longs === String ? "0" : 0;
|
7754 | object.audioTopic = "";
|
7755 | }
|
7756 | if (message.interactionType != null && message.hasOwnProperty("interactionType"))
|
7757 | object.interactionType = options.enums === String ? $root.google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType[message.interactionType] : message.interactionType;
|
7758 | if (message.industryNaicsCodeOfAudio != null && message.hasOwnProperty("industryNaicsCodeOfAudio"))
|
7759 | object.industryNaicsCodeOfAudio = message.industryNaicsCodeOfAudio;
|
7760 | if (message.microphoneDistance != null && message.hasOwnProperty("microphoneDistance"))
|
7761 | object.microphoneDistance = options.enums === String ? $root.google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance[message.microphoneDistance] : message.microphoneDistance;
|
7762 | if (message.originalMediaType != null && message.hasOwnProperty("originalMediaType"))
|
7763 | object.originalMediaType = options.enums === String ? $root.google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType[message.originalMediaType] : message.originalMediaType;
|
7764 | if (message.recordingDeviceType != null && message.hasOwnProperty("recordingDeviceType"))
|
7765 | object.recordingDeviceType = options.enums === String ? $root.google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType[message.recordingDeviceType] : message.recordingDeviceType;
|
7766 | if (message.recordingDeviceName != null && message.hasOwnProperty("recordingDeviceName"))
|
7767 | object.recordingDeviceName = message.recordingDeviceName;
|
7768 | if (message.originalMimeType != null && message.hasOwnProperty("originalMimeType"))
|
7769 | object.originalMimeType = message.originalMimeType;
|
7770 | if (message.obfuscatedId != null && message.hasOwnProperty("obfuscatedId"))
|
7771 | if (typeof message.obfuscatedId === "number")
|
7772 | object.obfuscatedId = options.longs === String ? String(message.obfuscatedId) : message.obfuscatedId;
|
7773 | else
|
7774 | object.obfuscatedId = options.longs === String ? $util.Long.prototype.toString.call(message.obfuscatedId) : options.longs === Number ? new $util.LongBits(message.obfuscatedId.low >>> 0, message.obfuscatedId.high >>> 0).toNumber() : message.obfuscatedId;
|
7775 | if (message.audioTopic != null && message.hasOwnProperty("audioTopic"))
|
7776 | object.audioTopic = message.audioTopic;
|
7777 | return object;
|
7778 | };
|
7779 |
|
7780 | /**
|
7781 | * Converts this RecognitionMetadata to JSON.
|
7782 | * @function toJSON
|
7783 | * @memberof google.cloud.speech.v1p1beta1.RecognitionMetadata
|
7784 | * @instance
|
7785 | * @returns {Object.<string,*>} JSON object
|
7786 | */
|
7787 | RecognitionMetadata.prototype.toJSON = function toJSON() {
|
7788 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
7789 | };
|
7790 |
|
7791 | /**
|
7792 | * InteractionType enum.
|
7793 | * @name google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType
|
7794 | * @enum {number}
|
7795 | * @property {number} INTERACTION_TYPE_UNSPECIFIED=0 INTERACTION_TYPE_UNSPECIFIED value
|
7796 | * @property {number} DISCUSSION=1 DISCUSSION value
|
7797 | * @property {number} PRESENTATION=2 PRESENTATION value
|
7798 | * @property {number} PHONE_CALL=3 PHONE_CALL value
|
7799 | * @property {number} VOICEMAIL=4 VOICEMAIL value
|
7800 | * @property {number} PROFESSIONALLY_PRODUCED=5 PROFESSIONALLY_PRODUCED value
|
7801 | * @property {number} VOICE_SEARCH=6 VOICE_SEARCH value
|
7802 | * @property {number} VOICE_COMMAND=7 VOICE_COMMAND value
|
7803 | * @property {number} DICTATION=8 DICTATION value
|
7804 | */
|
7805 | RecognitionMetadata.InteractionType = (function() {
|
7806 | var valuesById = {}, values = Object.create(valuesById);
|
7807 | values[valuesById[0] = "INTERACTION_TYPE_UNSPECIFIED"] = 0;
|
7808 | values[valuesById[1] = "DISCUSSION"] = 1;
|
7809 | values[valuesById[2] = "PRESENTATION"] = 2;
|
7810 | values[valuesById[3] = "PHONE_CALL"] = 3;
|
7811 | values[valuesById[4] = "VOICEMAIL"] = 4;
|
7812 | values[valuesById[5] = "PROFESSIONALLY_PRODUCED"] = 5;
|
7813 | values[valuesById[6] = "VOICE_SEARCH"] = 6;
|
7814 | values[valuesById[7] = "VOICE_COMMAND"] = 7;
|
7815 | values[valuesById[8] = "DICTATION"] = 8;
|
7816 | return values;
|
7817 | })();
|
7818 |
|
7819 | /**
|
7820 | * MicrophoneDistance enum.
|
7821 | * @name google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance
|
7822 | * @enum {number}
|
7823 | * @property {number} MICROPHONE_DISTANCE_UNSPECIFIED=0 MICROPHONE_DISTANCE_UNSPECIFIED value
|
7824 | * @property {number} NEARFIELD=1 NEARFIELD value
|
7825 | * @property {number} MIDFIELD=2 MIDFIELD value
|
7826 | * @property {number} FARFIELD=3 FARFIELD value
|
7827 | */
|
7828 | RecognitionMetadata.MicrophoneDistance = (function() {
|
7829 | var valuesById = {}, values = Object.create(valuesById);
|
7830 | values[valuesById[0] = "MICROPHONE_DISTANCE_UNSPECIFIED"] = 0;
|
7831 | values[valuesById[1] = "NEARFIELD"] = 1;
|
7832 | values[valuesById[2] = "MIDFIELD"] = 2;
|
7833 | values[valuesById[3] = "FARFIELD"] = 3;
|
7834 | return values;
|
7835 | })();
|
7836 |
|
7837 | /**
|
7838 | * OriginalMediaType enum.
|
7839 | * @name google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType
|
7840 | * @enum {number}
|
7841 | * @property {number} ORIGINAL_MEDIA_TYPE_UNSPECIFIED=0 ORIGINAL_MEDIA_TYPE_UNSPECIFIED value
|
7842 | * @property {number} AUDIO=1 AUDIO value
|
7843 | * @property {number} VIDEO=2 VIDEO value
|
7844 | */
|
7845 | RecognitionMetadata.OriginalMediaType = (function() {
|
7846 | var valuesById = {}, values = Object.create(valuesById);
|
7847 | values[valuesById[0] = "ORIGINAL_MEDIA_TYPE_UNSPECIFIED"] = 0;
|
7848 | values[valuesById[1] = "AUDIO"] = 1;
|
7849 | values[valuesById[2] = "VIDEO"] = 2;
|
7850 | return values;
|
7851 | })();
|
7852 |
|
7853 | /**
|
7854 | * RecordingDeviceType enum.
|
7855 | * @name google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType
|
7856 | * @enum {number}
|
7857 | * @property {number} RECORDING_DEVICE_TYPE_UNSPECIFIED=0 RECORDING_DEVICE_TYPE_UNSPECIFIED value
|
7858 | * @property {number} SMARTPHONE=1 SMARTPHONE value
|
7859 | * @property {number} PC=2 PC value
|
7860 | * @property {number} PHONE_LINE=3 PHONE_LINE value
|
7861 | * @property {number} VEHICLE=4 VEHICLE value
|
7862 | * @property {number} OTHER_OUTDOOR_DEVICE=5 OTHER_OUTDOOR_DEVICE value
|
7863 | * @property {number} OTHER_INDOOR_DEVICE=6 OTHER_INDOOR_DEVICE value
|
7864 | */
|
7865 | RecognitionMetadata.RecordingDeviceType = (function() {
|
7866 | var valuesById = {}, values = Object.create(valuesById);
|
7867 | values[valuesById[0] = "RECORDING_DEVICE_TYPE_UNSPECIFIED"] = 0;
|
7868 | values[valuesById[1] = "SMARTPHONE"] = 1;
|
7869 | values[valuesById[2] = "PC"] = 2;
|
7870 | values[valuesById[3] = "PHONE_LINE"] = 3;
|
7871 | values[valuesById[4] = "VEHICLE"] = 4;
|
7872 | values[valuesById[5] = "OTHER_OUTDOOR_DEVICE"] = 5;
|
7873 | values[valuesById[6] = "OTHER_INDOOR_DEVICE"] = 6;
|
7874 | return values;
|
7875 | })();
|
7876 |
|
7877 | return RecognitionMetadata;
|
7878 | })();
|
7879 |
|
7880 | v1p1beta1.SpeechContext = (function() {
|
7881 |
|
7882 | /**
|
7883 | * Properties of a SpeechContext.
|
7884 | * @memberof google.cloud.speech.v1p1beta1
|
7885 | * @interface ISpeechContext
|
7886 | * @property {Array.<string>|null} [phrases] SpeechContext phrases
|
7887 | * @property {number|null} [boost] SpeechContext boost
|
7888 | */
|
7889 |
|
7890 | /**
|
7891 | * Constructs a new SpeechContext.
|
7892 | * @memberof google.cloud.speech.v1p1beta1
|
7893 | * @classdesc Represents a SpeechContext.
|
7894 | * @implements ISpeechContext
|
7895 | * @constructor
|
7896 | * @param {google.cloud.speech.v1p1beta1.ISpeechContext=} [properties] Properties to set
|
7897 | */
|
7898 | function SpeechContext(properties) {
|
7899 | this.phrases = [];
|
7900 | if (properties)
|
7901 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
7902 | if (properties[keys[i]] != null)
|
7903 | this[keys[i]] = properties[keys[i]];
|
7904 | }
|
7905 |
|
7906 | /**
|
7907 | * SpeechContext phrases.
|
7908 | * @member {Array.<string>} phrases
|
7909 | * @memberof google.cloud.speech.v1p1beta1.SpeechContext
|
7910 | * @instance
|
7911 | */
|
7912 | SpeechContext.prototype.phrases = $util.emptyArray;
|
7913 |
|
7914 | /**
|
7915 | * SpeechContext boost.
|
7916 | * @member {number} boost
|
7917 | * @memberof google.cloud.speech.v1p1beta1.SpeechContext
|
7918 | * @instance
|
7919 | */
|
7920 | SpeechContext.prototype.boost = 0;
|
7921 |
|
7922 | /**
|
7923 | * Creates a new SpeechContext instance using the specified properties.
|
7924 | * @function create
|
7925 | * @memberof google.cloud.speech.v1p1beta1.SpeechContext
|
7926 | * @static
|
7927 | * @param {google.cloud.speech.v1p1beta1.ISpeechContext=} [properties] Properties to set
|
7928 | * @returns {google.cloud.speech.v1p1beta1.SpeechContext} SpeechContext instance
|
7929 | */
|
7930 | SpeechContext.create = function create(properties) {
|
7931 | return new SpeechContext(properties);
|
7932 | };
|
7933 |
|
7934 | /**
|
7935 | * Encodes the specified SpeechContext message. Does not implicitly {@link google.cloud.speech.v1p1beta1.SpeechContext.verify|verify} messages.
|
7936 | * @function encode
|
7937 | * @memberof google.cloud.speech.v1p1beta1.SpeechContext
|
7938 | * @static
|
7939 | * @param {google.cloud.speech.v1p1beta1.ISpeechContext} message SpeechContext message or plain object to encode
|
7940 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
7941 | * @returns {$protobuf.Writer} Writer
|
7942 | */
|
7943 | SpeechContext.encode = function encode(message, writer) {
|
7944 | if (!writer)
|
7945 | writer = $Writer.create();
|
7946 | if (message.phrases != null && message.phrases.length)
|
7947 | for (var i = 0; i < message.phrases.length; ++i)
|
7948 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.phrases[i]);
|
7949 | if (message.boost != null && Object.hasOwnProperty.call(message, "boost"))
|
7950 | writer.uint32(/* id 4, wireType 5 =*/37).float(message.boost);
|
7951 | return writer;
|
7952 | };
|
7953 |
|
7954 | /**
|
7955 | * Encodes the specified SpeechContext message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.SpeechContext.verify|verify} messages.
|
7956 | * @function encodeDelimited
|
7957 | * @memberof google.cloud.speech.v1p1beta1.SpeechContext
|
7958 | * @static
|
7959 | * @param {google.cloud.speech.v1p1beta1.ISpeechContext} message SpeechContext message or plain object to encode
|
7960 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
7961 | * @returns {$protobuf.Writer} Writer
|
7962 | */
|
7963 | SpeechContext.encodeDelimited = function encodeDelimited(message, writer) {
|
7964 | return this.encode(message, writer).ldelim();
|
7965 | };
|
7966 |
|
7967 | /**
|
7968 | * Decodes a SpeechContext message from the specified reader or buffer.
|
7969 | * @function decode
|
7970 | * @memberof google.cloud.speech.v1p1beta1.SpeechContext
|
7971 | * @static
|
7972 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
7973 | * @param {number} [length] Message length if known beforehand
|
7974 | * @returns {google.cloud.speech.v1p1beta1.SpeechContext} SpeechContext
|
7975 | * @throws {Error} If the payload is not a reader or valid buffer
|
7976 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
7977 | */
|
7978 | SpeechContext.decode = function decode(reader, length) {
|
7979 | if (!(reader instanceof $Reader))
|
7980 | reader = $Reader.create(reader);
|
7981 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.SpeechContext();
|
7982 | while (reader.pos < end) {
|
7983 | var tag = reader.uint32();
|
7984 | switch (tag >>> 3) {
|
7985 | case 1:
|
7986 | if (!(message.phrases && message.phrases.length))
|
7987 | message.phrases = [];
|
7988 | message.phrases.push(reader.string());
|
7989 | break;
|
7990 | case 4:
|
7991 | message.boost = reader.float();
|
7992 | break;
|
7993 | default:
|
7994 | reader.skipType(tag & 7);
|
7995 | break;
|
7996 | }
|
7997 | }
|
7998 | return message;
|
7999 | };
|
8000 |
|
8001 | /**
|
8002 | * Decodes a SpeechContext message from the specified reader or buffer, length delimited.
|
8003 | * @function decodeDelimited
|
8004 | * @memberof google.cloud.speech.v1p1beta1.SpeechContext
|
8005 | * @static
|
8006 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
8007 | * @returns {google.cloud.speech.v1p1beta1.SpeechContext} SpeechContext
|
8008 | * @throws {Error} If the payload is not a reader or valid buffer
|
8009 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
8010 | */
|
8011 | SpeechContext.decodeDelimited = function decodeDelimited(reader) {
|
8012 | if (!(reader instanceof $Reader))
|
8013 | reader = new $Reader(reader);
|
8014 | return this.decode(reader, reader.uint32());
|
8015 | };
|
8016 |
|
8017 | /**
|
8018 | * Verifies a SpeechContext message.
|
8019 | * @function verify
|
8020 | * @memberof google.cloud.speech.v1p1beta1.SpeechContext
|
8021 | * @static
|
8022 | * @param {Object.<string,*>} message Plain object to verify
|
8023 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
8024 | */
|
8025 | SpeechContext.verify = function verify(message) {
|
8026 | if (typeof message !== "object" || message === null)
|
8027 | return "object expected";
|
8028 | if (message.phrases != null && message.hasOwnProperty("phrases")) {
|
8029 | if (!Array.isArray(message.phrases))
|
8030 | return "phrases: array expected";
|
8031 | for (var i = 0; i < message.phrases.length; ++i)
|
8032 | if (!$util.isString(message.phrases[i]))
|
8033 | return "phrases: string[] expected";
|
8034 | }
|
8035 | if (message.boost != null && message.hasOwnProperty("boost"))
|
8036 | if (typeof message.boost !== "number")
|
8037 | return "boost: number expected";
|
8038 | return null;
|
8039 | };
|
8040 |
|
8041 | /**
|
8042 | * Creates a SpeechContext message from a plain object. Also converts values to their respective internal types.
|
8043 | * @function fromObject
|
8044 | * @memberof google.cloud.speech.v1p1beta1.SpeechContext
|
8045 | * @static
|
8046 | * @param {Object.<string,*>} object Plain object
|
8047 | * @returns {google.cloud.speech.v1p1beta1.SpeechContext} SpeechContext
|
8048 | */
|
8049 | SpeechContext.fromObject = function fromObject(object) {
|
8050 | if (object instanceof $root.google.cloud.speech.v1p1beta1.SpeechContext)
|
8051 | return object;
|
8052 | var message = new $root.google.cloud.speech.v1p1beta1.SpeechContext();
|
8053 | if (object.phrases) {
|
8054 | if (!Array.isArray(object.phrases))
|
8055 | throw TypeError(".google.cloud.speech.v1p1beta1.SpeechContext.phrases: array expected");
|
8056 | message.phrases = [];
|
8057 | for (var i = 0; i < object.phrases.length; ++i)
|
8058 | message.phrases[i] = String(object.phrases[i]);
|
8059 | }
|
8060 | if (object.boost != null)
|
8061 | message.boost = Number(object.boost);
|
8062 | return message;
|
8063 | };
|
8064 |
|
8065 | /**
|
8066 | * Creates a plain object from a SpeechContext message. Also converts values to other types if specified.
|
8067 | * @function toObject
|
8068 | * @memberof google.cloud.speech.v1p1beta1.SpeechContext
|
8069 | * @static
|
8070 | * @param {google.cloud.speech.v1p1beta1.SpeechContext} message SpeechContext
|
8071 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
8072 | * @returns {Object.<string,*>} Plain object
|
8073 | */
|
8074 | SpeechContext.toObject = function toObject(message, options) {
|
8075 | if (!options)
|
8076 | options = {};
|
8077 | var object = {};
|
8078 | if (options.arrays || options.defaults)
|
8079 | object.phrases = [];
|
8080 | if (options.defaults)
|
8081 | object.boost = 0;
|
8082 | if (message.phrases && message.phrases.length) {
|
8083 | object.phrases = [];
|
8084 | for (var j = 0; j < message.phrases.length; ++j)
|
8085 | object.phrases[j] = message.phrases[j];
|
8086 | }
|
8087 | if (message.boost != null && message.hasOwnProperty("boost"))
|
8088 | object.boost = options.json && !isFinite(message.boost) ? String(message.boost) : message.boost;
|
8089 | return object;
|
8090 | };
|
8091 |
|
8092 | /**
|
8093 | * Converts this SpeechContext to JSON.
|
8094 | * @function toJSON
|
8095 | * @memberof google.cloud.speech.v1p1beta1.SpeechContext
|
8096 | * @instance
|
8097 | * @returns {Object.<string,*>} JSON object
|
8098 | */
|
8099 | SpeechContext.prototype.toJSON = function toJSON() {
|
8100 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
8101 | };
|
8102 |
|
8103 | return SpeechContext;
|
8104 | })();
|
8105 |
|
8106 | v1p1beta1.RecognitionAudio = (function() {
|
8107 |
|
8108 | /**
|
8109 | * Properties of a RecognitionAudio.
|
8110 | * @memberof google.cloud.speech.v1p1beta1
|
8111 | * @interface IRecognitionAudio
|
8112 | * @property {Uint8Array|null} [content] RecognitionAudio content
|
8113 | * @property {string|null} [uri] RecognitionAudio uri
|
8114 | */
|
8115 |
|
8116 | /**
|
8117 | * Constructs a new RecognitionAudio.
|
8118 | * @memberof google.cloud.speech.v1p1beta1
|
8119 | * @classdesc Represents a RecognitionAudio.
|
8120 | * @implements IRecognitionAudio
|
8121 | * @constructor
|
8122 | * @param {google.cloud.speech.v1p1beta1.IRecognitionAudio=} [properties] Properties to set
|
8123 | */
|
8124 | function RecognitionAudio(properties) {
|
8125 | if (properties)
|
8126 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
8127 | if (properties[keys[i]] != null)
|
8128 | this[keys[i]] = properties[keys[i]];
|
8129 | }
|
8130 |
|
8131 | /**
|
8132 | * RecognitionAudio content.
|
8133 | * @member {Uint8Array|null|undefined} content
|
8134 | * @memberof google.cloud.speech.v1p1beta1.RecognitionAudio
|
8135 | * @instance
|
8136 | */
|
8137 | RecognitionAudio.prototype.content = null;
|
8138 |
|
8139 | /**
|
8140 | * RecognitionAudio uri.
|
8141 | * @member {string|null|undefined} uri
|
8142 | * @memberof google.cloud.speech.v1p1beta1.RecognitionAudio
|
8143 | * @instance
|
8144 | */
|
8145 | RecognitionAudio.prototype.uri = null;
|
8146 |
|
8147 | // OneOf field names bound to virtual getters and setters
|
8148 | var $oneOfFields;
|
8149 |
|
8150 | /**
|
8151 | * RecognitionAudio audioSource.
|
8152 | * @member {"content"|"uri"|undefined} audioSource
|
8153 | * @memberof google.cloud.speech.v1p1beta1.RecognitionAudio
|
8154 | * @instance
|
8155 | */
|
8156 | Object.defineProperty(RecognitionAudio.prototype, "audioSource", {
|
8157 | get: $util.oneOfGetter($oneOfFields = ["content", "uri"]),
|
8158 | set: $util.oneOfSetter($oneOfFields)
|
8159 | });
|
8160 |
|
8161 | /**
|
8162 | * Creates a new RecognitionAudio instance using the specified properties.
|
8163 | * @function create
|
8164 | * @memberof google.cloud.speech.v1p1beta1.RecognitionAudio
|
8165 | * @static
|
8166 | * @param {google.cloud.speech.v1p1beta1.IRecognitionAudio=} [properties] Properties to set
|
8167 | * @returns {google.cloud.speech.v1p1beta1.RecognitionAudio} RecognitionAudio instance
|
8168 | */
|
8169 | RecognitionAudio.create = function create(properties) {
|
8170 | return new RecognitionAudio(properties);
|
8171 | };
|
8172 |
|
8173 | /**
|
8174 | * Encodes the specified RecognitionAudio message. Does not implicitly {@link google.cloud.speech.v1p1beta1.RecognitionAudio.verify|verify} messages.
|
8175 | * @function encode
|
8176 | * @memberof google.cloud.speech.v1p1beta1.RecognitionAudio
|
8177 | * @static
|
8178 | * @param {google.cloud.speech.v1p1beta1.IRecognitionAudio} message RecognitionAudio message or plain object to encode
|
8179 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
8180 | * @returns {$protobuf.Writer} Writer
|
8181 | */
|
8182 | RecognitionAudio.encode = function encode(message, writer) {
|
8183 | if (!writer)
|
8184 | writer = $Writer.create();
|
8185 | if (message.content != null && Object.hasOwnProperty.call(message, "content"))
|
8186 | writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.content);
|
8187 | if (message.uri != null && Object.hasOwnProperty.call(message, "uri"))
|
8188 | writer.uint32(/* id 2, wireType 2 =*/18).string(message.uri);
|
8189 | return writer;
|
8190 | };
|
8191 |
|
8192 | /**
|
8193 | * Encodes the specified RecognitionAudio message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.RecognitionAudio.verify|verify} messages.
|
8194 | * @function encodeDelimited
|
8195 | * @memberof google.cloud.speech.v1p1beta1.RecognitionAudio
|
8196 | * @static
|
8197 | * @param {google.cloud.speech.v1p1beta1.IRecognitionAudio} message RecognitionAudio message or plain object to encode
|
8198 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
8199 | * @returns {$protobuf.Writer} Writer
|
8200 | */
|
8201 | RecognitionAudio.encodeDelimited = function encodeDelimited(message, writer) {
|
8202 | return this.encode(message, writer).ldelim();
|
8203 | };
|
8204 |
|
8205 | /**
|
8206 | * Decodes a RecognitionAudio message from the specified reader or buffer.
|
8207 | * @function decode
|
8208 | * @memberof google.cloud.speech.v1p1beta1.RecognitionAudio
|
8209 | * @static
|
8210 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
8211 | * @param {number} [length] Message length if known beforehand
|
8212 | * @returns {google.cloud.speech.v1p1beta1.RecognitionAudio} RecognitionAudio
|
8213 | * @throws {Error} If the payload is not a reader or valid buffer
|
8214 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
8215 | */
|
8216 | RecognitionAudio.decode = function decode(reader, length) {
|
8217 | if (!(reader instanceof $Reader))
|
8218 | reader = $Reader.create(reader);
|
8219 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.RecognitionAudio();
|
8220 | while (reader.pos < end) {
|
8221 | var tag = reader.uint32();
|
8222 | switch (tag >>> 3) {
|
8223 | case 1:
|
8224 | message.content = reader.bytes();
|
8225 | break;
|
8226 | case 2:
|
8227 | message.uri = reader.string();
|
8228 | break;
|
8229 | default:
|
8230 | reader.skipType(tag & 7);
|
8231 | break;
|
8232 | }
|
8233 | }
|
8234 | return message;
|
8235 | };
|
8236 |
|
8237 | /**
|
8238 | * Decodes a RecognitionAudio message from the specified reader or buffer, length delimited.
|
8239 | * @function decodeDelimited
|
8240 | * @memberof google.cloud.speech.v1p1beta1.RecognitionAudio
|
8241 | * @static
|
8242 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
8243 | * @returns {google.cloud.speech.v1p1beta1.RecognitionAudio} RecognitionAudio
|
8244 | * @throws {Error} If the payload is not a reader or valid buffer
|
8245 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
8246 | */
|
8247 | RecognitionAudio.decodeDelimited = function decodeDelimited(reader) {
|
8248 | if (!(reader instanceof $Reader))
|
8249 | reader = new $Reader(reader);
|
8250 | return this.decode(reader, reader.uint32());
|
8251 | };
|
8252 |
|
8253 | /**
|
8254 | * Verifies a RecognitionAudio message.
|
8255 | * @function verify
|
8256 | * @memberof google.cloud.speech.v1p1beta1.RecognitionAudio
|
8257 | * @static
|
8258 | * @param {Object.<string,*>} message Plain object to verify
|
8259 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
8260 | */
|
8261 | RecognitionAudio.verify = function verify(message) {
|
8262 | if (typeof message !== "object" || message === null)
|
8263 | return "object expected";
|
8264 | var properties = {};
|
8265 | if (message.content != null && message.hasOwnProperty("content")) {
|
8266 | properties.audioSource = 1;
|
8267 | if (!(message.content && typeof message.content.length === "number" || $util.isString(message.content)))
|
8268 | return "content: buffer expected";
|
8269 | }
|
8270 | if (message.uri != null && message.hasOwnProperty("uri")) {
|
8271 | if (properties.audioSource === 1)
|
8272 | return "audioSource: multiple values";
|
8273 | properties.audioSource = 1;
|
8274 | if (!$util.isString(message.uri))
|
8275 | return "uri: string expected";
|
8276 | }
|
8277 | return null;
|
8278 | };
|
8279 |
|
8280 | /**
|
8281 | * Creates a RecognitionAudio message from a plain object. Also converts values to their respective internal types.
|
8282 | * @function fromObject
|
8283 | * @memberof google.cloud.speech.v1p1beta1.RecognitionAudio
|
8284 | * @static
|
8285 | * @param {Object.<string,*>} object Plain object
|
8286 | * @returns {google.cloud.speech.v1p1beta1.RecognitionAudio} RecognitionAudio
|
8287 | */
|
8288 | RecognitionAudio.fromObject = function fromObject(object) {
|
8289 | if (object instanceof $root.google.cloud.speech.v1p1beta1.RecognitionAudio)
|
8290 | return object;
|
8291 | var message = new $root.google.cloud.speech.v1p1beta1.RecognitionAudio();
|
8292 | if (object.content != null)
|
8293 | if (typeof object.content === "string")
|
8294 | $util.base64.decode(object.content, message.content = $util.newBuffer($util.base64.length(object.content)), 0);
|
8295 | else if (object.content.length)
|
8296 | message.content = object.content;
|
8297 | if (object.uri != null)
|
8298 | message.uri = String(object.uri);
|
8299 | return message;
|
8300 | };
|
8301 |
|
8302 | /**
|
8303 | * Creates a plain object from a RecognitionAudio message. Also converts values to other types if specified.
|
8304 | * @function toObject
|
8305 | * @memberof google.cloud.speech.v1p1beta1.RecognitionAudio
|
8306 | * @static
|
8307 | * @param {google.cloud.speech.v1p1beta1.RecognitionAudio} message RecognitionAudio
|
8308 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
8309 | * @returns {Object.<string,*>} Plain object
|
8310 | */
|
8311 | RecognitionAudio.toObject = function toObject(message, options) {
|
8312 | if (!options)
|
8313 | options = {};
|
8314 | var object = {};
|
8315 | if (message.content != null && message.hasOwnProperty("content")) {
|
8316 | object.content = options.bytes === String ? $util.base64.encode(message.content, 0, message.content.length) : options.bytes === Array ? Array.prototype.slice.call(message.content) : message.content;
|
8317 | if (options.oneofs)
|
8318 | object.audioSource = "content";
|
8319 | }
|
8320 | if (message.uri != null && message.hasOwnProperty("uri")) {
|
8321 | object.uri = message.uri;
|
8322 | if (options.oneofs)
|
8323 | object.audioSource = "uri";
|
8324 | }
|
8325 | return object;
|
8326 | };
|
8327 |
|
8328 | /**
|
8329 | * Converts this RecognitionAudio to JSON.
|
8330 | * @function toJSON
|
8331 | * @memberof google.cloud.speech.v1p1beta1.RecognitionAudio
|
8332 | * @instance
|
8333 | * @returns {Object.<string,*>} JSON object
|
8334 | */
|
8335 | RecognitionAudio.prototype.toJSON = function toJSON() {
|
8336 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
8337 | };
|
8338 |
|
8339 | return RecognitionAudio;
|
8340 | })();
|
8341 |
|
8342 | v1p1beta1.RecognizeResponse = (function() {
|
8343 |
|
8344 | /**
|
8345 | * Properties of a RecognizeResponse.
|
8346 | * @memberof google.cloud.speech.v1p1beta1
|
8347 | * @interface IRecognizeResponse
|
8348 | * @property {Array.<google.cloud.speech.v1p1beta1.ISpeechRecognitionResult>|null} [results] RecognizeResponse results
|
8349 | */
|
8350 |
|
8351 | /**
|
8352 | * Constructs a new RecognizeResponse.
|
8353 | * @memberof google.cloud.speech.v1p1beta1
|
8354 | * @classdesc Represents a RecognizeResponse.
|
8355 | * @implements IRecognizeResponse
|
8356 | * @constructor
|
8357 | * @param {google.cloud.speech.v1p1beta1.IRecognizeResponse=} [properties] Properties to set
|
8358 | */
|
8359 | function RecognizeResponse(properties) {
|
8360 | this.results = [];
|
8361 | if (properties)
|
8362 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
8363 | if (properties[keys[i]] != null)
|
8364 | this[keys[i]] = properties[keys[i]];
|
8365 | }
|
8366 |
|
8367 | /**
|
8368 | * RecognizeResponse results.
|
8369 | * @member {Array.<google.cloud.speech.v1p1beta1.ISpeechRecognitionResult>} results
|
8370 | * @memberof google.cloud.speech.v1p1beta1.RecognizeResponse
|
8371 | * @instance
|
8372 | */
|
8373 | RecognizeResponse.prototype.results = $util.emptyArray;
|
8374 |
|
8375 | /**
|
8376 | * Creates a new RecognizeResponse instance using the specified properties.
|
8377 | * @function create
|
8378 | * @memberof google.cloud.speech.v1p1beta1.RecognizeResponse
|
8379 | * @static
|
8380 | * @param {google.cloud.speech.v1p1beta1.IRecognizeResponse=} [properties] Properties to set
|
8381 | * @returns {google.cloud.speech.v1p1beta1.RecognizeResponse} RecognizeResponse instance
|
8382 | */
|
8383 | RecognizeResponse.create = function create(properties) {
|
8384 | return new RecognizeResponse(properties);
|
8385 | };
|
8386 |
|
8387 | /**
|
8388 | * Encodes the specified RecognizeResponse message. Does not implicitly {@link google.cloud.speech.v1p1beta1.RecognizeResponse.verify|verify} messages.
|
8389 | * @function encode
|
8390 | * @memberof google.cloud.speech.v1p1beta1.RecognizeResponse
|
8391 | * @static
|
8392 | * @param {google.cloud.speech.v1p1beta1.IRecognizeResponse} message RecognizeResponse message or plain object to encode
|
8393 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
8394 | * @returns {$protobuf.Writer} Writer
|
8395 | */
|
8396 | RecognizeResponse.encode = function encode(message, writer) {
|
8397 | if (!writer)
|
8398 | writer = $Writer.create();
|
8399 | if (message.results != null && message.results.length)
|
8400 | for (var i = 0; i < message.results.length; ++i)
|
8401 | $root.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.encode(message.results[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
8402 | return writer;
|
8403 | };
|
8404 |
|
8405 | /**
|
8406 | * Encodes the specified RecognizeResponse message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.RecognizeResponse.verify|verify} messages.
|
8407 | * @function encodeDelimited
|
8408 | * @memberof google.cloud.speech.v1p1beta1.RecognizeResponse
|
8409 | * @static
|
8410 | * @param {google.cloud.speech.v1p1beta1.IRecognizeResponse} message RecognizeResponse message or plain object to encode
|
8411 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
8412 | * @returns {$protobuf.Writer} Writer
|
8413 | */
|
8414 | RecognizeResponse.encodeDelimited = function encodeDelimited(message, writer) {
|
8415 | return this.encode(message, writer).ldelim();
|
8416 | };
|
8417 |
|
8418 | /**
|
8419 | * Decodes a RecognizeResponse message from the specified reader or buffer.
|
8420 | * @function decode
|
8421 | * @memberof google.cloud.speech.v1p1beta1.RecognizeResponse
|
8422 | * @static
|
8423 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
8424 | * @param {number} [length] Message length if known beforehand
|
8425 | * @returns {google.cloud.speech.v1p1beta1.RecognizeResponse} RecognizeResponse
|
8426 | * @throws {Error} If the payload is not a reader or valid buffer
|
8427 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
8428 | */
|
8429 | RecognizeResponse.decode = function decode(reader, length) {
|
8430 | if (!(reader instanceof $Reader))
|
8431 | reader = $Reader.create(reader);
|
8432 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.RecognizeResponse();
|
8433 | while (reader.pos < end) {
|
8434 | var tag = reader.uint32();
|
8435 | switch (tag >>> 3) {
|
8436 | case 2:
|
8437 | if (!(message.results && message.results.length))
|
8438 | message.results = [];
|
8439 | message.results.push($root.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.decode(reader, reader.uint32()));
|
8440 | break;
|
8441 | default:
|
8442 | reader.skipType(tag & 7);
|
8443 | break;
|
8444 | }
|
8445 | }
|
8446 | return message;
|
8447 | };
|
8448 |
|
8449 | /**
|
8450 | * Decodes a RecognizeResponse message from the specified reader or buffer, length delimited.
|
8451 | * @function decodeDelimited
|
8452 | * @memberof google.cloud.speech.v1p1beta1.RecognizeResponse
|
8453 | * @static
|
8454 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
8455 | * @returns {google.cloud.speech.v1p1beta1.RecognizeResponse} RecognizeResponse
|
8456 | * @throws {Error} If the payload is not a reader or valid buffer
|
8457 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
8458 | */
|
8459 | RecognizeResponse.decodeDelimited = function decodeDelimited(reader) {
|
8460 | if (!(reader instanceof $Reader))
|
8461 | reader = new $Reader(reader);
|
8462 | return this.decode(reader, reader.uint32());
|
8463 | };
|
8464 |
|
8465 | /**
|
8466 | * Verifies a RecognizeResponse message.
|
8467 | * @function verify
|
8468 | * @memberof google.cloud.speech.v1p1beta1.RecognizeResponse
|
8469 | * @static
|
8470 | * @param {Object.<string,*>} message Plain object to verify
|
8471 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
8472 | */
|
8473 | RecognizeResponse.verify = function verify(message) {
|
8474 | if (typeof message !== "object" || message === null)
|
8475 | return "object expected";
|
8476 | if (message.results != null && message.hasOwnProperty("results")) {
|
8477 | if (!Array.isArray(message.results))
|
8478 | return "results: array expected";
|
8479 | for (var i = 0; i < message.results.length; ++i) {
|
8480 | var error = $root.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.verify(message.results[i]);
|
8481 | if (error)
|
8482 | return "results." + error;
|
8483 | }
|
8484 | }
|
8485 | return null;
|
8486 | };
|
8487 |
|
8488 | /**
|
8489 | * Creates a RecognizeResponse message from a plain object. Also converts values to their respective internal types.
|
8490 | * @function fromObject
|
8491 | * @memberof google.cloud.speech.v1p1beta1.RecognizeResponse
|
8492 | * @static
|
8493 | * @param {Object.<string,*>} object Plain object
|
8494 | * @returns {google.cloud.speech.v1p1beta1.RecognizeResponse} RecognizeResponse
|
8495 | */
|
8496 | RecognizeResponse.fromObject = function fromObject(object) {
|
8497 | if (object instanceof $root.google.cloud.speech.v1p1beta1.RecognizeResponse)
|
8498 | return object;
|
8499 | var message = new $root.google.cloud.speech.v1p1beta1.RecognizeResponse();
|
8500 | if (object.results) {
|
8501 | if (!Array.isArray(object.results))
|
8502 | throw TypeError(".google.cloud.speech.v1p1beta1.RecognizeResponse.results: array expected");
|
8503 | message.results = [];
|
8504 | for (var i = 0; i < object.results.length; ++i) {
|
8505 | if (typeof object.results[i] !== "object")
|
8506 | throw TypeError(".google.cloud.speech.v1p1beta1.RecognizeResponse.results: object expected");
|
8507 | message.results[i] = $root.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.fromObject(object.results[i]);
|
8508 | }
|
8509 | }
|
8510 | return message;
|
8511 | };
|
8512 |
|
8513 | /**
|
8514 | * Creates a plain object from a RecognizeResponse message. Also converts values to other types if specified.
|
8515 | * @function toObject
|
8516 | * @memberof google.cloud.speech.v1p1beta1.RecognizeResponse
|
8517 | * @static
|
8518 | * @param {google.cloud.speech.v1p1beta1.RecognizeResponse} message RecognizeResponse
|
8519 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
8520 | * @returns {Object.<string,*>} Plain object
|
8521 | */
|
8522 | RecognizeResponse.toObject = function toObject(message, options) {
|
8523 | if (!options)
|
8524 | options = {};
|
8525 | var object = {};
|
8526 | if (options.arrays || options.defaults)
|
8527 | object.results = [];
|
8528 | if (message.results && message.results.length) {
|
8529 | object.results = [];
|
8530 | for (var j = 0; j < message.results.length; ++j)
|
8531 | object.results[j] = $root.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.toObject(message.results[j], options);
|
8532 | }
|
8533 | return object;
|
8534 | };
|
8535 |
|
8536 | /**
|
8537 | * Converts this RecognizeResponse to JSON.
|
8538 | * @function toJSON
|
8539 | * @memberof google.cloud.speech.v1p1beta1.RecognizeResponse
|
8540 | * @instance
|
8541 | * @returns {Object.<string,*>} JSON object
|
8542 | */
|
8543 | RecognizeResponse.prototype.toJSON = function toJSON() {
|
8544 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
8545 | };
|
8546 |
|
8547 | return RecognizeResponse;
|
8548 | })();
|
8549 |
|
8550 | v1p1beta1.LongRunningRecognizeResponse = (function() {
|
8551 |
|
8552 | /**
|
8553 | * Properties of a LongRunningRecognizeResponse.
|
8554 | * @memberof google.cloud.speech.v1p1beta1
|
8555 | * @interface ILongRunningRecognizeResponse
|
8556 | * @property {Array.<google.cloud.speech.v1p1beta1.ISpeechRecognitionResult>|null} [results] LongRunningRecognizeResponse results
|
8557 | * @property {google.cloud.speech.v1p1beta1.ITranscriptOutputConfig|null} [outputConfig] LongRunningRecognizeResponse outputConfig
|
8558 | * @property {google.rpc.IStatus|null} [outputError] LongRunningRecognizeResponse outputError
|
8559 | */
|
8560 |
|
8561 | /**
|
8562 | * Constructs a new LongRunningRecognizeResponse.
|
8563 | * @memberof google.cloud.speech.v1p1beta1
|
8564 | * @classdesc Represents a LongRunningRecognizeResponse.
|
8565 | * @implements ILongRunningRecognizeResponse
|
8566 | * @constructor
|
8567 | * @param {google.cloud.speech.v1p1beta1.ILongRunningRecognizeResponse=} [properties] Properties to set
|
8568 | */
|
8569 | function LongRunningRecognizeResponse(properties) {
|
8570 | this.results = [];
|
8571 | if (properties)
|
8572 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
8573 | if (properties[keys[i]] != null)
|
8574 | this[keys[i]] = properties[keys[i]];
|
8575 | }
|
8576 |
|
8577 | /**
|
8578 | * LongRunningRecognizeResponse results.
|
8579 | * @member {Array.<google.cloud.speech.v1p1beta1.ISpeechRecognitionResult>} results
|
8580 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse
|
8581 | * @instance
|
8582 | */
|
8583 | LongRunningRecognizeResponse.prototype.results = $util.emptyArray;
|
8584 |
|
8585 | /**
|
8586 | * LongRunningRecognizeResponse outputConfig.
|
8587 | * @member {google.cloud.speech.v1p1beta1.ITranscriptOutputConfig|null|undefined} outputConfig
|
8588 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse
|
8589 | * @instance
|
8590 | */
|
8591 | LongRunningRecognizeResponse.prototype.outputConfig = null;
|
8592 |
|
8593 | /**
|
8594 | * LongRunningRecognizeResponse outputError.
|
8595 | * @member {google.rpc.IStatus|null|undefined} outputError
|
8596 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse
|
8597 | * @instance
|
8598 | */
|
8599 | LongRunningRecognizeResponse.prototype.outputError = null;
|
8600 |
|
8601 | /**
|
8602 | * Creates a new LongRunningRecognizeResponse instance using the specified properties.
|
8603 | * @function create
|
8604 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse
|
8605 | * @static
|
8606 | * @param {google.cloud.speech.v1p1beta1.ILongRunningRecognizeResponse=} [properties] Properties to set
|
8607 | * @returns {google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse} LongRunningRecognizeResponse instance
|
8608 | */
|
8609 | LongRunningRecognizeResponse.create = function create(properties) {
|
8610 | return new LongRunningRecognizeResponse(properties);
|
8611 | };
|
8612 |
|
8613 | /**
|
8614 | * Encodes the specified LongRunningRecognizeResponse message. Does not implicitly {@link google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse.verify|verify} messages.
|
8615 | * @function encode
|
8616 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse
|
8617 | * @static
|
8618 | * @param {google.cloud.speech.v1p1beta1.ILongRunningRecognizeResponse} message LongRunningRecognizeResponse message or plain object to encode
|
8619 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
8620 | * @returns {$protobuf.Writer} Writer
|
8621 | */
|
8622 | LongRunningRecognizeResponse.encode = function encode(message, writer) {
|
8623 | if (!writer)
|
8624 | writer = $Writer.create();
|
8625 | if (message.results != null && message.results.length)
|
8626 | for (var i = 0; i < message.results.length; ++i)
|
8627 | $root.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.encode(message.results[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
8628 | if (message.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig"))
|
8629 | $root.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.encode(message.outputConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
|
8630 | if (message.outputError != null && Object.hasOwnProperty.call(message, "outputError"))
|
8631 | $root.google.rpc.Status.encode(message.outputError, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();
|
8632 | return writer;
|
8633 | };
|
8634 |
|
8635 | /**
|
8636 | * Encodes the specified LongRunningRecognizeResponse message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse.verify|verify} messages.
|
8637 | * @function encodeDelimited
|
8638 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse
|
8639 | * @static
|
8640 | * @param {google.cloud.speech.v1p1beta1.ILongRunningRecognizeResponse} message LongRunningRecognizeResponse message or plain object to encode
|
8641 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
8642 | * @returns {$protobuf.Writer} Writer
|
8643 | */
|
8644 | LongRunningRecognizeResponse.encodeDelimited = function encodeDelimited(message, writer) {
|
8645 | return this.encode(message, writer).ldelim();
|
8646 | };
|
8647 |
|
8648 | /**
|
8649 | * Decodes a LongRunningRecognizeResponse message from the specified reader or buffer.
|
8650 | * @function decode
|
8651 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse
|
8652 | * @static
|
8653 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
8654 | * @param {number} [length] Message length if known beforehand
|
8655 | * @returns {google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse} LongRunningRecognizeResponse
|
8656 | * @throws {Error} If the payload is not a reader or valid buffer
|
8657 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
8658 | */
|
8659 | LongRunningRecognizeResponse.decode = function decode(reader, length) {
|
8660 | if (!(reader instanceof $Reader))
|
8661 | reader = $Reader.create(reader);
|
8662 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse();
|
8663 | while (reader.pos < end) {
|
8664 | var tag = reader.uint32();
|
8665 | switch (tag >>> 3) {
|
8666 | case 2:
|
8667 | if (!(message.results && message.results.length))
|
8668 | message.results = [];
|
8669 | message.results.push($root.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.decode(reader, reader.uint32()));
|
8670 | break;
|
8671 | case 6:
|
8672 | message.outputConfig = $root.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.decode(reader, reader.uint32());
|
8673 | break;
|
8674 | case 7:
|
8675 | message.outputError = $root.google.rpc.Status.decode(reader, reader.uint32());
|
8676 | break;
|
8677 | default:
|
8678 | reader.skipType(tag & 7);
|
8679 | break;
|
8680 | }
|
8681 | }
|
8682 | return message;
|
8683 | };
|
8684 |
|
8685 | /**
|
8686 | * Decodes a LongRunningRecognizeResponse message from the specified reader or buffer, length delimited.
|
8687 | * @function decodeDelimited
|
8688 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse
|
8689 | * @static
|
8690 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
8691 | * @returns {google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse} LongRunningRecognizeResponse
|
8692 | * @throws {Error} If the payload is not a reader or valid buffer
|
8693 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
8694 | */
|
8695 | LongRunningRecognizeResponse.decodeDelimited = function decodeDelimited(reader) {
|
8696 | if (!(reader instanceof $Reader))
|
8697 | reader = new $Reader(reader);
|
8698 | return this.decode(reader, reader.uint32());
|
8699 | };
|
8700 |
|
8701 | /**
|
8702 | * Verifies a LongRunningRecognizeResponse message.
|
8703 | * @function verify
|
8704 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse
|
8705 | * @static
|
8706 | * @param {Object.<string,*>} message Plain object to verify
|
8707 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
8708 | */
|
8709 | LongRunningRecognizeResponse.verify = function verify(message) {
|
8710 | if (typeof message !== "object" || message === null)
|
8711 | return "object expected";
|
8712 | if (message.results != null && message.hasOwnProperty("results")) {
|
8713 | if (!Array.isArray(message.results))
|
8714 | return "results: array expected";
|
8715 | for (var i = 0; i < message.results.length; ++i) {
|
8716 | var error = $root.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.verify(message.results[i]);
|
8717 | if (error)
|
8718 | return "results." + error;
|
8719 | }
|
8720 | }
|
8721 | if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) {
|
8722 | var error = $root.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.verify(message.outputConfig);
|
8723 | if (error)
|
8724 | return "outputConfig." + error;
|
8725 | }
|
8726 | if (message.outputError != null && message.hasOwnProperty("outputError")) {
|
8727 | var error = $root.google.rpc.Status.verify(message.outputError);
|
8728 | if (error)
|
8729 | return "outputError." + error;
|
8730 | }
|
8731 | return null;
|
8732 | };
|
8733 |
|
8734 | /**
|
8735 | * Creates a LongRunningRecognizeResponse message from a plain object. Also converts values to their respective internal types.
|
8736 | * @function fromObject
|
8737 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse
|
8738 | * @static
|
8739 | * @param {Object.<string,*>} object Plain object
|
8740 | * @returns {google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse} LongRunningRecognizeResponse
|
8741 | */
|
8742 | LongRunningRecognizeResponse.fromObject = function fromObject(object) {
|
8743 | if (object instanceof $root.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse)
|
8744 | return object;
|
8745 | var message = new $root.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse();
|
8746 | if (object.results) {
|
8747 | if (!Array.isArray(object.results))
|
8748 | throw TypeError(".google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse.results: array expected");
|
8749 | message.results = [];
|
8750 | for (var i = 0; i < object.results.length; ++i) {
|
8751 | if (typeof object.results[i] !== "object")
|
8752 | throw TypeError(".google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse.results: object expected");
|
8753 | message.results[i] = $root.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.fromObject(object.results[i]);
|
8754 | }
|
8755 | }
|
8756 | if (object.outputConfig != null) {
|
8757 | if (typeof object.outputConfig !== "object")
|
8758 | throw TypeError(".google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse.outputConfig: object expected");
|
8759 | message.outputConfig = $root.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.fromObject(object.outputConfig);
|
8760 | }
|
8761 | if (object.outputError != null) {
|
8762 | if (typeof object.outputError !== "object")
|
8763 | throw TypeError(".google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse.outputError: object expected");
|
8764 | message.outputError = $root.google.rpc.Status.fromObject(object.outputError);
|
8765 | }
|
8766 | return message;
|
8767 | };
|
8768 |
|
8769 | /**
|
8770 | * Creates a plain object from a LongRunningRecognizeResponse message. Also converts values to other types if specified.
|
8771 | * @function toObject
|
8772 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse
|
8773 | * @static
|
8774 | * @param {google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse} message LongRunningRecognizeResponse
|
8775 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
8776 | * @returns {Object.<string,*>} Plain object
|
8777 | */
|
8778 | LongRunningRecognizeResponse.toObject = function toObject(message, options) {
|
8779 | if (!options)
|
8780 | options = {};
|
8781 | var object = {};
|
8782 | if (options.arrays || options.defaults)
|
8783 | object.results = [];
|
8784 | if (options.defaults) {
|
8785 | object.outputConfig = null;
|
8786 | object.outputError = null;
|
8787 | }
|
8788 | if (message.results && message.results.length) {
|
8789 | object.results = [];
|
8790 | for (var j = 0; j < message.results.length; ++j)
|
8791 | object.results[j] = $root.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.toObject(message.results[j], options);
|
8792 | }
|
8793 | if (message.outputConfig != null && message.hasOwnProperty("outputConfig"))
|
8794 | object.outputConfig = $root.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.toObject(message.outputConfig, options);
|
8795 | if (message.outputError != null && message.hasOwnProperty("outputError"))
|
8796 | object.outputError = $root.google.rpc.Status.toObject(message.outputError, options);
|
8797 | return object;
|
8798 | };
|
8799 |
|
8800 | /**
|
8801 | * Converts this LongRunningRecognizeResponse to JSON.
|
8802 | * @function toJSON
|
8803 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse
|
8804 | * @instance
|
8805 | * @returns {Object.<string,*>} JSON object
|
8806 | */
|
8807 | LongRunningRecognizeResponse.prototype.toJSON = function toJSON() {
|
8808 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
8809 | };
|
8810 |
|
8811 | return LongRunningRecognizeResponse;
|
8812 | })();
|
8813 |
|
8814 | v1p1beta1.LongRunningRecognizeMetadata = (function() {
|
8815 |
|
8816 | /**
|
8817 | * Properties of a LongRunningRecognizeMetadata.
|
8818 | * @memberof google.cloud.speech.v1p1beta1
|
8819 | * @interface ILongRunningRecognizeMetadata
|
8820 | * @property {number|null} [progressPercent] LongRunningRecognizeMetadata progressPercent
|
8821 | * @property {google.protobuf.ITimestamp|null} [startTime] LongRunningRecognizeMetadata startTime
|
8822 | * @property {google.protobuf.ITimestamp|null} [lastUpdateTime] LongRunningRecognizeMetadata lastUpdateTime
|
8823 | * @property {string|null} [uri] LongRunningRecognizeMetadata uri
|
8824 | * @property {google.cloud.speech.v1p1beta1.ITranscriptOutputConfig|null} [outputConfig] LongRunningRecognizeMetadata outputConfig
|
8825 | */
|
8826 |
|
8827 | /**
|
8828 | * Constructs a new LongRunningRecognizeMetadata.
|
8829 | * @memberof google.cloud.speech.v1p1beta1
|
8830 | * @classdesc Represents a LongRunningRecognizeMetadata.
|
8831 | * @implements ILongRunningRecognizeMetadata
|
8832 | * @constructor
|
8833 | * @param {google.cloud.speech.v1p1beta1.ILongRunningRecognizeMetadata=} [properties] Properties to set
|
8834 | */
|
8835 | function LongRunningRecognizeMetadata(properties) {
|
8836 | if (properties)
|
8837 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
8838 | if (properties[keys[i]] != null)
|
8839 | this[keys[i]] = properties[keys[i]];
|
8840 | }
|
8841 |
|
8842 | /**
|
8843 | * LongRunningRecognizeMetadata progressPercent.
|
8844 | * @member {number} progressPercent
|
8845 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata
|
8846 | * @instance
|
8847 | */
|
8848 | LongRunningRecognizeMetadata.prototype.progressPercent = 0;
|
8849 |
|
8850 | /**
|
8851 | * LongRunningRecognizeMetadata startTime.
|
8852 | * @member {google.protobuf.ITimestamp|null|undefined} startTime
|
8853 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata
|
8854 | * @instance
|
8855 | */
|
8856 | LongRunningRecognizeMetadata.prototype.startTime = null;
|
8857 |
|
8858 | /**
|
8859 | * LongRunningRecognizeMetadata lastUpdateTime.
|
8860 | * @member {google.protobuf.ITimestamp|null|undefined} lastUpdateTime
|
8861 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata
|
8862 | * @instance
|
8863 | */
|
8864 | LongRunningRecognizeMetadata.prototype.lastUpdateTime = null;
|
8865 |
|
8866 | /**
|
8867 | * LongRunningRecognizeMetadata uri.
|
8868 | * @member {string} uri
|
8869 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata
|
8870 | * @instance
|
8871 | */
|
8872 | LongRunningRecognizeMetadata.prototype.uri = "";
|
8873 |
|
8874 | /**
|
8875 | * LongRunningRecognizeMetadata outputConfig.
|
8876 | * @member {google.cloud.speech.v1p1beta1.ITranscriptOutputConfig|null|undefined} outputConfig
|
8877 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata
|
8878 | * @instance
|
8879 | */
|
8880 | LongRunningRecognizeMetadata.prototype.outputConfig = null;
|
8881 |
|
8882 | /**
|
8883 | * Creates a new LongRunningRecognizeMetadata instance using the specified properties.
|
8884 | * @function create
|
8885 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata
|
8886 | * @static
|
8887 | * @param {google.cloud.speech.v1p1beta1.ILongRunningRecognizeMetadata=} [properties] Properties to set
|
8888 | * @returns {google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata} LongRunningRecognizeMetadata instance
|
8889 | */
|
8890 | LongRunningRecognizeMetadata.create = function create(properties) {
|
8891 | return new LongRunningRecognizeMetadata(properties);
|
8892 | };
|
8893 |
|
8894 | /**
|
8895 | * Encodes the specified LongRunningRecognizeMetadata message. Does not implicitly {@link google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata.verify|verify} messages.
|
8896 | * @function encode
|
8897 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata
|
8898 | * @static
|
8899 | * @param {google.cloud.speech.v1p1beta1.ILongRunningRecognizeMetadata} message LongRunningRecognizeMetadata message or plain object to encode
|
8900 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
8901 | * @returns {$protobuf.Writer} Writer
|
8902 | */
|
8903 | LongRunningRecognizeMetadata.encode = function encode(message, writer) {
|
8904 | if (!writer)
|
8905 | writer = $Writer.create();
|
8906 | if (message.progressPercent != null && Object.hasOwnProperty.call(message, "progressPercent"))
|
8907 | writer.uint32(/* id 1, wireType 0 =*/8).int32(message.progressPercent);
|
8908 | if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime"))
|
8909 | $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
8910 | if (message.lastUpdateTime != null && Object.hasOwnProperty.call(message, "lastUpdateTime"))
|
8911 | $root.google.protobuf.Timestamp.encode(message.lastUpdateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
|
8912 | if (message.uri != null && Object.hasOwnProperty.call(message, "uri"))
|
8913 | writer.uint32(/* id 4, wireType 2 =*/34).string(message.uri);
|
8914 | if (message.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig"))
|
8915 | $root.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.encode(message.outputConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
|
8916 | return writer;
|
8917 | };
|
8918 |
|
8919 | /**
|
8920 | * Encodes the specified LongRunningRecognizeMetadata message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata.verify|verify} messages.
|
8921 | * @function encodeDelimited
|
8922 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata
|
8923 | * @static
|
8924 | * @param {google.cloud.speech.v1p1beta1.ILongRunningRecognizeMetadata} message LongRunningRecognizeMetadata message or plain object to encode
|
8925 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
8926 | * @returns {$protobuf.Writer} Writer
|
8927 | */
|
8928 | LongRunningRecognizeMetadata.encodeDelimited = function encodeDelimited(message, writer) {
|
8929 | return this.encode(message, writer).ldelim();
|
8930 | };
|
8931 |
|
8932 | /**
|
8933 | * Decodes a LongRunningRecognizeMetadata message from the specified reader or buffer.
|
8934 | * @function decode
|
8935 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata
|
8936 | * @static
|
8937 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
8938 | * @param {number} [length] Message length if known beforehand
|
8939 | * @returns {google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata} LongRunningRecognizeMetadata
|
8940 | * @throws {Error} If the payload is not a reader or valid buffer
|
8941 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
8942 | */
|
8943 | LongRunningRecognizeMetadata.decode = function decode(reader, length) {
|
8944 | if (!(reader instanceof $Reader))
|
8945 | reader = $Reader.create(reader);
|
8946 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata();
|
8947 | while (reader.pos < end) {
|
8948 | var tag = reader.uint32();
|
8949 | switch (tag >>> 3) {
|
8950 | case 1:
|
8951 | message.progressPercent = reader.int32();
|
8952 | break;
|
8953 | case 2:
|
8954 | message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
|
8955 | break;
|
8956 | case 3:
|
8957 | message.lastUpdateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
|
8958 | break;
|
8959 | case 4:
|
8960 | message.uri = reader.string();
|
8961 | break;
|
8962 | case 5:
|
8963 | message.outputConfig = $root.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.decode(reader, reader.uint32());
|
8964 | break;
|
8965 | default:
|
8966 | reader.skipType(tag & 7);
|
8967 | break;
|
8968 | }
|
8969 | }
|
8970 | return message;
|
8971 | };
|
8972 |
|
8973 | /**
|
8974 | * Decodes a LongRunningRecognizeMetadata message from the specified reader or buffer, length delimited.
|
8975 | * @function decodeDelimited
|
8976 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata
|
8977 | * @static
|
8978 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
8979 | * @returns {google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata} LongRunningRecognizeMetadata
|
8980 | * @throws {Error} If the payload is not a reader or valid buffer
|
8981 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
8982 | */
|
8983 | LongRunningRecognizeMetadata.decodeDelimited = function decodeDelimited(reader) {
|
8984 | if (!(reader instanceof $Reader))
|
8985 | reader = new $Reader(reader);
|
8986 | return this.decode(reader, reader.uint32());
|
8987 | };
|
8988 |
|
8989 | /**
|
8990 | * Verifies a LongRunningRecognizeMetadata message.
|
8991 | * @function verify
|
8992 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata
|
8993 | * @static
|
8994 | * @param {Object.<string,*>} message Plain object to verify
|
8995 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
8996 | */
|
8997 | LongRunningRecognizeMetadata.verify = function verify(message) {
|
8998 | if (typeof message !== "object" || message === null)
|
8999 | return "object expected";
|
9000 | if (message.progressPercent != null && message.hasOwnProperty("progressPercent"))
|
9001 | if (!$util.isInteger(message.progressPercent))
|
9002 | return "progressPercent: integer expected";
|
9003 | if (message.startTime != null && message.hasOwnProperty("startTime")) {
|
9004 | var error = $root.google.protobuf.Timestamp.verify(message.startTime);
|
9005 | if (error)
|
9006 | return "startTime." + error;
|
9007 | }
|
9008 | if (message.lastUpdateTime != null && message.hasOwnProperty("lastUpdateTime")) {
|
9009 | var error = $root.google.protobuf.Timestamp.verify(message.lastUpdateTime);
|
9010 | if (error)
|
9011 | return "lastUpdateTime." + error;
|
9012 | }
|
9013 | if (message.uri != null && message.hasOwnProperty("uri"))
|
9014 | if (!$util.isString(message.uri))
|
9015 | return "uri: string expected";
|
9016 | if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) {
|
9017 | var error = $root.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.verify(message.outputConfig);
|
9018 | if (error)
|
9019 | return "outputConfig." + error;
|
9020 | }
|
9021 | return null;
|
9022 | };
|
9023 |
|
9024 | /**
|
9025 | * Creates a LongRunningRecognizeMetadata message from a plain object. Also converts values to their respective internal types.
|
9026 | * @function fromObject
|
9027 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata
|
9028 | * @static
|
9029 | * @param {Object.<string,*>} object Plain object
|
9030 | * @returns {google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata} LongRunningRecognizeMetadata
|
9031 | */
|
9032 | LongRunningRecognizeMetadata.fromObject = function fromObject(object) {
|
9033 | if (object instanceof $root.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata)
|
9034 | return object;
|
9035 | var message = new $root.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata();
|
9036 | if (object.progressPercent != null)
|
9037 | message.progressPercent = object.progressPercent | 0;
|
9038 | if (object.startTime != null) {
|
9039 | if (typeof object.startTime !== "object")
|
9040 | throw TypeError(".google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata.startTime: object expected");
|
9041 | message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime);
|
9042 | }
|
9043 | if (object.lastUpdateTime != null) {
|
9044 | if (typeof object.lastUpdateTime !== "object")
|
9045 | throw TypeError(".google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata.lastUpdateTime: object expected");
|
9046 | message.lastUpdateTime = $root.google.protobuf.Timestamp.fromObject(object.lastUpdateTime);
|
9047 | }
|
9048 | if (object.uri != null)
|
9049 | message.uri = String(object.uri);
|
9050 | if (object.outputConfig != null) {
|
9051 | if (typeof object.outputConfig !== "object")
|
9052 | throw TypeError(".google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata.outputConfig: object expected");
|
9053 | message.outputConfig = $root.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.fromObject(object.outputConfig);
|
9054 | }
|
9055 | return message;
|
9056 | };
|
9057 |
|
9058 | /**
|
9059 | * Creates a plain object from a LongRunningRecognizeMetadata message. Also converts values to other types if specified.
|
9060 | * @function toObject
|
9061 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata
|
9062 | * @static
|
9063 | * @param {google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata} message LongRunningRecognizeMetadata
|
9064 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
9065 | * @returns {Object.<string,*>} Plain object
|
9066 | */
|
9067 | LongRunningRecognizeMetadata.toObject = function toObject(message, options) {
|
9068 | if (!options)
|
9069 | options = {};
|
9070 | var object = {};
|
9071 | if (options.defaults) {
|
9072 | object.progressPercent = 0;
|
9073 | object.startTime = null;
|
9074 | object.lastUpdateTime = null;
|
9075 | object.uri = "";
|
9076 | object.outputConfig = null;
|
9077 | }
|
9078 | if (message.progressPercent != null && message.hasOwnProperty("progressPercent"))
|
9079 | object.progressPercent = message.progressPercent;
|
9080 | if (message.startTime != null && message.hasOwnProperty("startTime"))
|
9081 | object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options);
|
9082 | if (message.lastUpdateTime != null && message.hasOwnProperty("lastUpdateTime"))
|
9083 | object.lastUpdateTime = $root.google.protobuf.Timestamp.toObject(message.lastUpdateTime, options);
|
9084 | if (message.uri != null && message.hasOwnProperty("uri"))
|
9085 | object.uri = message.uri;
|
9086 | if (message.outputConfig != null && message.hasOwnProperty("outputConfig"))
|
9087 | object.outputConfig = $root.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.toObject(message.outputConfig, options);
|
9088 | return object;
|
9089 | };
|
9090 |
|
9091 | /**
|
9092 | * Converts this LongRunningRecognizeMetadata to JSON.
|
9093 | * @function toJSON
|
9094 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata
|
9095 | * @instance
|
9096 | * @returns {Object.<string,*>} JSON object
|
9097 | */
|
9098 | LongRunningRecognizeMetadata.prototype.toJSON = function toJSON() {
|
9099 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
9100 | };
|
9101 |
|
9102 | return LongRunningRecognizeMetadata;
|
9103 | })();
|
9104 |
|
9105 | v1p1beta1.StreamingRecognizeResponse = (function() {
|
9106 |
|
9107 | /**
|
9108 | * Properties of a StreamingRecognizeResponse.
|
9109 | * @memberof google.cloud.speech.v1p1beta1
|
9110 | * @interface IStreamingRecognizeResponse
|
9111 | * @property {google.rpc.IStatus|null} [error] StreamingRecognizeResponse error
|
9112 | * @property {Array.<google.cloud.speech.v1p1beta1.IStreamingRecognitionResult>|null} [results] StreamingRecognizeResponse results
|
9113 | * @property {google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType|null} [speechEventType] StreamingRecognizeResponse speechEventType
|
9114 | */
|
9115 |
|
9116 | /**
|
9117 | * Constructs a new StreamingRecognizeResponse.
|
9118 | * @memberof google.cloud.speech.v1p1beta1
|
9119 | * @classdesc Represents a StreamingRecognizeResponse.
|
9120 | * @implements IStreamingRecognizeResponse
|
9121 | * @constructor
|
9122 | * @param {google.cloud.speech.v1p1beta1.IStreamingRecognizeResponse=} [properties] Properties to set
|
9123 | */
|
9124 | function StreamingRecognizeResponse(properties) {
|
9125 | this.results = [];
|
9126 | if (properties)
|
9127 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
9128 | if (properties[keys[i]] != null)
|
9129 | this[keys[i]] = properties[keys[i]];
|
9130 | }
|
9131 |
|
9132 | /**
|
9133 | * StreamingRecognizeResponse error.
|
9134 | * @member {google.rpc.IStatus|null|undefined} error
|
9135 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeResponse
|
9136 | * @instance
|
9137 | */
|
9138 | StreamingRecognizeResponse.prototype.error = null;
|
9139 |
|
9140 | /**
|
9141 | * StreamingRecognizeResponse results.
|
9142 | * @member {Array.<google.cloud.speech.v1p1beta1.IStreamingRecognitionResult>} results
|
9143 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeResponse
|
9144 | * @instance
|
9145 | */
|
9146 | StreamingRecognizeResponse.prototype.results = $util.emptyArray;
|
9147 |
|
9148 | /**
|
9149 | * StreamingRecognizeResponse speechEventType.
|
9150 | * @member {google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType} speechEventType
|
9151 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeResponse
|
9152 | * @instance
|
9153 | */
|
9154 | StreamingRecognizeResponse.prototype.speechEventType = 0;
|
9155 |
|
9156 | /**
|
9157 | * Creates a new StreamingRecognizeResponse instance using the specified properties.
|
9158 | * @function create
|
9159 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeResponse
|
9160 | * @static
|
9161 | * @param {google.cloud.speech.v1p1beta1.IStreamingRecognizeResponse=} [properties] Properties to set
|
9162 | * @returns {google.cloud.speech.v1p1beta1.StreamingRecognizeResponse} StreamingRecognizeResponse instance
|
9163 | */
|
9164 | StreamingRecognizeResponse.create = function create(properties) {
|
9165 | return new StreamingRecognizeResponse(properties);
|
9166 | };
|
9167 |
|
9168 | /**
|
9169 | * Encodes the specified StreamingRecognizeResponse message. Does not implicitly {@link google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.verify|verify} messages.
|
9170 | * @function encode
|
9171 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeResponse
|
9172 | * @static
|
9173 | * @param {google.cloud.speech.v1p1beta1.IStreamingRecognizeResponse} message StreamingRecognizeResponse message or plain object to encode
|
9174 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
9175 | * @returns {$protobuf.Writer} Writer
|
9176 | */
|
9177 | StreamingRecognizeResponse.encode = function encode(message, writer) {
|
9178 | if (!writer)
|
9179 | writer = $Writer.create();
|
9180 | if (message.error != null && Object.hasOwnProperty.call(message, "error"))
|
9181 | $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
9182 | if (message.results != null && message.results.length)
|
9183 | for (var i = 0; i < message.results.length; ++i)
|
9184 | $root.google.cloud.speech.v1p1beta1.StreamingRecognitionResult.encode(message.results[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
9185 | if (message.speechEventType != null && Object.hasOwnProperty.call(message, "speechEventType"))
|
9186 | writer.uint32(/* id 4, wireType 0 =*/32).int32(message.speechEventType);
|
9187 | return writer;
|
9188 | };
|
9189 |
|
9190 | /**
|
9191 | * Encodes the specified StreamingRecognizeResponse message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.verify|verify} messages.
|
9192 | * @function encodeDelimited
|
9193 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeResponse
|
9194 | * @static
|
9195 | * @param {google.cloud.speech.v1p1beta1.IStreamingRecognizeResponse} message StreamingRecognizeResponse message or plain object to encode
|
9196 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
9197 | * @returns {$protobuf.Writer} Writer
|
9198 | */
|
9199 | StreamingRecognizeResponse.encodeDelimited = function encodeDelimited(message, writer) {
|
9200 | return this.encode(message, writer).ldelim();
|
9201 | };
|
9202 |
|
9203 | /**
|
9204 | * Decodes a StreamingRecognizeResponse message from the specified reader or buffer.
|
9205 | * @function decode
|
9206 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeResponse
|
9207 | * @static
|
9208 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
9209 | * @param {number} [length] Message length if known beforehand
|
9210 | * @returns {google.cloud.speech.v1p1beta1.StreamingRecognizeResponse} StreamingRecognizeResponse
|
9211 | * @throws {Error} If the payload is not a reader or valid buffer
|
9212 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
9213 | */
|
9214 | StreamingRecognizeResponse.decode = function decode(reader, length) {
|
9215 | if (!(reader instanceof $Reader))
|
9216 | reader = $Reader.create(reader);
|
9217 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse();
|
9218 | while (reader.pos < end) {
|
9219 | var tag = reader.uint32();
|
9220 | switch (tag >>> 3) {
|
9221 | case 1:
|
9222 | message.error = $root.google.rpc.Status.decode(reader, reader.uint32());
|
9223 | break;
|
9224 | case 2:
|
9225 | if (!(message.results && message.results.length))
|
9226 | message.results = [];
|
9227 | message.results.push($root.google.cloud.speech.v1p1beta1.StreamingRecognitionResult.decode(reader, reader.uint32()));
|
9228 | break;
|
9229 | case 4:
|
9230 | message.speechEventType = reader.int32();
|
9231 | break;
|
9232 | default:
|
9233 | reader.skipType(tag & 7);
|
9234 | break;
|
9235 | }
|
9236 | }
|
9237 | return message;
|
9238 | };
|
9239 |
|
9240 | /**
|
9241 | * Decodes a StreamingRecognizeResponse message from the specified reader or buffer, length delimited.
|
9242 | * @function decodeDelimited
|
9243 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeResponse
|
9244 | * @static
|
9245 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
9246 | * @returns {google.cloud.speech.v1p1beta1.StreamingRecognizeResponse} StreamingRecognizeResponse
|
9247 | * @throws {Error} If the payload is not a reader or valid buffer
|
9248 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
9249 | */
|
9250 | StreamingRecognizeResponse.decodeDelimited = function decodeDelimited(reader) {
|
9251 | if (!(reader instanceof $Reader))
|
9252 | reader = new $Reader(reader);
|
9253 | return this.decode(reader, reader.uint32());
|
9254 | };
|
9255 |
|
9256 | /**
|
9257 | * Verifies a StreamingRecognizeResponse message.
|
9258 | * @function verify
|
9259 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeResponse
|
9260 | * @static
|
9261 | * @param {Object.<string,*>} message Plain object to verify
|
9262 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
9263 | */
|
9264 | StreamingRecognizeResponse.verify = function verify(message) {
|
9265 | if (typeof message !== "object" || message === null)
|
9266 | return "object expected";
|
9267 | if (message.error != null && message.hasOwnProperty("error")) {
|
9268 | var error = $root.google.rpc.Status.verify(message.error);
|
9269 | if (error)
|
9270 | return "error." + error;
|
9271 | }
|
9272 | if (message.results != null && message.hasOwnProperty("results")) {
|
9273 | if (!Array.isArray(message.results))
|
9274 | return "results: array expected";
|
9275 | for (var i = 0; i < message.results.length; ++i) {
|
9276 | var error = $root.google.cloud.speech.v1p1beta1.StreamingRecognitionResult.verify(message.results[i]);
|
9277 | if (error)
|
9278 | return "results." + error;
|
9279 | }
|
9280 | }
|
9281 | if (message.speechEventType != null && message.hasOwnProperty("speechEventType"))
|
9282 | switch (message.speechEventType) {
|
9283 | default:
|
9284 | return "speechEventType: enum value expected";
|
9285 | case 0:
|
9286 | case 1:
|
9287 | break;
|
9288 | }
|
9289 | return null;
|
9290 | };
|
9291 |
|
9292 | /**
|
9293 | * Creates a StreamingRecognizeResponse message from a plain object. Also converts values to their respective internal types.
|
9294 | * @function fromObject
|
9295 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeResponse
|
9296 | * @static
|
9297 | * @param {Object.<string,*>} object Plain object
|
9298 | * @returns {google.cloud.speech.v1p1beta1.StreamingRecognizeResponse} StreamingRecognizeResponse
|
9299 | */
|
9300 | StreamingRecognizeResponse.fromObject = function fromObject(object) {
|
9301 | if (object instanceof $root.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse)
|
9302 | return object;
|
9303 | var message = new $root.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse();
|
9304 | if (object.error != null) {
|
9305 | if (typeof object.error !== "object")
|
9306 | throw TypeError(".google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.error: object expected");
|
9307 | message.error = $root.google.rpc.Status.fromObject(object.error);
|
9308 | }
|
9309 | if (object.results) {
|
9310 | if (!Array.isArray(object.results))
|
9311 | throw TypeError(".google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.results: array expected");
|
9312 | message.results = [];
|
9313 | for (var i = 0; i < object.results.length; ++i) {
|
9314 | if (typeof object.results[i] !== "object")
|
9315 | throw TypeError(".google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.results: object expected");
|
9316 | message.results[i] = $root.google.cloud.speech.v1p1beta1.StreamingRecognitionResult.fromObject(object.results[i]);
|
9317 | }
|
9318 | }
|
9319 | switch (object.speechEventType) {
|
9320 | case "SPEECH_EVENT_UNSPECIFIED":
|
9321 | case 0:
|
9322 | message.speechEventType = 0;
|
9323 | break;
|
9324 | case "END_OF_SINGLE_UTTERANCE":
|
9325 | case 1:
|
9326 | message.speechEventType = 1;
|
9327 | break;
|
9328 | }
|
9329 | return message;
|
9330 | };
|
9331 |
|
9332 | /**
|
9333 | * Creates a plain object from a StreamingRecognizeResponse message. Also converts values to other types if specified.
|
9334 | * @function toObject
|
9335 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeResponse
|
9336 | * @static
|
9337 | * @param {google.cloud.speech.v1p1beta1.StreamingRecognizeResponse} message StreamingRecognizeResponse
|
9338 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
9339 | * @returns {Object.<string,*>} Plain object
|
9340 | */
|
9341 | StreamingRecognizeResponse.toObject = function toObject(message, options) {
|
9342 | if (!options)
|
9343 | options = {};
|
9344 | var object = {};
|
9345 | if (options.arrays || options.defaults)
|
9346 | object.results = [];
|
9347 | if (options.defaults) {
|
9348 | object.error = null;
|
9349 | object.speechEventType = options.enums === String ? "SPEECH_EVENT_UNSPECIFIED" : 0;
|
9350 | }
|
9351 | if (message.error != null && message.hasOwnProperty("error"))
|
9352 | object.error = $root.google.rpc.Status.toObject(message.error, options);
|
9353 | if (message.results && message.results.length) {
|
9354 | object.results = [];
|
9355 | for (var j = 0; j < message.results.length; ++j)
|
9356 | object.results[j] = $root.google.cloud.speech.v1p1beta1.StreamingRecognitionResult.toObject(message.results[j], options);
|
9357 | }
|
9358 | if (message.speechEventType != null && message.hasOwnProperty("speechEventType"))
|
9359 | object.speechEventType = options.enums === String ? $root.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType[message.speechEventType] : message.speechEventType;
|
9360 | return object;
|
9361 | };
|
9362 |
|
9363 | /**
|
9364 | * Converts this StreamingRecognizeResponse to JSON.
|
9365 | * @function toJSON
|
9366 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeResponse
|
9367 | * @instance
|
9368 | * @returns {Object.<string,*>} JSON object
|
9369 | */
|
9370 | StreamingRecognizeResponse.prototype.toJSON = function toJSON() {
|
9371 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
9372 | };
|
9373 |
|
9374 | /**
|
9375 | * SpeechEventType enum.
|
9376 | * @name google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType
|
9377 | * @enum {number}
|
9378 | * @property {number} SPEECH_EVENT_UNSPECIFIED=0 SPEECH_EVENT_UNSPECIFIED value
|
9379 | * @property {number} END_OF_SINGLE_UTTERANCE=1 END_OF_SINGLE_UTTERANCE value
|
9380 | */
|
9381 | StreamingRecognizeResponse.SpeechEventType = (function() {
|
9382 | var valuesById = {}, values = Object.create(valuesById);
|
9383 | values[valuesById[0] = "SPEECH_EVENT_UNSPECIFIED"] = 0;
|
9384 | values[valuesById[1] = "END_OF_SINGLE_UTTERANCE"] = 1;
|
9385 | return values;
|
9386 | })();
|
9387 |
|
9388 | return StreamingRecognizeResponse;
|
9389 | })();
|
9390 |
|
9391 | v1p1beta1.StreamingRecognitionResult = (function() {
|
9392 |
|
9393 | /**
|
9394 | * Properties of a StreamingRecognitionResult.
|
9395 | * @memberof google.cloud.speech.v1p1beta1
|
9396 | * @interface IStreamingRecognitionResult
|
9397 | * @property {Array.<google.cloud.speech.v1p1beta1.ISpeechRecognitionAlternative>|null} [alternatives] StreamingRecognitionResult alternatives
|
9398 | * @property {boolean|null} [isFinal] StreamingRecognitionResult isFinal
|
9399 | * @property {number|null} [stability] StreamingRecognitionResult stability
|
9400 | * @property {google.protobuf.IDuration|null} [resultEndTime] StreamingRecognitionResult resultEndTime
|
9401 | * @property {number|null} [channelTag] StreamingRecognitionResult channelTag
|
9402 | * @property {string|null} [languageCode] StreamingRecognitionResult languageCode
|
9403 | */
|
9404 |
|
9405 | /**
|
9406 | * Constructs a new StreamingRecognitionResult.
|
9407 | * @memberof google.cloud.speech.v1p1beta1
|
9408 | * @classdesc Represents a StreamingRecognitionResult.
|
9409 | * @implements IStreamingRecognitionResult
|
9410 | * @constructor
|
9411 | * @param {google.cloud.speech.v1p1beta1.IStreamingRecognitionResult=} [properties] Properties to set
|
9412 | */
|
9413 | function StreamingRecognitionResult(properties) {
|
9414 | this.alternatives = [];
|
9415 | if (properties)
|
9416 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
9417 | if (properties[keys[i]] != null)
|
9418 | this[keys[i]] = properties[keys[i]];
|
9419 | }
|
9420 |
|
9421 | /**
|
9422 | * StreamingRecognitionResult alternatives.
|
9423 | * @member {Array.<google.cloud.speech.v1p1beta1.ISpeechRecognitionAlternative>} alternatives
|
9424 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionResult
|
9425 | * @instance
|
9426 | */
|
9427 | StreamingRecognitionResult.prototype.alternatives = $util.emptyArray;
|
9428 |
|
9429 | /**
|
9430 | * StreamingRecognitionResult isFinal.
|
9431 | * @member {boolean} isFinal
|
9432 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionResult
|
9433 | * @instance
|
9434 | */
|
9435 | StreamingRecognitionResult.prototype.isFinal = false;
|
9436 |
|
9437 | /**
|
9438 | * StreamingRecognitionResult stability.
|
9439 | * @member {number} stability
|
9440 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionResult
|
9441 | * @instance
|
9442 | */
|
9443 | StreamingRecognitionResult.prototype.stability = 0;
|
9444 |
|
9445 | /**
|
9446 | * StreamingRecognitionResult resultEndTime.
|
9447 | * @member {google.protobuf.IDuration|null|undefined} resultEndTime
|
9448 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionResult
|
9449 | * @instance
|
9450 | */
|
9451 | StreamingRecognitionResult.prototype.resultEndTime = null;
|
9452 |
|
9453 | /**
|
9454 | * StreamingRecognitionResult channelTag.
|
9455 | * @member {number} channelTag
|
9456 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionResult
|
9457 | * @instance
|
9458 | */
|
9459 | StreamingRecognitionResult.prototype.channelTag = 0;
|
9460 |
|
9461 | /**
|
9462 | * StreamingRecognitionResult languageCode.
|
9463 | * @member {string} languageCode
|
9464 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionResult
|
9465 | * @instance
|
9466 | */
|
9467 | StreamingRecognitionResult.prototype.languageCode = "";
|
9468 |
|
9469 | /**
|
9470 | * Creates a new StreamingRecognitionResult instance using the specified properties.
|
9471 | * @function create
|
9472 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionResult
|
9473 | * @static
|
9474 | * @param {google.cloud.speech.v1p1beta1.IStreamingRecognitionResult=} [properties] Properties to set
|
9475 | * @returns {google.cloud.speech.v1p1beta1.StreamingRecognitionResult} StreamingRecognitionResult instance
|
9476 | */
|
9477 | StreamingRecognitionResult.create = function create(properties) {
|
9478 | return new StreamingRecognitionResult(properties);
|
9479 | };
|
9480 |
|
9481 | /**
|
9482 | * Encodes the specified StreamingRecognitionResult message. Does not implicitly {@link google.cloud.speech.v1p1beta1.StreamingRecognitionResult.verify|verify} messages.
|
9483 | * @function encode
|
9484 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionResult
|
9485 | * @static
|
9486 | * @param {google.cloud.speech.v1p1beta1.IStreamingRecognitionResult} message StreamingRecognitionResult message or plain object to encode
|
9487 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
9488 | * @returns {$protobuf.Writer} Writer
|
9489 | */
|
9490 | StreamingRecognitionResult.encode = function encode(message, writer) {
|
9491 | if (!writer)
|
9492 | writer = $Writer.create();
|
9493 | if (message.alternatives != null && message.alternatives.length)
|
9494 | for (var i = 0; i < message.alternatives.length; ++i)
|
9495 | $root.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.encode(message.alternatives[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
9496 | if (message.isFinal != null && Object.hasOwnProperty.call(message, "isFinal"))
|
9497 | writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isFinal);
|
9498 | if (message.stability != null && Object.hasOwnProperty.call(message, "stability"))
|
9499 | writer.uint32(/* id 3, wireType 5 =*/29).float(message.stability);
|
9500 | if (message.resultEndTime != null && Object.hasOwnProperty.call(message, "resultEndTime"))
|
9501 | $root.google.protobuf.Duration.encode(message.resultEndTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
|
9502 | if (message.channelTag != null && Object.hasOwnProperty.call(message, "channelTag"))
|
9503 | writer.uint32(/* id 5, wireType 0 =*/40).int32(message.channelTag);
|
9504 | if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode"))
|
9505 | writer.uint32(/* id 6, wireType 2 =*/50).string(message.languageCode);
|
9506 | return writer;
|
9507 | };
|
9508 |
|
9509 | /**
|
9510 | * Encodes the specified StreamingRecognitionResult message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.StreamingRecognitionResult.verify|verify} messages.
|
9511 | * @function encodeDelimited
|
9512 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionResult
|
9513 | * @static
|
9514 | * @param {google.cloud.speech.v1p1beta1.IStreamingRecognitionResult} message StreamingRecognitionResult message or plain object to encode
|
9515 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
9516 | * @returns {$protobuf.Writer} Writer
|
9517 | */
|
9518 | StreamingRecognitionResult.encodeDelimited = function encodeDelimited(message, writer) {
|
9519 | return this.encode(message, writer).ldelim();
|
9520 | };
|
9521 |
|
9522 | /**
|
9523 | * Decodes a StreamingRecognitionResult message from the specified reader or buffer.
|
9524 | * @function decode
|
9525 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionResult
|
9526 | * @static
|
9527 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
9528 | * @param {number} [length] Message length if known beforehand
|
9529 | * @returns {google.cloud.speech.v1p1beta1.StreamingRecognitionResult} StreamingRecognitionResult
|
9530 | * @throws {Error} If the payload is not a reader or valid buffer
|
9531 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
9532 | */
|
9533 | StreamingRecognitionResult.decode = function decode(reader, length) {
|
9534 | if (!(reader instanceof $Reader))
|
9535 | reader = $Reader.create(reader);
|
9536 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.StreamingRecognitionResult();
|
9537 | while (reader.pos < end) {
|
9538 | var tag = reader.uint32();
|
9539 | switch (tag >>> 3) {
|
9540 | case 1:
|
9541 | if (!(message.alternatives && message.alternatives.length))
|
9542 | message.alternatives = [];
|
9543 | message.alternatives.push($root.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.decode(reader, reader.uint32()));
|
9544 | break;
|
9545 | case 2:
|
9546 | message.isFinal = reader.bool();
|
9547 | break;
|
9548 | case 3:
|
9549 | message.stability = reader.float();
|
9550 | break;
|
9551 | case 4:
|
9552 | message.resultEndTime = $root.google.protobuf.Duration.decode(reader, reader.uint32());
|
9553 | break;
|
9554 | case 5:
|
9555 | message.channelTag = reader.int32();
|
9556 | break;
|
9557 | case 6:
|
9558 | message.languageCode = reader.string();
|
9559 | break;
|
9560 | default:
|
9561 | reader.skipType(tag & 7);
|
9562 | break;
|
9563 | }
|
9564 | }
|
9565 | return message;
|
9566 | };
|
9567 |
|
9568 | /**
|
9569 | * Decodes a StreamingRecognitionResult message from the specified reader or buffer, length delimited.
|
9570 | * @function decodeDelimited
|
9571 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionResult
|
9572 | * @static
|
9573 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
9574 | * @returns {google.cloud.speech.v1p1beta1.StreamingRecognitionResult} StreamingRecognitionResult
|
9575 | * @throws {Error} If the payload is not a reader or valid buffer
|
9576 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
9577 | */
|
9578 | StreamingRecognitionResult.decodeDelimited = function decodeDelimited(reader) {
|
9579 | if (!(reader instanceof $Reader))
|
9580 | reader = new $Reader(reader);
|
9581 | return this.decode(reader, reader.uint32());
|
9582 | };
|
9583 |
|
9584 | /**
|
9585 | * Verifies a StreamingRecognitionResult message.
|
9586 | * @function verify
|
9587 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionResult
|
9588 | * @static
|
9589 | * @param {Object.<string,*>} message Plain object to verify
|
9590 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
9591 | */
|
9592 | StreamingRecognitionResult.verify = function verify(message) {
|
9593 | if (typeof message !== "object" || message === null)
|
9594 | return "object expected";
|
9595 | if (message.alternatives != null && message.hasOwnProperty("alternatives")) {
|
9596 | if (!Array.isArray(message.alternatives))
|
9597 | return "alternatives: array expected";
|
9598 | for (var i = 0; i < message.alternatives.length; ++i) {
|
9599 | var error = $root.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.verify(message.alternatives[i]);
|
9600 | if (error)
|
9601 | return "alternatives." + error;
|
9602 | }
|
9603 | }
|
9604 | if (message.isFinal != null && message.hasOwnProperty("isFinal"))
|
9605 | if (typeof message.isFinal !== "boolean")
|
9606 | return "isFinal: boolean expected";
|
9607 | if (message.stability != null && message.hasOwnProperty("stability"))
|
9608 | if (typeof message.stability !== "number")
|
9609 | return "stability: number expected";
|
9610 | if (message.resultEndTime != null && message.hasOwnProperty("resultEndTime")) {
|
9611 | var error = $root.google.protobuf.Duration.verify(message.resultEndTime);
|
9612 | if (error)
|
9613 | return "resultEndTime." + error;
|
9614 | }
|
9615 | if (message.channelTag != null && message.hasOwnProperty("channelTag"))
|
9616 | if (!$util.isInteger(message.channelTag))
|
9617 | return "channelTag: integer expected";
|
9618 | if (message.languageCode != null && message.hasOwnProperty("languageCode"))
|
9619 | if (!$util.isString(message.languageCode))
|
9620 | return "languageCode: string expected";
|
9621 | return null;
|
9622 | };
|
9623 |
|
9624 | /**
|
9625 | * Creates a StreamingRecognitionResult message from a plain object. Also converts values to their respective internal types.
|
9626 | * @function fromObject
|
9627 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionResult
|
9628 | * @static
|
9629 | * @param {Object.<string,*>} object Plain object
|
9630 | * @returns {google.cloud.speech.v1p1beta1.StreamingRecognitionResult} StreamingRecognitionResult
|
9631 | */
|
9632 | StreamingRecognitionResult.fromObject = function fromObject(object) {
|
9633 | if (object instanceof $root.google.cloud.speech.v1p1beta1.StreamingRecognitionResult)
|
9634 | return object;
|
9635 | var message = new $root.google.cloud.speech.v1p1beta1.StreamingRecognitionResult();
|
9636 | if (object.alternatives) {
|
9637 | if (!Array.isArray(object.alternatives))
|
9638 | throw TypeError(".google.cloud.speech.v1p1beta1.StreamingRecognitionResult.alternatives: array expected");
|
9639 | message.alternatives = [];
|
9640 | for (var i = 0; i < object.alternatives.length; ++i) {
|
9641 | if (typeof object.alternatives[i] !== "object")
|
9642 | throw TypeError(".google.cloud.speech.v1p1beta1.StreamingRecognitionResult.alternatives: object expected");
|
9643 | message.alternatives[i] = $root.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.fromObject(object.alternatives[i]);
|
9644 | }
|
9645 | }
|
9646 | if (object.isFinal != null)
|
9647 | message.isFinal = Boolean(object.isFinal);
|
9648 | if (object.stability != null)
|
9649 | message.stability = Number(object.stability);
|
9650 | if (object.resultEndTime != null) {
|
9651 | if (typeof object.resultEndTime !== "object")
|
9652 | throw TypeError(".google.cloud.speech.v1p1beta1.StreamingRecognitionResult.resultEndTime: object expected");
|
9653 | message.resultEndTime = $root.google.protobuf.Duration.fromObject(object.resultEndTime);
|
9654 | }
|
9655 | if (object.channelTag != null)
|
9656 | message.channelTag = object.channelTag | 0;
|
9657 | if (object.languageCode != null)
|
9658 | message.languageCode = String(object.languageCode);
|
9659 | return message;
|
9660 | };
|
9661 |
|
9662 | /**
|
9663 | * Creates a plain object from a StreamingRecognitionResult message. Also converts values to other types if specified.
|
9664 | * @function toObject
|
9665 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionResult
|
9666 | * @static
|
9667 | * @param {google.cloud.speech.v1p1beta1.StreamingRecognitionResult} message StreamingRecognitionResult
|
9668 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
9669 | * @returns {Object.<string,*>} Plain object
|
9670 | */
|
9671 | StreamingRecognitionResult.toObject = function toObject(message, options) {
|
9672 | if (!options)
|
9673 | options = {};
|
9674 | var object = {};
|
9675 | if (options.arrays || options.defaults)
|
9676 | object.alternatives = [];
|
9677 | if (options.defaults) {
|
9678 | object.isFinal = false;
|
9679 | object.stability = 0;
|
9680 | object.resultEndTime = null;
|
9681 | object.channelTag = 0;
|
9682 | object.languageCode = "";
|
9683 | }
|
9684 | if (message.alternatives && message.alternatives.length) {
|
9685 | object.alternatives = [];
|
9686 | for (var j = 0; j < message.alternatives.length; ++j)
|
9687 | object.alternatives[j] = $root.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.toObject(message.alternatives[j], options);
|
9688 | }
|
9689 | if (message.isFinal != null && message.hasOwnProperty("isFinal"))
|
9690 | object.isFinal = message.isFinal;
|
9691 | if (message.stability != null && message.hasOwnProperty("stability"))
|
9692 | object.stability = options.json && !isFinite(message.stability) ? String(message.stability) : message.stability;
|
9693 | if (message.resultEndTime != null && message.hasOwnProperty("resultEndTime"))
|
9694 | object.resultEndTime = $root.google.protobuf.Duration.toObject(message.resultEndTime, options);
|
9695 | if (message.channelTag != null && message.hasOwnProperty("channelTag"))
|
9696 | object.channelTag = message.channelTag;
|
9697 | if (message.languageCode != null && message.hasOwnProperty("languageCode"))
|
9698 | object.languageCode = message.languageCode;
|
9699 | return object;
|
9700 | };
|
9701 |
|
9702 | /**
|
9703 | * Converts this StreamingRecognitionResult to JSON.
|
9704 | * @function toJSON
|
9705 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionResult
|
9706 | * @instance
|
9707 | * @returns {Object.<string,*>} JSON object
|
9708 | */
|
9709 | StreamingRecognitionResult.prototype.toJSON = function toJSON() {
|
9710 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
9711 | };
|
9712 |
|
9713 | return StreamingRecognitionResult;
|
9714 | })();
|
9715 |
|
9716 | v1p1beta1.SpeechRecognitionResult = (function() {
|
9717 |
|
9718 | /**
|
9719 | * Properties of a SpeechRecognitionResult.
|
9720 | * @memberof google.cloud.speech.v1p1beta1
|
9721 | * @interface ISpeechRecognitionResult
|
9722 | * @property {Array.<google.cloud.speech.v1p1beta1.ISpeechRecognitionAlternative>|null} [alternatives] SpeechRecognitionResult alternatives
|
9723 | * @property {number|null} [channelTag] SpeechRecognitionResult channelTag
|
9724 | * @property {string|null} [languageCode] SpeechRecognitionResult languageCode
|
9725 | */
|
9726 |
|
9727 | /**
|
9728 | * Constructs a new SpeechRecognitionResult.
|
9729 | * @memberof google.cloud.speech.v1p1beta1
|
9730 | * @classdesc Represents a SpeechRecognitionResult.
|
9731 | * @implements ISpeechRecognitionResult
|
9732 | * @constructor
|
9733 | * @param {google.cloud.speech.v1p1beta1.ISpeechRecognitionResult=} [properties] Properties to set
|
9734 | */
|
9735 | function SpeechRecognitionResult(properties) {
|
9736 | this.alternatives = [];
|
9737 | if (properties)
|
9738 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
9739 | if (properties[keys[i]] != null)
|
9740 | this[keys[i]] = properties[keys[i]];
|
9741 | }
|
9742 |
|
9743 | /**
|
9744 | * SpeechRecognitionResult alternatives.
|
9745 | * @member {Array.<google.cloud.speech.v1p1beta1.ISpeechRecognitionAlternative>} alternatives
|
9746 | * @memberof google.cloud.speech.v1p1beta1.SpeechRecognitionResult
|
9747 | * @instance
|
9748 | */
|
9749 | SpeechRecognitionResult.prototype.alternatives = $util.emptyArray;
|
9750 |
|
9751 | /**
|
9752 | * SpeechRecognitionResult channelTag.
|
9753 | * @member {number} channelTag
|
9754 | * @memberof google.cloud.speech.v1p1beta1.SpeechRecognitionResult
|
9755 | * @instance
|
9756 | */
|
9757 | SpeechRecognitionResult.prototype.channelTag = 0;
|
9758 |
|
9759 | /**
|
9760 | * SpeechRecognitionResult languageCode.
|
9761 | * @member {string} languageCode
|
9762 | * @memberof google.cloud.speech.v1p1beta1.SpeechRecognitionResult
|
9763 | * @instance
|
9764 | */
|
9765 | SpeechRecognitionResult.prototype.languageCode = "";
|
9766 |
|
9767 | /**
|
9768 | * Creates a new SpeechRecognitionResult instance using the specified properties.
|
9769 | * @function create
|
9770 | * @memberof google.cloud.speech.v1p1beta1.SpeechRecognitionResult
|
9771 | * @static
|
9772 | * @param {google.cloud.speech.v1p1beta1.ISpeechRecognitionResult=} [properties] Properties to set
|
9773 | * @returns {google.cloud.speech.v1p1beta1.SpeechRecognitionResult} SpeechRecognitionResult instance
|
9774 | */
|
9775 | SpeechRecognitionResult.create = function create(properties) {
|
9776 | return new SpeechRecognitionResult(properties);
|
9777 | };
|
9778 |
|
9779 | /**
|
9780 | * Encodes the specified SpeechRecognitionResult message. Does not implicitly {@link google.cloud.speech.v1p1beta1.SpeechRecognitionResult.verify|verify} messages.
|
9781 | * @function encode
|
9782 | * @memberof google.cloud.speech.v1p1beta1.SpeechRecognitionResult
|
9783 | * @static
|
9784 | * @param {google.cloud.speech.v1p1beta1.ISpeechRecognitionResult} message SpeechRecognitionResult message or plain object to encode
|
9785 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
9786 | * @returns {$protobuf.Writer} Writer
|
9787 | */
|
9788 | SpeechRecognitionResult.encode = function encode(message, writer) {
|
9789 | if (!writer)
|
9790 | writer = $Writer.create();
|
9791 | if (message.alternatives != null && message.alternatives.length)
|
9792 | for (var i = 0; i < message.alternatives.length; ++i)
|
9793 | $root.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.encode(message.alternatives[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
9794 | if (message.channelTag != null && Object.hasOwnProperty.call(message, "channelTag"))
|
9795 | writer.uint32(/* id 2, wireType 0 =*/16).int32(message.channelTag);
|
9796 | if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode"))
|
9797 | writer.uint32(/* id 5, wireType 2 =*/42).string(message.languageCode);
|
9798 | return writer;
|
9799 | };
|
9800 |
|
9801 | /**
|
9802 | * Encodes the specified SpeechRecognitionResult message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.SpeechRecognitionResult.verify|verify} messages.
|
9803 | * @function encodeDelimited
|
9804 | * @memberof google.cloud.speech.v1p1beta1.SpeechRecognitionResult
|
9805 | * @static
|
9806 | * @param {google.cloud.speech.v1p1beta1.ISpeechRecognitionResult} message SpeechRecognitionResult message or plain object to encode
|
9807 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
9808 | * @returns {$protobuf.Writer} Writer
|
9809 | */
|
9810 | SpeechRecognitionResult.encodeDelimited = function encodeDelimited(message, writer) {
|
9811 | return this.encode(message, writer).ldelim();
|
9812 | };
|
9813 |
|
9814 | /**
|
9815 | * Decodes a SpeechRecognitionResult message from the specified reader or buffer.
|
9816 | * @function decode
|
9817 | * @memberof google.cloud.speech.v1p1beta1.SpeechRecognitionResult
|
9818 | * @static
|
9819 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
9820 | * @param {number} [length] Message length if known beforehand
|
9821 | * @returns {google.cloud.speech.v1p1beta1.SpeechRecognitionResult} SpeechRecognitionResult
|
9822 | * @throws {Error} If the payload is not a reader or valid buffer
|
9823 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
9824 | */
|
9825 | SpeechRecognitionResult.decode = function decode(reader, length) {
|
9826 | if (!(reader instanceof $Reader))
|
9827 | reader = $Reader.create(reader);
|
9828 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.SpeechRecognitionResult();
|
9829 | while (reader.pos < end) {
|
9830 | var tag = reader.uint32();
|
9831 | switch (tag >>> 3) {
|
9832 | case 1:
|
9833 | if (!(message.alternatives && message.alternatives.length))
|
9834 | message.alternatives = [];
|
9835 | message.alternatives.push($root.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.decode(reader, reader.uint32()));
|
9836 | break;
|
9837 | case 2:
|
9838 | message.channelTag = reader.int32();
|
9839 | break;
|
9840 | case 5:
|
9841 | message.languageCode = reader.string();
|
9842 | break;
|
9843 | default:
|
9844 | reader.skipType(tag & 7);
|
9845 | break;
|
9846 | }
|
9847 | }
|
9848 | return message;
|
9849 | };
|
9850 |
|
9851 | /**
|
9852 | * Decodes a SpeechRecognitionResult message from the specified reader or buffer, length delimited.
|
9853 | * @function decodeDelimited
|
9854 | * @memberof google.cloud.speech.v1p1beta1.SpeechRecognitionResult
|
9855 | * @static
|
9856 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
9857 | * @returns {google.cloud.speech.v1p1beta1.SpeechRecognitionResult} SpeechRecognitionResult
|
9858 | * @throws {Error} If the payload is not a reader or valid buffer
|
9859 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
9860 | */
|
9861 | SpeechRecognitionResult.decodeDelimited = function decodeDelimited(reader) {
|
9862 | if (!(reader instanceof $Reader))
|
9863 | reader = new $Reader(reader);
|
9864 | return this.decode(reader, reader.uint32());
|
9865 | };
|
9866 |
|
9867 | /**
|
9868 | * Verifies a SpeechRecognitionResult message.
|
9869 | * @function verify
|
9870 | * @memberof google.cloud.speech.v1p1beta1.SpeechRecognitionResult
|
9871 | * @static
|
9872 | * @param {Object.<string,*>} message Plain object to verify
|
9873 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
9874 | */
|
9875 | SpeechRecognitionResult.verify = function verify(message) {
|
9876 | if (typeof message !== "object" || message === null)
|
9877 | return "object expected";
|
9878 | if (message.alternatives != null && message.hasOwnProperty("alternatives")) {
|
9879 | if (!Array.isArray(message.alternatives))
|
9880 | return "alternatives: array expected";
|
9881 | for (var i = 0; i < message.alternatives.length; ++i) {
|
9882 | var error = $root.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.verify(message.alternatives[i]);
|
9883 | if (error)
|
9884 | return "alternatives." + error;
|
9885 | }
|
9886 | }
|
9887 | if (message.channelTag != null && message.hasOwnProperty("channelTag"))
|
9888 | if (!$util.isInteger(message.channelTag))
|
9889 | return "channelTag: integer expected";
|
9890 | if (message.languageCode != null && message.hasOwnProperty("languageCode"))
|
9891 | if (!$util.isString(message.languageCode))
|
9892 | return "languageCode: string expected";
|
9893 | return null;
|
9894 | };
|
9895 |
|
9896 | /**
|
9897 | * Creates a SpeechRecognitionResult message from a plain object. Also converts values to their respective internal types.
|
9898 | * @function fromObject
|
9899 | * @memberof google.cloud.speech.v1p1beta1.SpeechRecognitionResult
|
9900 | * @static
|
9901 | * @param {Object.<string,*>} object Plain object
|
9902 | * @returns {google.cloud.speech.v1p1beta1.SpeechRecognitionResult} SpeechRecognitionResult
|
9903 | */
|
9904 | SpeechRecognitionResult.fromObject = function fromObject(object) {
|
9905 | if (object instanceof $root.google.cloud.speech.v1p1beta1.SpeechRecognitionResult)
|
9906 | return object;
|
9907 | var message = new $root.google.cloud.speech.v1p1beta1.SpeechRecognitionResult();
|
9908 | if (object.alternatives) {
|
9909 | if (!Array.isArray(object.alternatives))
|
9910 | throw TypeError(".google.cloud.speech.v1p1beta1.SpeechRecognitionResult.alternatives: array expected");
|
9911 | message.alternatives = [];
|
9912 | for (var i = 0; i < object.alternatives.length; ++i) {
|
9913 | if (typeof object.alternatives[i] !== "object")
|
9914 | throw TypeError(".google.cloud.speech.v1p1beta1.SpeechRecognitionResult.alternatives: object expected");
|
9915 | message.alternatives[i] = $root.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.fromObject(object.alternatives[i]);
|
9916 | }
|
9917 | }
|
9918 | if (object.channelTag != null)
|
9919 | message.channelTag = object.channelTag | 0;
|
9920 | if (object.languageCode != null)
|
9921 | message.languageCode = String(object.languageCode);
|
9922 | return message;
|
9923 | };
|
9924 |
|
9925 | /**
|
9926 | * Creates a plain object from a SpeechRecognitionResult message. Also converts values to other types if specified.
|
9927 | * @function toObject
|
9928 | * @memberof google.cloud.speech.v1p1beta1.SpeechRecognitionResult
|
9929 | * @static
|
9930 | * @param {google.cloud.speech.v1p1beta1.SpeechRecognitionResult} message SpeechRecognitionResult
|
9931 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
9932 | * @returns {Object.<string,*>} Plain object
|
9933 | */
|
9934 | SpeechRecognitionResult.toObject = function toObject(message, options) {
|
9935 | if (!options)
|
9936 | options = {};
|
9937 | var object = {};
|
9938 | if (options.arrays || options.defaults)
|
9939 | object.alternatives = [];
|
9940 | if (options.defaults) {
|
9941 | object.channelTag = 0;
|
9942 | object.languageCode = "";
|
9943 | }
|
9944 | if (message.alternatives && message.alternatives.length) {
|
9945 | object.alternatives = [];
|
9946 | for (var j = 0; j < message.alternatives.length; ++j)
|
9947 | object.alternatives[j] = $root.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.toObject(message.alternatives[j], options);
|
9948 | }
|
9949 | if (message.channelTag != null && message.hasOwnProperty("channelTag"))
|
9950 | object.channelTag = message.channelTag;
|
9951 | if (message.languageCode != null && message.hasOwnProperty("languageCode"))
|
9952 | object.languageCode = message.languageCode;
|
9953 | return object;
|
9954 | };
|
9955 |
|
9956 | /**
|
9957 | * Converts this SpeechRecognitionResult to JSON.
|
9958 | * @function toJSON
|
9959 | * @memberof google.cloud.speech.v1p1beta1.SpeechRecognitionResult
|
9960 | * @instance
|
9961 | * @returns {Object.<string,*>} JSON object
|
9962 | */
|
9963 | SpeechRecognitionResult.prototype.toJSON = function toJSON() {
|
9964 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
9965 | };
|
9966 |
|
9967 | return SpeechRecognitionResult;
|
9968 | })();
|
9969 |
|
9970 | v1p1beta1.SpeechRecognitionAlternative = (function() {
|
9971 |
|
9972 | /**
|
9973 | * Properties of a SpeechRecognitionAlternative.
|
9974 | * @memberof google.cloud.speech.v1p1beta1
|
9975 | * @interface ISpeechRecognitionAlternative
|
9976 | * @property {string|null} [transcript] SpeechRecognitionAlternative transcript
|
9977 | * @property {number|null} [confidence] SpeechRecognitionAlternative confidence
|
9978 | * @property {Array.<google.cloud.speech.v1p1beta1.IWordInfo>|null} [words] SpeechRecognitionAlternative words
|
9979 | */
|
9980 |
|
9981 | /**
|
9982 | * Constructs a new SpeechRecognitionAlternative.
|
9983 | * @memberof google.cloud.speech.v1p1beta1
|
9984 | * @classdesc Represents a SpeechRecognitionAlternative.
|
9985 | * @implements ISpeechRecognitionAlternative
|
9986 | * @constructor
|
9987 | * @param {google.cloud.speech.v1p1beta1.ISpeechRecognitionAlternative=} [properties] Properties to set
|
9988 | */
|
9989 | function SpeechRecognitionAlternative(properties) {
|
9990 | this.words = [];
|
9991 | if (properties)
|
9992 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
9993 | if (properties[keys[i]] != null)
|
9994 | this[keys[i]] = properties[keys[i]];
|
9995 | }
|
9996 |
|
9997 | /**
|
9998 | * SpeechRecognitionAlternative transcript.
|
9999 | * @member {string} transcript
|
10000 | * @memberof google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative
|
10001 | * @instance
|
10002 | */
|
10003 | SpeechRecognitionAlternative.prototype.transcript = "";
|
10004 |
|
10005 | /**
|
10006 | * SpeechRecognitionAlternative confidence.
|
10007 | * @member {number} confidence
|
10008 | * @memberof google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative
|
10009 | * @instance
|
10010 | */
|
10011 | SpeechRecognitionAlternative.prototype.confidence = 0;
|
10012 |
|
10013 | /**
|
10014 | * SpeechRecognitionAlternative words.
|
10015 | * @member {Array.<google.cloud.speech.v1p1beta1.IWordInfo>} words
|
10016 | * @memberof google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative
|
10017 | * @instance
|
10018 | */
|
10019 | SpeechRecognitionAlternative.prototype.words = $util.emptyArray;
|
10020 |
|
10021 | /**
|
10022 | * Creates a new SpeechRecognitionAlternative instance using the specified properties.
|
10023 | * @function create
|
10024 | * @memberof google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative
|
10025 | * @static
|
10026 | * @param {google.cloud.speech.v1p1beta1.ISpeechRecognitionAlternative=} [properties] Properties to set
|
10027 | * @returns {google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative} SpeechRecognitionAlternative instance
|
10028 | */
|
10029 | SpeechRecognitionAlternative.create = function create(properties) {
|
10030 | return new SpeechRecognitionAlternative(properties);
|
10031 | };
|
10032 |
|
10033 | /**
|
10034 | * Encodes the specified SpeechRecognitionAlternative message. Does not implicitly {@link google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.verify|verify} messages.
|
10035 | * @function encode
|
10036 | * @memberof google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative
|
10037 | * @static
|
10038 | * @param {google.cloud.speech.v1p1beta1.ISpeechRecognitionAlternative} message SpeechRecognitionAlternative message or plain object to encode
|
10039 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
10040 | * @returns {$protobuf.Writer} Writer
|
10041 | */
|
10042 | SpeechRecognitionAlternative.encode = function encode(message, writer) {
|
10043 | if (!writer)
|
10044 | writer = $Writer.create();
|
10045 | if (message.transcript != null && Object.hasOwnProperty.call(message, "transcript"))
|
10046 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.transcript);
|
10047 | if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence"))
|
10048 | writer.uint32(/* id 2, wireType 5 =*/21).float(message.confidence);
|
10049 | if (message.words != null && message.words.length)
|
10050 | for (var i = 0; i < message.words.length; ++i)
|
10051 | $root.google.cloud.speech.v1p1beta1.WordInfo.encode(message.words[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
|
10052 | return writer;
|
10053 | };
|
10054 |
|
10055 | /**
|
10056 | * Encodes the specified SpeechRecognitionAlternative message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.verify|verify} messages.
|
10057 | * @function encodeDelimited
|
10058 | * @memberof google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative
|
10059 | * @static
|
10060 | * @param {google.cloud.speech.v1p1beta1.ISpeechRecognitionAlternative} message SpeechRecognitionAlternative message or plain object to encode
|
10061 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
10062 | * @returns {$protobuf.Writer} Writer
|
10063 | */
|
10064 | SpeechRecognitionAlternative.encodeDelimited = function encodeDelimited(message, writer) {
|
10065 | return this.encode(message, writer).ldelim();
|
10066 | };
|
10067 |
|
10068 | /**
|
10069 | * Decodes a SpeechRecognitionAlternative message from the specified reader or buffer.
|
10070 | * @function decode
|
10071 | * @memberof google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative
|
10072 | * @static
|
10073 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
10074 | * @param {number} [length] Message length if known beforehand
|
10075 | * @returns {google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative} SpeechRecognitionAlternative
|
10076 | * @throws {Error} If the payload is not a reader or valid buffer
|
10077 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
10078 | */
|
10079 | SpeechRecognitionAlternative.decode = function decode(reader, length) {
|
10080 | if (!(reader instanceof $Reader))
|
10081 | reader = $Reader.create(reader);
|
10082 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative();
|
10083 | while (reader.pos < end) {
|
10084 | var tag = reader.uint32();
|
10085 | switch (tag >>> 3) {
|
10086 | case 1:
|
10087 | message.transcript = reader.string();
|
10088 | break;
|
10089 | case 2:
|
10090 | message.confidence = reader.float();
|
10091 | break;
|
10092 | case 3:
|
10093 | if (!(message.words && message.words.length))
|
10094 | message.words = [];
|
10095 | message.words.push($root.google.cloud.speech.v1p1beta1.WordInfo.decode(reader, reader.uint32()));
|
10096 | break;
|
10097 | default:
|
10098 | reader.skipType(tag & 7);
|
10099 | break;
|
10100 | }
|
10101 | }
|
10102 | return message;
|
10103 | };
|
10104 |
|
10105 | /**
|
10106 | * Decodes a SpeechRecognitionAlternative message from the specified reader or buffer, length delimited.
|
10107 | * @function decodeDelimited
|
10108 | * @memberof google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative
|
10109 | * @static
|
10110 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
10111 | * @returns {google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative} SpeechRecognitionAlternative
|
10112 | * @throws {Error} If the payload is not a reader or valid buffer
|
10113 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
10114 | */
|
10115 | SpeechRecognitionAlternative.decodeDelimited = function decodeDelimited(reader) {
|
10116 | if (!(reader instanceof $Reader))
|
10117 | reader = new $Reader(reader);
|
10118 | return this.decode(reader, reader.uint32());
|
10119 | };
|
10120 |
|
10121 | /**
|
10122 | * Verifies a SpeechRecognitionAlternative message.
|
10123 | * @function verify
|
10124 | * @memberof google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative
|
10125 | * @static
|
10126 | * @param {Object.<string,*>} message Plain object to verify
|
10127 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
10128 | */
|
10129 | SpeechRecognitionAlternative.verify = function verify(message) {
|
10130 | if (typeof message !== "object" || message === null)
|
10131 | return "object expected";
|
10132 | if (message.transcript != null && message.hasOwnProperty("transcript"))
|
10133 | if (!$util.isString(message.transcript))
|
10134 | return "transcript: string expected";
|
10135 | if (message.confidence != null && message.hasOwnProperty("confidence"))
|
10136 | if (typeof message.confidence !== "number")
|
10137 | return "confidence: number expected";
|
10138 | if (message.words != null && message.hasOwnProperty("words")) {
|
10139 | if (!Array.isArray(message.words))
|
10140 | return "words: array expected";
|
10141 | for (var i = 0; i < message.words.length; ++i) {
|
10142 | var error = $root.google.cloud.speech.v1p1beta1.WordInfo.verify(message.words[i]);
|
10143 | if (error)
|
10144 | return "words." + error;
|
10145 | }
|
10146 | }
|
10147 | return null;
|
10148 | };
|
10149 |
|
10150 | /**
|
10151 | * Creates a SpeechRecognitionAlternative message from a plain object. Also converts values to their respective internal types.
|
10152 | * @function fromObject
|
10153 | * @memberof google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative
|
10154 | * @static
|
10155 | * @param {Object.<string,*>} object Plain object
|
10156 | * @returns {google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative} SpeechRecognitionAlternative
|
10157 | */
|
10158 | SpeechRecognitionAlternative.fromObject = function fromObject(object) {
|
10159 | if (object instanceof $root.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative)
|
10160 | return object;
|
10161 | var message = new $root.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative();
|
10162 | if (object.transcript != null)
|
10163 | message.transcript = String(object.transcript);
|
10164 | if (object.confidence != null)
|
10165 | message.confidence = Number(object.confidence);
|
10166 | if (object.words) {
|
10167 | if (!Array.isArray(object.words))
|
10168 | throw TypeError(".google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.words: array expected");
|
10169 | message.words = [];
|
10170 | for (var i = 0; i < object.words.length; ++i) {
|
10171 | if (typeof object.words[i] !== "object")
|
10172 | throw TypeError(".google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.words: object expected");
|
10173 | message.words[i] = $root.google.cloud.speech.v1p1beta1.WordInfo.fromObject(object.words[i]);
|
10174 | }
|
10175 | }
|
10176 | return message;
|
10177 | };
|
10178 |
|
10179 | /**
|
10180 | * Creates a plain object from a SpeechRecognitionAlternative message. Also converts values to other types if specified.
|
10181 | * @function toObject
|
10182 | * @memberof google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative
|
10183 | * @static
|
10184 | * @param {google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative} message SpeechRecognitionAlternative
|
10185 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
10186 | * @returns {Object.<string,*>} Plain object
|
10187 | */
|
10188 | SpeechRecognitionAlternative.toObject = function toObject(message, options) {
|
10189 | if (!options)
|
10190 | options = {};
|
10191 | var object = {};
|
10192 | if (options.arrays || options.defaults)
|
10193 | object.words = [];
|
10194 | if (options.defaults) {
|
10195 | object.transcript = "";
|
10196 | object.confidence = 0;
|
10197 | }
|
10198 | if (message.transcript != null && message.hasOwnProperty("transcript"))
|
10199 | object.transcript = message.transcript;
|
10200 | if (message.confidence != null && message.hasOwnProperty("confidence"))
|
10201 | object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence;
|
10202 | if (message.words && message.words.length) {
|
10203 | object.words = [];
|
10204 | for (var j = 0; j < message.words.length; ++j)
|
10205 | object.words[j] = $root.google.cloud.speech.v1p1beta1.WordInfo.toObject(message.words[j], options);
|
10206 | }
|
10207 | return object;
|
10208 | };
|
10209 |
|
10210 | /**
|
10211 | * Converts this SpeechRecognitionAlternative to JSON.
|
10212 | * @function toJSON
|
10213 | * @memberof google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative
|
10214 | * @instance
|
10215 | * @returns {Object.<string,*>} JSON object
|
10216 | */
|
10217 | SpeechRecognitionAlternative.prototype.toJSON = function toJSON() {
|
10218 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
10219 | };
|
10220 |
|
10221 | return SpeechRecognitionAlternative;
|
10222 | })();
|
10223 |
|
10224 | v1p1beta1.WordInfo = (function() {
|
10225 |
|
10226 | /**
|
10227 | * Properties of a WordInfo.
|
10228 | * @memberof google.cloud.speech.v1p1beta1
|
10229 | * @interface IWordInfo
|
10230 | * @property {google.protobuf.IDuration|null} [startTime] WordInfo startTime
|
10231 | * @property {google.protobuf.IDuration|null} [endTime] WordInfo endTime
|
10232 | * @property {string|null} [word] WordInfo word
|
10233 | * @property {number|null} [confidence] WordInfo confidence
|
10234 | * @property {number|null} [speakerTag] WordInfo speakerTag
|
10235 | */
|
10236 |
|
10237 | /**
|
10238 | * Constructs a new WordInfo.
|
10239 | * @memberof google.cloud.speech.v1p1beta1
|
10240 | * @classdesc Represents a WordInfo.
|
10241 | * @implements IWordInfo
|
10242 | * @constructor
|
10243 | * @param {google.cloud.speech.v1p1beta1.IWordInfo=} [properties] Properties to set
|
10244 | */
|
10245 | function WordInfo(properties) {
|
10246 | if (properties)
|
10247 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
10248 | if (properties[keys[i]] != null)
|
10249 | this[keys[i]] = properties[keys[i]];
|
10250 | }
|
10251 |
|
10252 | /**
|
10253 | * WordInfo startTime.
|
10254 | * @member {google.protobuf.IDuration|null|undefined} startTime
|
10255 | * @memberof google.cloud.speech.v1p1beta1.WordInfo
|
10256 | * @instance
|
10257 | */
|
10258 | WordInfo.prototype.startTime = null;
|
10259 |
|
10260 | /**
|
10261 | * WordInfo endTime.
|
10262 | * @member {google.protobuf.IDuration|null|undefined} endTime
|
10263 | * @memberof google.cloud.speech.v1p1beta1.WordInfo
|
10264 | * @instance
|
10265 | */
|
10266 | WordInfo.prototype.endTime = null;
|
10267 |
|
10268 | /**
|
10269 | * WordInfo word.
|
10270 | * @member {string} word
|
10271 | * @memberof google.cloud.speech.v1p1beta1.WordInfo
|
10272 | * @instance
|
10273 | */
|
10274 | WordInfo.prototype.word = "";
|
10275 |
|
10276 | /**
|
10277 | * WordInfo confidence.
|
10278 | * @member {number} confidence
|
10279 | * @memberof google.cloud.speech.v1p1beta1.WordInfo
|
10280 | * @instance
|
10281 | */
|
10282 | WordInfo.prototype.confidence = 0;
|
10283 |
|
10284 | /**
|
10285 | * WordInfo speakerTag.
|
10286 | * @member {number} speakerTag
|
10287 | * @memberof google.cloud.speech.v1p1beta1.WordInfo
|
10288 | * @instance
|
10289 | */
|
10290 | WordInfo.prototype.speakerTag = 0;
|
10291 |
|
10292 | /**
|
10293 | * Creates a new WordInfo instance using the specified properties.
|
10294 | * @function create
|
10295 | * @memberof google.cloud.speech.v1p1beta1.WordInfo
|
10296 | * @static
|
10297 | * @param {google.cloud.speech.v1p1beta1.IWordInfo=} [properties] Properties to set
|
10298 | * @returns {google.cloud.speech.v1p1beta1.WordInfo} WordInfo instance
|
10299 | */
|
10300 | WordInfo.create = function create(properties) {
|
10301 | return new WordInfo(properties);
|
10302 | };
|
10303 |
|
10304 | /**
|
10305 | * Encodes the specified WordInfo message. Does not implicitly {@link google.cloud.speech.v1p1beta1.WordInfo.verify|verify} messages.
|
10306 | * @function encode
|
10307 | * @memberof google.cloud.speech.v1p1beta1.WordInfo
|
10308 | * @static
|
10309 | * @param {google.cloud.speech.v1p1beta1.IWordInfo} message WordInfo message or plain object to encode
|
10310 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
10311 | * @returns {$protobuf.Writer} Writer
|
10312 | */
|
10313 | WordInfo.encode = function encode(message, writer) {
|
10314 | if (!writer)
|
10315 | writer = $Writer.create();
|
10316 | if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime"))
|
10317 | $root.google.protobuf.Duration.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
10318 | if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime"))
|
10319 | $root.google.protobuf.Duration.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
10320 | if (message.word != null && Object.hasOwnProperty.call(message, "word"))
|
10321 | writer.uint32(/* id 3, wireType 2 =*/26).string(message.word);
|
10322 | if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence"))
|
10323 | writer.uint32(/* id 4, wireType 5 =*/37).float(message.confidence);
|
10324 | if (message.speakerTag != null && Object.hasOwnProperty.call(message, "speakerTag"))
|
10325 | writer.uint32(/* id 5, wireType 0 =*/40).int32(message.speakerTag);
|
10326 | return writer;
|
10327 | };
|
10328 |
|
10329 | /**
|
10330 | * Encodes the specified WordInfo message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.WordInfo.verify|verify} messages.
|
10331 | * @function encodeDelimited
|
10332 | * @memberof google.cloud.speech.v1p1beta1.WordInfo
|
10333 | * @static
|
10334 | * @param {google.cloud.speech.v1p1beta1.IWordInfo} message WordInfo message or plain object to encode
|
10335 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
10336 | * @returns {$protobuf.Writer} Writer
|
10337 | */
|
10338 | WordInfo.encodeDelimited = function encodeDelimited(message, writer) {
|
10339 | return this.encode(message, writer).ldelim();
|
10340 | };
|
10341 |
|
10342 | /**
|
10343 | * Decodes a WordInfo message from the specified reader or buffer.
|
10344 | * @function decode
|
10345 | * @memberof google.cloud.speech.v1p1beta1.WordInfo
|
10346 | * @static
|
10347 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
10348 | * @param {number} [length] Message length if known beforehand
|
10349 | * @returns {google.cloud.speech.v1p1beta1.WordInfo} WordInfo
|
10350 | * @throws {Error} If the payload is not a reader or valid buffer
|
10351 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
10352 | */
|
10353 | WordInfo.decode = function decode(reader, length) {
|
10354 | if (!(reader instanceof $Reader))
|
10355 | reader = $Reader.create(reader);
|
10356 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.WordInfo();
|
10357 | while (reader.pos < end) {
|
10358 | var tag = reader.uint32();
|
10359 | switch (tag >>> 3) {
|
10360 | case 1:
|
10361 | message.startTime = $root.google.protobuf.Duration.decode(reader, reader.uint32());
|
10362 | break;
|
10363 | case 2:
|
10364 | message.endTime = $root.google.protobuf.Duration.decode(reader, reader.uint32());
|
10365 | break;
|
10366 | case 3:
|
10367 | message.word = reader.string();
|
10368 | break;
|
10369 | case 4:
|
10370 | message.confidence = reader.float();
|
10371 | break;
|
10372 | case 5:
|
10373 | message.speakerTag = reader.int32();
|
10374 | break;
|
10375 | default:
|
10376 | reader.skipType(tag & 7);
|
10377 | break;
|
10378 | }
|
10379 | }
|
10380 | return message;
|
10381 | };
|
10382 |
|
10383 | /**
|
10384 | * Decodes a WordInfo message from the specified reader or buffer, length delimited.
|
10385 | * @function decodeDelimited
|
10386 | * @memberof google.cloud.speech.v1p1beta1.WordInfo
|
10387 | * @static
|
10388 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
10389 | * @returns {google.cloud.speech.v1p1beta1.WordInfo} WordInfo
|
10390 | * @throws {Error} If the payload is not a reader or valid buffer
|
10391 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
10392 | */
|
10393 | WordInfo.decodeDelimited = function decodeDelimited(reader) {
|
10394 | if (!(reader instanceof $Reader))
|
10395 | reader = new $Reader(reader);
|
10396 | return this.decode(reader, reader.uint32());
|
10397 | };
|
10398 |
|
10399 | /**
|
10400 | * Verifies a WordInfo message.
|
10401 | * @function verify
|
10402 | * @memberof google.cloud.speech.v1p1beta1.WordInfo
|
10403 | * @static
|
10404 | * @param {Object.<string,*>} message Plain object to verify
|
10405 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
10406 | */
|
10407 | WordInfo.verify = function verify(message) {
|
10408 | if (typeof message !== "object" || message === null)
|
10409 | return "object expected";
|
10410 | if (message.startTime != null && message.hasOwnProperty("startTime")) {
|
10411 | var error = $root.google.protobuf.Duration.verify(message.startTime);
|
10412 | if (error)
|
10413 | return "startTime." + error;
|
10414 | }
|
10415 | if (message.endTime != null && message.hasOwnProperty("endTime")) {
|
10416 | var error = $root.google.protobuf.Duration.verify(message.endTime);
|
10417 | if (error)
|
10418 | return "endTime." + error;
|
10419 | }
|
10420 | if (message.word != null && message.hasOwnProperty("word"))
|
10421 | if (!$util.isString(message.word))
|
10422 | return "word: string expected";
|
10423 | if (message.confidence != null && message.hasOwnProperty("confidence"))
|
10424 | if (typeof message.confidence !== "number")
|
10425 | return "confidence: number expected";
|
10426 | if (message.speakerTag != null && message.hasOwnProperty("speakerTag"))
|
10427 | if (!$util.isInteger(message.speakerTag))
|
10428 | return "speakerTag: integer expected";
|
10429 | return null;
|
10430 | };
|
10431 |
|
10432 | /**
|
10433 | * Creates a WordInfo message from a plain object. Also converts values to their respective internal types.
|
10434 | * @function fromObject
|
10435 | * @memberof google.cloud.speech.v1p1beta1.WordInfo
|
10436 | * @static
|
10437 | * @param {Object.<string,*>} object Plain object
|
10438 | * @returns {google.cloud.speech.v1p1beta1.WordInfo} WordInfo
|
10439 | */
|
10440 | WordInfo.fromObject = function fromObject(object) {
|
10441 | if (object instanceof $root.google.cloud.speech.v1p1beta1.WordInfo)
|
10442 | return object;
|
10443 | var message = new $root.google.cloud.speech.v1p1beta1.WordInfo();
|
10444 | if (object.startTime != null) {
|
10445 | if (typeof object.startTime !== "object")
|
10446 | throw TypeError(".google.cloud.speech.v1p1beta1.WordInfo.startTime: object expected");
|
10447 | message.startTime = $root.google.protobuf.Duration.fromObject(object.startTime);
|
10448 | }
|
10449 | if (object.endTime != null) {
|
10450 | if (typeof object.endTime !== "object")
|
10451 | throw TypeError(".google.cloud.speech.v1p1beta1.WordInfo.endTime: object expected");
|
10452 | message.endTime = $root.google.protobuf.Duration.fromObject(object.endTime);
|
10453 | }
|
10454 | if (object.word != null)
|
10455 | message.word = String(object.word);
|
10456 | if (object.confidence != null)
|
10457 | message.confidence = Number(object.confidence);
|
10458 | if (object.speakerTag != null)
|
10459 | message.speakerTag = object.speakerTag | 0;
|
10460 | return message;
|
10461 | };
|
10462 |
|
10463 | /**
|
10464 | * Creates a plain object from a WordInfo message. Also converts values to other types if specified.
|
10465 | * @function toObject
|
10466 | * @memberof google.cloud.speech.v1p1beta1.WordInfo
|
10467 | * @static
|
10468 | * @param {google.cloud.speech.v1p1beta1.WordInfo} message WordInfo
|
10469 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
10470 | * @returns {Object.<string,*>} Plain object
|
10471 | */
|
10472 | WordInfo.toObject = function toObject(message, options) {
|
10473 | if (!options)
|
10474 | options = {};
|
10475 | var object = {};
|
10476 | if (options.defaults) {
|
10477 | object.startTime = null;
|
10478 | object.endTime = null;
|
10479 | object.word = "";
|
10480 | object.confidence = 0;
|
10481 | object.speakerTag = 0;
|
10482 | }
|
10483 | if (message.startTime != null && message.hasOwnProperty("startTime"))
|
10484 | object.startTime = $root.google.protobuf.Duration.toObject(message.startTime, options);
|
10485 | if (message.endTime != null && message.hasOwnProperty("endTime"))
|
10486 | object.endTime = $root.google.protobuf.Duration.toObject(message.endTime, options);
|
10487 | if (message.word != null && message.hasOwnProperty("word"))
|
10488 | object.word = message.word;
|
10489 | if (message.confidence != null && message.hasOwnProperty("confidence"))
|
10490 | object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence;
|
10491 | if (message.speakerTag != null && message.hasOwnProperty("speakerTag"))
|
10492 | object.speakerTag = message.speakerTag;
|
10493 | return object;
|
10494 | };
|
10495 |
|
10496 | /**
|
10497 | * Converts this WordInfo to JSON.
|
10498 | * @function toJSON
|
10499 | * @memberof google.cloud.speech.v1p1beta1.WordInfo
|
10500 | * @instance
|
10501 | * @returns {Object.<string,*>} JSON object
|
10502 | */
|
10503 | WordInfo.prototype.toJSON = function toJSON() {
|
10504 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
10505 | };
|
10506 |
|
10507 | return WordInfo;
|
10508 | })();
|
10509 |
|
10510 | v1p1beta1.CustomClass = (function() {
|
10511 |
|
10512 | /**
|
10513 | * Properties of a CustomClass.
|
10514 | * @memberof google.cloud.speech.v1p1beta1
|
10515 | * @interface ICustomClass
|
10516 | * @property {string|null} [name] CustomClass name
|
10517 | * @property {string|null} [customClassId] CustomClass customClassId
|
10518 | * @property {Array.<google.cloud.speech.v1p1beta1.CustomClass.IClassItem>|null} [items] CustomClass items
|
10519 | */
|
10520 |
|
10521 | /**
|
10522 | * Constructs a new CustomClass.
|
10523 | * @memberof google.cloud.speech.v1p1beta1
|
10524 | * @classdesc Represents a CustomClass.
|
10525 | * @implements ICustomClass
|
10526 | * @constructor
|
10527 | * @param {google.cloud.speech.v1p1beta1.ICustomClass=} [properties] Properties to set
|
10528 | */
|
10529 | function CustomClass(properties) {
|
10530 | this.items = [];
|
10531 | if (properties)
|
10532 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
10533 | if (properties[keys[i]] != null)
|
10534 | this[keys[i]] = properties[keys[i]];
|
10535 | }
|
10536 |
|
10537 | /**
|
10538 | * CustomClass name.
|
10539 | * @member {string} name
|
10540 | * @memberof google.cloud.speech.v1p1beta1.CustomClass
|
10541 | * @instance
|
10542 | */
|
10543 | CustomClass.prototype.name = "";
|
10544 |
|
10545 | /**
|
10546 | * CustomClass customClassId.
|
10547 | * @member {string} customClassId
|
10548 | * @memberof google.cloud.speech.v1p1beta1.CustomClass
|
10549 | * @instance
|
10550 | */
|
10551 | CustomClass.prototype.customClassId = "";
|
10552 |
|
10553 | /**
|
10554 | * CustomClass items.
|
10555 | * @member {Array.<google.cloud.speech.v1p1beta1.CustomClass.IClassItem>} items
|
10556 | * @memberof google.cloud.speech.v1p1beta1.CustomClass
|
10557 | * @instance
|
10558 | */
|
10559 | CustomClass.prototype.items = $util.emptyArray;
|
10560 |
|
10561 | /**
|
10562 | * Creates a new CustomClass instance using the specified properties.
|
10563 | * @function create
|
10564 | * @memberof google.cloud.speech.v1p1beta1.CustomClass
|
10565 | * @static
|
10566 | * @param {google.cloud.speech.v1p1beta1.ICustomClass=} [properties] Properties to set
|
10567 | * @returns {google.cloud.speech.v1p1beta1.CustomClass} CustomClass instance
|
10568 | */
|
10569 | CustomClass.create = function create(properties) {
|
10570 | return new CustomClass(properties);
|
10571 | };
|
10572 |
|
10573 | /**
|
10574 | * Encodes the specified CustomClass message. Does not implicitly {@link google.cloud.speech.v1p1beta1.CustomClass.verify|verify} messages.
|
10575 | * @function encode
|
10576 | * @memberof google.cloud.speech.v1p1beta1.CustomClass
|
10577 | * @static
|
10578 | * @param {google.cloud.speech.v1p1beta1.ICustomClass} message CustomClass message or plain object to encode
|
10579 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
10580 | * @returns {$protobuf.Writer} Writer
|
10581 | */
|
10582 | CustomClass.encode = function encode(message, writer) {
|
10583 | if (!writer)
|
10584 | writer = $Writer.create();
|
10585 | if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
10586 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
|
10587 | if (message.customClassId != null && Object.hasOwnProperty.call(message, "customClassId"))
|
10588 | writer.uint32(/* id 2, wireType 2 =*/18).string(message.customClassId);
|
10589 | if (message.items != null && message.items.length)
|
10590 | for (var i = 0; i < message.items.length; ++i)
|
10591 | $root.google.cloud.speech.v1p1beta1.CustomClass.ClassItem.encode(message.items[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
|
10592 | return writer;
|
10593 | };
|
10594 |
|
10595 | /**
|
10596 | * Encodes the specified CustomClass message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.CustomClass.verify|verify} messages.
|
10597 | * @function encodeDelimited
|
10598 | * @memberof google.cloud.speech.v1p1beta1.CustomClass
|
10599 | * @static
|
10600 | * @param {google.cloud.speech.v1p1beta1.ICustomClass} message CustomClass message or plain object to encode
|
10601 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
10602 | * @returns {$protobuf.Writer} Writer
|
10603 | */
|
10604 | CustomClass.encodeDelimited = function encodeDelimited(message, writer) {
|
10605 | return this.encode(message, writer).ldelim();
|
10606 | };
|
10607 |
|
10608 | /**
|
10609 | * Decodes a CustomClass message from the specified reader or buffer.
|
10610 | * @function decode
|
10611 | * @memberof google.cloud.speech.v1p1beta1.CustomClass
|
10612 | * @static
|
10613 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
10614 | * @param {number} [length] Message length if known beforehand
|
10615 | * @returns {google.cloud.speech.v1p1beta1.CustomClass} CustomClass
|
10616 | * @throws {Error} If the payload is not a reader or valid buffer
|
10617 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
10618 | */
|
10619 | CustomClass.decode = function decode(reader, length) {
|
10620 | if (!(reader instanceof $Reader))
|
10621 | reader = $Reader.create(reader);
|
10622 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.CustomClass();
|
10623 | while (reader.pos < end) {
|
10624 | var tag = reader.uint32();
|
10625 | switch (tag >>> 3) {
|
10626 | case 1:
|
10627 | message.name = reader.string();
|
10628 | break;
|
10629 | case 2:
|
10630 | message.customClassId = reader.string();
|
10631 | break;
|
10632 | case 3:
|
10633 | if (!(message.items && message.items.length))
|
10634 | message.items = [];
|
10635 | message.items.push($root.google.cloud.speech.v1p1beta1.CustomClass.ClassItem.decode(reader, reader.uint32()));
|
10636 | break;
|
10637 | default:
|
10638 | reader.skipType(tag & 7);
|
10639 | break;
|
10640 | }
|
10641 | }
|
10642 | return message;
|
10643 | };
|
10644 |
|
10645 | /**
|
10646 | * Decodes a CustomClass message from the specified reader or buffer, length delimited.
|
10647 | * @function decodeDelimited
|
10648 | * @memberof google.cloud.speech.v1p1beta1.CustomClass
|
10649 | * @static
|
10650 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
10651 | * @returns {google.cloud.speech.v1p1beta1.CustomClass} CustomClass
|
10652 | * @throws {Error} If the payload is not a reader or valid buffer
|
10653 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
10654 | */
|
10655 | CustomClass.decodeDelimited = function decodeDelimited(reader) {
|
10656 | if (!(reader instanceof $Reader))
|
10657 | reader = new $Reader(reader);
|
10658 | return this.decode(reader, reader.uint32());
|
10659 | };
|
10660 |
|
10661 | /**
|
10662 | * Verifies a CustomClass message.
|
10663 | * @function verify
|
10664 | * @memberof google.cloud.speech.v1p1beta1.CustomClass
|
10665 | * @static
|
10666 | * @param {Object.<string,*>} message Plain object to verify
|
10667 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
10668 | */
|
10669 | CustomClass.verify = function verify(message) {
|
10670 | if (typeof message !== "object" || message === null)
|
10671 | return "object expected";
|
10672 | if (message.name != null && message.hasOwnProperty("name"))
|
10673 | if (!$util.isString(message.name))
|
10674 | return "name: string expected";
|
10675 | if (message.customClassId != null && message.hasOwnProperty("customClassId"))
|
10676 | if (!$util.isString(message.customClassId))
|
10677 | return "customClassId: string expected";
|
10678 | if (message.items != null && message.hasOwnProperty("items")) {
|
10679 | if (!Array.isArray(message.items))
|
10680 | return "items: array expected";
|
10681 | for (var i = 0; i < message.items.length; ++i) {
|
10682 | var error = $root.google.cloud.speech.v1p1beta1.CustomClass.ClassItem.verify(message.items[i]);
|
10683 | if (error)
|
10684 | return "items." + error;
|
10685 | }
|
10686 | }
|
10687 | return null;
|
10688 | };
|
10689 |
|
10690 | /**
|
10691 | * Creates a CustomClass message from a plain object. Also converts values to their respective internal types.
|
10692 | * @function fromObject
|
10693 | * @memberof google.cloud.speech.v1p1beta1.CustomClass
|
10694 | * @static
|
10695 | * @param {Object.<string,*>} object Plain object
|
10696 | * @returns {google.cloud.speech.v1p1beta1.CustomClass} CustomClass
|
10697 | */
|
10698 | CustomClass.fromObject = function fromObject(object) {
|
10699 | if (object instanceof $root.google.cloud.speech.v1p1beta1.CustomClass)
|
10700 | return object;
|
10701 | var message = new $root.google.cloud.speech.v1p1beta1.CustomClass();
|
10702 | if (object.name != null)
|
10703 | message.name = String(object.name);
|
10704 | if (object.customClassId != null)
|
10705 | message.customClassId = String(object.customClassId);
|
10706 | if (object.items) {
|
10707 | if (!Array.isArray(object.items))
|
10708 | throw TypeError(".google.cloud.speech.v1p1beta1.CustomClass.items: array expected");
|
10709 | message.items = [];
|
10710 | for (var i = 0; i < object.items.length; ++i) {
|
10711 | if (typeof object.items[i] !== "object")
|
10712 | throw TypeError(".google.cloud.speech.v1p1beta1.CustomClass.items: object expected");
|
10713 | message.items[i] = $root.google.cloud.speech.v1p1beta1.CustomClass.ClassItem.fromObject(object.items[i]);
|
10714 | }
|
10715 | }
|
10716 | return message;
|
10717 | };
|
10718 |
|
10719 | /**
|
10720 | * Creates a plain object from a CustomClass message. Also converts values to other types if specified.
|
10721 | * @function toObject
|
10722 | * @memberof google.cloud.speech.v1p1beta1.CustomClass
|
10723 | * @static
|
10724 | * @param {google.cloud.speech.v1p1beta1.CustomClass} message CustomClass
|
10725 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
10726 | * @returns {Object.<string,*>} Plain object
|
10727 | */
|
10728 | CustomClass.toObject = function toObject(message, options) {
|
10729 | if (!options)
|
10730 | options = {};
|
10731 | var object = {};
|
10732 | if (options.arrays || options.defaults)
|
10733 | object.items = [];
|
10734 | if (options.defaults) {
|
10735 | object.name = "";
|
10736 | object.customClassId = "";
|
10737 | }
|
10738 | if (message.name != null && message.hasOwnProperty("name"))
|
10739 | object.name = message.name;
|
10740 | if (message.customClassId != null && message.hasOwnProperty("customClassId"))
|
10741 | object.customClassId = message.customClassId;
|
10742 | if (message.items && message.items.length) {
|
10743 | object.items = [];
|
10744 | for (var j = 0; j < message.items.length; ++j)
|
10745 | object.items[j] = $root.google.cloud.speech.v1p1beta1.CustomClass.ClassItem.toObject(message.items[j], options);
|
10746 | }
|
10747 | return object;
|
10748 | };
|
10749 |
|
10750 | /**
|
10751 | * Converts this CustomClass to JSON.
|
10752 | * @function toJSON
|
10753 | * @memberof google.cloud.speech.v1p1beta1.CustomClass
|
10754 | * @instance
|
10755 | * @returns {Object.<string,*>} JSON object
|
10756 | */
|
10757 | CustomClass.prototype.toJSON = function toJSON() {
|
10758 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
10759 | };
|
10760 |
|
10761 | CustomClass.ClassItem = (function() {
|
10762 |
|
10763 | /**
|
10764 | * Properties of a ClassItem.
|
10765 | * @memberof google.cloud.speech.v1p1beta1.CustomClass
|
10766 | * @interface IClassItem
|
10767 | * @property {string|null} [value] ClassItem value
|
10768 | */
|
10769 |
|
10770 | /**
|
10771 | * Constructs a new ClassItem.
|
10772 | * @memberof google.cloud.speech.v1p1beta1.CustomClass
|
10773 | * @classdesc Represents a ClassItem.
|
10774 | * @implements IClassItem
|
10775 | * @constructor
|
10776 | * @param {google.cloud.speech.v1p1beta1.CustomClass.IClassItem=} [properties] Properties to set
|
10777 | */
|
10778 | function ClassItem(properties) {
|
10779 | if (properties)
|
10780 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
10781 | if (properties[keys[i]] != null)
|
10782 | this[keys[i]] = properties[keys[i]];
|
10783 | }
|
10784 |
|
10785 | /**
|
10786 | * ClassItem value.
|
10787 | * @member {string} value
|
10788 | * @memberof google.cloud.speech.v1p1beta1.CustomClass.ClassItem
|
10789 | * @instance
|
10790 | */
|
10791 | ClassItem.prototype.value = "";
|
10792 |
|
10793 | /**
|
10794 | * Creates a new ClassItem instance using the specified properties.
|
10795 | * @function create
|
10796 | * @memberof google.cloud.speech.v1p1beta1.CustomClass.ClassItem
|
10797 | * @static
|
10798 | * @param {google.cloud.speech.v1p1beta1.CustomClass.IClassItem=} [properties] Properties to set
|
10799 | * @returns {google.cloud.speech.v1p1beta1.CustomClass.ClassItem} ClassItem instance
|
10800 | */
|
10801 | ClassItem.create = function create(properties) {
|
10802 | return new ClassItem(properties);
|
10803 | };
|
10804 |
|
10805 | /**
|
10806 | * Encodes the specified ClassItem message. Does not implicitly {@link google.cloud.speech.v1p1beta1.CustomClass.ClassItem.verify|verify} messages.
|
10807 | * @function encode
|
10808 | * @memberof google.cloud.speech.v1p1beta1.CustomClass.ClassItem
|
10809 | * @static
|
10810 | * @param {google.cloud.speech.v1p1beta1.CustomClass.IClassItem} message ClassItem message or plain object to encode
|
10811 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
10812 | * @returns {$protobuf.Writer} Writer
|
10813 | */
|
10814 | ClassItem.encode = function encode(message, writer) {
|
10815 | if (!writer)
|
10816 | writer = $Writer.create();
|
10817 | if (message.value != null && Object.hasOwnProperty.call(message, "value"))
|
10818 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.value);
|
10819 | return writer;
|
10820 | };
|
10821 |
|
10822 | /**
|
10823 | * Encodes the specified ClassItem message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.CustomClass.ClassItem.verify|verify} messages.
|
10824 | * @function encodeDelimited
|
10825 | * @memberof google.cloud.speech.v1p1beta1.CustomClass.ClassItem
|
10826 | * @static
|
10827 | * @param {google.cloud.speech.v1p1beta1.CustomClass.IClassItem} message ClassItem message or plain object to encode
|
10828 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
10829 | * @returns {$protobuf.Writer} Writer
|
10830 | */
|
10831 | ClassItem.encodeDelimited = function encodeDelimited(message, writer) {
|
10832 | return this.encode(message, writer).ldelim();
|
10833 | };
|
10834 |
|
10835 | /**
|
10836 | * Decodes a ClassItem message from the specified reader or buffer.
|
10837 | * @function decode
|
10838 | * @memberof google.cloud.speech.v1p1beta1.CustomClass.ClassItem
|
10839 | * @static
|
10840 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
10841 | * @param {number} [length] Message length if known beforehand
|
10842 | * @returns {google.cloud.speech.v1p1beta1.CustomClass.ClassItem} ClassItem
|
10843 | * @throws {Error} If the payload is not a reader or valid buffer
|
10844 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
10845 | */
|
10846 | ClassItem.decode = function decode(reader, length) {
|
10847 | if (!(reader instanceof $Reader))
|
10848 | reader = $Reader.create(reader);
|
10849 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.CustomClass.ClassItem();
|
10850 | while (reader.pos < end) {
|
10851 | var tag = reader.uint32();
|
10852 | switch (tag >>> 3) {
|
10853 | case 1:
|
10854 | message.value = reader.string();
|
10855 | break;
|
10856 | default:
|
10857 | reader.skipType(tag & 7);
|
10858 | break;
|
10859 | }
|
10860 | }
|
10861 | return message;
|
10862 | };
|
10863 |
|
10864 | /**
|
10865 | * Decodes a ClassItem message from the specified reader or buffer, length delimited.
|
10866 | * @function decodeDelimited
|
10867 | * @memberof google.cloud.speech.v1p1beta1.CustomClass.ClassItem
|
10868 | * @static
|
10869 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
10870 | * @returns {google.cloud.speech.v1p1beta1.CustomClass.ClassItem} ClassItem
|
10871 | * @throws {Error} If the payload is not a reader or valid buffer
|
10872 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
10873 | */
|
10874 | ClassItem.decodeDelimited = function decodeDelimited(reader) {
|
10875 | if (!(reader instanceof $Reader))
|
10876 | reader = new $Reader(reader);
|
10877 | return this.decode(reader, reader.uint32());
|
10878 | };
|
10879 |
|
10880 | /**
|
10881 | * Verifies a ClassItem message.
|
10882 | * @function verify
|
10883 | * @memberof google.cloud.speech.v1p1beta1.CustomClass.ClassItem
|
10884 | * @static
|
10885 | * @param {Object.<string,*>} message Plain object to verify
|
10886 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
10887 | */
|
10888 | ClassItem.verify = function verify(message) {
|
10889 | if (typeof message !== "object" || message === null)
|
10890 | return "object expected";
|
10891 | if (message.value != null && message.hasOwnProperty("value"))
|
10892 | if (!$util.isString(message.value))
|
10893 | return "value: string expected";
|
10894 | return null;
|
10895 | };
|
10896 |
|
10897 | /**
|
10898 | * Creates a ClassItem message from a plain object. Also converts values to their respective internal types.
|
10899 | * @function fromObject
|
10900 | * @memberof google.cloud.speech.v1p1beta1.CustomClass.ClassItem
|
10901 | * @static
|
10902 | * @param {Object.<string,*>} object Plain object
|
10903 | * @returns {google.cloud.speech.v1p1beta1.CustomClass.ClassItem} ClassItem
|
10904 | */
|
10905 | ClassItem.fromObject = function fromObject(object) {
|
10906 | if (object instanceof $root.google.cloud.speech.v1p1beta1.CustomClass.ClassItem)
|
10907 | return object;
|
10908 | var message = new $root.google.cloud.speech.v1p1beta1.CustomClass.ClassItem();
|
10909 | if (object.value != null)
|
10910 | message.value = String(object.value);
|
10911 | return message;
|
10912 | };
|
10913 |
|
10914 | /**
|
10915 | * Creates a plain object from a ClassItem message. Also converts values to other types if specified.
|
10916 | * @function toObject
|
10917 | * @memberof google.cloud.speech.v1p1beta1.CustomClass.ClassItem
|
10918 | * @static
|
10919 | * @param {google.cloud.speech.v1p1beta1.CustomClass.ClassItem} message ClassItem
|
10920 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
10921 | * @returns {Object.<string,*>} Plain object
|
10922 | */
|
10923 | ClassItem.toObject = function toObject(message, options) {
|
10924 | if (!options)
|
10925 | options = {};
|
10926 | var object = {};
|
10927 | if (options.defaults)
|
10928 | object.value = "";
|
10929 | if (message.value != null && message.hasOwnProperty("value"))
|
10930 | object.value = message.value;
|
10931 | return object;
|
10932 | };
|
10933 |
|
10934 | /**
|
10935 | * Converts this ClassItem to JSON.
|
10936 | * @function toJSON
|
10937 | * @memberof google.cloud.speech.v1p1beta1.CustomClass.ClassItem
|
10938 | * @instance
|
10939 | * @returns {Object.<string,*>} JSON object
|
10940 | */
|
10941 | ClassItem.prototype.toJSON = function toJSON() {
|
10942 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
10943 | };
|
10944 |
|
10945 | return ClassItem;
|
10946 | })();
|
10947 |
|
10948 | return CustomClass;
|
10949 | })();
|
10950 |
|
10951 | v1p1beta1.PhraseSet = (function() {
|
10952 |
|
10953 | /**
|
10954 | * Properties of a PhraseSet.
|
10955 | * @memberof google.cloud.speech.v1p1beta1
|
10956 | * @interface IPhraseSet
|
10957 | * @property {string|null} [name] PhraseSet name
|
10958 | * @property {Array.<google.cloud.speech.v1p1beta1.PhraseSet.IPhrase>|null} [phrases] PhraseSet phrases
|
10959 | * @property {number|null} [boost] PhraseSet boost
|
10960 | */
|
10961 |
|
10962 | /**
|
10963 | * Constructs a new PhraseSet.
|
10964 | * @memberof google.cloud.speech.v1p1beta1
|
10965 | * @classdesc Represents a PhraseSet.
|
10966 | * @implements IPhraseSet
|
10967 | * @constructor
|
10968 | * @param {google.cloud.speech.v1p1beta1.IPhraseSet=} [properties] Properties to set
|
10969 | */
|
10970 | function PhraseSet(properties) {
|
10971 | this.phrases = [];
|
10972 | if (properties)
|
10973 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
10974 | if (properties[keys[i]] != null)
|
10975 | this[keys[i]] = properties[keys[i]];
|
10976 | }
|
10977 |
|
10978 | /**
|
10979 | * PhraseSet name.
|
10980 | * @member {string} name
|
10981 | * @memberof google.cloud.speech.v1p1beta1.PhraseSet
|
10982 | * @instance
|
10983 | */
|
10984 | PhraseSet.prototype.name = "";
|
10985 |
|
10986 | /**
|
10987 | * PhraseSet phrases.
|
10988 | * @member {Array.<google.cloud.speech.v1p1beta1.PhraseSet.IPhrase>} phrases
|
10989 | * @memberof google.cloud.speech.v1p1beta1.PhraseSet
|
10990 | * @instance
|
10991 | */
|
10992 | PhraseSet.prototype.phrases = $util.emptyArray;
|
10993 |
|
10994 | /**
|
10995 | * PhraseSet boost.
|
10996 | * @member {number} boost
|
10997 | * @memberof google.cloud.speech.v1p1beta1.PhraseSet
|
10998 | * @instance
|
10999 | */
|
11000 | PhraseSet.prototype.boost = 0;
|
11001 |
|
11002 | /**
|
11003 | * Creates a new PhraseSet instance using the specified properties.
|
11004 | * @function create
|
11005 | * @memberof google.cloud.speech.v1p1beta1.PhraseSet
|
11006 | * @static
|
11007 | * @param {google.cloud.speech.v1p1beta1.IPhraseSet=} [properties] Properties to set
|
11008 | * @returns {google.cloud.speech.v1p1beta1.PhraseSet} PhraseSet instance
|
11009 | */
|
11010 | PhraseSet.create = function create(properties) {
|
11011 | return new PhraseSet(properties);
|
11012 | };
|
11013 |
|
11014 | /**
|
11015 | * Encodes the specified PhraseSet message. Does not implicitly {@link google.cloud.speech.v1p1beta1.PhraseSet.verify|verify} messages.
|
11016 | * @function encode
|
11017 | * @memberof google.cloud.speech.v1p1beta1.PhraseSet
|
11018 | * @static
|
11019 | * @param {google.cloud.speech.v1p1beta1.IPhraseSet} message PhraseSet message or plain object to encode
|
11020 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
11021 | * @returns {$protobuf.Writer} Writer
|
11022 | */
|
11023 | PhraseSet.encode = function encode(message, writer) {
|
11024 | if (!writer)
|
11025 | writer = $Writer.create();
|
11026 | if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
11027 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
|
11028 | if (message.phrases != null && message.phrases.length)
|
11029 | for (var i = 0; i < message.phrases.length; ++i)
|
11030 | $root.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.encode(message.phrases[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
11031 | if (message.boost != null && Object.hasOwnProperty.call(message, "boost"))
|
11032 | writer.uint32(/* id 4, wireType 5 =*/37).float(message.boost);
|
11033 | return writer;
|
11034 | };
|
11035 |
|
11036 | /**
|
11037 | * Encodes the specified PhraseSet message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.PhraseSet.verify|verify} messages.
|
11038 | * @function encodeDelimited
|
11039 | * @memberof google.cloud.speech.v1p1beta1.PhraseSet
|
11040 | * @static
|
11041 | * @param {google.cloud.speech.v1p1beta1.IPhraseSet} message PhraseSet message or plain object to encode
|
11042 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
11043 | * @returns {$protobuf.Writer} Writer
|
11044 | */
|
11045 | PhraseSet.encodeDelimited = function encodeDelimited(message, writer) {
|
11046 | return this.encode(message, writer).ldelim();
|
11047 | };
|
11048 |
|
11049 | /**
|
11050 | * Decodes a PhraseSet message from the specified reader or buffer.
|
11051 | * @function decode
|
11052 | * @memberof google.cloud.speech.v1p1beta1.PhraseSet
|
11053 | * @static
|
11054 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
11055 | * @param {number} [length] Message length if known beforehand
|
11056 | * @returns {google.cloud.speech.v1p1beta1.PhraseSet} PhraseSet
|
11057 | * @throws {Error} If the payload is not a reader or valid buffer
|
11058 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
11059 | */
|
11060 | PhraseSet.decode = function decode(reader, length) {
|
11061 | if (!(reader instanceof $Reader))
|
11062 | reader = $Reader.create(reader);
|
11063 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.PhraseSet();
|
11064 | while (reader.pos < end) {
|
11065 | var tag = reader.uint32();
|
11066 | switch (tag >>> 3) {
|
11067 | case 1:
|
11068 | message.name = reader.string();
|
11069 | break;
|
11070 | case 2:
|
11071 | if (!(message.phrases && message.phrases.length))
|
11072 | message.phrases = [];
|
11073 | message.phrases.push($root.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.decode(reader, reader.uint32()));
|
11074 | break;
|
11075 | case 4:
|
11076 | message.boost = reader.float();
|
11077 | break;
|
11078 | default:
|
11079 | reader.skipType(tag & 7);
|
11080 | break;
|
11081 | }
|
11082 | }
|
11083 | return message;
|
11084 | };
|
11085 |
|
11086 | /**
|
11087 | * Decodes a PhraseSet message from the specified reader or buffer, length delimited.
|
11088 | * @function decodeDelimited
|
11089 | * @memberof google.cloud.speech.v1p1beta1.PhraseSet
|
11090 | * @static
|
11091 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
11092 | * @returns {google.cloud.speech.v1p1beta1.PhraseSet} PhraseSet
|
11093 | * @throws {Error} If the payload is not a reader or valid buffer
|
11094 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
11095 | */
|
11096 | PhraseSet.decodeDelimited = function decodeDelimited(reader) {
|
11097 | if (!(reader instanceof $Reader))
|
11098 | reader = new $Reader(reader);
|
11099 | return this.decode(reader, reader.uint32());
|
11100 | };
|
11101 |
|
11102 | /**
|
11103 | * Verifies a PhraseSet message.
|
11104 | * @function verify
|
11105 | * @memberof google.cloud.speech.v1p1beta1.PhraseSet
|
11106 | * @static
|
11107 | * @param {Object.<string,*>} message Plain object to verify
|
11108 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
11109 | */
|
11110 | PhraseSet.verify = function verify(message) {
|
11111 | if (typeof message !== "object" || message === null)
|
11112 | return "object expected";
|
11113 | if (message.name != null && message.hasOwnProperty("name"))
|
11114 | if (!$util.isString(message.name))
|
11115 | return "name: string expected";
|
11116 | if (message.phrases != null && message.hasOwnProperty("phrases")) {
|
11117 | if (!Array.isArray(message.phrases))
|
11118 | return "phrases: array expected";
|
11119 | for (var i = 0; i < message.phrases.length; ++i) {
|
11120 | var error = $root.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.verify(message.phrases[i]);
|
11121 | if (error)
|
11122 | return "phrases." + error;
|
11123 | }
|
11124 | }
|
11125 | if (message.boost != null && message.hasOwnProperty("boost"))
|
11126 | if (typeof message.boost !== "number")
|
11127 | return "boost: number expected";
|
11128 | return null;
|
11129 | };
|
11130 |
|
11131 | /**
|
11132 | * Creates a PhraseSet message from a plain object. Also converts values to their respective internal types.
|
11133 | * @function fromObject
|
11134 | * @memberof google.cloud.speech.v1p1beta1.PhraseSet
|
11135 | * @static
|
11136 | * @param {Object.<string,*>} object Plain object
|
11137 | * @returns {google.cloud.speech.v1p1beta1.PhraseSet} PhraseSet
|
11138 | */
|
11139 | PhraseSet.fromObject = function fromObject(object) {
|
11140 | if (object instanceof $root.google.cloud.speech.v1p1beta1.PhraseSet)
|
11141 | return object;
|
11142 | var message = new $root.google.cloud.speech.v1p1beta1.PhraseSet();
|
11143 | if (object.name != null)
|
11144 | message.name = String(object.name);
|
11145 | if (object.phrases) {
|
11146 | if (!Array.isArray(object.phrases))
|
11147 | throw TypeError(".google.cloud.speech.v1p1beta1.PhraseSet.phrases: array expected");
|
11148 | message.phrases = [];
|
11149 | for (var i = 0; i < object.phrases.length; ++i) {
|
11150 | if (typeof object.phrases[i] !== "object")
|
11151 | throw TypeError(".google.cloud.speech.v1p1beta1.PhraseSet.phrases: object expected");
|
11152 | message.phrases[i] = $root.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.fromObject(object.phrases[i]);
|
11153 | }
|
11154 | }
|
11155 | if (object.boost != null)
|
11156 | message.boost = Number(object.boost);
|
11157 | return message;
|
11158 | };
|
11159 |
|
11160 | /**
|
11161 | * Creates a plain object from a PhraseSet message. Also converts values to other types if specified.
|
11162 | * @function toObject
|
11163 | * @memberof google.cloud.speech.v1p1beta1.PhraseSet
|
11164 | * @static
|
11165 | * @param {google.cloud.speech.v1p1beta1.PhraseSet} message PhraseSet
|
11166 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
11167 | * @returns {Object.<string,*>} Plain object
|
11168 | */
|
11169 | PhraseSet.toObject = function toObject(message, options) {
|
11170 | if (!options)
|
11171 | options = {};
|
11172 | var object = {};
|
11173 | if (options.arrays || options.defaults)
|
11174 | object.phrases = [];
|
11175 | if (options.defaults) {
|
11176 | object.name = "";
|
11177 | object.boost = 0;
|
11178 | }
|
11179 | if (message.name != null && message.hasOwnProperty("name"))
|
11180 | object.name = message.name;
|
11181 | if (message.phrases && message.phrases.length) {
|
11182 | object.phrases = [];
|
11183 | for (var j = 0; j < message.phrases.length; ++j)
|
11184 | object.phrases[j] = $root.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.toObject(message.phrases[j], options);
|
11185 | }
|
11186 | if (message.boost != null && message.hasOwnProperty("boost"))
|
11187 | object.boost = options.json && !isFinite(message.boost) ? String(message.boost) : message.boost;
|
11188 | return object;
|
11189 | };
|
11190 |
|
11191 | /**
|
11192 | * Converts this PhraseSet to JSON.
|
11193 | * @function toJSON
|
11194 | * @memberof google.cloud.speech.v1p1beta1.PhraseSet
|
11195 | * @instance
|
11196 | * @returns {Object.<string,*>} JSON object
|
11197 | */
|
11198 | PhraseSet.prototype.toJSON = function toJSON() {
|
11199 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
11200 | };
|
11201 |
|
11202 | PhraseSet.Phrase = (function() {
|
11203 |
|
11204 | /**
|
11205 | * Properties of a Phrase.
|
11206 | * @memberof google.cloud.speech.v1p1beta1.PhraseSet
|
11207 | * @interface IPhrase
|
11208 | * @property {string|null} [value] Phrase value
|
11209 | * @property {number|null} [boost] Phrase boost
|
11210 | */
|
11211 |
|
11212 | /**
|
11213 | * Constructs a new Phrase.
|
11214 | * @memberof google.cloud.speech.v1p1beta1.PhraseSet
|
11215 | * @classdesc Represents a Phrase.
|
11216 | * @implements IPhrase
|
11217 | * @constructor
|
11218 | * @param {google.cloud.speech.v1p1beta1.PhraseSet.IPhrase=} [properties] Properties to set
|
11219 | */
|
11220 | function Phrase(properties) {
|
11221 | if (properties)
|
11222 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
11223 | if (properties[keys[i]] != null)
|
11224 | this[keys[i]] = properties[keys[i]];
|
11225 | }
|
11226 |
|
11227 | /**
|
11228 | * Phrase value.
|
11229 | * @member {string} value
|
11230 | * @memberof google.cloud.speech.v1p1beta1.PhraseSet.Phrase
|
11231 | * @instance
|
11232 | */
|
11233 | Phrase.prototype.value = "";
|
11234 |
|
11235 | /**
|
11236 | * Phrase boost.
|
11237 | * @member {number} boost
|
11238 | * @memberof google.cloud.speech.v1p1beta1.PhraseSet.Phrase
|
11239 | * @instance
|
11240 | */
|
11241 | Phrase.prototype.boost = 0;
|
11242 |
|
11243 | /**
|
11244 | * Creates a new Phrase instance using the specified properties.
|
11245 | * @function create
|
11246 | * @memberof google.cloud.speech.v1p1beta1.PhraseSet.Phrase
|
11247 | * @static
|
11248 | * @param {google.cloud.speech.v1p1beta1.PhraseSet.IPhrase=} [properties] Properties to set
|
11249 | * @returns {google.cloud.speech.v1p1beta1.PhraseSet.Phrase} Phrase instance
|
11250 | */
|
11251 | Phrase.create = function create(properties) {
|
11252 | return new Phrase(properties);
|
11253 | };
|
11254 |
|
11255 | /**
|
11256 | * Encodes the specified Phrase message. Does not implicitly {@link google.cloud.speech.v1p1beta1.PhraseSet.Phrase.verify|verify} messages.
|
11257 | * @function encode
|
11258 | * @memberof google.cloud.speech.v1p1beta1.PhraseSet.Phrase
|
11259 | * @static
|
11260 | * @param {google.cloud.speech.v1p1beta1.PhraseSet.IPhrase} message Phrase message or plain object to encode
|
11261 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
11262 | * @returns {$protobuf.Writer} Writer
|
11263 | */
|
11264 | Phrase.encode = function encode(message, writer) {
|
11265 | if (!writer)
|
11266 | writer = $Writer.create();
|
11267 | if (message.value != null && Object.hasOwnProperty.call(message, "value"))
|
11268 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.value);
|
11269 | if (message.boost != null && Object.hasOwnProperty.call(message, "boost"))
|
11270 | writer.uint32(/* id 2, wireType 5 =*/21).float(message.boost);
|
11271 | return writer;
|
11272 | };
|
11273 |
|
11274 | /**
|
11275 | * Encodes the specified Phrase message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.PhraseSet.Phrase.verify|verify} messages.
|
11276 | * @function encodeDelimited
|
11277 | * @memberof google.cloud.speech.v1p1beta1.PhraseSet.Phrase
|
11278 | * @static
|
11279 | * @param {google.cloud.speech.v1p1beta1.PhraseSet.IPhrase} message Phrase message or plain object to encode
|
11280 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
11281 | * @returns {$protobuf.Writer} Writer
|
11282 | */
|
11283 | Phrase.encodeDelimited = function encodeDelimited(message, writer) {
|
11284 | return this.encode(message, writer).ldelim();
|
11285 | };
|
11286 |
|
11287 | /**
|
11288 | * Decodes a Phrase message from the specified reader or buffer.
|
11289 | * @function decode
|
11290 | * @memberof google.cloud.speech.v1p1beta1.PhraseSet.Phrase
|
11291 | * @static
|
11292 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
11293 | * @param {number} [length] Message length if known beforehand
|
11294 | * @returns {google.cloud.speech.v1p1beta1.PhraseSet.Phrase} Phrase
|
11295 | * @throws {Error} If the payload is not a reader or valid buffer
|
11296 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
11297 | */
|
11298 | Phrase.decode = function decode(reader, length) {
|
11299 | if (!(reader instanceof $Reader))
|
11300 | reader = $Reader.create(reader);
|
11301 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.PhraseSet.Phrase();
|
11302 | while (reader.pos < end) {
|
11303 | var tag = reader.uint32();
|
11304 | switch (tag >>> 3) {
|
11305 | case 1:
|
11306 | message.value = reader.string();
|
11307 | break;
|
11308 | case 2:
|
11309 | message.boost = reader.float();
|
11310 | break;
|
11311 | default:
|
11312 | reader.skipType(tag & 7);
|
11313 | break;
|
11314 | }
|
11315 | }
|
11316 | return message;
|
11317 | };
|
11318 |
|
11319 | /**
|
11320 | * Decodes a Phrase message from the specified reader or buffer, length delimited.
|
11321 | * @function decodeDelimited
|
11322 | * @memberof google.cloud.speech.v1p1beta1.PhraseSet.Phrase
|
11323 | * @static
|
11324 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
11325 | * @returns {google.cloud.speech.v1p1beta1.PhraseSet.Phrase} Phrase
|
11326 | * @throws {Error} If the payload is not a reader or valid buffer
|
11327 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
11328 | */
|
11329 | Phrase.decodeDelimited = function decodeDelimited(reader) {
|
11330 | if (!(reader instanceof $Reader))
|
11331 | reader = new $Reader(reader);
|
11332 | return this.decode(reader, reader.uint32());
|
11333 | };
|
11334 |
|
11335 | /**
|
11336 | * Verifies a Phrase message.
|
11337 | * @function verify
|
11338 | * @memberof google.cloud.speech.v1p1beta1.PhraseSet.Phrase
|
11339 | * @static
|
11340 | * @param {Object.<string,*>} message Plain object to verify
|
11341 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
11342 | */
|
11343 | Phrase.verify = function verify(message) {
|
11344 | if (typeof message !== "object" || message === null)
|
11345 | return "object expected";
|
11346 | if (message.value != null && message.hasOwnProperty("value"))
|
11347 | if (!$util.isString(message.value))
|
11348 | return "value: string expected";
|
11349 | if (message.boost != null && message.hasOwnProperty("boost"))
|
11350 | if (typeof message.boost !== "number")
|
11351 | return "boost: number expected";
|
11352 | return null;
|
11353 | };
|
11354 |
|
11355 | /**
|
11356 | * Creates a Phrase message from a plain object. Also converts values to their respective internal types.
|
11357 | * @function fromObject
|
11358 | * @memberof google.cloud.speech.v1p1beta1.PhraseSet.Phrase
|
11359 | * @static
|
11360 | * @param {Object.<string,*>} object Plain object
|
11361 | * @returns {google.cloud.speech.v1p1beta1.PhraseSet.Phrase} Phrase
|
11362 | */
|
11363 | Phrase.fromObject = function fromObject(object) {
|
11364 | if (object instanceof $root.google.cloud.speech.v1p1beta1.PhraseSet.Phrase)
|
11365 | return object;
|
11366 | var message = new $root.google.cloud.speech.v1p1beta1.PhraseSet.Phrase();
|
11367 | if (object.value != null)
|
11368 | message.value = String(object.value);
|
11369 | if (object.boost != null)
|
11370 | message.boost = Number(object.boost);
|
11371 | return message;
|
11372 | };
|
11373 |
|
11374 | /**
|
11375 | * Creates a plain object from a Phrase message. Also converts values to other types if specified.
|
11376 | * @function toObject
|
11377 | * @memberof google.cloud.speech.v1p1beta1.PhraseSet.Phrase
|
11378 | * @static
|
11379 | * @param {google.cloud.speech.v1p1beta1.PhraseSet.Phrase} message Phrase
|
11380 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
11381 | * @returns {Object.<string,*>} Plain object
|
11382 | */
|
11383 | Phrase.toObject = function toObject(message, options) {
|
11384 | if (!options)
|
11385 | options = {};
|
11386 | var object = {};
|
11387 | if (options.defaults) {
|
11388 | object.value = "";
|
11389 | object.boost = 0;
|
11390 | }
|
11391 | if (message.value != null && message.hasOwnProperty("value"))
|
11392 | object.value = message.value;
|
11393 | if (message.boost != null && message.hasOwnProperty("boost"))
|
11394 | object.boost = options.json && !isFinite(message.boost) ? String(message.boost) : message.boost;
|
11395 | return object;
|
11396 | };
|
11397 |
|
11398 | /**
|
11399 | * Converts this Phrase to JSON.
|
11400 | * @function toJSON
|
11401 | * @memberof google.cloud.speech.v1p1beta1.PhraseSet.Phrase
|
11402 | * @instance
|
11403 | * @returns {Object.<string,*>} JSON object
|
11404 | */
|
11405 | Phrase.prototype.toJSON = function toJSON() {
|
11406 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
11407 | };
|
11408 |
|
11409 | return Phrase;
|
11410 | })();
|
11411 |
|
11412 | return PhraseSet;
|
11413 | })();
|
11414 |
|
11415 | v1p1beta1.SpeechAdaptation = (function() {
|
11416 |
|
11417 | /**
|
11418 | * Properties of a SpeechAdaptation.
|
11419 | * @memberof google.cloud.speech.v1p1beta1
|
11420 | * @interface ISpeechAdaptation
|
11421 | * @property {Array.<google.cloud.speech.v1p1beta1.IPhraseSet>|null} [phraseSets] SpeechAdaptation phraseSets
|
11422 | * @property {Array.<string>|null} [phraseSetReferences] SpeechAdaptation phraseSetReferences
|
11423 | * @property {Array.<google.cloud.speech.v1p1beta1.ICustomClass>|null} [customClasses] SpeechAdaptation customClasses
|
11424 | */
|
11425 |
|
11426 | /**
|
11427 | * Constructs a new SpeechAdaptation.
|
11428 | * @memberof google.cloud.speech.v1p1beta1
|
11429 | * @classdesc Represents a SpeechAdaptation.
|
11430 | * @implements ISpeechAdaptation
|
11431 | * @constructor
|
11432 | * @param {google.cloud.speech.v1p1beta1.ISpeechAdaptation=} [properties] Properties to set
|
11433 | */
|
11434 | function SpeechAdaptation(properties) {
|
11435 | this.phraseSets = [];
|
11436 | this.phraseSetReferences = [];
|
11437 | this.customClasses = [];
|
11438 | if (properties)
|
11439 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
11440 | if (properties[keys[i]] != null)
|
11441 | this[keys[i]] = properties[keys[i]];
|
11442 | }
|
11443 |
|
11444 | /**
|
11445 | * SpeechAdaptation phraseSets.
|
11446 | * @member {Array.<google.cloud.speech.v1p1beta1.IPhraseSet>} phraseSets
|
11447 | * @memberof google.cloud.speech.v1p1beta1.SpeechAdaptation
|
11448 | * @instance
|
11449 | */
|
11450 | SpeechAdaptation.prototype.phraseSets = $util.emptyArray;
|
11451 |
|
11452 | /**
|
11453 | * SpeechAdaptation phraseSetReferences.
|
11454 | * @member {Array.<string>} phraseSetReferences
|
11455 | * @memberof google.cloud.speech.v1p1beta1.SpeechAdaptation
|
11456 | * @instance
|
11457 | */
|
11458 | SpeechAdaptation.prototype.phraseSetReferences = $util.emptyArray;
|
11459 |
|
11460 | /**
|
11461 | * SpeechAdaptation customClasses.
|
11462 | * @member {Array.<google.cloud.speech.v1p1beta1.ICustomClass>} customClasses
|
11463 | * @memberof google.cloud.speech.v1p1beta1.SpeechAdaptation
|
11464 | * @instance
|
11465 | */
|
11466 | SpeechAdaptation.prototype.customClasses = $util.emptyArray;
|
11467 |
|
11468 | /**
|
11469 | * Creates a new SpeechAdaptation instance using the specified properties.
|
11470 | * @function create
|
11471 | * @memberof google.cloud.speech.v1p1beta1.SpeechAdaptation
|
11472 | * @static
|
11473 | * @param {google.cloud.speech.v1p1beta1.ISpeechAdaptation=} [properties] Properties to set
|
11474 | * @returns {google.cloud.speech.v1p1beta1.SpeechAdaptation} SpeechAdaptation instance
|
11475 | */
|
11476 | SpeechAdaptation.create = function create(properties) {
|
11477 | return new SpeechAdaptation(properties);
|
11478 | };
|
11479 |
|
11480 | /**
|
11481 | * Encodes the specified SpeechAdaptation message. Does not implicitly {@link google.cloud.speech.v1p1beta1.SpeechAdaptation.verify|verify} messages.
|
11482 | * @function encode
|
11483 | * @memberof google.cloud.speech.v1p1beta1.SpeechAdaptation
|
11484 | * @static
|
11485 | * @param {google.cloud.speech.v1p1beta1.ISpeechAdaptation} message SpeechAdaptation message or plain object to encode
|
11486 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
11487 | * @returns {$protobuf.Writer} Writer
|
11488 | */
|
11489 | SpeechAdaptation.encode = function encode(message, writer) {
|
11490 | if (!writer)
|
11491 | writer = $Writer.create();
|
11492 | if (message.phraseSets != null && message.phraseSets.length)
|
11493 | for (var i = 0; i < message.phraseSets.length; ++i)
|
11494 | $root.google.cloud.speech.v1p1beta1.PhraseSet.encode(message.phraseSets[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
11495 | if (message.phraseSetReferences != null && message.phraseSetReferences.length)
|
11496 | for (var i = 0; i < message.phraseSetReferences.length; ++i)
|
11497 | writer.uint32(/* id 2, wireType 2 =*/18).string(message.phraseSetReferences[i]);
|
11498 | if (message.customClasses != null && message.customClasses.length)
|
11499 | for (var i = 0; i < message.customClasses.length; ++i)
|
11500 | $root.google.cloud.speech.v1p1beta1.CustomClass.encode(message.customClasses[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
|
11501 | return writer;
|
11502 | };
|
11503 |
|
11504 | /**
|
11505 | * Encodes the specified SpeechAdaptation message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.SpeechAdaptation.verify|verify} messages.
|
11506 | * @function encodeDelimited
|
11507 | * @memberof google.cloud.speech.v1p1beta1.SpeechAdaptation
|
11508 | * @static
|
11509 | * @param {google.cloud.speech.v1p1beta1.ISpeechAdaptation} message SpeechAdaptation message or plain object to encode
|
11510 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
11511 | * @returns {$protobuf.Writer} Writer
|
11512 | */
|
11513 | SpeechAdaptation.encodeDelimited = function encodeDelimited(message, writer) {
|
11514 | return this.encode(message, writer).ldelim();
|
11515 | };
|
11516 |
|
11517 | /**
|
11518 | * Decodes a SpeechAdaptation message from the specified reader or buffer.
|
11519 | * @function decode
|
11520 | * @memberof google.cloud.speech.v1p1beta1.SpeechAdaptation
|
11521 | * @static
|
11522 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
11523 | * @param {number} [length] Message length if known beforehand
|
11524 | * @returns {google.cloud.speech.v1p1beta1.SpeechAdaptation} SpeechAdaptation
|
11525 | * @throws {Error} If the payload is not a reader or valid buffer
|
11526 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
11527 | */
|
11528 | SpeechAdaptation.decode = function decode(reader, length) {
|
11529 | if (!(reader instanceof $Reader))
|
11530 | reader = $Reader.create(reader);
|
11531 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.SpeechAdaptation();
|
11532 | while (reader.pos < end) {
|
11533 | var tag = reader.uint32();
|
11534 | switch (tag >>> 3) {
|
11535 | case 1:
|
11536 | if (!(message.phraseSets && message.phraseSets.length))
|
11537 | message.phraseSets = [];
|
11538 | message.phraseSets.push($root.google.cloud.speech.v1p1beta1.PhraseSet.decode(reader, reader.uint32()));
|
11539 | break;
|
11540 | case 2:
|
11541 | if (!(message.phraseSetReferences && message.phraseSetReferences.length))
|
11542 | message.phraseSetReferences = [];
|
11543 | message.phraseSetReferences.push(reader.string());
|
11544 | break;
|
11545 | case 3:
|
11546 | if (!(message.customClasses && message.customClasses.length))
|
11547 | message.customClasses = [];
|
11548 | message.customClasses.push($root.google.cloud.speech.v1p1beta1.CustomClass.decode(reader, reader.uint32()));
|
11549 | break;
|
11550 | default:
|
11551 | reader.skipType(tag & 7);
|
11552 | break;
|
11553 | }
|
11554 | }
|
11555 | return message;
|
11556 | };
|
11557 |
|
11558 | /**
|
11559 | * Decodes a SpeechAdaptation message from the specified reader or buffer, length delimited.
|
11560 | * @function decodeDelimited
|
11561 | * @memberof google.cloud.speech.v1p1beta1.SpeechAdaptation
|
11562 | * @static
|
11563 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
11564 | * @returns {google.cloud.speech.v1p1beta1.SpeechAdaptation} SpeechAdaptation
|
11565 | * @throws {Error} If the payload is not a reader or valid buffer
|
11566 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
11567 | */
|
11568 | SpeechAdaptation.decodeDelimited = function decodeDelimited(reader) {
|
11569 | if (!(reader instanceof $Reader))
|
11570 | reader = new $Reader(reader);
|
11571 | return this.decode(reader, reader.uint32());
|
11572 | };
|
11573 |
|
11574 | /**
|
11575 | * Verifies a SpeechAdaptation message.
|
11576 | * @function verify
|
11577 | * @memberof google.cloud.speech.v1p1beta1.SpeechAdaptation
|
11578 | * @static
|
11579 | * @param {Object.<string,*>} message Plain object to verify
|
11580 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
11581 | */
|
11582 | SpeechAdaptation.verify = function verify(message) {
|
11583 | if (typeof message !== "object" || message === null)
|
11584 | return "object expected";
|
11585 | if (message.phraseSets != null && message.hasOwnProperty("phraseSets")) {
|
11586 | if (!Array.isArray(message.phraseSets))
|
11587 | return "phraseSets: array expected";
|
11588 | for (var i = 0; i < message.phraseSets.length; ++i) {
|
11589 | var error = $root.google.cloud.speech.v1p1beta1.PhraseSet.verify(message.phraseSets[i]);
|
11590 | if (error)
|
11591 | return "phraseSets." + error;
|
11592 | }
|
11593 | }
|
11594 | if (message.phraseSetReferences != null && message.hasOwnProperty("phraseSetReferences")) {
|
11595 | if (!Array.isArray(message.phraseSetReferences))
|
11596 | return "phraseSetReferences: array expected";
|
11597 | for (var i = 0; i < message.phraseSetReferences.length; ++i)
|
11598 | if (!$util.isString(message.phraseSetReferences[i]))
|
11599 | return "phraseSetReferences: string[] expected";
|
11600 | }
|
11601 | if (message.customClasses != null && message.hasOwnProperty("customClasses")) {
|
11602 | if (!Array.isArray(message.customClasses))
|
11603 | return "customClasses: array expected";
|
11604 | for (var i = 0; i < message.customClasses.length; ++i) {
|
11605 | var error = $root.google.cloud.speech.v1p1beta1.CustomClass.verify(message.customClasses[i]);
|
11606 | if (error)
|
11607 | return "customClasses." + error;
|
11608 | }
|
11609 | }
|
11610 | return null;
|
11611 | };
|
11612 |
|
11613 | /**
|
11614 | * Creates a SpeechAdaptation message from a plain object. Also converts values to their respective internal types.
|
11615 | * @function fromObject
|
11616 | * @memberof google.cloud.speech.v1p1beta1.SpeechAdaptation
|
11617 | * @static
|
11618 | * @param {Object.<string,*>} object Plain object
|
11619 | * @returns {google.cloud.speech.v1p1beta1.SpeechAdaptation} SpeechAdaptation
|
11620 | */
|
11621 | SpeechAdaptation.fromObject = function fromObject(object) {
|
11622 | if (object instanceof $root.google.cloud.speech.v1p1beta1.SpeechAdaptation)
|
11623 | return object;
|
11624 | var message = new $root.google.cloud.speech.v1p1beta1.SpeechAdaptation();
|
11625 | if (object.phraseSets) {
|
11626 | if (!Array.isArray(object.phraseSets))
|
11627 | throw TypeError(".google.cloud.speech.v1p1beta1.SpeechAdaptation.phraseSets: array expected");
|
11628 | message.phraseSets = [];
|
11629 | for (var i = 0; i < object.phraseSets.length; ++i) {
|
11630 | if (typeof object.phraseSets[i] !== "object")
|
11631 | throw TypeError(".google.cloud.speech.v1p1beta1.SpeechAdaptation.phraseSets: object expected");
|
11632 | message.phraseSets[i] = $root.google.cloud.speech.v1p1beta1.PhraseSet.fromObject(object.phraseSets[i]);
|
11633 | }
|
11634 | }
|
11635 | if (object.phraseSetReferences) {
|
11636 | if (!Array.isArray(object.phraseSetReferences))
|
11637 | throw TypeError(".google.cloud.speech.v1p1beta1.SpeechAdaptation.phraseSetReferences: array expected");
|
11638 | message.phraseSetReferences = [];
|
11639 | for (var i = 0; i < object.phraseSetReferences.length; ++i)
|
11640 | message.phraseSetReferences[i] = String(object.phraseSetReferences[i]);
|
11641 | }
|
11642 | if (object.customClasses) {
|
11643 | if (!Array.isArray(object.customClasses))
|
11644 | throw TypeError(".google.cloud.speech.v1p1beta1.SpeechAdaptation.customClasses: array expected");
|
11645 | message.customClasses = [];
|
11646 | for (var i = 0; i < object.customClasses.length; ++i) {
|
11647 | if (typeof object.customClasses[i] !== "object")
|
11648 | throw TypeError(".google.cloud.speech.v1p1beta1.SpeechAdaptation.customClasses: object expected");
|
11649 | message.customClasses[i] = $root.google.cloud.speech.v1p1beta1.CustomClass.fromObject(object.customClasses[i]);
|
11650 | }
|
11651 | }
|
11652 | return message;
|
11653 | };
|
11654 |
|
11655 | /**
|
11656 | * Creates a plain object from a SpeechAdaptation message. Also converts values to other types if specified.
|
11657 | * @function toObject
|
11658 | * @memberof google.cloud.speech.v1p1beta1.SpeechAdaptation
|
11659 | * @static
|
11660 | * @param {google.cloud.speech.v1p1beta1.SpeechAdaptation} message SpeechAdaptation
|
11661 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
11662 | * @returns {Object.<string,*>} Plain object
|
11663 | */
|
11664 | SpeechAdaptation.toObject = function toObject(message, options) {
|
11665 | if (!options)
|
11666 | options = {};
|
11667 | var object = {};
|
11668 | if (options.arrays || options.defaults) {
|
11669 | object.phraseSets = [];
|
11670 | object.phraseSetReferences = [];
|
11671 | object.customClasses = [];
|
11672 | }
|
11673 | if (message.phraseSets && message.phraseSets.length) {
|
11674 | object.phraseSets = [];
|
11675 | for (var j = 0; j < message.phraseSets.length; ++j)
|
11676 | object.phraseSets[j] = $root.google.cloud.speech.v1p1beta1.PhraseSet.toObject(message.phraseSets[j], options);
|
11677 | }
|
11678 | if (message.phraseSetReferences && message.phraseSetReferences.length) {
|
11679 | object.phraseSetReferences = [];
|
11680 | for (var j = 0; j < message.phraseSetReferences.length; ++j)
|
11681 | object.phraseSetReferences[j] = message.phraseSetReferences[j];
|
11682 | }
|
11683 | if (message.customClasses && message.customClasses.length) {
|
11684 | object.customClasses = [];
|
11685 | for (var j = 0; j < message.customClasses.length; ++j)
|
11686 | object.customClasses[j] = $root.google.cloud.speech.v1p1beta1.CustomClass.toObject(message.customClasses[j], options);
|
11687 | }
|
11688 | return object;
|
11689 | };
|
11690 |
|
11691 | /**
|
11692 | * Converts this SpeechAdaptation to JSON.
|
11693 | * @function toJSON
|
11694 | * @memberof google.cloud.speech.v1p1beta1.SpeechAdaptation
|
11695 | * @instance
|
11696 | * @returns {Object.<string,*>} JSON object
|
11697 | */
|
11698 | SpeechAdaptation.prototype.toJSON = function toJSON() {
|
11699 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
11700 | };
|
11701 |
|
11702 | return SpeechAdaptation;
|
11703 | })();
|
11704 |
|
11705 | v1p1beta1.Adaptation = (function() {
|
11706 |
|
11707 | /**
|
11708 | * Constructs a new Adaptation service.
|
11709 | * @memberof google.cloud.speech.v1p1beta1
|
11710 | * @classdesc Represents an Adaptation
|
11711 | * @extends $protobuf.rpc.Service
|
11712 | * @constructor
|
11713 | * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
|
11714 | * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
|
11715 | * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
|
11716 | */
|
11717 | function Adaptation(rpcImpl, requestDelimited, responseDelimited) {
|
11718 | $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);
|
11719 | }
|
11720 |
|
11721 | (Adaptation.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Adaptation;
|
11722 |
|
11723 | /**
|
11724 | * Creates new Adaptation service using the specified rpc implementation.
|
11725 | * @function create
|
11726 | * @memberof google.cloud.speech.v1p1beta1.Adaptation
|
11727 | * @static
|
11728 | * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
|
11729 | * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
|
11730 | * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
|
11731 | * @returns {Adaptation} RPC service. Useful where requests and/or responses are streamed.
|
11732 | */
|
11733 | Adaptation.create = function create(rpcImpl, requestDelimited, responseDelimited) {
|
11734 | return new this(rpcImpl, requestDelimited, responseDelimited);
|
11735 | };
|
11736 |
|
11737 | /**
|
11738 | * Callback as used by {@link google.cloud.speech.v1p1beta1.Adaptation#createPhraseSet}.
|
11739 | * @memberof google.cloud.speech.v1p1beta1.Adaptation
|
11740 | * @typedef CreatePhraseSetCallback
|
11741 | * @type {function}
|
11742 | * @param {Error|null} error Error, if any
|
11743 | * @param {google.cloud.speech.v1p1beta1.PhraseSet} [response] PhraseSet
|
11744 | */
|
11745 |
|
11746 | /**
|
11747 | * Calls CreatePhraseSet.
|
11748 | * @function createPhraseSet
|
11749 | * @memberof google.cloud.speech.v1p1beta1.Adaptation
|
11750 | * @instance
|
11751 | * @param {google.cloud.speech.v1p1beta1.ICreatePhraseSetRequest} request CreatePhraseSetRequest message or plain object
|
11752 | * @param {google.cloud.speech.v1p1beta1.Adaptation.CreatePhraseSetCallback} callback Node-style callback called with the error, if any, and PhraseSet
|
11753 | * @returns {undefined}
|
11754 | * @variation 1
|
11755 | */
|
11756 | Object.defineProperty(Adaptation.prototype.createPhraseSet = function createPhraseSet(request, callback) {
|
11757 | return this.rpcCall(createPhraseSet, $root.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest, $root.google.cloud.speech.v1p1beta1.PhraseSet, request, callback);
|
11758 | }, "name", { value: "CreatePhraseSet" });
|
11759 |
|
11760 | /**
|
11761 | * Calls CreatePhraseSet.
|
11762 | * @function createPhraseSet
|
11763 | * @memberof google.cloud.speech.v1p1beta1.Adaptation
|
11764 | * @instance
|
11765 | * @param {google.cloud.speech.v1p1beta1.ICreatePhraseSetRequest} request CreatePhraseSetRequest message or plain object
|
11766 | * @returns {Promise<google.cloud.speech.v1p1beta1.PhraseSet>} Promise
|
11767 | * @variation 2
|
11768 | */
|
11769 |
|
11770 | /**
|
11771 | * Callback as used by {@link google.cloud.speech.v1p1beta1.Adaptation#getPhraseSet}.
|
11772 | * @memberof google.cloud.speech.v1p1beta1.Adaptation
|
11773 | * @typedef GetPhraseSetCallback
|
11774 | * @type {function}
|
11775 | * @param {Error|null} error Error, if any
|
11776 | * @param {google.cloud.speech.v1p1beta1.PhraseSet} [response] PhraseSet
|
11777 | */
|
11778 |
|
11779 | /**
|
11780 | * Calls GetPhraseSet.
|
11781 | * @function getPhraseSet
|
11782 | * @memberof google.cloud.speech.v1p1beta1.Adaptation
|
11783 | * @instance
|
11784 | * @param {google.cloud.speech.v1p1beta1.IGetPhraseSetRequest} request GetPhraseSetRequest message or plain object
|
11785 | * @param {google.cloud.speech.v1p1beta1.Adaptation.GetPhraseSetCallback} callback Node-style callback called with the error, if any, and PhraseSet
|
11786 | * @returns {undefined}
|
11787 | * @variation 1
|
11788 | */
|
11789 | Object.defineProperty(Adaptation.prototype.getPhraseSet = function getPhraseSet(request, callback) {
|
11790 | return this.rpcCall(getPhraseSet, $root.google.cloud.speech.v1p1beta1.GetPhraseSetRequest, $root.google.cloud.speech.v1p1beta1.PhraseSet, request, callback);
|
11791 | }, "name", { value: "GetPhraseSet" });
|
11792 |
|
11793 | /**
|
11794 | * Calls GetPhraseSet.
|
11795 | * @function getPhraseSet
|
11796 | * @memberof google.cloud.speech.v1p1beta1.Adaptation
|
11797 | * @instance
|
11798 | * @param {google.cloud.speech.v1p1beta1.IGetPhraseSetRequest} request GetPhraseSetRequest message or plain object
|
11799 | * @returns {Promise<google.cloud.speech.v1p1beta1.PhraseSet>} Promise
|
11800 | * @variation 2
|
11801 | */
|
11802 |
|
11803 | /**
|
11804 | * Callback as used by {@link google.cloud.speech.v1p1beta1.Adaptation#listPhraseSet}.
|
11805 | * @memberof google.cloud.speech.v1p1beta1.Adaptation
|
11806 | * @typedef ListPhraseSetCallback
|
11807 | * @type {function}
|
11808 | * @param {Error|null} error Error, if any
|
11809 | * @param {google.cloud.speech.v1p1beta1.ListPhraseSetResponse} [response] ListPhraseSetResponse
|
11810 | */
|
11811 |
|
11812 | /**
|
11813 | * Calls ListPhraseSet.
|
11814 | * @function listPhraseSet
|
11815 | * @memberof google.cloud.speech.v1p1beta1.Adaptation
|
11816 | * @instance
|
11817 | * @param {google.cloud.speech.v1p1beta1.IListPhraseSetRequest} request ListPhraseSetRequest message or plain object
|
11818 | * @param {google.cloud.speech.v1p1beta1.Adaptation.ListPhraseSetCallback} callback Node-style callback called with the error, if any, and ListPhraseSetResponse
|
11819 | * @returns {undefined}
|
11820 | * @variation 1
|
11821 | */
|
11822 | Object.defineProperty(Adaptation.prototype.listPhraseSet = function listPhraseSet(request, callback) {
|
11823 | return this.rpcCall(listPhraseSet, $root.google.cloud.speech.v1p1beta1.ListPhraseSetRequest, $root.google.cloud.speech.v1p1beta1.ListPhraseSetResponse, request, callback);
|
11824 | }, "name", { value: "ListPhraseSet" });
|
11825 |
|
11826 | /**
|
11827 | * Calls ListPhraseSet.
|
11828 | * @function listPhraseSet
|
11829 | * @memberof google.cloud.speech.v1p1beta1.Adaptation
|
11830 | * @instance
|
11831 | * @param {google.cloud.speech.v1p1beta1.IListPhraseSetRequest} request ListPhraseSetRequest message or plain object
|
11832 | * @returns {Promise<google.cloud.speech.v1p1beta1.ListPhraseSetResponse>} Promise
|
11833 | * @variation 2
|
11834 | */
|
11835 |
|
11836 | /**
|
11837 | * Callback as used by {@link google.cloud.speech.v1p1beta1.Adaptation#updatePhraseSet}.
|
11838 | * @memberof google.cloud.speech.v1p1beta1.Adaptation
|
11839 | * @typedef UpdatePhraseSetCallback
|
11840 | * @type {function}
|
11841 | * @param {Error|null} error Error, if any
|
11842 | * @param {google.cloud.speech.v1p1beta1.PhraseSet} [response] PhraseSet
|
11843 | */
|
11844 |
|
11845 | /**
|
11846 | * Calls UpdatePhraseSet.
|
11847 | * @function updatePhraseSet
|
11848 | * @memberof google.cloud.speech.v1p1beta1.Adaptation
|
11849 | * @instance
|
11850 | * @param {google.cloud.speech.v1p1beta1.IUpdatePhraseSetRequest} request UpdatePhraseSetRequest message or plain object
|
11851 | * @param {google.cloud.speech.v1p1beta1.Adaptation.UpdatePhraseSetCallback} callback Node-style callback called with the error, if any, and PhraseSet
|
11852 | * @returns {undefined}
|
11853 | * @variation 1
|
11854 | */
|
11855 | Object.defineProperty(Adaptation.prototype.updatePhraseSet = function updatePhraseSet(request, callback) {
|
11856 | return this.rpcCall(updatePhraseSet, $root.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest, $root.google.cloud.speech.v1p1beta1.PhraseSet, request, callback);
|
11857 | }, "name", { value: "UpdatePhraseSet" });
|
11858 |
|
11859 | /**
|
11860 | * Calls UpdatePhraseSet.
|
11861 | * @function updatePhraseSet
|
11862 | * @memberof google.cloud.speech.v1p1beta1.Adaptation
|
11863 | * @instance
|
11864 | * @param {google.cloud.speech.v1p1beta1.IUpdatePhraseSetRequest} request UpdatePhraseSetRequest message or plain object
|
11865 | * @returns {Promise<google.cloud.speech.v1p1beta1.PhraseSet>} Promise
|
11866 | * @variation 2
|
11867 | */
|
11868 |
|
11869 | /**
|
11870 | * Callback as used by {@link google.cloud.speech.v1p1beta1.Adaptation#deletePhraseSet}.
|
11871 | * @memberof google.cloud.speech.v1p1beta1.Adaptation
|
11872 | * @typedef DeletePhraseSetCallback
|
11873 | * @type {function}
|
11874 | * @param {Error|null} error Error, if any
|
11875 | * @param {google.protobuf.Empty} [response] Empty
|
11876 | */
|
11877 |
|
11878 | /**
|
11879 | * Calls DeletePhraseSet.
|
11880 | * @function deletePhraseSet
|
11881 | * @memberof google.cloud.speech.v1p1beta1.Adaptation
|
11882 | * @instance
|
11883 | * @param {google.cloud.speech.v1p1beta1.IDeletePhraseSetRequest} request DeletePhraseSetRequest message or plain object
|
11884 | * @param {google.cloud.speech.v1p1beta1.Adaptation.DeletePhraseSetCallback} callback Node-style callback called with the error, if any, and Empty
|
11885 | * @returns {undefined}
|
11886 | * @variation 1
|
11887 | */
|
11888 | Object.defineProperty(Adaptation.prototype.deletePhraseSet = function deletePhraseSet(request, callback) {
|
11889 | return this.rpcCall(deletePhraseSet, $root.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest, $root.google.protobuf.Empty, request, callback);
|
11890 | }, "name", { value: "DeletePhraseSet" });
|
11891 |
|
11892 | /**
|
11893 | * Calls DeletePhraseSet.
|
11894 | * @function deletePhraseSet
|
11895 | * @memberof google.cloud.speech.v1p1beta1.Adaptation
|
11896 | * @instance
|
11897 | * @param {google.cloud.speech.v1p1beta1.IDeletePhraseSetRequest} request DeletePhraseSetRequest message or plain object
|
11898 | * @returns {Promise<google.protobuf.Empty>} Promise
|
11899 | * @variation 2
|
11900 | */
|
11901 |
|
11902 | /**
|
11903 | * Callback as used by {@link google.cloud.speech.v1p1beta1.Adaptation#createCustomClass}.
|
11904 | * @memberof google.cloud.speech.v1p1beta1.Adaptation
|
11905 | * @typedef CreateCustomClassCallback
|
11906 | * @type {function}
|
11907 | * @param {Error|null} error Error, if any
|
11908 | * @param {google.cloud.speech.v1p1beta1.CustomClass} [response] CustomClass
|
11909 | */
|
11910 |
|
11911 | /**
|
11912 | * Calls CreateCustomClass.
|
11913 | * @function createCustomClass
|
11914 | * @memberof google.cloud.speech.v1p1beta1.Adaptation
|
11915 | * @instance
|
11916 | * @param {google.cloud.speech.v1p1beta1.ICreateCustomClassRequest} request CreateCustomClassRequest message or plain object
|
11917 | * @param {google.cloud.speech.v1p1beta1.Adaptation.CreateCustomClassCallback} callback Node-style callback called with the error, if any, and CustomClass
|
11918 | * @returns {undefined}
|
11919 | * @variation 1
|
11920 | */
|
11921 | Object.defineProperty(Adaptation.prototype.createCustomClass = function createCustomClass(request, callback) {
|
11922 | return this.rpcCall(createCustomClass, $root.google.cloud.speech.v1p1beta1.CreateCustomClassRequest, $root.google.cloud.speech.v1p1beta1.CustomClass, request, callback);
|
11923 | }, "name", { value: "CreateCustomClass" });
|
11924 |
|
11925 | /**
|
11926 | * Calls CreateCustomClass.
|
11927 | * @function createCustomClass
|
11928 | * @memberof google.cloud.speech.v1p1beta1.Adaptation
|
11929 | * @instance
|
11930 | * @param {google.cloud.speech.v1p1beta1.ICreateCustomClassRequest} request CreateCustomClassRequest message or plain object
|
11931 | * @returns {Promise<google.cloud.speech.v1p1beta1.CustomClass>} Promise
|
11932 | * @variation 2
|
11933 | */
|
11934 |
|
11935 | /**
|
11936 | * Callback as used by {@link google.cloud.speech.v1p1beta1.Adaptation#getCustomClass}.
|
11937 | * @memberof google.cloud.speech.v1p1beta1.Adaptation
|
11938 | * @typedef GetCustomClassCallback
|
11939 | * @type {function}
|
11940 | * @param {Error|null} error Error, if any
|
11941 | * @param {google.cloud.speech.v1p1beta1.CustomClass} [response] CustomClass
|
11942 | */
|
11943 |
|
11944 | /**
|
11945 | * Calls GetCustomClass.
|
11946 | * @function getCustomClass
|
11947 | * @memberof google.cloud.speech.v1p1beta1.Adaptation
|
11948 | * @instance
|
11949 | * @param {google.cloud.speech.v1p1beta1.IGetCustomClassRequest} request GetCustomClassRequest message or plain object
|
11950 | * @param {google.cloud.speech.v1p1beta1.Adaptation.GetCustomClassCallback} callback Node-style callback called with the error, if any, and CustomClass
|
11951 | * @returns {undefined}
|
11952 | * @variation 1
|
11953 | */
|
11954 | Object.defineProperty(Adaptation.prototype.getCustomClass = function getCustomClass(request, callback) {
|
11955 | return this.rpcCall(getCustomClass, $root.google.cloud.speech.v1p1beta1.GetCustomClassRequest, $root.google.cloud.speech.v1p1beta1.CustomClass, request, callback);
|
11956 | }, "name", { value: "GetCustomClass" });
|
11957 |
|
11958 | /**
|
11959 | * Calls GetCustomClass.
|
11960 | * @function getCustomClass
|
11961 | * @memberof google.cloud.speech.v1p1beta1.Adaptation
|
11962 | * @instance
|
11963 | * @param {google.cloud.speech.v1p1beta1.IGetCustomClassRequest} request GetCustomClassRequest message or plain object
|
11964 | * @returns {Promise<google.cloud.speech.v1p1beta1.CustomClass>} Promise
|
11965 | * @variation 2
|
11966 | */
|
11967 |
|
11968 | /**
|
11969 | * Callback as used by {@link google.cloud.speech.v1p1beta1.Adaptation#listCustomClasses}.
|
11970 | * @memberof google.cloud.speech.v1p1beta1.Adaptation
|
11971 | * @typedef ListCustomClassesCallback
|
11972 | * @type {function}
|
11973 | * @param {Error|null} error Error, if any
|
11974 | * @param {google.cloud.speech.v1p1beta1.ListCustomClassesResponse} [response] ListCustomClassesResponse
|
11975 | */
|
11976 |
|
11977 | /**
|
11978 | * Calls ListCustomClasses.
|
11979 | * @function listCustomClasses
|
11980 | * @memberof google.cloud.speech.v1p1beta1.Adaptation
|
11981 | * @instance
|
11982 | * @param {google.cloud.speech.v1p1beta1.IListCustomClassesRequest} request ListCustomClassesRequest message or plain object
|
11983 | * @param {google.cloud.speech.v1p1beta1.Adaptation.ListCustomClassesCallback} callback Node-style callback called with the error, if any, and ListCustomClassesResponse
|
11984 | * @returns {undefined}
|
11985 | * @variation 1
|
11986 | */
|
11987 | Object.defineProperty(Adaptation.prototype.listCustomClasses = function listCustomClasses(request, callback) {
|
11988 | return this.rpcCall(listCustomClasses, $root.google.cloud.speech.v1p1beta1.ListCustomClassesRequest, $root.google.cloud.speech.v1p1beta1.ListCustomClassesResponse, request, callback);
|
11989 | }, "name", { value: "ListCustomClasses" });
|
11990 |
|
11991 | /**
|
11992 | * Calls ListCustomClasses.
|
11993 | * @function listCustomClasses
|
11994 | * @memberof google.cloud.speech.v1p1beta1.Adaptation
|
11995 | * @instance
|
11996 | * @param {google.cloud.speech.v1p1beta1.IListCustomClassesRequest} request ListCustomClassesRequest message or plain object
|
11997 | * @returns {Promise<google.cloud.speech.v1p1beta1.ListCustomClassesResponse>} Promise
|
11998 | * @variation 2
|
11999 | */
|
12000 |
|
12001 | /**
|
12002 | * Callback as used by {@link google.cloud.speech.v1p1beta1.Adaptation#updateCustomClass}.
|
12003 | * @memberof google.cloud.speech.v1p1beta1.Adaptation
|
12004 | * @typedef UpdateCustomClassCallback
|
12005 | * @type {function}
|
12006 | * @param {Error|null} error Error, if any
|
12007 | * @param {google.cloud.speech.v1p1beta1.CustomClass} [response] CustomClass
|
12008 | */
|
12009 |
|
12010 | /**
|
12011 | * Calls UpdateCustomClass.
|
12012 | * @function updateCustomClass
|
12013 | * @memberof google.cloud.speech.v1p1beta1.Adaptation
|
12014 | * @instance
|
12015 | * @param {google.cloud.speech.v1p1beta1.IUpdateCustomClassRequest} request UpdateCustomClassRequest message or plain object
|
12016 | * @param {google.cloud.speech.v1p1beta1.Adaptation.UpdateCustomClassCallback} callback Node-style callback called with the error, if any, and CustomClass
|
12017 | * @returns {undefined}
|
12018 | * @variation 1
|
12019 | */
|
12020 | Object.defineProperty(Adaptation.prototype.updateCustomClass = function updateCustomClass(request, callback) {
|
12021 | return this.rpcCall(updateCustomClass, $root.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest, $root.google.cloud.speech.v1p1beta1.CustomClass, request, callback);
|
12022 | }, "name", { value: "UpdateCustomClass" });
|
12023 |
|
12024 | /**
|
12025 | * Calls UpdateCustomClass.
|
12026 | * @function updateCustomClass
|
12027 | * @memberof google.cloud.speech.v1p1beta1.Adaptation
|
12028 | * @instance
|
12029 | * @param {google.cloud.speech.v1p1beta1.IUpdateCustomClassRequest} request UpdateCustomClassRequest message or plain object
|
12030 | * @returns {Promise<google.cloud.speech.v1p1beta1.CustomClass>} Promise
|
12031 | * @variation 2
|
12032 | */
|
12033 |
|
12034 | /**
|
12035 | * Callback as used by {@link google.cloud.speech.v1p1beta1.Adaptation#deleteCustomClass}.
|
12036 | * @memberof google.cloud.speech.v1p1beta1.Adaptation
|
12037 | * @typedef DeleteCustomClassCallback
|
12038 | * @type {function}
|
12039 | * @param {Error|null} error Error, if any
|
12040 | * @param {google.protobuf.Empty} [response] Empty
|
12041 | */
|
12042 |
|
12043 | /**
|
12044 | * Calls DeleteCustomClass.
|
12045 | * @function deleteCustomClass
|
12046 | * @memberof google.cloud.speech.v1p1beta1.Adaptation
|
12047 | * @instance
|
12048 | * @param {google.cloud.speech.v1p1beta1.IDeleteCustomClassRequest} request DeleteCustomClassRequest message or plain object
|
12049 | * @param {google.cloud.speech.v1p1beta1.Adaptation.DeleteCustomClassCallback} callback Node-style callback called with the error, if any, and Empty
|
12050 | * @returns {undefined}
|
12051 | * @variation 1
|
12052 | */
|
12053 | Object.defineProperty(Adaptation.prototype.deleteCustomClass = function deleteCustomClass(request, callback) {
|
12054 | return this.rpcCall(deleteCustomClass, $root.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest, $root.google.protobuf.Empty, request, callback);
|
12055 | }, "name", { value: "DeleteCustomClass" });
|
12056 |
|
12057 | /**
|
12058 | * Calls DeleteCustomClass.
|
12059 | * @function deleteCustomClass
|
12060 | * @memberof google.cloud.speech.v1p1beta1.Adaptation
|
12061 | * @instance
|
12062 | * @param {google.cloud.speech.v1p1beta1.IDeleteCustomClassRequest} request DeleteCustomClassRequest message or plain object
|
12063 | * @returns {Promise<google.protobuf.Empty>} Promise
|
12064 | * @variation 2
|
12065 | */
|
12066 |
|
12067 | return Adaptation;
|
12068 | })();
|
12069 |
|
12070 | v1p1beta1.CreatePhraseSetRequest = (function() {
|
12071 |
|
12072 | /**
|
12073 | * Properties of a CreatePhraseSetRequest.
|
12074 | * @memberof google.cloud.speech.v1p1beta1
|
12075 | * @interface ICreatePhraseSetRequest
|
12076 | * @property {string|null} [parent] CreatePhraseSetRequest parent
|
12077 | * @property {string|null} [phraseSetId] CreatePhraseSetRequest phraseSetId
|
12078 | * @property {google.cloud.speech.v1p1beta1.IPhraseSet|null} [phraseSet] CreatePhraseSetRequest phraseSet
|
12079 | */
|
12080 |
|
12081 | /**
|
12082 | * Constructs a new CreatePhraseSetRequest.
|
12083 | * @memberof google.cloud.speech.v1p1beta1
|
12084 | * @classdesc Represents a CreatePhraseSetRequest.
|
12085 | * @implements ICreatePhraseSetRequest
|
12086 | * @constructor
|
12087 | * @param {google.cloud.speech.v1p1beta1.ICreatePhraseSetRequest=} [properties] Properties to set
|
12088 | */
|
12089 | function CreatePhraseSetRequest(properties) {
|
12090 | if (properties)
|
12091 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
12092 | if (properties[keys[i]] != null)
|
12093 | this[keys[i]] = properties[keys[i]];
|
12094 | }
|
12095 |
|
12096 | /**
|
12097 | * CreatePhraseSetRequest parent.
|
12098 | * @member {string} parent
|
12099 | * @memberof google.cloud.speech.v1p1beta1.CreatePhraseSetRequest
|
12100 | * @instance
|
12101 | */
|
12102 | CreatePhraseSetRequest.prototype.parent = "";
|
12103 |
|
12104 | /**
|
12105 | * CreatePhraseSetRequest phraseSetId.
|
12106 | * @member {string} phraseSetId
|
12107 | * @memberof google.cloud.speech.v1p1beta1.CreatePhraseSetRequest
|
12108 | * @instance
|
12109 | */
|
12110 | CreatePhraseSetRequest.prototype.phraseSetId = "";
|
12111 |
|
12112 | /**
|
12113 | * CreatePhraseSetRequest phraseSet.
|
12114 | * @member {google.cloud.speech.v1p1beta1.IPhraseSet|null|undefined} phraseSet
|
12115 | * @memberof google.cloud.speech.v1p1beta1.CreatePhraseSetRequest
|
12116 | * @instance
|
12117 | */
|
12118 | CreatePhraseSetRequest.prototype.phraseSet = null;
|
12119 |
|
12120 | /**
|
12121 | * Creates a new CreatePhraseSetRequest instance using the specified properties.
|
12122 | * @function create
|
12123 | * @memberof google.cloud.speech.v1p1beta1.CreatePhraseSetRequest
|
12124 | * @static
|
12125 | * @param {google.cloud.speech.v1p1beta1.ICreatePhraseSetRequest=} [properties] Properties to set
|
12126 | * @returns {google.cloud.speech.v1p1beta1.CreatePhraseSetRequest} CreatePhraseSetRequest instance
|
12127 | */
|
12128 | CreatePhraseSetRequest.create = function create(properties) {
|
12129 | return new CreatePhraseSetRequest(properties);
|
12130 | };
|
12131 |
|
12132 | /**
|
12133 | * Encodes the specified CreatePhraseSetRequest message. Does not implicitly {@link google.cloud.speech.v1p1beta1.CreatePhraseSetRequest.verify|verify} messages.
|
12134 | * @function encode
|
12135 | * @memberof google.cloud.speech.v1p1beta1.CreatePhraseSetRequest
|
12136 | * @static
|
12137 | * @param {google.cloud.speech.v1p1beta1.ICreatePhraseSetRequest} message CreatePhraseSetRequest message or plain object to encode
|
12138 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
12139 | * @returns {$protobuf.Writer} Writer
|
12140 | */
|
12141 | CreatePhraseSetRequest.encode = function encode(message, writer) {
|
12142 | if (!writer)
|
12143 | writer = $Writer.create();
|
12144 | if (message.parent != null && Object.hasOwnProperty.call(message, "parent"))
|
12145 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent);
|
12146 | if (message.phraseSetId != null && Object.hasOwnProperty.call(message, "phraseSetId"))
|
12147 | writer.uint32(/* id 2, wireType 2 =*/18).string(message.phraseSetId);
|
12148 | if (message.phraseSet != null && Object.hasOwnProperty.call(message, "phraseSet"))
|
12149 | $root.google.cloud.speech.v1p1beta1.PhraseSet.encode(message.phraseSet, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
|
12150 | return writer;
|
12151 | };
|
12152 |
|
12153 | /**
|
12154 | * Encodes the specified CreatePhraseSetRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.CreatePhraseSetRequest.verify|verify} messages.
|
12155 | * @function encodeDelimited
|
12156 | * @memberof google.cloud.speech.v1p1beta1.CreatePhraseSetRequest
|
12157 | * @static
|
12158 | * @param {google.cloud.speech.v1p1beta1.ICreatePhraseSetRequest} message CreatePhraseSetRequest message or plain object to encode
|
12159 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
12160 | * @returns {$protobuf.Writer} Writer
|
12161 | */
|
12162 | CreatePhraseSetRequest.encodeDelimited = function encodeDelimited(message, writer) {
|
12163 | return this.encode(message, writer).ldelim();
|
12164 | };
|
12165 |
|
12166 | /**
|
12167 | * Decodes a CreatePhraseSetRequest message from the specified reader or buffer.
|
12168 | * @function decode
|
12169 | * @memberof google.cloud.speech.v1p1beta1.CreatePhraseSetRequest
|
12170 | * @static
|
12171 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
12172 | * @param {number} [length] Message length if known beforehand
|
12173 | * @returns {google.cloud.speech.v1p1beta1.CreatePhraseSetRequest} CreatePhraseSetRequest
|
12174 | * @throws {Error} If the payload is not a reader or valid buffer
|
12175 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
12176 | */
|
12177 | CreatePhraseSetRequest.decode = function decode(reader, length) {
|
12178 | if (!(reader instanceof $Reader))
|
12179 | reader = $Reader.create(reader);
|
12180 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest();
|
12181 | while (reader.pos < end) {
|
12182 | var tag = reader.uint32();
|
12183 | switch (tag >>> 3) {
|
12184 | case 1:
|
12185 | message.parent = reader.string();
|
12186 | break;
|
12187 | case 2:
|
12188 | message.phraseSetId = reader.string();
|
12189 | break;
|
12190 | case 3:
|
12191 | message.phraseSet = $root.google.cloud.speech.v1p1beta1.PhraseSet.decode(reader, reader.uint32());
|
12192 | break;
|
12193 | default:
|
12194 | reader.skipType(tag & 7);
|
12195 | break;
|
12196 | }
|
12197 | }
|
12198 | return message;
|
12199 | };
|
12200 |
|
12201 | /**
|
12202 | * Decodes a CreatePhraseSetRequest message from the specified reader or buffer, length delimited.
|
12203 | * @function decodeDelimited
|
12204 | * @memberof google.cloud.speech.v1p1beta1.CreatePhraseSetRequest
|
12205 | * @static
|
12206 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
12207 | * @returns {google.cloud.speech.v1p1beta1.CreatePhraseSetRequest} CreatePhraseSetRequest
|
12208 | * @throws {Error} If the payload is not a reader or valid buffer
|
12209 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
12210 | */
|
12211 | CreatePhraseSetRequest.decodeDelimited = function decodeDelimited(reader) {
|
12212 | if (!(reader instanceof $Reader))
|
12213 | reader = new $Reader(reader);
|
12214 | return this.decode(reader, reader.uint32());
|
12215 | };
|
12216 |
|
12217 | /**
|
12218 | * Verifies a CreatePhraseSetRequest message.
|
12219 | * @function verify
|
12220 | * @memberof google.cloud.speech.v1p1beta1.CreatePhraseSetRequest
|
12221 | * @static
|
12222 | * @param {Object.<string,*>} message Plain object to verify
|
12223 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
12224 | */
|
12225 | CreatePhraseSetRequest.verify = function verify(message) {
|
12226 | if (typeof message !== "object" || message === null)
|
12227 | return "object expected";
|
12228 | if (message.parent != null && message.hasOwnProperty("parent"))
|
12229 | if (!$util.isString(message.parent))
|
12230 | return "parent: string expected";
|
12231 | if (message.phraseSetId != null && message.hasOwnProperty("phraseSetId"))
|
12232 | if (!$util.isString(message.phraseSetId))
|
12233 | return "phraseSetId: string expected";
|
12234 | if (message.phraseSet != null && message.hasOwnProperty("phraseSet")) {
|
12235 | var error = $root.google.cloud.speech.v1p1beta1.PhraseSet.verify(message.phraseSet);
|
12236 | if (error)
|
12237 | return "phraseSet." + error;
|
12238 | }
|
12239 | return null;
|
12240 | };
|
12241 |
|
12242 | /**
|
12243 | * Creates a CreatePhraseSetRequest message from a plain object. Also converts values to their respective internal types.
|
12244 | * @function fromObject
|
12245 | * @memberof google.cloud.speech.v1p1beta1.CreatePhraseSetRequest
|
12246 | * @static
|
12247 | * @param {Object.<string,*>} object Plain object
|
12248 | * @returns {google.cloud.speech.v1p1beta1.CreatePhraseSetRequest} CreatePhraseSetRequest
|
12249 | */
|
12250 | CreatePhraseSetRequest.fromObject = function fromObject(object) {
|
12251 | if (object instanceof $root.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest)
|
12252 | return object;
|
12253 | var message = new $root.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest();
|
12254 | if (object.parent != null)
|
12255 | message.parent = String(object.parent);
|
12256 | if (object.phraseSetId != null)
|
12257 | message.phraseSetId = String(object.phraseSetId);
|
12258 | if (object.phraseSet != null) {
|
12259 | if (typeof object.phraseSet !== "object")
|
12260 | throw TypeError(".google.cloud.speech.v1p1beta1.CreatePhraseSetRequest.phraseSet: object expected");
|
12261 | message.phraseSet = $root.google.cloud.speech.v1p1beta1.PhraseSet.fromObject(object.phraseSet);
|
12262 | }
|
12263 | return message;
|
12264 | };
|
12265 |
|
12266 | /**
|
12267 | * Creates a plain object from a CreatePhraseSetRequest message. Also converts values to other types if specified.
|
12268 | * @function toObject
|
12269 | * @memberof google.cloud.speech.v1p1beta1.CreatePhraseSetRequest
|
12270 | * @static
|
12271 | * @param {google.cloud.speech.v1p1beta1.CreatePhraseSetRequest} message CreatePhraseSetRequest
|
12272 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
12273 | * @returns {Object.<string,*>} Plain object
|
12274 | */
|
12275 | CreatePhraseSetRequest.toObject = function toObject(message, options) {
|
12276 | if (!options)
|
12277 | options = {};
|
12278 | var object = {};
|
12279 | if (options.defaults) {
|
12280 | object.parent = "";
|
12281 | object.phraseSetId = "";
|
12282 | object.phraseSet = null;
|
12283 | }
|
12284 | if (message.parent != null && message.hasOwnProperty("parent"))
|
12285 | object.parent = message.parent;
|
12286 | if (message.phraseSetId != null && message.hasOwnProperty("phraseSetId"))
|
12287 | object.phraseSetId = message.phraseSetId;
|
12288 | if (message.phraseSet != null && message.hasOwnProperty("phraseSet"))
|
12289 | object.phraseSet = $root.google.cloud.speech.v1p1beta1.PhraseSet.toObject(message.phraseSet, options);
|
12290 | return object;
|
12291 | };
|
12292 |
|
12293 | /**
|
12294 | * Converts this CreatePhraseSetRequest to JSON.
|
12295 | * @function toJSON
|
12296 | * @memberof google.cloud.speech.v1p1beta1.CreatePhraseSetRequest
|
12297 | * @instance
|
12298 | * @returns {Object.<string,*>} JSON object
|
12299 | */
|
12300 | CreatePhraseSetRequest.prototype.toJSON = function toJSON() {
|
12301 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
12302 | };
|
12303 |
|
12304 | return CreatePhraseSetRequest;
|
12305 | })();
|
12306 |
|
12307 | v1p1beta1.UpdatePhraseSetRequest = (function() {
|
12308 |
|
12309 | /**
|
12310 | * Properties of an UpdatePhraseSetRequest.
|
12311 | * @memberof google.cloud.speech.v1p1beta1
|
12312 | * @interface IUpdatePhraseSetRequest
|
12313 | * @property {google.cloud.speech.v1p1beta1.IPhraseSet|null} [phraseSet] UpdatePhraseSetRequest phraseSet
|
12314 | * @property {google.protobuf.IFieldMask|null} [updateMask] UpdatePhraseSetRequest updateMask
|
12315 | */
|
12316 |
|
12317 | /**
|
12318 | * Constructs a new UpdatePhraseSetRequest.
|
12319 | * @memberof google.cloud.speech.v1p1beta1
|
12320 | * @classdesc Represents an UpdatePhraseSetRequest.
|
12321 | * @implements IUpdatePhraseSetRequest
|
12322 | * @constructor
|
12323 | * @param {google.cloud.speech.v1p1beta1.IUpdatePhraseSetRequest=} [properties] Properties to set
|
12324 | */
|
12325 | function UpdatePhraseSetRequest(properties) {
|
12326 | if (properties)
|
12327 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
12328 | if (properties[keys[i]] != null)
|
12329 | this[keys[i]] = properties[keys[i]];
|
12330 | }
|
12331 |
|
12332 | /**
|
12333 | * UpdatePhraseSetRequest phraseSet.
|
12334 | * @member {google.cloud.speech.v1p1beta1.IPhraseSet|null|undefined} phraseSet
|
12335 | * @memberof google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest
|
12336 | * @instance
|
12337 | */
|
12338 | UpdatePhraseSetRequest.prototype.phraseSet = null;
|
12339 |
|
12340 | /**
|
12341 | * UpdatePhraseSetRequest updateMask.
|
12342 | * @member {google.protobuf.IFieldMask|null|undefined} updateMask
|
12343 | * @memberof google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest
|
12344 | * @instance
|
12345 | */
|
12346 | UpdatePhraseSetRequest.prototype.updateMask = null;
|
12347 |
|
12348 | /**
|
12349 | * Creates a new UpdatePhraseSetRequest instance using the specified properties.
|
12350 | * @function create
|
12351 | * @memberof google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest
|
12352 | * @static
|
12353 | * @param {google.cloud.speech.v1p1beta1.IUpdatePhraseSetRequest=} [properties] Properties to set
|
12354 | * @returns {google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest} UpdatePhraseSetRequest instance
|
12355 | */
|
12356 | UpdatePhraseSetRequest.create = function create(properties) {
|
12357 | return new UpdatePhraseSetRequest(properties);
|
12358 | };
|
12359 |
|
12360 | /**
|
12361 | * Encodes the specified UpdatePhraseSetRequest message. Does not implicitly {@link google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest.verify|verify} messages.
|
12362 | * @function encode
|
12363 | * @memberof google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest
|
12364 | * @static
|
12365 | * @param {google.cloud.speech.v1p1beta1.IUpdatePhraseSetRequest} message UpdatePhraseSetRequest message or plain object to encode
|
12366 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
12367 | * @returns {$protobuf.Writer} Writer
|
12368 | */
|
12369 | UpdatePhraseSetRequest.encode = function encode(message, writer) {
|
12370 | if (!writer)
|
12371 | writer = $Writer.create();
|
12372 | if (message.phraseSet != null && Object.hasOwnProperty.call(message, "phraseSet"))
|
12373 | $root.google.cloud.speech.v1p1beta1.PhraseSet.encode(message.phraseSet, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
12374 | if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask"))
|
12375 | $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
12376 | return writer;
|
12377 | };
|
12378 |
|
12379 | /**
|
12380 | * Encodes the specified UpdatePhraseSetRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest.verify|verify} messages.
|
12381 | * @function encodeDelimited
|
12382 | * @memberof google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest
|
12383 | * @static
|
12384 | * @param {google.cloud.speech.v1p1beta1.IUpdatePhraseSetRequest} message UpdatePhraseSetRequest message or plain object to encode
|
12385 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
12386 | * @returns {$protobuf.Writer} Writer
|
12387 | */
|
12388 | UpdatePhraseSetRequest.encodeDelimited = function encodeDelimited(message, writer) {
|
12389 | return this.encode(message, writer).ldelim();
|
12390 | };
|
12391 |
|
12392 | /**
|
12393 | * Decodes an UpdatePhraseSetRequest message from the specified reader or buffer.
|
12394 | * @function decode
|
12395 | * @memberof google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest
|
12396 | * @static
|
12397 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
12398 | * @param {number} [length] Message length if known beforehand
|
12399 | * @returns {google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest} UpdatePhraseSetRequest
|
12400 | * @throws {Error} If the payload is not a reader or valid buffer
|
12401 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
12402 | */
|
12403 | UpdatePhraseSetRequest.decode = function decode(reader, length) {
|
12404 | if (!(reader instanceof $Reader))
|
12405 | reader = $Reader.create(reader);
|
12406 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest();
|
12407 | while (reader.pos < end) {
|
12408 | var tag = reader.uint32();
|
12409 | switch (tag >>> 3) {
|
12410 | case 1:
|
12411 | message.phraseSet = $root.google.cloud.speech.v1p1beta1.PhraseSet.decode(reader, reader.uint32());
|
12412 | break;
|
12413 | case 2:
|
12414 | message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32());
|
12415 | break;
|
12416 | default:
|
12417 | reader.skipType(tag & 7);
|
12418 | break;
|
12419 | }
|
12420 | }
|
12421 | return message;
|
12422 | };
|
12423 |
|
12424 | /**
|
12425 | * Decodes an UpdatePhraseSetRequest message from the specified reader or buffer, length delimited.
|
12426 | * @function decodeDelimited
|
12427 | * @memberof google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest
|
12428 | * @static
|
12429 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
12430 | * @returns {google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest} UpdatePhraseSetRequest
|
12431 | * @throws {Error} If the payload is not a reader or valid buffer
|
12432 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
12433 | */
|
12434 | UpdatePhraseSetRequest.decodeDelimited = function decodeDelimited(reader) {
|
12435 | if (!(reader instanceof $Reader))
|
12436 | reader = new $Reader(reader);
|
12437 | return this.decode(reader, reader.uint32());
|
12438 | };
|
12439 |
|
12440 | /**
|
12441 | * Verifies an UpdatePhraseSetRequest message.
|
12442 | * @function verify
|
12443 | * @memberof google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest
|
12444 | * @static
|
12445 | * @param {Object.<string,*>} message Plain object to verify
|
12446 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
12447 | */
|
12448 | UpdatePhraseSetRequest.verify = function verify(message) {
|
12449 | if (typeof message !== "object" || message === null)
|
12450 | return "object expected";
|
12451 | if (message.phraseSet != null && message.hasOwnProperty("phraseSet")) {
|
12452 | var error = $root.google.cloud.speech.v1p1beta1.PhraseSet.verify(message.phraseSet);
|
12453 | if (error)
|
12454 | return "phraseSet." + error;
|
12455 | }
|
12456 | if (message.updateMask != null && message.hasOwnProperty("updateMask")) {
|
12457 | var error = $root.google.protobuf.FieldMask.verify(message.updateMask);
|
12458 | if (error)
|
12459 | return "updateMask." + error;
|
12460 | }
|
12461 | return null;
|
12462 | };
|
12463 |
|
12464 | /**
|
12465 | * Creates an UpdatePhraseSetRequest message from a plain object. Also converts values to their respective internal types.
|
12466 | * @function fromObject
|
12467 | * @memberof google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest
|
12468 | * @static
|
12469 | * @param {Object.<string,*>} object Plain object
|
12470 | * @returns {google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest} UpdatePhraseSetRequest
|
12471 | */
|
12472 | UpdatePhraseSetRequest.fromObject = function fromObject(object) {
|
12473 | if (object instanceof $root.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest)
|
12474 | return object;
|
12475 | var message = new $root.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest();
|
12476 | if (object.phraseSet != null) {
|
12477 | if (typeof object.phraseSet !== "object")
|
12478 | throw TypeError(".google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest.phraseSet: object expected");
|
12479 | message.phraseSet = $root.google.cloud.speech.v1p1beta1.PhraseSet.fromObject(object.phraseSet);
|
12480 | }
|
12481 | if (object.updateMask != null) {
|
12482 | if (typeof object.updateMask !== "object")
|
12483 | throw TypeError(".google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest.updateMask: object expected");
|
12484 | message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask);
|
12485 | }
|
12486 | return message;
|
12487 | };
|
12488 |
|
12489 | /**
|
12490 | * Creates a plain object from an UpdatePhraseSetRequest message. Also converts values to other types if specified.
|
12491 | * @function toObject
|
12492 | * @memberof google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest
|
12493 | * @static
|
12494 | * @param {google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest} message UpdatePhraseSetRequest
|
12495 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
12496 | * @returns {Object.<string,*>} Plain object
|
12497 | */
|
12498 | UpdatePhraseSetRequest.toObject = function toObject(message, options) {
|
12499 | if (!options)
|
12500 | options = {};
|
12501 | var object = {};
|
12502 | if (options.defaults) {
|
12503 | object.phraseSet = null;
|
12504 | object.updateMask = null;
|
12505 | }
|
12506 | if (message.phraseSet != null && message.hasOwnProperty("phraseSet"))
|
12507 | object.phraseSet = $root.google.cloud.speech.v1p1beta1.PhraseSet.toObject(message.phraseSet, options);
|
12508 | if (message.updateMask != null && message.hasOwnProperty("updateMask"))
|
12509 | object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options);
|
12510 | return object;
|
12511 | };
|
12512 |
|
12513 | /**
|
12514 | * Converts this UpdatePhraseSetRequest to JSON.
|
12515 | * @function toJSON
|
12516 | * @memberof google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest
|
12517 | * @instance
|
12518 | * @returns {Object.<string,*>} JSON object
|
12519 | */
|
12520 | UpdatePhraseSetRequest.prototype.toJSON = function toJSON() {
|
12521 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
12522 | };
|
12523 |
|
12524 | return UpdatePhraseSetRequest;
|
12525 | })();
|
12526 |
|
12527 | v1p1beta1.GetPhraseSetRequest = (function() {
|
12528 |
|
12529 | /**
|
12530 | * Properties of a GetPhraseSetRequest.
|
12531 | * @memberof google.cloud.speech.v1p1beta1
|
12532 | * @interface IGetPhraseSetRequest
|
12533 | * @property {string|null} [name] GetPhraseSetRequest name
|
12534 | */
|
12535 |
|
12536 | /**
|
12537 | * Constructs a new GetPhraseSetRequest.
|
12538 | * @memberof google.cloud.speech.v1p1beta1
|
12539 | * @classdesc Represents a GetPhraseSetRequest.
|
12540 | * @implements IGetPhraseSetRequest
|
12541 | * @constructor
|
12542 | * @param {google.cloud.speech.v1p1beta1.IGetPhraseSetRequest=} [properties] Properties to set
|
12543 | */
|
12544 | function GetPhraseSetRequest(properties) {
|
12545 | if (properties)
|
12546 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
12547 | if (properties[keys[i]] != null)
|
12548 | this[keys[i]] = properties[keys[i]];
|
12549 | }
|
12550 |
|
12551 | /**
|
12552 | * GetPhraseSetRequest name.
|
12553 | * @member {string} name
|
12554 | * @memberof google.cloud.speech.v1p1beta1.GetPhraseSetRequest
|
12555 | * @instance
|
12556 | */
|
12557 | GetPhraseSetRequest.prototype.name = "";
|
12558 |
|
12559 | /**
|
12560 | * Creates a new GetPhraseSetRequest instance using the specified properties.
|
12561 | * @function create
|
12562 | * @memberof google.cloud.speech.v1p1beta1.GetPhraseSetRequest
|
12563 | * @static
|
12564 | * @param {google.cloud.speech.v1p1beta1.IGetPhraseSetRequest=} [properties] Properties to set
|
12565 | * @returns {google.cloud.speech.v1p1beta1.GetPhraseSetRequest} GetPhraseSetRequest instance
|
12566 | */
|
12567 | GetPhraseSetRequest.create = function create(properties) {
|
12568 | return new GetPhraseSetRequest(properties);
|
12569 | };
|
12570 |
|
12571 | /**
|
12572 | * Encodes the specified GetPhraseSetRequest message. Does not implicitly {@link google.cloud.speech.v1p1beta1.GetPhraseSetRequest.verify|verify} messages.
|
12573 | * @function encode
|
12574 | * @memberof google.cloud.speech.v1p1beta1.GetPhraseSetRequest
|
12575 | * @static
|
12576 | * @param {google.cloud.speech.v1p1beta1.IGetPhraseSetRequest} message GetPhraseSetRequest message or plain object to encode
|
12577 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
12578 | * @returns {$protobuf.Writer} Writer
|
12579 | */
|
12580 | GetPhraseSetRequest.encode = function encode(message, writer) {
|
12581 | if (!writer)
|
12582 | writer = $Writer.create();
|
12583 | if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
12584 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
|
12585 | return writer;
|
12586 | };
|
12587 |
|
12588 | /**
|
12589 | * Encodes the specified GetPhraseSetRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.GetPhraseSetRequest.verify|verify} messages.
|
12590 | * @function encodeDelimited
|
12591 | * @memberof google.cloud.speech.v1p1beta1.GetPhraseSetRequest
|
12592 | * @static
|
12593 | * @param {google.cloud.speech.v1p1beta1.IGetPhraseSetRequest} message GetPhraseSetRequest message or plain object to encode
|
12594 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
12595 | * @returns {$protobuf.Writer} Writer
|
12596 | */
|
12597 | GetPhraseSetRequest.encodeDelimited = function encodeDelimited(message, writer) {
|
12598 | return this.encode(message, writer).ldelim();
|
12599 | };
|
12600 |
|
12601 | /**
|
12602 | * Decodes a GetPhraseSetRequest message from the specified reader or buffer.
|
12603 | * @function decode
|
12604 | * @memberof google.cloud.speech.v1p1beta1.GetPhraseSetRequest
|
12605 | * @static
|
12606 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
12607 | * @param {number} [length] Message length if known beforehand
|
12608 | * @returns {google.cloud.speech.v1p1beta1.GetPhraseSetRequest} GetPhraseSetRequest
|
12609 | * @throws {Error} If the payload is not a reader or valid buffer
|
12610 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
12611 | */
|
12612 | GetPhraseSetRequest.decode = function decode(reader, length) {
|
12613 | if (!(reader instanceof $Reader))
|
12614 | reader = $Reader.create(reader);
|
12615 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.GetPhraseSetRequest();
|
12616 | while (reader.pos < end) {
|
12617 | var tag = reader.uint32();
|
12618 | switch (tag >>> 3) {
|
12619 | case 1:
|
12620 | message.name = reader.string();
|
12621 | break;
|
12622 | default:
|
12623 | reader.skipType(tag & 7);
|
12624 | break;
|
12625 | }
|
12626 | }
|
12627 | return message;
|
12628 | };
|
12629 |
|
12630 | /**
|
12631 | * Decodes a GetPhraseSetRequest message from the specified reader or buffer, length delimited.
|
12632 | * @function decodeDelimited
|
12633 | * @memberof google.cloud.speech.v1p1beta1.GetPhraseSetRequest
|
12634 | * @static
|
12635 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
12636 | * @returns {google.cloud.speech.v1p1beta1.GetPhraseSetRequest} GetPhraseSetRequest
|
12637 | * @throws {Error} If the payload is not a reader or valid buffer
|
12638 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
12639 | */
|
12640 | GetPhraseSetRequest.decodeDelimited = function decodeDelimited(reader) {
|
12641 | if (!(reader instanceof $Reader))
|
12642 | reader = new $Reader(reader);
|
12643 | return this.decode(reader, reader.uint32());
|
12644 | };
|
12645 |
|
12646 | /**
|
12647 | * Verifies a GetPhraseSetRequest message.
|
12648 | * @function verify
|
12649 | * @memberof google.cloud.speech.v1p1beta1.GetPhraseSetRequest
|
12650 | * @static
|
12651 | * @param {Object.<string,*>} message Plain object to verify
|
12652 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
12653 | */
|
12654 | GetPhraseSetRequest.verify = function verify(message) {
|
12655 | if (typeof message !== "object" || message === null)
|
12656 | return "object expected";
|
12657 | if (message.name != null && message.hasOwnProperty("name"))
|
12658 | if (!$util.isString(message.name))
|
12659 | return "name: string expected";
|
12660 | return null;
|
12661 | };
|
12662 |
|
12663 | /**
|
12664 | * Creates a GetPhraseSetRequest message from a plain object. Also converts values to their respective internal types.
|
12665 | * @function fromObject
|
12666 | * @memberof google.cloud.speech.v1p1beta1.GetPhraseSetRequest
|
12667 | * @static
|
12668 | * @param {Object.<string,*>} object Plain object
|
12669 | * @returns {google.cloud.speech.v1p1beta1.GetPhraseSetRequest} GetPhraseSetRequest
|
12670 | */
|
12671 | GetPhraseSetRequest.fromObject = function fromObject(object) {
|
12672 | if (object instanceof $root.google.cloud.speech.v1p1beta1.GetPhraseSetRequest)
|
12673 | return object;
|
12674 | var message = new $root.google.cloud.speech.v1p1beta1.GetPhraseSetRequest();
|
12675 | if (object.name != null)
|
12676 | message.name = String(object.name);
|
12677 | return message;
|
12678 | };
|
12679 |
|
12680 | /**
|
12681 | * Creates a plain object from a GetPhraseSetRequest message. Also converts values to other types if specified.
|
12682 | * @function toObject
|
12683 | * @memberof google.cloud.speech.v1p1beta1.GetPhraseSetRequest
|
12684 | * @static
|
12685 | * @param {google.cloud.speech.v1p1beta1.GetPhraseSetRequest} message GetPhraseSetRequest
|
12686 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
12687 | * @returns {Object.<string,*>} Plain object
|
12688 | */
|
12689 | GetPhraseSetRequest.toObject = function toObject(message, options) {
|
12690 | if (!options)
|
12691 | options = {};
|
12692 | var object = {};
|
12693 | if (options.defaults)
|
12694 | object.name = "";
|
12695 | if (message.name != null && message.hasOwnProperty("name"))
|
12696 | object.name = message.name;
|
12697 | return object;
|
12698 | };
|
12699 |
|
12700 | /**
|
12701 | * Converts this GetPhraseSetRequest to JSON.
|
12702 | * @function toJSON
|
12703 | * @memberof google.cloud.speech.v1p1beta1.GetPhraseSetRequest
|
12704 | * @instance
|
12705 | * @returns {Object.<string,*>} JSON object
|
12706 | */
|
12707 | GetPhraseSetRequest.prototype.toJSON = function toJSON() {
|
12708 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
12709 | };
|
12710 |
|
12711 | return GetPhraseSetRequest;
|
12712 | })();
|
12713 |
|
12714 | v1p1beta1.ListPhraseSetRequest = (function() {
|
12715 |
|
12716 | /**
|
12717 | * Properties of a ListPhraseSetRequest.
|
12718 | * @memberof google.cloud.speech.v1p1beta1
|
12719 | * @interface IListPhraseSetRequest
|
12720 | * @property {string|null} [parent] ListPhraseSetRequest parent
|
12721 | * @property {number|null} [pageSize] ListPhraseSetRequest pageSize
|
12722 | * @property {string|null} [pageToken] ListPhraseSetRequest pageToken
|
12723 | */
|
12724 |
|
12725 | /**
|
12726 | * Constructs a new ListPhraseSetRequest.
|
12727 | * @memberof google.cloud.speech.v1p1beta1
|
12728 | * @classdesc Represents a ListPhraseSetRequest.
|
12729 | * @implements IListPhraseSetRequest
|
12730 | * @constructor
|
12731 | * @param {google.cloud.speech.v1p1beta1.IListPhraseSetRequest=} [properties] Properties to set
|
12732 | */
|
12733 | function ListPhraseSetRequest(properties) {
|
12734 | if (properties)
|
12735 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
12736 | if (properties[keys[i]] != null)
|
12737 | this[keys[i]] = properties[keys[i]];
|
12738 | }
|
12739 |
|
12740 | /**
|
12741 | * ListPhraseSetRequest parent.
|
12742 | * @member {string} parent
|
12743 | * @memberof google.cloud.speech.v1p1beta1.ListPhraseSetRequest
|
12744 | * @instance
|
12745 | */
|
12746 | ListPhraseSetRequest.prototype.parent = "";
|
12747 |
|
12748 | /**
|
12749 | * ListPhraseSetRequest pageSize.
|
12750 | * @member {number} pageSize
|
12751 | * @memberof google.cloud.speech.v1p1beta1.ListPhraseSetRequest
|
12752 | * @instance
|
12753 | */
|
12754 | ListPhraseSetRequest.prototype.pageSize = 0;
|
12755 |
|
12756 | /**
|
12757 | * ListPhraseSetRequest pageToken.
|
12758 | * @member {string} pageToken
|
12759 | * @memberof google.cloud.speech.v1p1beta1.ListPhraseSetRequest
|
12760 | * @instance
|
12761 | */
|
12762 | ListPhraseSetRequest.prototype.pageToken = "";
|
12763 |
|
12764 | /**
|
12765 | * Creates a new ListPhraseSetRequest instance using the specified properties.
|
12766 | * @function create
|
12767 | * @memberof google.cloud.speech.v1p1beta1.ListPhraseSetRequest
|
12768 | * @static
|
12769 | * @param {google.cloud.speech.v1p1beta1.IListPhraseSetRequest=} [properties] Properties to set
|
12770 | * @returns {google.cloud.speech.v1p1beta1.ListPhraseSetRequest} ListPhraseSetRequest instance
|
12771 | */
|
12772 | ListPhraseSetRequest.create = function create(properties) {
|
12773 | return new ListPhraseSetRequest(properties);
|
12774 | };
|
12775 |
|
12776 | /**
|
12777 | * Encodes the specified ListPhraseSetRequest message. Does not implicitly {@link google.cloud.speech.v1p1beta1.ListPhraseSetRequest.verify|verify} messages.
|
12778 | * @function encode
|
12779 | * @memberof google.cloud.speech.v1p1beta1.ListPhraseSetRequest
|
12780 | * @static
|
12781 | * @param {google.cloud.speech.v1p1beta1.IListPhraseSetRequest} message ListPhraseSetRequest message or plain object to encode
|
12782 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
12783 | * @returns {$protobuf.Writer} Writer
|
12784 | */
|
12785 | ListPhraseSetRequest.encode = function encode(message, writer) {
|
12786 | if (!writer)
|
12787 | writer = $Writer.create();
|
12788 | if (message.parent != null && Object.hasOwnProperty.call(message, "parent"))
|
12789 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent);
|
12790 | if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize"))
|
12791 | writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize);
|
12792 | if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken"))
|
12793 | writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken);
|
12794 | return writer;
|
12795 | };
|
12796 |
|
12797 | /**
|
12798 | * Encodes the specified ListPhraseSetRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.ListPhraseSetRequest.verify|verify} messages.
|
12799 | * @function encodeDelimited
|
12800 | * @memberof google.cloud.speech.v1p1beta1.ListPhraseSetRequest
|
12801 | * @static
|
12802 | * @param {google.cloud.speech.v1p1beta1.IListPhraseSetRequest} message ListPhraseSetRequest message or plain object to encode
|
12803 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
12804 | * @returns {$protobuf.Writer} Writer
|
12805 | */
|
12806 | ListPhraseSetRequest.encodeDelimited = function encodeDelimited(message, writer) {
|
12807 | return this.encode(message, writer).ldelim();
|
12808 | };
|
12809 |
|
12810 | /**
|
12811 | * Decodes a ListPhraseSetRequest message from the specified reader or buffer.
|
12812 | * @function decode
|
12813 | * @memberof google.cloud.speech.v1p1beta1.ListPhraseSetRequest
|
12814 | * @static
|
12815 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
12816 | * @param {number} [length] Message length if known beforehand
|
12817 | * @returns {google.cloud.speech.v1p1beta1.ListPhraseSetRequest} ListPhraseSetRequest
|
12818 | * @throws {Error} If the payload is not a reader or valid buffer
|
12819 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
12820 | */
|
12821 | ListPhraseSetRequest.decode = function decode(reader, length) {
|
12822 | if (!(reader instanceof $Reader))
|
12823 | reader = $Reader.create(reader);
|
12824 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.ListPhraseSetRequest();
|
12825 | while (reader.pos < end) {
|
12826 | var tag = reader.uint32();
|
12827 | switch (tag >>> 3) {
|
12828 | case 1:
|
12829 | message.parent = reader.string();
|
12830 | break;
|
12831 | case 2:
|
12832 | message.pageSize = reader.int32();
|
12833 | break;
|
12834 | case 3:
|
12835 | message.pageToken = reader.string();
|
12836 | break;
|
12837 | default:
|
12838 | reader.skipType(tag & 7);
|
12839 | break;
|
12840 | }
|
12841 | }
|
12842 | return message;
|
12843 | };
|
12844 |
|
12845 | /**
|
12846 | * Decodes a ListPhraseSetRequest message from the specified reader or buffer, length delimited.
|
12847 | * @function decodeDelimited
|
12848 | * @memberof google.cloud.speech.v1p1beta1.ListPhraseSetRequest
|
12849 | * @static
|
12850 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
12851 | * @returns {google.cloud.speech.v1p1beta1.ListPhraseSetRequest} ListPhraseSetRequest
|
12852 | * @throws {Error} If the payload is not a reader or valid buffer
|
12853 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
12854 | */
|
12855 | ListPhraseSetRequest.decodeDelimited = function decodeDelimited(reader) {
|
12856 | if (!(reader instanceof $Reader))
|
12857 | reader = new $Reader(reader);
|
12858 | return this.decode(reader, reader.uint32());
|
12859 | };
|
12860 |
|
12861 | /**
|
12862 | * Verifies a ListPhraseSetRequest message.
|
12863 | * @function verify
|
12864 | * @memberof google.cloud.speech.v1p1beta1.ListPhraseSetRequest
|
12865 | * @static
|
12866 | * @param {Object.<string,*>} message Plain object to verify
|
12867 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
12868 | */
|
12869 | ListPhraseSetRequest.verify = function verify(message) {
|
12870 | if (typeof message !== "object" || message === null)
|
12871 | return "object expected";
|
12872 | if (message.parent != null && message.hasOwnProperty("parent"))
|
12873 | if (!$util.isString(message.parent))
|
12874 | return "parent: string expected";
|
12875 | if (message.pageSize != null && message.hasOwnProperty("pageSize"))
|
12876 | if (!$util.isInteger(message.pageSize))
|
12877 | return "pageSize: integer expected";
|
12878 | if (message.pageToken != null && message.hasOwnProperty("pageToken"))
|
12879 | if (!$util.isString(message.pageToken))
|
12880 | return "pageToken: string expected";
|
12881 | return null;
|
12882 | };
|
12883 |
|
12884 | /**
|
12885 | * Creates a ListPhraseSetRequest message from a plain object. Also converts values to their respective internal types.
|
12886 | * @function fromObject
|
12887 | * @memberof google.cloud.speech.v1p1beta1.ListPhraseSetRequest
|
12888 | * @static
|
12889 | * @param {Object.<string,*>} object Plain object
|
12890 | * @returns {google.cloud.speech.v1p1beta1.ListPhraseSetRequest} ListPhraseSetRequest
|
12891 | */
|
12892 | ListPhraseSetRequest.fromObject = function fromObject(object) {
|
12893 | if (object instanceof $root.google.cloud.speech.v1p1beta1.ListPhraseSetRequest)
|
12894 | return object;
|
12895 | var message = new $root.google.cloud.speech.v1p1beta1.ListPhraseSetRequest();
|
12896 | if (object.parent != null)
|
12897 | message.parent = String(object.parent);
|
12898 | if (object.pageSize != null)
|
12899 | message.pageSize = object.pageSize | 0;
|
12900 | if (object.pageToken != null)
|
12901 | message.pageToken = String(object.pageToken);
|
12902 | return message;
|
12903 | };
|
12904 |
|
12905 | /**
|
12906 | * Creates a plain object from a ListPhraseSetRequest message. Also converts values to other types if specified.
|
12907 | * @function toObject
|
12908 | * @memberof google.cloud.speech.v1p1beta1.ListPhraseSetRequest
|
12909 | * @static
|
12910 | * @param {google.cloud.speech.v1p1beta1.ListPhraseSetRequest} message ListPhraseSetRequest
|
12911 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
12912 | * @returns {Object.<string,*>} Plain object
|
12913 | */
|
12914 | ListPhraseSetRequest.toObject = function toObject(message, options) {
|
12915 | if (!options)
|
12916 | options = {};
|
12917 | var object = {};
|
12918 | if (options.defaults) {
|
12919 | object.parent = "";
|
12920 | object.pageSize = 0;
|
12921 | object.pageToken = "";
|
12922 | }
|
12923 | if (message.parent != null && message.hasOwnProperty("parent"))
|
12924 | object.parent = message.parent;
|
12925 | if (message.pageSize != null && message.hasOwnProperty("pageSize"))
|
12926 | object.pageSize = message.pageSize;
|
12927 | if (message.pageToken != null && message.hasOwnProperty("pageToken"))
|
12928 | object.pageToken = message.pageToken;
|
12929 | return object;
|
12930 | };
|
12931 |
|
12932 | /**
|
12933 | * Converts this ListPhraseSetRequest to JSON.
|
12934 | * @function toJSON
|
12935 | * @memberof google.cloud.speech.v1p1beta1.ListPhraseSetRequest
|
12936 | * @instance
|
12937 | * @returns {Object.<string,*>} JSON object
|
12938 | */
|
12939 | ListPhraseSetRequest.prototype.toJSON = function toJSON() {
|
12940 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
12941 | };
|
12942 |
|
12943 | return ListPhraseSetRequest;
|
12944 | })();
|
12945 |
|
12946 | v1p1beta1.ListPhraseSetResponse = (function() {
|
12947 |
|
12948 | /**
|
12949 | * Properties of a ListPhraseSetResponse.
|
12950 | * @memberof google.cloud.speech.v1p1beta1
|
12951 | * @interface IListPhraseSetResponse
|
12952 | * @property {Array.<google.cloud.speech.v1p1beta1.IPhraseSet>|null} [phraseSets] ListPhraseSetResponse phraseSets
|
12953 | * @property {string|null} [nextPageToken] ListPhraseSetResponse nextPageToken
|
12954 | */
|
12955 |
|
12956 | /**
|
12957 | * Constructs a new ListPhraseSetResponse.
|
12958 | * @memberof google.cloud.speech.v1p1beta1
|
12959 | * @classdesc Represents a ListPhraseSetResponse.
|
12960 | * @implements IListPhraseSetResponse
|
12961 | * @constructor
|
12962 | * @param {google.cloud.speech.v1p1beta1.IListPhraseSetResponse=} [properties] Properties to set
|
12963 | */
|
12964 | function ListPhraseSetResponse(properties) {
|
12965 | this.phraseSets = [];
|
12966 | if (properties)
|
12967 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
12968 | if (properties[keys[i]] != null)
|
12969 | this[keys[i]] = properties[keys[i]];
|
12970 | }
|
12971 |
|
12972 | /**
|
12973 | * ListPhraseSetResponse phraseSets.
|
12974 | * @member {Array.<google.cloud.speech.v1p1beta1.IPhraseSet>} phraseSets
|
12975 | * @memberof google.cloud.speech.v1p1beta1.ListPhraseSetResponse
|
12976 | * @instance
|
12977 | */
|
12978 | ListPhraseSetResponse.prototype.phraseSets = $util.emptyArray;
|
12979 |
|
12980 | /**
|
12981 | * ListPhraseSetResponse nextPageToken.
|
12982 | * @member {string} nextPageToken
|
12983 | * @memberof google.cloud.speech.v1p1beta1.ListPhraseSetResponse
|
12984 | * @instance
|
12985 | */
|
12986 | ListPhraseSetResponse.prototype.nextPageToken = "";
|
12987 |
|
12988 | /**
|
12989 | * Creates a new ListPhraseSetResponse instance using the specified properties.
|
12990 | * @function create
|
12991 | * @memberof google.cloud.speech.v1p1beta1.ListPhraseSetResponse
|
12992 | * @static
|
12993 | * @param {google.cloud.speech.v1p1beta1.IListPhraseSetResponse=} [properties] Properties to set
|
12994 | * @returns {google.cloud.speech.v1p1beta1.ListPhraseSetResponse} ListPhraseSetResponse instance
|
12995 | */
|
12996 | ListPhraseSetResponse.create = function create(properties) {
|
12997 | return new ListPhraseSetResponse(properties);
|
12998 | };
|
12999 |
|
13000 | /**
|
13001 | * Encodes the specified ListPhraseSetResponse message. Does not implicitly {@link google.cloud.speech.v1p1beta1.ListPhraseSetResponse.verify|verify} messages.
|
13002 | * @function encode
|
13003 | * @memberof google.cloud.speech.v1p1beta1.ListPhraseSetResponse
|
13004 | * @static
|
13005 | * @param {google.cloud.speech.v1p1beta1.IListPhraseSetResponse} message ListPhraseSetResponse message or plain object to encode
|
13006 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
13007 | * @returns {$protobuf.Writer} Writer
|
13008 | */
|
13009 | ListPhraseSetResponse.encode = function encode(message, writer) {
|
13010 | if (!writer)
|
13011 | writer = $Writer.create();
|
13012 | if (message.phraseSets != null && message.phraseSets.length)
|
13013 | for (var i = 0; i < message.phraseSets.length; ++i)
|
13014 | $root.google.cloud.speech.v1p1beta1.PhraseSet.encode(message.phraseSets[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
13015 | if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken"))
|
13016 | writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken);
|
13017 | return writer;
|
13018 | };
|
13019 |
|
13020 | /**
|
13021 | * Encodes the specified ListPhraseSetResponse message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.ListPhraseSetResponse.verify|verify} messages.
|
13022 | * @function encodeDelimited
|
13023 | * @memberof google.cloud.speech.v1p1beta1.ListPhraseSetResponse
|
13024 | * @static
|
13025 | * @param {google.cloud.speech.v1p1beta1.IListPhraseSetResponse} message ListPhraseSetResponse message or plain object to encode
|
13026 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
13027 | * @returns {$protobuf.Writer} Writer
|
13028 | */
|
13029 | ListPhraseSetResponse.encodeDelimited = function encodeDelimited(message, writer) {
|
13030 | return this.encode(message, writer).ldelim();
|
13031 | };
|
13032 |
|
13033 | /**
|
13034 | * Decodes a ListPhraseSetResponse message from the specified reader or buffer.
|
13035 | * @function decode
|
13036 | * @memberof google.cloud.speech.v1p1beta1.ListPhraseSetResponse
|
13037 | * @static
|
13038 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
13039 | * @param {number} [length] Message length if known beforehand
|
13040 | * @returns {google.cloud.speech.v1p1beta1.ListPhraseSetResponse} ListPhraseSetResponse
|
13041 | * @throws {Error} If the payload is not a reader or valid buffer
|
13042 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
13043 | */
|
13044 | ListPhraseSetResponse.decode = function decode(reader, length) {
|
13045 | if (!(reader instanceof $Reader))
|
13046 | reader = $Reader.create(reader);
|
13047 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.ListPhraseSetResponse();
|
13048 | while (reader.pos < end) {
|
13049 | var tag = reader.uint32();
|
13050 | switch (tag >>> 3) {
|
13051 | case 1:
|
13052 | if (!(message.phraseSets && message.phraseSets.length))
|
13053 | message.phraseSets = [];
|
13054 | message.phraseSets.push($root.google.cloud.speech.v1p1beta1.PhraseSet.decode(reader, reader.uint32()));
|
13055 | break;
|
13056 | case 2:
|
13057 | message.nextPageToken = reader.string();
|
13058 | break;
|
13059 | default:
|
13060 | reader.skipType(tag & 7);
|
13061 | break;
|
13062 | }
|
13063 | }
|
13064 | return message;
|
13065 | };
|
13066 |
|
13067 | /**
|
13068 | * Decodes a ListPhraseSetResponse message from the specified reader or buffer, length delimited.
|
13069 | * @function decodeDelimited
|
13070 | * @memberof google.cloud.speech.v1p1beta1.ListPhraseSetResponse
|
13071 | * @static
|
13072 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
13073 | * @returns {google.cloud.speech.v1p1beta1.ListPhraseSetResponse} ListPhraseSetResponse
|
13074 | * @throws {Error} If the payload is not a reader or valid buffer
|
13075 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
13076 | */
|
13077 | ListPhraseSetResponse.decodeDelimited = function decodeDelimited(reader) {
|
13078 | if (!(reader instanceof $Reader))
|
13079 | reader = new $Reader(reader);
|
13080 | return this.decode(reader, reader.uint32());
|
13081 | };
|
13082 |
|
13083 | /**
|
13084 | * Verifies a ListPhraseSetResponse message.
|
13085 | * @function verify
|
13086 | * @memberof google.cloud.speech.v1p1beta1.ListPhraseSetResponse
|
13087 | * @static
|
13088 | * @param {Object.<string,*>} message Plain object to verify
|
13089 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
13090 | */
|
13091 | ListPhraseSetResponse.verify = function verify(message) {
|
13092 | if (typeof message !== "object" || message === null)
|
13093 | return "object expected";
|
13094 | if (message.phraseSets != null && message.hasOwnProperty("phraseSets")) {
|
13095 | if (!Array.isArray(message.phraseSets))
|
13096 | return "phraseSets: array expected";
|
13097 | for (var i = 0; i < message.phraseSets.length; ++i) {
|
13098 | var error = $root.google.cloud.speech.v1p1beta1.PhraseSet.verify(message.phraseSets[i]);
|
13099 | if (error)
|
13100 | return "phraseSets." + error;
|
13101 | }
|
13102 | }
|
13103 | if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken"))
|
13104 | if (!$util.isString(message.nextPageToken))
|
13105 | return "nextPageToken: string expected";
|
13106 | return null;
|
13107 | };
|
13108 |
|
13109 | /**
|
13110 | * Creates a ListPhraseSetResponse message from a plain object. Also converts values to their respective internal types.
|
13111 | * @function fromObject
|
13112 | * @memberof google.cloud.speech.v1p1beta1.ListPhraseSetResponse
|
13113 | * @static
|
13114 | * @param {Object.<string,*>} object Plain object
|
13115 | * @returns {google.cloud.speech.v1p1beta1.ListPhraseSetResponse} ListPhraseSetResponse
|
13116 | */
|
13117 | ListPhraseSetResponse.fromObject = function fromObject(object) {
|
13118 | if (object instanceof $root.google.cloud.speech.v1p1beta1.ListPhraseSetResponse)
|
13119 | return object;
|
13120 | var message = new $root.google.cloud.speech.v1p1beta1.ListPhraseSetResponse();
|
13121 | if (object.phraseSets) {
|
13122 | if (!Array.isArray(object.phraseSets))
|
13123 | throw TypeError(".google.cloud.speech.v1p1beta1.ListPhraseSetResponse.phraseSets: array expected");
|
13124 | message.phraseSets = [];
|
13125 | for (var i = 0; i < object.phraseSets.length; ++i) {
|
13126 | if (typeof object.phraseSets[i] !== "object")
|
13127 | throw TypeError(".google.cloud.speech.v1p1beta1.ListPhraseSetResponse.phraseSets: object expected");
|
13128 | message.phraseSets[i] = $root.google.cloud.speech.v1p1beta1.PhraseSet.fromObject(object.phraseSets[i]);
|
13129 | }
|
13130 | }
|
13131 | if (object.nextPageToken != null)
|
13132 | message.nextPageToken = String(object.nextPageToken);
|
13133 | return message;
|
13134 | };
|
13135 |
|
13136 | /**
|
13137 | * Creates a plain object from a ListPhraseSetResponse message. Also converts values to other types if specified.
|
13138 | * @function toObject
|
13139 | * @memberof google.cloud.speech.v1p1beta1.ListPhraseSetResponse
|
13140 | * @static
|
13141 | * @param {google.cloud.speech.v1p1beta1.ListPhraseSetResponse} message ListPhraseSetResponse
|
13142 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
13143 | * @returns {Object.<string,*>} Plain object
|
13144 | */
|
13145 | ListPhraseSetResponse.toObject = function toObject(message, options) {
|
13146 | if (!options)
|
13147 | options = {};
|
13148 | var object = {};
|
13149 | if (options.arrays || options.defaults)
|
13150 | object.phraseSets = [];
|
13151 | if (options.defaults)
|
13152 | object.nextPageToken = "";
|
13153 | if (message.phraseSets && message.phraseSets.length) {
|
13154 | object.phraseSets = [];
|
13155 | for (var j = 0; j < message.phraseSets.length; ++j)
|
13156 | object.phraseSets[j] = $root.google.cloud.speech.v1p1beta1.PhraseSet.toObject(message.phraseSets[j], options);
|
13157 | }
|
13158 | if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken"))
|
13159 | object.nextPageToken = message.nextPageToken;
|
13160 | return object;
|
13161 | };
|
13162 |
|
13163 | /**
|
13164 | * Converts this ListPhraseSetResponse to JSON.
|
13165 | * @function toJSON
|
13166 | * @memberof google.cloud.speech.v1p1beta1.ListPhraseSetResponse
|
13167 | * @instance
|
13168 | * @returns {Object.<string,*>} JSON object
|
13169 | */
|
13170 | ListPhraseSetResponse.prototype.toJSON = function toJSON() {
|
13171 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
13172 | };
|
13173 |
|
13174 | return ListPhraseSetResponse;
|
13175 | })();
|
13176 |
|
13177 | v1p1beta1.DeletePhraseSetRequest = (function() {
|
13178 |
|
13179 | /**
|
13180 | * Properties of a DeletePhraseSetRequest.
|
13181 | * @memberof google.cloud.speech.v1p1beta1
|
13182 | * @interface IDeletePhraseSetRequest
|
13183 | * @property {string|null} [name] DeletePhraseSetRequest name
|
13184 | */
|
13185 |
|
13186 | /**
|
13187 | * Constructs a new DeletePhraseSetRequest.
|
13188 | * @memberof google.cloud.speech.v1p1beta1
|
13189 | * @classdesc Represents a DeletePhraseSetRequest.
|
13190 | * @implements IDeletePhraseSetRequest
|
13191 | * @constructor
|
13192 | * @param {google.cloud.speech.v1p1beta1.IDeletePhraseSetRequest=} [properties] Properties to set
|
13193 | */
|
13194 | function DeletePhraseSetRequest(properties) {
|
13195 | if (properties)
|
13196 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
13197 | if (properties[keys[i]] != null)
|
13198 | this[keys[i]] = properties[keys[i]];
|
13199 | }
|
13200 |
|
13201 | /**
|
13202 | * DeletePhraseSetRequest name.
|
13203 | * @member {string} name
|
13204 | * @memberof google.cloud.speech.v1p1beta1.DeletePhraseSetRequest
|
13205 | * @instance
|
13206 | */
|
13207 | DeletePhraseSetRequest.prototype.name = "";
|
13208 |
|
13209 | /**
|
13210 | * Creates a new DeletePhraseSetRequest instance using the specified properties.
|
13211 | * @function create
|
13212 | * @memberof google.cloud.speech.v1p1beta1.DeletePhraseSetRequest
|
13213 | * @static
|
13214 | * @param {google.cloud.speech.v1p1beta1.IDeletePhraseSetRequest=} [properties] Properties to set
|
13215 | * @returns {google.cloud.speech.v1p1beta1.DeletePhraseSetRequest} DeletePhraseSetRequest instance
|
13216 | */
|
13217 | DeletePhraseSetRequest.create = function create(properties) {
|
13218 | return new DeletePhraseSetRequest(properties);
|
13219 | };
|
13220 |
|
13221 | /**
|
13222 | * Encodes the specified DeletePhraseSetRequest message. Does not implicitly {@link google.cloud.speech.v1p1beta1.DeletePhraseSetRequest.verify|verify} messages.
|
13223 | * @function encode
|
13224 | * @memberof google.cloud.speech.v1p1beta1.DeletePhraseSetRequest
|
13225 | * @static
|
13226 | * @param {google.cloud.speech.v1p1beta1.IDeletePhraseSetRequest} message DeletePhraseSetRequest message or plain object to encode
|
13227 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
13228 | * @returns {$protobuf.Writer} Writer
|
13229 | */
|
13230 | DeletePhraseSetRequest.encode = function encode(message, writer) {
|
13231 | if (!writer)
|
13232 | writer = $Writer.create();
|
13233 | if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
13234 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
|
13235 | return writer;
|
13236 | };
|
13237 |
|
13238 | /**
|
13239 | * Encodes the specified DeletePhraseSetRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.DeletePhraseSetRequest.verify|verify} messages.
|
13240 | * @function encodeDelimited
|
13241 | * @memberof google.cloud.speech.v1p1beta1.DeletePhraseSetRequest
|
13242 | * @static
|
13243 | * @param {google.cloud.speech.v1p1beta1.IDeletePhraseSetRequest} message DeletePhraseSetRequest message or plain object to encode
|
13244 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
13245 | * @returns {$protobuf.Writer} Writer
|
13246 | */
|
13247 | DeletePhraseSetRequest.encodeDelimited = function encodeDelimited(message, writer) {
|
13248 | return this.encode(message, writer).ldelim();
|
13249 | };
|
13250 |
|
13251 | /**
|
13252 | * Decodes a DeletePhraseSetRequest message from the specified reader or buffer.
|
13253 | * @function decode
|
13254 | * @memberof google.cloud.speech.v1p1beta1.DeletePhraseSetRequest
|
13255 | * @static
|
13256 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
13257 | * @param {number} [length] Message length if known beforehand
|
13258 | * @returns {google.cloud.speech.v1p1beta1.DeletePhraseSetRequest} DeletePhraseSetRequest
|
13259 | * @throws {Error} If the payload is not a reader or valid buffer
|
13260 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
13261 | */
|
13262 | DeletePhraseSetRequest.decode = function decode(reader, length) {
|
13263 | if (!(reader instanceof $Reader))
|
13264 | reader = $Reader.create(reader);
|
13265 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest();
|
13266 | while (reader.pos < end) {
|
13267 | var tag = reader.uint32();
|
13268 | switch (tag >>> 3) {
|
13269 | case 1:
|
13270 | message.name = reader.string();
|
13271 | break;
|
13272 | default:
|
13273 | reader.skipType(tag & 7);
|
13274 | break;
|
13275 | }
|
13276 | }
|
13277 | return message;
|
13278 | };
|
13279 |
|
13280 | /**
|
13281 | * Decodes a DeletePhraseSetRequest message from the specified reader or buffer, length delimited.
|
13282 | * @function decodeDelimited
|
13283 | * @memberof google.cloud.speech.v1p1beta1.DeletePhraseSetRequest
|
13284 | * @static
|
13285 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
13286 | * @returns {google.cloud.speech.v1p1beta1.DeletePhraseSetRequest} DeletePhraseSetRequest
|
13287 | * @throws {Error} If the payload is not a reader or valid buffer
|
13288 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
13289 | */
|
13290 | DeletePhraseSetRequest.decodeDelimited = function decodeDelimited(reader) {
|
13291 | if (!(reader instanceof $Reader))
|
13292 | reader = new $Reader(reader);
|
13293 | return this.decode(reader, reader.uint32());
|
13294 | };
|
13295 |
|
13296 | /**
|
13297 | * Verifies a DeletePhraseSetRequest message.
|
13298 | * @function verify
|
13299 | * @memberof google.cloud.speech.v1p1beta1.DeletePhraseSetRequest
|
13300 | * @static
|
13301 | * @param {Object.<string,*>} message Plain object to verify
|
13302 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
13303 | */
|
13304 | DeletePhraseSetRequest.verify = function verify(message) {
|
13305 | if (typeof message !== "object" || message === null)
|
13306 | return "object expected";
|
13307 | if (message.name != null && message.hasOwnProperty("name"))
|
13308 | if (!$util.isString(message.name))
|
13309 | return "name: string expected";
|
13310 | return null;
|
13311 | };
|
13312 |
|
13313 | /**
|
13314 | * Creates a DeletePhraseSetRequest message from a plain object. Also converts values to their respective internal types.
|
13315 | * @function fromObject
|
13316 | * @memberof google.cloud.speech.v1p1beta1.DeletePhraseSetRequest
|
13317 | * @static
|
13318 | * @param {Object.<string,*>} object Plain object
|
13319 | * @returns {google.cloud.speech.v1p1beta1.DeletePhraseSetRequest} DeletePhraseSetRequest
|
13320 | */
|
13321 | DeletePhraseSetRequest.fromObject = function fromObject(object) {
|
13322 | if (object instanceof $root.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest)
|
13323 | return object;
|
13324 | var message = new $root.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest();
|
13325 | if (object.name != null)
|
13326 | message.name = String(object.name);
|
13327 | return message;
|
13328 | };
|
13329 |
|
13330 | /**
|
13331 | * Creates a plain object from a DeletePhraseSetRequest message. Also converts values to other types if specified.
|
13332 | * @function toObject
|
13333 | * @memberof google.cloud.speech.v1p1beta1.DeletePhraseSetRequest
|
13334 | * @static
|
13335 | * @param {google.cloud.speech.v1p1beta1.DeletePhraseSetRequest} message DeletePhraseSetRequest
|
13336 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
13337 | * @returns {Object.<string,*>} Plain object
|
13338 | */
|
13339 | DeletePhraseSetRequest.toObject = function toObject(message, options) {
|
13340 | if (!options)
|
13341 | options = {};
|
13342 | var object = {};
|
13343 | if (options.defaults)
|
13344 | object.name = "";
|
13345 | if (message.name != null && message.hasOwnProperty("name"))
|
13346 | object.name = message.name;
|
13347 | return object;
|
13348 | };
|
13349 |
|
13350 | /**
|
13351 | * Converts this DeletePhraseSetRequest to JSON.
|
13352 | * @function toJSON
|
13353 | * @memberof google.cloud.speech.v1p1beta1.DeletePhraseSetRequest
|
13354 | * @instance
|
13355 | * @returns {Object.<string,*>} JSON object
|
13356 | */
|
13357 | DeletePhraseSetRequest.prototype.toJSON = function toJSON() {
|
13358 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
13359 | };
|
13360 |
|
13361 | return DeletePhraseSetRequest;
|
13362 | })();
|
13363 |
|
13364 | v1p1beta1.CreateCustomClassRequest = (function() {
|
13365 |
|
13366 | /**
|
13367 | * Properties of a CreateCustomClassRequest.
|
13368 | * @memberof google.cloud.speech.v1p1beta1
|
13369 | * @interface ICreateCustomClassRequest
|
13370 | * @property {string|null} [parent] CreateCustomClassRequest parent
|
13371 | * @property {string|null} [customClassId] CreateCustomClassRequest customClassId
|
13372 | * @property {google.cloud.speech.v1p1beta1.ICustomClass|null} [customClass] CreateCustomClassRequest customClass
|
13373 | */
|
13374 |
|
13375 | /**
|
13376 | * Constructs a new CreateCustomClassRequest.
|
13377 | * @memberof google.cloud.speech.v1p1beta1
|
13378 | * @classdesc Represents a CreateCustomClassRequest.
|
13379 | * @implements ICreateCustomClassRequest
|
13380 | * @constructor
|
13381 | * @param {google.cloud.speech.v1p1beta1.ICreateCustomClassRequest=} [properties] Properties to set
|
13382 | */
|
13383 | function CreateCustomClassRequest(properties) {
|
13384 | if (properties)
|
13385 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
13386 | if (properties[keys[i]] != null)
|
13387 | this[keys[i]] = properties[keys[i]];
|
13388 | }
|
13389 |
|
13390 | /**
|
13391 | * CreateCustomClassRequest parent.
|
13392 | * @member {string} parent
|
13393 | * @memberof google.cloud.speech.v1p1beta1.CreateCustomClassRequest
|
13394 | * @instance
|
13395 | */
|
13396 | CreateCustomClassRequest.prototype.parent = "";
|
13397 |
|
13398 | /**
|
13399 | * CreateCustomClassRequest customClassId.
|
13400 | * @member {string} customClassId
|
13401 | * @memberof google.cloud.speech.v1p1beta1.CreateCustomClassRequest
|
13402 | * @instance
|
13403 | */
|
13404 | CreateCustomClassRequest.prototype.customClassId = "";
|
13405 |
|
13406 | /**
|
13407 | * CreateCustomClassRequest customClass.
|
13408 | * @member {google.cloud.speech.v1p1beta1.ICustomClass|null|undefined} customClass
|
13409 | * @memberof google.cloud.speech.v1p1beta1.CreateCustomClassRequest
|
13410 | * @instance
|
13411 | */
|
13412 | CreateCustomClassRequest.prototype.customClass = null;
|
13413 |
|
13414 | /**
|
13415 | * Creates a new CreateCustomClassRequest instance using the specified properties.
|
13416 | * @function create
|
13417 | * @memberof google.cloud.speech.v1p1beta1.CreateCustomClassRequest
|
13418 | * @static
|
13419 | * @param {google.cloud.speech.v1p1beta1.ICreateCustomClassRequest=} [properties] Properties to set
|
13420 | * @returns {google.cloud.speech.v1p1beta1.CreateCustomClassRequest} CreateCustomClassRequest instance
|
13421 | */
|
13422 | CreateCustomClassRequest.create = function create(properties) {
|
13423 | return new CreateCustomClassRequest(properties);
|
13424 | };
|
13425 |
|
13426 | /**
|
13427 | * Encodes the specified CreateCustomClassRequest message. Does not implicitly {@link google.cloud.speech.v1p1beta1.CreateCustomClassRequest.verify|verify} messages.
|
13428 | * @function encode
|
13429 | * @memberof google.cloud.speech.v1p1beta1.CreateCustomClassRequest
|
13430 | * @static
|
13431 | * @param {google.cloud.speech.v1p1beta1.ICreateCustomClassRequest} message CreateCustomClassRequest message or plain object to encode
|
13432 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
13433 | * @returns {$protobuf.Writer} Writer
|
13434 | */
|
13435 | CreateCustomClassRequest.encode = function encode(message, writer) {
|
13436 | if (!writer)
|
13437 | writer = $Writer.create();
|
13438 | if (message.parent != null && Object.hasOwnProperty.call(message, "parent"))
|
13439 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent);
|
13440 | if (message.customClassId != null && Object.hasOwnProperty.call(message, "customClassId"))
|
13441 | writer.uint32(/* id 2, wireType 2 =*/18).string(message.customClassId);
|
13442 | if (message.customClass != null && Object.hasOwnProperty.call(message, "customClass"))
|
13443 | $root.google.cloud.speech.v1p1beta1.CustomClass.encode(message.customClass, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
|
13444 | return writer;
|
13445 | };
|
13446 |
|
13447 | /**
|
13448 | * Encodes the specified CreateCustomClassRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.CreateCustomClassRequest.verify|verify} messages.
|
13449 | * @function encodeDelimited
|
13450 | * @memberof google.cloud.speech.v1p1beta1.CreateCustomClassRequest
|
13451 | * @static
|
13452 | * @param {google.cloud.speech.v1p1beta1.ICreateCustomClassRequest} message CreateCustomClassRequest message or plain object to encode
|
13453 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
13454 | * @returns {$protobuf.Writer} Writer
|
13455 | */
|
13456 | CreateCustomClassRequest.encodeDelimited = function encodeDelimited(message, writer) {
|
13457 | return this.encode(message, writer).ldelim();
|
13458 | };
|
13459 |
|
13460 | /**
|
13461 | * Decodes a CreateCustomClassRequest message from the specified reader or buffer.
|
13462 | * @function decode
|
13463 | * @memberof google.cloud.speech.v1p1beta1.CreateCustomClassRequest
|
13464 | * @static
|
13465 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
13466 | * @param {number} [length] Message length if known beforehand
|
13467 | * @returns {google.cloud.speech.v1p1beta1.CreateCustomClassRequest} CreateCustomClassRequest
|
13468 | * @throws {Error} If the payload is not a reader or valid buffer
|
13469 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
13470 | */
|
13471 | CreateCustomClassRequest.decode = function decode(reader, length) {
|
13472 | if (!(reader instanceof $Reader))
|
13473 | reader = $Reader.create(reader);
|
13474 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.CreateCustomClassRequest();
|
13475 | while (reader.pos < end) {
|
13476 | var tag = reader.uint32();
|
13477 | switch (tag >>> 3) {
|
13478 | case 1:
|
13479 | message.parent = reader.string();
|
13480 | break;
|
13481 | case 2:
|
13482 | message.customClassId = reader.string();
|
13483 | break;
|
13484 | case 3:
|
13485 | message.customClass = $root.google.cloud.speech.v1p1beta1.CustomClass.decode(reader, reader.uint32());
|
13486 | break;
|
13487 | default:
|
13488 | reader.skipType(tag & 7);
|
13489 | break;
|
13490 | }
|
13491 | }
|
13492 | return message;
|
13493 | };
|
13494 |
|
13495 | /**
|
13496 | * Decodes a CreateCustomClassRequest message from the specified reader or buffer, length delimited.
|
13497 | * @function decodeDelimited
|
13498 | * @memberof google.cloud.speech.v1p1beta1.CreateCustomClassRequest
|
13499 | * @static
|
13500 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
13501 | * @returns {google.cloud.speech.v1p1beta1.CreateCustomClassRequest} CreateCustomClassRequest
|
13502 | * @throws {Error} If the payload is not a reader or valid buffer
|
13503 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
13504 | */
|
13505 | CreateCustomClassRequest.decodeDelimited = function decodeDelimited(reader) {
|
13506 | if (!(reader instanceof $Reader))
|
13507 | reader = new $Reader(reader);
|
13508 | return this.decode(reader, reader.uint32());
|
13509 | };
|
13510 |
|
13511 | /**
|
13512 | * Verifies a CreateCustomClassRequest message.
|
13513 | * @function verify
|
13514 | * @memberof google.cloud.speech.v1p1beta1.CreateCustomClassRequest
|
13515 | * @static
|
13516 | * @param {Object.<string,*>} message Plain object to verify
|
13517 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
13518 | */
|
13519 | CreateCustomClassRequest.verify = function verify(message) {
|
13520 | if (typeof message !== "object" || message === null)
|
13521 | return "object expected";
|
13522 | if (message.parent != null && message.hasOwnProperty("parent"))
|
13523 | if (!$util.isString(message.parent))
|
13524 | return "parent: string expected";
|
13525 | if (message.customClassId != null && message.hasOwnProperty("customClassId"))
|
13526 | if (!$util.isString(message.customClassId))
|
13527 | return "customClassId: string expected";
|
13528 | if (message.customClass != null && message.hasOwnProperty("customClass")) {
|
13529 | var error = $root.google.cloud.speech.v1p1beta1.CustomClass.verify(message.customClass);
|
13530 | if (error)
|
13531 | return "customClass." + error;
|
13532 | }
|
13533 | return null;
|
13534 | };
|
13535 |
|
13536 | /**
|
13537 | * Creates a CreateCustomClassRequest message from a plain object. Also converts values to their respective internal types.
|
13538 | * @function fromObject
|
13539 | * @memberof google.cloud.speech.v1p1beta1.CreateCustomClassRequest
|
13540 | * @static
|
13541 | * @param {Object.<string,*>} object Plain object
|
13542 | * @returns {google.cloud.speech.v1p1beta1.CreateCustomClassRequest} CreateCustomClassRequest
|
13543 | */
|
13544 | CreateCustomClassRequest.fromObject = function fromObject(object) {
|
13545 | if (object instanceof $root.google.cloud.speech.v1p1beta1.CreateCustomClassRequest)
|
13546 | return object;
|
13547 | var message = new $root.google.cloud.speech.v1p1beta1.CreateCustomClassRequest();
|
13548 | if (object.parent != null)
|
13549 | message.parent = String(object.parent);
|
13550 | if (object.customClassId != null)
|
13551 | message.customClassId = String(object.customClassId);
|
13552 | if (object.customClass != null) {
|
13553 | if (typeof object.customClass !== "object")
|
13554 | throw TypeError(".google.cloud.speech.v1p1beta1.CreateCustomClassRequest.customClass: object expected");
|
13555 | message.customClass = $root.google.cloud.speech.v1p1beta1.CustomClass.fromObject(object.customClass);
|
13556 | }
|
13557 | return message;
|
13558 | };
|
13559 |
|
13560 | /**
|
13561 | * Creates a plain object from a CreateCustomClassRequest message. Also converts values to other types if specified.
|
13562 | * @function toObject
|
13563 | * @memberof google.cloud.speech.v1p1beta1.CreateCustomClassRequest
|
13564 | * @static
|
13565 | * @param {google.cloud.speech.v1p1beta1.CreateCustomClassRequest} message CreateCustomClassRequest
|
13566 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
13567 | * @returns {Object.<string,*>} Plain object
|
13568 | */
|
13569 | CreateCustomClassRequest.toObject = function toObject(message, options) {
|
13570 | if (!options)
|
13571 | options = {};
|
13572 | var object = {};
|
13573 | if (options.defaults) {
|
13574 | object.parent = "";
|
13575 | object.customClassId = "";
|
13576 | object.customClass = null;
|
13577 | }
|
13578 | if (message.parent != null && message.hasOwnProperty("parent"))
|
13579 | object.parent = message.parent;
|
13580 | if (message.customClassId != null && message.hasOwnProperty("customClassId"))
|
13581 | object.customClassId = message.customClassId;
|
13582 | if (message.customClass != null && message.hasOwnProperty("customClass"))
|
13583 | object.customClass = $root.google.cloud.speech.v1p1beta1.CustomClass.toObject(message.customClass, options);
|
13584 | return object;
|
13585 | };
|
13586 |
|
13587 | /**
|
13588 | * Converts this CreateCustomClassRequest to JSON.
|
13589 | * @function toJSON
|
13590 | * @memberof google.cloud.speech.v1p1beta1.CreateCustomClassRequest
|
13591 | * @instance
|
13592 | * @returns {Object.<string,*>} JSON object
|
13593 | */
|
13594 | CreateCustomClassRequest.prototype.toJSON = function toJSON() {
|
13595 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
13596 | };
|
13597 |
|
13598 | return CreateCustomClassRequest;
|
13599 | })();
|
13600 |
|
13601 | v1p1beta1.UpdateCustomClassRequest = (function() {
|
13602 |
|
13603 | /**
|
13604 | * Properties of an UpdateCustomClassRequest.
|
13605 | * @memberof google.cloud.speech.v1p1beta1
|
13606 | * @interface IUpdateCustomClassRequest
|
13607 | * @property {google.cloud.speech.v1p1beta1.ICustomClass|null} [customClass] UpdateCustomClassRequest customClass
|
13608 | * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateCustomClassRequest updateMask
|
13609 | */
|
13610 |
|
13611 | /**
|
13612 | * Constructs a new UpdateCustomClassRequest.
|
13613 | * @memberof google.cloud.speech.v1p1beta1
|
13614 | * @classdesc Represents an UpdateCustomClassRequest.
|
13615 | * @implements IUpdateCustomClassRequest
|
13616 | * @constructor
|
13617 | * @param {google.cloud.speech.v1p1beta1.IUpdateCustomClassRequest=} [properties] Properties to set
|
13618 | */
|
13619 | function UpdateCustomClassRequest(properties) {
|
13620 | if (properties)
|
13621 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
13622 | if (properties[keys[i]] != null)
|
13623 | this[keys[i]] = properties[keys[i]];
|
13624 | }
|
13625 |
|
13626 | /**
|
13627 | * UpdateCustomClassRequest customClass.
|
13628 | * @member {google.cloud.speech.v1p1beta1.ICustomClass|null|undefined} customClass
|
13629 | * @memberof google.cloud.speech.v1p1beta1.UpdateCustomClassRequest
|
13630 | * @instance
|
13631 | */
|
13632 | UpdateCustomClassRequest.prototype.customClass = null;
|
13633 |
|
13634 | /**
|
13635 | * UpdateCustomClassRequest updateMask.
|
13636 | * @member {google.protobuf.IFieldMask|null|undefined} updateMask
|
13637 | * @memberof google.cloud.speech.v1p1beta1.UpdateCustomClassRequest
|
13638 | * @instance
|
13639 | */
|
13640 | UpdateCustomClassRequest.prototype.updateMask = null;
|
13641 |
|
13642 | /**
|
13643 | * Creates a new UpdateCustomClassRequest instance using the specified properties.
|
13644 | * @function create
|
13645 | * @memberof google.cloud.speech.v1p1beta1.UpdateCustomClassRequest
|
13646 | * @static
|
13647 | * @param {google.cloud.speech.v1p1beta1.IUpdateCustomClassRequest=} [properties] Properties to set
|
13648 | * @returns {google.cloud.speech.v1p1beta1.UpdateCustomClassRequest} UpdateCustomClassRequest instance
|
13649 | */
|
13650 | UpdateCustomClassRequest.create = function create(properties) {
|
13651 | return new UpdateCustomClassRequest(properties);
|
13652 | };
|
13653 |
|
13654 | /**
|
13655 | * Encodes the specified UpdateCustomClassRequest message. Does not implicitly {@link google.cloud.speech.v1p1beta1.UpdateCustomClassRequest.verify|verify} messages.
|
13656 | * @function encode
|
13657 | * @memberof google.cloud.speech.v1p1beta1.UpdateCustomClassRequest
|
13658 | * @static
|
13659 | * @param {google.cloud.speech.v1p1beta1.IUpdateCustomClassRequest} message UpdateCustomClassRequest message or plain object to encode
|
13660 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
13661 | * @returns {$protobuf.Writer} Writer
|
13662 | */
|
13663 | UpdateCustomClassRequest.encode = function encode(message, writer) {
|
13664 | if (!writer)
|
13665 | writer = $Writer.create();
|
13666 | if (message.customClass != null && Object.hasOwnProperty.call(message, "customClass"))
|
13667 | $root.google.cloud.speech.v1p1beta1.CustomClass.encode(message.customClass, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
13668 | if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask"))
|
13669 | $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
13670 | return writer;
|
13671 | };
|
13672 |
|
13673 | /**
|
13674 | * Encodes the specified UpdateCustomClassRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.UpdateCustomClassRequest.verify|verify} messages.
|
13675 | * @function encodeDelimited
|
13676 | * @memberof google.cloud.speech.v1p1beta1.UpdateCustomClassRequest
|
13677 | * @static
|
13678 | * @param {google.cloud.speech.v1p1beta1.IUpdateCustomClassRequest} message UpdateCustomClassRequest message or plain object to encode
|
13679 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
13680 | * @returns {$protobuf.Writer} Writer
|
13681 | */
|
13682 | UpdateCustomClassRequest.encodeDelimited = function encodeDelimited(message, writer) {
|
13683 | return this.encode(message, writer).ldelim();
|
13684 | };
|
13685 |
|
13686 | /**
|
13687 | * Decodes an UpdateCustomClassRequest message from the specified reader or buffer.
|
13688 | * @function decode
|
13689 | * @memberof google.cloud.speech.v1p1beta1.UpdateCustomClassRequest
|
13690 | * @static
|
13691 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
13692 | * @param {number} [length] Message length if known beforehand
|
13693 | * @returns {google.cloud.speech.v1p1beta1.UpdateCustomClassRequest} UpdateCustomClassRequest
|
13694 | * @throws {Error} If the payload is not a reader or valid buffer
|
13695 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
13696 | */
|
13697 | UpdateCustomClassRequest.decode = function decode(reader, length) {
|
13698 | if (!(reader instanceof $Reader))
|
13699 | reader = $Reader.create(reader);
|
13700 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest();
|
13701 | while (reader.pos < end) {
|
13702 | var tag = reader.uint32();
|
13703 | switch (tag >>> 3) {
|
13704 | case 1:
|
13705 | message.customClass = $root.google.cloud.speech.v1p1beta1.CustomClass.decode(reader, reader.uint32());
|
13706 | break;
|
13707 | case 2:
|
13708 | message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32());
|
13709 | break;
|
13710 | default:
|
13711 | reader.skipType(tag & 7);
|
13712 | break;
|
13713 | }
|
13714 | }
|
13715 | return message;
|
13716 | };
|
13717 |
|
13718 | /**
|
13719 | * Decodes an UpdateCustomClassRequest message from the specified reader or buffer, length delimited.
|
13720 | * @function decodeDelimited
|
13721 | * @memberof google.cloud.speech.v1p1beta1.UpdateCustomClassRequest
|
13722 | * @static
|
13723 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
13724 | * @returns {google.cloud.speech.v1p1beta1.UpdateCustomClassRequest} UpdateCustomClassRequest
|
13725 | * @throws {Error} If the payload is not a reader or valid buffer
|
13726 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
13727 | */
|
13728 | UpdateCustomClassRequest.decodeDelimited = function decodeDelimited(reader) {
|
13729 | if (!(reader instanceof $Reader))
|
13730 | reader = new $Reader(reader);
|
13731 | return this.decode(reader, reader.uint32());
|
13732 | };
|
13733 |
|
13734 | /**
|
13735 | * Verifies an UpdateCustomClassRequest message.
|
13736 | * @function verify
|
13737 | * @memberof google.cloud.speech.v1p1beta1.UpdateCustomClassRequest
|
13738 | * @static
|
13739 | * @param {Object.<string,*>} message Plain object to verify
|
13740 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
13741 | */
|
13742 | UpdateCustomClassRequest.verify = function verify(message) {
|
13743 | if (typeof message !== "object" || message === null)
|
13744 | return "object expected";
|
13745 | if (message.customClass != null && message.hasOwnProperty("customClass")) {
|
13746 | var error = $root.google.cloud.speech.v1p1beta1.CustomClass.verify(message.customClass);
|
13747 | if (error)
|
13748 | return "customClass." + error;
|
13749 | }
|
13750 | if (message.updateMask != null && message.hasOwnProperty("updateMask")) {
|
13751 | var error = $root.google.protobuf.FieldMask.verify(message.updateMask);
|
13752 | if (error)
|
13753 | return "updateMask." + error;
|
13754 | }
|
13755 | return null;
|
13756 | };
|
13757 |
|
13758 | /**
|
13759 | * Creates an UpdateCustomClassRequest message from a plain object. Also converts values to their respective internal types.
|
13760 | * @function fromObject
|
13761 | * @memberof google.cloud.speech.v1p1beta1.UpdateCustomClassRequest
|
13762 | * @static
|
13763 | * @param {Object.<string,*>} object Plain object
|
13764 | * @returns {google.cloud.speech.v1p1beta1.UpdateCustomClassRequest} UpdateCustomClassRequest
|
13765 | */
|
13766 | UpdateCustomClassRequest.fromObject = function fromObject(object) {
|
13767 | if (object instanceof $root.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest)
|
13768 | return object;
|
13769 | var message = new $root.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest();
|
13770 | if (object.customClass != null) {
|
13771 | if (typeof object.customClass !== "object")
|
13772 | throw TypeError(".google.cloud.speech.v1p1beta1.UpdateCustomClassRequest.customClass: object expected");
|
13773 | message.customClass = $root.google.cloud.speech.v1p1beta1.CustomClass.fromObject(object.customClass);
|
13774 | }
|
13775 | if (object.updateMask != null) {
|
13776 | if (typeof object.updateMask !== "object")
|
13777 | throw TypeError(".google.cloud.speech.v1p1beta1.UpdateCustomClassRequest.updateMask: object expected");
|
13778 | message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask);
|
13779 | }
|
13780 | return message;
|
13781 | };
|
13782 |
|
13783 | /**
|
13784 | * Creates a plain object from an UpdateCustomClassRequest message. Also converts values to other types if specified.
|
13785 | * @function toObject
|
13786 | * @memberof google.cloud.speech.v1p1beta1.UpdateCustomClassRequest
|
13787 | * @static
|
13788 | * @param {google.cloud.speech.v1p1beta1.UpdateCustomClassRequest} message UpdateCustomClassRequest
|
13789 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
13790 | * @returns {Object.<string,*>} Plain object
|
13791 | */
|
13792 | UpdateCustomClassRequest.toObject = function toObject(message, options) {
|
13793 | if (!options)
|
13794 | options = {};
|
13795 | var object = {};
|
13796 | if (options.defaults) {
|
13797 | object.customClass = null;
|
13798 | object.updateMask = null;
|
13799 | }
|
13800 | if (message.customClass != null && message.hasOwnProperty("customClass"))
|
13801 | object.customClass = $root.google.cloud.speech.v1p1beta1.CustomClass.toObject(message.customClass, options);
|
13802 | if (message.updateMask != null && message.hasOwnProperty("updateMask"))
|
13803 | object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options);
|
13804 | return object;
|
13805 | };
|
13806 |
|
13807 | /**
|
13808 | * Converts this UpdateCustomClassRequest to JSON.
|
13809 | * @function toJSON
|
13810 | * @memberof google.cloud.speech.v1p1beta1.UpdateCustomClassRequest
|
13811 | * @instance
|
13812 | * @returns {Object.<string,*>} JSON object
|
13813 | */
|
13814 | UpdateCustomClassRequest.prototype.toJSON = function toJSON() {
|
13815 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
13816 | };
|
13817 |
|
13818 | return UpdateCustomClassRequest;
|
13819 | })();
|
13820 |
|
13821 | v1p1beta1.GetCustomClassRequest = (function() {
|
13822 |
|
13823 | /**
|
13824 | * Properties of a GetCustomClassRequest.
|
13825 | * @memberof google.cloud.speech.v1p1beta1
|
13826 | * @interface IGetCustomClassRequest
|
13827 | * @property {string|null} [name] GetCustomClassRequest name
|
13828 | */
|
13829 |
|
13830 | /**
|
13831 | * Constructs a new GetCustomClassRequest.
|
13832 | * @memberof google.cloud.speech.v1p1beta1
|
13833 | * @classdesc Represents a GetCustomClassRequest.
|
13834 | * @implements IGetCustomClassRequest
|
13835 | * @constructor
|
13836 | * @param {google.cloud.speech.v1p1beta1.IGetCustomClassRequest=} [properties] Properties to set
|
13837 | */
|
13838 | function GetCustomClassRequest(properties) {
|
13839 | if (properties)
|
13840 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
13841 | if (properties[keys[i]] != null)
|
13842 | this[keys[i]] = properties[keys[i]];
|
13843 | }
|
13844 |
|
13845 | /**
|
13846 | * GetCustomClassRequest name.
|
13847 | * @member {string} name
|
13848 | * @memberof google.cloud.speech.v1p1beta1.GetCustomClassRequest
|
13849 | * @instance
|
13850 | */
|
13851 | GetCustomClassRequest.prototype.name = "";
|
13852 |
|
13853 | /**
|
13854 | * Creates a new GetCustomClassRequest instance using the specified properties.
|
13855 | * @function create
|
13856 | * @memberof google.cloud.speech.v1p1beta1.GetCustomClassRequest
|
13857 | * @static
|
13858 | * @param {google.cloud.speech.v1p1beta1.IGetCustomClassRequest=} [properties] Properties to set
|
13859 | * @returns {google.cloud.speech.v1p1beta1.GetCustomClassRequest} GetCustomClassRequest instance
|
13860 | */
|
13861 | GetCustomClassRequest.create = function create(properties) {
|
13862 | return new GetCustomClassRequest(properties);
|
13863 | };
|
13864 |
|
13865 | /**
|
13866 | * Encodes the specified GetCustomClassRequest message. Does not implicitly {@link google.cloud.speech.v1p1beta1.GetCustomClassRequest.verify|verify} messages.
|
13867 | * @function encode
|
13868 | * @memberof google.cloud.speech.v1p1beta1.GetCustomClassRequest
|
13869 | * @static
|
13870 | * @param {google.cloud.speech.v1p1beta1.IGetCustomClassRequest} message GetCustomClassRequest message or plain object to encode
|
13871 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
13872 | * @returns {$protobuf.Writer} Writer
|
13873 | */
|
13874 | GetCustomClassRequest.encode = function encode(message, writer) {
|
13875 | if (!writer)
|
13876 | writer = $Writer.create();
|
13877 | if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
13878 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
|
13879 | return writer;
|
13880 | };
|
13881 |
|
13882 | /**
|
13883 | * Encodes the specified GetCustomClassRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.GetCustomClassRequest.verify|verify} messages.
|
13884 | * @function encodeDelimited
|
13885 | * @memberof google.cloud.speech.v1p1beta1.GetCustomClassRequest
|
13886 | * @static
|
13887 | * @param {google.cloud.speech.v1p1beta1.IGetCustomClassRequest} message GetCustomClassRequest message or plain object to encode
|
13888 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
13889 | * @returns {$protobuf.Writer} Writer
|
13890 | */
|
13891 | GetCustomClassRequest.encodeDelimited = function encodeDelimited(message, writer) {
|
13892 | return this.encode(message, writer).ldelim();
|
13893 | };
|
13894 |
|
13895 | /**
|
13896 | * Decodes a GetCustomClassRequest message from the specified reader or buffer.
|
13897 | * @function decode
|
13898 | * @memberof google.cloud.speech.v1p1beta1.GetCustomClassRequest
|
13899 | * @static
|
13900 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
13901 | * @param {number} [length] Message length if known beforehand
|
13902 | * @returns {google.cloud.speech.v1p1beta1.GetCustomClassRequest} GetCustomClassRequest
|
13903 | * @throws {Error} If the payload is not a reader or valid buffer
|
13904 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
13905 | */
|
13906 | GetCustomClassRequest.decode = function decode(reader, length) {
|
13907 | if (!(reader instanceof $Reader))
|
13908 | reader = $Reader.create(reader);
|
13909 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.GetCustomClassRequest();
|
13910 | while (reader.pos < end) {
|
13911 | var tag = reader.uint32();
|
13912 | switch (tag >>> 3) {
|
13913 | case 1:
|
13914 | message.name = reader.string();
|
13915 | break;
|
13916 | default:
|
13917 | reader.skipType(tag & 7);
|
13918 | break;
|
13919 | }
|
13920 | }
|
13921 | return message;
|
13922 | };
|
13923 |
|
13924 | /**
|
13925 | * Decodes a GetCustomClassRequest message from the specified reader or buffer, length delimited.
|
13926 | * @function decodeDelimited
|
13927 | * @memberof google.cloud.speech.v1p1beta1.GetCustomClassRequest
|
13928 | * @static
|
13929 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
13930 | * @returns {google.cloud.speech.v1p1beta1.GetCustomClassRequest} GetCustomClassRequest
|
13931 | * @throws {Error} If the payload is not a reader or valid buffer
|
13932 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
13933 | */
|
13934 | GetCustomClassRequest.decodeDelimited = function decodeDelimited(reader) {
|
13935 | if (!(reader instanceof $Reader))
|
13936 | reader = new $Reader(reader);
|
13937 | return this.decode(reader, reader.uint32());
|
13938 | };
|
13939 |
|
13940 | /**
|
13941 | * Verifies a GetCustomClassRequest message.
|
13942 | * @function verify
|
13943 | * @memberof google.cloud.speech.v1p1beta1.GetCustomClassRequest
|
13944 | * @static
|
13945 | * @param {Object.<string,*>} message Plain object to verify
|
13946 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
13947 | */
|
13948 | GetCustomClassRequest.verify = function verify(message) {
|
13949 | if (typeof message !== "object" || message === null)
|
13950 | return "object expected";
|
13951 | if (message.name != null && message.hasOwnProperty("name"))
|
13952 | if (!$util.isString(message.name))
|
13953 | return "name: string expected";
|
13954 | return null;
|
13955 | };
|
13956 |
|
13957 | /**
|
13958 | * Creates a GetCustomClassRequest message from a plain object. Also converts values to their respective internal types.
|
13959 | * @function fromObject
|
13960 | * @memberof google.cloud.speech.v1p1beta1.GetCustomClassRequest
|
13961 | * @static
|
13962 | * @param {Object.<string,*>} object Plain object
|
13963 | * @returns {google.cloud.speech.v1p1beta1.GetCustomClassRequest} GetCustomClassRequest
|
13964 | */
|
13965 | GetCustomClassRequest.fromObject = function fromObject(object) {
|
13966 | if (object instanceof $root.google.cloud.speech.v1p1beta1.GetCustomClassRequest)
|
13967 | return object;
|
13968 | var message = new $root.google.cloud.speech.v1p1beta1.GetCustomClassRequest();
|
13969 | if (object.name != null)
|
13970 | message.name = String(object.name);
|
13971 | return message;
|
13972 | };
|
13973 |
|
13974 | /**
|
13975 | * Creates a plain object from a GetCustomClassRequest message. Also converts values to other types if specified.
|
13976 | * @function toObject
|
13977 | * @memberof google.cloud.speech.v1p1beta1.GetCustomClassRequest
|
13978 | * @static
|
13979 | * @param {google.cloud.speech.v1p1beta1.GetCustomClassRequest} message GetCustomClassRequest
|
13980 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
13981 | * @returns {Object.<string,*>} Plain object
|
13982 | */
|
13983 | GetCustomClassRequest.toObject = function toObject(message, options) {
|
13984 | if (!options)
|
13985 | options = {};
|
13986 | var object = {};
|
13987 | if (options.defaults)
|
13988 | object.name = "";
|
13989 | if (message.name != null && message.hasOwnProperty("name"))
|
13990 | object.name = message.name;
|
13991 | return object;
|
13992 | };
|
13993 |
|
13994 | /**
|
13995 | * Converts this GetCustomClassRequest to JSON.
|
13996 | * @function toJSON
|
13997 | * @memberof google.cloud.speech.v1p1beta1.GetCustomClassRequest
|
13998 | * @instance
|
13999 | * @returns {Object.<string,*>} JSON object
|
14000 | */
|
14001 | GetCustomClassRequest.prototype.toJSON = function toJSON() {
|
14002 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
14003 | };
|
14004 |
|
14005 | return GetCustomClassRequest;
|
14006 | })();
|
14007 |
|
14008 | v1p1beta1.ListCustomClassesRequest = (function() {
|
14009 |
|
14010 | /**
|
14011 | * Properties of a ListCustomClassesRequest.
|
14012 | * @memberof google.cloud.speech.v1p1beta1
|
14013 | * @interface IListCustomClassesRequest
|
14014 | * @property {string|null} [parent] ListCustomClassesRequest parent
|
14015 | * @property {number|null} [pageSize] ListCustomClassesRequest pageSize
|
14016 | * @property {string|null} [pageToken] ListCustomClassesRequest pageToken
|
14017 | */
|
14018 |
|
14019 | /**
|
14020 | * Constructs a new ListCustomClassesRequest.
|
14021 | * @memberof google.cloud.speech.v1p1beta1
|
14022 | * @classdesc Represents a ListCustomClassesRequest.
|
14023 | * @implements IListCustomClassesRequest
|
14024 | * @constructor
|
14025 | * @param {google.cloud.speech.v1p1beta1.IListCustomClassesRequest=} [properties] Properties to set
|
14026 | */
|
14027 | function ListCustomClassesRequest(properties) {
|
14028 | if (properties)
|
14029 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
14030 | if (properties[keys[i]] != null)
|
14031 | this[keys[i]] = properties[keys[i]];
|
14032 | }
|
14033 |
|
14034 | /**
|
14035 | * ListCustomClassesRequest parent.
|
14036 | * @member {string} parent
|
14037 | * @memberof google.cloud.speech.v1p1beta1.ListCustomClassesRequest
|
14038 | * @instance
|
14039 | */
|
14040 | ListCustomClassesRequest.prototype.parent = "";
|
14041 |
|
14042 | /**
|
14043 | * ListCustomClassesRequest pageSize.
|
14044 | * @member {number} pageSize
|
14045 | * @memberof google.cloud.speech.v1p1beta1.ListCustomClassesRequest
|
14046 | * @instance
|
14047 | */
|
14048 | ListCustomClassesRequest.prototype.pageSize = 0;
|
14049 |
|
14050 | /**
|
14051 | * ListCustomClassesRequest pageToken.
|
14052 | * @member {string} pageToken
|
14053 | * @memberof google.cloud.speech.v1p1beta1.ListCustomClassesRequest
|
14054 | * @instance
|
14055 | */
|
14056 | ListCustomClassesRequest.prototype.pageToken = "";
|
14057 |
|
14058 | /**
|
14059 | * Creates a new ListCustomClassesRequest instance using the specified properties.
|
14060 | * @function create
|
14061 | * @memberof google.cloud.speech.v1p1beta1.ListCustomClassesRequest
|
14062 | * @static
|
14063 | * @param {google.cloud.speech.v1p1beta1.IListCustomClassesRequest=} [properties] Properties to set
|
14064 | * @returns {google.cloud.speech.v1p1beta1.ListCustomClassesRequest} ListCustomClassesRequest instance
|
14065 | */
|
14066 | ListCustomClassesRequest.create = function create(properties) {
|
14067 | return new ListCustomClassesRequest(properties);
|
14068 | };
|
14069 |
|
14070 | /**
|
14071 | * Encodes the specified ListCustomClassesRequest message. Does not implicitly {@link google.cloud.speech.v1p1beta1.ListCustomClassesRequest.verify|verify} messages.
|
14072 | * @function encode
|
14073 | * @memberof google.cloud.speech.v1p1beta1.ListCustomClassesRequest
|
14074 | * @static
|
14075 | * @param {google.cloud.speech.v1p1beta1.IListCustomClassesRequest} message ListCustomClassesRequest message or plain object to encode
|
14076 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
14077 | * @returns {$protobuf.Writer} Writer
|
14078 | */
|
14079 | ListCustomClassesRequest.encode = function encode(message, writer) {
|
14080 | if (!writer)
|
14081 | writer = $Writer.create();
|
14082 | if (message.parent != null && Object.hasOwnProperty.call(message, "parent"))
|
14083 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent);
|
14084 | if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize"))
|
14085 | writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize);
|
14086 | if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken"))
|
14087 | writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken);
|
14088 | return writer;
|
14089 | };
|
14090 |
|
14091 | /**
|
14092 | * Encodes the specified ListCustomClassesRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.ListCustomClassesRequest.verify|verify} messages.
|
14093 | * @function encodeDelimited
|
14094 | * @memberof google.cloud.speech.v1p1beta1.ListCustomClassesRequest
|
14095 | * @static
|
14096 | * @param {google.cloud.speech.v1p1beta1.IListCustomClassesRequest} message ListCustomClassesRequest message or plain object to encode
|
14097 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
14098 | * @returns {$protobuf.Writer} Writer
|
14099 | */
|
14100 | ListCustomClassesRequest.encodeDelimited = function encodeDelimited(message, writer) {
|
14101 | return this.encode(message, writer).ldelim();
|
14102 | };
|
14103 |
|
14104 | /**
|
14105 | * Decodes a ListCustomClassesRequest message from the specified reader or buffer.
|
14106 | * @function decode
|
14107 | * @memberof google.cloud.speech.v1p1beta1.ListCustomClassesRequest
|
14108 | * @static
|
14109 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
14110 | * @param {number} [length] Message length if known beforehand
|
14111 | * @returns {google.cloud.speech.v1p1beta1.ListCustomClassesRequest} ListCustomClassesRequest
|
14112 | * @throws {Error} If the payload is not a reader or valid buffer
|
14113 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
14114 | */
|
14115 | ListCustomClassesRequest.decode = function decode(reader, length) {
|
14116 | if (!(reader instanceof $Reader))
|
14117 | reader = $Reader.create(reader);
|
14118 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.ListCustomClassesRequest();
|
14119 | while (reader.pos < end) {
|
14120 | var tag = reader.uint32();
|
14121 | switch (tag >>> 3) {
|
14122 | case 1:
|
14123 | message.parent = reader.string();
|
14124 | break;
|
14125 | case 2:
|
14126 | message.pageSize = reader.int32();
|
14127 | break;
|
14128 | case 3:
|
14129 | message.pageToken = reader.string();
|
14130 | break;
|
14131 | default:
|
14132 | reader.skipType(tag & 7);
|
14133 | break;
|
14134 | }
|
14135 | }
|
14136 | return message;
|
14137 | };
|
14138 |
|
14139 | /**
|
14140 | * Decodes a ListCustomClassesRequest message from the specified reader or buffer, length delimited.
|
14141 | * @function decodeDelimited
|
14142 | * @memberof google.cloud.speech.v1p1beta1.ListCustomClassesRequest
|
14143 | * @static
|
14144 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
14145 | * @returns {google.cloud.speech.v1p1beta1.ListCustomClassesRequest} ListCustomClassesRequest
|
14146 | * @throws {Error} If the payload is not a reader or valid buffer
|
14147 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
14148 | */
|
14149 | ListCustomClassesRequest.decodeDelimited = function decodeDelimited(reader) {
|
14150 | if (!(reader instanceof $Reader))
|
14151 | reader = new $Reader(reader);
|
14152 | return this.decode(reader, reader.uint32());
|
14153 | };
|
14154 |
|
14155 | /**
|
14156 | * Verifies a ListCustomClassesRequest message.
|
14157 | * @function verify
|
14158 | * @memberof google.cloud.speech.v1p1beta1.ListCustomClassesRequest
|
14159 | * @static
|
14160 | * @param {Object.<string,*>} message Plain object to verify
|
14161 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
14162 | */
|
14163 | ListCustomClassesRequest.verify = function verify(message) {
|
14164 | if (typeof message !== "object" || message === null)
|
14165 | return "object expected";
|
14166 | if (message.parent != null && message.hasOwnProperty("parent"))
|
14167 | if (!$util.isString(message.parent))
|
14168 | return "parent: string expected";
|
14169 | if (message.pageSize != null && message.hasOwnProperty("pageSize"))
|
14170 | if (!$util.isInteger(message.pageSize))
|
14171 | return "pageSize: integer expected";
|
14172 | if (message.pageToken != null && message.hasOwnProperty("pageToken"))
|
14173 | if (!$util.isString(message.pageToken))
|
14174 | return "pageToken: string expected";
|
14175 | return null;
|
14176 | };
|
14177 |
|
14178 | /**
|
14179 | * Creates a ListCustomClassesRequest message from a plain object. Also converts values to their respective internal types.
|
14180 | * @function fromObject
|
14181 | * @memberof google.cloud.speech.v1p1beta1.ListCustomClassesRequest
|
14182 | * @static
|
14183 | * @param {Object.<string,*>} object Plain object
|
14184 | * @returns {google.cloud.speech.v1p1beta1.ListCustomClassesRequest} ListCustomClassesRequest
|
14185 | */
|
14186 | ListCustomClassesRequest.fromObject = function fromObject(object) {
|
14187 | if (object instanceof $root.google.cloud.speech.v1p1beta1.ListCustomClassesRequest)
|
14188 | return object;
|
14189 | var message = new $root.google.cloud.speech.v1p1beta1.ListCustomClassesRequest();
|
14190 | if (object.parent != null)
|
14191 | message.parent = String(object.parent);
|
14192 | if (object.pageSize != null)
|
14193 | message.pageSize = object.pageSize | 0;
|
14194 | if (object.pageToken != null)
|
14195 | message.pageToken = String(object.pageToken);
|
14196 | return message;
|
14197 | };
|
14198 |
|
14199 | /**
|
14200 | * Creates a plain object from a ListCustomClassesRequest message. Also converts values to other types if specified.
|
14201 | * @function toObject
|
14202 | * @memberof google.cloud.speech.v1p1beta1.ListCustomClassesRequest
|
14203 | * @static
|
14204 | * @param {google.cloud.speech.v1p1beta1.ListCustomClassesRequest} message ListCustomClassesRequest
|
14205 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
14206 | * @returns {Object.<string,*>} Plain object
|
14207 | */
|
14208 | ListCustomClassesRequest.toObject = function toObject(message, options) {
|
14209 | if (!options)
|
14210 | options = {};
|
14211 | var object = {};
|
14212 | if (options.defaults) {
|
14213 | object.parent = "";
|
14214 | object.pageSize = 0;
|
14215 | object.pageToken = "";
|
14216 | }
|
14217 | if (message.parent != null && message.hasOwnProperty("parent"))
|
14218 | object.parent = message.parent;
|
14219 | if (message.pageSize != null && message.hasOwnProperty("pageSize"))
|
14220 | object.pageSize = message.pageSize;
|
14221 | if (message.pageToken != null && message.hasOwnProperty("pageToken"))
|
14222 | object.pageToken = message.pageToken;
|
14223 | return object;
|
14224 | };
|
14225 |
|
14226 | /**
|
14227 | * Converts this ListCustomClassesRequest to JSON.
|
14228 | * @function toJSON
|
14229 | * @memberof google.cloud.speech.v1p1beta1.ListCustomClassesRequest
|
14230 | * @instance
|
14231 | * @returns {Object.<string,*>} JSON object
|
14232 | */
|
14233 | ListCustomClassesRequest.prototype.toJSON = function toJSON() {
|
14234 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
14235 | };
|
14236 |
|
14237 | return ListCustomClassesRequest;
|
14238 | })();
|
14239 |
|
14240 | v1p1beta1.ListCustomClassesResponse = (function() {
|
14241 |
|
14242 | /**
|
14243 | * Properties of a ListCustomClassesResponse.
|
14244 | * @memberof google.cloud.speech.v1p1beta1
|
14245 | * @interface IListCustomClassesResponse
|
14246 | * @property {Array.<google.cloud.speech.v1p1beta1.ICustomClass>|null} [customClasses] ListCustomClassesResponse customClasses
|
14247 | * @property {string|null} [nextPageToken] ListCustomClassesResponse nextPageToken
|
14248 | */
|
14249 |
|
14250 | /**
|
14251 | * Constructs a new ListCustomClassesResponse.
|
14252 | * @memberof google.cloud.speech.v1p1beta1
|
14253 | * @classdesc Represents a ListCustomClassesResponse.
|
14254 | * @implements IListCustomClassesResponse
|
14255 | * @constructor
|
14256 | * @param {google.cloud.speech.v1p1beta1.IListCustomClassesResponse=} [properties] Properties to set
|
14257 | */
|
14258 | function ListCustomClassesResponse(properties) {
|
14259 | this.customClasses = [];
|
14260 | if (properties)
|
14261 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
14262 | if (properties[keys[i]] != null)
|
14263 | this[keys[i]] = properties[keys[i]];
|
14264 | }
|
14265 |
|
14266 | /**
|
14267 | * ListCustomClassesResponse customClasses.
|
14268 | * @member {Array.<google.cloud.speech.v1p1beta1.ICustomClass>} customClasses
|
14269 | * @memberof google.cloud.speech.v1p1beta1.ListCustomClassesResponse
|
14270 | * @instance
|
14271 | */
|
14272 | ListCustomClassesResponse.prototype.customClasses = $util.emptyArray;
|
14273 |
|
14274 | /**
|
14275 | * ListCustomClassesResponse nextPageToken.
|
14276 | * @member {string} nextPageToken
|
14277 | * @memberof google.cloud.speech.v1p1beta1.ListCustomClassesResponse
|
14278 | * @instance
|
14279 | */
|
14280 | ListCustomClassesResponse.prototype.nextPageToken = "";
|
14281 |
|
14282 | /**
|
14283 | * Creates a new ListCustomClassesResponse instance using the specified properties.
|
14284 | * @function create
|
14285 | * @memberof google.cloud.speech.v1p1beta1.ListCustomClassesResponse
|
14286 | * @static
|
14287 | * @param {google.cloud.speech.v1p1beta1.IListCustomClassesResponse=} [properties] Properties to set
|
14288 | * @returns {google.cloud.speech.v1p1beta1.ListCustomClassesResponse} ListCustomClassesResponse instance
|
14289 | */
|
14290 | ListCustomClassesResponse.create = function create(properties) {
|
14291 | return new ListCustomClassesResponse(properties);
|
14292 | };
|
14293 |
|
14294 | /**
|
14295 | * Encodes the specified ListCustomClassesResponse message. Does not implicitly {@link google.cloud.speech.v1p1beta1.ListCustomClassesResponse.verify|verify} messages.
|
14296 | * @function encode
|
14297 | * @memberof google.cloud.speech.v1p1beta1.ListCustomClassesResponse
|
14298 | * @static
|
14299 | * @param {google.cloud.speech.v1p1beta1.IListCustomClassesResponse} message ListCustomClassesResponse message or plain object to encode
|
14300 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
14301 | * @returns {$protobuf.Writer} Writer
|
14302 | */
|
14303 | ListCustomClassesResponse.encode = function encode(message, writer) {
|
14304 | if (!writer)
|
14305 | writer = $Writer.create();
|
14306 | if (message.customClasses != null && message.customClasses.length)
|
14307 | for (var i = 0; i < message.customClasses.length; ++i)
|
14308 | $root.google.cloud.speech.v1p1beta1.CustomClass.encode(message.customClasses[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
14309 | if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken"))
|
14310 | writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken);
|
14311 | return writer;
|
14312 | };
|
14313 |
|
14314 | /**
|
14315 | * Encodes the specified ListCustomClassesResponse message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.ListCustomClassesResponse.verify|verify} messages.
|
14316 | * @function encodeDelimited
|
14317 | * @memberof google.cloud.speech.v1p1beta1.ListCustomClassesResponse
|
14318 | * @static
|
14319 | * @param {google.cloud.speech.v1p1beta1.IListCustomClassesResponse} message ListCustomClassesResponse message or plain object to encode
|
14320 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
14321 | * @returns {$protobuf.Writer} Writer
|
14322 | */
|
14323 | ListCustomClassesResponse.encodeDelimited = function encodeDelimited(message, writer) {
|
14324 | return this.encode(message, writer).ldelim();
|
14325 | };
|
14326 |
|
14327 | /**
|
14328 | * Decodes a ListCustomClassesResponse message from the specified reader or buffer.
|
14329 | * @function decode
|
14330 | * @memberof google.cloud.speech.v1p1beta1.ListCustomClassesResponse
|
14331 | * @static
|
14332 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
14333 | * @param {number} [length] Message length if known beforehand
|
14334 | * @returns {google.cloud.speech.v1p1beta1.ListCustomClassesResponse} ListCustomClassesResponse
|
14335 | * @throws {Error} If the payload is not a reader or valid buffer
|
14336 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
14337 | */
|
14338 | ListCustomClassesResponse.decode = function decode(reader, length) {
|
14339 | if (!(reader instanceof $Reader))
|
14340 | reader = $Reader.create(reader);
|
14341 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.ListCustomClassesResponse();
|
14342 | while (reader.pos < end) {
|
14343 | var tag = reader.uint32();
|
14344 | switch (tag >>> 3) {
|
14345 | case 1:
|
14346 | if (!(message.customClasses && message.customClasses.length))
|
14347 | message.customClasses = [];
|
14348 | message.customClasses.push($root.google.cloud.speech.v1p1beta1.CustomClass.decode(reader, reader.uint32()));
|
14349 | break;
|
14350 | case 2:
|
14351 | message.nextPageToken = reader.string();
|
14352 | break;
|
14353 | default:
|
14354 | reader.skipType(tag & 7);
|
14355 | break;
|
14356 | }
|
14357 | }
|
14358 | return message;
|
14359 | };
|
14360 |
|
14361 | /**
|
14362 | * Decodes a ListCustomClassesResponse message from the specified reader or buffer, length delimited.
|
14363 | * @function decodeDelimited
|
14364 | * @memberof google.cloud.speech.v1p1beta1.ListCustomClassesResponse
|
14365 | * @static
|
14366 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
14367 | * @returns {google.cloud.speech.v1p1beta1.ListCustomClassesResponse} ListCustomClassesResponse
|
14368 | * @throws {Error} If the payload is not a reader or valid buffer
|
14369 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
14370 | */
|
14371 | ListCustomClassesResponse.decodeDelimited = function decodeDelimited(reader) {
|
14372 | if (!(reader instanceof $Reader))
|
14373 | reader = new $Reader(reader);
|
14374 | return this.decode(reader, reader.uint32());
|
14375 | };
|
14376 |
|
14377 | /**
|
14378 | * Verifies a ListCustomClassesResponse message.
|
14379 | * @function verify
|
14380 | * @memberof google.cloud.speech.v1p1beta1.ListCustomClassesResponse
|
14381 | * @static
|
14382 | * @param {Object.<string,*>} message Plain object to verify
|
14383 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
14384 | */
|
14385 | ListCustomClassesResponse.verify = function verify(message) {
|
14386 | if (typeof message !== "object" || message === null)
|
14387 | return "object expected";
|
14388 | if (message.customClasses != null && message.hasOwnProperty("customClasses")) {
|
14389 | if (!Array.isArray(message.customClasses))
|
14390 | return "customClasses: array expected";
|
14391 | for (var i = 0; i < message.customClasses.length; ++i) {
|
14392 | var error = $root.google.cloud.speech.v1p1beta1.CustomClass.verify(message.customClasses[i]);
|
14393 | if (error)
|
14394 | return "customClasses." + error;
|
14395 | }
|
14396 | }
|
14397 | if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken"))
|
14398 | if (!$util.isString(message.nextPageToken))
|
14399 | return "nextPageToken: string expected";
|
14400 | return null;
|
14401 | };
|
14402 |
|
14403 | /**
|
14404 | * Creates a ListCustomClassesResponse message from a plain object. Also converts values to their respective internal types.
|
14405 | * @function fromObject
|
14406 | * @memberof google.cloud.speech.v1p1beta1.ListCustomClassesResponse
|
14407 | * @static
|
14408 | * @param {Object.<string,*>} object Plain object
|
14409 | * @returns {google.cloud.speech.v1p1beta1.ListCustomClassesResponse} ListCustomClassesResponse
|
14410 | */
|
14411 | ListCustomClassesResponse.fromObject = function fromObject(object) {
|
14412 | if (object instanceof $root.google.cloud.speech.v1p1beta1.ListCustomClassesResponse)
|
14413 | return object;
|
14414 | var message = new $root.google.cloud.speech.v1p1beta1.ListCustomClassesResponse();
|
14415 | if (object.customClasses) {
|
14416 | if (!Array.isArray(object.customClasses))
|
14417 | throw TypeError(".google.cloud.speech.v1p1beta1.ListCustomClassesResponse.customClasses: array expected");
|
14418 | message.customClasses = [];
|
14419 | for (var i = 0; i < object.customClasses.length; ++i) {
|
14420 | if (typeof object.customClasses[i] !== "object")
|
14421 | throw TypeError(".google.cloud.speech.v1p1beta1.ListCustomClassesResponse.customClasses: object expected");
|
14422 | message.customClasses[i] = $root.google.cloud.speech.v1p1beta1.CustomClass.fromObject(object.customClasses[i]);
|
14423 | }
|
14424 | }
|
14425 | if (object.nextPageToken != null)
|
14426 | message.nextPageToken = String(object.nextPageToken);
|
14427 | return message;
|
14428 | };
|
14429 |
|
14430 | /**
|
14431 | * Creates a plain object from a ListCustomClassesResponse message. Also converts values to other types if specified.
|
14432 | * @function toObject
|
14433 | * @memberof google.cloud.speech.v1p1beta1.ListCustomClassesResponse
|
14434 | * @static
|
14435 | * @param {google.cloud.speech.v1p1beta1.ListCustomClassesResponse} message ListCustomClassesResponse
|
14436 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
14437 | * @returns {Object.<string,*>} Plain object
|
14438 | */
|
14439 | ListCustomClassesResponse.toObject = function toObject(message, options) {
|
14440 | if (!options)
|
14441 | options = {};
|
14442 | var object = {};
|
14443 | if (options.arrays || options.defaults)
|
14444 | object.customClasses = [];
|
14445 | if (options.defaults)
|
14446 | object.nextPageToken = "";
|
14447 | if (message.customClasses && message.customClasses.length) {
|
14448 | object.customClasses = [];
|
14449 | for (var j = 0; j < message.customClasses.length; ++j)
|
14450 | object.customClasses[j] = $root.google.cloud.speech.v1p1beta1.CustomClass.toObject(message.customClasses[j], options);
|
14451 | }
|
14452 | if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken"))
|
14453 | object.nextPageToken = message.nextPageToken;
|
14454 | return object;
|
14455 | };
|
14456 |
|
14457 | /**
|
14458 | * Converts this ListCustomClassesResponse to JSON.
|
14459 | * @function toJSON
|
14460 | * @memberof google.cloud.speech.v1p1beta1.ListCustomClassesResponse
|
14461 | * @instance
|
14462 | * @returns {Object.<string,*>} JSON object
|
14463 | */
|
14464 | ListCustomClassesResponse.prototype.toJSON = function toJSON() {
|
14465 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
14466 | };
|
14467 |
|
14468 | return ListCustomClassesResponse;
|
14469 | })();
|
14470 |
|
14471 | v1p1beta1.DeleteCustomClassRequest = (function() {
|
14472 |
|
14473 | /**
|
14474 | * Properties of a DeleteCustomClassRequest.
|
14475 | * @memberof google.cloud.speech.v1p1beta1
|
14476 | * @interface IDeleteCustomClassRequest
|
14477 | * @property {string|null} [name] DeleteCustomClassRequest name
|
14478 | */
|
14479 |
|
14480 | /**
|
14481 | * Constructs a new DeleteCustomClassRequest.
|
14482 | * @memberof google.cloud.speech.v1p1beta1
|
14483 | * @classdesc Represents a DeleteCustomClassRequest.
|
14484 | * @implements IDeleteCustomClassRequest
|
14485 | * @constructor
|
14486 | * @param {google.cloud.speech.v1p1beta1.IDeleteCustomClassRequest=} [properties] Properties to set
|
14487 | */
|
14488 | function DeleteCustomClassRequest(properties) {
|
14489 | if (properties)
|
14490 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
14491 | if (properties[keys[i]] != null)
|
14492 | this[keys[i]] = properties[keys[i]];
|
14493 | }
|
14494 |
|
14495 | /**
|
14496 | * DeleteCustomClassRequest name.
|
14497 | * @member {string} name
|
14498 | * @memberof google.cloud.speech.v1p1beta1.DeleteCustomClassRequest
|
14499 | * @instance
|
14500 | */
|
14501 | DeleteCustomClassRequest.prototype.name = "";
|
14502 |
|
14503 | /**
|
14504 | * Creates a new DeleteCustomClassRequest instance using the specified properties.
|
14505 | * @function create
|
14506 | * @memberof google.cloud.speech.v1p1beta1.DeleteCustomClassRequest
|
14507 | * @static
|
14508 | * @param {google.cloud.speech.v1p1beta1.IDeleteCustomClassRequest=} [properties] Properties to set
|
14509 | * @returns {google.cloud.speech.v1p1beta1.DeleteCustomClassRequest} DeleteCustomClassRequest instance
|
14510 | */
|
14511 | DeleteCustomClassRequest.create = function create(properties) {
|
14512 | return new DeleteCustomClassRequest(properties);
|
14513 | };
|
14514 |
|
14515 | /**
|
14516 | * Encodes the specified DeleteCustomClassRequest message. Does not implicitly {@link google.cloud.speech.v1p1beta1.DeleteCustomClassRequest.verify|verify} messages.
|
14517 | * @function encode
|
14518 | * @memberof google.cloud.speech.v1p1beta1.DeleteCustomClassRequest
|
14519 | * @static
|
14520 | * @param {google.cloud.speech.v1p1beta1.IDeleteCustomClassRequest} message DeleteCustomClassRequest message or plain object to encode
|
14521 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
14522 | * @returns {$protobuf.Writer} Writer
|
14523 | */
|
14524 | DeleteCustomClassRequest.encode = function encode(message, writer) {
|
14525 | if (!writer)
|
14526 | writer = $Writer.create();
|
14527 | if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
14528 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
|
14529 | return writer;
|
14530 | };
|
14531 |
|
14532 | /**
|
14533 | * Encodes the specified DeleteCustomClassRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.DeleteCustomClassRequest.verify|verify} messages.
|
14534 | * @function encodeDelimited
|
14535 | * @memberof google.cloud.speech.v1p1beta1.DeleteCustomClassRequest
|
14536 | * @static
|
14537 | * @param {google.cloud.speech.v1p1beta1.IDeleteCustomClassRequest} message DeleteCustomClassRequest message or plain object to encode
|
14538 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
14539 | * @returns {$protobuf.Writer} Writer
|
14540 | */
|
14541 | DeleteCustomClassRequest.encodeDelimited = function encodeDelimited(message, writer) {
|
14542 | return this.encode(message, writer).ldelim();
|
14543 | };
|
14544 |
|
14545 | /**
|
14546 | * Decodes a DeleteCustomClassRequest message from the specified reader or buffer.
|
14547 | * @function decode
|
14548 | * @memberof google.cloud.speech.v1p1beta1.DeleteCustomClassRequest
|
14549 | * @static
|
14550 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
14551 | * @param {number} [length] Message length if known beforehand
|
14552 | * @returns {google.cloud.speech.v1p1beta1.DeleteCustomClassRequest} DeleteCustomClassRequest
|
14553 | * @throws {Error} If the payload is not a reader or valid buffer
|
14554 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
14555 | */
|
14556 | DeleteCustomClassRequest.decode = function decode(reader, length) {
|
14557 | if (!(reader instanceof $Reader))
|
14558 | reader = $Reader.create(reader);
|
14559 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest();
|
14560 | while (reader.pos < end) {
|
14561 | var tag = reader.uint32();
|
14562 | switch (tag >>> 3) {
|
14563 | case 1:
|
14564 | message.name = reader.string();
|
14565 | break;
|
14566 | default:
|
14567 | reader.skipType(tag & 7);
|
14568 | break;
|
14569 | }
|
14570 | }
|
14571 | return message;
|
14572 | };
|
14573 |
|
14574 | /**
|
14575 | * Decodes a DeleteCustomClassRequest message from the specified reader or buffer, length delimited.
|
14576 | * @function decodeDelimited
|
14577 | * @memberof google.cloud.speech.v1p1beta1.DeleteCustomClassRequest
|
14578 | * @static
|
14579 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
14580 | * @returns {google.cloud.speech.v1p1beta1.DeleteCustomClassRequest} DeleteCustomClassRequest
|
14581 | * @throws {Error} If the payload is not a reader or valid buffer
|
14582 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
14583 | */
|
14584 | DeleteCustomClassRequest.decodeDelimited = function decodeDelimited(reader) {
|
14585 | if (!(reader instanceof $Reader))
|
14586 | reader = new $Reader(reader);
|
14587 | return this.decode(reader, reader.uint32());
|
14588 | };
|
14589 |
|
14590 | /**
|
14591 | * Verifies a DeleteCustomClassRequest message.
|
14592 | * @function verify
|
14593 | * @memberof google.cloud.speech.v1p1beta1.DeleteCustomClassRequest
|
14594 | * @static
|
14595 | * @param {Object.<string,*>} message Plain object to verify
|
14596 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
14597 | */
|
14598 | DeleteCustomClassRequest.verify = function verify(message) {
|
14599 | if (typeof message !== "object" || message === null)
|
14600 | return "object expected";
|
14601 | if (message.name != null && message.hasOwnProperty("name"))
|
14602 | if (!$util.isString(message.name))
|
14603 | return "name: string expected";
|
14604 | return null;
|
14605 | };
|
14606 |
|
14607 | /**
|
14608 | * Creates a DeleteCustomClassRequest message from a plain object. Also converts values to their respective internal types.
|
14609 | * @function fromObject
|
14610 | * @memberof google.cloud.speech.v1p1beta1.DeleteCustomClassRequest
|
14611 | * @static
|
14612 | * @param {Object.<string,*>} object Plain object
|
14613 | * @returns {google.cloud.speech.v1p1beta1.DeleteCustomClassRequest} DeleteCustomClassRequest
|
14614 | */
|
14615 | DeleteCustomClassRequest.fromObject = function fromObject(object) {
|
14616 | if (object instanceof $root.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest)
|
14617 | return object;
|
14618 | var message = new $root.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest();
|
14619 | if (object.name != null)
|
14620 | message.name = String(object.name);
|
14621 | return message;
|
14622 | };
|
14623 |
|
14624 | /**
|
14625 | * Creates a plain object from a DeleteCustomClassRequest message. Also converts values to other types if specified.
|
14626 | * @function toObject
|
14627 | * @memberof google.cloud.speech.v1p1beta1.DeleteCustomClassRequest
|
14628 | * @static
|
14629 | * @param {google.cloud.speech.v1p1beta1.DeleteCustomClassRequest} message DeleteCustomClassRequest
|
14630 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
14631 | * @returns {Object.<string,*>} Plain object
|
14632 | */
|
14633 | DeleteCustomClassRequest.toObject = function toObject(message, options) {
|
14634 | if (!options)
|
14635 | options = {};
|
14636 | var object = {};
|
14637 | if (options.defaults)
|
14638 | object.name = "";
|
14639 | if (message.name != null && message.hasOwnProperty("name"))
|
14640 | object.name = message.name;
|
14641 | return object;
|
14642 | };
|
14643 |
|
14644 | /**
|
14645 | * Converts this DeleteCustomClassRequest to JSON.
|
14646 | * @function toJSON
|
14647 | * @memberof google.cloud.speech.v1p1beta1.DeleteCustomClassRequest
|
14648 | * @instance
|
14649 | * @returns {Object.<string,*>} JSON object
|
14650 | */
|
14651 | DeleteCustomClassRequest.prototype.toJSON = function toJSON() {
|
14652 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
14653 | };
|
14654 |
|
14655 | return DeleteCustomClassRequest;
|
14656 | })();
|
14657 |
|
14658 | return v1p1beta1;
|
14659 | })();
|
14660 |
|
14661 | return speech;
|
14662 | })();
|
14663 |
|
14664 | return cloud;
|
14665 | })();
|
14666 |
|
14667 | google.api = (function() {
|
14668 |
|
14669 | /**
|
14670 | * Namespace api.
|
14671 | * @memberof google
|
14672 | * @namespace
|
14673 | */
|
14674 | var api = {};
|
14675 |
|
14676 | api.Http = (function() {
|
14677 |
|
14678 | /**
|
14679 | * Properties of a Http.
|
14680 | * @memberof google.api
|
14681 | * @interface IHttp
|
14682 | * @property {Array.<google.api.IHttpRule>|null} [rules] Http rules
|
14683 | * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion
|
14684 | */
|
14685 |
|
14686 | /**
|
14687 | * Constructs a new Http.
|
14688 | * @memberof google.api
|
14689 | * @classdesc Represents a Http.
|
14690 | * @implements IHttp
|
14691 | * @constructor
|
14692 | * @param {google.api.IHttp=} [properties] Properties to set
|
14693 | */
|
14694 | function Http(properties) {
|
14695 | this.rules = [];
|
14696 | if (properties)
|
14697 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
14698 | if (properties[keys[i]] != null)
|
14699 | this[keys[i]] = properties[keys[i]];
|
14700 | }
|
14701 |
|
14702 | /**
|
14703 | * Http rules.
|
14704 | * @member {Array.<google.api.IHttpRule>} rules
|
14705 | * @memberof google.api.Http
|
14706 | * @instance
|
14707 | */
|
14708 | Http.prototype.rules = $util.emptyArray;
|
14709 |
|
14710 | /**
|
14711 | * Http fullyDecodeReservedExpansion.
|
14712 | * @member {boolean} fullyDecodeReservedExpansion
|
14713 | * @memberof google.api.Http
|
14714 | * @instance
|
14715 | */
|
14716 | Http.prototype.fullyDecodeReservedExpansion = false;
|
14717 |
|
14718 | /**
|
14719 | * Creates a new Http instance using the specified properties.
|
14720 | * @function create
|
14721 | * @memberof google.api.Http
|
14722 | * @static
|
14723 | * @param {google.api.IHttp=} [properties] Properties to set
|
14724 | * @returns {google.api.Http} Http instance
|
14725 | */
|
14726 | Http.create = function create(properties) {
|
14727 | return new Http(properties);
|
14728 | };
|
14729 |
|
14730 | /**
|
14731 | * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages.
|
14732 | * @function encode
|
14733 | * @memberof google.api.Http
|
14734 | * @static
|
14735 | * @param {google.api.IHttp} message Http message or plain object to encode
|
14736 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
14737 | * @returns {$protobuf.Writer} Writer
|
14738 | */
|
14739 | Http.encode = function encode(message, writer) {
|
14740 | if (!writer)
|
14741 | writer = $Writer.create();
|
14742 | if (message.rules != null && message.rules.length)
|
14743 | for (var i = 0; i < message.rules.length; ++i)
|
14744 | $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
14745 | if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion"))
|
14746 | writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion);
|
14747 | return writer;
|
14748 | };
|
14749 |
|
14750 | /**
|
14751 | * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages.
|
14752 | * @function encodeDelimited
|
14753 | * @memberof google.api.Http
|
14754 | * @static
|
14755 | * @param {google.api.IHttp} message Http message or plain object to encode
|
14756 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
14757 | * @returns {$protobuf.Writer} Writer
|
14758 | */
|
14759 | Http.encodeDelimited = function encodeDelimited(message, writer) {
|
14760 | return this.encode(message, writer).ldelim();
|
14761 | };
|
14762 |
|
14763 | /**
|
14764 | * Decodes a Http message from the specified reader or buffer.
|
14765 | * @function decode
|
14766 | * @memberof google.api.Http
|
14767 | * @static
|
14768 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
14769 | * @param {number} [length] Message length if known beforehand
|
14770 | * @returns {google.api.Http} Http
|
14771 | * @throws {Error} If the payload is not a reader or valid buffer
|
14772 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
14773 | */
|
14774 | Http.decode = function decode(reader, length) {
|
14775 | if (!(reader instanceof $Reader))
|
14776 | reader = $Reader.create(reader);
|
14777 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http();
|
14778 | while (reader.pos < end) {
|
14779 | var tag = reader.uint32();
|
14780 | switch (tag >>> 3) {
|
14781 | case 1:
|
14782 | if (!(message.rules && message.rules.length))
|
14783 | message.rules = [];
|
14784 | message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32()));
|
14785 | break;
|
14786 | case 2:
|
14787 | message.fullyDecodeReservedExpansion = reader.bool();
|
14788 | break;
|
14789 | default:
|
14790 | reader.skipType(tag & 7);
|
14791 | break;
|
14792 | }
|
14793 | }
|
14794 | return message;
|
14795 | };
|
14796 |
|
14797 | /**
|
14798 | * Decodes a Http message from the specified reader or buffer, length delimited.
|
14799 | * @function decodeDelimited
|
14800 | * @memberof google.api.Http
|
14801 | * @static
|
14802 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
14803 | * @returns {google.api.Http} Http
|
14804 | * @throws {Error} If the payload is not a reader or valid buffer
|
14805 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
14806 | */
|
14807 | Http.decodeDelimited = function decodeDelimited(reader) {
|
14808 | if (!(reader instanceof $Reader))
|
14809 | reader = new $Reader(reader);
|
14810 | return this.decode(reader, reader.uint32());
|
14811 | };
|
14812 |
|
14813 | /**
|
14814 | * Verifies a Http message.
|
14815 | * @function verify
|
14816 | * @memberof google.api.Http
|
14817 | * @static
|
14818 | * @param {Object.<string,*>} message Plain object to verify
|
14819 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
14820 | */
|
14821 | Http.verify = function verify(message) {
|
14822 | if (typeof message !== "object" || message === null)
|
14823 | return "object expected";
|
14824 | if (message.rules != null && message.hasOwnProperty("rules")) {
|
14825 | if (!Array.isArray(message.rules))
|
14826 | return "rules: array expected";
|
14827 | for (var i = 0; i < message.rules.length; ++i) {
|
14828 | var error = $root.google.api.HttpRule.verify(message.rules[i]);
|
14829 | if (error)
|
14830 | return "rules." + error;
|
14831 | }
|
14832 | }
|
14833 | if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion"))
|
14834 | if (typeof message.fullyDecodeReservedExpansion !== "boolean")
|
14835 | return "fullyDecodeReservedExpansion: boolean expected";
|
14836 | return null;
|
14837 | };
|
14838 |
|
14839 | /**
|
14840 | * Creates a Http message from a plain object. Also converts values to their respective internal types.
|
14841 | * @function fromObject
|
14842 | * @memberof google.api.Http
|
14843 | * @static
|
14844 | * @param {Object.<string,*>} object Plain object
|
14845 | * @returns {google.api.Http} Http
|
14846 | */
|
14847 | Http.fromObject = function fromObject(object) {
|
14848 | if (object instanceof $root.google.api.Http)
|
14849 | return object;
|
14850 | var message = new $root.google.api.Http();
|
14851 | if (object.rules) {
|
14852 | if (!Array.isArray(object.rules))
|
14853 | throw TypeError(".google.api.Http.rules: array expected");
|
14854 | message.rules = [];
|
14855 | for (var i = 0; i < object.rules.length; ++i) {
|
14856 | if (typeof object.rules[i] !== "object")
|
14857 | throw TypeError(".google.api.Http.rules: object expected");
|
14858 | message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]);
|
14859 | }
|
14860 | }
|
14861 | if (object.fullyDecodeReservedExpansion != null)
|
14862 | message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion);
|
14863 | return message;
|
14864 | };
|
14865 |
|
14866 | /**
|
14867 | * Creates a plain object from a Http message. Also converts values to other types if specified.
|
14868 | * @function toObject
|
14869 | * @memberof google.api.Http
|
14870 | * @static
|
14871 | * @param {google.api.Http} message Http
|
14872 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
14873 | * @returns {Object.<string,*>} Plain object
|
14874 | */
|
14875 | Http.toObject = function toObject(message, options) {
|
14876 | if (!options)
|
14877 | options = {};
|
14878 | var object = {};
|
14879 | if (options.arrays || options.defaults)
|
14880 | object.rules = [];
|
14881 | if (options.defaults)
|
14882 | object.fullyDecodeReservedExpansion = false;
|
14883 | if (message.rules && message.rules.length) {
|
14884 | object.rules = [];
|
14885 | for (var j = 0; j < message.rules.length; ++j)
|
14886 | object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options);
|
14887 | }
|
14888 | if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion"))
|
14889 | object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion;
|
14890 | return object;
|
14891 | };
|
14892 |
|
14893 | /**
|
14894 | * Converts this Http to JSON.
|
14895 | * @function toJSON
|
14896 | * @memberof google.api.Http
|
14897 | * @instance
|
14898 | * @returns {Object.<string,*>} JSON object
|
14899 | */
|
14900 | Http.prototype.toJSON = function toJSON() {
|
14901 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
14902 | };
|
14903 |
|
14904 | return Http;
|
14905 | })();
|
14906 |
|
14907 | api.HttpRule = (function() {
|
14908 |
|
14909 | /**
|
14910 | * Properties of a HttpRule.
|
14911 | * @memberof google.api
|
14912 | * @interface IHttpRule
|
14913 | * @property {string|null} [selector] HttpRule selector
|
14914 | * @property {string|null} [get] HttpRule get
|
14915 | * @property {string|null} [put] HttpRule put
|
14916 | * @property {string|null} [post] HttpRule post
|
14917 | * @property {string|null} ["delete"] HttpRule delete
|
14918 | * @property {string|null} [patch] HttpRule patch
|
14919 | * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom
|
14920 | * @property {string|null} [body] HttpRule body
|
14921 | * @property {string|null} [responseBody] HttpRule responseBody
|
14922 | * @property {Array.<google.api.IHttpRule>|null} [additionalBindings] HttpRule additionalBindings
|
14923 | */
|
14924 |
|
14925 | /**
|
14926 | * Constructs a new HttpRule.
|
14927 | * @memberof google.api
|
14928 | * @classdesc Represents a HttpRule.
|
14929 | * @implements IHttpRule
|
14930 | * @constructor
|
14931 | * @param {google.api.IHttpRule=} [properties] Properties to set
|
14932 | */
|
14933 | function HttpRule(properties) {
|
14934 | this.additionalBindings = [];
|
14935 | if (properties)
|
14936 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
14937 | if (properties[keys[i]] != null)
|
14938 | this[keys[i]] = properties[keys[i]];
|
14939 | }
|
14940 |
|
14941 | /**
|
14942 | * HttpRule selector.
|
14943 | * @member {string} selector
|
14944 | * @memberof google.api.HttpRule
|
14945 | * @instance
|
14946 | */
|
14947 | HttpRule.prototype.selector = "";
|
14948 |
|
14949 | /**
|
14950 | * HttpRule get.
|
14951 | * @member {string|null|undefined} get
|
14952 | * @memberof google.api.HttpRule
|
14953 | * @instance
|
14954 | */
|
14955 | HttpRule.prototype.get = null;
|
14956 |
|
14957 | /**
|
14958 | * HttpRule put.
|
14959 | * @member {string|null|undefined} put
|
14960 | * @memberof google.api.HttpRule
|
14961 | * @instance
|
14962 | */
|
14963 | HttpRule.prototype.put = null;
|
14964 |
|
14965 | /**
|
14966 | * HttpRule post.
|
14967 | * @member {string|null|undefined} post
|
14968 | * @memberof google.api.HttpRule
|
14969 | * @instance
|
14970 | */
|
14971 | HttpRule.prototype.post = null;
|
14972 |
|
14973 | /**
|
14974 | * HttpRule delete.
|
14975 | * @member {string|null|undefined} delete
|
14976 | * @memberof google.api.HttpRule
|
14977 | * @instance
|
14978 | */
|
14979 | HttpRule.prototype["delete"] = null;
|
14980 |
|
14981 | /**
|
14982 | * HttpRule patch.
|
14983 | * @member {string|null|undefined} patch
|
14984 | * @memberof google.api.HttpRule
|
14985 | * @instance
|
14986 | */
|
14987 | HttpRule.prototype.patch = null;
|
14988 |
|
14989 | /**
|
14990 | * HttpRule custom.
|
14991 | * @member {google.api.ICustomHttpPattern|null|undefined} custom
|
14992 | * @memberof google.api.HttpRule
|
14993 | * @instance
|
14994 | */
|
14995 | HttpRule.prototype.custom = null;
|
14996 |
|
14997 | /**
|
14998 | * HttpRule body.
|
14999 | * @member {string} body
|
15000 | * @memberof google.api.HttpRule
|
15001 | * @instance
|
15002 | */
|
15003 | HttpRule.prototype.body = "";
|
15004 |
|
15005 | /**
|
15006 | * HttpRule responseBody.
|
15007 | * @member {string} responseBody
|
15008 | * @memberof google.api.HttpRule
|
15009 | * @instance
|
15010 | */
|
15011 | HttpRule.prototype.responseBody = "";
|
15012 |
|
15013 | /**
|
15014 | * HttpRule additionalBindings.
|
15015 | * @member {Array.<google.api.IHttpRule>} additionalBindings
|
15016 | * @memberof google.api.HttpRule
|
15017 | * @instance
|
15018 | */
|
15019 | HttpRule.prototype.additionalBindings = $util.emptyArray;
|
15020 |
|
15021 | // OneOf field names bound to virtual getters and setters
|
15022 | var $oneOfFields;
|
15023 |
|
15024 | /**
|
15025 | * HttpRule pattern.
|
15026 | * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern
|
15027 | * @memberof google.api.HttpRule
|
15028 | * @instance
|
15029 | */
|
15030 | Object.defineProperty(HttpRule.prototype, "pattern", {
|
15031 | get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]),
|
15032 | set: $util.oneOfSetter($oneOfFields)
|
15033 | });
|
15034 |
|
15035 | /**
|
15036 | * Creates a new HttpRule instance using the specified properties.
|
15037 | * @function create
|
15038 | * @memberof google.api.HttpRule
|
15039 | * @static
|
15040 | * @param {google.api.IHttpRule=} [properties] Properties to set
|
15041 | * @returns {google.api.HttpRule} HttpRule instance
|
15042 | */
|
15043 | HttpRule.create = function create(properties) {
|
15044 | return new HttpRule(properties);
|
15045 | };
|
15046 |
|
15047 | /**
|
15048 | * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages.
|
15049 | * @function encode
|
15050 | * @memberof google.api.HttpRule
|
15051 | * @static
|
15052 | * @param {google.api.IHttpRule} message HttpRule message or plain object to encode
|
15053 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
15054 | * @returns {$protobuf.Writer} Writer
|
15055 | */
|
15056 | HttpRule.encode = function encode(message, writer) {
|
15057 | if (!writer)
|
15058 | writer = $Writer.create();
|
15059 | if (message.selector != null && Object.hasOwnProperty.call(message, "selector"))
|
15060 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector);
|
15061 | if (message.get != null && Object.hasOwnProperty.call(message, "get"))
|
15062 | writer.uint32(/* id 2, wireType 2 =*/18).string(message.get);
|
15063 | if (message.put != null && Object.hasOwnProperty.call(message, "put"))
|
15064 | writer.uint32(/* id 3, wireType 2 =*/26).string(message.put);
|
15065 | if (message.post != null && Object.hasOwnProperty.call(message, "post"))
|
15066 | writer.uint32(/* id 4, wireType 2 =*/34).string(message.post);
|
15067 | if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete"))
|
15068 | writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]);
|
15069 | if (message.patch != null && Object.hasOwnProperty.call(message, "patch"))
|
15070 | writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch);
|
15071 | if (message.body != null && Object.hasOwnProperty.call(message, "body"))
|
15072 | writer.uint32(/* id 7, wireType 2 =*/58).string(message.body);
|
15073 | if (message.custom != null && Object.hasOwnProperty.call(message, "custom"))
|
15074 | $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();
|
15075 | if (message.additionalBindings != null && message.additionalBindings.length)
|
15076 | for (var i = 0; i < message.additionalBindings.length; ++i)
|
15077 | $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim();
|
15078 | if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody"))
|
15079 | writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody);
|
15080 | return writer;
|
15081 | };
|
15082 |
|
15083 | /**
|
15084 | * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages.
|
15085 | * @function encodeDelimited
|
15086 | * @memberof google.api.HttpRule
|
15087 | * @static
|
15088 | * @param {google.api.IHttpRule} message HttpRule message or plain object to encode
|
15089 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
15090 | * @returns {$protobuf.Writer} Writer
|
15091 | */
|
15092 | HttpRule.encodeDelimited = function encodeDelimited(message, writer) {
|
15093 | return this.encode(message, writer).ldelim();
|
15094 | };
|
15095 |
|
15096 | /**
|
15097 | * Decodes a HttpRule message from the specified reader or buffer.
|
15098 | * @function decode
|
15099 | * @memberof google.api.HttpRule
|
15100 | * @static
|
15101 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
15102 | * @param {number} [length] Message length if known beforehand
|
15103 | * @returns {google.api.HttpRule} HttpRule
|
15104 | * @throws {Error} If the payload is not a reader or valid buffer
|
15105 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
15106 | */
|
15107 | HttpRule.decode = function decode(reader, length) {
|
15108 | if (!(reader instanceof $Reader))
|
15109 | reader = $Reader.create(reader);
|
15110 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule();
|
15111 | while (reader.pos < end) {
|
15112 | var tag = reader.uint32();
|
15113 | switch (tag >>> 3) {
|
15114 | case 1:
|
15115 | message.selector = reader.string();
|
15116 | break;
|
15117 | case 2:
|
15118 | message.get = reader.string();
|
15119 | break;
|
15120 | case 3:
|
15121 | message.put = reader.string();
|
15122 | break;
|
15123 | case 4:
|
15124 | message.post = reader.string();
|
15125 | break;
|
15126 | case 5:
|
15127 | message["delete"] = reader.string();
|
15128 | break;
|
15129 | case 6:
|
15130 | message.patch = reader.string();
|
15131 | break;
|
15132 | case 8:
|
15133 | message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32());
|
15134 | break;
|
15135 | case 7:
|
15136 | message.body = reader.string();
|
15137 | break;
|
15138 | case 12:
|
15139 | message.responseBody = reader.string();
|
15140 | break;
|
15141 | case 11:
|
15142 | if (!(message.additionalBindings && message.additionalBindings.length))
|
15143 | message.additionalBindings = [];
|
15144 | message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32()));
|
15145 | break;
|
15146 | default:
|
15147 | reader.skipType(tag & 7);
|
15148 | break;
|
15149 | }
|
15150 | }
|
15151 | return message;
|
15152 | };
|
15153 |
|
15154 | /**
|
15155 | * Decodes a HttpRule message from the specified reader or buffer, length delimited.
|
15156 | * @function decodeDelimited
|
15157 | * @memberof google.api.HttpRule
|
15158 | * @static
|
15159 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
15160 | * @returns {google.api.HttpRule} HttpRule
|
15161 | * @throws {Error} If the payload is not a reader or valid buffer
|
15162 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
15163 | */
|
15164 | HttpRule.decodeDelimited = function decodeDelimited(reader) {
|
15165 | if (!(reader instanceof $Reader))
|
15166 | reader = new $Reader(reader);
|
15167 | return this.decode(reader, reader.uint32());
|
15168 | };
|
15169 |
|
15170 | /**
|
15171 | * Verifies a HttpRule message.
|
15172 | * @function verify
|
15173 | * @memberof google.api.HttpRule
|
15174 | * @static
|
15175 | * @param {Object.<string,*>} message Plain object to verify
|
15176 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
15177 | */
|
15178 | HttpRule.verify = function verify(message) {
|
15179 | if (typeof message !== "object" || message === null)
|
15180 | return "object expected";
|
15181 | var properties = {};
|
15182 | if (message.selector != null && message.hasOwnProperty("selector"))
|
15183 | if (!$util.isString(message.selector))
|
15184 | return "selector: string expected";
|
15185 | if (message.get != null && message.hasOwnProperty("get")) {
|
15186 | properties.pattern = 1;
|
15187 | if (!$util.isString(message.get))
|
15188 | return "get: string expected";
|
15189 | }
|
15190 | if (message.put != null && message.hasOwnProperty("put")) {
|
15191 | if (properties.pattern === 1)
|
15192 | return "pattern: multiple values";
|
15193 | properties.pattern = 1;
|
15194 | if (!$util.isString(message.put))
|
15195 | return "put: string expected";
|
15196 | }
|
15197 | if (message.post != null && message.hasOwnProperty("post")) {
|
15198 | if (properties.pattern === 1)
|
15199 | return "pattern: multiple values";
|
15200 | properties.pattern = 1;
|
15201 | if (!$util.isString(message.post))
|
15202 | return "post: string expected";
|
15203 | }
|
15204 | if (message["delete"] != null && message.hasOwnProperty("delete")) {
|
15205 | if (properties.pattern === 1)
|
15206 | return "pattern: multiple values";
|
15207 | properties.pattern = 1;
|
15208 | if (!$util.isString(message["delete"]))
|
15209 | return "delete: string expected";
|
15210 | }
|
15211 | if (message.patch != null && message.hasOwnProperty("patch")) {
|
15212 | if (properties.pattern === 1)
|
15213 | return "pattern: multiple values";
|
15214 | properties.pattern = 1;
|
15215 | if (!$util.isString(message.patch))
|
15216 | return "patch: string expected";
|
15217 | }
|
15218 | if (message.custom != null && message.hasOwnProperty("custom")) {
|
15219 | if (properties.pattern === 1)
|
15220 | return "pattern: multiple values";
|
15221 | properties.pattern = 1;
|
15222 | {
|
15223 | var error = $root.google.api.CustomHttpPattern.verify(message.custom);
|
15224 | if (error)
|
15225 | return "custom." + error;
|
15226 | }
|
15227 | }
|
15228 | if (message.body != null && message.hasOwnProperty("body"))
|
15229 | if (!$util.isString(message.body))
|
15230 | return "body: string expected";
|
15231 | if (message.responseBody != null && message.hasOwnProperty("responseBody"))
|
15232 | if (!$util.isString(message.responseBody))
|
15233 | return "responseBody: string expected";
|
15234 | if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) {
|
15235 | if (!Array.isArray(message.additionalBindings))
|
15236 | return "additionalBindings: array expected";
|
15237 | for (var i = 0; i < message.additionalBindings.length; ++i) {
|
15238 | var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]);
|
15239 | if (error)
|
15240 | return "additionalBindings." + error;
|
15241 | }
|
15242 | }
|
15243 | return null;
|
15244 | };
|
15245 |
|
15246 | /**
|
15247 | * Creates a HttpRule message from a plain object. Also converts values to their respective internal types.
|
15248 | * @function fromObject
|
15249 | * @memberof google.api.HttpRule
|
15250 | * @static
|
15251 | * @param {Object.<string,*>} object Plain object
|
15252 | * @returns {google.api.HttpRule} HttpRule
|
15253 | */
|
15254 | HttpRule.fromObject = function fromObject(object) {
|
15255 | if (object instanceof $root.google.api.HttpRule)
|
15256 | return object;
|
15257 | var message = new $root.google.api.HttpRule();
|
15258 | if (object.selector != null)
|
15259 | message.selector = String(object.selector);
|
15260 | if (object.get != null)
|
15261 | message.get = String(object.get);
|
15262 | if (object.put != null)
|
15263 | message.put = String(object.put);
|
15264 | if (object.post != null)
|
15265 | message.post = String(object.post);
|
15266 | if (object["delete"] != null)
|
15267 | message["delete"] = String(object["delete"]);
|
15268 | if (object.patch != null)
|
15269 | message.patch = String(object.patch);
|
15270 | if (object.custom != null) {
|
15271 | if (typeof object.custom !== "object")
|
15272 | throw TypeError(".google.api.HttpRule.custom: object expected");
|
15273 | message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom);
|
15274 | }
|
15275 | if (object.body != null)
|
15276 | message.body = String(object.body);
|
15277 | if (object.responseBody != null)
|
15278 | message.responseBody = String(object.responseBody);
|
15279 | if (object.additionalBindings) {
|
15280 | if (!Array.isArray(object.additionalBindings))
|
15281 | throw TypeError(".google.api.HttpRule.additionalBindings: array expected");
|
15282 | message.additionalBindings = [];
|
15283 | for (var i = 0; i < object.additionalBindings.length; ++i) {
|
15284 | if (typeof object.additionalBindings[i] !== "object")
|
15285 | throw TypeError(".google.api.HttpRule.additionalBindings: object expected");
|
15286 | message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]);
|
15287 | }
|
15288 | }
|
15289 | return message;
|
15290 | };
|
15291 |
|
15292 | /**
|
15293 | * Creates a plain object from a HttpRule message. Also converts values to other types if specified.
|
15294 | * @function toObject
|
15295 | * @memberof google.api.HttpRule
|
15296 | * @static
|
15297 | * @param {google.api.HttpRule} message HttpRule
|
15298 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
15299 | * @returns {Object.<string,*>} Plain object
|
15300 | */
|
15301 | HttpRule.toObject = function toObject(message, options) {
|
15302 | if (!options)
|
15303 | options = {};
|
15304 | var object = {};
|
15305 | if (options.arrays || options.defaults)
|
15306 | object.additionalBindings = [];
|
15307 | if (options.defaults) {
|
15308 | object.selector = "";
|
15309 | object.body = "";
|
15310 | object.responseBody = "";
|
15311 | }
|
15312 | if (message.selector != null && message.hasOwnProperty("selector"))
|
15313 | object.selector = message.selector;
|
15314 | if (message.get != null && message.hasOwnProperty("get")) {
|
15315 | object.get = message.get;
|
15316 | if (options.oneofs)
|
15317 | object.pattern = "get";
|
15318 | }
|
15319 | if (message.put != null && message.hasOwnProperty("put")) {
|
15320 | object.put = message.put;
|
15321 | if (options.oneofs)
|
15322 | object.pattern = "put";
|
15323 | }
|
15324 | if (message.post != null && message.hasOwnProperty("post")) {
|
15325 | object.post = message.post;
|
15326 | if (options.oneofs)
|
15327 | object.pattern = "post";
|
15328 | }
|
15329 | if (message["delete"] != null && message.hasOwnProperty("delete")) {
|
15330 | object["delete"] = message["delete"];
|
15331 | if (options.oneofs)
|
15332 | object.pattern = "delete";
|
15333 | }
|
15334 | if (message.patch != null && message.hasOwnProperty("patch")) {
|
15335 | object.patch = message.patch;
|
15336 | if (options.oneofs)
|
15337 | object.pattern = "patch";
|
15338 | }
|
15339 | if (message.body != null && message.hasOwnProperty("body"))
|
15340 | object.body = message.body;
|
15341 | if (message.custom != null && message.hasOwnProperty("custom")) {
|
15342 | object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options);
|
15343 | if (options.oneofs)
|
15344 | object.pattern = "custom";
|
15345 | }
|
15346 | if (message.additionalBindings && message.additionalBindings.length) {
|
15347 | object.additionalBindings = [];
|
15348 | for (var j = 0; j < message.additionalBindings.length; ++j)
|
15349 | object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options);
|
15350 | }
|
15351 | if (message.responseBody != null && message.hasOwnProperty("responseBody"))
|
15352 | object.responseBody = message.responseBody;
|
15353 | return object;
|
15354 | };
|
15355 |
|
15356 | /**
|
15357 | * Converts this HttpRule to JSON.
|
15358 | * @function toJSON
|
15359 | * @memberof google.api.HttpRule
|
15360 | * @instance
|
15361 | * @returns {Object.<string,*>} JSON object
|
15362 | */
|
15363 | HttpRule.prototype.toJSON = function toJSON() {
|
15364 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
15365 | };
|
15366 |
|
15367 | return HttpRule;
|
15368 | })();
|
15369 |
|
15370 | api.CustomHttpPattern = (function() {
|
15371 |
|
15372 | /**
|
15373 | * Properties of a CustomHttpPattern.
|
15374 | * @memberof google.api
|
15375 | * @interface ICustomHttpPattern
|
15376 | * @property {string|null} [kind] CustomHttpPattern kind
|
15377 | * @property {string|null} [path] CustomHttpPattern path
|
15378 | */
|
15379 |
|
15380 | /**
|
15381 | * Constructs a new CustomHttpPattern.
|
15382 | * @memberof google.api
|
15383 | * @classdesc Represents a CustomHttpPattern.
|
15384 | * @implements ICustomHttpPattern
|
15385 | * @constructor
|
15386 | * @param {google.api.ICustomHttpPattern=} [properties] Properties to set
|
15387 | */
|
15388 | function CustomHttpPattern(properties) {
|
15389 | if (properties)
|
15390 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
15391 | if (properties[keys[i]] != null)
|
15392 | this[keys[i]] = properties[keys[i]];
|
15393 | }
|
15394 |
|
15395 | /**
|
15396 | * CustomHttpPattern kind.
|
15397 | * @member {string} kind
|
15398 | * @memberof google.api.CustomHttpPattern
|
15399 | * @instance
|
15400 | */
|
15401 | CustomHttpPattern.prototype.kind = "";
|
15402 |
|
15403 | /**
|
15404 | * CustomHttpPattern path.
|
15405 | * @member {string} path
|
15406 | * @memberof google.api.CustomHttpPattern
|
15407 | * @instance
|
15408 | */
|
15409 | CustomHttpPattern.prototype.path = "";
|
15410 |
|
15411 | /**
|
15412 | * Creates a new CustomHttpPattern instance using the specified properties.
|
15413 | * @function create
|
15414 | * @memberof google.api.CustomHttpPattern
|
15415 | * @static
|
15416 | * @param {google.api.ICustomHttpPattern=} [properties] Properties to set
|
15417 | * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance
|
15418 | */
|
15419 | CustomHttpPattern.create = function create(properties) {
|
15420 | return new CustomHttpPattern(properties);
|
15421 | };
|
15422 |
|
15423 | /**
|
15424 | * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages.
|
15425 | * @function encode
|
15426 | * @memberof google.api.CustomHttpPattern
|
15427 | * @static
|
15428 | * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode
|
15429 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
15430 | * @returns {$protobuf.Writer} Writer
|
15431 | */
|
15432 | CustomHttpPattern.encode = function encode(message, writer) {
|
15433 | if (!writer)
|
15434 | writer = $Writer.create();
|
15435 | if (message.kind != null && Object.hasOwnProperty.call(message, "kind"))
|
15436 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind);
|
15437 | if (message.path != null && Object.hasOwnProperty.call(message, "path"))
|
15438 | writer.uint32(/* id 2, wireType 2 =*/18).string(message.path);
|
15439 | return writer;
|
15440 | };
|
15441 |
|
15442 | /**
|
15443 | * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages.
|
15444 | * @function encodeDelimited
|
15445 | * @memberof google.api.CustomHttpPattern
|
15446 | * @static
|
15447 | * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode
|
15448 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
15449 | * @returns {$protobuf.Writer} Writer
|
15450 | */
|
15451 | CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) {
|
15452 | return this.encode(message, writer).ldelim();
|
15453 | };
|
15454 |
|
15455 | /**
|
15456 | * Decodes a CustomHttpPattern message from the specified reader or buffer.
|
15457 | * @function decode
|
15458 | * @memberof google.api.CustomHttpPattern
|
15459 | * @static
|
15460 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
15461 | * @param {number} [length] Message length if known beforehand
|
15462 | * @returns {google.api.CustomHttpPattern} CustomHttpPattern
|
15463 | * @throws {Error} If the payload is not a reader or valid buffer
|
15464 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
15465 | */
|
15466 | CustomHttpPattern.decode = function decode(reader, length) {
|
15467 | if (!(reader instanceof $Reader))
|
15468 | reader = $Reader.create(reader);
|
15469 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern();
|
15470 | while (reader.pos < end) {
|
15471 | var tag = reader.uint32();
|
15472 | switch (tag >>> 3) {
|
15473 | case 1:
|
15474 | message.kind = reader.string();
|
15475 | break;
|
15476 | case 2:
|
15477 | message.path = reader.string();
|
15478 | break;
|
15479 | default:
|
15480 | reader.skipType(tag & 7);
|
15481 | break;
|
15482 | }
|
15483 | }
|
15484 | return message;
|
15485 | };
|
15486 |
|
15487 | /**
|
15488 | * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited.
|
15489 | * @function decodeDelimited
|
15490 | * @memberof google.api.CustomHttpPattern
|
15491 | * @static
|
15492 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
15493 | * @returns {google.api.CustomHttpPattern} CustomHttpPattern
|
15494 | * @throws {Error} If the payload is not a reader or valid buffer
|
15495 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
15496 | */
|
15497 | CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) {
|
15498 | if (!(reader instanceof $Reader))
|
15499 | reader = new $Reader(reader);
|
15500 | return this.decode(reader, reader.uint32());
|
15501 | };
|
15502 |
|
15503 | /**
|
15504 | * Verifies a CustomHttpPattern message.
|
15505 | * @function verify
|
15506 | * @memberof google.api.CustomHttpPattern
|
15507 | * @static
|
15508 | * @param {Object.<string,*>} message Plain object to verify
|
15509 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
15510 | */
|
15511 | CustomHttpPattern.verify = function verify(message) {
|
15512 | if (typeof message !== "object" || message === null)
|
15513 | return "object expected";
|
15514 | if (message.kind != null && message.hasOwnProperty("kind"))
|
15515 | if (!$util.isString(message.kind))
|
15516 | return "kind: string expected";
|
15517 | if (message.path != null && message.hasOwnProperty("path"))
|
15518 | if (!$util.isString(message.path))
|
15519 | return "path: string expected";
|
15520 | return null;
|
15521 | };
|
15522 |
|
15523 | /**
|
15524 | * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types.
|
15525 | * @function fromObject
|
15526 | * @memberof google.api.CustomHttpPattern
|
15527 | * @static
|
15528 | * @param {Object.<string,*>} object Plain object
|
15529 | * @returns {google.api.CustomHttpPattern} CustomHttpPattern
|
15530 | */
|
15531 | CustomHttpPattern.fromObject = function fromObject(object) {
|
15532 | if (object instanceof $root.google.api.CustomHttpPattern)
|
15533 | return object;
|
15534 | var message = new $root.google.api.CustomHttpPattern();
|
15535 | if (object.kind != null)
|
15536 | message.kind = String(object.kind);
|
15537 | if (object.path != null)
|
15538 | message.path = String(object.path);
|
15539 | return message;
|
15540 | };
|
15541 |
|
15542 | /**
|
15543 | * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified.
|
15544 | * @function toObject
|
15545 | * @memberof google.api.CustomHttpPattern
|
15546 | * @static
|
15547 | * @param {google.api.CustomHttpPattern} message CustomHttpPattern
|
15548 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
15549 | * @returns {Object.<string,*>} Plain object
|
15550 | */
|
15551 | CustomHttpPattern.toObject = function toObject(message, options) {
|
15552 | if (!options)
|
15553 | options = {};
|
15554 | var object = {};
|
15555 | if (options.defaults) {
|
15556 | object.kind = "";
|
15557 | object.path = "";
|
15558 | }
|
15559 | if (message.kind != null && message.hasOwnProperty("kind"))
|
15560 | object.kind = message.kind;
|
15561 | if (message.path != null && message.hasOwnProperty("path"))
|
15562 | object.path = message.path;
|
15563 | return object;
|
15564 | };
|
15565 |
|
15566 | /**
|
15567 | * Converts this CustomHttpPattern to JSON.
|
15568 | * @function toJSON
|
15569 | * @memberof google.api.CustomHttpPattern
|
15570 | * @instance
|
15571 | * @returns {Object.<string,*>} JSON object
|
15572 | */
|
15573 | CustomHttpPattern.prototype.toJSON = function toJSON() {
|
15574 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
15575 | };
|
15576 |
|
15577 | return CustomHttpPattern;
|
15578 | })();
|
15579 |
|
15580 | /**
|
15581 | * FieldBehavior enum.
|
15582 | * @name google.api.FieldBehavior
|
15583 | * @enum {number}
|
15584 | * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value
|
15585 | * @property {number} OPTIONAL=1 OPTIONAL value
|
15586 | * @property {number} REQUIRED=2 REQUIRED value
|
15587 | * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value
|
15588 | * @property {number} INPUT_ONLY=4 INPUT_ONLY value
|
15589 | * @property {number} IMMUTABLE=5 IMMUTABLE value
|
15590 | * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value
|
15591 | */
|
15592 | api.FieldBehavior = (function() {
|
15593 | var valuesById = {}, values = Object.create(valuesById);
|
15594 | values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0;
|
15595 | values[valuesById[1] = "OPTIONAL"] = 1;
|
15596 | values[valuesById[2] = "REQUIRED"] = 2;
|
15597 | values[valuesById[3] = "OUTPUT_ONLY"] = 3;
|
15598 | values[valuesById[4] = "INPUT_ONLY"] = 4;
|
15599 | values[valuesById[5] = "IMMUTABLE"] = 5;
|
15600 | values[valuesById[6] = "UNORDERED_LIST"] = 6;
|
15601 | return values;
|
15602 | })();
|
15603 |
|
15604 | api.ResourceDescriptor = (function() {
|
15605 |
|
15606 | /**
|
15607 | * Properties of a ResourceDescriptor.
|
15608 | * @memberof google.api
|
15609 | * @interface IResourceDescriptor
|
15610 | * @property {string|null} [type] ResourceDescriptor type
|
15611 | * @property {Array.<string>|null} [pattern] ResourceDescriptor pattern
|
15612 | * @property {string|null} [nameField] ResourceDescriptor nameField
|
15613 | * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history
|
15614 | * @property {string|null} [plural] ResourceDescriptor plural
|
15615 | * @property {string|null} [singular] ResourceDescriptor singular
|
15616 | * @property {Array.<google.api.ResourceDescriptor.Style>|null} [style] ResourceDescriptor style
|
15617 | */
|
15618 |
|
15619 | /**
|
15620 | * Constructs a new ResourceDescriptor.
|
15621 | * @memberof google.api
|
15622 | * @classdesc Represents a ResourceDescriptor.
|
15623 | * @implements IResourceDescriptor
|
15624 | * @constructor
|
15625 | * @param {google.api.IResourceDescriptor=} [properties] Properties to set
|
15626 | */
|
15627 | function ResourceDescriptor(properties) {
|
15628 | this.pattern = [];
|
15629 | this.style = [];
|
15630 | if (properties)
|
15631 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
15632 | if (properties[keys[i]] != null)
|
15633 | this[keys[i]] = properties[keys[i]];
|
15634 | }
|
15635 |
|
15636 | /**
|
15637 | * ResourceDescriptor type.
|
15638 | * @member {string} type
|
15639 | * @memberof google.api.ResourceDescriptor
|
15640 | * @instance
|
15641 | */
|
15642 | ResourceDescriptor.prototype.type = "";
|
15643 |
|
15644 | /**
|
15645 | * ResourceDescriptor pattern.
|
15646 | * @member {Array.<string>} pattern
|
15647 | * @memberof google.api.ResourceDescriptor
|
15648 | * @instance
|
15649 | */
|
15650 | ResourceDescriptor.prototype.pattern = $util.emptyArray;
|
15651 |
|
15652 | /**
|
15653 | * ResourceDescriptor nameField.
|
15654 | * @member {string} nameField
|
15655 | * @memberof google.api.ResourceDescriptor
|
15656 | * @instance
|
15657 | */
|
15658 | ResourceDescriptor.prototype.nameField = "";
|
15659 |
|
15660 | /**
|
15661 | * ResourceDescriptor history.
|
15662 | * @member {google.api.ResourceDescriptor.History} history
|
15663 | * @memberof google.api.ResourceDescriptor
|
15664 | * @instance
|
15665 | */
|
15666 | ResourceDescriptor.prototype.history = 0;
|
15667 |
|
15668 | /**
|
15669 | * ResourceDescriptor plural.
|
15670 | * @member {string} plural
|
15671 | * @memberof google.api.ResourceDescriptor
|
15672 | * @instance
|
15673 | */
|
15674 | ResourceDescriptor.prototype.plural = "";
|
15675 |
|
15676 | /**
|
15677 | * ResourceDescriptor singular.
|
15678 | * @member {string} singular
|
15679 | * @memberof google.api.ResourceDescriptor
|
15680 | * @instance
|
15681 | */
|
15682 | ResourceDescriptor.prototype.singular = "";
|
15683 |
|
15684 | /**
|
15685 | * ResourceDescriptor style.
|
15686 | * @member {Array.<google.api.ResourceDescriptor.Style>} style
|
15687 | * @memberof google.api.ResourceDescriptor
|
15688 | * @instance
|
15689 | */
|
15690 | ResourceDescriptor.prototype.style = $util.emptyArray;
|
15691 |
|
15692 | /**
|
15693 | * Creates a new ResourceDescriptor instance using the specified properties.
|
15694 | * @function create
|
15695 | * @memberof google.api.ResourceDescriptor
|
15696 | * @static
|
15697 | * @param {google.api.IResourceDescriptor=} [properties] Properties to set
|
15698 | * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance
|
15699 | */
|
15700 | ResourceDescriptor.create = function create(properties) {
|
15701 | return new ResourceDescriptor(properties);
|
15702 | };
|
15703 |
|
15704 | /**
|
15705 | * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages.
|
15706 | * @function encode
|
15707 | * @memberof google.api.ResourceDescriptor
|
15708 | * @static
|
15709 | * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode
|
15710 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
15711 | * @returns {$protobuf.Writer} Writer
|
15712 | */
|
15713 | ResourceDescriptor.encode = function encode(message, writer) {
|
15714 | if (!writer)
|
15715 | writer = $Writer.create();
|
15716 | if (message.type != null && Object.hasOwnProperty.call(message, "type"))
|
15717 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.type);
|
15718 | if (message.pattern != null && message.pattern.length)
|
15719 | for (var i = 0; i < message.pattern.length; ++i)
|
15720 | writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]);
|
15721 | if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField"))
|
15722 | writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField);
|
15723 | if (message.history != null && Object.hasOwnProperty.call(message, "history"))
|
15724 | writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history);
|
15725 | if (message.plural != null && Object.hasOwnProperty.call(message, "plural"))
|
15726 | writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural);
|
15727 | if (message.singular != null && Object.hasOwnProperty.call(message, "singular"))
|
15728 | writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular);
|
15729 | if (message.style != null && message.style.length) {
|
15730 | writer.uint32(/* id 10, wireType 2 =*/82).fork();
|
15731 | for (var i = 0; i < message.style.length; ++i)
|
15732 | writer.int32(message.style[i]);
|
15733 | writer.ldelim();
|
15734 | }
|
15735 | return writer;
|
15736 | };
|
15737 |
|
15738 | /**
|
15739 | * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages.
|
15740 | * @function encodeDelimited
|
15741 | * @memberof google.api.ResourceDescriptor
|
15742 | * @static
|
15743 | * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode
|
15744 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
15745 | * @returns {$protobuf.Writer} Writer
|
15746 | */
|
15747 | ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) {
|
15748 | return this.encode(message, writer).ldelim();
|
15749 | };
|
15750 |
|
15751 | /**
|
15752 | * Decodes a ResourceDescriptor message from the specified reader or buffer.
|
15753 | * @function decode
|
15754 | * @memberof google.api.ResourceDescriptor
|
15755 | * @static
|
15756 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
15757 | * @param {number} [length] Message length if known beforehand
|
15758 | * @returns {google.api.ResourceDescriptor} ResourceDescriptor
|
15759 | * @throws {Error} If the payload is not a reader or valid buffer
|
15760 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
15761 | */
|
15762 | ResourceDescriptor.decode = function decode(reader, length) {
|
15763 | if (!(reader instanceof $Reader))
|
15764 | reader = $Reader.create(reader);
|
15765 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor();
|
15766 | while (reader.pos < end) {
|
15767 | var tag = reader.uint32();
|
15768 | switch (tag >>> 3) {
|
15769 | case 1:
|
15770 | message.type = reader.string();
|
15771 | break;
|
15772 | case 2:
|
15773 | if (!(message.pattern && message.pattern.length))
|
15774 | message.pattern = [];
|
15775 | message.pattern.push(reader.string());
|
15776 | break;
|
15777 | case 3:
|
15778 | message.nameField = reader.string();
|
15779 | break;
|
15780 | case 4:
|
15781 | message.history = reader.int32();
|
15782 | break;
|
15783 | case 5:
|
15784 | message.plural = reader.string();
|
15785 | break;
|
15786 | case 6:
|
15787 | message.singular = reader.string();
|
15788 | break;
|
15789 | case 10:
|
15790 | if (!(message.style && message.style.length))
|
15791 | message.style = [];
|
15792 | if ((tag & 7) === 2) {
|
15793 | var end2 = reader.uint32() + reader.pos;
|
15794 | while (reader.pos < end2)
|
15795 | message.style.push(reader.int32());
|
15796 | } else
|
15797 | message.style.push(reader.int32());
|
15798 | break;
|
15799 | default:
|
15800 | reader.skipType(tag & 7);
|
15801 | break;
|
15802 | }
|
15803 | }
|
15804 | return message;
|
15805 | };
|
15806 |
|
15807 | /**
|
15808 | * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited.
|
15809 | * @function decodeDelimited
|
15810 | * @memberof google.api.ResourceDescriptor
|
15811 | * @static
|
15812 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
15813 | * @returns {google.api.ResourceDescriptor} ResourceDescriptor
|
15814 | * @throws {Error} If the payload is not a reader or valid buffer
|
15815 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
15816 | */
|
15817 | ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) {
|
15818 | if (!(reader instanceof $Reader))
|
15819 | reader = new $Reader(reader);
|
15820 | return this.decode(reader, reader.uint32());
|
15821 | };
|
15822 |
|
15823 | /**
|
15824 | * Verifies a ResourceDescriptor message.
|
15825 | * @function verify
|
15826 | * @memberof google.api.ResourceDescriptor
|
15827 | * @static
|
15828 | * @param {Object.<string,*>} message Plain object to verify
|
15829 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
15830 | */
|
15831 | ResourceDescriptor.verify = function verify(message) {
|
15832 | if (typeof message !== "object" || message === null)
|
15833 | return "object expected";
|
15834 | if (message.type != null && message.hasOwnProperty("type"))
|
15835 | if (!$util.isString(message.type))
|
15836 | return "type: string expected";
|
15837 | if (message.pattern != null && message.hasOwnProperty("pattern")) {
|
15838 | if (!Array.isArray(message.pattern))
|
15839 | return "pattern: array expected";
|
15840 | for (var i = 0; i < message.pattern.length; ++i)
|
15841 | if (!$util.isString(message.pattern[i]))
|
15842 | return "pattern: string[] expected";
|
15843 | }
|
15844 | if (message.nameField != null && message.hasOwnProperty("nameField"))
|
15845 | if (!$util.isString(message.nameField))
|
15846 | return "nameField: string expected";
|
15847 | if (message.history != null && message.hasOwnProperty("history"))
|
15848 | switch (message.history) {
|
15849 | default:
|
15850 | return "history: enum value expected";
|
15851 | case 0:
|
15852 | case 1:
|
15853 | case 2:
|
15854 | break;
|
15855 | }
|
15856 | if (message.plural != null && message.hasOwnProperty("plural"))
|
15857 | if (!$util.isString(message.plural))
|
15858 | return "plural: string expected";
|
15859 | if (message.singular != null && message.hasOwnProperty("singular"))
|
15860 | if (!$util.isString(message.singular))
|
15861 | return "singular: string expected";
|
15862 | if (message.style != null && message.hasOwnProperty("style")) {
|
15863 | if (!Array.isArray(message.style))
|
15864 | return "style: array expected";
|
15865 | for (var i = 0; i < message.style.length; ++i)
|
15866 | switch (message.style[i]) {
|
15867 | default:
|
15868 | return "style: enum value[] expected";
|
15869 | case 0:
|
15870 | case 1:
|
15871 | break;
|
15872 | }
|
15873 | }
|
15874 | return null;
|
15875 | };
|
15876 |
|
15877 | /**
|
15878 | * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types.
|
15879 | * @function fromObject
|
15880 | * @memberof google.api.ResourceDescriptor
|
15881 | * @static
|
15882 | * @param {Object.<string,*>} object Plain object
|
15883 | * @returns {google.api.ResourceDescriptor} ResourceDescriptor
|
15884 | */
|
15885 | ResourceDescriptor.fromObject = function fromObject(object) {
|
15886 | if (object instanceof $root.google.api.ResourceDescriptor)
|
15887 | return object;
|
15888 | var message = new $root.google.api.ResourceDescriptor();
|
15889 | if (object.type != null)
|
15890 | message.type = String(object.type);
|
15891 | if (object.pattern) {
|
15892 | if (!Array.isArray(object.pattern))
|
15893 | throw TypeError(".google.api.ResourceDescriptor.pattern: array expected");
|
15894 | message.pattern = [];
|
15895 | for (var i = 0; i < object.pattern.length; ++i)
|
15896 | message.pattern[i] = String(object.pattern[i]);
|
15897 | }
|
15898 | if (object.nameField != null)
|
15899 | message.nameField = String(object.nameField);
|
15900 | switch (object.history) {
|
15901 | case "HISTORY_UNSPECIFIED":
|
15902 | case 0:
|
15903 | message.history = 0;
|
15904 | break;
|
15905 | case "ORIGINALLY_SINGLE_PATTERN":
|
15906 | case 1:
|
15907 | message.history = 1;
|
15908 | break;
|
15909 | case "FUTURE_MULTI_PATTERN":
|
15910 | case 2:
|
15911 | message.history = 2;
|
15912 | break;
|
15913 | }
|
15914 | if (object.plural != null)
|
15915 | message.plural = String(object.plural);
|
15916 | if (object.singular != null)
|
15917 | message.singular = String(object.singular);
|
15918 | if (object.style) {
|
15919 | if (!Array.isArray(object.style))
|
15920 | throw TypeError(".google.api.ResourceDescriptor.style: array expected");
|
15921 | message.style = [];
|
15922 | for (var i = 0; i < object.style.length; ++i)
|
15923 | switch (object.style[i]) {
|
15924 | default:
|
15925 | case "STYLE_UNSPECIFIED":
|
15926 | case 0:
|
15927 | message.style[i] = 0;
|
15928 | break;
|
15929 | case "DECLARATIVE_FRIENDLY":
|
15930 | case 1:
|
15931 | message.style[i] = 1;
|
15932 | break;
|
15933 | }
|
15934 | }
|
15935 | return message;
|
15936 | };
|
15937 |
|
15938 | /**
|
15939 | * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified.
|
15940 | * @function toObject
|
15941 | * @memberof google.api.ResourceDescriptor
|
15942 | * @static
|
15943 | * @param {google.api.ResourceDescriptor} message ResourceDescriptor
|
15944 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
15945 | * @returns {Object.<string,*>} Plain object
|
15946 | */
|
15947 | ResourceDescriptor.toObject = function toObject(message, options) {
|
15948 | if (!options)
|
15949 | options = {};
|
15950 | var object = {};
|
15951 | if (options.arrays || options.defaults) {
|
15952 | object.pattern = [];
|
15953 | object.style = [];
|
15954 | }
|
15955 | if (options.defaults) {
|
15956 | object.type = "";
|
15957 | object.nameField = "";
|
15958 | object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0;
|
15959 | object.plural = "";
|
15960 | object.singular = "";
|
15961 | }
|
15962 | if (message.type != null && message.hasOwnProperty("type"))
|
15963 | object.type = message.type;
|
15964 | if (message.pattern && message.pattern.length) {
|
15965 | object.pattern = [];
|
15966 | for (var j = 0; j < message.pattern.length; ++j)
|
15967 | object.pattern[j] = message.pattern[j];
|
15968 | }
|
15969 | if (message.nameField != null && message.hasOwnProperty("nameField"))
|
15970 | object.nameField = message.nameField;
|
15971 | if (message.history != null && message.hasOwnProperty("history"))
|
15972 | object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] : message.history;
|
15973 | if (message.plural != null && message.hasOwnProperty("plural"))
|
15974 | object.plural = message.plural;
|
15975 | if (message.singular != null && message.hasOwnProperty("singular"))
|
15976 | object.singular = message.singular;
|
15977 | if (message.style && message.style.length) {
|
15978 | object.style = [];
|
15979 | for (var j = 0; j < message.style.length; ++j)
|
15980 | object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j];
|
15981 | }
|
15982 | return object;
|
15983 | };
|
15984 |
|
15985 | /**
|
15986 | * Converts this ResourceDescriptor to JSON.
|
15987 | * @function toJSON
|
15988 | * @memberof google.api.ResourceDescriptor
|
15989 | * @instance
|
15990 | * @returns {Object.<string,*>} JSON object
|
15991 | */
|
15992 | ResourceDescriptor.prototype.toJSON = function toJSON() {
|
15993 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
15994 | };
|
15995 |
|
15996 | /**
|
15997 | * History enum.
|
15998 | * @name google.api.ResourceDescriptor.History
|
15999 | * @enum {number}
|
16000 | * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value
|
16001 | * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value
|
16002 | * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value
|
16003 | */
|
16004 | ResourceDescriptor.History = (function() {
|
16005 | var valuesById = {}, values = Object.create(valuesById);
|
16006 | values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0;
|
16007 | values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1;
|
16008 | values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2;
|
16009 | return values;
|
16010 | })();
|
16011 |
|
16012 | /**
|
16013 | * Style enum.
|
16014 | * @name google.api.ResourceDescriptor.Style
|
16015 | * @enum {number}
|
16016 | * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value
|
16017 | * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value
|
16018 | */
|
16019 | ResourceDescriptor.Style = (function() {
|
16020 | var valuesById = {}, values = Object.create(valuesById);
|
16021 | values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0;
|
16022 | values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1;
|
16023 | return values;
|
16024 | })();
|
16025 |
|
16026 | return ResourceDescriptor;
|
16027 | })();
|
16028 |
|
16029 | api.ResourceReference = (function() {
|
16030 |
|
16031 | /**
|
16032 | * Properties of a ResourceReference.
|
16033 | * @memberof google.api
|
16034 | * @interface IResourceReference
|
16035 | * @property {string|null} [type] ResourceReference type
|
16036 | * @property {string|null} [childType] ResourceReference childType
|
16037 | */
|
16038 |
|
16039 | /**
|
16040 | * Constructs a new ResourceReference.
|
16041 | * @memberof google.api
|
16042 | * @classdesc Represents a ResourceReference.
|
16043 | * @implements IResourceReference
|
16044 | * @constructor
|
16045 | * @param {google.api.IResourceReference=} [properties] Properties to set
|
16046 | */
|
16047 | function ResourceReference(properties) {
|
16048 | if (properties)
|
16049 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
16050 | if (properties[keys[i]] != null)
|
16051 | this[keys[i]] = properties[keys[i]];
|
16052 | }
|
16053 |
|
16054 | /**
|
16055 | * ResourceReference type.
|
16056 | * @member {string} type
|
16057 | * @memberof google.api.ResourceReference
|
16058 | * @instance
|
16059 | */
|
16060 | ResourceReference.prototype.type = "";
|
16061 |
|
16062 | /**
|
16063 | * ResourceReference childType.
|
16064 | * @member {string} childType
|
16065 | * @memberof google.api.ResourceReference
|
16066 | * @instance
|
16067 | */
|
16068 | ResourceReference.prototype.childType = "";
|
16069 |
|
16070 | /**
|
16071 | * Creates a new ResourceReference instance using the specified properties.
|
16072 | * @function create
|
16073 | * @memberof google.api.ResourceReference
|
16074 | * @static
|
16075 | * @param {google.api.IResourceReference=} [properties] Properties to set
|
16076 | * @returns {google.api.ResourceReference} ResourceReference instance
|
16077 | */
|
16078 | ResourceReference.create = function create(properties) {
|
16079 | return new ResourceReference(properties);
|
16080 | };
|
16081 |
|
16082 | /**
|
16083 | * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages.
|
16084 | * @function encode
|
16085 | * @memberof google.api.ResourceReference
|
16086 | * @static
|
16087 | * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode
|
16088 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
16089 | * @returns {$protobuf.Writer} Writer
|
16090 | */
|
16091 | ResourceReference.encode = function encode(message, writer) {
|
16092 | if (!writer)
|
16093 | writer = $Writer.create();
|
16094 | if (message.type != null && Object.hasOwnProperty.call(message, "type"))
|
16095 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.type);
|
16096 | if (message.childType != null && Object.hasOwnProperty.call(message, "childType"))
|
16097 | writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType);
|
16098 | return writer;
|
16099 | };
|
16100 |
|
16101 | /**
|
16102 | * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages.
|
16103 | * @function encodeDelimited
|
16104 | * @memberof google.api.ResourceReference
|
16105 | * @static
|
16106 | * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode
|
16107 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
16108 | * @returns {$protobuf.Writer} Writer
|
16109 | */
|
16110 | ResourceReference.encodeDelimited = function encodeDelimited(message, writer) {
|
16111 | return this.encode(message, writer).ldelim();
|
16112 | };
|
16113 |
|
16114 | /**
|
16115 | * Decodes a ResourceReference message from the specified reader or buffer.
|
16116 | * @function decode
|
16117 | * @memberof google.api.ResourceReference
|
16118 | * @static
|
16119 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
16120 | * @param {number} [length] Message length if known beforehand
|
16121 | * @returns {google.api.ResourceReference} ResourceReference
|
16122 | * @throws {Error} If the payload is not a reader or valid buffer
|
16123 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
16124 | */
|
16125 | ResourceReference.decode = function decode(reader, length) {
|
16126 | if (!(reader instanceof $Reader))
|
16127 | reader = $Reader.create(reader);
|
16128 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference();
|
16129 | while (reader.pos < end) {
|
16130 | var tag = reader.uint32();
|
16131 | switch (tag >>> 3) {
|
16132 | case 1:
|
16133 | message.type = reader.string();
|
16134 | break;
|
16135 | case 2:
|
16136 | message.childType = reader.string();
|
16137 | break;
|
16138 | default:
|
16139 | reader.skipType(tag & 7);
|
16140 | break;
|
16141 | }
|
16142 | }
|
16143 | return message;
|
16144 | };
|
16145 |
|
16146 | /**
|
16147 | * Decodes a ResourceReference message from the specified reader or buffer, length delimited.
|
16148 | * @function decodeDelimited
|
16149 | * @memberof google.api.ResourceReference
|
16150 | * @static
|
16151 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
16152 | * @returns {google.api.ResourceReference} ResourceReference
|
16153 | * @throws {Error} If the payload is not a reader or valid buffer
|
16154 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
16155 | */
|
16156 | ResourceReference.decodeDelimited = function decodeDelimited(reader) {
|
16157 | if (!(reader instanceof $Reader))
|
16158 | reader = new $Reader(reader);
|
16159 | return this.decode(reader, reader.uint32());
|
16160 | };
|
16161 |
|
16162 | /**
|
16163 | * Verifies a ResourceReference message.
|
16164 | * @function verify
|
16165 | * @memberof google.api.ResourceReference
|
16166 | * @static
|
16167 | * @param {Object.<string,*>} message Plain object to verify
|
16168 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
16169 | */
|
16170 | ResourceReference.verify = function verify(message) {
|
16171 | if (typeof message !== "object" || message === null)
|
16172 | return "object expected";
|
16173 | if (message.type != null && message.hasOwnProperty("type"))
|
16174 | if (!$util.isString(message.type))
|
16175 | return "type: string expected";
|
16176 | if (message.childType != null && message.hasOwnProperty("childType"))
|
16177 | if (!$util.isString(message.childType))
|
16178 | return "childType: string expected";
|
16179 | return null;
|
16180 | };
|
16181 |
|
16182 | /**
|
16183 | * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types.
|
16184 | * @function fromObject
|
16185 | * @memberof google.api.ResourceReference
|
16186 | * @static
|
16187 | * @param {Object.<string,*>} object Plain object
|
16188 | * @returns {google.api.ResourceReference} ResourceReference
|
16189 | */
|
16190 | ResourceReference.fromObject = function fromObject(object) {
|
16191 | if (object instanceof $root.google.api.ResourceReference)
|
16192 | return object;
|
16193 | var message = new $root.google.api.ResourceReference();
|
16194 | if (object.type != null)
|
16195 | message.type = String(object.type);
|
16196 | if (object.childType != null)
|
16197 | message.childType = String(object.childType);
|
16198 | return message;
|
16199 | };
|
16200 |
|
16201 | /**
|
16202 | * Creates a plain object from a ResourceReference message. Also converts values to other types if specified.
|
16203 | * @function toObject
|
16204 | * @memberof google.api.ResourceReference
|
16205 | * @static
|
16206 | * @param {google.api.ResourceReference} message ResourceReference
|
16207 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
16208 | * @returns {Object.<string,*>} Plain object
|
16209 | */
|
16210 | ResourceReference.toObject = function toObject(message, options) {
|
16211 | if (!options)
|
16212 | options = {};
|
16213 | var object = {};
|
16214 | if (options.defaults) {
|
16215 | object.type = "";
|
16216 | object.childType = "";
|
16217 | }
|
16218 | if (message.type != null && message.hasOwnProperty("type"))
|
16219 | object.type = message.type;
|
16220 | if (message.childType != null && message.hasOwnProperty("childType"))
|
16221 | object.childType = message.childType;
|
16222 | return object;
|
16223 | };
|
16224 |
|
16225 | /**
|
16226 | * Converts this ResourceReference to JSON.
|
16227 | * @function toJSON
|
16228 | * @memberof google.api.ResourceReference
|
16229 | * @instance
|
16230 | * @returns {Object.<string,*>} JSON object
|
16231 | */
|
16232 | ResourceReference.prototype.toJSON = function toJSON() {
|
16233 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
16234 | };
|
16235 |
|
16236 | return ResourceReference;
|
16237 | })();
|
16238 |
|
16239 | return api;
|
16240 | })();
|
16241 |
|
16242 | google.protobuf = (function() {
|
16243 |
|
16244 | /**
|
16245 | * Namespace protobuf.
|
16246 | * @memberof google
|
16247 | * @namespace
|
16248 | */
|
16249 | var protobuf = {};
|
16250 |
|
16251 | protobuf.FileDescriptorSet = (function() {
|
16252 |
|
16253 | /**
|
16254 | * Properties of a FileDescriptorSet.
|
16255 | * @memberof google.protobuf
|
16256 | * @interface IFileDescriptorSet
|
16257 | * @property {Array.<google.protobuf.IFileDescriptorProto>|null} [file] FileDescriptorSet file
|
16258 | */
|
16259 |
|
16260 | /**
|
16261 | * Constructs a new FileDescriptorSet.
|
16262 | * @memberof google.protobuf
|
16263 | * @classdesc Represents a FileDescriptorSet.
|
16264 | * @implements IFileDescriptorSet
|
16265 | * @constructor
|
16266 | * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set
|
16267 | */
|
16268 | function FileDescriptorSet(properties) {
|
16269 | this.file = [];
|
16270 | if (properties)
|
16271 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
16272 | if (properties[keys[i]] != null)
|
16273 | this[keys[i]] = properties[keys[i]];
|
16274 | }
|
16275 |
|
16276 | /**
|
16277 | * FileDescriptorSet file.
|
16278 | * @member {Array.<google.protobuf.IFileDescriptorProto>} file
|
16279 | * @memberof google.protobuf.FileDescriptorSet
|
16280 | * @instance
|
16281 | */
|
16282 | FileDescriptorSet.prototype.file = $util.emptyArray;
|
16283 |
|
16284 | /**
|
16285 | * Creates a new FileDescriptorSet instance using the specified properties.
|
16286 | * @function create
|
16287 | * @memberof google.protobuf.FileDescriptorSet
|
16288 | * @static
|
16289 | * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set
|
16290 | * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance
|
16291 | */
|
16292 | FileDescriptorSet.create = function create(properties) {
|
16293 | return new FileDescriptorSet(properties);
|
16294 | };
|
16295 |
|
16296 | /**
|
16297 | * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages.
|
16298 | * @function encode
|
16299 | * @memberof google.protobuf.FileDescriptorSet
|
16300 | * @static
|
16301 | * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode
|
16302 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
16303 | * @returns {$protobuf.Writer} Writer
|
16304 | */
|
16305 | FileDescriptorSet.encode = function encode(message, writer) {
|
16306 | if (!writer)
|
16307 | writer = $Writer.create();
|
16308 | if (message.file != null && message.file.length)
|
16309 | for (var i = 0; i < message.file.length; ++i)
|
16310 | $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
16311 | return writer;
|
16312 | };
|
16313 |
|
16314 | /**
|
16315 | * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages.
|
16316 | * @function encodeDelimited
|
16317 | * @memberof google.protobuf.FileDescriptorSet
|
16318 | * @static
|
16319 | * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode
|
16320 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
16321 | * @returns {$protobuf.Writer} Writer
|
16322 | */
|
16323 | FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) {
|
16324 | return this.encode(message, writer).ldelim();
|
16325 | };
|
16326 |
|
16327 | /**
|
16328 | * Decodes a FileDescriptorSet message from the specified reader or buffer.
|
16329 | * @function decode
|
16330 | * @memberof google.protobuf.FileDescriptorSet
|
16331 | * @static
|
16332 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
16333 | * @param {number} [length] Message length if known beforehand
|
16334 | * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet
|
16335 | * @throws {Error} If the payload is not a reader or valid buffer
|
16336 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
16337 | */
|
16338 | FileDescriptorSet.decode = function decode(reader, length) {
|
16339 | if (!(reader instanceof $Reader))
|
16340 | reader = $Reader.create(reader);
|
16341 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet();
|
16342 | while (reader.pos < end) {
|
16343 | var tag = reader.uint32();
|
16344 | switch (tag >>> 3) {
|
16345 | case 1:
|
16346 | if (!(message.file && message.file.length))
|
16347 | message.file = [];
|
16348 | message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32()));
|
16349 | break;
|
16350 | default:
|
16351 | reader.skipType(tag & 7);
|
16352 | break;
|
16353 | }
|
16354 | }
|
16355 | return message;
|
16356 | };
|
16357 |
|
16358 | /**
|
16359 | * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited.
|
16360 | * @function decodeDelimited
|
16361 | * @memberof google.protobuf.FileDescriptorSet
|
16362 | * @static
|
16363 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
16364 | * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet
|
16365 | * @throws {Error} If the payload is not a reader or valid buffer
|
16366 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
16367 | */
|
16368 | FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) {
|
16369 | if (!(reader instanceof $Reader))
|
16370 | reader = new $Reader(reader);
|
16371 | return this.decode(reader, reader.uint32());
|
16372 | };
|
16373 |
|
16374 | /**
|
16375 | * Verifies a FileDescriptorSet message.
|
16376 | * @function verify
|
16377 | * @memberof google.protobuf.FileDescriptorSet
|
16378 | * @static
|
16379 | * @param {Object.<string,*>} message Plain object to verify
|
16380 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
16381 | */
|
16382 | FileDescriptorSet.verify = function verify(message) {
|
16383 | if (typeof message !== "object" || message === null)
|
16384 | return "object expected";
|
16385 | if (message.file != null && message.hasOwnProperty("file")) {
|
16386 | if (!Array.isArray(message.file))
|
16387 | return "file: array expected";
|
16388 | for (var i = 0; i < message.file.length; ++i) {
|
16389 | var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]);
|
16390 | if (error)
|
16391 | return "file." + error;
|
16392 | }
|
16393 | }
|
16394 | return null;
|
16395 | };
|
16396 |
|
16397 | /**
|
16398 | * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types.
|
16399 | * @function fromObject
|
16400 | * @memberof google.protobuf.FileDescriptorSet
|
16401 | * @static
|
16402 | * @param {Object.<string,*>} object Plain object
|
16403 | * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet
|
16404 | */
|
16405 | FileDescriptorSet.fromObject = function fromObject(object) {
|
16406 | if (object instanceof $root.google.protobuf.FileDescriptorSet)
|
16407 | return object;
|
16408 | var message = new $root.google.protobuf.FileDescriptorSet();
|
16409 | if (object.file) {
|
16410 | if (!Array.isArray(object.file))
|
16411 | throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected");
|
16412 | message.file = [];
|
16413 | for (var i = 0; i < object.file.length; ++i) {
|
16414 | if (typeof object.file[i] !== "object")
|
16415 | throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected");
|
16416 | message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]);
|
16417 | }
|
16418 | }
|
16419 | return message;
|
16420 | };
|
16421 |
|
16422 | /**
|
16423 | * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified.
|
16424 | * @function toObject
|
16425 | * @memberof google.protobuf.FileDescriptorSet
|
16426 | * @static
|
16427 | * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet
|
16428 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
16429 | * @returns {Object.<string,*>} Plain object
|
16430 | */
|
16431 | FileDescriptorSet.toObject = function toObject(message, options) {
|
16432 | if (!options)
|
16433 | options = {};
|
16434 | var object = {};
|
16435 | if (options.arrays || options.defaults)
|
16436 | object.file = [];
|
16437 | if (message.file && message.file.length) {
|
16438 | object.file = [];
|
16439 | for (var j = 0; j < message.file.length; ++j)
|
16440 | object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options);
|
16441 | }
|
16442 | return object;
|
16443 | };
|
16444 |
|
16445 | /**
|
16446 | * Converts this FileDescriptorSet to JSON.
|
16447 | * @function toJSON
|
16448 | * @memberof google.protobuf.FileDescriptorSet
|
16449 | * @instance
|
16450 | * @returns {Object.<string,*>} JSON object
|
16451 | */
|
16452 | FileDescriptorSet.prototype.toJSON = function toJSON() {
|
16453 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
16454 | };
|
16455 |
|
16456 | return FileDescriptorSet;
|
16457 | })();
|
16458 |
|
16459 | protobuf.FileDescriptorProto = (function() {
|
16460 |
|
16461 | /**
|
16462 | * Properties of a FileDescriptorProto.
|
16463 | * @memberof google.protobuf
|
16464 | * @interface IFileDescriptorProto
|
16465 | * @property {string|null} [name] FileDescriptorProto name
|
16466 | * @property {string|null} ["package"] FileDescriptorProto package
|
16467 | * @property {Array.<string>|null} [dependency] FileDescriptorProto dependency
|
16468 | * @property {Array.<number>|null} [publicDependency] FileDescriptorProto publicDependency
|
16469 | * @property {Array.<number>|null} [weakDependency] FileDescriptorProto weakDependency
|
16470 | * @property {Array.<google.protobuf.IDescriptorProto>|null} [messageType] FileDescriptorProto messageType
|
16471 | * @property {Array.<google.protobuf.IEnumDescriptorProto>|null} [enumType] FileDescriptorProto enumType
|
16472 | * @property {Array.<google.protobuf.IServiceDescriptorProto>|null} [service] FileDescriptorProto service
|
16473 | * @property {Array.<google.protobuf.IFieldDescriptorProto>|null} [extension] FileDescriptorProto extension
|
16474 | * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options
|
16475 | * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo
|
16476 | * @property {string|null} [syntax] FileDescriptorProto syntax
|
16477 | */
|
16478 |
|
16479 | /**
|
16480 | * Constructs a new FileDescriptorProto.
|
16481 | * @memberof google.protobuf
|
16482 | * @classdesc Represents a FileDescriptorProto.
|
16483 | * @implements IFileDescriptorProto
|
16484 | * @constructor
|
16485 | * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set
|
16486 | */
|
16487 | function FileDescriptorProto(properties) {
|
16488 | this.dependency = [];
|
16489 | this.publicDependency = [];
|
16490 | this.weakDependency = [];
|
16491 | this.messageType = [];
|
16492 | this.enumType = [];
|
16493 | this.service = [];
|
16494 | this.extension = [];
|
16495 | if (properties)
|
16496 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
16497 | if (properties[keys[i]] != null)
|
16498 | this[keys[i]] = properties[keys[i]];
|
16499 | }
|
16500 |
|
16501 | /**
|
16502 | * FileDescriptorProto name.
|
16503 | * @member {string} name
|
16504 | * @memberof google.protobuf.FileDescriptorProto
|
16505 | * @instance
|
16506 | */
|
16507 | FileDescriptorProto.prototype.name = "";
|
16508 |
|
16509 | /**
|
16510 | * FileDescriptorProto package.
|
16511 | * @member {string} package
|
16512 | * @memberof google.protobuf.FileDescriptorProto
|
16513 | * @instance
|
16514 | */
|
16515 | FileDescriptorProto.prototype["package"] = "";
|
16516 |
|
16517 | /**
|
16518 | * FileDescriptorProto dependency.
|
16519 | * @member {Array.<string>} dependency
|
16520 | * @memberof google.protobuf.FileDescriptorProto
|
16521 | * @instance
|
16522 | */
|
16523 | FileDescriptorProto.prototype.dependency = $util.emptyArray;
|
16524 |
|
16525 | /**
|
16526 | * FileDescriptorProto publicDependency.
|
16527 | * @member {Array.<number>} publicDependency
|
16528 | * @memberof google.protobuf.FileDescriptorProto
|
16529 | * @instance
|
16530 | */
|
16531 | FileDescriptorProto.prototype.publicDependency = $util.emptyArray;
|
16532 |
|
16533 | /**
|
16534 | * FileDescriptorProto weakDependency.
|
16535 | * @member {Array.<number>} weakDependency
|
16536 | * @memberof google.protobuf.FileDescriptorProto
|
16537 | * @instance
|
16538 | */
|
16539 | FileDescriptorProto.prototype.weakDependency = $util.emptyArray;
|
16540 |
|
16541 | /**
|
16542 | * FileDescriptorProto messageType.
|
16543 | * @member {Array.<google.protobuf.IDescriptorProto>} messageType
|
16544 | * @memberof google.protobuf.FileDescriptorProto
|
16545 | * @instance
|
16546 | */
|
16547 | FileDescriptorProto.prototype.messageType = $util.emptyArray;
|
16548 |
|
16549 | /**
|
16550 | * FileDescriptorProto enumType.
|
16551 | * @member {Array.<google.protobuf.IEnumDescriptorProto>} enumType
|
16552 | * @memberof google.protobuf.FileDescriptorProto
|
16553 | * @instance
|
16554 | */
|
16555 | FileDescriptorProto.prototype.enumType = $util.emptyArray;
|
16556 |
|
16557 | /**
|
16558 | * FileDescriptorProto service.
|
16559 | * @member {Array.<google.protobuf.IServiceDescriptorProto>} service
|
16560 | * @memberof google.protobuf.FileDescriptorProto
|
16561 | * @instance
|
16562 | */
|
16563 | FileDescriptorProto.prototype.service = $util.emptyArray;
|
16564 |
|
16565 | /**
|
16566 | * FileDescriptorProto extension.
|
16567 | * @member {Array.<google.protobuf.IFieldDescriptorProto>} extension
|
16568 | * @memberof google.protobuf.FileDescriptorProto
|
16569 | * @instance
|
16570 | */
|
16571 | FileDescriptorProto.prototype.extension = $util.emptyArray;
|
16572 |
|
16573 | /**
|
16574 | * FileDescriptorProto options.
|
16575 | * @member {google.protobuf.IFileOptions|null|undefined} options
|
16576 | * @memberof google.protobuf.FileDescriptorProto
|
16577 | * @instance
|
16578 | */
|
16579 | FileDescriptorProto.prototype.options = null;
|
16580 |
|
16581 | /**
|
16582 | * FileDescriptorProto sourceCodeInfo.
|
16583 | * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo
|
16584 | * @memberof google.protobuf.FileDescriptorProto
|
16585 | * @instance
|
16586 | */
|
16587 | FileDescriptorProto.prototype.sourceCodeInfo = null;
|
16588 |
|
16589 | /**
|
16590 | * FileDescriptorProto syntax.
|
16591 | * @member {string} syntax
|
16592 | * @memberof google.protobuf.FileDescriptorProto
|
16593 | * @instance
|
16594 | */
|
16595 | FileDescriptorProto.prototype.syntax = "";
|
16596 |
|
16597 | /**
|
16598 | * Creates a new FileDescriptorProto instance using the specified properties.
|
16599 | * @function create
|
16600 | * @memberof google.protobuf.FileDescriptorProto
|
16601 | * @static
|
16602 | * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set
|
16603 | * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance
|
16604 | */
|
16605 | FileDescriptorProto.create = function create(properties) {
|
16606 | return new FileDescriptorProto(properties);
|
16607 | };
|
16608 |
|
16609 | /**
|
16610 | * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages.
|
16611 | * @function encode
|
16612 | * @memberof google.protobuf.FileDescriptorProto
|
16613 | * @static
|
16614 | * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode
|
16615 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
16616 | * @returns {$protobuf.Writer} Writer
|
16617 | */
|
16618 | FileDescriptorProto.encode = function encode(message, writer) {
|
16619 | if (!writer)
|
16620 | writer = $Writer.create();
|
16621 | if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
16622 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
|
16623 | if (message["package"] != null && Object.hasOwnProperty.call(message, "package"))
|
16624 | writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]);
|
16625 | if (message.dependency != null && message.dependency.length)
|
16626 | for (var i = 0; i < message.dependency.length; ++i)
|
16627 | writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]);
|
16628 | if (message.messageType != null && message.messageType.length)
|
16629 | for (var i = 0; i < message.messageType.length; ++i)
|
16630 | $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
|
16631 | if (message.enumType != null && message.enumType.length)
|
16632 | for (var i = 0; i < message.enumType.length; ++i)
|
16633 | $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
|
16634 | if (message.service != null && message.service.length)
|
16635 | for (var i = 0; i < message.service.length; ++i)
|
16636 | $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
|
16637 | if (message.extension != null && message.extension.length)
|
16638 | for (var i = 0; i < message.extension.length; ++i)
|
16639 | $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();
|
16640 | if (message.options != null && Object.hasOwnProperty.call(message, "options"))
|
16641 | $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();
|
16642 | if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo"))
|
16643 | $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim();
|
16644 | if (message.publicDependency != null && message.publicDependency.length)
|
16645 | for (var i = 0; i < message.publicDependency.length; ++i)
|
16646 | writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]);
|
16647 | if (message.weakDependency != null && message.weakDependency.length)
|
16648 | for (var i = 0; i < message.weakDependency.length; ++i)
|
16649 | writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]);
|
16650 | if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax"))
|
16651 | writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax);
|
16652 | return writer;
|
16653 | };
|
16654 |
|
16655 | /**
|
16656 | * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages.
|
16657 | * @function encodeDelimited
|
16658 | * @memberof google.protobuf.FileDescriptorProto
|
16659 | * @static
|
16660 | * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode
|
16661 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
16662 | * @returns {$protobuf.Writer} Writer
|
16663 | */
|
16664 | FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) {
|
16665 | return this.encode(message, writer).ldelim();
|
16666 | };
|
16667 |
|
16668 | /**
|
16669 | * Decodes a FileDescriptorProto message from the specified reader or buffer.
|
16670 | * @function decode
|
16671 | * @memberof google.protobuf.FileDescriptorProto
|
16672 | * @static
|
16673 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
16674 | * @param {number} [length] Message length if known beforehand
|
16675 | * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto
|
16676 | * @throws {Error} If the payload is not a reader or valid buffer
|
16677 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
16678 | */
|
16679 | FileDescriptorProto.decode = function decode(reader, length) {
|
16680 | if (!(reader instanceof $Reader))
|
16681 | reader = $Reader.create(reader);
|
16682 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto();
|
16683 | while (reader.pos < end) {
|
16684 | var tag = reader.uint32();
|
16685 | switch (tag >>> 3) {
|
16686 | case 1:
|
16687 | message.name = reader.string();
|
16688 | break;
|
16689 | case 2:
|
16690 | message["package"] = reader.string();
|
16691 | break;
|
16692 | case 3:
|
16693 | if (!(message.dependency && message.dependency.length))
|
16694 | message.dependency = [];
|
16695 | message.dependency.push(reader.string());
|
16696 | break;
|
16697 | case 10:
|
16698 | if (!(message.publicDependency && message.publicDependency.length))
|
16699 | message.publicDependency = [];
|
16700 | if ((tag & 7) === 2) {
|
16701 | var end2 = reader.uint32() + reader.pos;
|
16702 | while (reader.pos < end2)
|
16703 | message.publicDependency.push(reader.int32());
|
16704 | } else
|
16705 | message.publicDependency.push(reader.int32());
|
16706 | break;
|
16707 | case 11:
|
16708 | if (!(message.weakDependency && message.weakDependency.length))
|
16709 | message.weakDependency = [];
|
16710 | if ((tag & 7) === 2) {
|
16711 | var end2 = reader.uint32() + reader.pos;
|
16712 | while (reader.pos < end2)
|
16713 | message.weakDependency.push(reader.int32());
|
16714 | } else
|
16715 | message.weakDependency.push(reader.int32());
|
16716 | break;
|
16717 | case 4:
|
16718 | if (!(message.messageType && message.messageType.length))
|
16719 | message.messageType = [];
|
16720 | message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32()));
|
16721 | break;
|
16722 | case 5:
|
16723 | if (!(message.enumType && message.enumType.length))
|
16724 | message.enumType = [];
|
16725 | message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32()));
|
16726 | break;
|
16727 | case 6:
|
16728 | if (!(message.service && message.service.length))
|
16729 | message.service = [];
|
16730 | message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32()));
|
16731 | break;
|
16732 | case 7:
|
16733 | if (!(message.extension && message.extension.length))
|
16734 | message.extension = [];
|
16735 | message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32()));
|
16736 | break;
|
16737 | case 8:
|
16738 | message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32());
|
16739 | break;
|
16740 | case 9:
|
16741 | message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32());
|
16742 | break;
|
16743 | case 12:
|
16744 | message.syntax = reader.string();
|
16745 | break;
|
16746 | default:
|
16747 | reader.skipType(tag & 7);
|
16748 | break;
|
16749 | }
|
16750 | }
|
16751 | return message;
|
16752 | };
|
16753 |
|
16754 | /**
|
16755 | * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited.
|
16756 | * @function decodeDelimited
|
16757 | * @memberof google.protobuf.FileDescriptorProto
|
16758 | * @static
|
16759 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
16760 | * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto
|
16761 | * @throws {Error} If the payload is not a reader or valid buffer
|
16762 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
16763 | */
|
16764 | FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) {
|
16765 | if (!(reader instanceof $Reader))
|
16766 | reader = new $Reader(reader);
|
16767 | return this.decode(reader, reader.uint32());
|
16768 | };
|
16769 |
|
16770 | /**
|
16771 | * Verifies a FileDescriptorProto message.
|
16772 | * @function verify
|
16773 | * @memberof google.protobuf.FileDescriptorProto
|
16774 | * @static
|
16775 | * @param {Object.<string,*>} message Plain object to verify
|
16776 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
16777 | */
|
16778 | FileDescriptorProto.verify = function verify(message) {
|
16779 | if (typeof message !== "object" || message === null)
|
16780 | return "object expected";
|
16781 | if (message.name != null && message.hasOwnProperty("name"))
|
16782 | if (!$util.isString(message.name))
|
16783 | return "name: string expected";
|
16784 | if (message["package"] != null && message.hasOwnProperty("package"))
|
16785 | if (!$util.isString(message["package"]))
|
16786 | return "package: string expected";
|
16787 | if (message.dependency != null && message.hasOwnProperty("dependency")) {
|
16788 | if (!Array.isArray(message.dependency))
|
16789 | return "dependency: array expected";
|
16790 | for (var i = 0; i < message.dependency.length; ++i)
|
16791 | if (!$util.isString(message.dependency[i]))
|
16792 | return "dependency: string[] expected";
|
16793 | }
|
16794 | if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) {
|
16795 | if (!Array.isArray(message.publicDependency))
|
16796 | return "publicDependency: array expected";
|
16797 | for (var i = 0; i < message.publicDependency.length; ++i)
|
16798 | if (!$util.isInteger(message.publicDependency[i]))
|
16799 | return "publicDependency: integer[] expected";
|
16800 | }
|
16801 | if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) {
|
16802 | if (!Array.isArray(message.weakDependency))
|
16803 | return "weakDependency: array expected";
|
16804 | for (var i = 0; i < message.weakDependency.length; ++i)
|
16805 | if (!$util.isInteger(message.weakDependency[i]))
|
16806 | return "weakDependency: integer[] expected";
|
16807 | }
|
16808 | if (message.messageType != null && message.hasOwnProperty("messageType")) {
|
16809 | if (!Array.isArray(message.messageType))
|
16810 | return "messageType: array expected";
|
16811 | for (var i = 0; i < message.messageType.length; ++i) {
|
16812 | var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]);
|
16813 | if (error)
|
16814 | return "messageType." + error;
|
16815 | }
|
16816 | }
|
16817 | if (message.enumType != null && message.hasOwnProperty("enumType")) {
|
16818 | if (!Array.isArray(message.enumType))
|
16819 | return "enumType: array expected";
|
16820 | for (var i = 0; i < message.enumType.length; ++i) {
|
16821 | var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]);
|
16822 | if (error)
|
16823 | return "enumType." + error;
|
16824 | }
|
16825 | }
|
16826 | if (message.service != null && message.hasOwnProperty("service")) {
|
16827 | if (!Array.isArray(message.service))
|
16828 | return "service: array expected";
|
16829 | for (var i = 0; i < message.service.length; ++i) {
|
16830 | var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]);
|
16831 | if (error)
|
16832 | return "service." + error;
|
16833 | }
|
16834 | }
|
16835 | if (message.extension != null && message.hasOwnProperty("extension")) {
|
16836 | if (!Array.isArray(message.extension))
|
16837 | return "extension: array expected";
|
16838 | for (var i = 0; i < message.extension.length; ++i) {
|
16839 | var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]);
|
16840 | if (error)
|
16841 | return "extension." + error;
|
16842 | }
|
16843 | }
|
16844 | if (message.options != null && message.hasOwnProperty("options")) {
|
16845 | var error = $root.google.protobuf.FileOptions.verify(message.options);
|
16846 | if (error)
|
16847 | return "options." + error;
|
16848 | }
|
16849 | if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) {
|
16850 | var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo);
|
16851 | if (error)
|
16852 | return "sourceCodeInfo." + error;
|
16853 | }
|
16854 | if (message.syntax != null && message.hasOwnProperty("syntax"))
|
16855 | if (!$util.isString(message.syntax))
|
16856 | return "syntax: string expected";
|
16857 | return null;
|
16858 | };
|
16859 |
|
16860 | /**
|
16861 | * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types.
|
16862 | * @function fromObject
|
16863 | * @memberof google.protobuf.FileDescriptorProto
|
16864 | * @static
|
16865 | * @param {Object.<string,*>} object Plain object
|
16866 | * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto
|
16867 | */
|
16868 | FileDescriptorProto.fromObject = function fromObject(object) {
|
16869 | if (object instanceof $root.google.protobuf.FileDescriptorProto)
|
16870 | return object;
|
16871 | var message = new $root.google.protobuf.FileDescriptorProto();
|
16872 | if (object.name != null)
|
16873 | message.name = String(object.name);
|
16874 | if (object["package"] != null)
|
16875 | message["package"] = String(object["package"]);
|
16876 | if (object.dependency) {
|
16877 | if (!Array.isArray(object.dependency))
|
16878 | throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected");
|
16879 | message.dependency = [];
|
16880 | for (var i = 0; i < object.dependency.length; ++i)
|
16881 | message.dependency[i] = String(object.dependency[i]);
|
16882 | }
|
16883 | if (object.publicDependency) {
|
16884 | if (!Array.isArray(object.publicDependency))
|
16885 | throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected");
|
16886 | message.publicDependency = [];
|
16887 | for (var i = 0; i < object.publicDependency.length; ++i)
|
16888 | message.publicDependency[i] = object.publicDependency[i] | 0;
|
16889 | }
|
16890 | if (object.weakDependency) {
|
16891 | if (!Array.isArray(object.weakDependency))
|
16892 | throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected");
|
16893 | message.weakDependency = [];
|
16894 | for (var i = 0; i < object.weakDependency.length; ++i)
|
16895 | message.weakDependency[i] = object.weakDependency[i] | 0;
|
16896 | }
|
16897 | if (object.messageType) {
|
16898 | if (!Array.isArray(object.messageType))
|
16899 | throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected");
|
16900 | message.messageType = [];
|
16901 | for (var i = 0; i < object.messageType.length; ++i) {
|
16902 | if (typeof object.messageType[i] !== "object")
|
16903 | throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected");
|
16904 | message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]);
|
16905 | }
|
16906 | }
|
16907 | if (object.enumType) {
|
16908 | if (!Array.isArray(object.enumType))
|
16909 | throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected");
|
16910 | message.enumType = [];
|
16911 | for (var i = 0; i < object.enumType.length; ++i) {
|
16912 | if (typeof object.enumType[i] !== "object")
|
16913 | throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected");
|
16914 | message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]);
|
16915 | }
|
16916 | }
|
16917 | if (object.service) {
|
16918 | if (!Array.isArray(object.service))
|
16919 | throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected");
|
16920 | message.service = [];
|
16921 | for (var i = 0; i < object.service.length; ++i) {
|
16922 | if (typeof object.service[i] !== "object")
|
16923 | throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected");
|
16924 | message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]);
|
16925 | }
|
16926 | }
|
16927 | if (object.extension) {
|
16928 | if (!Array.isArray(object.extension))
|
16929 | throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected");
|
16930 | message.extension = [];
|
16931 | for (var i = 0; i < object.extension.length; ++i) {
|
16932 | if (typeof object.extension[i] !== "object")
|
16933 | throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected");
|
16934 | message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]);
|
16935 | }
|
16936 | }
|
16937 | if (object.options != null) {
|
16938 | if (typeof object.options !== "object")
|
16939 | throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected");
|
16940 | message.options = $root.google.protobuf.FileOptions.fromObject(object.options);
|
16941 | }
|
16942 | if (object.sourceCodeInfo != null) {
|
16943 | if (typeof object.sourceCodeInfo !== "object")
|
16944 | throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected");
|
16945 | message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo);
|
16946 | }
|
16947 | if (object.syntax != null)
|
16948 | message.syntax = String(object.syntax);
|
16949 | return message;
|
16950 | };
|
16951 |
|
16952 | /**
|
16953 | * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified.
|
16954 | * @function toObject
|
16955 | * @memberof google.protobuf.FileDescriptorProto
|
16956 | * @static
|
16957 | * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto
|
16958 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
16959 | * @returns {Object.<string,*>} Plain object
|
16960 | */
|
16961 | FileDescriptorProto.toObject = function toObject(message, options) {
|
16962 | if (!options)
|
16963 | options = {};
|
16964 | var object = {};
|
16965 | if (options.arrays || options.defaults) {
|
16966 | object.dependency = [];
|
16967 | object.messageType = [];
|
16968 | object.enumType = [];
|
16969 | object.service = [];
|
16970 | object.extension = [];
|
16971 | object.publicDependency = [];
|
16972 | object.weakDependency = [];
|
16973 | }
|
16974 | if (options.defaults) {
|
16975 | object.name = "";
|
16976 | object["package"] = "";
|
16977 | object.options = null;
|
16978 | object.sourceCodeInfo = null;
|
16979 | object.syntax = "";
|
16980 | }
|
16981 | if (message.name != null && message.hasOwnProperty("name"))
|
16982 | object.name = message.name;
|
16983 | if (message["package"] != null && message.hasOwnProperty("package"))
|
16984 | object["package"] = message["package"];
|
16985 | if (message.dependency && message.dependency.length) {
|
16986 | object.dependency = [];
|
16987 | for (var j = 0; j < message.dependency.length; ++j)
|
16988 | object.dependency[j] = message.dependency[j];
|
16989 | }
|
16990 | if (message.messageType && message.messageType.length) {
|
16991 | object.messageType = [];
|
16992 | for (var j = 0; j < message.messageType.length; ++j)
|
16993 | object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options);
|
16994 | }
|
16995 | if (message.enumType && message.enumType.length) {
|
16996 | object.enumType = [];
|
16997 | for (var j = 0; j < message.enumType.length; ++j)
|
16998 | object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options);
|
16999 | }
|
17000 | if (message.service && message.service.length) {
|
17001 | object.service = [];
|
17002 | for (var j = 0; j < message.service.length; ++j)
|
17003 | object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options);
|
17004 | }
|
17005 | if (message.extension && message.extension.length) {
|
17006 | object.extension = [];
|
17007 | for (var j = 0; j < message.extension.length; ++j)
|
17008 | object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options);
|
17009 | }
|
17010 | if (message.options != null && message.hasOwnProperty("options"))
|
17011 | object.options = $root.google.protobuf.FileOptions.toObject(message.options, options);
|
17012 | if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo"))
|
17013 | object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options);
|
17014 | if (message.publicDependency && message.publicDependency.length) {
|
17015 | object.publicDependency = [];
|
17016 | for (var j = 0; j < message.publicDependency.length; ++j)
|
17017 | object.publicDependency[j] = message.publicDependency[j];
|
17018 | }
|
17019 | if (message.weakDependency && message.weakDependency.length) {
|
17020 | object.weakDependency = [];
|
17021 | for (var j = 0; j < message.weakDependency.length; ++j)
|
17022 | object.weakDependency[j] = message.weakDependency[j];
|
17023 | }
|
17024 | if (message.syntax != null && message.hasOwnProperty("syntax"))
|
17025 | object.syntax = message.syntax;
|
17026 | return object;
|
17027 | };
|
17028 |
|
17029 | /**
|
17030 | * Converts this FileDescriptorProto to JSON.
|
17031 | * @function toJSON
|
17032 | * @memberof google.protobuf.FileDescriptorProto
|
17033 | * @instance
|
17034 | * @returns {Object.<string,*>} JSON object
|
17035 | */
|
17036 | FileDescriptorProto.prototype.toJSON = function toJSON() {
|
17037 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
17038 | };
|
17039 |
|
17040 | return FileDescriptorProto;
|
17041 | })();
|
17042 |
|
17043 | protobuf.DescriptorProto = (function() {
|
17044 |
|
17045 | /**
|
17046 | * Properties of a DescriptorProto.
|
17047 | * @memberof google.protobuf
|
17048 | * @interface IDescriptorProto
|
17049 | * @property {string|null} [name] DescriptorProto name
|
17050 | * @property {Array.<google.protobuf.IFieldDescriptorProto>|null} [field] DescriptorProto field
|
17051 | * @property {Array.<google.protobuf.IFieldDescriptorProto>|null} [extension] DescriptorProto extension
|
17052 | * @property {Array.<google.protobuf.IDescriptorProto>|null} [nestedType] DescriptorProto nestedType
|
17053 | * @property {Array.<google.protobuf.IEnumDescriptorProto>|null} [enumType] DescriptorProto enumType
|
17054 | * @property {Array.<google.protobuf.DescriptorProto.IExtensionRange>|null} [extensionRange] DescriptorProto extensionRange
|
17055 | * @property {Array.<google.protobuf.IOneofDescriptorProto>|null} [oneofDecl] DescriptorProto oneofDecl
|
17056 | * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options
|
17057 | * @property {Array.<google.protobuf.DescriptorProto.IReservedRange>|null} [reservedRange] DescriptorProto reservedRange
|
17058 | * @property {Array.<string>|null} [reservedName] DescriptorProto reservedName
|
17059 | */
|
17060 |
|
17061 | /**
|
17062 | * Constructs a new DescriptorProto.
|
17063 | * @memberof google.protobuf
|
17064 | * @classdesc Represents a DescriptorProto.
|
17065 | * @implements IDescriptorProto
|
17066 | * @constructor
|
17067 | * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set
|
17068 | */
|
17069 | function DescriptorProto(properties) {
|
17070 | this.field = [];
|
17071 | this.extension = [];
|
17072 | this.nestedType = [];
|
17073 | this.enumType = [];
|
17074 | this.extensionRange = [];
|
17075 | this.oneofDecl = [];
|
17076 | this.reservedRange = [];
|
17077 | this.reservedName = [];
|
17078 | if (properties)
|
17079 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
17080 | if (properties[keys[i]] != null)
|
17081 | this[keys[i]] = properties[keys[i]];
|
17082 | }
|
17083 |
|
17084 | /**
|
17085 | * DescriptorProto name.
|
17086 | * @member {string} name
|
17087 | * @memberof google.protobuf.DescriptorProto
|
17088 | * @instance
|
17089 | */
|
17090 | DescriptorProto.prototype.name = "";
|
17091 |
|
17092 | /**
|
17093 | * DescriptorProto field.
|
17094 | * @member {Array.<google.protobuf.IFieldDescriptorProto>} field
|
17095 | * @memberof google.protobuf.DescriptorProto
|
17096 | * @instance
|
17097 | */
|
17098 | DescriptorProto.prototype.field = $util.emptyArray;
|
17099 |
|
17100 | /**
|
17101 | * DescriptorProto extension.
|
17102 | * @member {Array.<google.protobuf.IFieldDescriptorProto>} extension
|
17103 | * @memberof google.protobuf.DescriptorProto
|
17104 | * @instance
|
17105 | */
|
17106 | DescriptorProto.prototype.extension = $util.emptyArray;
|
17107 |
|
17108 | /**
|
17109 | * DescriptorProto nestedType.
|
17110 | * @member {Array.<google.protobuf.IDescriptorProto>} nestedType
|
17111 | * @memberof google.protobuf.DescriptorProto
|
17112 | * @instance
|
17113 | */
|
17114 | DescriptorProto.prototype.nestedType = $util.emptyArray;
|
17115 |
|
17116 | /**
|
17117 | * DescriptorProto enumType.
|
17118 | * @member {Array.<google.protobuf.IEnumDescriptorProto>} enumType
|
17119 | * @memberof google.protobuf.DescriptorProto
|
17120 | * @instance
|
17121 | */
|
17122 | DescriptorProto.prototype.enumType = $util.emptyArray;
|
17123 |
|
17124 | /**
|
17125 | * DescriptorProto extensionRange.
|
17126 | * @member {Array.<google.protobuf.DescriptorProto.IExtensionRange>} extensionRange
|
17127 | * @memberof google.protobuf.DescriptorProto
|
17128 | * @instance
|
17129 | */
|
17130 | DescriptorProto.prototype.extensionRange = $util.emptyArray;
|
17131 |
|
17132 | /**
|
17133 | * DescriptorProto oneofDecl.
|
17134 | * @member {Array.<google.protobuf.IOneofDescriptorProto>} oneofDecl
|
17135 | * @memberof google.protobuf.DescriptorProto
|
17136 | * @instance
|
17137 | */
|
17138 | DescriptorProto.prototype.oneofDecl = $util.emptyArray;
|
17139 |
|
17140 | /**
|
17141 | * DescriptorProto options.
|
17142 | * @member {google.protobuf.IMessageOptions|null|undefined} options
|
17143 | * @memberof google.protobuf.DescriptorProto
|
17144 | * @instance
|
17145 | */
|
17146 | DescriptorProto.prototype.options = null;
|
17147 |
|
17148 | /**
|
17149 | * DescriptorProto reservedRange.
|
17150 | * @member {Array.<google.protobuf.DescriptorProto.IReservedRange>} reservedRange
|
17151 | * @memberof google.protobuf.DescriptorProto
|
17152 | * @instance
|
17153 | */
|
17154 | DescriptorProto.prototype.reservedRange = $util.emptyArray;
|
17155 |
|
17156 | /**
|
17157 | * DescriptorProto reservedName.
|
17158 | * @member {Array.<string>} reservedName
|
17159 | * @memberof google.protobuf.DescriptorProto
|
17160 | * @instance
|
17161 | */
|
17162 | DescriptorProto.prototype.reservedName = $util.emptyArray;
|
17163 |
|
17164 | /**
|
17165 | * Creates a new DescriptorProto instance using the specified properties.
|
17166 | * @function create
|
17167 | * @memberof google.protobuf.DescriptorProto
|
17168 | * @static
|
17169 | * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set
|
17170 | * @returns {google.protobuf.DescriptorProto} DescriptorProto instance
|
17171 | */
|
17172 | DescriptorProto.create = function create(properties) {
|
17173 | return new DescriptorProto(properties);
|
17174 | };
|
17175 |
|
17176 | /**
|
17177 | * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages.
|
17178 | * @function encode
|
17179 | * @memberof google.protobuf.DescriptorProto
|
17180 | * @static
|
17181 | * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode
|
17182 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
17183 | * @returns {$protobuf.Writer} Writer
|
17184 | */
|
17185 | DescriptorProto.encode = function encode(message, writer) {
|
17186 | if (!writer)
|
17187 | writer = $Writer.create();
|
17188 | if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
17189 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
|
17190 | if (message.field != null && message.field.length)
|
17191 | for (var i = 0; i < message.field.length; ++i)
|
17192 | $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
17193 | if (message.nestedType != null && message.nestedType.length)
|
17194 | for (var i = 0; i < message.nestedType.length; ++i)
|
17195 | $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
|
17196 | if (message.enumType != null && message.enumType.length)
|
17197 | for (var i = 0; i < message.enumType.length; ++i)
|
17198 | $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
|
17199 | if (message.extensionRange != null && message.extensionRange.length)
|
17200 | for (var i = 0; i < message.extensionRange.length; ++i)
|
17201 | $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
|
17202 | if (message.extension != null && message.extension.length)
|
17203 | for (var i = 0; i < message.extension.length; ++i)
|
17204 | $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
|
17205 | if (message.options != null && Object.hasOwnProperty.call(message, "options"))
|
17206 | $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();
|
17207 | if (message.oneofDecl != null && message.oneofDecl.length)
|
17208 | for (var i = 0; i < message.oneofDecl.length; ++i)
|
17209 | $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();
|
17210 | if (message.reservedRange != null && message.reservedRange.length)
|
17211 | for (var i = 0; i < message.reservedRange.length; ++i)
|
17212 | $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim();
|
17213 | if (message.reservedName != null && message.reservedName.length)
|
17214 | for (var i = 0; i < message.reservedName.length; ++i)
|
17215 | writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]);
|
17216 | return writer;
|
17217 | };
|
17218 |
|
17219 | /**
|
17220 | * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages.
|
17221 | * @function encodeDelimited
|
17222 | * @memberof google.protobuf.DescriptorProto
|
17223 | * @static
|
17224 | * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode
|
17225 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
17226 | * @returns {$protobuf.Writer} Writer
|
17227 | */
|
17228 | DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) {
|
17229 | return this.encode(message, writer).ldelim();
|
17230 | };
|
17231 |
|
17232 | /**
|
17233 | * Decodes a DescriptorProto message from the specified reader or buffer.
|
17234 | * @function decode
|
17235 | * @memberof google.protobuf.DescriptorProto
|
17236 | * @static
|
17237 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
17238 | * @param {number} [length] Message length if known beforehand
|
17239 | * @returns {google.protobuf.DescriptorProto} DescriptorProto
|
17240 | * @throws {Error} If the payload is not a reader or valid buffer
|
17241 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
17242 | */
|
17243 | DescriptorProto.decode = function decode(reader, length) {
|
17244 | if (!(reader instanceof $Reader))
|
17245 | reader = $Reader.create(reader);
|
17246 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto();
|
17247 | while (reader.pos < end) {
|
17248 | var tag = reader.uint32();
|
17249 | switch (tag >>> 3) {
|
17250 | case 1:
|
17251 | message.name = reader.string();
|
17252 | break;
|
17253 | case 2:
|
17254 | if (!(message.field && message.field.length))
|
17255 | message.field = [];
|
17256 | message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32()));
|
17257 | break;
|
17258 | case 6:
|
17259 | if (!(message.extension && message.extension.length))
|
17260 | message.extension = [];
|
17261 | message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32()));
|
17262 | break;
|
17263 | case 3:
|
17264 | if (!(message.nestedType && message.nestedType.length))
|
17265 | message.nestedType = [];
|
17266 | message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32()));
|
17267 | break;
|
17268 | case 4:
|
17269 | if (!(message.enumType && message.enumType.length))
|
17270 | message.enumType = [];
|
17271 | message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32()));
|
17272 | break;
|
17273 | case 5:
|
17274 | if (!(message.extensionRange && message.extensionRange.length))
|
17275 | message.extensionRange = [];
|
17276 | message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32()));
|
17277 | break;
|
17278 | case 8:
|
17279 | if (!(message.oneofDecl && message.oneofDecl.length))
|
17280 | message.oneofDecl = [];
|
17281 | message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32()));
|
17282 | break;
|
17283 | case 7:
|
17284 | message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32());
|
17285 | break;
|
17286 | case 9:
|
17287 | if (!(message.reservedRange && message.reservedRange.length))
|
17288 | message.reservedRange = [];
|
17289 | message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32()));
|
17290 | break;
|
17291 | case 10:
|
17292 | if (!(message.reservedName && message.reservedName.length))
|
17293 | message.reservedName = [];
|
17294 | message.reservedName.push(reader.string());
|
17295 | break;
|
17296 | default:
|
17297 | reader.skipType(tag & 7);
|
17298 | break;
|
17299 | }
|
17300 | }
|
17301 | return message;
|
17302 | };
|
17303 |
|
17304 | /**
|
17305 | * Decodes a DescriptorProto message from the specified reader or buffer, length delimited.
|
17306 | * @function decodeDelimited
|
17307 | * @memberof google.protobuf.DescriptorProto
|
17308 | * @static
|
17309 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
17310 | * @returns {google.protobuf.DescriptorProto} DescriptorProto
|
17311 | * @throws {Error} If the payload is not a reader or valid buffer
|
17312 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
17313 | */
|
17314 | DescriptorProto.decodeDelimited = function decodeDelimited(reader) {
|
17315 | if (!(reader instanceof $Reader))
|
17316 | reader = new $Reader(reader);
|
17317 | return this.decode(reader, reader.uint32());
|
17318 | };
|
17319 |
|
17320 | /**
|
17321 | * Verifies a DescriptorProto message.
|
17322 | * @function verify
|
17323 | * @memberof google.protobuf.DescriptorProto
|
17324 | * @static
|
17325 | * @param {Object.<string,*>} message Plain object to verify
|
17326 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
17327 | */
|
17328 | DescriptorProto.verify = function verify(message) {
|
17329 | if (typeof message !== "object" || message === null)
|
17330 | return "object expected";
|
17331 | if (message.name != null && message.hasOwnProperty("name"))
|
17332 | if (!$util.isString(message.name))
|
17333 | return "name: string expected";
|
17334 | if (message.field != null && message.hasOwnProperty("field")) {
|
17335 | if (!Array.isArray(message.field))
|
17336 | return "field: array expected";
|
17337 | for (var i = 0; i < message.field.length; ++i) {
|
17338 | var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]);
|
17339 | if (error)
|
17340 | return "field." + error;
|
17341 | }
|
17342 | }
|
17343 | if (message.extension != null && message.hasOwnProperty("extension")) {
|
17344 | if (!Array.isArray(message.extension))
|
17345 | return "extension: array expected";
|
17346 | for (var i = 0; i < message.extension.length; ++i) {
|
17347 | var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]);
|
17348 | if (error)
|
17349 | return "extension." + error;
|
17350 | }
|
17351 | }
|
17352 | if (message.nestedType != null && message.hasOwnProperty("nestedType")) {
|
17353 | if (!Array.isArray(message.nestedType))
|
17354 | return "nestedType: array expected";
|
17355 | for (var i = 0; i < message.nestedType.length; ++i) {
|
17356 | var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]);
|
17357 | if (error)
|
17358 | return "nestedType." + error;
|
17359 | }
|
17360 | }
|
17361 | if (message.enumType != null && message.hasOwnProperty("enumType")) {
|
17362 | if (!Array.isArray(message.enumType))
|
17363 | return "enumType: array expected";
|
17364 | for (var i = 0; i < message.enumType.length; ++i) {
|
17365 | var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]);
|
17366 | if (error)
|
17367 | return "enumType." + error;
|
17368 | }
|
17369 | }
|
17370 | if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) {
|
17371 | if (!Array.isArray(message.extensionRange))
|
17372 | return "extensionRange: array expected";
|
17373 | for (var i = 0; i < message.extensionRange.length; ++i) {
|
17374 | var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]);
|
17375 | if (error)
|
17376 | return "extensionRange." + error;
|
17377 | }
|
17378 | }
|
17379 | if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) {
|
17380 | if (!Array.isArray(message.oneofDecl))
|
17381 | return "oneofDecl: array expected";
|
17382 | for (var i = 0; i < message.oneofDecl.length; ++i) {
|
17383 | var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]);
|
17384 | if (error)
|
17385 | return "oneofDecl." + error;
|
17386 | }
|
17387 | }
|
17388 | if (message.options != null && message.hasOwnProperty("options")) {
|
17389 | var error = $root.google.protobuf.MessageOptions.verify(message.options);
|
17390 | if (error)
|
17391 | return "options." + error;
|
17392 | }
|
17393 | if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) {
|
17394 | if (!Array.isArray(message.reservedRange))
|
17395 | return "reservedRange: array expected";
|
17396 | for (var i = 0; i < message.reservedRange.length; ++i) {
|
17397 | var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]);
|
17398 | if (error)
|
17399 | return "reservedRange." + error;
|
17400 | }
|
17401 | }
|
17402 | if (message.reservedName != null && message.hasOwnProperty("reservedName")) {
|
17403 | if (!Array.isArray(message.reservedName))
|
17404 | return "reservedName: array expected";
|
17405 | for (var i = 0; i < message.reservedName.length; ++i)
|
17406 | if (!$util.isString(message.reservedName[i]))
|
17407 | return "reservedName: string[] expected";
|
17408 | }
|
17409 | return null;
|
17410 | };
|
17411 |
|
17412 | /**
|
17413 | * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types.
|
17414 | * @function fromObject
|
17415 | * @memberof google.protobuf.DescriptorProto
|
17416 | * @static
|
17417 | * @param {Object.<string,*>} object Plain object
|
17418 | * @returns {google.protobuf.DescriptorProto} DescriptorProto
|
17419 | */
|
17420 | DescriptorProto.fromObject = function fromObject(object) {
|
17421 | if (object instanceof $root.google.protobuf.DescriptorProto)
|
17422 | return object;
|
17423 | var message = new $root.google.protobuf.DescriptorProto();
|
17424 | if (object.name != null)
|
17425 | message.name = String(object.name);
|
17426 | if (object.field) {
|
17427 | if (!Array.isArray(object.field))
|
17428 | throw TypeError(".google.protobuf.DescriptorProto.field: array expected");
|
17429 | message.field = [];
|
17430 | for (var i = 0; i < object.field.length; ++i) {
|
17431 | if (typeof object.field[i] !== "object")
|
17432 | throw TypeError(".google.protobuf.DescriptorProto.field: object expected");
|
17433 | message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]);
|
17434 | }
|
17435 | }
|
17436 | if (object.extension) {
|
17437 | if (!Array.isArray(object.extension))
|
17438 | throw TypeError(".google.protobuf.DescriptorProto.extension: array expected");
|
17439 | message.extension = [];
|
17440 | for (var i = 0; i < object.extension.length; ++i) {
|
17441 | if (typeof object.extension[i] !== "object")
|
17442 | throw TypeError(".google.protobuf.DescriptorProto.extension: object expected");
|
17443 | message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]);
|
17444 | }
|
17445 | }
|
17446 | if (object.nestedType) {
|
17447 | if (!Array.isArray(object.nestedType))
|
17448 | throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected");
|
17449 | message.nestedType = [];
|
17450 | for (var i = 0; i < object.nestedType.length; ++i) {
|
17451 | if (typeof object.nestedType[i] !== "object")
|
17452 | throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected");
|
17453 | message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]);
|
17454 | }
|
17455 | }
|
17456 | if (object.enumType) {
|
17457 | if (!Array.isArray(object.enumType))
|
17458 | throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected");
|
17459 | message.enumType = [];
|
17460 | for (var i = 0; i < object.enumType.length; ++i) {
|
17461 | if (typeof object.enumType[i] !== "object")
|
17462 | throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected");
|
17463 | message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]);
|
17464 | }
|
17465 | }
|
17466 | if (object.extensionRange) {
|
17467 | if (!Array.isArray(object.extensionRange))
|
17468 | throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected");
|
17469 | message.extensionRange = [];
|
17470 | for (var i = 0; i < object.extensionRange.length; ++i) {
|
17471 | if (typeof object.extensionRange[i] !== "object")
|
17472 | throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected");
|
17473 | message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]);
|
17474 | }
|
17475 | }
|
17476 | if (object.oneofDecl) {
|
17477 | if (!Array.isArray(object.oneofDecl))
|
17478 | throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected");
|
17479 | message.oneofDecl = [];
|
17480 | for (var i = 0; i < object.oneofDecl.length; ++i) {
|
17481 | if (typeof object.oneofDecl[i] !== "object")
|
17482 | throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected");
|
17483 | message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]);
|
17484 | }
|
17485 | }
|
17486 | if (object.options != null) {
|
17487 | if (typeof object.options !== "object")
|
17488 | throw TypeError(".google.protobuf.DescriptorProto.options: object expected");
|
17489 | message.options = $root.google.protobuf.MessageOptions.fromObject(object.options);
|
17490 | }
|
17491 | if (object.reservedRange) {
|
17492 | if (!Array.isArray(object.reservedRange))
|
17493 | throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected");
|
17494 | message.reservedRange = [];
|
17495 | for (var i = 0; i < object.reservedRange.length; ++i) {
|
17496 | if (typeof object.reservedRange[i] !== "object")
|
17497 | throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected");
|
17498 | message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]);
|
17499 | }
|
17500 | }
|
17501 | if (object.reservedName) {
|
17502 | if (!Array.isArray(object.reservedName))
|
17503 | throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected");
|
17504 | message.reservedName = [];
|
17505 | for (var i = 0; i < object.reservedName.length; ++i)
|
17506 | message.reservedName[i] = String(object.reservedName[i]);
|
17507 | }
|
17508 | return message;
|
17509 | };
|
17510 |
|
17511 | /**
|
17512 | * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified.
|
17513 | * @function toObject
|
17514 | * @memberof google.protobuf.DescriptorProto
|
17515 | * @static
|
17516 | * @param {google.protobuf.DescriptorProto} message DescriptorProto
|
17517 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
17518 | * @returns {Object.<string,*>} Plain object
|
17519 | */
|
17520 | DescriptorProto.toObject = function toObject(message, options) {
|
17521 | if (!options)
|
17522 | options = {};
|
17523 | var object = {};
|
17524 | if (options.arrays || options.defaults) {
|
17525 | object.field = [];
|
17526 | object.nestedType = [];
|
17527 | object.enumType = [];
|
17528 | object.extensionRange = [];
|
17529 | object.extension = [];
|
17530 | object.oneofDecl = [];
|
17531 | object.reservedRange = [];
|
17532 | object.reservedName = [];
|
17533 | }
|
17534 | if (options.defaults) {
|
17535 | object.name = "";
|
17536 | object.options = null;
|
17537 | }
|
17538 | if (message.name != null && message.hasOwnProperty("name"))
|
17539 | object.name = message.name;
|
17540 | if (message.field && message.field.length) {
|
17541 | object.field = [];
|
17542 | for (var j = 0; j < message.field.length; ++j)
|
17543 | object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options);
|
17544 | }
|
17545 | if (message.nestedType && message.nestedType.length) {
|
17546 | object.nestedType = [];
|
17547 | for (var j = 0; j < message.nestedType.length; ++j)
|
17548 | object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options);
|
17549 | }
|
17550 | if (message.enumType && message.enumType.length) {
|
17551 | object.enumType = [];
|
17552 | for (var j = 0; j < message.enumType.length; ++j)
|
17553 | object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options);
|
17554 | }
|
17555 | if (message.extensionRange && message.extensionRange.length) {
|
17556 | object.extensionRange = [];
|
17557 | for (var j = 0; j < message.extensionRange.length; ++j)
|
17558 | object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options);
|
17559 | }
|
17560 | if (message.extension && message.extension.length) {
|
17561 | object.extension = [];
|
17562 | for (var j = 0; j < message.extension.length; ++j)
|
17563 | object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options);
|
17564 | }
|
17565 | if (message.options != null && message.hasOwnProperty("options"))
|
17566 | object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options);
|
17567 | if (message.oneofDecl && message.oneofDecl.length) {
|
17568 | object.oneofDecl = [];
|
17569 | for (var j = 0; j < message.oneofDecl.length; ++j)
|
17570 | object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options);
|
17571 | }
|
17572 | if (message.reservedRange && message.reservedRange.length) {
|
17573 | object.reservedRange = [];
|
17574 | for (var j = 0; j < message.reservedRange.length; ++j)
|
17575 | object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options);
|
17576 | }
|
17577 | if (message.reservedName && message.reservedName.length) {
|
17578 | object.reservedName = [];
|
17579 | for (var j = 0; j < message.reservedName.length; ++j)
|
17580 | object.reservedName[j] = message.reservedName[j];
|
17581 | }
|
17582 | return object;
|
17583 | };
|
17584 |
|
17585 | /**
|
17586 | * Converts this DescriptorProto to JSON.
|
17587 | * @function toJSON
|
17588 | * @memberof google.protobuf.DescriptorProto
|
17589 | * @instance
|
17590 | * @returns {Object.<string,*>} JSON object
|
17591 | */
|
17592 | DescriptorProto.prototype.toJSON = function toJSON() {
|
17593 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
17594 | };
|
17595 |
|
17596 | DescriptorProto.ExtensionRange = (function() {
|
17597 |
|
17598 | /**
|
17599 | * Properties of an ExtensionRange.
|
17600 | * @memberof google.protobuf.DescriptorProto
|
17601 | * @interface IExtensionRange
|
17602 | * @property {number|null} [start] ExtensionRange start
|
17603 | * @property {number|null} [end] ExtensionRange end
|
17604 | * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options
|
17605 | */
|
17606 |
|
17607 | /**
|
17608 | * Constructs a new ExtensionRange.
|
17609 | * @memberof google.protobuf.DescriptorProto
|
17610 | * @classdesc Represents an ExtensionRange.
|
17611 | * @implements IExtensionRange
|
17612 | * @constructor
|
17613 | * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set
|
17614 | */
|
17615 | function ExtensionRange(properties) {
|
17616 | if (properties)
|
17617 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
17618 | if (properties[keys[i]] != null)
|
17619 | this[keys[i]] = properties[keys[i]];
|
17620 | }
|
17621 |
|
17622 | /**
|
17623 | * ExtensionRange start.
|
17624 | * @member {number} start
|
17625 | * @memberof google.protobuf.DescriptorProto.ExtensionRange
|
17626 | * @instance
|
17627 | */
|
17628 | ExtensionRange.prototype.start = 0;
|
17629 |
|
17630 | /**
|
17631 | * ExtensionRange end.
|
17632 | * @member {number} end
|
17633 | * @memberof google.protobuf.DescriptorProto.ExtensionRange
|
17634 | * @instance
|
17635 | */
|
17636 | ExtensionRange.prototype.end = 0;
|
17637 |
|
17638 | /**
|
17639 | * ExtensionRange options.
|
17640 | * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options
|
17641 | * @memberof google.protobuf.DescriptorProto.ExtensionRange
|
17642 | * @instance
|
17643 | */
|
17644 | ExtensionRange.prototype.options = null;
|
17645 |
|
17646 | /**
|
17647 | * Creates a new ExtensionRange instance using the specified properties.
|
17648 | * @function create
|
17649 | * @memberof google.protobuf.DescriptorProto.ExtensionRange
|
17650 | * @static
|
17651 | * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set
|
17652 | * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance
|
17653 | */
|
17654 | ExtensionRange.create = function create(properties) {
|
17655 | return new ExtensionRange(properties);
|
17656 | };
|
17657 |
|
17658 | /**
|
17659 | * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages.
|
17660 | * @function encode
|
17661 | * @memberof google.protobuf.DescriptorProto.ExtensionRange
|
17662 | * @static
|
17663 | * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode
|
17664 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
17665 | * @returns {$protobuf.Writer} Writer
|
17666 | */
|
17667 | ExtensionRange.encode = function encode(message, writer) {
|
17668 | if (!writer)
|
17669 | writer = $Writer.create();
|
17670 | if (message.start != null && Object.hasOwnProperty.call(message, "start"))
|
17671 | writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start);
|
17672 | if (message.end != null && Object.hasOwnProperty.call(message, "end"))
|
17673 | writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end);
|
17674 | if (message.options != null && Object.hasOwnProperty.call(message, "options"))
|
17675 | $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
|
17676 | return writer;
|
17677 | };
|
17678 |
|
17679 | /**
|
17680 | * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages.
|
17681 | * @function encodeDelimited
|
17682 | * @memberof google.protobuf.DescriptorProto.ExtensionRange
|
17683 | * @static
|
17684 | * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode
|
17685 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
17686 | * @returns {$protobuf.Writer} Writer
|
17687 | */
|
17688 | ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) {
|
17689 | return this.encode(message, writer).ldelim();
|
17690 | };
|
17691 |
|
17692 | /**
|
17693 | * Decodes an ExtensionRange message from the specified reader or buffer.
|
17694 | * @function decode
|
17695 | * @memberof google.protobuf.DescriptorProto.ExtensionRange
|
17696 | * @static
|
17697 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
17698 | * @param {number} [length] Message length if known beforehand
|
17699 | * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange
|
17700 | * @throws {Error} If the payload is not a reader or valid buffer
|
17701 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
17702 | */
|
17703 | ExtensionRange.decode = function decode(reader, length) {
|
17704 | if (!(reader instanceof $Reader))
|
17705 | reader = $Reader.create(reader);
|
17706 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange();
|
17707 | while (reader.pos < end) {
|
17708 | var tag = reader.uint32();
|
17709 | switch (tag >>> 3) {
|
17710 | case 1:
|
17711 | message.start = reader.int32();
|
17712 | break;
|
17713 | case 2:
|
17714 | message.end = reader.int32();
|
17715 | break;
|
17716 | case 3:
|
17717 | message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32());
|
17718 | break;
|
17719 | default:
|
17720 | reader.skipType(tag & 7);
|
17721 | break;
|
17722 | }
|
17723 | }
|
17724 | return message;
|
17725 | };
|
17726 |
|
17727 | /**
|
17728 | * Decodes an ExtensionRange message from the specified reader or buffer, length delimited.
|
17729 | * @function decodeDelimited
|
17730 | * @memberof google.protobuf.DescriptorProto.ExtensionRange
|
17731 | * @static
|
17732 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
17733 | * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange
|
17734 | * @throws {Error} If the payload is not a reader or valid buffer
|
17735 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
17736 | */
|
17737 | ExtensionRange.decodeDelimited = function decodeDelimited(reader) {
|
17738 | if (!(reader instanceof $Reader))
|
17739 | reader = new $Reader(reader);
|
17740 | return this.decode(reader, reader.uint32());
|
17741 | };
|
17742 |
|
17743 | /**
|
17744 | * Verifies an ExtensionRange message.
|
17745 | * @function verify
|
17746 | * @memberof google.protobuf.DescriptorProto.ExtensionRange
|
17747 | * @static
|
17748 | * @param {Object.<string,*>} message Plain object to verify
|
17749 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
17750 | */
|
17751 | ExtensionRange.verify = function verify(message) {
|
17752 | if (typeof message !== "object" || message === null)
|
17753 | return "object expected";
|
17754 | if (message.start != null && message.hasOwnProperty("start"))
|
17755 | if (!$util.isInteger(message.start))
|
17756 | return "start: integer expected";
|
17757 | if (message.end != null && message.hasOwnProperty("end"))
|
17758 | if (!$util.isInteger(message.end))
|
17759 | return "end: integer expected";
|
17760 | if (message.options != null && message.hasOwnProperty("options")) {
|
17761 | var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options);
|
17762 | if (error)
|
17763 | return "options." + error;
|
17764 | }
|
17765 | return null;
|
17766 | };
|
17767 |
|
17768 | /**
|
17769 | * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types.
|
17770 | * @function fromObject
|
17771 | * @memberof google.protobuf.DescriptorProto.ExtensionRange
|
17772 | * @static
|
17773 | * @param {Object.<string,*>} object Plain object
|
17774 | * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange
|
17775 | */
|
17776 | ExtensionRange.fromObject = function fromObject(object) {
|
17777 | if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange)
|
17778 | return object;
|
17779 | var message = new $root.google.protobuf.DescriptorProto.ExtensionRange();
|
17780 | if (object.start != null)
|
17781 | message.start = object.start | 0;
|
17782 | if (object.end != null)
|
17783 | message.end = object.end | 0;
|
17784 | if (object.options != null) {
|
17785 | if (typeof object.options !== "object")
|
17786 | throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected");
|
17787 | message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options);
|
17788 | }
|
17789 | return message;
|
17790 | };
|
17791 |
|
17792 | /**
|
17793 | * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified.
|
17794 | * @function toObject
|
17795 | * @memberof google.protobuf.DescriptorProto.ExtensionRange
|
17796 | * @static
|
17797 | * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange
|
17798 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
17799 | * @returns {Object.<string,*>} Plain object
|
17800 | */
|
17801 | ExtensionRange.toObject = function toObject(message, options) {
|
17802 | if (!options)
|
17803 | options = {};
|
17804 | var object = {};
|
17805 | if (options.defaults) {
|
17806 | object.start = 0;
|
17807 | object.end = 0;
|
17808 | object.options = null;
|
17809 | }
|
17810 | if (message.start != null && message.hasOwnProperty("start"))
|
17811 | object.start = message.start;
|
17812 | if (message.end != null && message.hasOwnProperty("end"))
|
17813 | object.end = message.end;
|
17814 | if (message.options != null && message.hasOwnProperty("options"))
|
17815 | object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options);
|
17816 | return object;
|
17817 | };
|
17818 |
|
17819 | /**
|
17820 | * Converts this ExtensionRange to JSON.
|
17821 | * @function toJSON
|
17822 | * @memberof google.protobuf.DescriptorProto.ExtensionRange
|
17823 | * @instance
|
17824 | * @returns {Object.<string,*>} JSON object
|
17825 | */
|
17826 | ExtensionRange.prototype.toJSON = function toJSON() {
|
17827 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
17828 | };
|
17829 |
|
17830 | return ExtensionRange;
|
17831 | })();
|
17832 |
|
17833 | DescriptorProto.ReservedRange = (function() {
|
17834 |
|
17835 | /**
|
17836 | * Properties of a ReservedRange.
|
17837 | * @memberof google.protobuf.DescriptorProto
|
17838 | * @interface IReservedRange
|
17839 | * @property {number|null} [start] ReservedRange start
|
17840 | * @property {number|null} [end] ReservedRange end
|
17841 | */
|
17842 |
|
17843 | /**
|
17844 | * Constructs a new ReservedRange.
|
17845 | * @memberof google.protobuf.DescriptorProto
|
17846 | * @classdesc Represents a ReservedRange.
|
17847 | * @implements IReservedRange
|
17848 | * @constructor
|
17849 | * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set
|
17850 | */
|
17851 | function ReservedRange(properties) {
|
17852 | if (properties)
|
17853 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
17854 | if (properties[keys[i]] != null)
|
17855 | this[keys[i]] = properties[keys[i]];
|
17856 | }
|
17857 |
|
17858 | /**
|
17859 | * ReservedRange start.
|
17860 | * @member {number} start
|
17861 | * @memberof google.protobuf.DescriptorProto.ReservedRange
|
17862 | * @instance
|
17863 | */
|
17864 | ReservedRange.prototype.start = 0;
|
17865 |
|
17866 | /**
|
17867 | * ReservedRange end.
|
17868 | * @member {number} end
|
17869 | * @memberof google.protobuf.DescriptorProto.ReservedRange
|
17870 | * @instance
|
17871 | */
|
17872 | ReservedRange.prototype.end = 0;
|
17873 |
|
17874 | /**
|
17875 | * Creates a new ReservedRange instance using the specified properties.
|
17876 | * @function create
|
17877 | * @memberof google.protobuf.DescriptorProto.ReservedRange
|
17878 | * @static
|
17879 | * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set
|
17880 | * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance
|
17881 | */
|
17882 | ReservedRange.create = function create(properties) {
|
17883 | return new ReservedRange(properties);
|
17884 | };
|
17885 |
|
17886 | /**
|
17887 | * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages.
|
17888 | * @function encode
|
17889 | * @memberof google.protobuf.DescriptorProto.ReservedRange
|
17890 | * @static
|
17891 | * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode
|
17892 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
17893 | * @returns {$protobuf.Writer} Writer
|
17894 | */
|
17895 | ReservedRange.encode = function encode(message, writer) {
|
17896 | if (!writer)
|
17897 | writer = $Writer.create();
|
17898 | if (message.start != null && Object.hasOwnProperty.call(message, "start"))
|
17899 | writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start);
|
17900 | if (message.end != null && Object.hasOwnProperty.call(message, "end"))
|
17901 | writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end);
|
17902 | return writer;
|
17903 | };
|
17904 |
|
17905 | /**
|
17906 | * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages.
|
17907 | * @function encodeDelimited
|
17908 | * @memberof google.protobuf.DescriptorProto.ReservedRange
|
17909 | * @static
|
17910 | * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode
|
17911 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
17912 | * @returns {$protobuf.Writer} Writer
|
17913 | */
|
17914 | ReservedRange.encodeDelimited = function encodeDelimited(message, writer) {
|
17915 | return this.encode(message, writer).ldelim();
|
17916 | };
|
17917 |
|
17918 | /**
|
17919 | * Decodes a ReservedRange message from the specified reader or buffer.
|
17920 | * @function decode
|
17921 | * @memberof google.protobuf.DescriptorProto.ReservedRange
|
17922 | * @static
|
17923 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
17924 | * @param {number} [length] Message length if known beforehand
|
17925 | * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange
|
17926 | * @throws {Error} If the payload is not a reader or valid buffer
|
17927 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
17928 | */
|
17929 | ReservedRange.decode = function decode(reader, length) {
|
17930 | if (!(reader instanceof $Reader))
|
17931 | reader = $Reader.create(reader);
|
17932 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange();
|
17933 | while (reader.pos < end) {
|
17934 | var tag = reader.uint32();
|
17935 | switch (tag >>> 3) {
|
17936 | case 1:
|
17937 | message.start = reader.int32();
|
17938 | break;
|
17939 | case 2:
|
17940 | message.end = reader.int32();
|
17941 | break;
|
17942 | default:
|
17943 | reader.skipType(tag & 7);
|
17944 | break;
|
17945 | }
|
17946 | }
|
17947 | return message;
|
17948 | };
|
17949 |
|
17950 | /**
|
17951 | * Decodes a ReservedRange message from the specified reader or buffer, length delimited.
|
17952 | * @function decodeDelimited
|
17953 | * @memberof google.protobuf.DescriptorProto.ReservedRange
|
17954 | * @static
|
17955 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
17956 | * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange
|
17957 | * @throws {Error} If the payload is not a reader or valid buffer
|
17958 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
17959 | */
|
17960 | ReservedRange.decodeDelimited = function decodeDelimited(reader) {
|
17961 | if (!(reader instanceof $Reader))
|
17962 | reader = new $Reader(reader);
|
17963 | return this.decode(reader, reader.uint32());
|
17964 | };
|
17965 |
|
17966 | /**
|
17967 | * Verifies a ReservedRange message.
|
17968 | * @function verify
|
17969 | * @memberof google.protobuf.DescriptorProto.ReservedRange
|
17970 | * @static
|
17971 | * @param {Object.<string,*>} message Plain object to verify
|
17972 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
17973 | */
|
17974 | ReservedRange.verify = function verify(message) {
|
17975 | if (typeof message !== "object" || message === null)
|
17976 | return "object expected";
|
17977 | if (message.start != null && message.hasOwnProperty("start"))
|
17978 | if (!$util.isInteger(message.start))
|
17979 | return "start: integer expected";
|
17980 | if (message.end != null && message.hasOwnProperty("end"))
|
17981 | if (!$util.isInteger(message.end))
|
17982 | return "end: integer expected";
|
17983 | return null;
|
17984 | };
|
17985 |
|
17986 | /**
|
17987 | * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types.
|
17988 | * @function fromObject
|
17989 | * @memberof google.protobuf.DescriptorProto.ReservedRange
|
17990 | * @static
|
17991 | * @param {Object.<string,*>} object Plain object
|
17992 | * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange
|
17993 | */
|
17994 | ReservedRange.fromObject = function fromObject(object) {
|
17995 | if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange)
|
17996 | return object;
|
17997 | var message = new $root.google.protobuf.DescriptorProto.ReservedRange();
|
17998 | if (object.start != null)
|
17999 | message.start = object.start | 0;
|
18000 | if (object.end != null)
|
18001 | message.end = object.end | 0;
|
18002 | return message;
|
18003 | };
|
18004 |
|
18005 | /**
|
18006 | * Creates a plain object from a ReservedRange message. Also converts values to other types if specified.
|
18007 | * @function toObject
|
18008 | * @memberof google.protobuf.DescriptorProto.ReservedRange
|
18009 | * @static
|
18010 | * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange
|
18011 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
18012 | * @returns {Object.<string,*>} Plain object
|
18013 | */
|
18014 | ReservedRange.toObject = function toObject(message, options) {
|
18015 | if (!options)
|
18016 | options = {};
|
18017 | var object = {};
|
18018 | if (options.defaults) {
|
18019 | object.start = 0;
|
18020 | object.end = 0;
|
18021 | }
|
18022 | if (message.start != null && message.hasOwnProperty("start"))
|
18023 | object.start = message.start;
|
18024 | if (message.end != null && message.hasOwnProperty("end"))
|
18025 | object.end = message.end;
|
18026 | return object;
|
18027 | };
|
18028 |
|
18029 | /**
|
18030 | * Converts this ReservedRange to JSON.
|
18031 | * @function toJSON
|
18032 | * @memberof google.protobuf.DescriptorProto.ReservedRange
|
18033 | * @instance
|
18034 | * @returns {Object.<string,*>} JSON object
|
18035 | */
|
18036 | ReservedRange.prototype.toJSON = function toJSON() {
|
18037 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
18038 | };
|
18039 |
|
18040 | return ReservedRange;
|
18041 | })();
|
18042 |
|
18043 | return DescriptorProto;
|
18044 | })();
|
18045 |
|
18046 | protobuf.ExtensionRangeOptions = (function() {
|
18047 |
|
18048 | /**
|
18049 | * Properties of an ExtensionRangeOptions.
|
18050 | * @memberof google.protobuf
|
18051 | * @interface IExtensionRangeOptions
|
18052 | * @property {Array.<google.protobuf.IUninterpretedOption>|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption
|
18053 | */
|
18054 |
|
18055 | /**
|
18056 | * Constructs a new ExtensionRangeOptions.
|
18057 | * @memberof google.protobuf
|
18058 | * @classdesc Represents an ExtensionRangeOptions.
|
18059 | * @implements IExtensionRangeOptions
|
18060 | * @constructor
|
18061 | * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set
|
18062 | */
|
18063 | function ExtensionRangeOptions(properties) {
|
18064 | this.uninterpretedOption = [];
|
18065 | if (properties)
|
18066 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
18067 | if (properties[keys[i]] != null)
|
18068 | this[keys[i]] = properties[keys[i]];
|
18069 | }
|
18070 |
|
18071 | /**
|
18072 | * ExtensionRangeOptions uninterpretedOption.
|
18073 | * @member {Array.<google.protobuf.IUninterpretedOption>} uninterpretedOption
|
18074 | * @memberof google.protobuf.ExtensionRangeOptions
|
18075 | * @instance
|
18076 | */
|
18077 | ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray;
|
18078 |
|
18079 | /**
|
18080 | * Creates a new ExtensionRangeOptions instance using the specified properties.
|
18081 | * @function create
|
18082 | * @memberof google.protobuf.ExtensionRangeOptions
|
18083 | * @static
|
18084 | * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set
|
18085 | * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance
|
18086 | */
|
18087 | ExtensionRangeOptions.create = function create(properties) {
|
18088 | return new ExtensionRangeOptions(properties);
|
18089 | };
|
18090 |
|
18091 | /**
|
18092 | * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages.
|
18093 | * @function encode
|
18094 | * @memberof google.protobuf.ExtensionRangeOptions
|
18095 | * @static
|
18096 | * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode
|
18097 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
18098 | * @returns {$protobuf.Writer} Writer
|
18099 | */
|
18100 | ExtensionRangeOptions.encode = function encode(message, writer) {
|
18101 | if (!writer)
|
18102 | writer = $Writer.create();
|
18103 | if (message.uninterpretedOption != null && message.uninterpretedOption.length)
|
18104 | for (var i = 0; i < message.uninterpretedOption.length; ++i)
|
18105 | $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim();
|
18106 | return writer;
|
18107 | };
|
18108 |
|
18109 | /**
|
18110 | * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages.
|
18111 | * @function encodeDelimited
|
18112 | * @memberof google.protobuf.ExtensionRangeOptions
|
18113 | * @static
|
18114 | * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode
|
18115 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
18116 | * @returns {$protobuf.Writer} Writer
|
18117 | */
|
18118 | ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) {
|
18119 | return this.encode(message, writer).ldelim();
|
18120 | };
|
18121 |
|
18122 | /**
|
18123 | * Decodes an ExtensionRangeOptions message from the specified reader or buffer.
|
18124 | * @function decode
|
18125 | * @memberof google.protobuf.ExtensionRangeOptions
|
18126 | * @static
|
18127 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
18128 | * @param {number} [length] Message length if known beforehand
|
18129 | * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions
|
18130 | * @throws {Error} If the payload is not a reader or valid buffer
|
18131 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
18132 | */
|
18133 | ExtensionRangeOptions.decode = function decode(reader, length) {
|
18134 | if (!(reader instanceof $Reader))
|
18135 | reader = $Reader.create(reader);
|
18136 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions();
|
18137 | while (reader.pos < end) {
|
18138 | var tag = reader.uint32();
|
18139 | switch (tag >>> 3) {
|
18140 | case 999:
|
18141 | if (!(message.uninterpretedOption && message.uninterpretedOption.length))
|
18142 | message.uninterpretedOption = [];
|
18143 | message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32()));
|
18144 | break;
|
18145 | default:
|
18146 | reader.skipType(tag & 7);
|
18147 | break;
|
18148 | }
|
18149 | }
|
18150 | return message;
|
18151 | };
|
18152 |
|
18153 | /**
|
18154 | * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited.
|
18155 | * @function decodeDelimited
|
18156 | * @memberof google.protobuf.ExtensionRangeOptions
|
18157 | * @static
|
18158 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
18159 | * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions
|
18160 | * @throws {Error} If the payload is not a reader or valid buffer
|
18161 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
18162 | */
|
18163 | ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) {
|
18164 | if (!(reader instanceof $Reader))
|
18165 | reader = new $Reader(reader);
|
18166 | return this.decode(reader, reader.uint32());
|
18167 | };
|
18168 |
|
18169 | /**
|
18170 | * Verifies an ExtensionRangeOptions message.
|
18171 | * @function verify
|
18172 | * @memberof google.protobuf.ExtensionRangeOptions
|
18173 | * @static
|
18174 | * @param {Object.<string,*>} message Plain object to verify
|
18175 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
18176 | */
|
18177 | ExtensionRangeOptions.verify = function verify(message) {
|
18178 | if (typeof message !== "object" || message === null)
|
18179 | return "object expected";
|
18180 | if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) {
|
18181 | if (!Array.isArray(message.uninterpretedOption))
|
18182 | return "uninterpretedOption: array expected";
|
18183 | for (var i = 0; i < message.uninterpretedOption.length; ++i) {
|
18184 | var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]);
|
18185 | if (error)
|
18186 | return "uninterpretedOption." + error;
|
18187 | }
|
18188 | }
|
18189 | return null;
|
18190 | };
|
18191 |
|
18192 | /**
|
18193 | * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types.
|
18194 | * @function fromObject
|
18195 | * @memberof google.protobuf.ExtensionRangeOptions
|
18196 | * @static
|
18197 | * @param {Object.<string,*>} object Plain object
|
18198 | * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions
|
18199 | */
|
18200 | ExtensionRangeOptions.fromObject = function fromObject(object) {
|
18201 | if (object instanceof $root.google.protobuf.ExtensionRangeOptions)
|
18202 | return object;
|
18203 | var message = new $root.google.protobuf.ExtensionRangeOptions();
|
18204 | if (object.uninterpretedOption) {
|
18205 | if (!Array.isArray(object.uninterpretedOption))
|
18206 | throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected");
|
18207 | message.uninterpretedOption = [];
|
18208 | for (var i = 0; i < object.uninterpretedOption.length; ++i) {
|
18209 | if (typeof object.uninterpretedOption[i] !== "object")
|
18210 | throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected");
|
18211 | message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]);
|
18212 | }
|
18213 | }
|
18214 | return message;
|
18215 | };
|
18216 |
|
18217 | /**
|
18218 | * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified.
|
18219 | * @function toObject
|
18220 | * @memberof google.protobuf.ExtensionRangeOptions
|
18221 | * @static
|
18222 | * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions
|
18223 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
18224 | * @returns {Object.<string,*>} Plain object
|
18225 | */
|
18226 | ExtensionRangeOptions.toObject = function toObject(message, options) {
|
18227 | if (!options)
|
18228 | options = {};
|
18229 | var object = {};
|
18230 | if (options.arrays || options.defaults)
|
18231 | object.uninterpretedOption = [];
|
18232 | if (message.uninterpretedOption && message.uninterpretedOption.length) {
|
18233 | object.uninterpretedOption = [];
|
18234 | for (var j = 0; j < message.uninterpretedOption.length; ++j)
|
18235 | object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options);
|
18236 | }
|
18237 | return object;
|
18238 | };
|
18239 |
|
18240 | /**
|
18241 | * Converts this ExtensionRangeOptions to JSON.
|
18242 | * @function toJSON
|
18243 | * @memberof google.protobuf.ExtensionRangeOptions
|
18244 | * @instance
|
18245 | * @returns {Object.<string,*>} JSON object
|
18246 | */
|
18247 | ExtensionRangeOptions.prototype.toJSON = function toJSON() {
|
18248 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
18249 | };
|
18250 |
|
18251 | return ExtensionRangeOptions;
|
18252 | })();
|
18253 |
|
18254 | protobuf.FieldDescriptorProto = (function() {
|
18255 |
|
18256 | /**
|
18257 | * Properties of a FieldDescriptorProto.
|
18258 | * @memberof google.protobuf
|
18259 | * @interface IFieldDescriptorProto
|
18260 | * @property {string|null} [name] FieldDescriptorProto name
|
18261 | * @property {number|null} [number] FieldDescriptorProto number
|
18262 | * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label
|
18263 | * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type
|
18264 | * @property {string|null} [typeName] FieldDescriptorProto typeName
|
18265 | * @property {string|null} [extendee] FieldDescriptorProto extendee
|
18266 | * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue
|
18267 | * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex
|
18268 | * @property {string|null} [jsonName] FieldDescriptorProto jsonName
|
18269 | * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options
|
18270 | * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional
|
18271 | */
|
18272 |
|
18273 | /**
|
18274 | * Constructs a new FieldDescriptorProto.
|
18275 | * @memberof google.protobuf
|
18276 | * @classdesc Represents a FieldDescriptorProto.
|
18277 | * @implements IFieldDescriptorProto
|
18278 | * @constructor
|
18279 | * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set
|
18280 | */
|
18281 | function FieldDescriptorProto(properties) {
|
18282 | if (properties)
|
18283 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
18284 | if (properties[keys[i]] != null)
|
18285 | this[keys[i]] = properties[keys[i]];
|
18286 | }
|
18287 |
|
18288 | /**
|
18289 | * FieldDescriptorProto name.
|
18290 | * @member {string} name
|
18291 | * @memberof google.protobuf.FieldDescriptorProto
|
18292 | * @instance
|
18293 | */
|
18294 | FieldDescriptorProto.prototype.name = "";
|
18295 |
|
18296 | /**
|
18297 | * FieldDescriptorProto number.
|
18298 | * @member {number} number
|
18299 | * @memberof google.protobuf.FieldDescriptorProto
|
18300 | * @instance
|
18301 | */
|
18302 | FieldDescriptorProto.prototype.number = 0;
|
18303 |
|
18304 | /**
|
18305 | * FieldDescriptorProto label.
|
18306 | * @member {google.protobuf.FieldDescriptorProto.Label} label
|
18307 | * @memberof google.protobuf.FieldDescriptorProto
|
18308 | * @instance
|
18309 | */
|
18310 | FieldDescriptorProto.prototype.label = 1;
|
18311 |
|
18312 | /**
|
18313 | * FieldDescriptorProto type.
|
18314 | * @member {google.protobuf.FieldDescriptorProto.Type} type
|
18315 | * @memberof google.protobuf.FieldDescriptorProto
|
18316 | * @instance
|
18317 | */
|
18318 | FieldDescriptorProto.prototype.type = 1;
|
18319 |
|
18320 | /**
|
18321 | * FieldDescriptorProto typeName.
|
18322 | * @member {string} typeName
|
18323 | * @memberof google.protobuf.FieldDescriptorProto
|
18324 | * @instance
|
18325 | */
|
18326 | FieldDescriptorProto.prototype.typeName = "";
|
18327 |
|
18328 | /**
|
18329 | * FieldDescriptorProto extendee.
|
18330 | * @member {string} extendee
|
18331 | * @memberof google.protobuf.FieldDescriptorProto
|
18332 | * @instance
|
18333 | */
|
18334 | FieldDescriptorProto.prototype.extendee = "";
|
18335 |
|
18336 | /**
|
18337 | * FieldDescriptorProto defaultValue.
|
18338 | * @member {string} defaultValue
|
18339 | * @memberof google.protobuf.FieldDescriptorProto
|
18340 | * @instance
|
18341 | */
|
18342 | FieldDescriptorProto.prototype.defaultValue = "";
|
18343 |
|
18344 | /**
|
18345 | * FieldDescriptorProto oneofIndex.
|
18346 | * @member {number} oneofIndex
|
18347 | * @memberof google.protobuf.FieldDescriptorProto
|
18348 | * @instance
|
18349 | */
|
18350 | FieldDescriptorProto.prototype.oneofIndex = 0;
|
18351 |
|
18352 | /**
|
18353 | * FieldDescriptorProto jsonName.
|
18354 | * @member {string} jsonName
|
18355 | * @memberof google.protobuf.FieldDescriptorProto
|
18356 | * @instance
|
18357 | */
|
18358 | FieldDescriptorProto.prototype.jsonName = "";
|
18359 |
|
18360 | /**
|
18361 | * FieldDescriptorProto options.
|
18362 | * @member {google.protobuf.IFieldOptions|null|undefined} options
|
18363 | * @memberof google.protobuf.FieldDescriptorProto
|
18364 | * @instance
|
18365 | */
|
18366 | FieldDescriptorProto.prototype.options = null;
|
18367 |
|
18368 | /**
|
18369 | * FieldDescriptorProto proto3Optional.
|
18370 | * @member {boolean} proto3Optional
|
18371 | * @memberof google.protobuf.FieldDescriptorProto
|
18372 | * @instance
|
18373 | */
|
18374 | FieldDescriptorProto.prototype.proto3Optional = false;
|
18375 |
|
18376 | /**
|
18377 | * Creates a new FieldDescriptorProto instance using the specified properties.
|
18378 | * @function create
|
18379 | * @memberof google.protobuf.FieldDescriptorProto
|
18380 | * @static
|
18381 | * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set
|
18382 | * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance
|
18383 | */
|
18384 | FieldDescriptorProto.create = function create(properties) {
|
18385 | return new FieldDescriptorProto(properties);
|
18386 | };
|
18387 |
|
18388 | /**
|
18389 | * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages.
|
18390 | * @function encode
|
18391 | * @memberof google.protobuf.FieldDescriptorProto
|
18392 | * @static
|
18393 | * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode
|
18394 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
18395 | * @returns {$protobuf.Writer} Writer
|
18396 | */
|
18397 | FieldDescriptorProto.encode = function encode(message, writer) {
|
18398 | if (!writer)
|
18399 | writer = $Writer.create();
|
18400 | if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
18401 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
|
18402 | if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee"))
|
18403 | writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee);
|
18404 | if (message.number != null && Object.hasOwnProperty.call(message, "number"))
|
18405 | writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number);
|
18406 | if (message.label != null && Object.hasOwnProperty.call(message, "label"))
|
18407 | writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label);
|
18408 | if (message.type != null && Object.hasOwnProperty.call(message, "type"))
|
18409 | writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type);
|
18410 | if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName"))
|
18411 | writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName);
|
18412 | if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue"))
|
18413 | writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue);
|
18414 | if (message.options != null && Object.hasOwnProperty.call(message, "options"))
|
18415 | $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();
|
18416 | if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex"))
|
18417 | writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex);
|
18418 | if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName"))
|
18419 | writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName);
|
18420 | if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional"))
|
18421 | writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional);
|
18422 | return writer;
|
18423 | };
|
18424 |
|
18425 | /**
|
18426 | * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages.
|
18427 | * @function encodeDelimited
|
18428 | * @memberof google.protobuf.FieldDescriptorProto
|
18429 | * @static
|
18430 | * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode
|
18431 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
18432 | * @returns {$protobuf.Writer} Writer
|
18433 | */
|
18434 | FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) {
|
18435 | return this.encode(message, writer).ldelim();
|
18436 | };
|
18437 |
|
18438 | /**
|
18439 | * Decodes a FieldDescriptorProto message from the specified reader or buffer.
|
18440 | * @function decode
|
18441 | * @memberof google.protobuf.FieldDescriptorProto
|
18442 | * @static
|
18443 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
18444 | * @param {number} [length] Message length if known beforehand
|
18445 | * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto
|
18446 | * @throws {Error} If the payload is not a reader or valid buffer
|
18447 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
18448 | */
|
18449 | FieldDescriptorProto.decode = function decode(reader, length) {
|
18450 | if (!(reader instanceof $Reader))
|
18451 | reader = $Reader.create(reader);
|
18452 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto();
|
18453 | while (reader.pos < end) {
|
18454 | var tag = reader.uint32();
|
18455 | switch (tag >>> 3) {
|
18456 | case 1:
|
18457 | message.name = reader.string();
|
18458 | break;
|
18459 | case 3:
|
18460 | message.number = reader.int32();
|
18461 | break;
|
18462 | case 4:
|
18463 | message.label = reader.int32();
|
18464 | break;
|
18465 | case 5:
|
18466 | message.type = reader.int32();
|
18467 | break;
|
18468 | case 6:
|
18469 | message.typeName = reader.string();
|
18470 | break;
|
18471 | case 2:
|
18472 | message.extendee = reader.string();
|
18473 | break;
|
18474 | case 7:
|
18475 | message.defaultValue = reader.string();
|
18476 | break;
|
18477 | case 9:
|
18478 | message.oneofIndex = reader.int32();
|
18479 | break;
|
18480 | case 10:
|
18481 | message.jsonName = reader.string();
|
18482 | break;
|
18483 | case 8:
|
18484 | message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32());
|
18485 | break;
|
18486 | case 17:
|
18487 | message.proto3Optional = reader.bool();
|
18488 | break;
|
18489 | default:
|
18490 | reader.skipType(tag & 7);
|
18491 | break;
|
18492 | }
|
18493 | }
|
18494 | return message;
|
18495 | };
|
18496 |
|
18497 | /**
|
18498 | * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited.
|
18499 | * @function decodeDelimited
|
18500 | * @memberof google.protobuf.FieldDescriptorProto
|
18501 | * @static
|
18502 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
18503 | * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto
|
18504 | * @throws {Error} If the payload is not a reader or valid buffer
|
18505 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
18506 | */
|
18507 | FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) {
|
18508 | if (!(reader instanceof $Reader))
|
18509 | reader = new $Reader(reader);
|
18510 | return this.decode(reader, reader.uint32());
|
18511 | };
|
18512 |
|
18513 | /**
|
18514 | * Verifies a FieldDescriptorProto message.
|
18515 | * @function verify
|
18516 | * @memberof google.protobuf.FieldDescriptorProto
|
18517 | * @static
|
18518 | * @param {Object.<string,*>} message Plain object to verify
|
18519 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
18520 | */
|
18521 | FieldDescriptorProto.verify = function verify(message) {
|
18522 | if (typeof message !== "object" || message === null)
|
18523 | return "object expected";
|
18524 | if (message.name != null && message.hasOwnProperty("name"))
|
18525 | if (!$util.isString(message.name))
|
18526 | return "name: string expected";
|
18527 | if (message.number != null && message.hasOwnProperty("number"))
|
18528 | if (!$util.isInteger(message.number))
|
18529 | return "number: integer expected";
|
18530 | if (message.label != null && message.hasOwnProperty("label"))
|
18531 | switch (message.label) {
|
18532 | default:
|
18533 | return "label: enum value expected";
|
18534 | case 1:
|
18535 | case 2:
|
18536 | case 3:
|
18537 | break;
|
18538 | }
|
18539 | if (message.type != null && message.hasOwnProperty("type"))
|
18540 | switch (message.type) {
|
18541 | default:
|
18542 | return "type: enum value expected";
|
18543 | case 1:
|
18544 | case 2:
|
18545 | case 3:
|
18546 | case 4:
|
18547 | case 5:
|
18548 | case 6:
|
18549 | case 7:
|
18550 | case 8:
|
18551 | case 9:
|
18552 | case 10:
|
18553 | case 11:
|
18554 | case 12:
|
18555 | case 13:
|
18556 | case 14:
|
18557 | case 15:
|
18558 | case 16:
|
18559 | case 17:
|
18560 | case 18:
|
18561 | break;
|
18562 | }
|
18563 | if (message.typeName != null && message.hasOwnProperty("typeName"))
|
18564 | if (!$util.isString(message.typeName))
|
18565 | return "typeName: string expected";
|
18566 | if (message.extendee != null && message.hasOwnProperty("extendee"))
|
18567 | if (!$util.isString(message.extendee))
|
18568 | return "extendee: string expected";
|
18569 | if (message.defaultValue != null && message.hasOwnProperty("defaultValue"))
|
18570 | if (!$util.isString(message.defaultValue))
|
18571 | return "defaultValue: string expected";
|
18572 | if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex"))
|
18573 | if (!$util.isInteger(message.oneofIndex))
|
18574 | return "oneofIndex: integer expected";
|
18575 | if (message.jsonName != null && message.hasOwnProperty("jsonName"))
|
18576 | if (!$util.isString(message.jsonName))
|
18577 | return "jsonName: string expected";
|
18578 | if (message.options != null && message.hasOwnProperty("options")) {
|
18579 | var error = $root.google.protobuf.FieldOptions.verify(message.options);
|
18580 | if (error)
|
18581 | return "options." + error;
|
18582 | }
|
18583 | if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional"))
|
18584 | if (typeof message.proto3Optional !== "boolean")
|
18585 | return "proto3Optional: boolean expected";
|
18586 | return null;
|
18587 | };
|
18588 |
|
18589 | /**
|
18590 | * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types.
|
18591 | * @function fromObject
|
18592 | * @memberof google.protobuf.FieldDescriptorProto
|
18593 | * @static
|
18594 | * @param {Object.<string,*>} object Plain object
|
18595 | * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto
|
18596 | */
|
18597 | FieldDescriptorProto.fromObject = function fromObject(object) {
|
18598 | if (object instanceof $root.google.protobuf.FieldDescriptorProto)
|
18599 | return object;
|
18600 | var message = new $root.google.protobuf.FieldDescriptorProto();
|
18601 | if (object.name != null)
|
18602 | message.name = String(object.name);
|
18603 | if (object.number != null)
|
18604 | message.number = object.number | 0;
|
18605 | switch (object.label) {
|
18606 | case "LABEL_OPTIONAL":
|
18607 | case 1:
|
18608 | message.label = 1;
|
18609 | break;
|
18610 | case "LABEL_REQUIRED":
|
18611 | case 2:
|
18612 | message.label = 2;
|
18613 | break;
|
18614 | case "LABEL_REPEATED":
|
18615 | case 3:
|
18616 | message.label = 3;
|
18617 | break;
|
18618 | }
|
18619 | switch (object.type) {
|
18620 | case "TYPE_DOUBLE":
|
18621 | case 1:
|
18622 | message.type = 1;
|
18623 | break;
|
18624 | case "TYPE_FLOAT":
|
18625 | case 2:
|
18626 | message.type = 2;
|
18627 | break;
|
18628 | case "TYPE_INT64":
|
18629 | case 3:
|
18630 | message.type = 3;
|
18631 | break;
|
18632 | case "TYPE_UINT64":
|
18633 | case 4:
|
18634 | message.type = 4;
|
18635 | break;
|
18636 | case "TYPE_INT32":
|
18637 | case 5:
|
18638 | message.type = 5;
|
18639 | break;
|
18640 | case "TYPE_FIXED64":
|
18641 | case 6:
|
18642 | message.type = 6;
|
18643 | break;
|
18644 | case "TYPE_FIXED32":
|
18645 | case 7:
|
18646 | message.type = 7;
|
18647 | break;
|
18648 | case "TYPE_BOOL":
|
18649 | case 8:
|
18650 | message.type = 8;
|
18651 | break;
|
18652 | case "TYPE_STRING":
|
18653 | case 9:
|
18654 | message.type = 9;
|
18655 | break;
|
18656 | case "TYPE_GROUP":
|
18657 | case 10:
|
18658 | message.type = 10;
|
18659 | break;
|
18660 | case "TYPE_MESSAGE":
|
18661 | case 11:
|
18662 | message.type = 11;
|
18663 | break;
|
18664 | case "TYPE_BYTES":
|
18665 | case 12:
|
18666 | message.type = 12;
|
18667 | break;
|
18668 | case "TYPE_UINT32":
|
18669 | case 13:
|
18670 | message.type = 13;
|
18671 | break;
|
18672 | case "TYPE_ENUM":
|
18673 | case 14:
|
18674 | message.type = 14;
|
18675 | break;
|
18676 | case "TYPE_SFIXED32":
|
18677 | case 15:
|
18678 | message.type = 15;
|
18679 | break;
|
18680 | case "TYPE_SFIXED64":
|
18681 | case 16:
|
18682 | message.type = 16;
|
18683 | break;
|
18684 | case "TYPE_SINT32":
|
18685 | case 17:
|
18686 | message.type = 17;
|
18687 | break;
|
18688 | case "TYPE_SINT64":
|
18689 | case 18:
|
18690 | message.type = 18;
|
18691 | break;
|
18692 | }
|
18693 | if (object.typeName != null)
|
18694 | message.typeName = String(object.typeName);
|
18695 | if (object.extendee != null)
|
18696 | message.extendee = String(object.extendee);
|
18697 | if (object.defaultValue != null)
|
18698 | message.defaultValue = String(object.defaultValue);
|
18699 | if (object.oneofIndex != null)
|
18700 | message.oneofIndex = object.oneofIndex | 0;
|
18701 | if (object.jsonName != null)
|
18702 | message.jsonName = String(object.jsonName);
|
18703 | if (object.options != null) {
|
18704 | if (typeof object.options !== "object")
|
18705 | throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected");
|
18706 | message.options = $root.google.protobuf.FieldOptions.fromObject(object.options);
|
18707 | }
|
18708 | if (object.proto3Optional != null)
|
18709 | message.proto3Optional = Boolean(object.proto3Optional);
|
18710 | return message;
|
18711 | };
|
18712 |
|
18713 | /**
|
18714 | * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified.
|
18715 | * @function toObject
|
18716 | * @memberof google.protobuf.FieldDescriptorProto
|
18717 | * @static
|
18718 | * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto
|
18719 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
18720 | * @returns {Object.<string,*>} Plain object
|
18721 | */
|
18722 | FieldDescriptorProto.toObject = function toObject(message, options) {
|
18723 | if (!options)
|
18724 | options = {};
|
18725 | var object = {};
|
18726 | if (options.defaults) {
|
18727 | object.name = "";
|
18728 | object.extendee = "";
|
18729 | object.number = 0;
|
18730 | object.label = options.enums === String ? "LABEL_OPTIONAL" : 1;
|
18731 | object.type = options.enums === String ? "TYPE_DOUBLE" : 1;
|
18732 | object.typeName = "";
|
18733 | object.defaultValue = "";
|
18734 | object.options = null;
|
18735 | object.oneofIndex = 0;
|
18736 | object.jsonName = "";
|
18737 | object.proto3Optional = false;
|
18738 | }
|
18739 | if (message.name != null && message.hasOwnProperty("name"))
|
18740 | object.name = message.name;
|
18741 | if (message.extendee != null && message.hasOwnProperty("extendee"))
|
18742 | object.extendee = message.extendee;
|
18743 | if (message.number != null && message.hasOwnProperty("number"))
|
18744 | object.number = message.number;
|
18745 | if (message.label != null && message.hasOwnProperty("label"))
|
18746 | object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label;
|
18747 | if (message.type != null && message.hasOwnProperty("type"))
|
18748 | object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type;
|
18749 | if (message.typeName != null && message.hasOwnProperty("typeName"))
|
18750 | object.typeName = message.typeName;
|
18751 | if (message.defaultValue != null && message.hasOwnProperty("defaultValue"))
|
18752 | object.defaultValue = message.defaultValue;
|
18753 | if (message.options != null && message.hasOwnProperty("options"))
|
18754 | object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options);
|
18755 | if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex"))
|
18756 | object.oneofIndex = message.oneofIndex;
|
18757 | if (message.jsonName != null && message.hasOwnProperty("jsonName"))
|
18758 | object.jsonName = message.jsonName;
|
18759 | if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional"))
|
18760 | object.proto3Optional = message.proto3Optional;
|
18761 | return object;
|
18762 | };
|
18763 |
|
18764 | /**
|
18765 | * Converts this FieldDescriptorProto to JSON.
|
18766 | * @function toJSON
|
18767 | * @memberof google.protobuf.FieldDescriptorProto
|
18768 | * @instance
|
18769 | * @returns {Object.<string,*>} JSON object
|
18770 | */
|
18771 | FieldDescriptorProto.prototype.toJSON = function toJSON() {
|
18772 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
18773 | };
|
18774 |
|
18775 | /**
|
18776 | * Type enum.
|
18777 | * @name google.protobuf.FieldDescriptorProto.Type
|
18778 | * @enum {number}
|
18779 | * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value
|
18780 | * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value
|
18781 | * @property {number} TYPE_INT64=3 TYPE_INT64 value
|
18782 | * @property {number} TYPE_UINT64=4 TYPE_UINT64 value
|
18783 | * @property {number} TYPE_INT32=5 TYPE_INT32 value
|
18784 | * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value
|
18785 | * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value
|
18786 | * @property {number} TYPE_BOOL=8 TYPE_BOOL value
|
18787 | * @property {number} TYPE_STRING=9 TYPE_STRING value
|
18788 | * @property {number} TYPE_GROUP=10 TYPE_GROUP value
|
18789 | * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value
|
18790 | * @property {number} TYPE_BYTES=12 TYPE_BYTES value
|
18791 | * @property {number} TYPE_UINT32=13 TYPE_UINT32 value
|
18792 | * @property {number} TYPE_ENUM=14 TYPE_ENUM value
|
18793 | * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value
|
18794 | * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value
|
18795 | * @property {number} TYPE_SINT32=17 TYPE_SINT32 value
|
18796 | * @property {number} TYPE_SINT64=18 TYPE_SINT64 value
|
18797 | */
|
18798 | FieldDescriptorProto.Type = (function() {
|
18799 | var valuesById = {}, values = Object.create(valuesById);
|
18800 | values[valuesById[1] = "TYPE_DOUBLE"] = 1;
|
18801 | values[valuesById[2] = "TYPE_FLOAT"] = 2;
|
18802 | values[valuesById[3] = "TYPE_INT64"] = 3;
|
18803 | values[valuesById[4] = "TYPE_UINT64"] = 4;
|
18804 | values[valuesById[5] = "TYPE_INT32"] = 5;
|
18805 | values[valuesById[6] = "TYPE_FIXED64"] = 6;
|
18806 | values[valuesById[7] = "TYPE_FIXED32"] = 7;
|
18807 | values[valuesById[8] = "TYPE_BOOL"] = 8;
|
18808 | values[valuesById[9] = "TYPE_STRING"] = 9;
|
18809 | values[valuesById[10] = "TYPE_GROUP"] = 10;
|
18810 | values[valuesById[11] = "TYPE_MESSAGE"] = 11;
|
18811 | values[valuesById[12] = "TYPE_BYTES"] = 12;
|
18812 | values[valuesById[13] = "TYPE_UINT32"] = 13;
|
18813 | values[valuesById[14] = "TYPE_ENUM"] = 14;
|
18814 | values[valuesById[15] = "TYPE_SFIXED32"] = 15;
|
18815 | values[valuesById[16] = "TYPE_SFIXED64"] = 16;
|
18816 | values[valuesById[17] = "TYPE_SINT32"] = 17;
|
18817 | values[valuesById[18] = "TYPE_SINT64"] = 18;
|
18818 | return values;
|
18819 | })();
|
18820 |
|
18821 | /**
|
18822 | * Label enum.
|
18823 | * @name google.protobuf.FieldDescriptorProto.Label
|
18824 | * @enum {number}
|
18825 | * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value
|
18826 | * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value
|
18827 | * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value
|
18828 | */
|
18829 | FieldDescriptorProto.Label = (function() {
|
18830 | var valuesById = {}, values = Object.create(valuesById);
|
18831 | values[valuesById[1] = "LABEL_OPTIONAL"] = 1;
|
18832 | values[valuesById[2] = "LABEL_REQUIRED"] = 2;
|
18833 | values[valuesById[3] = "LABEL_REPEATED"] = 3;
|
18834 | return values;
|
18835 | })();
|
18836 |
|
18837 | return FieldDescriptorProto;
|
18838 | })();
|
18839 |
|
18840 | protobuf.OneofDescriptorProto = (function() {
|
18841 |
|
18842 | /**
|
18843 | * Properties of an OneofDescriptorProto.
|
18844 | * @memberof google.protobuf
|
18845 | * @interface IOneofDescriptorProto
|
18846 | * @property {string|null} [name] OneofDescriptorProto name
|
18847 | * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options
|
18848 | */
|
18849 |
|
18850 | /**
|
18851 | * Constructs a new OneofDescriptorProto.
|
18852 | * @memberof google.protobuf
|
18853 | * @classdesc Represents an OneofDescriptorProto.
|
18854 | * @implements IOneofDescriptorProto
|
18855 | * @constructor
|
18856 | * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set
|
18857 | */
|
18858 | function OneofDescriptorProto(properties) {
|
18859 | if (properties)
|
18860 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
18861 | if (properties[keys[i]] != null)
|
18862 | this[keys[i]] = properties[keys[i]];
|
18863 | }
|
18864 |
|
18865 | /**
|
18866 | * OneofDescriptorProto name.
|
18867 | * @member {string} name
|
18868 | * @memberof google.protobuf.OneofDescriptorProto
|
18869 | * @instance
|
18870 | */
|
18871 | OneofDescriptorProto.prototype.name = "";
|
18872 |
|
18873 | /**
|
18874 | * OneofDescriptorProto options.
|
18875 | * @member {google.protobuf.IOneofOptions|null|undefined} options
|
18876 | * @memberof google.protobuf.OneofDescriptorProto
|
18877 | * @instance
|
18878 | */
|
18879 | OneofDescriptorProto.prototype.options = null;
|
18880 |
|
18881 | /**
|
18882 | * Creates a new OneofDescriptorProto instance using the specified properties.
|
18883 | * @function create
|
18884 | * @memberof google.protobuf.OneofDescriptorProto
|
18885 | * @static
|
18886 | * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set
|
18887 | * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance
|
18888 | */
|
18889 | OneofDescriptorProto.create = function create(properties) {
|
18890 | return new OneofDescriptorProto(properties);
|
18891 | };
|
18892 |
|
18893 | /**
|
18894 | * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages.
|
18895 | * @function encode
|
18896 | * @memberof google.protobuf.OneofDescriptorProto
|
18897 | * @static
|
18898 | * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode
|
18899 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
18900 | * @returns {$protobuf.Writer} Writer
|
18901 | */
|
18902 | OneofDescriptorProto.encode = function encode(message, writer) {
|
18903 | if (!writer)
|
18904 | writer = $Writer.create();
|
18905 | if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
18906 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
|
18907 | if (message.options != null && Object.hasOwnProperty.call(message, "options"))
|
18908 | $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
18909 | return writer;
|
18910 | };
|
18911 |
|
18912 | /**
|
18913 | * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages.
|
18914 | * @function encodeDelimited
|
18915 | * @memberof google.protobuf.OneofDescriptorProto
|
18916 | * @static
|
18917 | * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode
|
18918 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
18919 | * @returns {$protobuf.Writer} Writer
|
18920 | */
|
18921 | OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) {
|
18922 | return this.encode(message, writer).ldelim();
|
18923 | };
|
18924 |
|
18925 | /**
|
18926 | * Decodes an OneofDescriptorProto message from the specified reader or buffer.
|
18927 | * @function decode
|
18928 | * @memberof google.protobuf.OneofDescriptorProto
|
18929 | * @static
|
18930 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
18931 | * @param {number} [length] Message length if known beforehand
|
18932 | * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto
|
18933 | * @throws {Error} If the payload is not a reader or valid buffer
|
18934 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
18935 | */
|
18936 | OneofDescriptorProto.decode = function decode(reader, length) {
|
18937 | if (!(reader instanceof $Reader))
|
18938 | reader = $Reader.create(reader);
|
18939 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto();
|
18940 | while (reader.pos < end) {
|
18941 | var tag = reader.uint32();
|
18942 | switch (tag >>> 3) {
|
18943 | case 1:
|
18944 | message.name = reader.string();
|
18945 | break;
|
18946 | case 2:
|
18947 | message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32());
|
18948 | break;
|
18949 | default:
|
18950 | reader.skipType(tag & 7);
|
18951 | break;
|
18952 | }
|
18953 | }
|
18954 | return message;
|
18955 | };
|
18956 |
|
18957 | /**
|
18958 | * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited.
|
18959 | * @function decodeDelimited
|
18960 | * @memberof google.protobuf.OneofDescriptorProto
|
18961 | * @static
|
18962 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
18963 | * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto
|
18964 | * @throws {Error} If the payload is not a reader or valid buffer
|
18965 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
18966 | */
|
18967 | OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) {
|
18968 | if (!(reader instanceof $Reader))
|
18969 | reader = new $Reader(reader);
|
18970 | return this.decode(reader, reader.uint32());
|
18971 | };
|
18972 |
|
18973 | /**
|
18974 | * Verifies an OneofDescriptorProto message.
|
18975 | * @function verify
|
18976 | * @memberof google.protobuf.OneofDescriptorProto
|
18977 | * @static
|
18978 | * @param {Object.<string,*>} message Plain object to verify
|
18979 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
18980 | */
|
18981 | OneofDescriptorProto.verify = function verify(message) {
|
18982 | if (typeof message !== "object" || message === null)
|
18983 | return "object expected";
|
18984 | if (message.name != null && message.hasOwnProperty("name"))
|
18985 | if (!$util.isString(message.name))
|
18986 | return "name: string expected";
|
18987 | if (message.options != null && message.hasOwnProperty("options")) {
|
18988 | var error = $root.google.protobuf.OneofOptions.verify(message.options);
|
18989 | if (error)
|
18990 | return "options." + error;
|
18991 | }
|
18992 | return null;
|
18993 | };
|
18994 |
|
18995 | /**
|
18996 | * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types.
|
18997 | * @function fromObject
|
18998 | * @memberof google.protobuf.OneofDescriptorProto
|
18999 | * @static
|
19000 | * @param {Object.<string,*>} object Plain object
|
19001 | * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto
|
19002 | */
|
19003 | OneofDescriptorProto.fromObject = function fromObject(object) {
|
19004 | if (object instanceof $root.google.protobuf.OneofDescriptorProto)
|
19005 | return object;
|
19006 | var message = new $root.google.protobuf.OneofDescriptorProto();
|
19007 | if (object.name != null)
|
19008 | message.name = String(object.name);
|
19009 | if (object.options != null) {
|
19010 | if (typeof object.options !== "object")
|
19011 | throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected");
|
19012 | message.options = $root.google.protobuf.OneofOptions.fromObject(object.options);
|
19013 | }
|
19014 | return message;
|
19015 | };
|
19016 |
|
19017 | /**
|
19018 | * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified.
|
19019 | * @function toObject
|
19020 | * @memberof google.protobuf.OneofDescriptorProto
|
19021 | * @static
|
19022 | * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto
|
19023 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
19024 | * @returns {Object.<string,*>} Plain object
|
19025 | */
|
19026 | OneofDescriptorProto.toObject = function toObject(message, options) {
|
19027 | if (!options)
|
19028 | options = {};
|
19029 | var object = {};
|
19030 | if (options.defaults) {
|
19031 | object.name = "";
|
19032 | object.options = null;
|
19033 | }
|
19034 | if (message.name != null && message.hasOwnProperty("name"))
|
19035 | object.name = message.name;
|
19036 | if (message.options != null && message.hasOwnProperty("options"))
|
19037 | object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options);
|
19038 | return object;
|
19039 | };
|
19040 |
|
19041 | /**
|
19042 | * Converts this OneofDescriptorProto to JSON.
|
19043 | * @function toJSON
|
19044 | * @memberof google.protobuf.OneofDescriptorProto
|
19045 | * @instance
|
19046 | * @returns {Object.<string,*>} JSON object
|
19047 | */
|
19048 | OneofDescriptorProto.prototype.toJSON = function toJSON() {
|
19049 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
19050 | };
|
19051 |
|
19052 | return OneofDescriptorProto;
|
19053 | })();
|
19054 |
|
19055 | protobuf.EnumDescriptorProto = (function() {
|
19056 |
|
19057 | /**
|
19058 | * Properties of an EnumDescriptorProto.
|
19059 | * @memberof google.protobuf
|
19060 | * @interface IEnumDescriptorProto
|
19061 | * @property {string|null} [name] EnumDescriptorProto name
|
19062 | * @property {Array.<google.protobuf.IEnumValueDescriptorProto>|null} [value] EnumDescriptorProto value
|
19063 | * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options
|
19064 | * @property {Array.<google.protobuf.EnumDescriptorProto.IEnumReservedRange>|null} [reservedRange] EnumDescriptorProto reservedRange
|
19065 | * @property {Array.<string>|null} [reservedName] EnumDescriptorProto reservedName
|
19066 | */
|
19067 |
|
19068 | /**
|
19069 | * Constructs a new EnumDescriptorProto.
|
19070 | * @memberof google.protobuf
|
19071 | * @classdesc Represents an EnumDescriptorProto.
|
19072 | * @implements IEnumDescriptorProto
|
19073 | * @constructor
|
19074 | * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set
|
19075 | */
|
19076 | function EnumDescriptorProto(properties) {
|
19077 | this.value = [];
|
19078 | this.reservedRange = [];
|
19079 | this.reservedName = [];
|
19080 | if (properties)
|
19081 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
19082 | if (properties[keys[i]] != null)
|
19083 | this[keys[i]] = properties[keys[i]];
|
19084 | }
|
19085 |
|
19086 | /**
|
19087 | * EnumDescriptorProto name.
|
19088 | * @member {string} name
|
19089 | * @memberof google.protobuf.EnumDescriptorProto
|
19090 | * @instance
|
19091 | */
|
19092 | EnumDescriptorProto.prototype.name = "";
|
19093 |
|
19094 | /**
|
19095 | * EnumDescriptorProto value.
|
19096 | * @member {Array.<google.protobuf.IEnumValueDescriptorProto>} value
|
19097 | * @memberof google.protobuf.EnumDescriptorProto
|
19098 | * @instance
|
19099 | */
|
19100 | EnumDescriptorProto.prototype.value = $util.emptyArray;
|
19101 |
|
19102 | /**
|
19103 | * EnumDescriptorProto options.
|
19104 | * @member {google.protobuf.IEnumOptions|null|undefined} options
|
19105 | * @memberof google.protobuf.EnumDescriptorProto
|
19106 | * @instance
|
19107 | */
|
19108 | EnumDescriptorProto.prototype.options = null;
|
19109 |
|
19110 | /**
|
19111 | * EnumDescriptorProto reservedRange.
|
19112 | * @member {Array.<google.protobuf.EnumDescriptorProto.IEnumReservedRange>} reservedRange
|
19113 | * @memberof google.protobuf.EnumDescriptorProto
|
19114 | * @instance
|
19115 | */
|
19116 | EnumDescriptorProto.prototype.reservedRange = $util.emptyArray;
|
19117 |
|
19118 | /**
|
19119 | * EnumDescriptorProto reservedName.
|
19120 | * @member {Array.<string>} reservedName
|
19121 | * @memberof google.protobuf.EnumDescriptorProto
|
19122 | * @instance
|
19123 | */
|
19124 | EnumDescriptorProto.prototype.reservedName = $util.emptyArray;
|
19125 |
|
19126 | /**
|
19127 | * Creates a new EnumDescriptorProto instance using the specified properties.
|
19128 | * @function create
|
19129 | * @memberof google.protobuf.EnumDescriptorProto
|
19130 | * @static
|
19131 | * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set
|
19132 | * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance
|
19133 | */
|
19134 | EnumDescriptorProto.create = function create(properties) {
|
19135 | return new EnumDescriptorProto(properties);
|
19136 | };
|
19137 |
|
19138 | /**
|
19139 | * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages.
|
19140 | * @function encode
|
19141 | * @memberof google.protobuf.EnumDescriptorProto
|
19142 | * @static
|
19143 | * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode
|
19144 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
19145 | * @returns {$protobuf.Writer} Writer
|
19146 | */
|
19147 | EnumDescriptorProto.encode = function encode(message, writer) {
|
19148 | if (!writer)
|
19149 | writer = $Writer.create();
|
19150 | if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
19151 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
|
19152 | if (message.value != null && message.value.length)
|
19153 | for (var i = 0; i < message.value.length; ++i)
|
19154 | $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
19155 | if (message.options != null && Object.hasOwnProperty.call(message, "options"))
|
19156 | $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
|
19157 | if (message.reservedRange != null && message.reservedRange.length)
|
19158 | for (var i = 0; i < message.reservedRange.length; ++i)
|
19159 | $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
|
19160 | if (message.reservedName != null && message.reservedName.length)
|
19161 | for (var i = 0; i < message.reservedName.length; ++i)
|
19162 | writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]);
|
19163 | return writer;
|
19164 | };
|
19165 |
|
19166 | /**
|
19167 | * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages.
|
19168 | * @function encodeDelimited
|
19169 | * @memberof google.protobuf.EnumDescriptorProto
|
19170 | * @static
|
19171 | * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode
|
19172 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
19173 | * @returns {$protobuf.Writer} Writer
|
19174 | */
|
19175 | EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) {
|
19176 | return this.encode(message, writer).ldelim();
|
19177 | };
|
19178 |
|
19179 | /**
|
19180 | * Decodes an EnumDescriptorProto message from the specified reader or buffer.
|
19181 | * @function decode
|
19182 | * @memberof google.protobuf.EnumDescriptorProto
|
19183 | * @static
|
19184 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
19185 | * @param {number} [length] Message length if known beforehand
|
19186 | * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto
|
19187 | * @throws {Error} If the payload is not a reader or valid buffer
|
19188 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
19189 | */
|
19190 | EnumDescriptorProto.decode = function decode(reader, length) {
|
19191 | if (!(reader instanceof $Reader))
|
19192 | reader = $Reader.create(reader);
|
19193 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto();
|
19194 | while (reader.pos < end) {
|
19195 | var tag = reader.uint32();
|
19196 | switch (tag >>> 3) {
|
19197 | case 1:
|
19198 | message.name = reader.string();
|
19199 | break;
|
19200 | case 2:
|
19201 | if (!(message.value && message.value.length))
|
19202 | message.value = [];
|
19203 | message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32()));
|
19204 | break;
|
19205 | case 3:
|
19206 | message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32());
|
19207 | break;
|
19208 | case 4:
|
19209 | if (!(message.reservedRange && message.reservedRange.length))
|
19210 | message.reservedRange = [];
|
19211 | message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32()));
|
19212 | break;
|
19213 | case 5:
|
19214 | if (!(message.reservedName && message.reservedName.length))
|
19215 | message.reservedName = [];
|
19216 | message.reservedName.push(reader.string());
|
19217 | break;
|
19218 | default:
|
19219 | reader.skipType(tag & 7);
|
19220 | break;
|
19221 | }
|
19222 | }
|
19223 | return message;
|
19224 | };
|
19225 |
|
19226 | /**
|
19227 | * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited.
|
19228 | * @function decodeDelimited
|
19229 | * @memberof google.protobuf.EnumDescriptorProto
|
19230 | * @static
|
19231 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
19232 | * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto
|
19233 | * @throws {Error} If the payload is not a reader or valid buffer
|
19234 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
19235 | */
|
19236 | EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) {
|
19237 | if (!(reader instanceof $Reader))
|
19238 | reader = new $Reader(reader);
|
19239 | return this.decode(reader, reader.uint32());
|
19240 | };
|
19241 |
|
19242 | /**
|
19243 | * Verifies an EnumDescriptorProto message.
|
19244 | * @function verify
|
19245 | * @memberof google.protobuf.EnumDescriptorProto
|
19246 | * @static
|
19247 | * @param {Object.<string,*>} message Plain object to verify
|
19248 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
19249 | */
|
19250 | EnumDescriptorProto.verify = function verify(message) {
|
19251 | if (typeof message !== "object" || message === null)
|
19252 | return "object expected";
|
19253 | if (message.name != null && message.hasOwnProperty("name"))
|
19254 | if (!$util.isString(message.name))
|
19255 | return "name: string expected";
|
19256 | if (message.value != null && message.hasOwnProperty("value")) {
|
19257 | if (!Array.isArray(message.value))
|
19258 | return "value: array expected";
|
19259 | for (var i = 0; i < message.value.length; ++i) {
|
19260 | var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]);
|
19261 | if (error)
|
19262 | return "value." + error;
|
19263 | }
|
19264 | }
|
19265 | if (message.options != null && message.hasOwnProperty("options")) {
|
19266 | var error = $root.google.protobuf.EnumOptions.verify(message.options);
|
19267 | if (error)
|
19268 | return "options." + error;
|
19269 | }
|
19270 | if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) {
|
19271 | if (!Array.isArray(message.reservedRange))
|
19272 | return "reservedRange: array expected";
|
19273 | for (var i = 0; i < message.reservedRange.length; ++i) {
|
19274 | var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]);
|
19275 | if (error)
|
19276 | return "reservedRange." + error;
|
19277 | }
|
19278 | }
|
19279 | if (message.reservedName != null && message.hasOwnProperty("reservedName")) {
|
19280 | if (!Array.isArray(message.reservedName))
|
19281 | return "reservedName: array expected";
|
19282 | for (var i = 0; i < message.reservedName.length; ++i)
|
19283 | if (!$util.isString(message.reservedName[i]))
|
19284 | return "reservedName: string[] expected";
|
19285 | }
|
19286 | return null;
|
19287 | };
|
19288 |
|
19289 | /**
|
19290 | * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types.
|
19291 | * @function fromObject
|
19292 | * @memberof google.protobuf.EnumDescriptorProto
|
19293 | * @static
|
19294 | * @param {Object.<string,*>} object Plain object
|
19295 | * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto
|
19296 | */
|
19297 | EnumDescriptorProto.fromObject = function fromObject(object) {
|
19298 | if (object instanceof $root.google.protobuf.EnumDescriptorProto)
|
19299 | return object;
|
19300 | var message = new $root.google.protobuf.EnumDescriptorProto();
|
19301 | if (object.name != null)
|
19302 | message.name = String(object.name);
|
19303 | if (object.value) {
|
19304 | if (!Array.isArray(object.value))
|
19305 | throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected");
|
19306 | message.value = [];
|
19307 | for (var i = 0; i < object.value.length; ++i) {
|
19308 | if (typeof object.value[i] !== "object")
|
19309 | throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected");
|
19310 | message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]);
|
19311 | }
|
19312 | }
|
19313 | if (object.options != null) {
|
19314 | if (typeof object.options !== "object")
|
19315 | throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected");
|
19316 | message.options = $root.google.protobuf.EnumOptions.fromObject(object.options);
|
19317 | }
|
19318 | if (object.reservedRange) {
|
19319 | if (!Array.isArray(object.reservedRange))
|
19320 | throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected");
|
19321 | message.reservedRange = [];
|
19322 | for (var i = 0; i < object.reservedRange.length; ++i) {
|
19323 | if (typeof object.reservedRange[i] !== "object")
|
19324 | throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected");
|
19325 | message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]);
|
19326 | }
|
19327 | }
|
19328 | if (object.reservedName) {
|
19329 | if (!Array.isArray(object.reservedName))
|
19330 | throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected");
|
19331 | message.reservedName = [];
|
19332 | for (var i = 0; i < object.reservedName.length; ++i)
|
19333 | message.reservedName[i] = String(object.reservedName[i]);
|
19334 | }
|
19335 | return message;
|
19336 | };
|
19337 |
|
19338 | /**
|
19339 | * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified.
|
19340 | * @function toObject
|
19341 | * @memberof google.protobuf.EnumDescriptorProto
|
19342 | * @static
|
19343 | * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto
|
19344 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
19345 | * @returns {Object.<string,*>} Plain object
|
19346 | */
|
19347 | EnumDescriptorProto.toObject = function toObject(message, options) {
|
19348 | if (!options)
|
19349 | options = {};
|
19350 | var object = {};
|
19351 | if (options.arrays || options.defaults) {
|
19352 | object.value = [];
|
19353 | object.reservedRange = [];
|
19354 | object.reservedName = [];
|
19355 | }
|
19356 | if (options.defaults) {
|
19357 | object.name = "";
|
19358 | object.options = null;
|
19359 | }
|
19360 | if (message.name != null && message.hasOwnProperty("name"))
|
19361 | object.name = message.name;
|
19362 | if (message.value && message.value.length) {
|
19363 | object.value = [];
|
19364 | for (var j = 0; j < message.value.length; ++j)
|
19365 | object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options);
|
19366 | }
|
19367 | if (message.options != null && message.hasOwnProperty("options"))
|
19368 | object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options);
|
19369 | if (message.reservedRange && message.reservedRange.length) {
|
19370 | object.reservedRange = [];
|
19371 | for (var j = 0; j < message.reservedRange.length; ++j)
|
19372 | object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options);
|
19373 | }
|
19374 | if (message.reservedName && message.reservedName.length) {
|
19375 | object.reservedName = [];
|
19376 | for (var j = 0; j < message.reservedName.length; ++j)
|
19377 | object.reservedName[j] = message.reservedName[j];
|
19378 | }
|
19379 | return object;
|
19380 | };
|
19381 |
|
19382 | /**
|
19383 | * Converts this EnumDescriptorProto to JSON.
|
19384 | * @function toJSON
|
19385 | * @memberof google.protobuf.EnumDescriptorProto
|
19386 | * @instance
|
19387 | * @returns {Object.<string,*>} JSON object
|
19388 | */
|
19389 | EnumDescriptorProto.prototype.toJSON = function toJSON() {
|
19390 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
19391 | };
|
19392 |
|
19393 | EnumDescriptorProto.EnumReservedRange = (function() {
|
19394 |
|
19395 | /**
|
19396 | * Properties of an EnumReservedRange.
|
19397 | * @memberof google.protobuf.EnumDescriptorProto
|
19398 | * @interface IEnumReservedRange
|
19399 | * @property {number|null} [start] EnumReservedRange start
|
19400 | * @property {number|null} [end] EnumReservedRange end
|
19401 | */
|
19402 |
|
19403 | /**
|
19404 | * Constructs a new EnumReservedRange.
|
19405 | * @memberof google.protobuf.EnumDescriptorProto
|
19406 | * @classdesc Represents an EnumReservedRange.
|
19407 | * @implements IEnumReservedRange
|
19408 | * @constructor
|
19409 | * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set
|
19410 | */
|
19411 | function EnumReservedRange(properties) {
|
19412 | if (properties)
|
19413 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
19414 | if (properties[keys[i]] != null)
|
19415 | this[keys[i]] = properties[keys[i]];
|
19416 | }
|
19417 |
|
19418 | /**
|
19419 | * EnumReservedRange start.
|
19420 | * @member {number} start
|
19421 | * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange
|
19422 | * @instance
|
19423 | */
|
19424 | EnumReservedRange.prototype.start = 0;
|
19425 |
|
19426 | /**
|
19427 | * EnumReservedRange end.
|
19428 | * @member {number} end
|
19429 | * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange
|
19430 | * @instance
|
19431 | */
|
19432 | EnumReservedRange.prototype.end = 0;
|
19433 |
|
19434 | /**
|
19435 | * Creates a new EnumReservedRange instance using the specified properties.
|
19436 | * @function create
|
19437 | * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange
|
19438 | * @static
|
19439 | * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set
|
19440 | * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance
|
19441 | */
|
19442 | EnumReservedRange.create = function create(properties) {
|
19443 | return new EnumReservedRange(properties);
|
19444 | };
|
19445 |
|
19446 | /**
|
19447 | * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages.
|
19448 | * @function encode
|
19449 | * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange
|
19450 | * @static
|
19451 | * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode
|
19452 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
19453 | * @returns {$protobuf.Writer} Writer
|
19454 | */
|
19455 | EnumReservedRange.encode = function encode(message, writer) {
|
19456 | if (!writer)
|
19457 | writer = $Writer.create();
|
19458 | if (message.start != null && Object.hasOwnProperty.call(message, "start"))
|
19459 | writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start);
|
19460 | if (message.end != null && Object.hasOwnProperty.call(message, "end"))
|
19461 | writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end);
|
19462 | return writer;
|
19463 | };
|
19464 |
|
19465 | /**
|
19466 | * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages.
|
19467 | * @function encodeDelimited
|
19468 | * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange
|
19469 | * @static
|
19470 | * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode
|
19471 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
19472 | * @returns {$protobuf.Writer} Writer
|
19473 | */
|
19474 | EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) {
|
19475 | return this.encode(message, writer).ldelim();
|
19476 | };
|
19477 |
|
19478 | /**
|
19479 | * Decodes an EnumReservedRange message from the specified reader or buffer.
|
19480 | * @function decode
|
19481 | * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange
|
19482 | * @static
|
19483 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
19484 | * @param {number} [length] Message length if known beforehand
|
19485 | * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange
|
19486 | * @throws {Error} If the payload is not a reader or valid buffer
|
19487 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
19488 | */
|
19489 | EnumReservedRange.decode = function decode(reader, length) {
|
19490 | if (!(reader instanceof $Reader))
|
19491 | reader = $Reader.create(reader);
|
19492 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange();
|
19493 | while (reader.pos < end) {
|
19494 | var tag = reader.uint32();
|
19495 | switch (tag >>> 3) {
|
19496 | case 1:
|
19497 | message.start = reader.int32();
|
19498 | break;
|
19499 | case 2:
|
19500 | message.end = reader.int32();
|
19501 | break;
|
19502 | default:
|
19503 | reader.skipType(tag & 7);
|
19504 | break;
|
19505 | }
|
19506 | }
|
19507 | return message;
|
19508 | };
|
19509 |
|
19510 | /**
|
19511 | * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited.
|
19512 | * @function decodeDelimited
|
19513 | * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange
|
19514 | * @static
|
19515 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
19516 | * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange
|
19517 | * @throws {Error} If the payload is not a reader or valid buffer
|
19518 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
19519 | */
|
19520 | EnumReservedRange.decodeDelimited = function decodeDelimited(reader) {
|
19521 | if (!(reader instanceof $Reader))
|
19522 | reader = new $Reader(reader);
|
19523 | return this.decode(reader, reader.uint32());
|
19524 | };
|
19525 |
|
19526 | /**
|
19527 | * Verifies an EnumReservedRange message.
|
19528 | * @function verify
|
19529 | * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange
|
19530 | * @static
|
19531 | * @param {Object.<string,*>} message Plain object to verify
|
19532 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
19533 | */
|
19534 | EnumReservedRange.verify = function verify(message) {
|
19535 | if (typeof message !== "object" || message === null)
|
19536 | return "object expected";
|
19537 | if (message.start != null && message.hasOwnProperty("start"))
|
19538 | if (!$util.isInteger(message.start))
|
19539 | return "start: integer expected";
|
19540 | if (message.end != null && message.hasOwnProperty("end"))
|
19541 | if (!$util.isInteger(message.end))
|
19542 | return "end: integer expected";
|
19543 | return null;
|
19544 | };
|
19545 |
|
19546 | /**
|
19547 | * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types.
|
19548 | * @function fromObject
|
19549 | * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange
|
19550 | * @static
|
19551 | * @param {Object.<string,*>} object Plain object
|
19552 | * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange
|
19553 | */
|
19554 | EnumReservedRange.fromObject = function fromObject(object) {
|
19555 | if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange)
|
19556 | return object;
|
19557 | var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange();
|
19558 | if (object.start != null)
|
19559 | message.start = object.start | 0;
|
19560 | if (object.end != null)
|
19561 | message.end = object.end | 0;
|
19562 | return message;
|
19563 | };
|
19564 |
|
19565 | /**
|
19566 | * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified.
|
19567 | * @function toObject
|
19568 | * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange
|
19569 | * @static
|
19570 | * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange
|
19571 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
19572 | * @returns {Object.<string,*>} Plain object
|
19573 | */
|
19574 | EnumReservedRange.toObject = function toObject(message, options) {
|
19575 | if (!options)
|
19576 | options = {};
|
19577 | var object = {};
|
19578 | if (options.defaults) {
|
19579 | object.start = 0;
|
19580 | object.end = 0;
|
19581 | }
|
19582 | if (message.start != null && message.hasOwnProperty("start"))
|
19583 | object.start = message.start;
|
19584 | if (message.end != null && message.hasOwnProperty("end"))
|
19585 | object.end = message.end;
|
19586 | return object;
|
19587 | };
|
19588 |
|
19589 | /**
|
19590 | * Converts this EnumReservedRange to JSON.
|
19591 | * @function toJSON
|
19592 | * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange
|
19593 | * @instance
|
19594 | * @returns {Object.<string,*>} JSON object
|
19595 | */
|
19596 | EnumReservedRange.prototype.toJSON = function toJSON() {
|
19597 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
19598 | };
|
19599 |
|
19600 | return EnumReservedRange;
|
19601 | })();
|
19602 |
|
19603 | return EnumDescriptorProto;
|
19604 | })();
|
19605 |
|
19606 | protobuf.EnumValueDescriptorProto = (function() {
|
19607 |
|
19608 | /**
|
19609 | * Properties of an EnumValueDescriptorProto.
|
19610 | * @memberof google.protobuf
|
19611 | * @interface IEnumValueDescriptorProto
|
19612 | * @property {string|null} [name] EnumValueDescriptorProto name
|
19613 | * @property {number|null} [number] EnumValueDescriptorProto number
|
19614 | * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options
|
19615 | */
|
19616 |
|
19617 | /**
|
19618 | * Constructs a new EnumValueDescriptorProto.
|
19619 | * @memberof google.protobuf
|
19620 | * @classdesc Represents an EnumValueDescriptorProto.
|
19621 | * @implements IEnumValueDescriptorProto
|
19622 | * @constructor
|
19623 | * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set
|
19624 | */
|
19625 | function EnumValueDescriptorProto(properties) {
|
19626 | if (properties)
|
19627 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
19628 | if (properties[keys[i]] != null)
|
19629 | this[keys[i]] = properties[keys[i]];
|
19630 | }
|
19631 |
|
19632 | /**
|
19633 | * EnumValueDescriptorProto name.
|
19634 | * @member {string} name
|
19635 | * @memberof google.protobuf.EnumValueDescriptorProto
|
19636 | * @instance
|
19637 | */
|
19638 | EnumValueDescriptorProto.prototype.name = "";
|
19639 |
|
19640 | /**
|
19641 | * EnumValueDescriptorProto number.
|
19642 | * @member {number} number
|
19643 | * @memberof google.protobuf.EnumValueDescriptorProto
|
19644 | * @instance
|
19645 | */
|
19646 | EnumValueDescriptorProto.prototype.number = 0;
|
19647 |
|
19648 | /**
|
19649 | * EnumValueDescriptorProto options.
|
19650 | * @member {google.protobuf.IEnumValueOptions|null|undefined} options
|
19651 | * @memberof google.protobuf.EnumValueDescriptorProto
|
19652 | * @instance
|
19653 | */
|
19654 | EnumValueDescriptorProto.prototype.options = null;
|
19655 |
|
19656 | /**
|
19657 | * Creates a new EnumValueDescriptorProto instance using the specified properties.
|
19658 | * @function create
|
19659 | * @memberof google.protobuf.EnumValueDescriptorProto
|
19660 | * @static
|
19661 | * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set
|
19662 | * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance
|
19663 | */
|
19664 | EnumValueDescriptorProto.create = function create(properties) {
|
19665 | return new EnumValueDescriptorProto(properties);
|
19666 | };
|
19667 |
|
19668 | /**
|
19669 | * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages.
|
19670 | * @function encode
|
19671 | * @memberof google.protobuf.EnumValueDescriptorProto
|
19672 | * @static
|
19673 | * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode
|
19674 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
19675 | * @returns {$protobuf.Writer} Writer
|
19676 | */
|
19677 | EnumValueDescriptorProto.encode = function encode(message, writer) {
|
19678 | if (!writer)
|
19679 | writer = $Writer.create();
|
19680 | if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
19681 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
|
19682 | if (message.number != null && Object.hasOwnProperty.call(message, "number"))
|
19683 | writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number);
|
19684 | if (message.options != null && Object.hasOwnProperty.call(message, "options"))
|
19685 | $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
|
19686 | return writer;
|
19687 | };
|
19688 |
|
19689 | /**
|
19690 | * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages.
|
19691 | * @function encodeDelimited
|
19692 | * @memberof google.protobuf.EnumValueDescriptorProto
|
19693 | * @static
|
19694 | * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode
|
19695 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
19696 | * @returns {$protobuf.Writer} Writer
|
19697 | */
|
19698 | EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) {
|
19699 | return this.encode(message, writer).ldelim();
|
19700 | };
|
19701 |
|
19702 | /**
|
19703 | * Decodes an EnumValueDescriptorProto message from the specified reader or buffer.
|
19704 | * @function decode
|
19705 | * @memberof google.protobuf.EnumValueDescriptorProto
|
19706 | * @static
|
19707 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
19708 | * @param {number} [length] Message length if known beforehand
|
19709 | * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto
|
19710 | * @throws {Error} If the payload is not a reader or valid buffer
|
19711 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
19712 | */
|
19713 | EnumValueDescriptorProto.decode = function decode(reader, length) {
|
19714 | if (!(reader instanceof $Reader))
|
19715 | reader = $Reader.create(reader);
|
19716 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto();
|
19717 | while (reader.pos < end) {
|
19718 | var tag = reader.uint32();
|
19719 | switch (tag >>> 3) {
|
19720 | case 1:
|
19721 | message.name = reader.string();
|
19722 | break;
|
19723 | case 2:
|
19724 | message.number = reader.int32();
|
19725 | break;
|
19726 | case 3:
|
19727 | message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32());
|
19728 | break;
|
19729 | default:
|
19730 | reader.skipType(tag & 7);
|
19731 | break;
|
19732 | }
|
19733 | }
|
19734 | return message;
|
19735 | };
|
19736 |
|
19737 | /**
|
19738 | * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited.
|
19739 | * @function decodeDelimited
|
19740 | * @memberof google.protobuf.EnumValueDescriptorProto
|
19741 | * @static
|
19742 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
19743 | * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto
|
19744 | * @throws {Error} If the payload is not a reader or valid buffer
|
19745 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
19746 | */
|
19747 | EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) {
|
19748 | if (!(reader instanceof $Reader))
|
19749 | reader = new $Reader(reader);
|
19750 | return this.decode(reader, reader.uint32());
|
19751 | };
|
19752 |
|
19753 | /**
|
19754 | * Verifies an EnumValueDescriptorProto message.
|
19755 | * @function verify
|
19756 | * @memberof google.protobuf.EnumValueDescriptorProto
|
19757 | * @static
|
19758 | * @param {Object.<string,*>} message Plain object to verify
|
19759 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
19760 | */
|
19761 | EnumValueDescriptorProto.verify = function verify(message) {
|
19762 | if (typeof message !== "object" || message === null)
|
19763 | return "object expected";
|
19764 | if (message.name != null && message.hasOwnProperty("name"))
|
19765 | if (!$util.isString(message.name))
|
19766 | return "name: string expected";
|
19767 | if (message.number != null && message.hasOwnProperty("number"))
|
19768 | if (!$util.isInteger(message.number))
|
19769 | return "number: integer expected";
|
19770 | if (message.options != null && message.hasOwnProperty("options")) {
|
19771 | var error = $root.google.protobuf.EnumValueOptions.verify(message.options);
|
19772 | if (error)
|
19773 | return "options." + error;
|
19774 | }
|
19775 | return null;
|
19776 | };
|
19777 |
|
19778 | /**
|
19779 | * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types.
|
19780 | * @function fromObject
|
19781 | * @memberof google.protobuf.EnumValueDescriptorProto
|
19782 | * @static
|
19783 | * @param {Object.<string,*>} object Plain object
|
19784 | * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto
|
19785 | */
|
19786 | EnumValueDescriptorProto.fromObject = function fromObject(object) {
|
19787 | if (object instanceof $root.google.protobuf.EnumValueDescriptorProto)
|
19788 | return object;
|
19789 | var message = new $root.google.protobuf.EnumValueDescriptorProto();
|
19790 | if (object.name != null)
|
19791 | message.name = String(object.name);
|
19792 | if (object.number != null)
|
19793 | message.number = object.number | 0;
|
19794 | if (object.options != null) {
|
19795 | if (typeof object.options !== "object")
|
19796 | throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected");
|
19797 | message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options);
|
19798 | }
|
19799 | return message;
|
19800 | };
|
19801 |
|
19802 | /**
|
19803 | * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified.
|
19804 | * @function toObject
|
19805 | * @memberof google.protobuf.EnumValueDescriptorProto
|
19806 | * @static
|
19807 | * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto
|
19808 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
19809 | * @returns {Object.<string,*>} Plain object
|
19810 | */
|
19811 | EnumValueDescriptorProto.toObject = function toObject(message, options) {
|
19812 | if (!options)
|
19813 | options = {};
|
19814 | var object = {};
|
19815 | if (options.defaults) {
|
19816 | object.name = "";
|
19817 | object.number = 0;
|
19818 | object.options = null;
|
19819 | }
|
19820 | if (message.name != null && message.hasOwnProperty("name"))
|
19821 | object.name = message.name;
|
19822 | if (message.number != null && message.hasOwnProperty("number"))
|
19823 | object.number = message.number;
|
19824 | if (message.options != null && message.hasOwnProperty("options"))
|
19825 | object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options);
|
19826 | return object;
|
19827 | };
|
19828 |
|
19829 | /**
|
19830 | * Converts this EnumValueDescriptorProto to JSON.
|
19831 | * @function toJSON
|
19832 | * @memberof google.protobuf.EnumValueDescriptorProto
|
19833 | * @instance
|
19834 | * @returns {Object.<string,*>} JSON object
|
19835 | */
|
19836 | EnumValueDescriptorProto.prototype.toJSON = function toJSON() {
|
19837 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
19838 | };
|
19839 |
|
19840 | return EnumValueDescriptorProto;
|
19841 | })();
|
19842 |
|
19843 | protobuf.ServiceDescriptorProto = (function() {
|
19844 |
|
19845 | /**
|
19846 | * Properties of a ServiceDescriptorProto.
|
19847 | * @memberof google.protobuf
|
19848 | * @interface IServiceDescriptorProto
|
19849 | * @property {string|null} [name] ServiceDescriptorProto name
|
19850 | * @property {Array.<google.protobuf.IMethodDescriptorProto>|null} [method] ServiceDescriptorProto method
|
19851 | * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options
|
19852 | */
|
19853 |
|
19854 | /**
|
19855 | * Constructs a new ServiceDescriptorProto.
|
19856 | * @memberof google.protobuf
|
19857 | * @classdesc Represents a ServiceDescriptorProto.
|
19858 | * @implements IServiceDescriptorProto
|
19859 | * @constructor
|
19860 | * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set
|
19861 | */
|
19862 | function ServiceDescriptorProto(properties) {
|
19863 | this.method = [];
|
19864 | if (properties)
|
19865 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
19866 | if (properties[keys[i]] != null)
|
19867 | this[keys[i]] = properties[keys[i]];
|
19868 | }
|
19869 |
|
19870 | /**
|
19871 | * ServiceDescriptorProto name.
|
19872 | * @member {string} name
|
19873 | * @memberof google.protobuf.ServiceDescriptorProto
|
19874 | * @instance
|
19875 | */
|
19876 | ServiceDescriptorProto.prototype.name = "";
|
19877 |
|
19878 | /**
|
19879 | * ServiceDescriptorProto method.
|
19880 | * @member {Array.<google.protobuf.IMethodDescriptorProto>} method
|
19881 | * @memberof google.protobuf.ServiceDescriptorProto
|
19882 | * @instance
|
19883 | */
|
19884 | ServiceDescriptorProto.prototype.method = $util.emptyArray;
|
19885 |
|
19886 | /**
|
19887 | * ServiceDescriptorProto options.
|
19888 | * @member {google.protobuf.IServiceOptions|null|undefined} options
|
19889 | * @memberof google.protobuf.ServiceDescriptorProto
|
19890 | * @instance
|
19891 | */
|
19892 | ServiceDescriptorProto.prototype.options = null;
|
19893 |
|
19894 | /**
|
19895 | * Creates a new ServiceDescriptorProto instance using the specified properties.
|
19896 | * @function create
|
19897 | * @memberof google.protobuf.ServiceDescriptorProto
|
19898 | * @static
|
19899 | * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set
|
19900 | * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance
|
19901 | */
|
19902 | ServiceDescriptorProto.create = function create(properties) {
|
19903 | return new ServiceDescriptorProto(properties);
|
19904 | };
|
19905 |
|
19906 | /**
|
19907 | * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages.
|
19908 | * @function encode
|
19909 | * @memberof google.protobuf.ServiceDescriptorProto
|
19910 | * @static
|
19911 | * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode
|
19912 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
19913 | * @returns {$protobuf.Writer} Writer
|
19914 | */
|
19915 | ServiceDescriptorProto.encode = function encode(message, writer) {
|
19916 | if (!writer)
|
19917 | writer = $Writer.create();
|
19918 | if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
19919 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
|
19920 | if (message.method != null && message.method.length)
|
19921 | for (var i = 0; i < message.method.length; ++i)
|
19922 | $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
19923 | if (message.options != null && Object.hasOwnProperty.call(message, "options"))
|
19924 | $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
|
19925 | return writer;
|
19926 | };
|
19927 |
|
19928 | /**
|
19929 | * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages.
|
19930 | * @function encodeDelimited
|
19931 | * @memberof google.protobuf.ServiceDescriptorProto
|
19932 | * @static
|
19933 | * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode
|
19934 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
19935 | * @returns {$protobuf.Writer} Writer
|
19936 | */
|
19937 | ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) {
|
19938 | return this.encode(message, writer).ldelim();
|
19939 | };
|
19940 |
|
19941 | /**
|
19942 | * Decodes a ServiceDescriptorProto message from the specified reader or buffer.
|
19943 | * @function decode
|
19944 | * @memberof google.protobuf.ServiceDescriptorProto
|
19945 | * @static
|
19946 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
19947 | * @param {number} [length] Message length if known beforehand
|
19948 | * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto
|
19949 | * @throws {Error} If the payload is not a reader or valid buffer
|
19950 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
19951 | */
|
19952 | ServiceDescriptorProto.decode = function decode(reader, length) {
|
19953 | if (!(reader instanceof $Reader))
|
19954 | reader = $Reader.create(reader);
|
19955 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto();
|
19956 | while (reader.pos < end) {
|
19957 | var tag = reader.uint32();
|
19958 | switch (tag >>> 3) {
|
19959 | case 1:
|
19960 | message.name = reader.string();
|
19961 | break;
|
19962 | case 2:
|
19963 | if (!(message.method && message.method.length))
|
19964 | message.method = [];
|
19965 | message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32()));
|
19966 | break;
|
19967 | case 3:
|
19968 | message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32());
|
19969 | break;
|
19970 | default:
|
19971 | reader.skipType(tag & 7);
|
19972 | break;
|
19973 | }
|
19974 | }
|
19975 | return message;
|
19976 | };
|
19977 |
|
19978 | /**
|
19979 | * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited.
|
19980 | * @function decodeDelimited
|
19981 | * @memberof google.protobuf.ServiceDescriptorProto
|
19982 | * @static
|
19983 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
19984 | * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto
|
19985 | * @throws {Error} If the payload is not a reader or valid buffer
|
19986 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
19987 | */
|
19988 | ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) {
|
19989 | if (!(reader instanceof $Reader))
|
19990 | reader = new $Reader(reader);
|
19991 | return this.decode(reader, reader.uint32());
|
19992 | };
|
19993 |
|
19994 | /**
|
19995 | * Verifies a ServiceDescriptorProto message.
|
19996 | * @function verify
|
19997 | * @memberof google.protobuf.ServiceDescriptorProto
|
19998 | * @static
|
19999 | * @param {Object.<string,*>} message Plain object to verify
|
20000 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
20001 | */
|
20002 | ServiceDescriptorProto.verify = function verify(message) {
|
20003 | if (typeof message !== "object" || message === null)
|
20004 | return "object expected";
|
20005 | if (message.name != null && message.hasOwnProperty("name"))
|
20006 | if (!$util.isString(message.name))
|
20007 | return "name: string expected";
|
20008 | if (message.method != null && message.hasOwnProperty("method")) {
|
20009 | if (!Array.isArray(message.method))
|
20010 | return "method: array expected";
|
20011 | for (var i = 0; i < message.method.length; ++i) {
|
20012 | var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]);
|
20013 | if (error)
|
20014 | return "method." + error;
|
20015 | }
|
20016 | }
|
20017 | if (message.options != null && message.hasOwnProperty("options")) {
|
20018 | var error = $root.google.protobuf.ServiceOptions.verify(message.options);
|
20019 | if (error)
|
20020 | return "options." + error;
|
20021 | }
|
20022 | return null;
|
20023 | };
|
20024 |
|
20025 | /**
|
20026 | * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types.
|
20027 | * @function fromObject
|
20028 | * @memberof google.protobuf.ServiceDescriptorProto
|
20029 | * @static
|
20030 | * @param {Object.<string,*>} object Plain object
|
20031 | * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto
|
20032 | */
|
20033 | ServiceDescriptorProto.fromObject = function fromObject(object) {
|
20034 | if (object instanceof $root.google.protobuf.ServiceDescriptorProto)
|
20035 | return object;
|
20036 | var message = new $root.google.protobuf.ServiceDescriptorProto();
|
20037 | if (object.name != null)
|
20038 | message.name = String(object.name);
|
20039 | if (object.method) {
|
20040 | if (!Array.isArray(object.method))
|
20041 | throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected");
|
20042 | message.method = [];
|
20043 | for (var i = 0; i < object.method.length; ++i) {
|
20044 | if (typeof object.method[i] !== "object")
|
20045 | throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected");
|
20046 | message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]);
|
20047 | }
|
20048 | }
|
20049 | if (object.options != null) {
|
20050 | if (typeof object.options !== "object")
|
20051 | throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected");
|
20052 | message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options);
|
20053 | }
|
20054 | return message;
|
20055 | };
|
20056 |
|
20057 | /**
|
20058 | * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified.
|
20059 | * @function toObject
|
20060 | * @memberof google.protobuf.ServiceDescriptorProto
|
20061 | * @static
|
20062 | * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto
|
20063 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
20064 | * @returns {Object.<string,*>} Plain object
|
20065 | */
|
20066 | ServiceDescriptorProto.toObject = function toObject(message, options) {
|
20067 | if (!options)
|
20068 | options = {};
|
20069 | var object = {};
|
20070 | if (options.arrays || options.defaults)
|
20071 | object.method = [];
|
20072 | if (options.defaults) {
|
20073 | object.name = "";
|
20074 | object.options = null;
|
20075 | }
|
20076 | if (message.name != null && message.hasOwnProperty("name"))
|
20077 | object.name = message.name;
|
20078 | if (message.method && message.method.length) {
|
20079 | object.method = [];
|
20080 | for (var j = 0; j < message.method.length; ++j)
|
20081 | object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options);
|
20082 | }
|
20083 | if (message.options != null && message.hasOwnProperty("options"))
|
20084 | object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options);
|
20085 | return object;
|
20086 | };
|
20087 |
|
20088 | /**
|
20089 | * Converts this ServiceDescriptorProto to JSON.
|
20090 | * @function toJSON
|
20091 | * @memberof google.protobuf.ServiceDescriptorProto
|
20092 | * @instance
|
20093 | * @returns {Object.<string,*>} JSON object
|
20094 | */
|
20095 | ServiceDescriptorProto.prototype.toJSON = function toJSON() {
|
20096 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
20097 | };
|
20098 |
|
20099 | return ServiceDescriptorProto;
|
20100 | })();
|
20101 |
|
20102 | protobuf.MethodDescriptorProto = (function() {
|
20103 |
|
20104 | /**
|
20105 | * Properties of a MethodDescriptorProto.
|
20106 | * @memberof google.protobuf
|
20107 | * @interface IMethodDescriptorProto
|
20108 | * @property {string|null} [name] MethodDescriptorProto name
|
20109 | * @property {string|null} [inputType] MethodDescriptorProto inputType
|
20110 | * @property {string|null} [outputType] MethodDescriptorProto outputType
|
20111 | * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options
|
20112 | * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming
|
20113 | * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming
|
20114 | */
|
20115 |
|
20116 | /**
|
20117 | * Constructs a new MethodDescriptorProto.
|
20118 | * @memberof google.protobuf
|
20119 | * @classdesc Represents a MethodDescriptorProto.
|
20120 | * @implements IMethodDescriptorProto
|
20121 | * @constructor
|
20122 | * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set
|
20123 | */
|
20124 | function MethodDescriptorProto(properties) {
|
20125 | if (properties)
|
20126 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
20127 | if (properties[keys[i]] != null)
|
20128 | this[keys[i]] = properties[keys[i]];
|
20129 | }
|
20130 |
|
20131 | /**
|
20132 | * MethodDescriptorProto name.
|
20133 | * @member {string} name
|
20134 | * @memberof google.protobuf.MethodDescriptorProto
|
20135 | * @instance
|
20136 | */
|
20137 | MethodDescriptorProto.prototype.name = "";
|
20138 |
|
20139 | /**
|
20140 | * MethodDescriptorProto inputType.
|
20141 | * @member {string} inputType
|
20142 | * @memberof google.protobuf.MethodDescriptorProto
|
20143 | * @instance
|
20144 | */
|
20145 | MethodDescriptorProto.prototype.inputType = "";
|
20146 |
|
20147 | /**
|
20148 | * MethodDescriptorProto outputType.
|
20149 | * @member {string} outputType
|
20150 | * @memberof google.protobuf.MethodDescriptorProto
|
20151 | * @instance
|
20152 | */
|
20153 | MethodDescriptorProto.prototype.outputType = "";
|
20154 |
|
20155 | /**
|
20156 | * MethodDescriptorProto options.
|
20157 | * @member {google.protobuf.IMethodOptions|null|undefined} options
|
20158 | * @memberof google.protobuf.MethodDescriptorProto
|
20159 | * @instance
|
20160 | */
|
20161 | MethodDescriptorProto.prototype.options = null;
|
20162 |
|
20163 | /**
|
20164 | * MethodDescriptorProto clientStreaming.
|
20165 | * @member {boolean} clientStreaming
|
20166 | * @memberof google.protobuf.MethodDescriptorProto
|
20167 | * @instance
|
20168 | */
|
20169 | MethodDescriptorProto.prototype.clientStreaming = false;
|
20170 |
|
20171 | /**
|
20172 | * MethodDescriptorProto serverStreaming.
|
20173 | * @member {boolean} serverStreaming
|
20174 | * @memberof google.protobuf.MethodDescriptorProto
|
20175 | * @instance
|
20176 | */
|
20177 | MethodDescriptorProto.prototype.serverStreaming = false;
|
20178 |
|
20179 | /**
|
20180 | * Creates a new MethodDescriptorProto instance using the specified properties.
|
20181 | * @function create
|
20182 | * @memberof google.protobuf.MethodDescriptorProto
|
20183 | * @static
|
20184 | * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set
|
20185 | * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance
|
20186 | */
|
20187 | MethodDescriptorProto.create = function create(properties) {
|
20188 | return new MethodDescriptorProto(properties);
|
20189 | };
|
20190 |
|
20191 | /**
|
20192 | * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages.
|
20193 | * @function encode
|
20194 | * @memberof google.protobuf.MethodDescriptorProto
|
20195 | * @static
|
20196 | * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode
|
20197 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
20198 | * @returns {$protobuf.Writer} Writer
|
20199 | */
|
20200 | MethodDescriptorProto.encode = function encode(message, writer) {
|
20201 | if (!writer)
|
20202 | writer = $Writer.create();
|
20203 | if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
20204 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
|
20205 | if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType"))
|
20206 | writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType);
|
20207 | if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType"))
|
20208 | writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType);
|
20209 | if (message.options != null && Object.hasOwnProperty.call(message, "options"))
|
20210 | $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
|
20211 | if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming"))
|
20212 | writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming);
|
20213 | if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming"))
|
20214 | writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming);
|
20215 | return writer;
|
20216 | };
|
20217 |
|
20218 | /**
|
20219 | * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages.
|
20220 | * @function encodeDelimited
|
20221 | * @memberof google.protobuf.MethodDescriptorProto
|
20222 | * @static
|
20223 | * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode
|
20224 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
20225 | * @returns {$protobuf.Writer} Writer
|
20226 | */
|
20227 | MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) {
|
20228 | return this.encode(message, writer).ldelim();
|
20229 | };
|
20230 |
|
20231 | /**
|
20232 | * Decodes a MethodDescriptorProto message from the specified reader or buffer.
|
20233 | * @function decode
|
20234 | * @memberof google.protobuf.MethodDescriptorProto
|
20235 | * @static
|
20236 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
20237 | * @param {number} [length] Message length if known beforehand
|
20238 | * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto
|
20239 | * @throws {Error} If the payload is not a reader or valid buffer
|
20240 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
20241 | */
|
20242 | MethodDescriptorProto.decode = function decode(reader, length) {
|
20243 | if (!(reader instanceof $Reader))
|
20244 | reader = $Reader.create(reader);
|
20245 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto();
|
20246 | while (reader.pos < end) {
|
20247 | var tag = reader.uint32();
|
20248 | switch (tag >>> 3) {
|
20249 | case 1:
|
20250 | message.name = reader.string();
|
20251 | break;
|
20252 | case 2:
|
20253 | message.inputType = reader.string();
|
20254 | break;
|
20255 | case 3:
|
20256 | message.outputType = reader.string();
|
20257 | break;
|
20258 | case 4:
|
20259 | message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32());
|
20260 | break;
|
20261 | case 5:
|
20262 | message.clientStreaming = reader.bool();
|
20263 | break;
|
20264 | case 6:
|
20265 | message.serverStreaming = reader.bool();
|
20266 | break;
|
20267 | default:
|
20268 | reader.skipType(tag & 7);
|
20269 | break;
|
20270 | }
|
20271 | }
|
20272 | return message;
|
20273 | };
|
20274 |
|
20275 | /**
|
20276 | * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited.
|
20277 | * @function decodeDelimited
|
20278 | * @memberof google.protobuf.MethodDescriptorProto
|
20279 | * @static
|
20280 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
20281 | * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto
|
20282 | * @throws {Error} If the payload is not a reader or valid buffer
|
20283 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
20284 | */
|
20285 | MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) {
|
20286 | if (!(reader instanceof $Reader))
|
20287 | reader = new $Reader(reader);
|
20288 | return this.decode(reader, reader.uint32());
|
20289 | };
|
20290 |
|
20291 | /**
|
20292 | * Verifies a MethodDescriptorProto message.
|
20293 | * @function verify
|
20294 | * @memberof google.protobuf.MethodDescriptorProto
|
20295 | * @static
|
20296 | * @param {Object.<string,*>} message Plain object to verify
|
20297 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
20298 | */
|
20299 | MethodDescriptorProto.verify = function verify(message) {
|
20300 | if (typeof message !== "object" || message === null)
|
20301 | return "object expected";
|
20302 | if (message.name != null && message.hasOwnProperty("name"))
|
20303 | if (!$util.isString(message.name))
|
20304 | return "name: string expected";
|
20305 | if (message.inputType != null && message.hasOwnProperty("inputType"))
|
20306 | if (!$util.isString(message.inputType))
|
20307 | return "inputType: string expected";
|
20308 | if (message.outputType != null && message.hasOwnProperty("outputType"))
|
20309 | if (!$util.isString(message.outputType))
|
20310 | return "outputType: string expected";
|
20311 | if (message.options != null && message.hasOwnProperty("options")) {
|
20312 | var error = $root.google.protobuf.MethodOptions.verify(message.options);
|
20313 | if (error)
|
20314 | return "options." + error;
|
20315 | }
|
20316 | if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming"))
|
20317 | if (typeof message.clientStreaming !== "boolean")
|
20318 | return "clientStreaming: boolean expected";
|
20319 | if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming"))
|
20320 | if (typeof message.serverStreaming !== "boolean")
|
20321 | return "serverStreaming: boolean expected";
|
20322 | return null;
|
20323 | };
|
20324 |
|
20325 | /**
|
20326 | * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types.
|
20327 | * @function fromObject
|
20328 | * @memberof google.protobuf.MethodDescriptorProto
|
20329 | * @static
|
20330 | * @param {Object.<string,*>} object Plain object
|
20331 | * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto
|
20332 | */
|
20333 | MethodDescriptorProto.fromObject = function fromObject(object) {
|
20334 | if (object instanceof $root.google.protobuf.MethodDescriptorProto)
|
20335 | return object;
|
20336 | var message = new $root.google.protobuf.MethodDescriptorProto();
|
20337 | if (object.name != null)
|
20338 | message.name = String(object.name);
|
20339 | if (object.inputType != null)
|
20340 | message.inputType = String(object.inputType);
|
20341 | if (object.outputType != null)
|
20342 | message.outputType = String(object.outputType);
|
20343 | if (object.options != null) {
|
20344 | if (typeof object.options !== "object")
|
20345 | throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected");
|
20346 | message.options = $root.google.protobuf.MethodOptions.fromObject(object.options);
|
20347 | }
|
20348 | if (object.clientStreaming != null)
|
20349 | message.clientStreaming = Boolean(object.clientStreaming);
|
20350 | if (object.serverStreaming != null)
|
20351 | message.serverStreaming = Boolean(object.serverStreaming);
|
20352 | return message;
|
20353 | };
|
20354 |
|
20355 | /**
|
20356 | * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified.
|
20357 | * @function toObject
|
20358 | * @memberof google.protobuf.MethodDescriptorProto
|
20359 | * @static
|
20360 | * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto
|
20361 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
20362 | * @returns {Object.<string,*>} Plain object
|
20363 | */
|
20364 | MethodDescriptorProto.toObject = function toObject(message, options) {
|
20365 | if (!options)
|
20366 | options = {};
|
20367 | var object = {};
|
20368 | if (options.defaults) {
|
20369 | object.name = "";
|
20370 | object.inputType = "";
|
20371 | object.outputType = "";
|
20372 | object.options = null;
|
20373 | object.clientStreaming = false;
|
20374 | object.serverStreaming = false;
|
20375 | }
|
20376 | if (message.name != null && message.hasOwnProperty("name"))
|
20377 | object.name = message.name;
|
20378 | if (message.inputType != null && message.hasOwnProperty("inputType"))
|
20379 | object.inputType = message.inputType;
|
20380 | if (message.outputType != null && message.hasOwnProperty("outputType"))
|
20381 | object.outputType = message.outputType;
|
20382 | if (message.options != null && message.hasOwnProperty("options"))
|
20383 | object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options);
|
20384 | if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming"))
|
20385 | object.clientStreaming = message.clientStreaming;
|
20386 | if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming"))
|
20387 | object.serverStreaming = message.serverStreaming;
|
20388 | return object;
|
20389 | };
|
20390 |
|
20391 | /**
|
20392 | * Converts this MethodDescriptorProto to JSON.
|
20393 | * @function toJSON
|
20394 | * @memberof google.protobuf.MethodDescriptorProto
|
20395 | * @instance
|
20396 | * @returns {Object.<string,*>} JSON object
|
20397 | */
|
20398 | MethodDescriptorProto.prototype.toJSON = function toJSON() {
|
20399 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
20400 | };
|
20401 |
|
20402 | return MethodDescriptorProto;
|
20403 | })();
|
20404 |
|
20405 | protobuf.FileOptions = (function() {
|
20406 |
|
20407 | /**
|
20408 | * Properties of a FileOptions.
|
20409 | * @memberof google.protobuf
|
20410 | * @interface IFileOptions
|
20411 | * @property {string|null} [javaPackage] FileOptions javaPackage
|
20412 | * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname
|
20413 | * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles
|
20414 | * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash
|
20415 | * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8
|
20416 | * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor
|
20417 | * @property {string|null} [goPackage] FileOptions goPackage
|
20418 | * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices
|
20419 | * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices
|
20420 | * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices
|
20421 | * @property {boolean|null} [phpGenericServices] FileOptions phpGenericServices
|
20422 | * @property {boolean|null} [deprecated] FileOptions deprecated
|
20423 | * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas
|
20424 | * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix
|
20425 | * @property {string|null} [csharpNamespace] FileOptions csharpNamespace
|
20426 | * @property {string|null} [swiftPrefix] FileOptions swiftPrefix
|
20427 | * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix
|
20428 | * @property {string|null} [phpNamespace] FileOptions phpNamespace
|
20429 | * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace
|
20430 | * @property {string|null} [rubyPackage] FileOptions rubyPackage
|
20431 | * @property {Array.<google.protobuf.IUninterpretedOption>|null} [uninterpretedOption] FileOptions uninterpretedOption
|
20432 | * @property {Array.<google.api.IResourceDescriptor>|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition
|
20433 | */
|
20434 |
|
20435 | /**
|
20436 | * Constructs a new FileOptions.
|
20437 | * @memberof google.protobuf
|
20438 | * @classdesc Represents a FileOptions.
|
20439 | * @implements IFileOptions
|
20440 | * @constructor
|
20441 | * @param {google.protobuf.IFileOptions=} [properties] Properties to set
|
20442 | */
|
20443 | function FileOptions(properties) {
|
20444 | this.uninterpretedOption = [];
|
20445 | this[".google.api.resourceDefinition"] = [];
|
20446 | if (properties)
|
20447 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
20448 | if (properties[keys[i]] != null)
|
20449 | this[keys[i]] = properties[keys[i]];
|
20450 | }
|
20451 |
|
20452 | /**
|
20453 | * FileOptions javaPackage.
|
20454 | * @member {string} javaPackage
|
20455 | * @memberof google.protobuf.FileOptions
|
20456 | * @instance
|
20457 | */
|
20458 | FileOptions.prototype.javaPackage = "";
|
20459 |
|
20460 | /**
|
20461 | * FileOptions javaOuterClassname.
|
20462 | * @member {string} javaOuterClassname
|
20463 | * @memberof google.protobuf.FileOptions
|
20464 | * @instance
|
20465 | */
|
20466 | FileOptions.prototype.javaOuterClassname = "";
|
20467 |
|
20468 | /**
|
20469 | * FileOptions javaMultipleFiles.
|
20470 | * @member {boolean} javaMultipleFiles
|
20471 | * @memberof google.protobuf.FileOptions
|
20472 | * @instance
|
20473 | */
|
20474 | FileOptions.prototype.javaMultipleFiles = false;
|
20475 |
|
20476 | /**
|
20477 | * FileOptions javaGenerateEqualsAndHash.
|
20478 | * @member {boolean} javaGenerateEqualsAndHash
|
20479 | * @memberof google.protobuf.FileOptions
|
20480 | * @instance
|
20481 | */
|
20482 | FileOptions.prototype.javaGenerateEqualsAndHash = false;
|
20483 |
|
20484 | /**
|
20485 | * FileOptions javaStringCheckUtf8.
|
20486 | * @member {boolean} javaStringCheckUtf8
|
20487 | * @memberof google.protobuf.FileOptions
|
20488 | * @instance
|
20489 | */
|
20490 | FileOptions.prototype.javaStringCheckUtf8 = false;
|
20491 |
|
20492 | /**
|
20493 | * FileOptions optimizeFor.
|
20494 | * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor
|
20495 | * @memberof google.protobuf.FileOptions
|
20496 | * @instance
|
20497 | */
|
20498 | FileOptions.prototype.optimizeFor = 1;
|
20499 |
|
20500 | /**
|
20501 | * FileOptions goPackage.
|
20502 | * @member {string} goPackage
|
20503 | * @memberof google.protobuf.FileOptions
|
20504 | * @instance
|
20505 | */
|
20506 | FileOptions.prototype.goPackage = "";
|
20507 |
|
20508 | /**
|
20509 | * FileOptions ccGenericServices.
|
20510 | * @member {boolean} ccGenericServices
|
20511 | * @memberof google.protobuf.FileOptions
|
20512 | * @instance
|
20513 | */
|
20514 | FileOptions.prototype.ccGenericServices = false;
|
20515 |
|
20516 | /**
|
20517 | * FileOptions javaGenericServices.
|
20518 | * @member {boolean} javaGenericServices
|
20519 | * @memberof google.protobuf.FileOptions
|
20520 | * @instance
|
20521 | */
|
20522 | FileOptions.prototype.javaGenericServices = false;
|
20523 |
|
20524 | /**
|
20525 | * FileOptions pyGenericServices.
|
20526 | * @member {boolean} pyGenericServices
|
20527 | * @memberof google.protobuf.FileOptions
|
20528 | * @instance
|
20529 | */
|
20530 | FileOptions.prototype.pyGenericServices = false;
|
20531 |
|
20532 | /**
|
20533 | * FileOptions phpGenericServices.
|
20534 | * @member {boolean} phpGenericServices
|
20535 | * @memberof google.protobuf.FileOptions
|
20536 | * @instance
|
20537 | */
|
20538 | FileOptions.prototype.phpGenericServices = false;
|
20539 |
|
20540 | /**
|
20541 | * FileOptions deprecated.
|
20542 | * @member {boolean} deprecated
|
20543 | * @memberof google.protobuf.FileOptions
|
20544 | * @instance
|
20545 | */
|
20546 | FileOptions.prototype.deprecated = false;
|
20547 |
|
20548 | /**
|
20549 | * FileOptions ccEnableArenas.
|
20550 | * @member {boolean} ccEnableArenas
|
20551 | * @memberof google.protobuf.FileOptions
|
20552 | * @instance
|
20553 | */
|
20554 | FileOptions.prototype.ccEnableArenas = true;
|
20555 |
|
20556 | /**
|
20557 | * FileOptions objcClassPrefix.
|
20558 | * @member {string} objcClassPrefix
|
20559 | * @memberof google.protobuf.FileOptions
|
20560 | * @instance
|
20561 | */
|
20562 | FileOptions.prototype.objcClassPrefix = "";
|
20563 |
|
20564 | /**
|
20565 | * FileOptions csharpNamespace.
|
20566 | * @member {string} csharpNamespace
|
20567 | * @memberof google.protobuf.FileOptions
|
20568 | * @instance
|
20569 | */
|
20570 | FileOptions.prototype.csharpNamespace = "";
|
20571 |
|
20572 | /**
|
20573 | * FileOptions swiftPrefix.
|
20574 | * @member {string} swiftPrefix
|
20575 | * @memberof google.protobuf.FileOptions
|
20576 | * @instance
|
20577 | */
|
20578 | FileOptions.prototype.swiftPrefix = "";
|
20579 |
|
20580 | /**
|
20581 | * FileOptions phpClassPrefix.
|
20582 | * @member {string} phpClassPrefix
|
20583 | * @memberof google.protobuf.FileOptions
|
20584 | * @instance
|
20585 | */
|
20586 | FileOptions.prototype.phpClassPrefix = "";
|
20587 |
|
20588 | /**
|
20589 | * FileOptions phpNamespace.
|
20590 | * @member {string} phpNamespace
|
20591 | * @memberof google.protobuf.FileOptions
|
20592 | * @instance
|
20593 | */
|
20594 | FileOptions.prototype.phpNamespace = "";
|
20595 |
|
20596 | /**
|
20597 | * FileOptions phpMetadataNamespace.
|
20598 | * @member {string} phpMetadataNamespace
|
20599 | * @memberof google.protobuf.FileOptions
|
20600 | * @instance
|
20601 | */
|
20602 | FileOptions.prototype.phpMetadataNamespace = "";
|
20603 |
|
20604 | /**
|
20605 | * FileOptions rubyPackage.
|
20606 | * @member {string} rubyPackage
|
20607 | * @memberof google.protobuf.FileOptions
|
20608 | * @instance
|
20609 | */
|
20610 | FileOptions.prototype.rubyPackage = "";
|
20611 |
|
20612 | /**
|
20613 | * FileOptions uninterpretedOption.
|
20614 | * @member {Array.<google.protobuf.IUninterpretedOption>} uninterpretedOption
|
20615 | * @memberof google.protobuf.FileOptions
|
20616 | * @instance
|
20617 | */
|
20618 | FileOptions.prototype.uninterpretedOption = $util.emptyArray;
|
20619 |
|
20620 | /**
|
20621 | * FileOptions .google.api.resourceDefinition.
|
20622 | * @member {Array.<google.api.IResourceDescriptor>} .google.api.resourceDefinition
|
20623 | * @memberof google.protobuf.FileOptions
|
20624 | * @instance
|
20625 | */
|
20626 | FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray;
|
20627 |
|
20628 | /**
|
20629 | * Creates a new FileOptions instance using the specified properties.
|
20630 | * @function create
|
20631 | * @memberof google.protobuf.FileOptions
|
20632 | * @static
|
20633 | * @param {google.protobuf.IFileOptions=} [properties] Properties to set
|
20634 | * @returns {google.protobuf.FileOptions} FileOptions instance
|
20635 | */
|
20636 | FileOptions.create = function create(properties) {
|
20637 | return new FileOptions(properties);
|
20638 | };
|
20639 |
|
20640 | /**
|
20641 | * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages.
|
20642 | * @function encode
|
20643 | * @memberof google.protobuf.FileOptions
|
20644 | * @static
|
20645 | * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode
|
20646 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
20647 | * @returns {$protobuf.Writer} Writer
|
20648 | */
|
20649 | FileOptions.encode = function encode(message, writer) {
|
20650 | if (!writer)
|
20651 | writer = $Writer.create();
|
20652 | if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage"))
|
20653 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage);
|
20654 | if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname"))
|
20655 | writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname);
|
20656 | if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor"))
|
20657 | writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor);
|
20658 | if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles"))
|
20659 | writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles);
|
20660 | if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage"))
|
20661 | writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage);
|
20662 | if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices"))
|
20663 | writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices);
|
20664 | if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices"))
|
20665 | writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices);
|
20666 | if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices"))
|
20667 | writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices);
|
20668 | if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash"))
|
20669 | writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash);
|
20670 | if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated"))
|
20671 | writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated);
|
20672 | if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8"))
|
20673 | writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8);
|
20674 | if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas"))
|
20675 | writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas);
|
20676 | if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix"))
|
20677 | writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix);
|
20678 | if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace"))
|
20679 | writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace);
|
20680 | if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix"))
|
20681 | writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix);
|
20682 | if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix"))
|
20683 | writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix);
|
20684 | if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace"))
|
20685 | writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace);
|
20686 | if (message.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices"))
|
20687 | writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices);
|
20688 | if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace"))
|
20689 | writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace);
|
20690 | if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage"))
|
20691 | writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage);
|
20692 | if (message.uninterpretedOption != null && message.uninterpretedOption.length)
|
20693 | for (var i = 0; i < message.uninterpretedOption.length; ++i)
|
20694 | $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim();
|
20695 | if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length)
|
20696 | for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i)
|
20697 | $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim();
|
20698 | return writer;
|
20699 | };
|
20700 |
|
20701 | /**
|
20702 | * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages.
|
20703 | * @function encodeDelimited
|
20704 | * @memberof google.protobuf.FileOptions
|
20705 | * @static
|
20706 | * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode
|
20707 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
20708 | * @returns {$protobuf.Writer} Writer
|
20709 | */
|
20710 | FileOptions.encodeDelimited = function encodeDelimited(message, writer) {
|
20711 | return this.encode(message, writer).ldelim();
|
20712 | };
|
20713 |
|
20714 | /**
|
20715 | * Decodes a FileOptions message from the specified reader or buffer.
|
20716 | * @function decode
|
20717 | * @memberof google.protobuf.FileOptions
|
20718 | * @static
|
20719 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
20720 | * @param {number} [length] Message length if known beforehand
|
20721 | * @returns {google.protobuf.FileOptions} FileOptions
|
20722 | * @throws {Error} If the payload is not a reader or valid buffer
|
20723 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
20724 | */
|
20725 | FileOptions.decode = function decode(reader, length) {
|
20726 | if (!(reader instanceof $Reader))
|
20727 | reader = $Reader.create(reader);
|
20728 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions();
|
20729 | while (reader.pos < end) {
|
20730 | var tag = reader.uint32();
|
20731 | switch (tag >>> 3) {
|
20732 | case 1:
|
20733 | message.javaPackage = reader.string();
|
20734 | break;
|
20735 | case 8:
|
20736 | message.javaOuterClassname = reader.string();
|
20737 | break;
|
20738 | case 10:
|
20739 | message.javaMultipleFiles = reader.bool();
|
20740 | break;
|
20741 | case 20:
|
20742 | message.javaGenerateEqualsAndHash = reader.bool();
|
20743 | break;
|
20744 | case 27:
|
20745 | message.javaStringCheckUtf8 = reader.bool();
|
20746 | break;
|
20747 | case 9:
|
20748 | message.optimizeFor = reader.int32();
|
20749 | break;
|
20750 | case 11:
|
20751 | message.goPackage = reader.string();
|
20752 | break;
|
20753 | case 16:
|
20754 | message.ccGenericServices = reader.bool();
|
20755 | break;
|
20756 | case 17:
|
20757 | message.javaGenericServices = reader.bool();
|
20758 | break;
|
20759 | case 18:
|
20760 | message.pyGenericServices = reader.bool();
|
20761 | break;
|
20762 | case 42:
|
20763 | message.phpGenericServices = reader.bool();
|
20764 | break;
|
20765 | case 23:
|
20766 | message.deprecated = reader.bool();
|
20767 | break;
|
20768 | case 31:
|
20769 | message.ccEnableArenas = reader.bool();
|
20770 | break;
|
20771 | case 36:
|
20772 | message.objcClassPrefix = reader.string();
|
20773 | break;
|
20774 | case 37:
|
20775 | message.csharpNamespace = reader.string();
|
20776 | break;
|
20777 | case 39:
|
20778 | message.swiftPrefix = reader.string();
|
20779 | break;
|
20780 | case 40:
|
20781 | message.phpClassPrefix = reader.string();
|
20782 | break;
|
20783 | case 41:
|
20784 | message.phpNamespace = reader.string();
|
20785 | break;
|
20786 | case 44:
|
20787 | message.phpMetadataNamespace = reader.string();
|
20788 | break;
|
20789 | case 45:
|
20790 | message.rubyPackage = reader.string();
|
20791 | break;
|
20792 | case 999:
|
20793 | if (!(message.uninterpretedOption && message.uninterpretedOption.length))
|
20794 | message.uninterpretedOption = [];
|
20795 | message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32()));
|
20796 | break;
|
20797 | case 1053:
|
20798 | if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length))
|
20799 | message[".google.api.resourceDefinition"] = [];
|
20800 | message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32()));
|
20801 | break;
|
20802 | default:
|
20803 | reader.skipType(tag & 7);
|
20804 | break;
|
20805 | }
|
20806 | }
|
20807 | return message;
|
20808 | };
|
20809 |
|
20810 | /**
|
20811 | * Decodes a FileOptions message from the specified reader or buffer, length delimited.
|
20812 | * @function decodeDelimited
|
20813 | * @memberof google.protobuf.FileOptions
|
20814 | * @static
|
20815 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
20816 | * @returns {google.protobuf.FileOptions} FileOptions
|
20817 | * @throws {Error} If the payload is not a reader or valid buffer
|
20818 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
20819 | */
|
20820 | FileOptions.decodeDelimited = function decodeDelimited(reader) {
|
20821 | if (!(reader instanceof $Reader))
|
20822 | reader = new $Reader(reader);
|
20823 | return this.decode(reader, reader.uint32());
|
20824 | };
|
20825 |
|
20826 | /**
|
20827 | * Verifies a FileOptions message.
|
20828 | * @function verify
|
20829 | * @memberof google.protobuf.FileOptions
|
20830 | * @static
|
20831 | * @param {Object.<string,*>} message Plain object to verify
|
20832 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
20833 | */
|
20834 | FileOptions.verify = function verify(message) {
|
20835 | if (typeof message !== "object" || message === null)
|
20836 | return "object expected";
|
20837 | if (message.javaPackage != null && message.hasOwnProperty("javaPackage"))
|
20838 | if (!$util.isString(message.javaPackage))
|
20839 | return "javaPackage: string expected";
|
20840 | if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname"))
|
20841 | if (!$util.isString(message.javaOuterClassname))
|
20842 | return "javaOuterClassname: string expected";
|
20843 | if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles"))
|
20844 | if (typeof message.javaMultipleFiles !== "boolean")
|
20845 | return "javaMultipleFiles: boolean expected";
|
20846 | if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash"))
|
20847 | if (typeof message.javaGenerateEqualsAndHash !== "boolean")
|
20848 | return "javaGenerateEqualsAndHash: boolean expected";
|
20849 | if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8"))
|
20850 | if (typeof message.javaStringCheckUtf8 !== "boolean")
|
20851 | return "javaStringCheckUtf8: boolean expected";
|
20852 | if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor"))
|
20853 | switch (message.optimizeFor) {
|
20854 | default:
|
20855 | return "optimizeFor: enum value expected";
|
20856 | case 1:
|
20857 | case 2:
|
20858 | case 3:
|
20859 | break;
|
20860 | }
|
20861 | if (message.goPackage != null && message.hasOwnProperty("goPackage"))
|
20862 | if (!$util.isString(message.goPackage))
|
20863 | return "goPackage: string expected";
|
20864 | if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices"))
|
20865 | if (typeof message.ccGenericServices !== "boolean")
|
20866 | return "ccGenericServices: boolean expected";
|
20867 | if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices"))
|
20868 | if (typeof message.javaGenericServices !== "boolean")
|
20869 | return "javaGenericServices: boolean expected";
|
20870 | if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices"))
|
20871 | if (typeof message.pyGenericServices !== "boolean")
|
20872 | return "pyGenericServices: boolean expected";
|
20873 | if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices"))
|
20874 | if (typeof message.phpGenericServices !== "boolean")
|
20875 | return "phpGenericServices: boolean expected";
|
20876 | if (message.deprecated != null && message.hasOwnProperty("deprecated"))
|
20877 | if (typeof message.deprecated !== "boolean")
|
20878 | return "deprecated: boolean expected";
|
20879 | if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas"))
|
20880 | if (typeof message.ccEnableArenas !== "boolean")
|
20881 | return "ccEnableArenas: boolean expected";
|
20882 | if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix"))
|
20883 | if (!$util.isString(message.objcClassPrefix))
|
20884 | return "objcClassPrefix: string expected";
|
20885 | if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace"))
|
20886 | if (!$util.isString(message.csharpNamespace))
|
20887 | return "csharpNamespace: string expected";
|
20888 | if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix"))
|
20889 | if (!$util.isString(message.swiftPrefix))
|
20890 | return "swiftPrefix: string expected";
|
20891 | if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix"))
|
20892 | if (!$util.isString(message.phpClassPrefix))
|
20893 | return "phpClassPrefix: string expected";
|
20894 | if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace"))
|
20895 | if (!$util.isString(message.phpNamespace))
|
20896 | return "phpNamespace: string expected";
|
20897 | if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace"))
|
20898 | if (!$util.isString(message.phpMetadataNamespace))
|
20899 | return "phpMetadataNamespace: string expected";
|
20900 | if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage"))
|
20901 | if (!$util.isString(message.rubyPackage))
|
20902 | return "rubyPackage: string expected";
|
20903 | if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) {
|
20904 | if (!Array.isArray(message.uninterpretedOption))
|
20905 | return "uninterpretedOption: array expected";
|
20906 | for (var i = 0; i < message.uninterpretedOption.length; ++i) {
|
20907 | var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]);
|
20908 | if (error)
|
20909 | return "uninterpretedOption." + error;
|
20910 | }
|
20911 | }
|
20912 | if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) {
|
20913 | if (!Array.isArray(message[".google.api.resourceDefinition"]))
|
20914 | return ".google.api.resourceDefinition: array expected";
|
20915 | for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) {
|
20916 | var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]);
|
20917 | if (error)
|
20918 | return ".google.api.resourceDefinition." + error;
|
20919 | }
|
20920 | }
|
20921 | return null;
|
20922 | };
|
20923 |
|
20924 | /**
|
20925 | * Creates a FileOptions message from a plain object. Also converts values to their respective internal types.
|
20926 | * @function fromObject
|
20927 | * @memberof google.protobuf.FileOptions
|
20928 | * @static
|
20929 | * @param {Object.<string,*>} object Plain object
|
20930 | * @returns {google.protobuf.FileOptions} FileOptions
|
20931 | */
|
20932 | FileOptions.fromObject = function fromObject(object) {
|
20933 | if (object instanceof $root.google.protobuf.FileOptions)
|
20934 | return object;
|
20935 | var message = new $root.google.protobuf.FileOptions();
|
20936 | if (object.javaPackage != null)
|
20937 | message.javaPackage = String(object.javaPackage);
|
20938 | if (object.javaOuterClassname != null)
|
20939 | message.javaOuterClassname = String(object.javaOuterClassname);
|
20940 | if (object.javaMultipleFiles != null)
|
20941 | message.javaMultipleFiles = Boolean(object.javaMultipleFiles);
|
20942 | if (object.javaGenerateEqualsAndHash != null)
|
20943 | message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash);
|
20944 | if (object.javaStringCheckUtf8 != null)
|
20945 | message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8);
|
20946 | switch (object.optimizeFor) {
|
20947 | case "SPEED":
|
20948 | case 1:
|
20949 | message.optimizeFor = 1;
|
20950 | break;
|
20951 | case "CODE_SIZE":
|
20952 | case 2:
|
20953 | message.optimizeFor = 2;
|
20954 | break;
|
20955 | case "LITE_RUNTIME":
|
20956 | case 3:
|
20957 | message.optimizeFor = 3;
|
20958 | break;
|
20959 | }
|
20960 | if (object.goPackage != null)
|
20961 | message.goPackage = String(object.goPackage);
|
20962 | if (object.ccGenericServices != null)
|
20963 | message.ccGenericServices = Boolean(object.ccGenericServices);
|
20964 | if (object.javaGenericServices != null)
|
20965 | message.javaGenericServices = Boolean(object.javaGenericServices);
|
20966 | if (object.pyGenericServices != null)
|
20967 | message.pyGenericServices = Boolean(object.pyGenericServices);
|
20968 | if (object.phpGenericServices != null)
|
20969 | message.phpGenericServices = Boolean(object.phpGenericServices);
|
20970 | if (object.deprecated != null)
|
20971 | message.deprecated = Boolean(object.deprecated);
|
20972 | if (object.ccEnableArenas != null)
|
20973 | message.ccEnableArenas = Boolean(object.ccEnableArenas);
|
20974 | if (object.objcClassPrefix != null)
|
20975 | message.objcClassPrefix = String(object.objcClassPrefix);
|
20976 | if (object.csharpNamespace != null)
|
20977 | message.csharpNamespace = String(object.csharpNamespace);
|
20978 | if (object.swiftPrefix != null)
|
20979 | message.swiftPrefix = String(object.swiftPrefix);
|
20980 | if (object.phpClassPrefix != null)
|
20981 | message.phpClassPrefix = String(object.phpClassPrefix);
|
20982 | if (object.phpNamespace != null)
|
20983 | message.phpNamespace = String(object.phpNamespace);
|
20984 | if (object.phpMetadataNamespace != null)
|
20985 | message.phpMetadataNamespace = String(object.phpMetadataNamespace);
|
20986 | if (object.rubyPackage != null)
|
20987 | message.rubyPackage = String(object.rubyPackage);
|
20988 | if (object.uninterpretedOption) {
|
20989 | if (!Array.isArray(object.uninterpretedOption))
|
20990 | throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected");
|
20991 | message.uninterpretedOption = [];
|
20992 | for (var i = 0; i < object.uninterpretedOption.length; ++i) {
|
20993 | if (typeof object.uninterpretedOption[i] !== "object")
|
20994 | throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected");
|
20995 | message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]);
|
20996 | }
|
20997 | }
|
20998 | if (object[".google.api.resourceDefinition"]) {
|
20999 | if (!Array.isArray(object[".google.api.resourceDefinition"]))
|
21000 | throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected");
|
21001 | message[".google.api.resourceDefinition"] = [];
|
21002 | for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) {
|
21003 | if (typeof object[".google.api.resourceDefinition"][i] !== "object")
|
21004 | throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected");
|
21005 | message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]);
|
21006 | }
|
21007 | }
|
21008 | return message;
|
21009 | };
|
21010 |
|
21011 | /**
|
21012 | * Creates a plain object from a FileOptions message. Also converts values to other types if specified.
|
21013 | * @function toObject
|
21014 | * @memberof google.protobuf.FileOptions
|
21015 | * @static
|
21016 | * @param {google.protobuf.FileOptions} message FileOptions
|
21017 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
21018 | * @returns {Object.<string,*>} Plain object
|
21019 | */
|
21020 | FileOptions.toObject = function toObject(message, options) {
|
21021 | if (!options)
|
21022 | options = {};
|
21023 | var object = {};
|
21024 | if (options.arrays || options.defaults) {
|
21025 | object.uninterpretedOption = [];
|
21026 | object[".google.api.resourceDefinition"] = [];
|
21027 | }
|
21028 | if (options.defaults) {
|
21029 | object.javaPackage = "";
|
21030 | object.javaOuterClassname = "";
|
21031 | object.optimizeFor = options.enums === String ? "SPEED" : 1;
|
21032 | object.javaMultipleFiles = false;
|
21033 | object.goPackage = "";
|
21034 | object.ccGenericServices = false;
|
21035 | object.javaGenericServices = false;
|
21036 | object.pyGenericServices = false;
|
21037 | object.javaGenerateEqualsAndHash = false;
|
21038 | object.deprecated = false;
|
21039 | object.javaStringCheckUtf8 = false;
|
21040 | object.ccEnableArenas = true;
|
21041 | object.objcClassPrefix = "";
|
21042 | object.csharpNamespace = "";
|
21043 | object.swiftPrefix = "";
|
21044 | object.phpClassPrefix = "";
|
21045 | object.phpNamespace = "";
|
21046 | object.phpGenericServices = false;
|
21047 | object.phpMetadataNamespace = "";
|
21048 | object.rubyPackage = "";
|
21049 | }
|
21050 | if (message.javaPackage != null && message.hasOwnProperty("javaPackage"))
|
21051 | object.javaPackage = message.javaPackage;
|
21052 | if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname"))
|
21053 | object.javaOuterClassname = message.javaOuterClassname;
|
21054 | if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor"))
|
21055 | object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor;
|
21056 | if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles"))
|
21057 | object.javaMultipleFiles = message.javaMultipleFiles;
|
21058 | if (message.goPackage != null && message.hasOwnProperty("goPackage"))
|
21059 | object.goPackage = message.goPackage;
|
21060 | if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices"))
|
21061 | object.ccGenericServices = message.ccGenericServices;
|
21062 | if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices"))
|
21063 | object.javaGenericServices = message.javaGenericServices;
|
21064 | if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices"))
|
21065 | object.pyGenericServices = message.pyGenericServices;
|
21066 | if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash"))
|
21067 | object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash;
|
21068 | if (message.deprecated != null && message.hasOwnProperty("deprecated"))
|
21069 | object.deprecated = message.deprecated;
|
21070 | if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8"))
|
21071 | object.javaStringCheckUtf8 = message.javaStringCheckUtf8;
|
21072 | if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas"))
|
21073 | object.ccEnableArenas = message.ccEnableArenas;
|
21074 | if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix"))
|
21075 | object.objcClassPrefix = message.objcClassPrefix;
|
21076 | if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace"))
|
21077 | object.csharpNamespace = message.csharpNamespace;
|
21078 | if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix"))
|
21079 | object.swiftPrefix = message.swiftPrefix;
|
21080 | if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix"))
|
21081 | object.phpClassPrefix = message.phpClassPrefix;
|
21082 | if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace"))
|
21083 | object.phpNamespace = message.phpNamespace;
|
21084 | if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices"))
|
21085 | object.phpGenericServices = message.phpGenericServices;
|
21086 | if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace"))
|
21087 | object.phpMetadataNamespace = message.phpMetadataNamespace;
|
21088 | if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage"))
|
21089 | object.rubyPackage = message.rubyPackage;
|
21090 | if (message.uninterpretedOption && message.uninterpretedOption.length) {
|
21091 | object.uninterpretedOption = [];
|
21092 | for (var j = 0; j < message.uninterpretedOption.length; ++j)
|
21093 | object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options);
|
21094 | }
|
21095 | if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) {
|
21096 | object[".google.api.resourceDefinition"] = [];
|
21097 | for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j)
|
21098 | object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options);
|
21099 | }
|
21100 | return object;
|
21101 | };
|
21102 |
|
21103 | /**
|
21104 | * Converts this FileOptions to JSON.
|
21105 | * @function toJSON
|
21106 | * @memberof google.protobuf.FileOptions
|
21107 | * @instance
|
21108 | * @returns {Object.<string,*>} JSON object
|
21109 | */
|
21110 | FileOptions.prototype.toJSON = function toJSON() {
|
21111 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
21112 | };
|
21113 |
|
21114 | /**
|
21115 | * OptimizeMode enum.
|
21116 | * @name google.protobuf.FileOptions.OptimizeMode
|
21117 | * @enum {number}
|
21118 | * @property {number} SPEED=1 SPEED value
|
21119 | * @property {number} CODE_SIZE=2 CODE_SIZE value
|
21120 | * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value
|
21121 | */
|
21122 | FileOptions.OptimizeMode = (function() {
|
21123 | var valuesById = {}, values = Object.create(valuesById);
|
21124 | values[valuesById[1] = "SPEED"] = 1;
|
21125 | values[valuesById[2] = "CODE_SIZE"] = 2;
|
21126 | values[valuesById[3] = "LITE_RUNTIME"] = 3;
|
21127 | return values;
|
21128 | })();
|
21129 |
|
21130 | return FileOptions;
|
21131 | })();
|
21132 |
|
21133 | protobuf.MessageOptions = (function() {
|
21134 |
|
21135 | /**
|
21136 | * Properties of a MessageOptions.
|
21137 | * @memberof google.protobuf
|
21138 | * @interface IMessageOptions
|
21139 | * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat
|
21140 | * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor
|
21141 | * @property {boolean|null} [deprecated] MessageOptions deprecated
|
21142 | * @property {boolean|null} [mapEntry] MessageOptions mapEntry
|
21143 | * @property {Array.<google.protobuf.IUninterpretedOption>|null} [uninterpretedOption] MessageOptions uninterpretedOption
|
21144 | * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource
|
21145 | */
|
21146 |
|
21147 | /**
|
21148 | * Constructs a new MessageOptions.
|
21149 | * @memberof google.protobuf
|
21150 | * @classdesc Represents a MessageOptions.
|
21151 | * @implements IMessageOptions
|
21152 | * @constructor
|
21153 | * @param {google.protobuf.IMessageOptions=} [properties] Properties to set
|
21154 | */
|
21155 | function MessageOptions(properties) {
|
21156 | this.uninterpretedOption = [];
|
21157 | if (properties)
|
21158 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
21159 | if (properties[keys[i]] != null)
|
21160 | this[keys[i]] = properties[keys[i]];
|
21161 | }
|
21162 |
|
21163 | /**
|
21164 | * MessageOptions messageSetWireFormat.
|
21165 | * @member {boolean} messageSetWireFormat
|
21166 | * @memberof google.protobuf.MessageOptions
|
21167 | * @instance
|
21168 | */
|
21169 | MessageOptions.prototype.messageSetWireFormat = false;
|
21170 |
|
21171 | /**
|
21172 | * MessageOptions noStandardDescriptorAccessor.
|
21173 | * @member {boolean} noStandardDescriptorAccessor
|
21174 | * @memberof google.protobuf.MessageOptions
|
21175 | * @instance
|
21176 | */
|
21177 | MessageOptions.prototype.noStandardDescriptorAccessor = false;
|
21178 |
|
21179 | /**
|
21180 | * MessageOptions deprecated.
|
21181 | * @member {boolean} deprecated
|
21182 | * @memberof google.protobuf.MessageOptions
|
21183 | * @instance
|
21184 | */
|
21185 | MessageOptions.prototype.deprecated = false;
|
21186 |
|
21187 | /**
|
21188 | * MessageOptions mapEntry.
|
21189 | * @member {boolean} mapEntry
|
21190 | * @memberof google.protobuf.MessageOptions
|
21191 | * @instance
|
21192 | */
|
21193 | MessageOptions.prototype.mapEntry = false;
|
21194 |
|
21195 | /**
|
21196 | * MessageOptions uninterpretedOption.
|
21197 | * @member {Array.<google.protobuf.IUninterpretedOption>} uninterpretedOption
|
21198 | * @memberof google.protobuf.MessageOptions
|
21199 | * @instance
|
21200 | */
|
21201 | MessageOptions.prototype.uninterpretedOption = $util.emptyArray;
|
21202 |
|
21203 | /**
|
21204 | * MessageOptions .google.api.resource.
|
21205 | * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource
|
21206 | * @memberof google.protobuf.MessageOptions
|
21207 | * @instance
|
21208 | */
|
21209 | MessageOptions.prototype[".google.api.resource"] = null;
|
21210 |
|
21211 | /**
|
21212 | * Creates a new MessageOptions instance using the specified properties.
|
21213 | * @function create
|
21214 | * @memberof google.protobuf.MessageOptions
|
21215 | * @static
|
21216 | * @param {google.protobuf.IMessageOptions=} [properties] Properties to set
|
21217 | * @returns {google.protobuf.MessageOptions} MessageOptions instance
|
21218 | */
|
21219 | MessageOptions.create = function create(properties) {
|
21220 | return new MessageOptions(properties);
|
21221 | };
|
21222 |
|
21223 | /**
|
21224 | * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages.
|
21225 | * @function encode
|
21226 | * @memberof google.protobuf.MessageOptions
|
21227 | * @static
|
21228 | * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode
|
21229 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
21230 | * @returns {$protobuf.Writer} Writer
|
21231 | */
|
21232 | MessageOptions.encode = function encode(message, writer) {
|
21233 | if (!writer)
|
21234 | writer = $Writer.create();
|
21235 | if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat"))
|
21236 | writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat);
|
21237 | if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor"))
|
21238 | writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor);
|
21239 | if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated"))
|
21240 | writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated);
|
21241 | if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry"))
|
21242 | writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry);
|
21243 | if (message.uninterpretedOption != null && message.uninterpretedOption.length)
|
21244 | for (var i = 0; i < message.uninterpretedOption.length; ++i)
|
21245 | $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim();
|
21246 | if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource"))
|
21247 | $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim();
|
21248 | return writer;
|
21249 | };
|
21250 |
|
21251 | /**
|
21252 | * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages.
|
21253 | * @function encodeDelimited
|
21254 | * @memberof google.protobuf.MessageOptions
|
21255 | * @static
|
21256 | * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode
|
21257 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
21258 | * @returns {$protobuf.Writer} Writer
|
21259 | */
|
21260 | MessageOptions.encodeDelimited = function encodeDelimited(message, writer) {
|
21261 | return this.encode(message, writer).ldelim();
|
21262 | };
|
21263 |
|
21264 | /**
|
21265 | * Decodes a MessageOptions message from the specified reader or buffer.
|
21266 | * @function decode
|
21267 | * @memberof google.protobuf.MessageOptions
|
21268 | * @static
|
21269 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
21270 | * @param {number} [length] Message length if known beforehand
|
21271 | * @returns {google.protobuf.MessageOptions} MessageOptions
|
21272 | * @throws {Error} If the payload is not a reader or valid buffer
|
21273 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
21274 | */
|
21275 | MessageOptions.decode = function decode(reader, length) {
|
21276 | if (!(reader instanceof $Reader))
|
21277 | reader = $Reader.create(reader);
|
21278 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions();
|
21279 | while (reader.pos < end) {
|
21280 | var tag = reader.uint32();
|
21281 | switch (tag >>> 3) {
|
21282 | case 1:
|
21283 | message.messageSetWireFormat = reader.bool();
|
21284 | break;
|
21285 | case 2:
|
21286 | message.noStandardDescriptorAccessor = reader.bool();
|
21287 | break;
|
21288 | case 3:
|
21289 | message.deprecated = reader.bool();
|
21290 | break;
|
21291 | case 7:
|
21292 | message.mapEntry = reader.bool();
|
21293 | break;
|
21294 | case 999:
|
21295 | if (!(message.uninterpretedOption && message.uninterpretedOption.length))
|
21296 | message.uninterpretedOption = [];
|
21297 | message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32()));
|
21298 | break;
|
21299 | case 1053:
|
21300 | message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32());
|
21301 | break;
|
21302 | default:
|
21303 | reader.skipType(tag & 7);
|
21304 | break;
|
21305 | }
|
21306 | }
|
21307 | return message;
|
21308 | };
|
21309 |
|
21310 | /**
|
21311 | * Decodes a MessageOptions message from the specified reader or buffer, length delimited.
|
21312 | * @function decodeDelimited
|
21313 | * @memberof google.protobuf.MessageOptions
|
21314 | * @static
|
21315 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
21316 | * @returns {google.protobuf.MessageOptions} MessageOptions
|
21317 | * @throws {Error} If the payload is not a reader or valid buffer
|
21318 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
21319 | */
|
21320 | MessageOptions.decodeDelimited = function decodeDelimited(reader) {
|
21321 | if (!(reader instanceof $Reader))
|
21322 | reader = new $Reader(reader);
|
21323 | return this.decode(reader, reader.uint32());
|
21324 | };
|
21325 |
|
21326 | /**
|
21327 | * Verifies a MessageOptions message.
|
21328 | * @function verify
|
21329 | * @memberof google.protobuf.MessageOptions
|
21330 | * @static
|
21331 | * @param {Object.<string,*>} message Plain object to verify
|
21332 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
21333 | */
|
21334 | MessageOptions.verify = function verify(message) {
|
21335 | if (typeof message !== "object" || message === null)
|
21336 | return "object expected";
|
21337 | if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat"))
|
21338 | if (typeof message.messageSetWireFormat !== "boolean")
|
21339 | return "messageSetWireFormat: boolean expected";
|
21340 | if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor"))
|
21341 | if (typeof message.noStandardDescriptorAccessor !== "boolean")
|
21342 | return "noStandardDescriptorAccessor: boolean expected";
|
21343 | if (message.deprecated != null && message.hasOwnProperty("deprecated"))
|
21344 | if (typeof message.deprecated !== "boolean")
|
21345 | return "deprecated: boolean expected";
|
21346 | if (message.mapEntry != null && message.hasOwnProperty("mapEntry"))
|
21347 | if (typeof message.mapEntry !== "boolean")
|
21348 | return "mapEntry: boolean expected";
|
21349 | if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) {
|
21350 | if (!Array.isArray(message.uninterpretedOption))
|
21351 | return "uninterpretedOption: array expected";
|
21352 | for (var i = 0; i < message.uninterpretedOption.length; ++i) {
|
21353 | var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]);
|
21354 | if (error)
|
21355 | return "uninterpretedOption." + error;
|
21356 | }
|
21357 | }
|
21358 | if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) {
|
21359 | var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]);
|
21360 | if (error)
|
21361 | return ".google.api.resource." + error;
|
21362 | }
|
21363 | return null;
|
21364 | };
|
21365 |
|
21366 | /**
|
21367 | * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types.
|
21368 | * @function fromObject
|
21369 | * @memberof google.protobuf.MessageOptions
|
21370 | * @static
|
21371 | * @param {Object.<string,*>} object Plain object
|
21372 | * @returns {google.protobuf.MessageOptions} MessageOptions
|
21373 | */
|
21374 | MessageOptions.fromObject = function fromObject(object) {
|
21375 | if (object instanceof $root.google.protobuf.MessageOptions)
|
21376 | return object;
|
21377 | var message = new $root.google.protobuf.MessageOptions();
|
21378 | if (object.messageSetWireFormat != null)
|
21379 | message.messageSetWireFormat = Boolean(object.messageSetWireFormat);
|
21380 | if (object.noStandardDescriptorAccessor != null)
|
21381 | message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor);
|
21382 | if (object.deprecated != null)
|
21383 | message.deprecated = Boolean(object.deprecated);
|
21384 | if (object.mapEntry != null)
|
21385 | message.mapEntry = Boolean(object.mapEntry);
|
21386 | if (object.uninterpretedOption) {
|
21387 | if (!Array.isArray(object.uninterpretedOption))
|
21388 | throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected");
|
21389 | message.uninterpretedOption = [];
|
21390 | for (var i = 0; i < object.uninterpretedOption.length; ++i) {
|
21391 | if (typeof object.uninterpretedOption[i] !== "object")
|
21392 | throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected");
|
21393 | message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]);
|
21394 | }
|
21395 | }
|
21396 | if (object[".google.api.resource"] != null) {
|
21397 | if (typeof object[".google.api.resource"] !== "object")
|
21398 | throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected");
|
21399 | message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]);
|
21400 | }
|
21401 | return message;
|
21402 | };
|
21403 |
|
21404 | /**
|
21405 | * Creates a plain object from a MessageOptions message. Also converts values to other types if specified.
|
21406 | * @function toObject
|
21407 | * @memberof google.protobuf.MessageOptions
|
21408 | * @static
|
21409 | * @param {google.protobuf.MessageOptions} message MessageOptions
|
21410 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
21411 | * @returns {Object.<string,*>} Plain object
|
21412 | */
|
21413 | MessageOptions.toObject = function toObject(message, options) {
|
21414 | if (!options)
|
21415 | options = {};
|
21416 | var object = {};
|
21417 | if (options.arrays || options.defaults)
|
21418 | object.uninterpretedOption = [];
|
21419 | if (options.defaults) {
|
21420 | object.messageSetWireFormat = false;
|
21421 | object.noStandardDescriptorAccessor = false;
|
21422 | object.deprecated = false;
|
21423 | object.mapEntry = false;
|
21424 | object[".google.api.resource"] = null;
|
21425 | }
|
21426 | if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat"))
|
21427 | object.messageSetWireFormat = message.messageSetWireFormat;
|
21428 | if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor"))
|
21429 | object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor;
|
21430 | if (message.deprecated != null && message.hasOwnProperty("deprecated"))
|
21431 | object.deprecated = message.deprecated;
|
21432 | if (message.mapEntry != null && message.hasOwnProperty("mapEntry"))
|
21433 | object.mapEntry = message.mapEntry;
|
21434 | if (message.uninterpretedOption && message.uninterpretedOption.length) {
|
21435 | object.uninterpretedOption = [];
|
21436 | for (var j = 0; j < message.uninterpretedOption.length; ++j)
|
21437 | object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options);
|
21438 | }
|
21439 | if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource"))
|
21440 | object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options);
|
21441 | return object;
|
21442 | };
|
21443 |
|
21444 | /**
|
21445 | * Converts this MessageOptions to JSON.
|
21446 | * @function toJSON
|
21447 | * @memberof google.protobuf.MessageOptions
|
21448 | * @instance
|
21449 | * @returns {Object.<string,*>} JSON object
|
21450 | */
|
21451 | MessageOptions.prototype.toJSON = function toJSON() {
|
21452 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
21453 | };
|
21454 |
|
21455 | return MessageOptions;
|
21456 | })();
|
21457 |
|
21458 | protobuf.FieldOptions = (function() {
|
21459 |
|
21460 | /**
|
21461 | * Properties of a FieldOptions.
|
21462 | * @memberof google.protobuf
|
21463 | * @interface IFieldOptions
|
21464 | * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype
|
21465 | * @property {boolean|null} [packed] FieldOptions packed
|
21466 | * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype
|
21467 | * @property {boolean|null} [lazy] FieldOptions lazy
|
21468 | * @property {boolean|null} [deprecated] FieldOptions deprecated
|
21469 | * @property {boolean|null} [weak] FieldOptions weak
|
21470 | * @property {Array.<google.protobuf.IUninterpretedOption>|null} [uninterpretedOption] FieldOptions uninterpretedOption
|
21471 | * @property {Array.<google.api.FieldBehavior>|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior
|
21472 | * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference
|
21473 | */
|
21474 |
|
21475 | /**
|
21476 | * Constructs a new FieldOptions.
|
21477 | * @memberof google.protobuf
|
21478 | * @classdesc Represents a FieldOptions.
|
21479 | * @implements IFieldOptions
|
21480 | * @constructor
|
21481 | * @param {google.protobuf.IFieldOptions=} [properties] Properties to set
|
21482 | */
|
21483 | function FieldOptions(properties) {
|
21484 | this.uninterpretedOption = [];
|
21485 | this[".google.api.fieldBehavior"] = [];
|
21486 | if (properties)
|
21487 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
21488 | if (properties[keys[i]] != null)
|
21489 | this[keys[i]] = properties[keys[i]];
|
21490 | }
|
21491 |
|
21492 | /**
|
21493 | * FieldOptions ctype.
|
21494 | * @member {google.protobuf.FieldOptions.CType} ctype
|
21495 | * @memberof google.protobuf.FieldOptions
|
21496 | * @instance
|
21497 | */
|
21498 | FieldOptions.prototype.ctype = 0;
|
21499 |
|
21500 | /**
|
21501 | * FieldOptions packed.
|
21502 | * @member {boolean} packed
|
21503 | * @memberof google.protobuf.FieldOptions
|
21504 | * @instance
|
21505 | */
|
21506 | FieldOptions.prototype.packed = false;
|
21507 |
|
21508 | /**
|
21509 | * FieldOptions jstype.
|
21510 | * @member {google.protobuf.FieldOptions.JSType} jstype
|
21511 | * @memberof google.protobuf.FieldOptions
|
21512 | * @instance
|
21513 | */
|
21514 | FieldOptions.prototype.jstype = 0;
|
21515 |
|
21516 | /**
|
21517 | * FieldOptions lazy.
|
21518 | * @member {boolean} lazy
|
21519 | * @memberof google.protobuf.FieldOptions
|
21520 | * @instance
|
21521 | */
|
21522 | FieldOptions.prototype.lazy = false;
|
21523 |
|
21524 | /**
|
21525 | * FieldOptions deprecated.
|
21526 | * @member {boolean} deprecated
|
21527 | * @memberof google.protobuf.FieldOptions
|
21528 | * @instance
|
21529 | */
|
21530 | FieldOptions.prototype.deprecated = false;
|
21531 |
|
21532 | /**
|
21533 | * FieldOptions weak.
|
21534 | * @member {boolean} weak
|
21535 | * @memberof google.protobuf.FieldOptions
|
21536 | * @instance
|
21537 | */
|
21538 | FieldOptions.prototype.weak = false;
|
21539 |
|
21540 | /**
|
21541 | * FieldOptions uninterpretedOption.
|
21542 | * @member {Array.<google.protobuf.IUninterpretedOption>} uninterpretedOption
|
21543 | * @memberof google.protobuf.FieldOptions
|
21544 | * @instance
|
21545 | */
|
21546 | FieldOptions.prototype.uninterpretedOption = $util.emptyArray;
|
21547 |
|
21548 | /**
|
21549 | * FieldOptions .google.api.fieldBehavior.
|
21550 | * @member {Array.<google.api.FieldBehavior>} .google.api.fieldBehavior
|
21551 | * @memberof google.protobuf.FieldOptions
|
21552 | * @instance
|
21553 | */
|
21554 | FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray;
|
21555 |
|
21556 | /**
|
21557 | * FieldOptions .google.api.resourceReference.
|
21558 | * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference
|
21559 | * @memberof google.protobuf.FieldOptions
|
21560 | * @instance
|
21561 | */
|
21562 | FieldOptions.prototype[".google.api.resourceReference"] = null;
|
21563 |
|
21564 | /**
|
21565 | * Creates a new FieldOptions instance using the specified properties.
|
21566 | * @function create
|
21567 | * @memberof google.protobuf.FieldOptions
|
21568 | * @static
|
21569 | * @param {google.protobuf.IFieldOptions=} [properties] Properties to set
|
21570 | * @returns {google.protobuf.FieldOptions} FieldOptions instance
|
21571 | */
|
21572 | FieldOptions.create = function create(properties) {
|
21573 | return new FieldOptions(properties);
|
21574 | };
|
21575 |
|
21576 | /**
|
21577 | * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages.
|
21578 | * @function encode
|
21579 | * @memberof google.protobuf.FieldOptions
|
21580 | * @static
|
21581 | * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode
|
21582 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
21583 | * @returns {$protobuf.Writer} Writer
|
21584 | */
|
21585 | FieldOptions.encode = function encode(message, writer) {
|
21586 | if (!writer)
|
21587 | writer = $Writer.create();
|
21588 | if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype"))
|
21589 | writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype);
|
21590 | if (message.packed != null && Object.hasOwnProperty.call(message, "packed"))
|
21591 | writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed);
|
21592 | if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated"))
|
21593 | writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated);
|
21594 | if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy"))
|
21595 | writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy);
|
21596 | if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype"))
|
21597 | writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype);
|
21598 | if (message.weak != null && Object.hasOwnProperty.call(message, "weak"))
|
21599 | writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak);
|
21600 | if (message.uninterpretedOption != null && message.uninterpretedOption.length)
|
21601 | for (var i = 0; i < message.uninterpretedOption.length; ++i)
|
21602 | $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim();
|
21603 | if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) {
|
21604 | writer.uint32(/* id 1052, wireType 2 =*/8418).fork();
|
21605 | for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i)
|
21606 | writer.int32(message[".google.api.fieldBehavior"][i]);
|
21607 | writer.ldelim();
|
21608 | }
|
21609 | if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference"))
|
21610 | $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim();
|
21611 | return writer;
|
21612 | };
|
21613 |
|
21614 | /**
|
21615 | * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages.
|
21616 | * @function encodeDelimited
|
21617 | * @memberof google.protobuf.FieldOptions
|
21618 | * @static
|
21619 | * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode
|
21620 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
21621 | * @returns {$protobuf.Writer} Writer
|
21622 | */
|
21623 | FieldOptions.encodeDelimited = function encodeDelimited(message, writer) {
|
21624 | return this.encode(message, writer).ldelim();
|
21625 | };
|
21626 |
|
21627 | /**
|
21628 | * Decodes a FieldOptions message from the specified reader or buffer.
|
21629 | * @function decode
|
21630 | * @memberof google.protobuf.FieldOptions
|
21631 | * @static
|
21632 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
21633 | * @param {number} [length] Message length if known beforehand
|
21634 | * @returns {google.protobuf.FieldOptions} FieldOptions
|
21635 | * @throws {Error} If the payload is not a reader or valid buffer
|
21636 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
21637 | */
|
21638 | FieldOptions.decode = function decode(reader, length) {
|
21639 | if (!(reader instanceof $Reader))
|
21640 | reader = $Reader.create(reader);
|
21641 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions();
|
21642 | while (reader.pos < end) {
|
21643 | var tag = reader.uint32();
|
21644 | switch (tag >>> 3) {
|
21645 | case 1:
|
21646 | message.ctype = reader.int32();
|
21647 | break;
|
21648 | case 2:
|
21649 | message.packed = reader.bool();
|
21650 | break;
|
21651 | case 6:
|
21652 | message.jstype = reader.int32();
|
21653 | break;
|
21654 | case 5:
|
21655 | message.lazy = reader.bool();
|
21656 | break;
|
21657 | case 3:
|
21658 | message.deprecated = reader.bool();
|
21659 | break;
|
21660 | case 10:
|
21661 | message.weak = reader.bool();
|
21662 | break;
|
21663 | case 999:
|
21664 | if (!(message.uninterpretedOption && message.uninterpretedOption.length))
|
21665 | message.uninterpretedOption = [];
|
21666 | message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32()));
|
21667 | break;
|
21668 | case 1052:
|
21669 | if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length))
|
21670 | message[".google.api.fieldBehavior"] = [];
|
21671 | if ((tag & 7) === 2) {
|
21672 | var end2 = reader.uint32() + reader.pos;
|
21673 | while (reader.pos < end2)
|
21674 | message[".google.api.fieldBehavior"].push(reader.int32());
|
21675 | } else
|
21676 | message[".google.api.fieldBehavior"].push(reader.int32());
|
21677 | break;
|
21678 | case 1055:
|
21679 | message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32());
|
21680 | break;
|
21681 | default:
|
21682 | reader.skipType(tag & 7);
|
21683 | break;
|
21684 | }
|
21685 | }
|
21686 | return message;
|
21687 | };
|
21688 |
|
21689 | /**
|
21690 | * Decodes a FieldOptions message from the specified reader or buffer, length delimited.
|
21691 | * @function decodeDelimited
|
21692 | * @memberof google.protobuf.FieldOptions
|
21693 | * @static
|
21694 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
21695 | * @returns {google.protobuf.FieldOptions} FieldOptions
|
21696 | * @throws {Error} If the payload is not a reader or valid buffer
|
21697 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
21698 | */
|
21699 | FieldOptions.decodeDelimited = function decodeDelimited(reader) {
|
21700 | if (!(reader instanceof $Reader))
|
21701 | reader = new $Reader(reader);
|
21702 | return this.decode(reader, reader.uint32());
|
21703 | };
|
21704 |
|
21705 | /**
|
21706 | * Verifies a FieldOptions message.
|
21707 | * @function verify
|
21708 | * @memberof google.protobuf.FieldOptions
|
21709 | * @static
|
21710 | * @param {Object.<string,*>} message Plain object to verify
|
21711 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
21712 | */
|
21713 | FieldOptions.verify = function verify(message) {
|
21714 | if (typeof message !== "object" || message === null)
|
21715 | return "object expected";
|
21716 | if (message.ctype != null && message.hasOwnProperty("ctype"))
|
21717 | switch (message.ctype) {
|
21718 | default:
|
21719 | return "ctype: enum value expected";
|
21720 | case 0:
|
21721 | case 1:
|
21722 | case 2:
|
21723 | break;
|
21724 | }
|
21725 | if (message.packed != null && message.hasOwnProperty("packed"))
|
21726 | if (typeof message.packed !== "boolean")
|
21727 | return "packed: boolean expected";
|
21728 | if (message.jstype != null && message.hasOwnProperty("jstype"))
|
21729 | switch (message.jstype) {
|
21730 | default:
|
21731 | return "jstype: enum value expected";
|
21732 | case 0:
|
21733 | case 1:
|
21734 | case 2:
|
21735 | break;
|
21736 | }
|
21737 | if (message.lazy != null && message.hasOwnProperty("lazy"))
|
21738 | if (typeof message.lazy !== "boolean")
|
21739 | return "lazy: boolean expected";
|
21740 | if (message.deprecated != null && message.hasOwnProperty("deprecated"))
|
21741 | if (typeof message.deprecated !== "boolean")
|
21742 | return "deprecated: boolean expected";
|
21743 | if (message.weak != null && message.hasOwnProperty("weak"))
|
21744 | if (typeof message.weak !== "boolean")
|
21745 | return "weak: boolean expected";
|
21746 | if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) {
|
21747 | if (!Array.isArray(message.uninterpretedOption))
|
21748 | return "uninterpretedOption: array expected";
|
21749 | for (var i = 0; i < message.uninterpretedOption.length; ++i) {
|
21750 | var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]);
|
21751 | if (error)
|
21752 | return "uninterpretedOption." + error;
|
21753 | }
|
21754 | }
|
21755 | if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) {
|
21756 | if (!Array.isArray(message[".google.api.fieldBehavior"]))
|
21757 | return ".google.api.fieldBehavior: array expected";
|
21758 | for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i)
|
21759 | switch (message[".google.api.fieldBehavior"][i]) {
|
21760 | default:
|
21761 | return ".google.api.fieldBehavior: enum value[] expected";
|
21762 | case 0:
|
21763 | case 1:
|
21764 | case 2:
|
21765 | case 3:
|
21766 | case 4:
|
21767 | case 5:
|
21768 | case 6:
|
21769 | break;
|
21770 | }
|
21771 | }
|
21772 | if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) {
|
21773 | var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]);
|
21774 | if (error)
|
21775 | return ".google.api.resourceReference." + error;
|
21776 | }
|
21777 | return null;
|
21778 | };
|
21779 |
|
21780 | /**
|
21781 | * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types.
|
21782 | * @function fromObject
|
21783 | * @memberof google.protobuf.FieldOptions
|
21784 | * @static
|
21785 | * @param {Object.<string,*>} object Plain object
|
21786 | * @returns {google.protobuf.FieldOptions} FieldOptions
|
21787 | */
|
21788 | FieldOptions.fromObject = function fromObject(object) {
|
21789 | if (object instanceof $root.google.protobuf.FieldOptions)
|
21790 | return object;
|
21791 | var message = new $root.google.protobuf.FieldOptions();
|
21792 | switch (object.ctype) {
|
21793 | case "STRING":
|
21794 | case 0:
|
21795 | message.ctype = 0;
|
21796 | break;
|
21797 | case "CORD":
|
21798 | case 1:
|
21799 | message.ctype = 1;
|
21800 | break;
|
21801 | case "STRING_PIECE":
|
21802 | case 2:
|
21803 | message.ctype = 2;
|
21804 | break;
|
21805 | }
|
21806 | if (object.packed != null)
|
21807 | message.packed = Boolean(object.packed);
|
21808 | switch (object.jstype) {
|
21809 | case "JS_NORMAL":
|
21810 | case 0:
|
21811 | message.jstype = 0;
|
21812 | break;
|
21813 | case "JS_STRING":
|
21814 | case 1:
|
21815 | message.jstype = 1;
|
21816 | break;
|
21817 | case "JS_NUMBER":
|
21818 | case 2:
|
21819 | message.jstype = 2;
|
21820 | break;
|
21821 | }
|
21822 | if (object.lazy != null)
|
21823 | message.lazy = Boolean(object.lazy);
|
21824 | if (object.deprecated != null)
|
21825 | message.deprecated = Boolean(object.deprecated);
|
21826 | if (object.weak != null)
|
21827 | message.weak = Boolean(object.weak);
|
21828 | if (object.uninterpretedOption) {
|
21829 | if (!Array.isArray(object.uninterpretedOption))
|
21830 | throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected");
|
21831 | message.uninterpretedOption = [];
|
21832 | for (var i = 0; i < object.uninterpretedOption.length; ++i) {
|
21833 | if (typeof object.uninterpretedOption[i] !== "object")
|
21834 | throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected");
|
21835 | message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]);
|
21836 | }
|
21837 | }
|
21838 | if (object[".google.api.fieldBehavior"]) {
|
21839 | if (!Array.isArray(object[".google.api.fieldBehavior"]))
|
21840 | throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected");
|
21841 | message[".google.api.fieldBehavior"] = [];
|
21842 | for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i)
|
21843 | switch (object[".google.api.fieldBehavior"][i]) {
|
21844 | default:
|
21845 | case "FIELD_BEHAVIOR_UNSPECIFIED":
|
21846 | case 0:
|
21847 | message[".google.api.fieldBehavior"][i] = 0;
|
21848 | break;
|
21849 | case "OPTIONAL":
|
21850 | case 1:
|
21851 | message[".google.api.fieldBehavior"][i] = 1;
|
21852 | break;
|
21853 | case "REQUIRED":
|
21854 | case 2:
|
21855 | message[".google.api.fieldBehavior"][i] = 2;
|
21856 | break;
|
21857 | case "OUTPUT_ONLY":
|
21858 | case 3:
|
21859 | message[".google.api.fieldBehavior"][i] = 3;
|
21860 | break;
|
21861 | case "INPUT_ONLY":
|
21862 | case 4:
|
21863 | message[".google.api.fieldBehavior"][i] = 4;
|
21864 | break;
|
21865 | case "IMMUTABLE":
|
21866 | case 5:
|
21867 | message[".google.api.fieldBehavior"][i] = 5;
|
21868 | break;
|
21869 | case "UNORDERED_LIST":
|
21870 | case 6:
|
21871 | message[".google.api.fieldBehavior"][i] = 6;
|
21872 | break;
|
21873 | }
|
21874 | }
|
21875 | if (object[".google.api.resourceReference"] != null) {
|
21876 | if (typeof object[".google.api.resourceReference"] !== "object")
|
21877 | throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected");
|
21878 | message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]);
|
21879 | }
|
21880 | return message;
|
21881 | };
|
21882 |
|
21883 | /**
|
21884 | * Creates a plain object from a FieldOptions message. Also converts values to other types if specified.
|
21885 | * @function toObject
|
21886 | * @memberof google.protobuf.FieldOptions
|
21887 | * @static
|
21888 | * @param {google.protobuf.FieldOptions} message FieldOptions
|
21889 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
21890 | * @returns {Object.<string,*>} Plain object
|
21891 | */
|
21892 | FieldOptions.toObject = function toObject(message, options) {
|
21893 | if (!options)
|
21894 | options = {};
|
21895 | var object = {};
|
21896 | if (options.arrays || options.defaults) {
|
21897 | object.uninterpretedOption = [];
|
21898 | object[".google.api.fieldBehavior"] = [];
|
21899 | }
|
21900 | if (options.defaults) {
|
21901 | object.ctype = options.enums === String ? "STRING" : 0;
|
21902 | object.packed = false;
|
21903 | object.deprecated = false;
|
21904 | object.lazy = false;
|
21905 | object.jstype = options.enums === String ? "JS_NORMAL" : 0;
|
21906 | object.weak = false;
|
21907 | object[".google.api.resourceReference"] = null;
|
21908 | }
|
21909 | if (message.ctype != null && message.hasOwnProperty("ctype"))
|
21910 | object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype;
|
21911 | if (message.packed != null && message.hasOwnProperty("packed"))
|
21912 | object.packed = message.packed;
|
21913 | if (message.deprecated != null && message.hasOwnProperty("deprecated"))
|
21914 | object.deprecated = message.deprecated;
|
21915 | if (message.lazy != null && message.hasOwnProperty("lazy"))
|
21916 | object.lazy = message.lazy;
|
21917 | if (message.jstype != null && message.hasOwnProperty("jstype"))
|
21918 | object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype;
|
21919 | if (message.weak != null && message.hasOwnProperty("weak"))
|
21920 | object.weak = message.weak;
|
21921 | if (message.uninterpretedOption && message.uninterpretedOption.length) {
|
21922 | object.uninterpretedOption = [];
|
21923 | for (var j = 0; j < message.uninterpretedOption.length; ++j)
|
21924 | object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options);
|
21925 | }
|
21926 | if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) {
|
21927 | object[".google.api.fieldBehavior"] = [];
|
21928 | for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j)
|
21929 | object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j];
|
21930 | }
|
21931 | if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference"))
|
21932 | object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options);
|
21933 | return object;
|
21934 | };
|
21935 |
|
21936 | /**
|
21937 | * Converts this FieldOptions to JSON.
|
21938 | * @function toJSON
|
21939 | * @memberof google.protobuf.FieldOptions
|
21940 | * @instance
|
21941 | * @returns {Object.<string,*>} JSON object
|
21942 | */
|
21943 | FieldOptions.prototype.toJSON = function toJSON() {
|
21944 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
21945 | };
|
21946 |
|
21947 | /**
|
21948 | * CType enum.
|
21949 | * @name google.protobuf.FieldOptions.CType
|
21950 | * @enum {number}
|
21951 | * @property {number} STRING=0 STRING value
|
21952 | * @property {number} CORD=1 CORD value
|
21953 | * @property {number} STRING_PIECE=2 STRING_PIECE value
|
21954 | */
|
21955 | FieldOptions.CType = (function() {
|
21956 | var valuesById = {}, values = Object.create(valuesById);
|
21957 | values[valuesById[0] = "STRING"] = 0;
|
21958 | values[valuesById[1] = "CORD"] = 1;
|
21959 | values[valuesById[2] = "STRING_PIECE"] = 2;
|
21960 | return values;
|
21961 | })();
|
21962 |
|
21963 | /**
|
21964 | * JSType enum.
|
21965 | * @name google.protobuf.FieldOptions.JSType
|
21966 | * @enum {number}
|
21967 | * @property {number} JS_NORMAL=0 JS_NORMAL value
|
21968 | * @property {number} JS_STRING=1 JS_STRING value
|
21969 | * @property {number} JS_NUMBER=2 JS_NUMBER value
|
21970 | */
|
21971 | FieldOptions.JSType = (function() {
|
21972 | var valuesById = {}, values = Object.create(valuesById);
|
21973 | values[valuesById[0] = "JS_NORMAL"] = 0;
|
21974 | values[valuesById[1] = "JS_STRING"] = 1;
|
21975 | values[valuesById[2] = "JS_NUMBER"] = 2;
|
21976 | return values;
|
21977 | })();
|
21978 |
|
21979 | return FieldOptions;
|
21980 | })();
|
21981 |
|
21982 | protobuf.OneofOptions = (function() {
|
21983 |
|
21984 | /**
|
21985 | * Properties of an OneofOptions.
|
21986 | * @memberof google.protobuf
|
21987 | * @interface IOneofOptions
|
21988 | * @property {Array.<google.protobuf.IUninterpretedOption>|null} [uninterpretedOption] OneofOptions uninterpretedOption
|
21989 | */
|
21990 |
|
21991 | /**
|
21992 | * Constructs a new OneofOptions.
|
21993 | * @memberof google.protobuf
|
21994 | * @classdesc Represents an OneofOptions.
|
21995 | * @implements IOneofOptions
|
21996 | * @constructor
|
21997 | * @param {google.protobuf.IOneofOptions=} [properties] Properties to set
|
21998 | */
|
21999 | function OneofOptions(properties) {
|
22000 | this.uninterpretedOption = [];
|
22001 | if (properties)
|
22002 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
22003 | if (properties[keys[i]] != null)
|
22004 | this[keys[i]] = properties[keys[i]];
|
22005 | }
|
22006 |
|
22007 | /**
|
22008 | * OneofOptions uninterpretedOption.
|
22009 | * @member {Array.<google.protobuf.IUninterpretedOption>} uninterpretedOption
|
22010 | * @memberof google.protobuf.OneofOptions
|
22011 | * @instance
|
22012 | */
|
22013 | OneofOptions.prototype.uninterpretedOption = $util.emptyArray;
|
22014 |
|
22015 | /**
|
22016 | * Creates a new OneofOptions instance using the specified properties.
|
22017 | * @function create
|
22018 | * @memberof google.protobuf.OneofOptions
|
22019 | * @static
|
22020 | * @param {google.protobuf.IOneofOptions=} [properties] Properties to set
|
22021 | * @returns {google.protobuf.OneofOptions} OneofOptions instance
|
22022 | */
|
22023 | OneofOptions.create = function create(properties) {
|
22024 | return new OneofOptions(properties);
|
22025 | };
|
22026 |
|
22027 | /**
|
22028 | * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages.
|
22029 | * @function encode
|
22030 | * @memberof google.protobuf.OneofOptions
|
22031 | * @static
|
22032 | * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode
|
22033 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
22034 | * @returns {$protobuf.Writer} Writer
|
22035 | */
|
22036 | OneofOptions.encode = function encode(message, writer) {
|
22037 | if (!writer)
|
22038 | writer = $Writer.create();
|
22039 | if (message.uninterpretedOption != null && message.uninterpretedOption.length)
|
22040 | for (var i = 0; i < message.uninterpretedOption.length; ++i)
|
22041 | $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim();
|
22042 | return writer;
|
22043 | };
|
22044 |
|
22045 | /**
|
22046 | * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages.
|
22047 | * @function encodeDelimited
|
22048 | * @memberof google.protobuf.OneofOptions
|
22049 | * @static
|
22050 | * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode
|
22051 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
22052 | * @returns {$protobuf.Writer} Writer
|
22053 | */
|
22054 | OneofOptions.encodeDelimited = function encodeDelimited(message, writer) {
|
22055 | return this.encode(message, writer).ldelim();
|
22056 | };
|
22057 |
|
22058 | /**
|
22059 | * Decodes an OneofOptions message from the specified reader or buffer.
|
22060 | * @function decode
|
22061 | * @memberof google.protobuf.OneofOptions
|
22062 | * @static
|
22063 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
22064 | * @param {number} [length] Message length if known beforehand
|
22065 | * @returns {google.protobuf.OneofOptions} OneofOptions
|
22066 | * @throws {Error} If the payload is not a reader or valid buffer
|
22067 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
22068 | */
|
22069 | OneofOptions.decode = function decode(reader, length) {
|
22070 | if (!(reader instanceof $Reader))
|
22071 | reader = $Reader.create(reader);
|
22072 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions();
|
22073 | while (reader.pos < end) {
|
22074 | var tag = reader.uint32();
|
22075 | switch (tag >>> 3) {
|
22076 | case 999:
|
22077 | if (!(message.uninterpretedOption && message.uninterpretedOption.length))
|
22078 | message.uninterpretedOption = [];
|
22079 | message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32()));
|
22080 | break;
|
22081 | default:
|
22082 | reader.skipType(tag & 7);
|
22083 | break;
|
22084 | }
|
22085 | }
|
22086 | return message;
|
22087 | };
|
22088 |
|
22089 | /**
|
22090 | * Decodes an OneofOptions message from the specified reader or buffer, length delimited.
|
22091 | * @function decodeDelimited
|
22092 | * @memberof google.protobuf.OneofOptions
|
22093 | * @static
|
22094 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
22095 | * @returns {google.protobuf.OneofOptions} OneofOptions
|
22096 | * @throws {Error} If the payload is not a reader or valid buffer
|
22097 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
22098 | */
|
22099 | OneofOptions.decodeDelimited = function decodeDelimited(reader) {
|
22100 | if (!(reader instanceof $Reader))
|
22101 | reader = new $Reader(reader);
|
22102 | return this.decode(reader, reader.uint32());
|
22103 | };
|
22104 |
|
22105 | /**
|
22106 | * Verifies an OneofOptions message.
|
22107 | * @function verify
|
22108 | * @memberof google.protobuf.OneofOptions
|
22109 | * @static
|
22110 | * @param {Object.<string,*>} message Plain object to verify
|
22111 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
22112 | */
|
22113 | OneofOptions.verify = function verify(message) {
|
22114 | if (typeof message !== "object" || message === null)
|
22115 | return "object expected";
|
22116 | if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) {
|
22117 | if (!Array.isArray(message.uninterpretedOption))
|
22118 | return "uninterpretedOption: array expected";
|
22119 | for (var i = 0; i < message.uninterpretedOption.length; ++i) {
|
22120 | var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]);
|
22121 | if (error)
|
22122 | return "uninterpretedOption." + error;
|
22123 | }
|
22124 | }
|
22125 | return null;
|
22126 | };
|
22127 |
|
22128 | /**
|
22129 | * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types.
|
22130 | * @function fromObject
|
22131 | * @memberof google.protobuf.OneofOptions
|
22132 | * @static
|
22133 | * @param {Object.<string,*>} object Plain object
|
22134 | * @returns {google.protobuf.OneofOptions} OneofOptions
|
22135 | */
|
22136 | OneofOptions.fromObject = function fromObject(object) {
|
22137 | if (object instanceof $root.google.protobuf.OneofOptions)
|
22138 | return object;
|
22139 | var message = new $root.google.protobuf.OneofOptions();
|
22140 | if (object.uninterpretedOption) {
|
22141 | if (!Array.isArray(object.uninterpretedOption))
|
22142 | throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected");
|
22143 | message.uninterpretedOption = [];
|
22144 | for (var i = 0; i < object.uninterpretedOption.length; ++i) {
|
22145 | if (typeof object.uninterpretedOption[i] !== "object")
|
22146 | throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected");
|
22147 | message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]);
|
22148 | }
|
22149 | }
|
22150 | return message;
|
22151 | };
|
22152 |
|
22153 | /**
|
22154 | * Creates a plain object from an OneofOptions message. Also converts values to other types if specified.
|
22155 | * @function toObject
|
22156 | * @memberof google.protobuf.OneofOptions
|
22157 | * @static
|
22158 | * @param {google.protobuf.OneofOptions} message OneofOptions
|
22159 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
22160 | * @returns {Object.<string,*>} Plain object
|
22161 | */
|
22162 | OneofOptions.toObject = function toObject(message, options) {
|
22163 | if (!options)
|
22164 | options = {};
|
22165 | var object = {};
|
22166 | if (options.arrays || options.defaults)
|
22167 | object.uninterpretedOption = [];
|
22168 | if (message.uninterpretedOption && message.uninterpretedOption.length) {
|
22169 | object.uninterpretedOption = [];
|
22170 | for (var j = 0; j < message.uninterpretedOption.length; ++j)
|
22171 | object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options);
|
22172 | }
|
22173 | return object;
|
22174 | };
|
22175 |
|
22176 | /**
|
22177 | * Converts this OneofOptions to JSON.
|
22178 | * @function toJSON
|
22179 | * @memberof google.protobuf.OneofOptions
|
22180 | * @instance
|
22181 | * @returns {Object.<string,*>} JSON object
|
22182 | */
|
22183 | OneofOptions.prototype.toJSON = function toJSON() {
|
22184 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
22185 | };
|
22186 |
|
22187 | return OneofOptions;
|
22188 | })();
|
22189 |
|
22190 | protobuf.EnumOptions = (function() {
|
22191 |
|
22192 | /**
|
22193 | * Properties of an EnumOptions.
|
22194 | * @memberof google.protobuf
|
22195 | * @interface IEnumOptions
|
22196 | * @property {boolean|null} [allowAlias] EnumOptions allowAlias
|
22197 | * @property {boolean|null} [deprecated] EnumOptions deprecated
|
22198 | * @property {Array.<google.protobuf.IUninterpretedOption>|null} [uninterpretedOption] EnumOptions uninterpretedOption
|
22199 | */
|
22200 |
|
22201 | /**
|
22202 | * Constructs a new EnumOptions.
|
22203 | * @memberof google.protobuf
|
22204 | * @classdesc Represents an EnumOptions.
|
22205 | * @implements IEnumOptions
|
22206 | * @constructor
|
22207 | * @param {google.protobuf.IEnumOptions=} [properties] Properties to set
|
22208 | */
|
22209 | function EnumOptions(properties) {
|
22210 | this.uninterpretedOption = [];
|
22211 | if (properties)
|
22212 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
22213 | if (properties[keys[i]] != null)
|
22214 | this[keys[i]] = properties[keys[i]];
|
22215 | }
|
22216 |
|
22217 | /**
|
22218 | * EnumOptions allowAlias.
|
22219 | * @member {boolean} allowAlias
|
22220 | * @memberof google.protobuf.EnumOptions
|
22221 | * @instance
|
22222 | */
|
22223 | EnumOptions.prototype.allowAlias = false;
|
22224 |
|
22225 | /**
|
22226 | * EnumOptions deprecated.
|
22227 | * @member {boolean} deprecated
|
22228 | * @memberof google.protobuf.EnumOptions
|
22229 | * @instance
|
22230 | */
|
22231 | EnumOptions.prototype.deprecated = false;
|
22232 |
|
22233 | /**
|
22234 | * EnumOptions uninterpretedOption.
|
22235 | * @member {Array.<google.protobuf.IUninterpretedOption>} uninterpretedOption
|
22236 | * @memberof google.protobuf.EnumOptions
|
22237 | * @instance
|
22238 | */
|
22239 | EnumOptions.prototype.uninterpretedOption = $util.emptyArray;
|
22240 |
|
22241 | /**
|
22242 | * Creates a new EnumOptions instance using the specified properties.
|
22243 | * @function create
|
22244 | * @memberof google.protobuf.EnumOptions
|
22245 | * @static
|
22246 | * @param {google.protobuf.IEnumOptions=} [properties] Properties to set
|
22247 | * @returns {google.protobuf.EnumOptions} EnumOptions instance
|
22248 | */
|
22249 | EnumOptions.create = function create(properties) {
|
22250 | return new EnumOptions(properties);
|
22251 | };
|
22252 |
|
22253 | /**
|
22254 | * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages.
|
22255 | * @function encode
|
22256 | * @memberof google.protobuf.EnumOptions
|
22257 | * @static
|
22258 | * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode
|
22259 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
22260 | * @returns {$protobuf.Writer} Writer
|
22261 | */
|
22262 | EnumOptions.encode = function encode(message, writer) {
|
22263 | if (!writer)
|
22264 | writer = $Writer.create();
|
22265 | if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias"))
|
22266 | writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias);
|
22267 | if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated"))
|
22268 | writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated);
|
22269 | if (message.uninterpretedOption != null && message.uninterpretedOption.length)
|
22270 | for (var i = 0; i < message.uninterpretedOption.length; ++i)
|
22271 | $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim();
|
22272 | return writer;
|
22273 | };
|
22274 |
|
22275 | /**
|
22276 | * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages.
|
22277 | * @function encodeDelimited
|
22278 | * @memberof google.protobuf.EnumOptions
|
22279 | * @static
|
22280 | * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode
|
22281 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
22282 | * @returns {$protobuf.Writer} Writer
|
22283 | */
|
22284 | EnumOptions.encodeDelimited = function encodeDelimited(message, writer) {
|
22285 | return this.encode(message, writer).ldelim();
|
22286 | };
|
22287 |
|
22288 | /**
|
22289 | * Decodes an EnumOptions message from the specified reader or buffer.
|
22290 | * @function decode
|
22291 | * @memberof google.protobuf.EnumOptions
|
22292 | * @static
|
22293 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
22294 | * @param {number} [length] Message length if known beforehand
|
22295 | * @returns {google.protobuf.EnumOptions} EnumOptions
|
22296 | * @throws {Error} If the payload is not a reader or valid buffer
|
22297 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
22298 | */
|
22299 | EnumOptions.decode = function decode(reader, length) {
|
22300 | if (!(reader instanceof $Reader))
|
22301 | reader = $Reader.create(reader);
|
22302 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions();
|
22303 | while (reader.pos < end) {
|
22304 | var tag = reader.uint32();
|
22305 | switch (tag >>> 3) {
|
22306 | case 2:
|
22307 | message.allowAlias = reader.bool();
|
22308 | break;
|
22309 | case 3:
|
22310 | message.deprecated = reader.bool();
|
22311 | break;
|
22312 | case 999:
|
22313 | if (!(message.uninterpretedOption && message.uninterpretedOption.length))
|
22314 | message.uninterpretedOption = [];
|
22315 | message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32()));
|
22316 | break;
|
22317 | default:
|
22318 | reader.skipType(tag & 7);
|
22319 | break;
|
22320 | }
|
22321 | }
|
22322 | return message;
|
22323 | };
|
22324 |
|
22325 | /**
|
22326 | * Decodes an EnumOptions message from the specified reader or buffer, length delimited.
|
22327 | * @function decodeDelimited
|
22328 | * @memberof google.protobuf.EnumOptions
|
22329 | * @static
|
22330 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
22331 | * @returns {google.protobuf.EnumOptions} EnumOptions
|
22332 | * @throws {Error} If the payload is not a reader or valid buffer
|
22333 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
22334 | */
|
22335 | EnumOptions.decodeDelimited = function decodeDelimited(reader) {
|
22336 | if (!(reader instanceof $Reader))
|
22337 | reader = new $Reader(reader);
|
22338 | return this.decode(reader, reader.uint32());
|
22339 | };
|
22340 |
|
22341 | /**
|
22342 | * Verifies an EnumOptions message.
|
22343 | * @function verify
|
22344 | * @memberof google.protobuf.EnumOptions
|
22345 | * @static
|
22346 | * @param {Object.<string,*>} message Plain object to verify
|
22347 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
22348 | */
|
22349 | EnumOptions.verify = function verify(message) {
|
22350 | if (typeof message !== "object" || message === null)
|
22351 | return "object expected";
|
22352 | if (message.allowAlias != null && message.hasOwnProperty("allowAlias"))
|
22353 | if (typeof message.allowAlias !== "boolean")
|
22354 | return "allowAlias: boolean expected";
|
22355 | if (message.deprecated != null && message.hasOwnProperty("deprecated"))
|
22356 | if (typeof message.deprecated !== "boolean")
|
22357 | return "deprecated: boolean expected";
|
22358 | if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) {
|
22359 | if (!Array.isArray(message.uninterpretedOption))
|
22360 | return "uninterpretedOption: array expected";
|
22361 | for (var i = 0; i < message.uninterpretedOption.length; ++i) {
|
22362 | var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]);
|
22363 | if (error)
|
22364 | return "uninterpretedOption." + error;
|
22365 | }
|
22366 | }
|
22367 | return null;
|
22368 | };
|
22369 |
|
22370 | /**
|
22371 | * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types.
|
22372 | * @function fromObject
|
22373 | * @memberof google.protobuf.EnumOptions
|
22374 | * @static
|
22375 | * @param {Object.<string,*>} object Plain object
|
22376 | * @returns {google.protobuf.EnumOptions} EnumOptions
|
22377 | */
|
22378 | EnumOptions.fromObject = function fromObject(object) {
|
22379 | if (object instanceof $root.google.protobuf.EnumOptions)
|
22380 | return object;
|
22381 | var message = new $root.google.protobuf.EnumOptions();
|
22382 | if (object.allowAlias != null)
|
22383 | message.allowAlias = Boolean(object.allowAlias);
|
22384 | if (object.deprecated != null)
|
22385 | message.deprecated = Boolean(object.deprecated);
|
22386 | if (object.uninterpretedOption) {
|
22387 | if (!Array.isArray(object.uninterpretedOption))
|
22388 | throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected");
|
22389 | message.uninterpretedOption = [];
|
22390 | for (var i = 0; i < object.uninterpretedOption.length; ++i) {
|
22391 | if (typeof object.uninterpretedOption[i] !== "object")
|
22392 | throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected");
|
22393 | message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]);
|
22394 | }
|
22395 | }
|
22396 | return message;
|
22397 | };
|
22398 |
|
22399 | /**
|
22400 | * Creates a plain object from an EnumOptions message. Also converts values to other types if specified.
|
22401 | * @function toObject
|
22402 | * @memberof google.protobuf.EnumOptions
|
22403 | * @static
|
22404 | * @param {google.protobuf.EnumOptions} message EnumOptions
|
22405 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
22406 | * @returns {Object.<string,*>} Plain object
|
22407 | */
|
22408 | EnumOptions.toObject = function toObject(message, options) {
|
22409 | if (!options)
|
22410 | options = {};
|
22411 | var object = {};
|
22412 | if (options.arrays || options.defaults)
|
22413 | object.uninterpretedOption = [];
|
22414 | if (options.defaults) {
|
22415 | object.allowAlias = false;
|
22416 | object.deprecated = false;
|
22417 | }
|
22418 | if (message.allowAlias != null && message.hasOwnProperty("allowAlias"))
|
22419 | object.allowAlias = message.allowAlias;
|
22420 | if (message.deprecated != null && message.hasOwnProperty("deprecated"))
|
22421 | object.deprecated = message.deprecated;
|
22422 | if (message.uninterpretedOption && message.uninterpretedOption.length) {
|
22423 | object.uninterpretedOption = [];
|
22424 | for (var j = 0; j < message.uninterpretedOption.length; ++j)
|
22425 | object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options);
|
22426 | }
|
22427 | return object;
|
22428 | };
|
22429 |
|
22430 | /**
|
22431 | * Converts this EnumOptions to JSON.
|
22432 | * @function toJSON
|
22433 | * @memberof google.protobuf.EnumOptions
|
22434 | * @instance
|
22435 | * @returns {Object.<string,*>} JSON object
|
22436 | */
|
22437 | EnumOptions.prototype.toJSON = function toJSON() {
|
22438 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
22439 | };
|
22440 |
|
22441 | return EnumOptions;
|
22442 | })();
|
22443 |
|
22444 | protobuf.EnumValueOptions = (function() {
|
22445 |
|
22446 | /**
|
22447 | * Properties of an EnumValueOptions.
|
22448 | * @memberof google.protobuf
|
22449 | * @interface IEnumValueOptions
|
22450 | * @property {boolean|null} [deprecated] EnumValueOptions deprecated
|
22451 | * @property {Array.<google.protobuf.IUninterpretedOption>|null} [uninterpretedOption] EnumValueOptions uninterpretedOption
|
22452 | */
|
22453 |
|
22454 | /**
|
22455 | * Constructs a new EnumValueOptions.
|
22456 | * @memberof google.protobuf
|
22457 | * @classdesc Represents an EnumValueOptions.
|
22458 | * @implements IEnumValueOptions
|
22459 | * @constructor
|
22460 | * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set
|
22461 | */
|
22462 | function EnumValueOptions(properties) {
|
22463 | this.uninterpretedOption = [];
|
22464 | if (properties)
|
22465 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
22466 | if (properties[keys[i]] != null)
|
22467 | this[keys[i]] = properties[keys[i]];
|
22468 | }
|
22469 |
|
22470 | /**
|
22471 | * EnumValueOptions deprecated.
|
22472 | * @member {boolean} deprecated
|
22473 | * @memberof google.protobuf.EnumValueOptions
|
22474 | * @instance
|
22475 | */
|
22476 | EnumValueOptions.prototype.deprecated = false;
|
22477 |
|
22478 | /**
|
22479 | * EnumValueOptions uninterpretedOption.
|
22480 | * @member {Array.<google.protobuf.IUninterpretedOption>} uninterpretedOption
|
22481 | * @memberof google.protobuf.EnumValueOptions
|
22482 | * @instance
|
22483 | */
|
22484 | EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray;
|
22485 |
|
22486 | /**
|
22487 | * Creates a new EnumValueOptions instance using the specified properties.
|
22488 | * @function create
|
22489 | * @memberof google.protobuf.EnumValueOptions
|
22490 | * @static
|
22491 | * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set
|
22492 | * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance
|
22493 | */
|
22494 | EnumValueOptions.create = function create(properties) {
|
22495 | return new EnumValueOptions(properties);
|
22496 | };
|
22497 |
|
22498 | /**
|
22499 | * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages.
|
22500 | * @function encode
|
22501 | * @memberof google.protobuf.EnumValueOptions
|
22502 | * @static
|
22503 | * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode
|
22504 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
22505 | * @returns {$protobuf.Writer} Writer
|
22506 | */
|
22507 | EnumValueOptions.encode = function encode(message, writer) {
|
22508 | if (!writer)
|
22509 | writer = $Writer.create();
|
22510 | if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated"))
|
22511 | writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated);
|
22512 | if (message.uninterpretedOption != null && message.uninterpretedOption.length)
|
22513 | for (var i = 0; i < message.uninterpretedOption.length; ++i)
|
22514 | $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim();
|
22515 | return writer;
|
22516 | };
|
22517 |
|
22518 | /**
|
22519 | * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages.
|
22520 | * @function encodeDelimited
|
22521 | * @memberof google.protobuf.EnumValueOptions
|
22522 | * @static
|
22523 | * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode
|
22524 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
22525 | * @returns {$protobuf.Writer} Writer
|
22526 | */
|
22527 | EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) {
|
22528 | return this.encode(message, writer).ldelim();
|
22529 | };
|
22530 |
|
22531 | /**
|
22532 | * Decodes an EnumValueOptions message from the specified reader or buffer.
|
22533 | * @function decode
|
22534 | * @memberof google.protobuf.EnumValueOptions
|
22535 | * @static
|
22536 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
22537 | * @param {number} [length] Message length if known beforehand
|
22538 | * @returns {google.protobuf.EnumValueOptions} EnumValueOptions
|
22539 | * @throws {Error} If the payload is not a reader or valid buffer
|
22540 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
22541 | */
|
22542 | EnumValueOptions.decode = function decode(reader, length) {
|
22543 | if (!(reader instanceof $Reader))
|
22544 | reader = $Reader.create(reader);
|
22545 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions();
|
22546 | while (reader.pos < end) {
|
22547 | var tag = reader.uint32();
|
22548 | switch (tag >>> 3) {
|
22549 | case 1:
|
22550 | message.deprecated = reader.bool();
|
22551 | break;
|
22552 | case 999:
|
22553 | if (!(message.uninterpretedOption && message.uninterpretedOption.length))
|
22554 | message.uninterpretedOption = [];
|
22555 | message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32()));
|
22556 | break;
|
22557 | default:
|
22558 | reader.skipType(tag & 7);
|
22559 | break;
|
22560 | }
|
22561 | }
|
22562 | return message;
|
22563 | };
|
22564 |
|
22565 | /**
|
22566 | * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited.
|
22567 | * @function decodeDelimited
|
22568 | * @memberof google.protobuf.EnumValueOptions
|
22569 | * @static
|
22570 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
22571 | * @returns {google.protobuf.EnumValueOptions} EnumValueOptions
|
22572 | * @throws {Error} If the payload is not a reader or valid buffer
|
22573 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
22574 | */
|
22575 | EnumValueOptions.decodeDelimited = function decodeDelimited(reader) {
|
22576 | if (!(reader instanceof $Reader))
|
22577 | reader = new $Reader(reader);
|
22578 | return this.decode(reader, reader.uint32());
|
22579 | };
|
22580 |
|
22581 | /**
|
22582 | * Verifies an EnumValueOptions message.
|
22583 | * @function verify
|
22584 | * @memberof google.protobuf.EnumValueOptions
|
22585 | * @static
|
22586 | * @param {Object.<string,*>} message Plain object to verify
|
22587 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
22588 | */
|
22589 | EnumValueOptions.verify = function verify(message) {
|
22590 | if (typeof message !== "object" || message === null)
|
22591 | return "object expected";
|
22592 | if (message.deprecated != null && message.hasOwnProperty("deprecated"))
|
22593 | if (typeof message.deprecated !== "boolean")
|
22594 | return "deprecated: boolean expected";
|
22595 | if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) {
|
22596 | if (!Array.isArray(message.uninterpretedOption))
|
22597 | return "uninterpretedOption: array expected";
|
22598 | for (var i = 0; i < message.uninterpretedOption.length; ++i) {
|
22599 | var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]);
|
22600 | if (error)
|
22601 | return "uninterpretedOption." + error;
|
22602 | }
|
22603 | }
|
22604 | return null;
|
22605 | };
|
22606 |
|
22607 | /**
|
22608 | * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types.
|
22609 | * @function fromObject
|
22610 | * @memberof google.protobuf.EnumValueOptions
|
22611 | * @static
|
22612 | * @param {Object.<string,*>} object Plain object
|
22613 | * @returns {google.protobuf.EnumValueOptions} EnumValueOptions
|
22614 | */
|
22615 | EnumValueOptions.fromObject = function fromObject(object) {
|
22616 | if (object instanceof $root.google.protobuf.EnumValueOptions)
|
22617 | return object;
|
22618 | var message = new $root.google.protobuf.EnumValueOptions();
|
22619 | if (object.deprecated != null)
|
22620 | message.deprecated = Boolean(object.deprecated);
|
22621 | if (object.uninterpretedOption) {
|
22622 | if (!Array.isArray(object.uninterpretedOption))
|
22623 | throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected");
|
22624 | message.uninterpretedOption = [];
|
22625 | for (var i = 0; i < object.uninterpretedOption.length; ++i) {
|
22626 | if (typeof object.uninterpretedOption[i] !== "object")
|
22627 | throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected");
|
22628 | message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]);
|
22629 | }
|
22630 | }
|
22631 | return message;
|
22632 | };
|
22633 |
|
22634 | /**
|
22635 | * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified.
|
22636 | * @function toObject
|
22637 | * @memberof google.protobuf.EnumValueOptions
|
22638 | * @static
|
22639 | * @param {google.protobuf.EnumValueOptions} message EnumValueOptions
|
22640 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
22641 | * @returns {Object.<string,*>} Plain object
|
22642 | */
|
22643 | EnumValueOptions.toObject = function toObject(message, options) {
|
22644 | if (!options)
|
22645 | options = {};
|
22646 | var object = {};
|
22647 | if (options.arrays || options.defaults)
|
22648 | object.uninterpretedOption = [];
|
22649 | if (options.defaults)
|
22650 | object.deprecated = false;
|
22651 | if (message.deprecated != null && message.hasOwnProperty("deprecated"))
|
22652 | object.deprecated = message.deprecated;
|
22653 | if (message.uninterpretedOption && message.uninterpretedOption.length) {
|
22654 | object.uninterpretedOption = [];
|
22655 | for (var j = 0; j < message.uninterpretedOption.length; ++j)
|
22656 | object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options);
|
22657 | }
|
22658 | return object;
|
22659 | };
|
22660 |
|
22661 | /**
|
22662 | * Converts this EnumValueOptions to JSON.
|
22663 | * @function toJSON
|
22664 | * @memberof google.protobuf.EnumValueOptions
|
22665 | * @instance
|
22666 | * @returns {Object.<string,*>} JSON object
|
22667 | */
|
22668 | EnumValueOptions.prototype.toJSON = function toJSON() {
|
22669 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
22670 | };
|
22671 |
|
22672 | return EnumValueOptions;
|
22673 | })();
|
22674 |
|
22675 | protobuf.ServiceOptions = (function() {
|
22676 |
|
22677 | /**
|
22678 | * Properties of a ServiceOptions.
|
22679 | * @memberof google.protobuf
|
22680 | * @interface IServiceOptions
|
22681 | * @property {boolean|null} [deprecated] ServiceOptions deprecated
|
22682 | * @property {Array.<google.protobuf.IUninterpretedOption>|null} [uninterpretedOption] ServiceOptions uninterpretedOption
|
22683 | * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost
|
22684 | * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes
|
22685 | */
|
22686 |
|
22687 | /**
|
22688 | * Constructs a new ServiceOptions.
|
22689 | * @memberof google.protobuf
|
22690 | * @classdesc Represents a ServiceOptions.
|
22691 | * @implements IServiceOptions
|
22692 | * @constructor
|
22693 | * @param {google.protobuf.IServiceOptions=} [properties] Properties to set
|
22694 | */
|
22695 | function ServiceOptions(properties) {
|
22696 | this.uninterpretedOption = [];
|
22697 | if (properties)
|
22698 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
22699 | if (properties[keys[i]] != null)
|
22700 | this[keys[i]] = properties[keys[i]];
|
22701 | }
|
22702 |
|
22703 | /**
|
22704 | * ServiceOptions deprecated.
|
22705 | * @member {boolean} deprecated
|
22706 | * @memberof google.protobuf.ServiceOptions
|
22707 | * @instance
|
22708 | */
|
22709 | ServiceOptions.prototype.deprecated = false;
|
22710 |
|
22711 | /**
|
22712 | * ServiceOptions uninterpretedOption.
|
22713 | * @member {Array.<google.protobuf.IUninterpretedOption>} uninterpretedOption
|
22714 | * @memberof google.protobuf.ServiceOptions
|
22715 | * @instance
|
22716 | */
|
22717 | ServiceOptions.prototype.uninterpretedOption = $util.emptyArray;
|
22718 |
|
22719 | /**
|
22720 | * ServiceOptions .google.api.defaultHost.
|
22721 | * @member {string} .google.api.defaultHost
|
22722 | * @memberof google.protobuf.ServiceOptions
|
22723 | * @instance
|
22724 | */
|
22725 | ServiceOptions.prototype[".google.api.defaultHost"] = "";
|
22726 |
|
22727 | /**
|
22728 | * ServiceOptions .google.api.oauthScopes.
|
22729 | * @member {string} .google.api.oauthScopes
|
22730 | * @memberof google.protobuf.ServiceOptions
|
22731 | * @instance
|
22732 | */
|
22733 | ServiceOptions.prototype[".google.api.oauthScopes"] = "";
|
22734 |
|
22735 | /**
|
22736 | * Creates a new ServiceOptions instance using the specified properties.
|
22737 | * @function create
|
22738 | * @memberof google.protobuf.ServiceOptions
|
22739 | * @static
|
22740 | * @param {google.protobuf.IServiceOptions=} [properties] Properties to set
|
22741 | * @returns {google.protobuf.ServiceOptions} ServiceOptions instance
|
22742 | */
|
22743 | ServiceOptions.create = function create(properties) {
|
22744 | return new ServiceOptions(properties);
|
22745 | };
|
22746 |
|
22747 | /**
|
22748 | * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages.
|
22749 | * @function encode
|
22750 | * @memberof google.protobuf.ServiceOptions
|
22751 | * @static
|
22752 | * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode
|
22753 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
22754 | * @returns {$protobuf.Writer} Writer
|
22755 | */
|
22756 | ServiceOptions.encode = function encode(message, writer) {
|
22757 | if (!writer)
|
22758 | writer = $Writer.create();
|
22759 | if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated"))
|
22760 | writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated);
|
22761 | if (message.uninterpretedOption != null && message.uninterpretedOption.length)
|
22762 | for (var i = 0; i < message.uninterpretedOption.length; ++i)
|
22763 | $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim();
|
22764 | if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost"))
|
22765 | writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]);
|
22766 | if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes"))
|
22767 | writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]);
|
22768 | return writer;
|
22769 | };
|
22770 |
|
22771 | /**
|
22772 | * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages.
|
22773 | * @function encodeDelimited
|
22774 | * @memberof google.protobuf.ServiceOptions
|
22775 | * @static
|
22776 | * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode
|
22777 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
22778 | * @returns {$protobuf.Writer} Writer
|
22779 | */
|
22780 | ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) {
|
22781 | return this.encode(message, writer).ldelim();
|
22782 | };
|
22783 |
|
22784 | /**
|
22785 | * Decodes a ServiceOptions message from the specified reader or buffer.
|
22786 | * @function decode
|
22787 | * @memberof google.protobuf.ServiceOptions
|
22788 | * @static
|
22789 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
22790 | * @param {number} [length] Message length if known beforehand
|
22791 | * @returns {google.protobuf.ServiceOptions} ServiceOptions
|
22792 | * @throws {Error} If the payload is not a reader or valid buffer
|
22793 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
22794 | */
|
22795 | ServiceOptions.decode = function decode(reader, length) {
|
22796 | if (!(reader instanceof $Reader))
|
22797 | reader = $Reader.create(reader);
|
22798 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions();
|
22799 | while (reader.pos < end) {
|
22800 | var tag = reader.uint32();
|
22801 | switch (tag >>> 3) {
|
22802 | case 33:
|
22803 | message.deprecated = reader.bool();
|
22804 | break;
|
22805 | case 999:
|
22806 | if (!(message.uninterpretedOption && message.uninterpretedOption.length))
|
22807 | message.uninterpretedOption = [];
|
22808 | message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32()));
|
22809 | break;
|
22810 | case 1049:
|
22811 | message[".google.api.defaultHost"] = reader.string();
|
22812 | break;
|
22813 | case 1050:
|
22814 | message[".google.api.oauthScopes"] = reader.string();
|
22815 | break;
|
22816 | default:
|
22817 | reader.skipType(tag & 7);
|
22818 | break;
|
22819 | }
|
22820 | }
|
22821 | return message;
|
22822 | };
|
22823 |
|
22824 | /**
|
22825 | * Decodes a ServiceOptions message from the specified reader or buffer, length delimited.
|
22826 | * @function decodeDelimited
|
22827 | * @memberof google.protobuf.ServiceOptions
|
22828 | * @static
|
22829 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
22830 | * @returns {google.protobuf.ServiceOptions} ServiceOptions
|
22831 | * @throws {Error} If the payload is not a reader or valid buffer
|
22832 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
22833 | */
|
22834 | ServiceOptions.decodeDelimited = function decodeDelimited(reader) {
|
22835 | if (!(reader instanceof $Reader))
|
22836 | reader = new $Reader(reader);
|
22837 | return this.decode(reader, reader.uint32());
|
22838 | };
|
22839 |
|
22840 | /**
|
22841 | * Verifies a ServiceOptions message.
|
22842 | * @function verify
|
22843 | * @memberof google.protobuf.ServiceOptions
|
22844 | * @static
|
22845 | * @param {Object.<string,*>} message Plain object to verify
|
22846 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
22847 | */
|
22848 | ServiceOptions.verify = function verify(message) {
|
22849 | if (typeof message !== "object" || message === null)
|
22850 | return "object expected";
|
22851 | if (message.deprecated != null && message.hasOwnProperty("deprecated"))
|
22852 | if (typeof message.deprecated !== "boolean")
|
22853 | return "deprecated: boolean expected";
|
22854 | if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) {
|
22855 | if (!Array.isArray(message.uninterpretedOption))
|
22856 | return "uninterpretedOption: array expected";
|
22857 | for (var i = 0; i < message.uninterpretedOption.length; ++i) {
|
22858 | var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]);
|
22859 | if (error)
|
22860 | return "uninterpretedOption." + error;
|
22861 | }
|
22862 | }
|
22863 | if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost"))
|
22864 | if (!$util.isString(message[".google.api.defaultHost"]))
|
22865 | return ".google.api.defaultHost: string expected";
|
22866 | if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes"))
|
22867 | if (!$util.isString(message[".google.api.oauthScopes"]))
|
22868 | return ".google.api.oauthScopes: string expected";
|
22869 | return null;
|
22870 | };
|
22871 |
|
22872 | /**
|
22873 | * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types.
|
22874 | * @function fromObject
|
22875 | * @memberof google.protobuf.ServiceOptions
|
22876 | * @static
|
22877 | * @param {Object.<string,*>} object Plain object
|
22878 | * @returns {google.protobuf.ServiceOptions} ServiceOptions
|
22879 | */
|
22880 | ServiceOptions.fromObject = function fromObject(object) {
|
22881 | if (object instanceof $root.google.protobuf.ServiceOptions)
|
22882 | return object;
|
22883 | var message = new $root.google.protobuf.ServiceOptions();
|
22884 | if (object.deprecated != null)
|
22885 | message.deprecated = Boolean(object.deprecated);
|
22886 | if (object.uninterpretedOption) {
|
22887 | if (!Array.isArray(object.uninterpretedOption))
|
22888 | throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected");
|
22889 | message.uninterpretedOption = [];
|
22890 | for (var i = 0; i < object.uninterpretedOption.length; ++i) {
|
22891 | if (typeof object.uninterpretedOption[i] !== "object")
|
22892 | throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected");
|
22893 | message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]);
|
22894 | }
|
22895 | }
|
22896 | if (object[".google.api.defaultHost"] != null)
|
22897 | message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]);
|
22898 | if (object[".google.api.oauthScopes"] != null)
|
22899 | message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]);
|
22900 | return message;
|
22901 | };
|
22902 |
|
22903 | /**
|
22904 | * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified.
|
22905 | * @function toObject
|
22906 | * @memberof google.protobuf.ServiceOptions
|
22907 | * @static
|
22908 | * @param {google.protobuf.ServiceOptions} message ServiceOptions
|
22909 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
22910 | * @returns {Object.<string,*>} Plain object
|
22911 | */
|
22912 | ServiceOptions.toObject = function toObject(message, options) {
|
22913 | if (!options)
|
22914 | options = {};
|
22915 | var object = {};
|
22916 | if (options.arrays || options.defaults)
|
22917 | object.uninterpretedOption = [];
|
22918 | if (options.defaults) {
|
22919 | object.deprecated = false;
|
22920 | object[".google.api.defaultHost"] = "";
|
22921 | object[".google.api.oauthScopes"] = "";
|
22922 | }
|
22923 | if (message.deprecated != null && message.hasOwnProperty("deprecated"))
|
22924 | object.deprecated = message.deprecated;
|
22925 | if (message.uninterpretedOption && message.uninterpretedOption.length) {
|
22926 | object.uninterpretedOption = [];
|
22927 | for (var j = 0; j < message.uninterpretedOption.length; ++j)
|
22928 | object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options);
|
22929 | }
|
22930 | if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost"))
|
22931 | object[".google.api.defaultHost"] = message[".google.api.defaultHost"];
|
22932 | if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes"))
|
22933 | object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"];
|
22934 | return object;
|
22935 | };
|
22936 |
|
22937 | /**
|
22938 | * Converts this ServiceOptions to JSON.
|
22939 | * @function toJSON
|
22940 | * @memberof google.protobuf.ServiceOptions
|
22941 | * @instance
|
22942 | * @returns {Object.<string,*>} JSON object
|
22943 | */
|
22944 | ServiceOptions.prototype.toJSON = function toJSON() {
|
22945 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
22946 | };
|
22947 |
|
22948 | return ServiceOptions;
|
22949 | })();
|
22950 |
|
22951 | protobuf.MethodOptions = (function() {
|
22952 |
|
22953 | /**
|
22954 | * Properties of a MethodOptions.
|
22955 | * @memberof google.protobuf
|
22956 | * @interface IMethodOptions
|
22957 | * @property {boolean|null} [deprecated] MethodOptions deprecated
|
22958 | * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel
|
22959 | * @property {Array.<google.protobuf.IUninterpretedOption>|null} [uninterpretedOption] MethodOptions uninterpretedOption
|
22960 | * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http
|
22961 | * @property {Array.<string>|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature
|
22962 | * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo
|
22963 | */
|
22964 |
|
22965 | /**
|
22966 | * Constructs a new MethodOptions.
|
22967 | * @memberof google.protobuf
|
22968 | * @classdesc Represents a MethodOptions.
|
22969 | * @implements IMethodOptions
|
22970 | * @constructor
|
22971 | * @param {google.protobuf.IMethodOptions=} [properties] Properties to set
|
22972 | */
|
22973 | function MethodOptions(properties) {
|
22974 | this.uninterpretedOption = [];
|
22975 | this[".google.api.methodSignature"] = [];
|
22976 | if (properties)
|
22977 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
22978 | if (properties[keys[i]] != null)
|
22979 | this[keys[i]] = properties[keys[i]];
|
22980 | }
|
22981 |
|
22982 | /**
|
22983 | * MethodOptions deprecated.
|
22984 | * @member {boolean} deprecated
|
22985 | * @memberof google.protobuf.MethodOptions
|
22986 | * @instance
|
22987 | */
|
22988 | MethodOptions.prototype.deprecated = false;
|
22989 |
|
22990 | /**
|
22991 | * MethodOptions idempotencyLevel.
|
22992 | * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel
|
22993 | * @memberof google.protobuf.MethodOptions
|
22994 | * @instance
|
22995 | */
|
22996 | MethodOptions.prototype.idempotencyLevel = 0;
|
22997 |
|
22998 | /**
|
22999 | * MethodOptions uninterpretedOption.
|
23000 | * @member {Array.<google.protobuf.IUninterpretedOption>} uninterpretedOption
|
23001 | * @memberof google.protobuf.MethodOptions
|
23002 | * @instance
|
23003 | */
|
23004 | MethodOptions.prototype.uninterpretedOption = $util.emptyArray;
|
23005 |
|
23006 | /**
|
23007 | * MethodOptions .google.api.http.
|
23008 | * @member {google.api.IHttpRule|null|undefined} .google.api.http
|
23009 | * @memberof google.protobuf.MethodOptions
|
23010 | * @instance
|
23011 | */
|
23012 | MethodOptions.prototype[".google.api.http"] = null;
|
23013 |
|
23014 | /**
|
23015 | * MethodOptions .google.api.methodSignature.
|
23016 | * @member {Array.<string>} .google.api.methodSignature
|
23017 | * @memberof google.protobuf.MethodOptions
|
23018 | * @instance
|
23019 | */
|
23020 | MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray;
|
23021 |
|
23022 | /**
|
23023 | * MethodOptions .google.longrunning.operationInfo.
|
23024 | * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo
|
23025 | * @memberof google.protobuf.MethodOptions
|
23026 | * @instance
|
23027 | */
|
23028 | MethodOptions.prototype[".google.longrunning.operationInfo"] = null;
|
23029 |
|
23030 | /**
|
23031 | * Creates a new MethodOptions instance using the specified properties.
|
23032 | * @function create
|
23033 | * @memberof google.protobuf.MethodOptions
|
23034 | * @static
|
23035 | * @param {google.protobuf.IMethodOptions=} [properties] Properties to set
|
23036 | * @returns {google.protobuf.MethodOptions} MethodOptions instance
|
23037 | */
|
23038 | MethodOptions.create = function create(properties) {
|
23039 | return new MethodOptions(properties);
|
23040 | };
|
23041 |
|
23042 | /**
|
23043 | * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages.
|
23044 | * @function encode
|
23045 | * @memberof google.protobuf.MethodOptions
|
23046 | * @static
|
23047 | * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode
|
23048 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
23049 | * @returns {$protobuf.Writer} Writer
|
23050 | */
|
23051 | MethodOptions.encode = function encode(message, writer) {
|
23052 | if (!writer)
|
23053 | writer = $Writer.create();
|
23054 | if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated"))
|
23055 | writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated);
|
23056 | if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel"))
|
23057 | writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel);
|
23058 | if (message.uninterpretedOption != null && message.uninterpretedOption.length)
|
23059 | for (var i = 0; i < message.uninterpretedOption.length; ++i)
|
23060 | $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim();
|
23061 | if (message[".google.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo"))
|
23062 | $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).fork()).ldelim();
|
23063 | if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length)
|
23064 | for (var i = 0; i < message[".google.api.methodSignature"].length; ++i)
|
23065 | writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]);
|
23066 | if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http"))
|
23067 | $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim();
|
23068 | return writer;
|
23069 | };
|
23070 |
|
23071 | /**
|
23072 | * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages.
|
23073 | * @function encodeDelimited
|
23074 | * @memberof google.protobuf.MethodOptions
|
23075 | * @static
|
23076 | * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode
|
23077 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
23078 | * @returns {$protobuf.Writer} Writer
|
23079 | */
|
23080 | MethodOptions.encodeDelimited = function encodeDelimited(message, writer) {
|
23081 | return this.encode(message, writer).ldelim();
|
23082 | };
|
23083 |
|
23084 | /**
|
23085 | * Decodes a MethodOptions message from the specified reader or buffer.
|
23086 | * @function decode
|
23087 | * @memberof google.protobuf.MethodOptions
|
23088 | * @static
|
23089 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
23090 | * @param {number} [length] Message length if known beforehand
|
23091 | * @returns {google.protobuf.MethodOptions} MethodOptions
|
23092 | * @throws {Error} If the payload is not a reader or valid buffer
|
23093 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
23094 | */
|
23095 | MethodOptions.decode = function decode(reader, length) {
|
23096 | if (!(reader instanceof $Reader))
|
23097 | reader = $Reader.create(reader);
|
23098 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions();
|
23099 | while (reader.pos < end) {
|
23100 | var tag = reader.uint32();
|
23101 | switch (tag >>> 3) {
|
23102 | case 33:
|
23103 | message.deprecated = reader.bool();
|
23104 | break;
|
23105 | case 34:
|
23106 | message.idempotencyLevel = reader.int32();
|
23107 | break;
|
23108 | case 999:
|
23109 | if (!(message.uninterpretedOption && message.uninterpretedOption.length))
|
23110 | message.uninterpretedOption = [];
|
23111 | message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32()));
|
23112 | break;
|
23113 | case 72295728:
|
23114 | message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32());
|
23115 | break;
|
23116 | case 1051:
|
23117 | if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length))
|
23118 | message[".google.api.methodSignature"] = [];
|
23119 | message[".google.api.methodSignature"].push(reader.string());
|
23120 | break;
|
23121 | case 1049:
|
23122 | message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32());
|
23123 | break;
|
23124 | default:
|
23125 | reader.skipType(tag & 7);
|
23126 | break;
|
23127 | }
|
23128 | }
|
23129 | return message;
|
23130 | };
|
23131 |
|
23132 | /**
|
23133 | * Decodes a MethodOptions message from the specified reader or buffer, length delimited.
|
23134 | * @function decodeDelimited
|
23135 | * @memberof google.protobuf.MethodOptions
|
23136 | * @static
|
23137 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
23138 | * @returns {google.protobuf.MethodOptions} MethodOptions
|
23139 | * @throws {Error} If the payload is not a reader or valid buffer
|
23140 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
23141 | */
|
23142 | MethodOptions.decodeDelimited = function decodeDelimited(reader) {
|
23143 | if (!(reader instanceof $Reader))
|
23144 | reader = new $Reader(reader);
|
23145 | return this.decode(reader, reader.uint32());
|
23146 | };
|
23147 |
|
23148 | /**
|
23149 | * Verifies a MethodOptions message.
|
23150 | * @function verify
|
23151 | * @memberof google.protobuf.MethodOptions
|
23152 | * @static
|
23153 | * @param {Object.<string,*>} message Plain object to verify
|
23154 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
23155 | */
|
23156 | MethodOptions.verify = function verify(message) {
|
23157 | if (typeof message !== "object" || message === null)
|
23158 | return "object expected";
|
23159 | if (message.deprecated != null && message.hasOwnProperty("deprecated"))
|
23160 | if (typeof message.deprecated !== "boolean")
|
23161 | return "deprecated: boolean expected";
|
23162 | if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel"))
|
23163 | switch (message.idempotencyLevel) {
|
23164 | default:
|
23165 | return "idempotencyLevel: enum value expected";
|
23166 | case 0:
|
23167 | case 1:
|
23168 | case 2:
|
23169 | break;
|
23170 | }
|
23171 | if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) {
|
23172 | if (!Array.isArray(message.uninterpretedOption))
|
23173 | return "uninterpretedOption: array expected";
|
23174 | for (var i = 0; i < message.uninterpretedOption.length; ++i) {
|
23175 | var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]);
|
23176 | if (error)
|
23177 | return "uninterpretedOption." + error;
|
23178 | }
|
23179 | }
|
23180 | if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) {
|
23181 | var error = $root.google.api.HttpRule.verify(message[".google.api.http"]);
|
23182 | if (error)
|
23183 | return ".google.api.http." + error;
|
23184 | }
|
23185 | if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) {
|
23186 | if (!Array.isArray(message[".google.api.methodSignature"]))
|
23187 | return ".google.api.methodSignature: array expected";
|
23188 | for (var i = 0; i < message[".google.api.methodSignature"].length; ++i)
|
23189 | if (!$util.isString(message[".google.api.methodSignature"][i]))
|
23190 | return ".google.api.methodSignature: string[] expected";
|
23191 | }
|
23192 | if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) {
|
23193 | var error = $root.google.longrunning.OperationInfo.verify(message[".google.longrunning.operationInfo"]);
|
23194 | if (error)
|
23195 | return ".google.longrunning.operationInfo." + error;
|
23196 | }
|
23197 | return null;
|
23198 | };
|
23199 |
|
23200 | /**
|
23201 | * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types.
|
23202 | * @function fromObject
|
23203 | * @memberof google.protobuf.MethodOptions
|
23204 | * @static
|
23205 | * @param {Object.<string,*>} object Plain object
|
23206 | * @returns {google.protobuf.MethodOptions} MethodOptions
|
23207 | */
|
23208 | MethodOptions.fromObject = function fromObject(object) {
|
23209 | if (object instanceof $root.google.protobuf.MethodOptions)
|
23210 | return object;
|
23211 | var message = new $root.google.protobuf.MethodOptions();
|
23212 | if (object.deprecated != null)
|
23213 | message.deprecated = Boolean(object.deprecated);
|
23214 | switch (object.idempotencyLevel) {
|
23215 | case "IDEMPOTENCY_UNKNOWN":
|
23216 | case 0:
|
23217 | message.idempotencyLevel = 0;
|
23218 | break;
|
23219 | case "NO_SIDE_EFFECTS":
|
23220 | case 1:
|
23221 | message.idempotencyLevel = 1;
|
23222 | break;
|
23223 | case "IDEMPOTENT":
|
23224 | case 2:
|
23225 | message.idempotencyLevel = 2;
|
23226 | break;
|
23227 | }
|
23228 | if (object.uninterpretedOption) {
|
23229 | if (!Array.isArray(object.uninterpretedOption))
|
23230 | throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected");
|
23231 | message.uninterpretedOption = [];
|
23232 | for (var i = 0; i < object.uninterpretedOption.length; ++i) {
|
23233 | if (typeof object.uninterpretedOption[i] !== "object")
|
23234 | throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected");
|
23235 | message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]);
|
23236 | }
|
23237 | }
|
23238 | if (object[".google.api.http"] != null) {
|
23239 | if (typeof object[".google.api.http"] !== "object")
|
23240 | throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected");
|
23241 | message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]);
|
23242 | }
|
23243 | if (object[".google.api.methodSignature"]) {
|
23244 | if (!Array.isArray(object[".google.api.methodSignature"]))
|
23245 | throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected");
|
23246 | message[".google.api.methodSignature"] = [];
|
23247 | for (var i = 0; i < object[".google.api.methodSignature"].length; ++i)
|
23248 | message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]);
|
23249 | }
|
23250 | if (object[".google.longrunning.operationInfo"] != null) {
|
23251 | if (typeof object[".google.longrunning.operationInfo"] !== "object")
|
23252 | throw TypeError(".google.protobuf.MethodOptions..google.longrunning.operationInfo: object expected");
|
23253 | message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.fromObject(object[".google.longrunning.operationInfo"]);
|
23254 | }
|
23255 | return message;
|
23256 | };
|
23257 |
|
23258 | /**
|
23259 | * Creates a plain object from a MethodOptions message. Also converts values to other types if specified.
|
23260 | * @function toObject
|
23261 | * @memberof google.protobuf.MethodOptions
|
23262 | * @static
|
23263 | * @param {google.protobuf.MethodOptions} message MethodOptions
|
23264 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
23265 | * @returns {Object.<string,*>} Plain object
|
23266 | */
|
23267 | MethodOptions.toObject = function toObject(message, options) {
|
23268 | if (!options)
|
23269 | options = {};
|
23270 | var object = {};
|
23271 | if (options.arrays || options.defaults) {
|
23272 | object.uninterpretedOption = [];
|
23273 | object[".google.api.methodSignature"] = [];
|
23274 | }
|
23275 | if (options.defaults) {
|
23276 | object.deprecated = false;
|
23277 | object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0;
|
23278 | object[".google.longrunning.operationInfo"] = null;
|
23279 | object[".google.api.http"] = null;
|
23280 | }
|
23281 | if (message.deprecated != null && message.hasOwnProperty("deprecated"))
|
23282 | object.deprecated = message.deprecated;
|
23283 | if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel"))
|
23284 | object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel;
|
23285 | if (message.uninterpretedOption && message.uninterpretedOption.length) {
|
23286 | object.uninterpretedOption = [];
|
23287 | for (var j = 0; j < message.uninterpretedOption.length; ++j)
|
23288 | object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options);
|
23289 | }
|
23290 | if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo"))
|
23291 | object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], options);
|
23292 | if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) {
|
23293 | object[".google.api.methodSignature"] = [];
|
23294 | for (var j = 0; j < message[".google.api.methodSignature"].length; ++j)
|
23295 | object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j];
|
23296 | }
|
23297 | if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http"))
|
23298 | object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options);
|
23299 | return object;
|
23300 | };
|
23301 |
|
23302 | /**
|
23303 | * Converts this MethodOptions to JSON.
|
23304 | * @function toJSON
|
23305 | * @memberof google.protobuf.MethodOptions
|
23306 | * @instance
|
23307 | * @returns {Object.<string,*>} JSON object
|
23308 | */
|
23309 | MethodOptions.prototype.toJSON = function toJSON() {
|
23310 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
23311 | };
|
23312 |
|
23313 | /**
|
23314 | * IdempotencyLevel enum.
|
23315 | * @name google.protobuf.MethodOptions.IdempotencyLevel
|
23316 | * @enum {number}
|
23317 | * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value
|
23318 | * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value
|
23319 | * @property {number} IDEMPOTENT=2 IDEMPOTENT value
|
23320 | */
|
23321 | MethodOptions.IdempotencyLevel = (function() {
|
23322 | var valuesById = {}, values = Object.create(valuesById);
|
23323 | values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0;
|
23324 | values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1;
|
23325 | values[valuesById[2] = "IDEMPOTENT"] = 2;
|
23326 | return values;
|
23327 | })();
|
23328 |
|
23329 | return MethodOptions;
|
23330 | })();
|
23331 |
|
23332 | protobuf.UninterpretedOption = (function() {
|
23333 |
|
23334 | /**
|
23335 | * Properties of an UninterpretedOption.
|
23336 | * @memberof google.protobuf
|
23337 | * @interface IUninterpretedOption
|
23338 | * @property {Array.<google.protobuf.UninterpretedOption.INamePart>|null} [name] UninterpretedOption name
|
23339 | * @property {string|null} [identifierValue] UninterpretedOption identifierValue
|
23340 | * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue
|
23341 | * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue
|
23342 | * @property {number|null} [doubleValue] UninterpretedOption doubleValue
|
23343 | * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue
|
23344 | * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue
|
23345 | */
|
23346 |
|
23347 | /**
|
23348 | * Constructs a new UninterpretedOption.
|
23349 | * @memberof google.protobuf
|
23350 | * @classdesc Represents an UninterpretedOption.
|
23351 | * @implements IUninterpretedOption
|
23352 | * @constructor
|
23353 | * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set
|
23354 | */
|
23355 | function UninterpretedOption(properties) {
|
23356 | this.name = [];
|
23357 | if (properties)
|
23358 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
23359 | if (properties[keys[i]] != null)
|
23360 | this[keys[i]] = properties[keys[i]];
|
23361 | }
|
23362 |
|
23363 | /**
|
23364 | * UninterpretedOption name.
|
23365 | * @member {Array.<google.protobuf.UninterpretedOption.INamePart>} name
|
23366 | * @memberof google.protobuf.UninterpretedOption
|
23367 | * @instance
|
23368 | */
|
23369 | UninterpretedOption.prototype.name = $util.emptyArray;
|
23370 |
|
23371 | /**
|
23372 | * UninterpretedOption identifierValue.
|
23373 | * @member {string} identifierValue
|
23374 | * @memberof google.protobuf.UninterpretedOption
|
23375 | * @instance
|
23376 | */
|
23377 | UninterpretedOption.prototype.identifierValue = "";
|
23378 |
|
23379 | /**
|
23380 | * UninterpretedOption positiveIntValue.
|
23381 | * @member {number|Long} positiveIntValue
|
23382 | * @memberof google.protobuf.UninterpretedOption
|
23383 | * @instance
|
23384 | */
|
23385 | UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
|
23386 |
|
23387 | /**
|
23388 | * UninterpretedOption negativeIntValue.
|
23389 | * @member {number|Long} negativeIntValue
|
23390 | * @memberof google.protobuf.UninterpretedOption
|
23391 | * @instance
|
23392 | */
|
23393 | UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
23394 |
|
23395 | /**
|
23396 | * UninterpretedOption doubleValue.
|
23397 | * @member {number} doubleValue
|
23398 | * @memberof google.protobuf.UninterpretedOption
|
23399 | * @instance
|
23400 | */
|
23401 | UninterpretedOption.prototype.doubleValue = 0;
|
23402 |
|
23403 | /**
|
23404 | * UninterpretedOption stringValue.
|
23405 | * @member {Uint8Array} stringValue
|
23406 | * @memberof google.protobuf.UninterpretedOption
|
23407 | * @instance
|
23408 | */
|
23409 | UninterpretedOption.prototype.stringValue = $util.newBuffer([]);
|
23410 |
|
23411 | /**
|
23412 | * UninterpretedOption aggregateValue.
|
23413 | * @member {string} aggregateValue
|
23414 | * @memberof google.protobuf.UninterpretedOption
|
23415 | * @instance
|
23416 | */
|
23417 | UninterpretedOption.prototype.aggregateValue = "";
|
23418 |
|
23419 | /**
|
23420 | * Creates a new UninterpretedOption instance using the specified properties.
|
23421 | * @function create
|
23422 | * @memberof google.protobuf.UninterpretedOption
|
23423 | * @static
|
23424 | * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set
|
23425 | * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance
|
23426 | */
|
23427 | UninterpretedOption.create = function create(properties) {
|
23428 | return new UninterpretedOption(properties);
|
23429 | };
|
23430 |
|
23431 | /**
|
23432 | * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages.
|
23433 | * @function encode
|
23434 | * @memberof google.protobuf.UninterpretedOption
|
23435 | * @static
|
23436 | * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode
|
23437 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
23438 | * @returns {$protobuf.Writer} Writer
|
23439 | */
|
23440 | UninterpretedOption.encode = function encode(message, writer) {
|
23441 | if (!writer)
|
23442 | writer = $Writer.create();
|
23443 | if (message.name != null && message.name.length)
|
23444 | for (var i = 0; i < message.name.length; ++i)
|
23445 | $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
23446 | if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue"))
|
23447 | writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue);
|
23448 | if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue"))
|
23449 | writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue);
|
23450 | if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue"))
|
23451 | writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue);
|
23452 | if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue"))
|
23453 | writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue);
|
23454 | if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue"))
|
23455 | writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue);
|
23456 | if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue"))
|
23457 | writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue);
|
23458 | return writer;
|
23459 | };
|
23460 |
|
23461 | /**
|
23462 | * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages.
|
23463 | * @function encodeDelimited
|
23464 | * @memberof google.protobuf.UninterpretedOption
|
23465 | * @static
|
23466 | * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode
|
23467 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
23468 | * @returns {$protobuf.Writer} Writer
|
23469 | */
|
23470 | UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) {
|
23471 | return this.encode(message, writer).ldelim();
|
23472 | };
|
23473 |
|
23474 | /**
|
23475 | * Decodes an UninterpretedOption message from the specified reader or buffer.
|
23476 | * @function decode
|
23477 | * @memberof google.protobuf.UninterpretedOption
|
23478 | * @static
|
23479 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
23480 | * @param {number} [length] Message length if known beforehand
|
23481 | * @returns {google.protobuf.UninterpretedOption} UninterpretedOption
|
23482 | * @throws {Error} If the payload is not a reader or valid buffer
|
23483 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
23484 | */
|
23485 | UninterpretedOption.decode = function decode(reader, length) {
|
23486 | if (!(reader instanceof $Reader))
|
23487 | reader = $Reader.create(reader);
|
23488 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption();
|
23489 | while (reader.pos < end) {
|
23490 | var tag = reader.uint32();
|
23491 | switch (tag >>> 3) {
|
23492 | case 2:
|
23493 | if (!(message.name && message.name.length))
|
23494 | message.name = [];
|
23495 | message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32()));
|
23496 | break;
|
23497 | case 3:
|
23498 | message.identifierValue = reader.string();
|
23499 | break;
|
23500 | case 4:
|
23501 | message.positiveIntValue = reader.uint64();
|
23502 | break;
|
23503 | case 5:
|
23504 | message.negativeIntValue = reader.int64();
|
23505 | break;
|
23506 | case 6:
|
23507 | message.doubleValue = reader.double();
|
23508 | break;
|
23509 | case 7:
|
23510 | message.stringValue = reader.bytes();
|
23511 | break;
|
23512 | case 8:
|
23513 | message.aggregateValue = reader.string();
|
23514 | break;
|
23515 | default:
|
23516 | reader.skipType(tag & 7);
|
23517 | break;
|
23518 | }
|
23519 | }
|
23520 | return message;
|
23521 | };
|
23522 |
|
23523 | /**
|
23524 | * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited.
|
23525 | * @function decodeDelimited
|
23526 | * @memberof google.protobuf.UninterpretedOption
|
23527 | * @static
|
23528 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
23529 | * @returns {google.protobuf.UninterpretedOption} UninterpretedOption
|
23530 | * @throws {Error} If the payload is not a reader or valid buffer
|
23531 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
23532 | */
|
23533 | UninterpretedOption.decodeDelimited = function decodeDelimited(reader) {
|
23534 | if (!(reader instanceof $Reader))
|
23535 | reader = new $Reader(reader);
|
23536 | return this.decode(reader, reader.uint32());
|
23537 | };
|
23538 |
|
23539 | /**
|
23540 | * Verifies an UninterpretedOption message.
|
23541 | * @function verify
|
23542 | * @memberof google.protobuf.UninterpretedOption
|
23543 | * @static
|
23544 | * @param {Object.<string,*>} message Plain object to verify
|
23545 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
23546 | */
|
23547 | UninterpretedOption.verify = function verify(message) {
|
23548 | if (typeof message !== "object" || message === null)
|
23549 | return "object expected";
|
23550 | if (message.name != null && message.hasOwnProperty("name")) {
|
23551 | if (!Array.isArray(message.name))
|
23552 | return "name: array expected";
|
23553 | for (var i = 0; i < message.name.length; ++i) {
|
23554 | var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]);
|
23555 | if (error)
|
23556 | return "name." + error;
|
23557 | }
|
23558 | }
|
23559 | if (message.identifierValue != null && message.hasOwnProperty("identifierValue"))
|
23560 | if (!$util.isString(message.identifierValue))
|
23561 | return "identifierValue: string expected";
|
23562 | if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue"))
|
23563 | if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high)))
|
23564 | return "positiveIntValue: integer|Long expected";
|
23565 | if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue"))
|
23566 | if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high)))
|
23567 | return "negativeIntValue: integer|Long expected";
|
23568 | if (message.doubleValue != null && message.hasOwnProperty("doubleValue"))
|
23569 | if (typeof message.doubleValue !== "number")
|
23570 | return "doubleValue: number expected";
|
23571 | if (message.stringValue != null && message.hasOwnProperty("stringValue"))
|
23572 | if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue)))
|
23573 | return "stringValue: buffer expected";
|
23574 | if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue"))
|
23575 | if (!$util.isString(message.aggregateValue))
|
23576 | return "aggregateValue: string expected";
|
23577 | return null;
|
23578 | };
|
23579 |
|
23580 | /**
|
23581 | * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types.
|
23582 | * @function fromObject
|
23583 | * @memberof google.protobuf.UninterpretedOption
|
23584 | * @static
|
23585 | * @param {Object.<string,*>} object Plain object
|
23586 | * @returns {google.protobuf.UninterpretedOption} UninterpretedOption
|
23587 | */
|
23588 | UninterpretedOption.fromObject = function fromObject(object) {
|
23589 | if (object instanceof $root.google.protobuf.UninterpretedOption)
|
23590 | return object;
|
23591 | var message = new $root.google.protobuf.UninterpretedOption();
|
23592 | if (object.name) {
|
23593 | if (!Array.isArray(object.name))
|
23594 | throw TypeError(".google.protobuf.UninterpretedOption.name: array expected");
|
23595 | message.name = [];
|
23596 | for (var i = 0; i < object.name.length; ++i) {
|
23597 | if (typeof object.name[i] !== "object")
|
23598 | throw TypeError(".google.protobuf.UninterpretedOption.name: object expected");
|
23599 | message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]);
|
23600 | }
|
23601 | }
|
23602 | if (object.identifierValue != null)
|
23603 | message.identifierValue = String(object.identifierValue);
|
23604 | if (object.positiveIntValue != null)
|
23605 | if ($util.Long)
|
23606 | (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true;
|
23607 | else if (typeof object.positiveIntValue === "string")
|
23608 | message.positiveIntValue = parseInt(object.positiveIntValue, 10);
|
23609 | else if (typeof object.positiveIntValue === "number")
|
23610 | message.positiveIntValue = object.positiveIntValue;
|
23611 | else if (typeof object.positiveIntValue === "object")
|
23612 | message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true);
|
23613 | if (object.negativeIntValue != null)
|
23614 | if ($util.Long)
|
23615 | (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false;
|
23616 | else if (typeof object.negativeIntValue === "string")
|
23617 | message.negativeIntValue = parseInt(object.negativeIntValue, 10);
|
23618 | else if (typeof object.negativeIntValue === "number")
|
23619 | message.negativeIntValue = object.negativeIntValue;
|
23620 | else if (typeof object.negativeIntValue === "object")
|
23621 | message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber();
|
23622 | if (object.doubleValue != null)
|
23623 | message.doubleValue = Number(object.doubleValue);
|
23624 | if (object.stringValue != null)
|
23625 | if (typeof object.stringValue === "string")
|
23626 | $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0);
|
23627 | else if (object.stringValue.length)
|
23628 | message.stringValue = object.stringValue;
|
23629 | if (object.aggregateValue != null)
|
23630 | message.aggregateValue = String(object.aggregateValue);
|
23631 | return message;
|
23632 | };
|
23633 |
|
23634 | /**
|
23635 | * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified.
|
23636 | * @function toObject
|
23637 | * @memberof google.protobuf.UninterpretedOption
|
23638 | * @static
|
23639 | * @param {google.protobuf.UninterpretedOption} message UninterpretedOption
|
23640 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
23641 | * @returns {Object.<string,*>} Plain object
|
23642 | */
|
23643 | UninterpretedOption.toObject = function toObject(message, options) {
|
23644 | if (!options)
|
23645 | options = {};
|
23646 | var object = {};
|
23647 | if (options.arrays || options.defaults)
|
23648 | object.name = [];
|
23649 | if (options.defaults) {
|
23650 | object.identifierValue = "";
|
23651 | if ($util.Long) {
|
23652 | var long = new $util.Long(0, 0, true);
|
23653 | object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
23654 | } else
|
23655 | object.positiveIntValue = options.longs === String ? "0" : 0;
|
23656 | if ($util.Long) {
|
23657 | var long = new $util.Long(0, 0, false);
|
23658 | object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
23659 | } else
|
23660 | object.negativeIntValue = options.longs === String ? "0" : 0;
|
23661 | object.doubleValue = 0;
|
23662 | if (options.bytes === String)
|
23663 | object.stringValue = "";
|
23664 | else {
|
23665 | object.stringValue = [];
|
23666 | if (options.bytes !== Array)
|
23667 | object.stringValue = $util.newBuffer(object.stringValue);
|
23668 | }
|
23669 | object.aggregateValue = "";
|
23670 | }
|
23671 | if (message.name && message.name.length) {
|
23672 | object.name = [];
|
23673 | for (var j = 0; j < message.name.length; ++j)
|
23674 | object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options);
|
23675 | }
|
23676 | if (message.identifierValue != null && message.hasOwnProperty("identifierValue"))
|
23677 | object.identifierValue = message.identifierValue;
|
23678 | if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue"))
|
23679 | if (typeof message.positiveIntValue === "number")
|
23680 | object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue;
|
23681 | else
|
23682 | object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue;
|
23683 | if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue"))
|
23684 | if (typeof message.negativeIntValue === "number")
|
23685 | object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue;
|
23686 | else
|
23687 | object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue;
|
23688 | if (message.doubleValue != null && message.hasOwnProperty("doubleValue"))
|
23689 | object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue;
|
23690 | if (message.stringValue != null && message.hasOwnProperty("stringValue"))
|
23691 | object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue;
|
23692 | if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue"))
|
23693 | object.aggregateValue = message.aggregateValue;
|
23694 | return object;
|
23695 | };
|
23696 |
|
23697 | /**
|
23698 | * Converts this UninterpretedOption to JSON.
|
23699 | * @function toJSON
|
23700 | * @memberof google.protobuf.UninterpretedOption
|
23701 | * @instance
|
23702 | * @returns {Object.<string,*>} JSON object
|
23703 | */
|
23704 | UninterpretedOption.prototype.toJSON = function toJSON() {
|
23705 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
23706 | };
|
23707 |
|
23708 | UninterpretedOption.NamePart = (function() {
|
23709 |
|
23710 | /**
|
23711 | * Properties of a NamePart.
|
23712 | * @memberof google.protobuf.UninterpretedOption
|
23713 | * @interface INamePart
|
23714 | * @property {string} namePart NamePart namePart
|
23715 | * @property {boolean} isExtension NamePart isExtension
|
23716 | */
|
23717 |
|
23718 | /**
|
23719 | * Constructs a new NamePart.
|
23720 | * @memberof google.protobuf.UninterpretedOption
|
23721 | * @classdesc Represents a NamePart.
|
23722 | * @implements INamePart
|
23723 | * @constructor
|
23724 | * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set
|
23725 | */
|
23726 | function NamePart(properties) {
|
23727 | if (properties)
|
23728 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
23729 | if (properties[keys[i]] != null)
|
23730 | this[keys[i]] = properties[keys[i]];
|
23731 | }
|
23732 |
|
23733 | /**
|
23734 | * NamePart namePart.
|
23735 | * @member {string} namePart
|
23736 | * @memberof google.protobuf.UninterpretedOption.NamePart
|
23737 | * @instance
|
23738 | */
|
23739 | NamePart.prototype.namePart = "";
|
23740 |
|
23741 | /**
|
23742 | * NamePart isExtension.
|
23743 | * @member {boolean} isExtension
|
23744 | * @memberof google.protobuf.UninterpretedOption.NamePart
|
23745 | * @instance
|
23746 | */
|
23747 | NamePart.prototype.isExtension = false;
|
23748 |
|
23749 | /**
|
23750 | * Creates a new NamePart instance using the specified properties.
|
23751 | * @function create
|
23752 | * @memberof google.protobuf.UninterpretedOption.NamePart
|
23753 | * @static
|
23754 | * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set
|
23755 | * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance
|
23756 | */
|
23757 | NamePart.create = function create(properties) {
|
23758 | return new NamePart(properties);
|
23759 | };
|
23760 |
|
23761 | /**
|
23762 | * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages.
|
23763 | * @function encode
|
23764 | * @memberof google.protobuf.UninterpretedOption.NamePart
|
23765 | * @static
|
23766 | * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode
|
23767 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
23768 | * @returns {$protobuf.Writer} Writer
|
23769 | */
|
23770 | NamePart.encode = function encode(message, writer) {
|
23771 | if (!writer)
|
23772 | writer = $Writer.create();
|
23773 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart);
|
23774 | writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension);
|
23775 | return writer;
|
23776 | };
|
23777 |
|
23778 | /**
|
23779 | * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages.
|
23780 | * @function encodeDelimited
|
23781 | * @memberof google.protobuf.UninterpretedOption.NamePart
|
23782 | * @static
|
23783 | * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode
|
23784 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
23785 | * @returns {$protobuf.Writer} Writer
|
23786 | */
|
23787 | NamePart.encodeDelimited = function encodeDelimited(message, writer) {
|
23788 | return this.encode(message, writer).ldelim();
|
23789 | };
|
23790 |
|
23791 | /**
|
23792 | * Decodes a NamePart message from the specified reader or buffer.
|
23793 | * @function decode
|
23794 | * @memberof google.protobuf.UninterpretedOption.NamePart
|
23795 | * @static
|
23796 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
23797 | * @param {number} [length] Message length if known beforehand
|
23798 | * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart
|
23799 | * @throws {Error} If the payload is not a reader or valid buffer
|
23800 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
23801 | */
|
23802 | NamePart.decode = function decode(reader, length) {
|
23803 | if (!(reader instanceof $Reader))
|
23804 | reader = $Reader.create(reader);
|
23805 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart();
|
23806 | while (reader.pos < end) {
|
23807 | var tag = reader.uint32();
|
23808 | switch (tag >>> 3) {
|
23809 | case 1:
|
23810 | message.namePart = reader.string();
|
23811 | break;
|
23812 | case 2:
|
23813 | message.isExtension = reader.bool();
|
23814 | break;
|
23815 | default:
|
23816 | reader.skipType(tag & 7);
|
23817 | break;
|
23818 | }
|
23819 | }
|
23820 | if (!message.hasOwnProperty("namePart"))
|
23821 | throw $util.ProtocolError("missing required 'namePart'", { instance: message });
|
23822 | if (!message.hasOwnProperty("isExtension"))
|
23823 | throw $util.ProtocolError("missing required 'isExtension'", { instance: message });
|
23824 | return message;
|
23825 | };
|
23826 |
|
23827 | /**
|
23828 | * Decodes a NamePart message from the specified reader or buffer, length delimited.
|
23829 | * @function decodeDelimited
|
23830 | * @memberof google.protobuf.UninterpretedOption.NamePart
|
23831 | * @static
|
23832 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
23833 | * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart
|
23834 | * @throws {Error} If the payload is not a reader or valid buffer
|
23835 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
23836 | */
|
23837 | NamePart.decodeDelimited = function decodeDelimited(reader) {
|
23838 | if (!(reader instanceof $Reader))
|
23839 | reader = new $Reader(reader);
|
23840 | return this.decode(reader, reader.uint32());
|
23841 | };
|
23842 |
|
23843 | /**
|
23844 | * Verifies a NamePart message.
|
23845 | * @function verify
|
23846 | * @memberof google.protobuf.UninterpretedOption.NamePart
|
23847 | * @static
|
23848 | * @param {Object.<string,*>} message Plain object to verify
|
23849 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
23850 | */
|
23851 | NamePart.verify = function verify(message) {
|
23852 | if (typeof message !== "object" || message === null)
|
23853 | return "object expected";
|
23854 | if (!$util.isString(message.namePart))
|
23855 | return "namePart: string expected";
|
23856 | if (typeof message.isExtension !== "boolean")
|
23857 | return "isExtension: boolean expected";
|
23858 | return null;
|
23859 | };
|
23860 |
|
23861 | /**
|
23862 | * Creates a NamePart message from a plain object. Also converts values to their respective internal types.
|
23863 | * @function fromObject
|
23864 | * @memberof google.protobuf.UninterpretedOption.NamePart
|
23865 | * @static
|
23866 | * @param {Object.<string,*>} object Plain object
|
23867 | * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart
|
23868 | */
|
23869 | NamePart.fromObject = function fromObject(object) {
|
23870 | if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart)
|
23871 | return object;
|
23872 | var message = new $root.google.protobuf.UninterpretedOption.NamePart();
|
23873 | if (object.namePart != null)
|
23874 | message.namePart = String(object.namePart);
|
23875 | if (object.isExtension != null)
|
23876 | message.isExtension = Boolean(object.isExtension);
|
23877 | return message;
|
23878 | };
|
23879 |
|
23880 | /**
|
23881 | * Creates a plain object from a NamePart message. Also converts values to other types if specified.
|
23882 | * @function toObject
|
23883 | * @memberof google.protobuf.UninterpretedOption.NamePart
|
23884 | * @static
|
23885 | * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart
|
23886 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
23887 | * @returns {Object.<string,*>} Plain object
|
23888 | */
|
23889 | NamePart.toObject = function toObject(message, options) {
|
23890 | if (!options)
|
23891 | options = {};
|
23892 | var object = {};
|
23893 | if (options.defaults) {
|
23894 | object.namePart = "";
|
23895 | object.isExtension = false;
|
23896 | }
|
23897 | if (message.namePart != null && message.hasOwnProperty("namePart"))
|
23898 | object.namePart = message.namePart;
|
23899 | if (message.isExtension != null && message.hasOwnProperty("isExtension"))
|
23900 | object.isExtension = message.isExtension;
|
23901 | return object;
|
23902 | };
|
23903 |
|
23904 | /**
|
23905 | * Converts this NamePart to JSON.
|
23906 | * @function toJSON
|
23907 | * @memberof google.protobuf.UninterpretedOption.NamePart
|
23908 | * @instance
|
23909 | * @returns {Object.<string,*>} JSON object
|
23910 | */
|
23911 | NamePart.prototype.toJSON = function toJSON() {
|
23912 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
23913 | };
|
23914 |
|
23915 | return NamePart;
|
23916 | })();
|
23917 |
|
23918 | return UninterpretedOption;
|
23919 | })();
|
23920 |
|
23921 | protobuf.SourceCodeInfo = (function() {
|
23922 |
|
23923 | /**
|
23924 | * Properties of a SourceCodeInfo.
|
23925 | * @memberof google.protobuf
|
23926 | * @interface ISourceCodeInfo
|
23927 | * @property {Array.<google.protobuf.SourceCodeInfo.ILocation>|null} [location] SourceCodeInfo location
|
23928 | */
|
23929 |
|
23930 | /**
|
23931 | * Constructs a new SourceCodeInfo.
|
23932 | * @memberof google.protobuf
|
23933 | * @classdesc Represents a SourceCodeInfo.
|
23934 | * @implements ISourceCodeInfo
|
23935 | * @constructor
|
23936 | * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set
|
23937 | */
|
23938 | function SourceCodeInfo(properties) {
|
23939 | this.location = [];
|
23940 | if (properties)
|
23941 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
23942 | if (properties[keys[i]] != null)
|
23943 | this[keys[i]] = properties[keys[i]];
|
23944 | }
|
23945 |
|
23946 | /**
|
23947 | * SourceCodeInfo location.
|
23948 | * @member {Array.<google.protobuf.SourceCodeInfo.ILocation>} location
|
23949 | * @memberof google.protobuf.SourceCodeInfo
|
23950 | * @instance
|
23951 | */
|
23952 | SourceCodeInfo.prototype.location = $util.emptyArray;
|
23953 |
|
23954 | /**
|
23955 | * Creates a new SourceCodeInfo instance using the specified properties.
|
23956 | * @function create
|
23957 | * @memberof google.protobuf.SourceCodeInfo
|
23958 | * @static
|
23959 | * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set
|
23960 | * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance
|
23961 | */
|
23962 | SourceCodeInfo.create = function create(properties) {
|
23963 | return new SourceCodeInfo(properties);
|
23964 | };
|
23965 |
|
23966 | /**
|
23967 | * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages.
|
23968 | * @function encode
|
23969 | * @memberof google.protobuf.SourceCodeInfo
|
23970 | * @static
|
23971 | * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode
|
23972 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
23973 | * @returns {$protobuf.Writer} Writer
|
23974 | */
|
23975 | SourceCodeInfo.encode = function encode(message, writer) {
|
23976 | if (!writer)
|
23977 | writer = $Writer.create();
|
23978 | if (message.location != null && message.location.length)
|
23979 | for (var i = 0; i < message.location.length; ++i)
|
23980 | $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
23981 | return writer;
|
23982 | };
|
23983 |
|
23984 | /**
|
23985 | * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages.
|
23986 | * @function encodeDelimited
|
23987 | * @memberof google.protobuf.SourceCodeInfo
|
23988 | * @static
|
23989 | * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode
|
23990 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
23991 | * @returns {$protobuf.Writer} Writer
|
23992 | */
|
23993 | SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) {
|
23994 | return this.encode(message, writer).ldelim();
|
23995 | };
|
23996 |
|
23997 | /**
|
23998 | * Decodes a SourceCodeInfo message from the specified reader or buffer.
|
23999 | * @function decode
|
24000 | * @memberof google.protobuf.SourceCodeInfo
|
24001 | * @static
|
24002 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
24003 | * @param {number} [length] Message length if known beforehand
|
24004 | * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo
|
24005 | * @throws {Error} If the payload is not a reader or valid buffer
|
24006 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
24007 | */
|
24008 | SourceCodeInfo.decode = function decode(reader, length) {
|
24009 | if (!(reader instanceof $Reader))
|
24010 | reader = $Reader.create(reader);
|
24011 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo();
|
24012 | while (reader.pos < end) {
|
24013 | var tag = reader.uint32();
|
24014 | switch (tag >>> 3) {
|
24015 | case 1:
|
24016 | if (!(message.location && message.location.length))
|
24017 | message.location = [];
|
24018 | message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32()));
|
24019 | break;
|
24020 | default:
|
24021 | reader.skipType(tag & 7);
|
24022 | break;
|
24023 | }
|
24024 | }
|
24025 | return message;
|
24026 | };
|
24027 |
|
24028 | /**
|
24029 | * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited.
|
24030 | * @function decodeDelimited
|
24031 | * @memberof google.protobuf.SourceCodeInfo
|
24032 | * @static
|
24033 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
24034 | * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo
|
24035 | * @throws {Error} If the payload is not a reader or valid buffer
|
24036 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
24037 | */
|
24038 | SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) {
|
24039 | if (!(reader instanceof $Reader))
|
24040 | reader = new $Reader(reader);
|
24041 | return this.decode(reader, reader.uint32());
|
24042 | };
|
24043 |
|
24044 | /**
|
24045 | * Verifies a SourceCodeInfo message.
|
24046 | * @function verify
|
24047 | * @memberof google.protobuf.SourceCodeInfo
|
24048 | * @static
|
24049 | * @param {Object.<string,*>} message Plain object to verify
|
24050 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
24051 | */
|
24052 | SourceCodeInfo.verify = function verify(message) {
|
24053 | if (typeof message !== "object" || message === null)
|
24054 | return "object expected";
|
24055 | if (message.location != null && message.hasOwnProperty("location")) {
|
24056 | if (!Array.isArray(message.location))
|
24057 | return "location: array expected";
|
24058 | for (var i = 0; i < message.location.length; ++i) {
|
24059 | var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]);
|
24060 | if (error)
|
24061 | return "location." + error;
|
24062 | }
|
24063 | }
|
24064 | return null;
|
24065 | };
|
24066 |
|
24067 | /**
|
24068 | * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types.
|
24069 | * @function fromObject
|
24070 | * @memberof google.protobuf.SourceCodeInfo
|
24071 | * @static
|
24072 | * @param {Object.<string,*>} object Plain object
|
24073 | * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo
|
24074 | */
|
24075 | SourceCodeInfo.fromObject = function fromObject(object) {
|
24076 | if (object instanceof $root.google.protobuf.SourceCodeInfo)
|
24077 | return object;
|
24078 | var message = new $root.google.protobuf.SourceCodeInfo();
|
24079 | if (object.location) {
|
24080 | if (!Array.isArray(object.location))
|
24081 | throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected");
|
24082 | message.location = [];
|
24083 | for (var i = 0; i < object.location.length; ++i) {
|
24084 | if (typeof object.location[i] !== "object")
|
24085 | throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected");
|
24086 | message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]);
|
24087 | }
|
24088 | }
|
24089 | return message;
|
24090 | };
|
24091 |
|
24092 | /**
|
24093 | * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified.
|
24094 | * @function toObject
|
24095 | * @memberof google.protobuf.SourceCodeInfo
|
24096 | * @static
|
24097 | * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo
|
24098 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
24099 | * @returns {Object.<string,*>} Plain object
|
24100 | */
|
24101 | SourceCodeInfo.toObject = function toObject(message, options) {
|
24102 | if (!options)
|
24103 | options = {};
|
24104 | var object = {};
|
24105 | if (options.arrays || options.defaults)
|
24106 | object.location = [];
|
24107 | if (message.location && message.location.length) {
|
24108 | object.location = [];
|
24109 | for (var j = 0; j < message.location.length; ++j)
|
24110 | object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options);
|
24111 | }
|
24112 | return object;
|
24113 | };
|
24114 |
|
24115 | /**
|
24116 | * Converts this SourceCodeInfo to JSON.
|
24117 | * @function toJSON
|
24118 | * @memberof google.protobuf.SourceCodeInfo
|
24119 | * @instance
|
24120 | * @returns {Object.<string,*>} JSON object
|
24121 | */
|
24122 | SourceCodeInfo.prototype.toJSON = function toJSON() {
|
24123 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
24124 | };
|
24125 |
|
24126 | SourceCodeInfo.Location = (function() {
|
24127 |
|
24128 | /**
|
24129 | * Properties of a Location.
|
24130 | * @memberof google.protobuf.SourceCodeInfo
|
24131 | * @interface ILocation
|
24132 | * @property {Array.<number>|null} [path] Location path
|
24133 | * @property {Array.<number>|null} [span] Location span
|
24134 | * @property {string|null} [leadingComments] Location leadingComments
|
24135 | * @property {string|null} [trailingComments] Location trailingComments
|
24136 | * @property {Array.<string>|null} [leadingDetachedComments] Location leadingDetachedComments
|
24137 | */
|
24138 |
|
24139 | /**
|
24140 | * Constructs a new Location.
|
24141 | * @memberof google.protobuf.SourceCodeInfo
|
24142 | * @classdesc Represents a Location.
|
24143 | * @implements ILocation
|
24144 | * @constructor
|
24145 | * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set
|
24146 | */
|
24147 | function Location(properties) {
|
24148 | this.path = [];
|
24149 | this.span = [];
|
24150 | this.leadingDetachedComments = [];
|
24151 | if (properties)
|
24152 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
24153 | if (properties[keys[i]] != null)
|
24154 | this[keys[i]] = properties[keys[i]];
|
24155 | }
|
24156 |
|
24157 | /**
|
24158 | * Location path.
|
24159 | * @member {Array.<number>} path
|
24160 | * @memberof google.protobuf.SourceCodeInfo.Location
|
24161 | * @instance
|
24162 | */
|
24163 | Location.prototype.path = $util.emptyArray;
|
24164 |
|
24165 | /**
|
24166 | * Location span.
|
24167 | * @member {Array.<number>} span
|
24168 | * @memberof google.protobuf.SourceCodeInfo.Location
|
24169 | * @instance
|
24170 | */
|
24171 | Location.prototype.span = $util.emptyArray;
|
24172 |
|
24173 | /**
|
24174 | * Location leadingComments.
|
24175 | * @member {string} leadingComments
|
24176 | * @memberof google.protobuf.SourceCodeInfo.Location
|
24177 | * @instance
|
24178 | */
|
24179 | Location.prototype.leadingComments = "";
|
24180 |
|
24181 | /**
|
24182 | * Location trailingComments.
|
24183 | * @member {string} trailingComments
|
24184 | * @memberof google.protobuf.SourceCodeInfo.Location
|
24185 | * @instance
|
24186 | */
|
24187 | Location.prototype.trailingComments = "";
|
24188 |
|
24189 | /**
|
24190 | * Location leadingDetachedComments.
|
24191 | * @member {Array.<string>} leadingDetachedComments
|
24192 | * @memberof google.protobuf.SourceCodeInfo.Location
|
24193 | * @instance
|
24194 | */
|
24195 | Location.prototype.leadingDetachedComments = $util.emptyArray;
|
24196 |
|
24197 | /**
|
24198 | * Creates a new Location instance using the specified properties.
|
24199 | * @function create
|
24200 | * @memberof google.protobuf.SourceCodeInfo.Location
|
24201 | * @static
|
24202 | * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set
|
24203 | * @returns {google.protobuf.SourceCodeInfo.Location} Location instance
|
24204 | */
|
24205 | Location.create = function create(properties) {
|
24206 | return new Location(properties);
|
24207 | };
|
24208 |
|
24209 | /**
|
24210 | * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages.
|
24211 | * @function encode
|
24212 | * @memberof google.protobuf.SourceCodeInfo.Location
|
24213 | * @static
|
24214 | * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode
|
24215 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
24216 | * @returns {$protobuf.Writer} Writer
|
24217 | */
|
24218 | Location.encode = function encode(message, writer) {
|
24219 | if (!writer)
|
24220 | writer = $Writer.create();
|
24221 | if (message.path != null && message.path.length) {
|
24222 | writer.uint32(/* id 1, wireType 2 =*/10).fork();
|
24223 | for (var i = 0; i < message.path.length; ++i)
|
24224 | writer.int32(message.path[i]);
|
24225 | writer.ldelim();
|
24226 | }
|
24227 | if (message.span != null && message.span.length) {
|
24228 | writer.uint32(/* id 2, wireType 2 =*/18).fork();
|
24229 | for (var i = 0; i < message.span.length; ++i)
|
24230 | writer.int32(message.span[i]);
|
24231 | writer.ldelim();
|
24232 | }
|
24233 | if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments"))
|
24234 | writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments);
|
24235 | if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments"))
|
24236 | writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments);
|
24237 | if (message.leadingDetachedComments != null && message.leadingDetachedComments.length)
|
24238 | for (var i = 0; i < message.leadingDetachedComments.length; ++i)
|
24239 | writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]);
|
24240 | return writer;
|
24241 | };
|
24242 |
|
24243 | /**
|
24244 | * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages.
|
24245 | * @function encodeDelimited
|
24246 | * @memberof google.protobuf.SourceCodeInfo.Location
|
24247 | * @static
|
24248 | * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode
|
24249 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
24250 | * @returns {$protobuf.Writer} Writer
|
24251 | */
|
24252 | Location.encodeDelimited = function encodeDelimited(message, writer) {
|
24253 | return this.encode(message, writer).ldelim();
|
24254 | };
|
24255 |
|
24256 | /**
|
24257 | * Decodes a Location message from the specified reader or buffer.
|
24258 | * @function decode
|
24259 | * @memberof google.protobuf.SourceCodeInfo.Location
|
24260 | * @static
|
24261 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
24262 | * @param {number} [length] Message length if known beforehand
|
24263 | * @returns {google.protobuf.SourceCodeInfo.Location} Location
|
24264 | * @throws {Error} If the payload is not a reader or valid buffer
|
24265 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
24266 | */
|
24267 | Location.decode = function decode(reader, length) {
|
24268 | if (!(reader instanceof $Reader))
|
24269 | reader = $Reader.create(reader);
|
24270 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location();
|
24271 | while (reader.pos < end) {
|
24272 | var tag = reader.uint32();
|
24273 | switch (tag >>> 3) {
|
24274 | case 1:
|
24275 | if (!(message.path && message.path.length))
|
24276 | message.path = [];
|
24277 | if ((tag & 7) === 2) {
|
24278 | var end2 = reader.uint32() + reader.pos;
|
24279 | while (reader.pos < end2)
|
24280 | message.path.push(reader.int32());
|
24281 | } else
|
24282 | message.path.push(reader.int32());
|
24283 | break;
|
24284 | case 2:
|
24285 | if (!(message.span && message.span.length))
|
24286 | message.span = [];
|
24287 | if ((tag & 7) === 2) {
|
24288 | var end2 = reader.uint32() + reader.pos;
|
24289 | while (reader.pos < end2)
|
24290 | message.span.push(reader.int32());
|
24291 | } else
|
24292 | message.span.push(reader.int32());
|
24293 | break;
|
24294 | case 3:
|
24295 | message.leadingComments = reader.string();
|
24296 | break;
|
24297 | case 4:
|
24298 | message.trailingComments = reader.string();
|
24299 | break;
|
24300 | case 6:
|
24301 | if (!(message.leadingDetachedComments && message.leadingDetachedComments.length))
|
24302 | message.leadingDetachedComments = [];
|
24303 | message.leadingDetachedComments.push(reader.string());
|
24304 | break;
|
24305 | default:
|
24306 | reader.skipType(tag & 7);
|
24307 | break;
|
24308 | }
|
24309 | }
|
24310 | return message;
|
24311 | };
|
24312 |
|
24313 | /**
|
24314 | * Decodes a Location message from the specified reader or buffer, length delimited.
|
24315 | * @function decodeDelimited
|
24316 | * @memberof google.protobuf.SourceCodeInfo.Location
|
24317 | * @static
|
24318 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
24319 | * @returns {google.protobuf.SourceCodeInfo.Location} Location
|
24320 | * @throws {Error} If the payload is not a reader or valid buffer
|
24321 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
24322 | */
|
24323 | Location.decodeDelimited = function decodeDelimited(reader) {
|
24324 | if (!(reader instanceof $Reader))
|
24325 | reader = new $Reader(reader);
|
24326 | return this.decode(reader, reader.uint32());
|
24327 | };
|
24328 |
|
24329 | /**
|
24330 | * Verifies a Location message.
|
24331 | * @function verify
|
24332 | * @memberof google.protobuf.SourceCodeInfo.Location
|
24333 | * @static
|
24334 | * @param {Object.<string,*>} message Plain object to verify
|
24335 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
24336 | */
|
24337 | Location.verify = function verify(message) {
|
24338 | if (typeof message !== "object" || message === null)
|
24339 | return "object expected";
|
24340 | if (message.path != null && message.hasOwnProperty("path")) {
|
24341 | if (!Array.isArray(message.path))
|
24342 | return "path: array expected";
|
24343 | for (var i = 0; i < message.path.length; ++i)
|
24344 | if (!$util.isInteger(message.path[i]))
|
24345 | return "path: integer[] expected";
|
24346 | }
|
24347 | if (message.span != null && message.hasOwnProperty("span")) {
|
24348 | if (!Array.isArray(message.span))
|
24349 | return "span: array expected";
|
24350 | for (var i = 0; i < message.span.length; ++i)
|
24351 | if (!$util.isInteger(message.span[i]))
|
24352 | return "span: integer[] expected";
|
24353 | }
|
24354 | if (message.leadingComments != null && message.hasOwnProperty("leadingComments"))
|
24355 | if (!$util.isString(message.leadingComments))
|
24356 | return "leadingComments: string expected";
|
24357 | if (message.trailingComments != null && message.hasOwnProperty("trailingComments"))
|
24358 | if (!$util.isString(message.trailingComments))
|
24359 | return "trailingComments: string expected";
|
24360 | if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) {
|
24361 | if (!Array.isArray(message.leadingDetachedComments))
|
24362 | return "leadingDetachedComments: array expected";
|
24363 | for (var i = 0; i < message.leadingDetachedComments.length; ++i)
|
24364 | if (!$util.isString(message.leadingDetachedComments[i]))
|
24365 | return "leadingDetachedComments: string[] expected";
|
24366 | }
|
24367 | return null;
|
24368 | };
|
24369 |
|
24370 | /**
|
24371 | * Creates a Location message from a plain object. Also converts values to their respective internal types.
|
24372 | * @function fromObject
|
24373 | * @memberof google.protobuf.SourceCodeInfo.Location
|
24374 | * @static
|
24375 | * @param {Object.<string,*>} object Plain object
|
24376 | * @returns {google.protobuf.SourceCodeInfo.Location} Location
|
24377 | */
|
24378 | Location.fromObject = function fromObject(object) {
|
24379 | if (object instanceof $root.google.protobuf.SourceCodeInfo.Location)
|
24380 | return object;
|
24381 | var message = new $root.google.protobuf.SourceCodeInfo.Location();
|
24382 | if (object.path) {
|
24383 | if (!Array.isArray(object.path))
|
24384 | throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected");
|
24385 | message.path = [];
|
24386 | for (var i = 0; i < object.path.length; ++i)
|
24387 | message.path[i] = object.path[i] | 0;
|
24388 | }
|
24389 | if (object.span) {
|
24390 | if (!Array.isArray(object.span))
|
24391 | throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected");
|
24392 | message.span = [];
|
24393 | for (var i = 0; i < object.span.length; ++i)
|
24394 | message.span[i] = object.span[i] | 0;
|
24395 | }
|
24396 | if (object.leadingComments != null)
|
24397 | message.leadingComments = String(object.leadingComments);
|
24398 | if (object.trailingComments != null)
|
24399 | message.trailingComments = String(object.trailingComments);
|
24400 | if (object.leadingDetachedComments) {
|
24401 | if (!Array.isArray(object.leadingDetachedComments))
|
24402 | throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected");
|
24403 | message.leadingDetachedComments = [];
|
24404 | for (var i = 0; i < object.leadingDetachedComments.length; ++i)
|
24405 | message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]);
|
24406 | }
|
24407 | return message;
|
24408 | };
|
24409 |
|
24410 | /**
|
24411 | * Creates a plain object from a Location message. Also converts values to other types if specified.
|
24412 | * @function toObject
|
24413 | * @memberof google.protobuf.SourceCodeInfo.Location
|
24414 | * @static
|
24415 | * @param {google.protobuf.SourceCodeInfo.Location} message Location
|
24416 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
24417 | * @returns {Object.<string,*>} Plain object
|
24418 | */
|
24419 | Location.toObject = function toObject(message, options) {
|
24420 | if (!options)
|
24421 | options = {};
|
24422 | var object = {};
|
24423 | if (options.arrays || options.defaults) {
|
24424 | object.path = [];
|
24425 | object.span = [];
|
24426 | object.leadingDetachedComments = [];
|
24427 | }
|
24428 | if (options.defaults) {
|
24429 | object.leadingComments = "";
|
24430 | object.trailingComments = "";
|
24431 | }
|
24432 | if (message.path && message.path.length) {
|
24433 | object.path = [];
|
24434 | for (var j = 0; j < message.path.length; ++j)
|
24435 | object.path[j] = message.path[j];
|
24436 | }
|
24437 | if (message.span && message.span.length) {
|
24438 | object.span = [];
|
24439 | for (var j = 0; j < message.span.length; ++j)
|
24440 | object.span[j] = message.span[j];
|
24441 | }
|
24442 | if (message.leadingComments != null && message.hasOwnProperty("leadingComments"))
|
24443 | object.leadingComments = message.leadingComments;
|
24444 | if (message.trailingComments != null && message.hasOwnProperty("trailingComments"))
|
24445 | object.trailingComments = message.trailingComments;
|
24446 | if (message.leadingDetachedComments && message.leadingDetachedComments.length) {
|
24447 | object.leadingDetachedComments = [];
|
24448 | for (var j = 0; j < message.leadingDetachedComments.length; ++j)
|
24449 | object.leadingDetachedComments[j] = message.leadingDetachedComments[j];
|
24450 | }
|
24451 | return object;
|
24452 | };
|
24453 |
|
24454 | /**
|
24455 | * Converts this Location to JSON.
|
24456 | * @function toJSON
|
24457 | * @memberof google.protobuf.SourceCodeInfo.Location
|
24458 | * @instance
|
24459 | * @returns {Object.<string,*>} JSON object
|
24460 | */
|
24461 | Location.prototype.toJSON = function toJSON() {
|
24462 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
24463 | };
|
24464 |
|
24465 | return Location;
|
24466 | })();
|
24467 |
|
24468 | return SourceCodeInfo;
|
24469 | })();
|
24470 |
|
24471 | protobuf.GeneratedCodeInfo = (function() {
|
24472 |
|
24473 | /**
|
24474 | * Properties of a GeneratedCodeInfo.
|
24475 | * @memberof google.protobuf
|
24476 | * @interface IGeneratedCodeInfo
|
24477 | * @property {Array.<google.protobuf.GeneratedCodeInfo.IAnnotation>|null} [annotation] GeneratedCodeInfo annotation
|
24478 | */
|
24479 |
|
24480 | /**
|
24481 | * Constructs a new GeneratedCodeInfo.
|
24482 | * @memberof google.protobuf
|
24483 | * @classdesc Represents a GeneratedCodeInfo.
|
24484 | * @implements IGeneratedCodeInfo
|
24485 | * @constructor
|
24486 | * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set
|
24487 | */
|
24488 | function GeneratedCodeInfo(properties) {
|
24489 | this.annotation = [];
|
24490 | if (properties)
|
24491 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
24492 | if (properties[keys[i]] != null)
|
24493 | this[keys[i]] = properties[keys[i]];
|
24494 | }
|
24495 |
|
24496 | /**
|
24497 | * GeneratedCodeInfo annotation.
|
24498 | * @member {Array.<google.protobuf.GeneratedCodeInfo.IAnnotation>} annotation
|
24499 | * @memberof google.protobuf.GeneratedCodeInfo
|
24500 | * @instance
|
24501 | */
|
24502 | GeneratedCodeInfo.prototype.annotation = $util.emptyArray;
|
24503 |
|
24504 | /**
|
24505 | * Creates a new GeneratedCodeInfo instance using the specified properties.
|
24506 | * @function create
|
24507 | * @memberof google.protobuf.GeneratedCodeInfo
|
24508 | * @static
|
24509 | * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set
|
24510 | * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance
|
24511 | */
|
24512 | GeneratedCodeInfo.create = function create(properties) {
|
24513 | return new GeneratedCodeInfo(properties);
|
24514 | };
|
24515 |
|
24516 | /**
|
24517 | * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages.
|
24518 | * @function encode
|
24519 | * @memberof google.protobuf.GeneratedCodeInfo
|
24520 | * @static
|
24521 | * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode
|
24522 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
24523 | * @returns {$protobuf.Writer} Writer
|
24524 | */
|
24525 | GeneratedCodeInfo.encode = function encode(message, writer) {
|
24526 | if (!writer)
|
24527 | writer = $Writer.create();
|
24528 | if (message.annotation != null && message.annotation.length)
|
24529 | for (var i = 0; i < message.annotation.length; ++i)
|
24530 | $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
24531 | return writer;
|
24532 | };
|
24533 |
|
24534 | /**
|
24535 | * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages.
|
24536 | * @function encodeDelimited
|
24537 | * @memberof google.protobuf.GeneratedCodeInfo
|
24538 | * @static
|
24539 | * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode
|
24540 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
24541 | * @returns {$protobuf.Writer} Writer
|
24542 | */
|
24543 | GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) {
|
24544 | return this.encode(message, writer).ldelim();
|
24545 | };
|
24546 |
|
24547 | /**
|
24548 | * Decodes a GeneratedCodeInfo message from the specified reader or buffer.
|
24549 | * @function decode
|
24550 | * @memberof google.protobuf.GeneratedCodeInfo
|
24551 | * @static
|
24552 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
24553 | * @param {number} [length] Message length if known beforehand
|
24554 | * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo
|
24555 | * @throws {Error} If the payload is not a reader or valid buffer
|
24556 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
24557 | */
|
24558 | GeneratedCodeInfo.decode = function decode(reader, length) {
|
24559 | if (!(reader instanceof $Reader))
|
24560 | reader = $Reader.create(reader);
|
24561 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo();
|
24562 | while (reader.pos < end) {
|
24563 | var tag = reader.uint32();
|
24564 | switch (tag >>> 3) {
|
24565 | case 1:
|
24566 | if (!(message.annotation && message.annotation.length))
|
24567 | message.annotation = [];
|
24568 | message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32()));
|
24569 | break;
|
24570 | default:
|
24571 | reader.skipType(tag & 7);
|
24572 | break;
|
24573 | }
|
24574 | }
|
24575 | return message;
|
24576 | };
|
24577 |
|
24578 | /**
|
24579 | * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited.
|
24580 | * @function decodeDelimited
|
24581 | * @memberof google.protobuf.GeneratedCodeInfo
|
24582 | * @static
|
24583 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
24584 | * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo
|
24585 | * @throws {Error} If the payload is not a reader or valid buffer
|
24586 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
24587 | */
|
24588 | GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) {
|
24589 | if (!(reader instanceof $Reader))
|
24590 | reader = new $Reader(reader);
|
24591 | return this.decode(reader, reader.uint32());
|
24592 | };
|
24593 |
|
24594 | /**
|
24595 | * Verifies a GeneratedCodeInfo message.
|
24596 | * @function verify
|
24597 | * @memberof google.protobuf.GeneratedCodeInfo
|
24598 | * @static
|
24599 | * @param {Object.<string,*>} message Plain object to verify
|
24600 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
24601 | */
|
24602 | GeneratedCodeInfo.verify = function verify(message) {
|
24603 | if (typeof message !== "object" || message === null)
|
24604 | return "object expected";
|
24605 | if (message.annotation != null && message.hasOwnProperty("annotation")) {
|
24606 | if (!Array.isArray(message.annotation))
|
24607 | return "annotation: array expected";
|
24608 | for (var i = 0; i < message.annotation.length; ++i) {
|
24609 | var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]);
|
24610 | if (error)
|
24611 | return "annotation." + error;
|
24612 | }
|
24613 | }
|
24614 | return null;
|
24615 | };
|
24616 |
|
24617 | /**
|
24618 | * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types.
|
24619 | * @function fromObject
|
24620 | * @memberof google.protobuf.GeneratedCodeInfo
|
24621 | * @static
|
24622 | * @param {Object.<string,*>} object Plain object
|
24623 | * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo
|
24624 | */
|
24625 | GeneratedCodeInfo.fromObject = function fromObject(object) {
|
24626 | if (object instanceof $root.google.protobuf.GeneratedCodeInfo)
|
24627 | return object;
|
24628 | var message = new $root.google.protobuf.GeneratedCodeInfo();
|
24629 | if (object.annotation) {
|
24630 | if (!Array.isArray(object.annotation))
|
24631 | throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected");
|
24632 | message.annotation = [];
|
24633 | for (var i = 0; i < object.annotation.length; ++i) {
|
24634 | if (typeof object.annotation[i] !== "object")
|
24635 | throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected");
|
24636 | message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]);
|
24637 | }
|
24638 | }
|
24639 | return message;
|
24640 | };
|
24641 |
|
24642 | /**
|
24643 | * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified.
|
24644 | * @function toObject
|
24645 | * @memberof google.protobuf.GeneratedCodeInfo
|
24646 | * @static
|
24647 | * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo
|
24648 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
24649 | * @returns {Object.<string,*>} Plain object
|
24650 | */
|
24651 | GeneratedCodeInfo.toObject = function toObject(message, options) {
|
24652 | if (!options)
|
24653 | options = {};
|
24654 | var object = {};
|
24655 | if (options.arrays || options.defaults)
|
24656 | object.annotation = [];
|
24657 | if (message.annotation && message.annotation.length) {
|
24658 | object.annotation = [];
|
24659 | for (var j = 0; j < message.annotation.length; ++j)
|
24660 | object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options);
|
24661 | }
|
24662 | return object;
|
24663 | };
|
24664 |
|
24665 | /**
|
24666 | * Converts this GeneratedCodeInfo to JSON.
|
24667 | * @function toJSON
|
24668 | * @memberof google.protobuf.GeneratedCodeInfo
|
24669 | * @instance
|
24670 | * @returns {Object.<string,*>} JSON object
|
24671 | */
|
24672 | GeneratedCodeInfo.prototype.toJSON = function toJSON() {
|
24673 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
24674 | };
|
24675 |
|
24676 | GeneratedCodeInfo.Annotation = (function() {
|
24677 |
|
24678 | /**
|
24679 | * Properties of an Annotation.
|
24680 | * @memberof google.protobuf.GeneratedCodeInfo
|
24681 | * @interface IAnnotation
|
24682 | * @property {Array.<number>|null} [path] Annotation path
|
24683 | * @property {string|null} [sourceFile] Annotation sourceFile
|
24684 | * @property {number|null} [begin] Annotation begin
|
24685 | * @property {number|null} [end] Annotation end
|
24686 | */
|
24687 |
|
24688 | /**
|
24689 | * Constructs a new Annotation.
|
24690 | * @memberof google.protobuf.GeneratedCodeInfo
|
24691 | * @classdesc Represents an Annotation.
|
24692 | * @implements IAnnotation
|
24693 | * @constructor
|
24694 | * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set
|
24695 | */
|
24696 | function Annotation(properties) {
|
24697 | this.path = [];
|
24698 | if (properties)
|
24699 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
24700 | if (properties[keys[i]] != null)
|
24701 | this[keys[i]] = properties[keys[i]];
|
24702 | }
|
24703 |
|
24704 | /**
|
24705 | * Annotation path.
|
24706 | * @member {Array.<number>} path
|
24707 | * @memberof google.protobuf.GeneratedCodeInfo.Annotation
|
24708 | * @instance
|
24709 | */
|
24710 | Annotation.prototype.path = $util.emptyArray;
|
24711 |
|
24712 | /**
|
24713 | * Annotation sourceFile.
|
24714 | * @member {string} sourceFile
|
24715 | * @memberof google.protobuf.GeneratedCodeInfo.Annotation
|
24716 | * @instance
|
24717 | */
|
24718 | Annotation.prototype.sourceFile = "";
|
24719 |
|
24720 | /**
|
24721 | * Annotation begin.
|
24722 | * @member {number} begin
|
24723 | * @memberof google.protobuf.GeneratedCodeInfo.Annotation
|
24724 | * @instance
|
24725 | */
|
24726 | Annotation.prototype.begin = 0;
|
24727 |
|
24728 | /**
|
24729 | * Annotation end.
|
24730 | * @member {number} end
|
24731 | * @memberof google.protobuf.GeneratedCodeInfo.Annotation
|
24732 | * @instance
|
24733 | */
|
24734 | Annotation.prototype.end = 0;
|
24735 |
|
24736 | /**
|
24737 | * Creates a new Annotation instance using the specified properties.
|
24738 | * @function create
|
24739 | * @memberof google.protobuf.GeneratedCodeInfo.Annotation
|
24740 | * @static
|
24741 | * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set
|
24742 | * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance
|
24743 | */
|
24744 | Annotation.create = function create(properties) {
|
24745 | return new Annotation(properties);
|
24746 | };
|
24747 |
|
24748 | /**
|
24749 | * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages.
|
24750 | * @function encode
|
24751 | * @memberof google.protobuf.GeneratedCodeInfo.Annotation
|
24752 | * @static
|
24753 | * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode
|
24754 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
24755 | * @returns {$protobuf.Writer} Writer
|
24756 | */
|
24757 | Annotation.encode = function encode(message, writer) {
|
24758 | if (!writer)
|
24759 | writer = $Writer.create();
|
24760 | if (message.path != null && message.path.length) {
|
24761 | writer.uint32(/* id 1, wireType 2 =*/10).fork();
|
24762 | for (var i = 0; i < message.path.length; ++i)
|
24763 | writer.int32(message.path[i]);
|
24764 | writer.ldelim();
|
24765 | }
|
24766 | if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile"))
|
24767 | writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile);
|
24768 | if (message.begin != null && Object.hasOwnProperty.call(message, "begin"))
|
24769 | writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin);
|
24770 | if (message.end != null && Object.hasOwnProperty.call(message, "end"))
|
24771 | writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end);
|
24772 | return writer;
|
24773 | };
|
24774 |
|
24775 | /**
|
24776 | * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages.
|
24777 | * @function encodeDelimited
|
24778 | * @memberof google.protobuf.GeneratedCodeInfo.Annotation
|
24779 | * @static
|
24780 | * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode
|
24781 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
24782 | * @returns {$protobuf.Writer} Writer
|
24783 | */
|
24784 | Annotation.encodeDelimited = function encodeDelimited(message, writer) {
|
24785 | return this.encode(message, writer).ldelim();
|
24786 | };
|
24787 |
|
24788 | /**
|
24789 | * Decodes an Annotation message from the specified reader or buffer.
|
24790 | * @function decode
|
24791 | * @memberof google.protobuf.GeneratedCodeInfo.Annotation
|
24792 | * @static
|
24793 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
24794 | * @param {number} [length] Message length if known beforehand
|
24795 | * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation
|
24796 | * @throws {Error} If the payload is not a reader or valid buffer
|
24797 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
24798 | */
|
24799 | Annotation.decode = function decode(reader, length) {
|
24800 | if (!(reader instanceof $Reader))
|
24801 | reader = $Reader.create(reader);
|
24802 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation();
|
24803 | while (reader.pos < end) {
|
24804 | var tag = reader.uint32();
|
24805 | switch (tag >>> 3) {
|
24806 | case 1:
|
24807 | if (!(message.path && message.path.length))
|
24808 | message.path = [];
|
24809 | if ((tag & 7) === 2) {
|
24810 | var end2 = reader.uint32() + reader.pos;
|
24811 | while (reader.pos < end2)
|
24812 | message.path.push(reader.int32());
|
24813 | } else
|
24814 | message.path.push(reader.int32());
|
24815 | break;
|
24816 | case 2:
|
24817 | message.sourceFile = reader.string();
|
24818 | break;
|
24819 | case 3:
|
24820 | message.begin = reader.int32();
|
24821 | break;
|
24822 | case 4:
|
24823 | message.end = reader.int32();
|
24824 | break;
|
24825 | default:
|
24826 | reader.skipType(tag & 7);
|
24827 | break;
|
24828 | }
|
24829 | }
|
24830 | return message;
|
24831 | };
|
24832 |
|
24833 | /**
|
24834 | * Decodes an Annotation message from the specified reader or buffer, length delimited.
|
24835 | * @function decodeDelimited
|
24836 | * @memberof google.protobuf.GeneratedCodeInfo.Annotation
|
24837 | * @static
|
24838 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
24839 | * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation
|
24840 | * @throws {Error} If the payload is not a reader or valid buffer
|
24841 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
24842 | */
|
24843 | Annotation.decodeDelimited = function decodeDelimited(reader) {
|
24844 | if (!(reader instanceof $Reader))
|
24845 | reader = new $Reader(reader);
|
24846 | return this.decode(reader, reader.uint32());
|
24847 | };
|
24848 |
|
24849 | /**
|
24850 | * Verifies an Annotation message.
|
24851 | * @function verify
|
24852 | * @memberof google.protobuf.GeneratedCodeInfo.Annotation
|
24853 | * @static
|
24854 | * @param {Object.<string,*>} message Plain object to verify
|
24855 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
24856 | */
|
24857 | Annotation.verify = function verify(message) {
|
24858 | if (typeof message !== "object" || message === null)
|
24859 | return "object expected";
|
24860 | if (message.path != null && message.hasOwnProperty("path")) {
|
24861 | if (!Array.isArray(message.path))
|
24862 | return "path: array expected";
|
24863 | for (var i = 0; i < message.path.length; ++i)
|
24864 | if (!$util.isInteger(message.path[i]))
|
24865 | return "path: integer[] expected";
|
24866 | }
|
24867 | if (message.sourceFile != null && message.hasOwnProperty("sourceFile"))
|
24868 | if (!$util.isString(message.sourceFile))
|
24869 | return "sourceFile: string expected";
|
24870 | if (message.begin != null && message.hasOwnProperty("begin"))
|
24871 | if (!$util.isInteger(message.begin))
|
24872 | return "begin: integer expected";
|
24873 | if (message.end != null && message.hasOwnProperty("end"))
|
24874 | if (!$util.isInteger(message.end))
|
24875 | return "end: integer expected";
|
24876 | return null;
|
24877 | };
|
24878 |
|
24879 | /**
|
24880 | * Creates an Annotation message from a plain object. Also converts values to their respective internal types.
|
24881 | * @function fromObject
|
24882 | * @memberof google.protobuf.GeneratedCodeInfo.Annotation
|
24883 | * @static
|
24884 | * @param {Object.<string,*>} object Plain object
|
24885 | * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation
|
24886 | */
|
24887 | Annotation.fromObject = function fromObject(object) {
|
24888 | if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation)
|
24889 | return object;
|
24890 | var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation();
|
24891 | if (object.path) {
|
24892 | if (!Array.isArray(object.path))
|
24893 | throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected");
|
24894 | message.path = [];
|
24895 | for (var i = 0; i < object.path.length; ++i)
|
24896 | message.path[i] = object.path[i] | 0;
|
24897 | }
|
24898 | if (object.sourceFile != null)
|
24899 | message.sourceFile = String(object.sourceFile);
|
24900 | if (object.begin != null)
|
24901 | message.begin = object.begin | 0;
|
24902 | if (object.end != null)
|
24903 | message.end = object.end | 0;
|
24904 | return message;
|
24905 | };
|
24906 |
|
24907 | /**
|
24908 | * Creates a plain object from an Annotation message. Also converts values to other types if specified.
|
24909 | * @function toObject
|
24910 | * @memberof google.protobuf.GeneratedCodeInfo.Annotation
|
24911 | * @static
|
24912 | * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation
|
24913 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
24914 | * @returns {Object.<string,*>} Plain object
|
24915 | */
|
24916 | Annotation.toObject = function toObject(message, options) {
|
24917 | if (!options)
|
24918 | options = {};
|
24919 | var object = {};
|
24920 | if (options.arrays || options.defaults)
|
24921 | object.path = [];
|
24922 | if (options.defaults) {
|
24923 | object.sourceFile = "";
|
24924 | object.begin = 0;
|
24925 | object.end = 0;
|
24926 | }
|
24927 | if (message.path && message.path.length) {
|
24928 | object.path = [];
|
24929 | for (var j = 0; j < message.path.length; ++j)
|
24930 | object.path[j] = message.path[j];
|
24931 | }
|
24932 | if (message.sourceFile != null && message.hasOwnProperty("sourceFile"))
|
24933 | object.sourceFile = message.sourceFile;
|
24934 | if (message.begin != null && message.hasOwnProperty("begin"))
|
24935 | object.begin = message.begin;
|
24936 | if (message.end != null && message.hasOwnProperty("end"))
|
24937 | object.end = message.end;
|
24938 | return object;
|
24939 | };
|
24940 |
|
24941 | /**
|
24942 | * Converts this Annotation to JSON.
|
24943 | * @function toJSON
|
24944 | * @memberof google.protobuf.GeneratedCodeInfo.Annotation
|
24945 | * @instance
|
24946 | * @returns {Object.<string,*>} JSON object
|
24947 | */
|
24948 | Annotation.prototype.toJSON = function toJSON() {
|
24949 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
24950 | };
|
24951 |
|
24952 | return Annotation;
|
24953 | })();
|
24954 |
|
24955 | return GeneratedCodeInfo;
|
24956 | })();
|
24957 |
|
24958 | protobuf.Any = (function() {
|
24959 |
|
24960 | /**
|
24961 | * Properties of an Any.
|
24962 | * @memberof google.protobuf
|
24963 | * @interface IAny
|
24964 | * @property {string|null} [type_url] Any type_url
|
24965 | * @property {Uint8Array|null} [value] Any value
|
24966 | */
|
24967 |
|
24968 | /**
|
24969 | * Constructs a new Any.
|
24970 | * @memberof google.protobuf
|
24971 | * @classdesc Represents an Any.
|
24972 | * @implements IAny
|
24973 | * @constructor
|
24974 | * @param {google.protobuf.IAny=} [properties] Properties to set
|
24975 | */
|
24976 | function Any(properties) {
|
24977 | if (properties)
|
24978 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
24979 | if (properties[keys[i]] != null)
|
24980 | this[keys[i]] = properties[keys[i]];
|
24981 | }
|
24982 |
|
24983 | /**
|
24984 | * Any type_url.
|
24985 | * @member {string} type_url
|
24986 | * @memberof google.protobuf.Any
|
24987 | * @instance
|
24988 | */
|
24989 | Any.prototype.type_url = "";
|
24990 |
|
24991 | /**
|
24992 | * Any value.
|
24993 | * @member {Uint8Array} value
|
24994 | * @memberof google.protobuf.Any
|
24995 | * @instance
|
24996 | */
|
24997 | Any.prototype.value = $util.newBuffer([]);
|
24998 |
|
24999 | /**
|
25000 | * Creates a new Any instance using the specified properties.
|
25001 | * @function create
|
25002 | * @memberof google.protobuf.Any
|
25003 | * @static
|
25004 | * @param {google.protobuf.IAny=} [properties] Properties to set
|
25005 | * @returns {google.protobuf.Any} Any instance
|
25006 | */
|
25007 | Any.create = function create(properties) {
|
25008 | return new Any(properties);
|
25009 | };
|
25010 |
|
25011 | /**
|
25012 | * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages.
|
25013 | * @function encode
|
25014 | * @memberof google.protobuf.Any
|
25015 | * @static
|
25016 | * @param {google.protobuf.IAny} message Any message or plain object to encode
|
25017 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
25018 | * @returns {$protobuf.Writer} Writer
|
25019 | */
|
25020 | Any.encode = function encode(message, writer) {
|
25021 | if (!writer)
|
25022 | writer = $Writer.create();
|
25023 | if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url"))
|
25024 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url);
|
25025 | if (message.value != null && Object.hasOwnProperty.call(message, "value"))
|
25026 | writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value);
|
25027 | return writer;
|
25028 | };
|
25029 |
|
25030 | /**
|
25031 | * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages.
|
25032 | * @function encodeDelimited
|
25033 | * @memberof google.protobuf.Any
|
25034 | * @static
|
25035 | * @param {google.protobuf.IAny} message Any message or plain object to encode
|
25036 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
25037 | * @returns {$protobuf.Writer} Writer
|
25038 | */
|
25039 | Any.encodeDelimited = function encodeDelimited(message, writer) {
|
25040 | return this.encode(message, writer).ldelim();
|
25041 | };
|
25042 |
|
25043 | /**
|
25044 | * Decodes an Any message from the specified reader or buffer.
|
25045 | * @function decode
|
25046 | * @memberof google.protobuf.Any
|
25047 | * @static
|
25048 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
25049 | * @param {number} [length] Message length if known beforehand
|
25050 | * @returns {google.protobuf.Any} Any
|
25051 | * @throws {Error} If the payload is not a reader or valid buffer
|
25052 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
25053 | */
|
25054 | Any.decode = function decode(reader, length) {
|
25055 | if (!(reader instanceof $Reader))
|
25056 | reader = $Reader.create(reader);
|
25057 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any();
|
25058 | while (reader.pos < end) {
|
25059 | var tag = reader.uint32();
|
25060 | switch (tag >>> 3) {
|
25061 | case 1:
|
25062 | message.type_url = reader.string();
|
25063 | break;
|
25064 | case 2:
|
25065 | message.value = reader.bytes();
|
25066 | break;
|
25067 | default:
|
25068 | reader.skipType(tag & 7);
|
25069 | break;
|
25070 | }
|
25071 | }
|
25072 | return message;
|
25073 | };
|
25074 |
|
25075 | /**
|
25076 | * Decodes an Any message from the specified reader or buffer, length delimited.
|
25077 | * @function decodeDelimited
|
25078 | * @memberof google.protobuf.Any
|
25079 | * @static
|
25080 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
25081 | * @returns {google.protobuf.Any} Any
|
25082 | * @throws {Error} If the payload is not a reader or valid buffer
|
25083 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
25084 | */
|
25085 | Any.decodeDelimited = function decodeDelimited(reader) {
|
25086 | if (!(reader instanceof $Reader))
|
25087 | reader = new $Reader(reader);
|
25088 | return this.decode(reader, reader.uint32());
|
25089 | };
|
25090 |
|
25091 | /**
|
25092 | * Verifies an Any message.
|
25093 | * @function verify
|
25094 | * @memberof google.protobuf.Any
|
25095 | * @static
|
25096 | * @param {Object.<string,*>} message Plain object to verify
|
25097 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
25098 | */
|
25099 | Any.verify = function verify(message) {
|
25100 | if (typeof message !== "object" || message === null)
|
25101 | return "object expected";
|
25102 | if (message.type_url != null && message.hasOwnProperty("type_url"))
|
25103 | if (!$util.isString(message.type_url))
|
25104 | return "type_url: string expected";
|
25105 | if (message.value != null && message.hasOwnProperty("value"))
|
25106 | if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value)))
|
25107 | return "value: buffer expected";
|
25108 | return null;
|
25109 | };
|
25110 |
|
25111 | /**
|
25112 | * Creates an Any message from a plain object. Also converts values to their respective internal types.
|
25113 | * @function fromObject
|
25114 | * @memberof google.protobuf.Any
|
25115 | * @static
|
25116 | * @param {Object.<string,*>} object Plain object
|
25117 | * @returns {google.protobuf.Any} Any
|
25118 | */
|
25119 | Any.fromObject = function fromObject(object) {
|
25120 | if (object instanceof $root.google.protobuf.Any)
|
25121 | return object;
|
25122 | var message = new $root.google.protobuf.Any();
|
25123 | if (object.type_url != null)
|
25124 | message.type_url = String(object.type_url);
|
25125 | if (object.value != null)
|
25126 | if (typeof object.value === "string")
|
25127 | $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0);
|
25128 | else if (object.value.length)
|
25129 | message.value = object.value;
|
25130 | return message;
|
25131 | };
|
25132 |
|
25133 | /**
|
25134 | * Creates a plain object from an Any message. Also converts values to other types if specified.
|
25135 | * @function toObject
|
25136 | * @memberof google.protobuf.Any
|
25137 | * @static
|
25138 | * @param {google.protobuf.Any} message Any
|
25139 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
25140 | * @returns {Object.<string,*>} Plain object
|
25141 | */
|
25142 | Any.toObject = function toObject(message, options) {
|
25143 | if (!options)
|
25144 | options = {};
|
25145 | var object = {};
|
25146 | if (options.defaults) {
|
25147 | object.type_url = "";
|
25148 | if (options.bytes === String)
|
25149 | object.value = "";
|
25150 | else {
|
25151 | object.value = [];
|
25152 | if (options.bytes !== Array)
|
25153 | object.value = $util.newBuffer(object.value);
|
25154 | }
|
25155 | }
|
25156 | if (message.type_url != null && message.hasOwnProperty("type_url"))
|
25157 | object.type_url = message.type_url;
|
25158 | if (message.value != null && message.hasOwnProperty("value"))
|
25159 | object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value;
|
25160 | return object;
|
25161 | };
|
25162 |
|
25163 | /**
|
25164 | * Converts this Any to JSON.
|
25165 | * @function toJSON
|
25166 | * @memberof google.protobuf.Any
|
25167 | * @instance
|
25168 | * @returns {Object.<string,*>} JSON object
|
25169 | */
|
25170 | Any.prototype.toJSON = function toJSON() {
|
25171 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
25172 | };
|
25173 |
|
25174 | return Any;
|
25175 | })();
|
25176 |
|
25177 | protobuf.Duration = (function() {
|
25178 |
|
25179 | /**
|
25180 | * Properties of a Duration.
|
25181 | * @memberof google.protobuf
|
25182 | * @interface IDuration
|
25183 | * @property {number|Long|null} [seconds] Duration seconds
|
25184 | * @property {number|null} [nanos] Duration nanos
|
25185 | */
|
25186 |
|
25187 | /**
|
25188 | * Constructs a new Duration.
|
25189 | * @memberof google.protobuf
|
25190 | * @classdesc Represents a Duration.
|
25191 | * @implements IDuration
|
25192 | * @constructor
|
25193 | * @param {google.protobuf.IDuration=} [properties] Properties to set
|
25194 | */
|
25195 | function Duration(properties) {
|
25196 | if (properties)
|
25197 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
25198 | if (properties[keys[i]] != null)
|
25199 | this[keys[i]] = properties[keys[i]];
|
25200 | }
|
25201 |
|
25202 | /**
|
25203 | * Duration seconds.
|
25204 | * @member {number|Long} seconds
|
25205 | * @memberof google.protobuf.Duration
|
25206 | * @instance
|
25207 | */
|
25208 | Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
25209 |
|
25210 | /**
|
25211 | * Duration nanos.
|
25212 | * @member {number} nanos
|
25213 | * @memberof google.protobuf.Duration
|
25214 | * @instance
|
25215 | */
|
25216 | Duration.prototype.nanos = 0;
|
25217 |
|
25218 | /**
|
25219 | * Creates a new Duration instance using the specified properties.
|
25220 | * @function create
|
25221 | * @memberof google.protobuf.Duration
|
25222 | * @static
|
25223 | * @param {google.protobuf.IDuration=} [properties] Properties to set
|
25224 | * @returns {google.protobuf.Duration} Duration instance
|
25225 | */
|
25226 | Duration.create = function create(properties) {
|
25227 | return new Duration(properties);
|
25228 | };
|
25229 |
|
25230 | /**
|
25231 | * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages.
|
25232 | * @function encode
|
25233 | * @memberof google.protobuf.Duration
|
25234 | * @static
|
25235 | * @param {google.protobuf.IDuration} message Duration message or plain object to encode
|
25236 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
25237 | * @returns {$protobuf.Writer} Writer
|
25238 | */
|
25239 | Duration.encode = function encode(message, writer) {
|
25240 | if (!writer)
|
25241 | writer = $Writer.create();
|
25242 | if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds"))
|
25243 | writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds);
|
25244 | if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos"))
|
25245 | writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos);
|
25246 | return writer;
|
25247 | };
|
25248 |
|
25249 | /**
|
25250 | * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages.
|
25251 | * @function encodeDelimited
|
25252 | * @memberof google.protobuf.Duration
|
25253 | * @static
|
25254 | * @param {google.protobuf.IDuration} message Duration message or plain object to encode
|
25255 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
25256 | * @returns {$protobuf.Writer} Writer
|
25257 | */
|
25258 | Duration.encodeDelimited = function encodeDelimited(message, writer) {
|
25259 | return this.encode(message, writer).ldelim();
|
25260 | };
|
25261 |
|
25262 | /**
|
25263 | * Decodes a Duration message from the specified reader or buffer.
|
25264 | * @function decode
|
25265 | * @memberof google.protobuf.Duration
|
25266 | * @static
|
25267 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
25268 | * @param {number} [length] Message length if known beforehand
|
25269 | * @returns {google.protobuf.Duration} Duration
|
25270 | * @throws {Error} If the payload is not a reader or valid buffer
|
25271 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
25272 | */
|
25273 | Duration.decode = function decode(reader, length) {
|
25274 | if (!(reader instanceof $Reader))
|
25275 | reader = $Reader.create(reader);
|
25276 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration();
|
25277 | while (reader.pos < end) {
|
25278 | var tag = reader.uint32();
|
25279 | switch (tag >>> 3) {
|
25280 | case 1:
|
25281 | message.seconds = reader.int64();
|
25282 | break;
|
25283 | case 2:
|
25284 | message.nanos = reader.int32();
|
25285 | break;
|
25286 | default:
|
25287 | reader.skipType(tag & 7);
|
25288 | break;
|
25289 | }
|
25290 | }
|
25291 | return message;
|
25292 | };
|
25293 |
|
25294 | /**
|
25295 | * Decodes a Duration message from the specified reader or buffer, length delimited.
|
25296 | * @function decodeDelimited
|
25297 | * @memberof google.protobuf.Duration
|
25298 | * @static
|
25299 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
25300 | * @returns {google.protobuf.Duration} Duration
|
25301 | * @throws {Error} If the payload is not a reader or valid buffer
|
25302 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
25303 | */
|
25304 | Duration.decodeDelimited = function decodeDelimited(reader) {
|
25305 | if (!(reader instanceof $Reader))
|
25306 | reader = new $Reader(reader);
|
25307 | return this.decode(reader, reader.uint32());
|
25308 | };
|
25309 |
|
25310 | /**
|
25311 | * Verifies a Duration message.
|
25312 | * @function verify
|
25313 | * @memberof google.protobuf.Duration
|
25314 | * @static
|
25315 | * @param {Object.<string,*>} message Plain object to verify
|
25316 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
25317 | */
|
25318 | Duration.verify = function verify(message) {
|
25319 | if (typeof message !== "object" || message === null)
|
25320 | return "object expected";
|
25321 | if (message.seconds != null && message.hasOwnProperty("seconds"))
|
25322 | if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high)))
|
25323 | return "seconds: integer|Long expected";
|
25324 | if (message.nanos != null && message.hasOwnProperty("nanos"))
|
25325 | if (!$util.isInteger(message.nanos))
|
25326 | return "nanos: integer expected";
|
25327 | return null;
|
25328 | };
|
25329 |
|
25330 | /**
|
25331 | * Creates a Duration message from a plain object. Also converts values to their respective internal types.
|
25332 | * @function fromObject
|
25333 | * @memberof google.protobuf.Duration
|
25334 | * @static
|
25335 | * @param {Object.<string,*>} object Plain object
|
25336 | * @returns {google.protobuf.Duration} Duration
|
25337 | */
|
25338 | Duration.fromObject = function fromObject(object) {
|
25339 | if (object instanceof $root.google.protobuf.Duration)
|
25340 | return object;
|
25341 | var message = new $root.google.protobuf.Duration();
|
25342 | if (object.seconds != null)
|
25343 | if ($util.Long)
|
25344 | (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false;
|
25345 | else if (typeof object.seconds === "string")
|
25346 | message.seconds = parseInt(object.seconds, 10);
|
25347 | else if (typeof object.seconds === "number")
|
25348 | message.seconds = object.seconds;
|
25349 | else if (typeof object.seconds === "object")
|
25350 | message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber();
|
25351 | if (object.nanos != null)
|
25352 | message.nanos = object.nanos | 0;
|
25353 | return message;
|
25354 | };
|
25355 |
|
25356 | /**
|
25357 | * Creates a plain object from a Duration message. Also converts values to other types if specified.
|
25358 | * @function toObject
|
25359 | * @memberof google.protobuf.Duration
|
25360 | * @static
|
25361 | * @param {google.protobuf.Duration} message Duration
|
25362 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
25363 | * @returns {Object.<string,*>} Plain object
|
25364 | */
|
25365 | Duration.toObject = function toObject(message, options) {
|
25366 | if (!options)
|
25367 | options = {};
|
25368 | var object = {};
|
25369 | if (options.defaults) {
|
25370 | if ($util.Long) {
|
25371 | var long = new $util.Long(0, 0, false);
|
25372 | object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
25373 | } else
|
25374 | object.seconds = options.longs === String ? "0" : 0;
|
25375 | object.nanos = 0;
|
25376 | }
|
25377 | if (message.seconds != null && message.hasOwnProperty("seconds"))
|
25378 | if (typeof message.seconds === "number")
|
25379 | object.seconds = options.longs === String ? String(message.seconds) : message.seconds;
|
25380 | else
|
25381 | object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds;
|
25382 | if (message.nanos != null && message.hasOwnProperty("nanos"))
|
25383 | object.nanos = message.nanos;
|
25384 | return object;
|
25385 | };
|
25386 |
|
25387 | /**
|
25388 | * Converts this Duration to JSON.
|
25389 | * @function toJSON
|
25390 | * @memberof google.protobuf.Duration
|
25391 | * @instance
|
25392 | * @returns {Object.<string,*>} JSON object
|
25393 | */
|
25394 | Duration.prototype.toJSON = function toJSON() {
|
25395 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
25396 | };
|
25397 |
|
25398 | return Duration;
|
25399 | })();
|
25400 |
|
25401 | protobuf.Empty = (function() {
|
25402 |
|
25403 | /**
|
25404 | * Properties of an Empty.
|
25405 | * @memberof google.protobuf
|
25406 | * @interface IEmpty
|
25407 | */
|
25408 |
|
25409 | /**
|
25410 | * Constructs a new Empty.
|
25411 | * @memberof google.protobuf
|
25412 | * @classdesc Represents an Empty.
|
25413 | * @implements IEmpty
|
25414 | * @constructor
|
25415 | * @param {google.protobuf.IEmpty=} [properties] Properties to set
|
25416 | */
|
25417 | function Empty(properties) {
|
25418 | if (properties)
|
25419 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
25420 | if (properties[keys[i]] != null)
|
25421 | this[keys[i]] = properties[keys[i]];
|
25422 | }
|
25423 |
|
25424 | /**
|
25425 | * Creates a new Empty instance using the specified properties.
|
25426 | * @function create
|
25427 | * @memberof google.protobuf.Empty
|
25428 | * @static
|
25429 | * @param {google.protobuf.IEmpty=} [properties] Properties to set
|
25430 | * @returns {google.protobuf.Empty} Empty instance
|
25431 | */
|
25432 | Empty.create = function create(properties) {
|
25433 | return new Empty(properties);
|
25434 | };
|
25435 |
|
25436 | /**
|
25437 | * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages.
|
25438 | * @function encode
|
25439 | * @memberof google.protobuf.Empty
|
25440 | * @static
|
25441 | * @param {google.protobuf.IEmpty} message Empty message or plain object to encode
|
25442 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
25443 | * @returns {$protobuf.Writer} Writer
|
25444 | */
|
25445 | Empty.encode = function encode(message, writer) {
|
25446 | if (!writer)
|
25447 | writer = $Writer.create();
|
25448 | return writer;
|
25449 | };
|
25450 |
|
25451 | /**
|
25452 | * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages.
|
25453 | * @function encodeDelimited
|
25454 | * @memberof google.protobuf.Empty
|
25455 | * @static
|
25456 | * @param {google.protobuf.IEmpty} message Empty message or plain object to encode
|
25457 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
25458 | * @returns {$protobuf.Writer} Writer
|
25459 | */
|
25460 | Empty.encodeDelimited = function encodeDelimited(message, writer) {
|
25461 | return this.encode(message, writer).ldelim();
|
25462 | };
|
25463 |
|
25464 | /**
|
25465 | * Decodes an Empty message from the specified reader or buffer.
|
25466 | * @function decode
|
25467 | * @memberof google.protobuf.Empty
|
25468 | * @static
|
25469 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
25470 | * @param {number} [length] Message length if known beforehand
|
25471 | * @returns {google.protobuf.Empty} Empty
|
25472 | * @throws {Error} If the payload is not a reader or valid buffer
|
25473 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
25474 | */
|
25475 | Empty.decode = function decode(reader, length) {
|
25476 | if (!(reader instanceof $Reader))
|
25477 | reader = $Reader.create(reader);
|
25478 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty();
|
25479 | while (reader.pos < end) {
|
25480 | var tag = reader.uint32();
|
25481 | switch (tag >>> 3) {
|
25482 | default:
|
25483 | reader.skipType(tag & 7);
|
25484 | break;
|
25485 | }
|
25486 | }
|
25487 | return message;
|
25488 | };
|
25489 |
|
25490 | /**
|
25491 | * Decodes an Empty message from the specified reader or buffer, length delimited.
|
25492 | * @function decodeDelimited
|
25493 | * @memberof google.protobuf.Empty
|
25494 | * @static
|
25495 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
25496 | * @returns {google.protobuf.Empty} Empty
|
25497 | * @throws {Error} If the payload is not a reader or valid buffer
|
25498 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
25499 | */
|
25500 | Empty.decodeDelimited = function decodeDelimited(reader) {
|
25501 | if (!(reader instanceof $Reader))
|
25502 | reader = new $Reader(reader);
|
25503 | return this.decode(reader, reader.uint32());
|
25504 | };
|
25505 |
|
25506 | /**
|
25507 | * Verifies an Empty message.
|
25508 | * @function verify
|
25509 | * @memberof google.protobuf.Empty
|
25510 | * @static
|
25511 | * @param {Object.<string,*>} message Plain object to verify
|
25512 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
25513 | */
|
25514 | Empty.verify = function verify(message) {
|
25515 | if (typeof message !== "object" || message === null)
|
25516 | return "object expected";
|
25517 | return null;
|
25518 | };
|
25519 |
|
25520 | /**
|
25521 | * Creates an Empty message from a plain object. Also converts values to their respective internal types.
|
25522 | * @function fromObject
|
25523 | * @memberof google.protobuf.Empty
|
25524 | * @static
|
25525 | * @param {Object.<string,*>} object Plain object
|
25526 | * @returns {google.protobuf.Empty} Empty
|
25527 | */
|
25528 | Empty.fromObject = function fromObject(object) {
|
25529 | if (object instanceof $root.google.protobuf.Empty)
|
25530 | return object;
|
25531 | return new $root.google.protobuf.Empty();
|
25532 | };
|
25533 |
|
25534 | /**
|
25535 | * Creates a plain object from an Empty message. Also converts values to other types if specified.
|
25536 | * @function toObject
|
25537 | * @memberof google.protobuf.Empty
|
25538 | * @static
|
25539 | * @param {google.protobuf.Empty} message Empty
|
25540 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
25541 | * @returns {Object.<string,*>} Plain object
|
25542 | */
|
25543 | Empty.toObject = function toObject() {
|
25544 | return {};
|
25545 | };
|
25546 |
|
25547 | /**
|
25548 | * Converts this Empty to JSON.
|
25549 | * @function toJSON
|
25550 | * @memberof google.protobuf.Empty
|
25551 | * @instance
|
25552 | * @returns {Object.<string,*>} JSON object
|
25553 | */
|
25554 | Empty.prototype.toJSON = function toJSON() {
|
25555 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
25556 | };
|
25557 |
|
25558 | return Empty;
|
25559 | })();
|
25560 |
|
25561 | protobuf.Timestamp = (function() {
|
25562 |
|
25563 | /**
|
25564 | * Properties of a Timestamp.
|
25565 | * @memberof google.protobuf
|
25566 | * @interface ITimestamp
|
25567 | * @property {number|Long|null} [seconds] Timestamp seconds
|
25568 | * @property {number|null} [nanos] Timestamp nanos
|
25569 | */
|
25570 |
|
25571 | /**
|
25572 | * Constructs a new Timestamp.
|
25573 | * @memberof google.protobuf
|
25574 | * @classdesc Represents a Timestamp.
|
25575 | * @implements ITimestamp
|
25576 | * @constructor
|
25577 | * @param {google.protobuf.ITimestamp=} [properties] Properties to set
|
25578 | */
|
25579 | function Timestamp(properties) {
|
25580 | if (properties)
|
25581 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
25582 | if (properties[keys[i]] != null)
|
25583 | this[keys[i]] = properties[keys[i]];
|
25584 | }
|
25585 |
|
25586 | /**
|
25587 | * Timestamp seconds.
|
25588 | * @member {number|Long} seconds
|
25589 | * @memberof google.protobuf.Timestamp
|
25590 | * @instance
|
25591 | */
|
25592 | Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
25593 |
|
25594 | /**
|
25595 | * Timestamp nanos.
|
25596 | * @member {number} nanos
|
25597 | * @memberof google.protobuf.Timestamp
|
25598 | * @instance
|
25599 | */
|
25600 | Timestamp.prototype.nanos = 0;
|
25601 |
|
25602 | /**
|
25603 | * Creates a new Timestamp instance using the specified properties.
|
25604 | * @function create
|
25605 | * @memberof google.protobuf.Timestamp
|
25606 | * @static
|
25607 | * @param {google.protobuf.ITimestamp=} [properties] Properties to set
|
25608 | * @returns {google.protobuf.Timestamp} Timestamp instance
|
25609 | */
|
25610 | Timestamp.create = function create(properties) {
|
25611 | return new Timestamp(properties);
|
25612 | };
|
25613 |
|
25614 | /**
|
25615 | * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages.
|
25616 | * @function encode
|
25617 | * @memberof google.protobuf.Timestamp
|
25618 | * @static
|
25619 | * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode
|
25620 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
25621 | * @returns {$protobuf.Writer} Writer
|
25622 | */
|
25623 | Timestamp.encode = function encode(message, writer) {
|
25624 | if (!writer)
|
25625 | writer = $Writer.create();
|
25626 | if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds"))
|
25627 | writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds);
|
25628 | if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos"))
|
25629 | writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos);
|
25630 | return writer;
|
25631 | };
|
25632 |
|
25633 | /**
|
25634 | * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages.
|
25635 | * @function encodeDelimited
|
25636 | * @memberof google.protobuf.Timestamp
|
25637 | * @static
|
25638 | * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode
|
25639 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
25640 | * @returns {$protobuf.Writer} Writer
|
25641 | */
|
25642 | Timestamp.encodeDelimited = function encodeDelimited(message, writer) {
|
25643 | return this.encode(message, writer).ldelim();
|
25644 | };
|
25645 |
|
25646 | /**
|
25647 | * Decodes a Timestamp message from the specified reader or buffer.
|
25648 | * @function decode
|
25649 | * @memberof google.protobuf.Timestamp
|
25650 | * @static
|
25651 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
25652 | * @param {number} [length] Message length if known beforehand
|
25653 | * @returns {google.protobuf.Timestamp} Timestamp
|
25654 | * @throws {Error} If the payload is not a reader or valid buffer
|
25655 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
25656 | */
|
25657 | Timestamp.decode = function decode(reader, length) {
|
25658 | if (!(reader instanceof $Reader))
|
25659 | reader = $Reader.create(reader);
|
25660 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp();
|
25661 | while (reader.pos < end) {
|
25662 | var tag = reader.uint32();
|
25663 | switch (tag >>> 3) {
|
25664 | case 1:
|
25665 | message.seconds = reader.int64();
|
25666 | break;
|
25667 | case 2:
|
25668 | message.nanos = reader.int32();
|
25669 | break;
|
25670 | default:
|
25671 | reader.skipType(tag & 7);
|
25672 | break;
|
25673 | }
|
25674 | }
|
25675 | return message;
|
25676 | };
|
25677 |
|
25678 | /**
|
25679 | * Decodes a Timestamp message from the specified reader or buffer, length delimited.
|
25680 | * @function decodeDelimited
|
25681 | * @memberof google.protobuf.Timestamp
|
25682 | * @static
|
25683 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
25684 | * @returns {google.protobuf.Timestamp} Timestamp
|
25685 | * @throws {Error} If the payload is not a reader or valid buffer
|
25686 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
25687 | */
|
25688 | Timestamp.decodeDelimited = function decodeDelimited(reader) {
|
25689 | if (!(reader instanceof $Reader))
|
25690 | reader = new $Reader(reader);
|
25691 | return this.decode(reader, reader.uint32());
|
25692 | };
|
25693 |
|
25694 | /**
|
25695 | * Verifies a Timestamp message.
|
25696 | * @function verify
|
25697 | * @memberof google.protobuf.Timestamp
|
25698 | * @static
|
25699 | * @param {Object.<string,*>} message Plain object to verify
|
25700 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
25701 | */
|
25702 | Timestamp.verify = function verify(message) {
|
25703 | if (typeof message !== "object" || message === null)
|
25704 | return "object expected";
|
25705 | if (message.seconds != null && message.hasOwnProperty("seconds"))
|
25706 | if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high)))
|
25707 | return "seconds: integer|Long expected";
|
25708 | if (message.nanos != null && message.hasOwnProperty("nanos"))
|
25709 | if (!$util.isInteger(message.nanos))
|
25710 | return "nanos: integer expected";
|
25711 | return null;
|
25712 | };
|
25713 |
|
25714 | /**
|
25715 | * Creates a Timestamp message from a plain object. Also converts values to their respective internal types.
|
25716 | * @function fromObject
|
25717 | * @memberof google.protobuf.Timestamp
|
25718 | * @static
|
25719 | * @param {Object.<string,*>} object Plain object
|
25720 | * @returns {google.protobuf.Timestamp} Timestamp
|
25721 | */
|
25722 | Timestamp.fromObject = function fromObject(object) {
|
25723 | if (object instanceof $root.google.protobuf.Timestamp)
|
25724 | return object;
|
25725 | var message = new $root.google.protobuf.Timestamp();
|
25726 | if (object.seconds != null)
|
25727 | if ($util.Long)
|
25728 | (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false;
|
25729 | else if (typeof object.seconds === "string")
|
25730 | message.seconds = parseInt(object.seconds, 10);
|
25731 | else if (typeof object.seconds === "number")
|
25732 | message.seconds = object.seconds;
|
25733 | else if (typeof object.seconds === "object")
|
25734 | message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber();
|
25735 | if (object.nanos != null)
|
25736 | message.nanos = object.nanos | 0;
|
25737 | return message;
|
25738 | };
|
25739 |
|
25740 | /**
|
25741 | * Creates a plain object from a Timestamp message. Also converts values to other types if specified.
|
25742 | * @function toObject
|
25743 | * @memberof google.protobuf.Timestamp
|
25744 | * @static
|
25745 | * @param {google.protobuf.Timestamp} message Timestamp
|
25746 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
25747 | * @returns {Object.<string,*>} Plain object
|
25748 | */
|
25749 | Timestamp.toObject = function toObject(message, options) {
|
25750 | if (!options)
|
25751 | options = {};
|
25752 | var object = {};
|
25753 | if (options.defaults) {
|
25754 | if ($util.Long) {
|
25755 | var long = new $util.Long(0, 0, false);
|
25756 | object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
25757 | } else
|
25758 | object.seconds = options.longs === String ? "0" : 0;
|
25759 | object.nanos = 0;
|
25760 | }
|
25761 | if (message.seconds != null && message.hasOwnProperty("seconds"))
|
25762 | if (typeof message.seconds === "number")
|
25763 | object.seconds = options.longs === String ? String(message.seconds) : message.seconds;
|
25764 | else
|
25765 | object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds;
|
25766 | if (message.nanos != null && message.hasOwnProperty("nanos"))
|
25767 | object.nanos = message.nanos;
|
25768 | return object;
|
25769 | };
|
25770 |
|
25771 | /**
|
25772 | * Converts this Timestamp to JSON.
|
25773 | * @function toJSON
|
25774 | * @memberof google.protobuf.Timestamp
|
25775 | * @instance
|
25776 | * @returns {Object.<string,*>} JSON object
|
25777 | */
|
25778 | Timestamp.prototype.toJSON = function toJSON() {
|
25779 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
25780 | };
|
25781 |
|
25782 | return Timestamp;
|
25783 | })();
|
25784 |
|
25785 | protobuf.DoubleValue = (function() {
|
25786 |
|
25787 | /**
|
25788 | * Properties of a DoubleValue.
|
25789 | * @memberof google.protobuf
|
25790 | * @interface IDoubleValue
|
25791 | * @property {number|null} [value] DoubleValue value
|
25792 | */
|
25793 |
|
25794 | /**
|
25795 | * Constructs a new DoubleValue.
|
25796 | * @memberof google.protobuf
|
25797 | * @classdesc Represents a DoubleValue.
|
25798 | * @implements IDoubleValue
|
25799 | * @constructor
|
25800 | * @param {google.protobuf.IDoubleValue=} [properties] Properties to set
|
25801 | */
|
25802 | function DoubleValue(properties) {
|
25803 | if (properties)
|
25804 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
25805 | if (properties[keys[i]] != null)
|
25806 | this[keys[i]] = properties[keys[i]];
|
25807 | }
|
25808 |
|
25809 | /**
|
25810 | * DoubleValue value.
|
25811 | * @member {number} value
|
25812 | * @memberof google.protobuf.DoubleValue
|
25813 | * @instance
|
25814 | */
|
25815 | DoubleValue.prototype.value = 0;
|
25816 |
|
25817 | /**
|
25818 | * Creates a new DoubleValue instance using the specified properties.
|
25819 | * @function create
|
25820 | * @memberof google.protobuf.DoubleValue
|
25821 | * @static
|
25822 | * @param {google.protobuf.IDoubleValue=} [properties] Properties to set
|
25823 | * @returns {google.protobuf.DoubleValue} DoubleValue instance
|
25824 | */
|
25825 | DoubleValue.create = function create(properties) {
|
25826 | return new DoubleValue(properties);
|
25827 | };
|
25828 |
|
25829 | /**
|
25830 | * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages.
|
25831 | * @function encode
|
25832 | * @memberof google.protobuf.DoubleValue
|
25833 | * @static
|
25834 | * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode
|
25835 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
25836 | * @returns {$protobuf.Writer} Writer
|
25837 | */
|
25838 | DoubleValue.encode = function encode(message, writer) {
|
25839 | if (!writer)
|
25840 | writer = $Writer.create();
|
25841 | if (message.value != null && Object.hasOwnProperty.call(message, "value"))
|
25842 | writer.uint32(/* id 1, wireType 1 =*/9).double(message.value);
|
25843 | return writer;
|
25844 | };
|
25845 |
|
25846 | /**
|
25847 | * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages.
|
25848 | * @function encodeDelimited
|
25849 | * @memberof google.protobuf.DoubleValue
|
25850 | * @static
|
25851 | * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode
|
25852 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
25853 | * @returns {$protobuf.Writer} Writer
|
25854 | */
|
25855 | DoubleValue.encodeDelimited = function encodeDelimited(message, writer) {
|
25856 | return this.encode(message, writer).ldelim();
|
25857 | };
|
25858 |
|
25859 | /**
|
25860 | * Decodes a DoubleValue message from the specified reader or buffer.
|
25861 | * @function decode
|
25862 | * @memberof google.protobuf.DoubleValue
|
25863 | * @static
|
25864 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
25865 | * @param {number} [length] Message length if known beforehand
|
25866 | * @returns {google.protobuf.DoubleValue} DoubleValue
|
25867 | * @throws {Error} If the payload is not a reader or valid buffer
|
25868 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
25869 | */
|
25870 | DoubleValue.decode = function decode(reader, length) {
|
25871 | if (!(reader instanceof $Reader))
|
25872 | reader = $Reader.create(reader);
|
25873 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DoubleValue();
|
25874 | while (reader.pos < end) {
|
25875 | var tag = reader.uint32();
|
25876 | switch (tag >>> 3) {
|
25877 | case 1:
|
25878 | message.value = reader.double();
|
25879 | break;
|
25880 | default:
|
25881 | reader.skipType(tag & 7);
|
25882 | break;
|
25883 | }
|
25884 | }
|
25885 | return message;
|
25886 | };
|
25887 |
|
25888 | /**
|
25889 | * Decodes a DoubleValue message from the specified reader or buffer, length delimited.
|
25890 | * @function decodeDelimited
|
25891 | * @memberof google.protobuf.DoubleValue
|
25892 | * @static
|
25893 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
25894 | * @returns {google.protobuf.DoubleValue} DoubleValue
|
25895 | * @throws {Error} If the payload is not a reader or valid buffer
|
25896 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
25897 | */
|
25898 | DoubleValue.decodeDelimited = function decodeDelimited(reader) {
|
25899 | if (!(reader instanceof $Reader))
|
25900 | reader = new $Reader(reader);
|
25901 | return this.decode(reader, reader.uint32());
|
25902 | };
|
25903 |
|
25904 | /**
|
25905 | * Verifies a DoubleValue message.
|
25906 | * @function verify
|
25907 | * @memberof google.protobuf.DoubleValue
|
25908 | * @static
|
25909 | * @param {Object.<string,*>} message Plain object to verify
|
25910 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
25911 | */
|
25912 | DoubleValue.verify = function verify(message) {
|
25913 | if (typeof message !== "object" || message === null)
|
25914 | return "object expected";
|
25915 | if (message.value != null && message.hasOwnProperty("value"))
|
25916 | if (typeof message.value !== "number")
|
25917 | return "value: number expected";
|
25918 | return null;
|
25919 | };
|
25920 |
|
25921 | /**
|
25922 | * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types.
|
25923 | * @function fromObject
|
25924 | * @memberof google.protobuf.DoubleValue
|
25925 | * @static
|
25926 | * @param {Object.<string,*>} object Plain object
|
25927 | * @returns {google.protobuf.DoubleValue} DoubleValue
|
25928 | */
|
25929 | DoubleValue.fromObject = function fromObject(object) {
|
25930 | if (object instanceof $root.google.protobuf.DoubleValue)
|
25931 | return object;
|
25932 | var message = new $root.google.protobuf.DoubleValue();
|
25933 | if (object.value != null)
|
25934 | message.value = Number(object.value);
|
25935 | return message;
|
25936 | };
|
25937 |
|
25938 | /**
|
25939 | * Creates a plain object from a DoubleValue message. Also converts values to other types if specified.
|
25940 | * @function toObject
|
25941 | * @memberof google.protobuf.DoubleValue
|
25942 | * @static
|
25943 | * @param {google.protobuf.DoubleValue} message DoubleValue
|
25944 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
25945 | * @returns {Object.<string,*>} Plain object
|
25946 | */
|
25947 | DoubleValue.toObject = function toObject(message, options) {
|
25948 | if (!options)
|
25949 | options = {};
|
25950 | var object = {};
|
25951 | if (options.defaults)
|
25952 | object.value = 0;
|
25953 | if (message.value != null && message.hasOwnProperty("value"))
|
25954 | object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value;
|
25955 | return object;
|
25956 | };
|
25957 |
|
25958 | /**
|
25959 | * Converts this DoubleValue to JSON.
|
25960 | * @function toJSON
|
25961 | * @memberof google.protobuf.DoubleValue
|
25962 | * @instance
|
25963 | * @returns {Object.<string,*>} JSON object
|
25964 | */
|
25965 | DoubleValue.prototype.toJSON = function toJSON() {
|
25966 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
25967 | };
|
25968 |
|
25969 | return DoubleValue;
|
25970 | })();
|
25971 |
|
25972 | protobuf.FloatValue = (function() {
|
25973 |
|
25974 | /**
|
25975 | * Properties of a FloatValue.
|
25976 | * @memberof google.protobuf
|
25977 | * @interface IFloatValue
|
25978 | * @property {number|null} [value] FloatValue value
|
25979 | */
|
25980 |
|
25981 | /**
|
25982 | * Constructs a new FloatValue.
|
25983 | * @memberof google.protobuf
|
25984 | * @classdesc Represents a FloatValue.
|
25985 | * @implements IFloatValue
|
25986 | * @constructor
|
25987 | * @param {google.protobuf.IFloatValue=} [properties] Properties to set
|
25988 | */
|
25989 | function FloatValue(properties) {
|
25990 | if (properties)
|
25991 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
25992 | if (properties[keys[i]] != null)
|
25993 | this[keys[i]] = properties[keys[i]];
|
25994 | }
|
25995 |
|
25996 | /**
|
25997 | * FloatValue value.
|
25998 | * @member {number} value
|
25999 | * @memberof google.protobuf.FloatValue
|
26000 | * @instance
|
26001 | */
|
26002 | FloatValue.prototype.value = 0;
|
26003 |
|
26004 | /**
|
26005 | * Creates a new FloatValue instance using the specified properties.
|
26006 | * @function create
|
26007 | * @memberof google.protobuf.FloatValue
|
26008 | * @static
|
26009 | * @param {google.protobuf.IFloatValue=} [properties] Properties to set
|
26010 | * @returns {google.protobuf.FloatValue} FloatValue instance
|
26011 | */
|
26012 | FloatValue.create = function create(properties) {
|
26013 | return new FloatValue(properties);
|
26014 | };
|
26015 |
|
26016 | /**
|
26017 | * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages.
|
26018 | * @function encode
|
26019 | * @memberof google.protobuf.FloatValue
|
26020 | * @static
|
26021 | * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode
|
26022 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
26023 | * @returns {$protobuf.Writer} Writer
|
26024 | */
|
26025 | FloatValue.encode = function encode(message, writer) {
|
26026 | if (!writer)
|
26027 | writer = $Writer.create();
|
26028 | if (message.value != null && Object.hasOwnProperty.call(message, "value"))
|
26029 | writer.uint32(/* id 1, wireType 5 =*/13).float(message.value);
|
26030 | return writer;
|
26031 | };
|
26032 |
|
26033 | /**
|
26034 | * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages.
|
26035 | * @function encodeDelimited
|
26036 | * @memberof google.protobuf.FloatValue
|
26037 | * @static
|
26038 | * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode
|
26039 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
26040 | * @returns {$protobuf.Writer} Writer
|
26041 | */
|
26042 | FloatValue.encodeDelimited = function encodeDelimited(message, writer) {
|
26043 | return this.encode(message, writer).ldelim();
|
26044 | };
|
26045 |
|
26046 | /**
|
26047 | * Decodes a FloatValue message from the specified reader or buffer.
|
26048 | * @function decode
|
26049 | * @memberof google.protobuf.FloatValue
|
26050 | * @static
|
26051 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
26052 | * @param {number} [length] Message length if known beforehand
|
26053 | * @returns {google.protobuf.FloatValue} FloatValue
|
26054 | * @throws {Error} If the payload is not a reader or valid buffer
|
26055 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
26056 | */
|
26057 | FloatValue.decode = function decode(reader, length) {
|
26058 | if (!(reader instanceof $Reader))
|
26059 | reader = $Reader.create(reader);
|
26060 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FloatValue();
|
26061 | while (reader.pos < end) {
|
26062 | var tag = reader.uint32();
|
26063 | switch (tag >>> 3) {
|
26064 | case 1:
|
26065 | message.value = reader.float();
|
26066 | break;
|
26067 | default:
|
26068 | reader.skipType(tag & 7);
|
26069 | break;
|
26070 | }
|
26071 | }
|
26072 | return message;
|
26073 | };
|
26074 |
|
26075 | /**
|
26076 | * Decodes a FloatValue message from the specified reader or buffer, length delimited.
|
26077 | * @function decodeDelimited
|
26078 | * @memberof google.protobuf.FloatValue
|
26079 | * @static
|
26080 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
26081 | * @returns {google.protobuf.FloatValue} FloatValue
|
26082 | * @throws {Error} If the payload is not a reader or valid buffer
|
26083 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
26084 | */
|
26085 | FloatValue.decodeDelimited = function decodeDelimited(reader) {
|
26086 | if (!(reader instanceof $Reader))
|
26087 | reader = new $Reader(reader);
|
26088 | return this.decode(reader, reader.uint32());
|
26089 | };
|
26090 |
|
26091 | /**
|
26092 | * Verifies a FloatValue message.
|
26093 | * @function verify
|
26094 | * @memberof google.protobuf.FloatValue
|
26095 | * @static
|
26096 | * @param {Object.<string,*>} message Plain object to verify
|
26097 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
26098 | */
|
26099 | FloatValue.verify = function verify(message) {
|
26100 | if (typeof message !== "object" || message === null)
|
26101 | return "object expected";
|
26102 | if (message.value != null && message.hasOwnProperty("value"))
|
26103 | if (typeof message.value !== "number")
|
26104 | return "value: number expected";
|
26105 | return null;
|
26106 | };
|
26107 |
|
26108 | /**
|
26109 | * Creates a FloatValue message from a plain object. Also converts values to their respective internal types.
|
26110 | * @function fromObject
|
26111 | * @memberof google.protobuf.FloatValue
|
26112 | * @static
|
26113 | * @param {Object.<string,*>} object Plain object
|
26114 | * @returns {google.protobuf.FloatValue} FloatValue
|
26115 | */
|
26116 | FloatValue.fromObject = function fromObject(object) {
|
26117 | if (object instanceof $root.google.protobuf.FloatValue)
|
26118 | return object;
|
26119 | var message = new $root.google.protobuf.FloatValue();
|
26120 | if (object.value != null)
|
26121 | message.value = Number(object.value);
|
26122 | return message;
|
26123 | };
|
26124 |
|
26125 | /**
|
26126 | * Creates a plain object from a FloatValue message. Also converts values to other types if specified.
|
26127 | * @function toObject
|
26128 | * @memberof google.protobuf.FloatValue
|
26129 | * @static
|
26130 | * @param {google.protobuf.FloatValue} message FloatValue
|
26131 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
26132 | * @returns {Object.<string,*>} Plain object
|
26133 | */
|
26134 | FloatValue.toObject = function toObject(message, options) {
|
26135 | if (!options)
|
26136 | options = {};
|
26137 | var object = {};
|
26138 | if (options.defaults)
|
26139 | object.value = 0;
|
26140 | if (message.value != null && message.hasOwnProperty("value"))
|
26141 | object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value;
|
26142 | return object;
|
26143 | };
|
26144 |
|
26145 | /**
|
26146 | * Converts this FloatValue to JSON.
|
26147 | * @function toJSON
|
26148 | * @memberof google.protobuf.FloatValue
|
26149 | * @instance
|
26150 | * @returns {Object.<string,*>} JSON object
|
26151 | */
|
26152 | FloatValue.prototype.toJSON = function toJSON() {
|
26153 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
26154 | };
|
26155 |
|
26156 | return FloatValue;
|
26157 | })();
|
26158 |
|
26159 | protobuf.Int64Value = (function() {
|
26160 |
|
26161 | /**
|
26162 | * Properties of an Int64Value.
|
26163 | * @memberof google.protobuf
|
26164 | * @interface IInt64Value
|
26165 | * @property {number|Long|null} [value] Int64Value value
|
26166 | */
|
26167 |
|
26168 | /**
|
26169 | * Constructs a new Int64Value.
|
26170 | * @memberof google.protobuf
|
26171 | * @classdesc Represents an Int64Value.
|
26172 | * @implements IInt64Value
|
26173 | * @constructor
|
26174 | * @param {google.protobuf.IInt64Value=} [properties] Properties to set
|
26175 | */
|
26176 | function Int64Value(properties) {
|
26177 | if (properties)
|
26178 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
26179 | if (properties[keys[i]] != null)
|
26180 | this[keys[i]] = properties[keys[i]];
|
26181 | }
|
26182 |
|
26183 | /**
|
26184 | * Int64Value value.
|
26185 | * @member {number|Long} value
|
26186 | * @memberof google.protobuf.Int64Value
|
26187 | * @instance
|
26188 | */
|
26189 | Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
26190 |
|
26191 | /**
|
26192 | * Creates a new Int64Value instance using the specified properties.
|
26193 | * @function create
|
26194 | * @memberof google.protobuf.Int64Value
|
26195 | * @static
|
26196 | * @param {google.protobuf.IInt64Value=} [properties] Properties to set
|
26197 | * @returns {google.protobuf.Int64Value} Int64Value instance
|
26198 | */
|
26199 | Int64Value.create = function create(properties) {
|
26200 | return new Int64Value(properties);
|
26201 | };
|
26202 |
|
26203 | /**
|
26204 | * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages.
|
26205 | * @function encode
|
26206 | * @memberof google.protobuf.Int64Value
|
26207 | * @static
|
26208 | * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode
|
26209 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
26210 | * @returns {$protobuf.Writer} Writer
|
26211 | */
|
26212 | Int64Value.encode = function encode(message, writer) {
|
26213 | if (!writer)
|
26214 | writer = $Writer.create();
|
26215 | if (message.value != null && Object.hasOwnProperty.call(message, "value"))
|
26216 | writer.uint32(/* id 1, wireType 0 =*/8).int64(message.value);
|
26217 | return writer;
|
26218 | };
|
26219 |
|
26220 | /**
|
26221 | * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages.
|
26222 | * @function encodeDelimited
|
26223 | * @memberof google.protobuf.Int64Value
|
26224 | * @static
|
26225 | * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode
|
26226 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
26227 | * @returns {$protobuf.Writer} Writer
|
26228 | */
|
26229 | Int64Value.encodeDelimited = function encodeDelimited(message, writer) {
|
26230 | return this.encode(message, writer).ldelim();
|
26231 | };
|
26232 |
|
26233 | /**
|
26234 | * Decodes an Int64Value message from the specified reader or buffer.
|
26235 | * @function decode
|
26236 | * @memberof google.protobuf.Int64Value
|
26237 | * @static
|
26238 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
26239 | * @param {number} [length] Message length if known beforehand
|
26240 | * @returns {google.protobuf.Int64Value} Int64Value
|
26241 | * @throws {Error} If the payload is not a reader or valid buffer
|
26242 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
26243 | */
|
26244 | Int64Value.decode = function decode(reader, length) {
|
26245 | if (!(reader instanceof $Reader))
|
26246 | reader = $Reader.create(reader);
|
26247 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int64Value();
|
26248 | while (reader.pos < end) {
|
26249 | var tag = reader.uint32();
|
26250 | switch (tag >>> 3) {
|
26251 | case 1:
|
26252 | message.value = reader.int64();
|
26253 | break;
|
26254 | default:
|
26255 | reader.skipType(tag & 7);
|
26256 | break;
|
26257 | }
|
26258 | }
|
26259 | return message;
|
26260 | };
|
26261 |
|
26262 | /**
|
26263 | * Decodes an Int64Value message from the specified reader or buffer, length delimited.
|
26264 | * @function decodeDelimited
|
26265 | * @memberof google.protobuf.Int64Value
|
26266 | * @static
|
26267 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
26268 | * @returns {google.protobuf.Int64Value} Int64Value
|
26269 | * @throws {Error} If the payload is not a reader or valid buffer
|
26270 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
26271 | */
|
26272 | Int64Value.decodeDelimited = function decodeDelimited(reader) {
|
26273 | if (!(reader instanceof $Reader))
|
26274 | reader = new $Reader(reader);
|
26275 | return this.decode(reader, reader.uint32());
|
26276 | };
|
26277 |
|
26278 | /**
|
26279 | * Verifies an Int64Value message.
|
26280 | * @function verify
|
26281 | * @memberof google.protobuf.Int64Value
|
26282 | * @static
|
26283 | * @param {Object.<string,*>} message Plain object to verify
|
26284 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
26285 | */
|
26286 | Int64Value.verify = function verify(message) {
|
26287 | if (typeof message !== "object" || message === null)
|
26288 | return "object expected";
|
26289 | if (message.value != null && message.hasOwnProperty("value"))
|
26290 | if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high)))
|
26291 | return "value: integer|Long expected";
|
26292 | return null;
|
26293 | };
|
26294 |
|
26295 | /**
|
26296 | * Creates an Int64Value message from a plain object. Also converts values to their respective internal types.
|
26297 | * @function fromObject
|
26298 | * @memberof google.protobuf.Int64Value
|
26299 | * @static
|
26300 | * @param {Object.<string,*>} object Plain object
|
26301 | * @returns {google.protobuf.Int64Value} Int64Value
|
26302 | */
|
26303 | Int64Value.fromObject = function fromObject(object) {
|
26304 | if (object instanceof $root.google.protobuf.Int64Value)
|
26305 | return object;
|
26306 | var message = new $root.google.protobuf.Int64Value();
|
26307 | if (object.value != null)
|
26308 | if ($util.Long)
|
26309 | (message.value = $util.Long.fromValue(object.value)).unsigned = false;
|
26310 | else if (typeof object.value === "string")
|
26311 | message.value = parseInt(object.value, 10);
|
26312 | else if (typeof object.value === "number")
|
26313 | message.value = object.value;
|
26314 | else if (typeof object.value === "object")
|
26315 | message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber();
|
26316 | return message;
|
26317 | };
|
26318 |
|
26319 | /**
|
26320 | * Creates a plain object from an Int64Value message. Also converts values to other types if specified.
|
26321 | * @function toObject
|
26322 | * @memberof google.protobuf.Int64Value
|
26323 | * @static
|
26324 | * @param {google.protobuf.Int64Value} message Int64Value
|
26325 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
26326 | * @returns {Object.<string,*>} Plain object
|
26327 | */
|
26328 | Int64Value.toObject = function toObject(message, options) {
|
26329 | if (!options)
|
26330 | options = {};
|
26331 | var object = {};
|
26332 | if (options.defaults)
|
26333 | if ($util.Long) {
|
26334 | var long = new $util.Long(0, 0, false);
|
26335 | object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
26336 | } else
|
26337 | object.value = options.longs === String ? "0" : 0;
|
26338 | if (message.value != null && message.hasOwnProperty("value"))
|
26339 | if (typeof message.value === "number")
|
26340 | object.value = options.longs === String ? String(message.value) : message.value;
|
26341 | else
|
26342 | object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber() : message.value;
|
26343 | return object;
|
26344 | };
|
26345 |
|
26346 | /**
|
26347 | * Converts this Int64Value to JSON.
|
26348 | * @function toJSON
|
26349 | * @memberof google.protobuf.Int64Value
|
26350 | * @instance
|
26351 | * @returns {Object.<string,*>} JSON object
|
26352 | */
|
26353 | Int64Value.prototype.toJSON = function toJSON() {
|
26354 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
26355 | };
|
26356 |
|
26357 | return Int64Value;
|
26358 | })();
|
26359 |
|
26360 | protobuf.UInt64Value = (function() {
|
26361 |
|
26362 | /**
|
26363 | * Properties of a UInt64Value.
|
26364 | * @memberof google.protobuf
|
26365 | * @interface IUInt64Value
|
26366 | * @property {number|Long|null} [value] UInt64Value value
|
26367 | */
|
26368 |
|
26369 | /**
|
26370 | * Constructs a new UInt64Value.
|
26371 | * @memberof google.protobuf
|
26372 | * @classdesc Represents a UInt64Value.
|
26373 | * @implements IUInt64Value
|
26374 | * @constructor
|
26375 | * @param {google.protobuf.IUInt64Value=} [properties] Properties to set
|
26376 | */
|
26377 | function UInt64Value(properties) {
|
26378 | if (properties)
|
26379 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
26380 | if (properties[keys[i]] != null)
|
26381 | this[keys[i]] = properties[keys[i]];
|
26382 | }
|
26383 |
|
26384 | /**
|
26385 | * UInt64Value value.
|
26386 | * @member {number|Long} value
|
26387 | * @memberof google.protobuf.UInt64Value
|
26388 | * @instance
|
26389 | */
|
26390 | UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
|
26391 |
|
26392 | /**
|
26393 | * Creates a new UInt64Value instance using the specified properties.
|
26394 | * @function create
|
26395 | * @memberof google.protobuf.UInt64Value
|
26396 | * @static
|
26397 | * @param {google.protobuf.IUInt64Value=} [properties] Properties to set
|
26398 | * @returns {google.protobuf.UInt64Value} UInt64Value instance
|
26399 | */
|
26400 | UInt64Value.create = function create(properties) {
|
26401 | return new UInt64Value(properties);
|
26402 | };
|
26403 |
|
26404 | /**
|
26405 | * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages.
|
26406 | * @function encode
|
26407 | * @memberof google.protobuf.UInt64Value
|
26408 | * @static
|
26409 | * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode
|
26410 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
26411 | * @returns {$protobuf.Writer} Writer
|
26412 | */
|
26413 | UInt64Value.encode = function encode(message, writer) {
|
26414 | if (!writer)
|
26415 | writer = $Writer.create();
|
26416 | if (message.value != null && Object.hasOwnProperty.call(message, "value"))
|
26417 | writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.value);
|
26418 | return writer;
|
26419 | };
|
26420 |
|
26421 | /**
|
26422 | * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages.
|
26423 | * @function encodeDelimited
|
26424 | * @memberof google.protobuf.UInt64Value
|
26425 | * @static
|
26426 | * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode
|
26427 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
26428 | * @returns {$protobuf.Writer} Writer
|
26429 | */
|
26430 | UInt64Value.encodeDelimited = function encodeDelimited(message, writer) {
|
26431 | return this.encode(message, writer).ldelim();
|
26432 | };
|
26433 |
|
26434 | /**
|
26435 | * Decodes a UInt64Value message from the specified reader or buffer.
|
26436 | * @function decode
|
26437 | * @memberof google.protobuf.UInt64Value
|
26438 | * @static
|
26439 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
26440 | * @param {number} [length] Message length if known beforehand
|
26441 | * @returns {google.protobuf.UInt64Value} UInt64Value
|
26442 | * @throws {Error} If the payload is not a reader or valid buffer
|
26443 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
26444 | */
|
26445 | UInt64Value.decode = function decode(reader, length) {
|
26446 | if (!(reader instanceof $Reader))
|
26447 | reader = $Reader.create(reader);
|
26448 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt64Value();
|
26449 | while (reader.pos < end) {
|
26450 | var tag = reader.uint32();
|
26451 | switch (tag >>> 3) {
|
26452 | case 1:
|
26453 | message.value = reader.uint64();
|
26454 | break;
|
26455 | default:
|
26456 | reader.skipType(tag & 7);
|
26457 | break;
|
26458 | }
|
26459 | }
|
26460 | return message;
|
26461 | };
|
26462 |
|
26463 | /**
|
26464 | * Decodes a UInt64Value message from the specified reader or buffer, length delimited.
|
26465 | * @function decodeDelimited
|
26466 | * @memberof google.protobuf.UInt64Value
|
26467 | * @static
|
26468 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
26469 | * @returns {google.protobuf.UInt64Value} UInt64Value
|
26470 | * @throws {Error} If the payload is not a reader or valid buffer
|
26471 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
26472 | */
|
26473 | UInt64Value.decodeDelimited = function decodeDelimited(reader) {
|
26474 | if (!(reader instanceof $Reader))
|
26475 | reader = new $Reader(reader);
|
26476 | return this.decode(reader, reader.uint32());
|
26477 | };
|
26478 |
|
26479 | /**
|
26480 | * Verifies a UInt64Value message.
|
26481 | * @function verify
|
26482 | * @memberof google.protobuf.UInt64Value
|
26483 | * @static
|
26484 | * @param {Object.<string,*>} message Plain object to verify
|
26485 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
26486 | */
|
26487 | UInt64Value.verify = function verify(message) {
|
26488 | if (typeof message !== "object" || message === null)
|
26489 | return "object expected";
|
26490 | if (message.value != null && message.hasOwnProperty("value"))
|
26491 | if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high)))
|
26492 | return "value: integer|Long expected";
|
26493 | return null;
|
26494 | };
|
26495 |
|
26496 | /**
|
26497 | * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types.
|
26498 | * @function fromObject
|
26499 | * @memberof google.protobuf.UInt64Value
|
26500 | * @static
|
26501 | * @param {Object.<string,*>} object Plain object
|
26502 | * @returns {google.protobuf.UInt64Value} UInt64Value
|
26503 | */
|
26504 | UInt64Value.fromObject = function fromObject(object) {
|
26505 | if (object instanceof $root.google.protobuf.UInt64Value)
|
26506 | return object;
|
26507 | var message = new $root.google.protobuf.UInt64Value();
|
26508 | if (object.value != null)
|
26509 | if ($util.Long)
|
26510 | (message.value = $util.Long.fromValue(object.value)).unsigned = true;
|
26511 | else if (typeof object.value === "string")
|
26512 | message.value = parseInt(object.value, 10);
|
26513 | else if (typeof object.value === "number")
|
26514 | message.value = object.value;
|
26515 | else if (typeof object.value === "object")
|
26516 | message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(true);
|
26517 | return message;
|
26518 | };
|
26519 |
|
26520 | /**
|
26521 | * Creates a plain object from a UInt64Value message. Also converts values to other types if specified.
|
26522 | * @function toObject
|
26523 | * @memberof google.protobuf.UInt64Value
|
26524 | * @static
|
26525 | * @param {google.protobuf.UInt64Value} message UInt64Value
|
26526 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
26527 | * @returns {Object.<string,*>} Plain object
|
26528 | */
|
26529 | UInt64Value.toObject = function toObject(message, options) {
|
26530 | if (!options)
|
26531 | options = {};
|
26532 | var object = {};
|
26533 | if (options.defaults)
|
26534 | if ($util.Long) {
|
26535 | var long = new $util.Long(0, 0, true);
|
26536 | object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
26537 | } else
|
26538 | object.value = options.longs === String ? "0" : 0;
|
26539 | if (message.value != null && message.hasOwnProperty("value"))
|
26540 | if (typeof message.value === "number")
|
26541 | object.value = options.longs === String ? String(message.value) : message.value;
|
26542 | else
|
26543 | object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber(true) : message.value;
|
26544 | return object;
|
26545 | };
|
26546 |
|
26547 | /**
|
26548 | * Converts this UInt64Value to JSON.
|
26549 | * @function toJSON
|
26550 | * @memberof google.protobuf.UInt64Value
|
26551 | * @instance
|
26552 | * @returns {Object.<string,*>} JSON object
|
26553 | */
|
26554 | UInt64Value.prototype.toJSON = function toJSON() {
|
26555 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
26556 | };
|
26557 |
|
26558 | return UInt64Value;
|
26559 | })();
|
26560 |
|
26561 | protobuf.Int32Value = (function() {
|
26562 |
|
26563 | /**
|
26564 | * Properties of an Int32Value.
|
26565 | * @memberof google.protobuf
|
26566 | * @interface IInt32Value
|
26567 | * @property {number|null} [value] Int32Value value
|
26568 | */
|
26569 |
|
26570 | /**
|
26571 | * Constructs a new Int32Value.
|
26572 | * @memberof google.protobuf
|
26573 | * @classdesc Represents an Int32Value.
|
26574 | * @implements IInt32Value
|
26575 | * @constructor
|
26576 | * @param {google.protobuf.IInt32Value=} [properties] Properties to set
|
26577 | */
|
26578 | function Int32Value(properties) {
|
26579 | if (properties)
|
26580 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
26581 | if (properties[keys[i]] != null)
|
26582 | this[keys[i]] = properties[keys[i]];
|
26583 | }
|
26584 |
|
26585 | /**
|
26586 | * Int32Value value.
|
26587 | * @member {number} value
|
26588 | * @memberof google.protobuf.Int32Value
|
26589 | * @instance
|
26590 | */
|
26591 | Int32Value.prototype.value = 0;
|
26592 |
|
26593 | /**
|
26594 | * Creates a new Int32Value instance using the specified properties.
|
26595 | * @function create
|
26596 | * @memberof google.protobuf.Int32Value
|
26597 | * @static
|
26598 | * @param {google.protobuf.IInt32Value=} [properties] Properties to set
|
26599 | * @returns {google.protobuf.Int32Value} Int32Value instance
|
26600 | */
|
26601 | Int32Value.create = function create(properties) {
|
26602 | return new Int32Value(properties);
|
26603 | };
|
26604 |
|
26605 | /**
|
26606 | * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages.
|
26607 | * @function encode
|
26608 | * @memberof google.protobuf.Int32Value
|
26609 | * @static
|
26610 | * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode
|
26611 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
26612 | * @returns {$protobuf.Writer} Writer
|
26613 | */
|
26614 | Int32Value.encode = function encode(message, writer) {
|
26615 | if (!writer)
|
26616 | writer = $Writer.create();
|
26617 | if (message.value != null && Object.hasOwnProperty.call(message, "value"))
|
26618 | writer.uint32(/* id 1, wireType 0 =*/8).int32(message.value);
|
26619 | return writer;
|
26620 | };
|
26621 |
|
26622 | /**
|
26623 | * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages.
|
26624 | * @function encodeDelimited
|
26625 | * @memberof google.protobuf.Int32Value
|
26626 | * @static
|
26627 | * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode
|
26628 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
26629 | * @returns {$protobuf.Writer} Writer
|
26630 | */
|
26631 | Int32Value.encodeDelimited = function encodeDelimited(message, writer) {
|
26632 | return this.encode(message, writer).ldelim();
|
26633 | };
|
26634 |
|
26635 | /**
|
26636 | * Decodes an Int32Value message from the specified reader or buffer.
|
26637 | * @function decode
|
26638 | * @memberof google.protobuf.Int32Value
|
26639 | * @static
|
26640 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
26641 | * @param {number} [length] Message length if known beforehand
|
26642 | * @returns {google.protobuf.Int32Value} Int32Value
|
26643 | * @throws {Error} If the payload is not a reader or valid buffer
|
26644 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
26645 | */
|
26646 | Int32Value.decode = function decode(reader, length) {
|
26647 | if (!(reader instanceof $Reader))
|
26648 | reader = $Reader.create(reader);
|
26649 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int32Value();
|
26650 | while (reader.pos < end) {
|
26651 | var tag = reader.uint32();
|
26652 | switch (tag >>> 3) {
|
26653 | case 1:
|
26654 | message.value = reader.int32();
|
26655 | break;
|
26656 | default:
|
26657 | reader.skipType(tag & 7);
|
26658 | break;
|
26659 | }
|
26660 | }
|
26661 | return message;
|
26662 | };
|
26663 |
|
26664 | /**
|
26665 | * Decodes an Int32Value message from the specified reader or buffer, length delimited.
|
26666 | * @function decodeDelimited
|
26667 | * @memberof google.protobuf.Int32Value
|
26668 | * @static
|
26669 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
26670 | * @returns {google.protobuf.Int32Value} Int32Value
|
26671 | * @throws {Error} If the payload is not a reader or valid buffer
|
26672 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
26673 | */
|
26674 | Int32Value.decodeDelimited = function decodeDelimited(reader) {
|
26675 | if (!(reader instanceof $Reader))
|
26676 | reader = new $Reader(reader);
|
26677 | return this.decode(reader, reader.uint32());
|
26678 | };
|
26679 |
|
26680 | /**
|
26681 | * Verifies an Int32Value message.
|
26682 | * @function verify
|
26683 | * @memberof google.protobuf.Int32Value
|
26684 | * @static
|
26685 | * @param {Object.<string,*>} message Plain object to verify
|
26686 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
26687 | */
|
26688 | Int32Value.verify = function verify(message) {
|
26689 | if (typeof message !== "object" || message === null)
|
26690 | return "object expected";
|
26691 | if (message.value != null && message.hasOwnProperty("value"))
|
26692 | if (!$util.isInteger(message.value))
|
26693 | return "value: integer expected";
|
26694 | return null;
|
26695 | };
|
26696 |
|
26697 | /**
|
26698 | * Creates an Int32Value message from a plain object. Also converts values to their respective internal types.
|
26699 | * @function fromObject
|
26700 | * @memberof google.protobuf.Int32Value
|
26701 | * @static
|
26702 | * @param {Object.<string,*>} object Plain object
|
26703 | * @returns {google.protobuf.Int32Value} Int32Value
|
26704 | */
|
26705 | Int32Value.fromObject = function fromObject(object) {
|
26706 | if (object instanceof $root.google.protobuf.Int32Value)
|
26707 | return object;
|
26708 | var message = new $root.google.protobuf.Int32Value();
|
26709 | if (object.value != null)
|
26710 | message.value = object.value | 0;
|
26711 | return message;
|
26712 | };
|
26713 |
|
26714 | /**
|
26715 | * Creates a plain object from an Int32Value message. Also converts values to other types if specified.
|
26716 | * @function toObject
|
26717 | * @memberof google.protobuf.Int32Value
|
26718 | * @static
|
26719 | * @param {google.protobuf.Int32Value} message Int32Value
|
26720 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
26721 | * @returns {Object.<string,*>} Plain object
|
26722 | */
|
26723 | Int32Value.toObject = function toObject(message, options) {
|
26724 | if (!options)
|
26725 | options = {};
|
26726 | var object = {};
|
26727 | if (options.defaults)
|
26728 | object.value = 0;
|
26729 | if (message.value != null && message.hasOwnProperty("value"))
|
26730 | object.value = message.value;
|
26731 | return object;
|
26732 | };
|
26733 |
|
26734 | /**
|
26735 | * Converts this Int32Value to JSON.
|
26736 | * @function toJSON
|
26737 | * @memberof google.protobuf.Int32Value
|
26738 | * @instance
|
26739 | * @returns {Object.<string,*>} JSON object
|
26740 | */
|
26741 | Int32Value.prototype.toJSON = function toJSON() {
|
26742 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
26743 | };
|
26744 |
|
26745 | return Int32Value;
|
26746 | })();
|
26747 |
|
26748 | protobuf.UInt32Value = (function() {
|
26749 |
|
26750 | /**
|
26751 | * Properties of a UInt32Value.
|
26752 | * @memberof google.protobuf
|
26753 | * @interface IUInt32Value
|
26754 | * @property {number|null} [value] UInt32Value value
|
26755 | */
|
26756 |
|
26757 | /**
|
26758 | * Constructs a new UInt32Value.
|
26759 | * @memberof google.protobuf
|
26760 | * @classdesc Represents a UInt32Value.
|
26761 | * @implements IUInt32Value
|
26762 | * @constructor
|
26763 | * @param {google.protobuf.IUInt32Value=} [properties] Properties to set
|
26764 | */
|
26765 | function UInt32Value(properties) {
|
26766 | if (properties)
|
26767 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
26768 | if (properties[keys[i]] != null)
|
26769 | this[keys[i]] = properties[keys[i]];
|
26770 | }
|
26771 |
|
26772 | /**
|
26773 | * UInt32Value value.
|
26774 | * @member {number} value
|
26775 | * @memberof google.protobuf.UInt32Value
|
26776 | * @instance
|
26777 | */
|
26778 | UInt32Value.prototype.value = 0;
|
26779 |
|
26780 | /**
|
26781 | * Creates a new UInt32Value instance using the specified properties.
|
26782 | * @function create
|
26783 | * @memberof google.protobuf.UInt32Value
|
26784 | * @static
|
26785 | * @param {google.protobuf.IUInt32Value=} [properties] Properties to set
|
26786 | * @returns {google.protobuf.UInt32Value} UInt32Value instance
|
26787 | */
|
26788 | UInt32Value.create = function create(properties) {
|
26789 | return new UInt32Value(properties);
|
26790 | };
|
26791 |
|
26792 | /**
|
26793 | * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages.
|
26794 | * @function encode
|
26795 | * @memberof google.protobuf.UInt32Value
|
26796 | * @static
|
26797 | * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode
|
26798 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
26799 | * @returns {$protobuf.Writer} Writer
|
26800 | */
|
26801 | UInt32Value.encode = function encode(message, writer) {
|
26802 | if (!writer)
|
26803 | writer = $Writer.create();
|
26804 | if (message.value != null && Object.hasOwnProperty.call(message, "value"))
|
26805 | writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.value);
|
26806 | return writer;
|
26807 | };
|
26808 |
|
26809 | /**
|
26810 | * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages.
|
26811 | * @function encodeDelimited
|
26812 | * @memberof google.protobuf.UInt32Value
|
26813 | * @static
|
26814 | * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode
|
26815 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
26816 | * @returns {$protobuf.Writer} Writer
|
26817 | */
|
26818 | UInt32Value.encodeDelimited = function encodeDelimited(message, writer) {
|
26819 | return this.encode(message, writer).ldelim();
|
26820 | };
|
26821 |
|
26822 | /**
|
26823 | * Decodes a UInt32Value message from the specified reader or buffer.
|
26824 | * @function decode
|
26825 | * @memberof google.protobuf.UInt32Value
|
26826 | * @static
|
26827 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
26828 | * @param {number} [length] Message length if known beforehand
|
26829 | * @returns {google.protobuf.UInt32Value} UInt32Value
|
26830 | * @throws {Error} If the payload is not a reader or valid buffer
|
26831 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
26832 | */
|
26833 | UInt32Value.decode = function decode(reader, length) {
|
26834 | if (!(reader instanceof $Reader))
|
26835 | reader = $Reader.create(reader);
|
26836 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt32Value();
|
26837 | while (reader.pos < end) {
|
26838 | var tag = reader.uint32();
|
26839 | switch (tag >>> 3) {
|
26840 | case 1:
|
26841 | message.value = reader.uint32();
|
26842 | break;
|
26843 | default:
|
26844 | reader.skipType(tag & 7);
|
26845 | break;
|
26846 | }
|
26847 | }
|
26848 | return message;
|
26849 | };
|
26850 |
|
26851 | /**
|
26852 | * Decodes a UInt32Value message from the specified reader or buffer, length delimited.
|
26853 | * @function decodeDelimited
|
26854 | * @memberof google.protobuf.UInt32Value
|
26855 | * @static
|
26856 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
26857 | * @returns {google.protobuf.UInt32Value} UInt32Value
|
26858 | * @throws {Error} If the payload is not a reader or valid buffer
|
26859 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
26860 | */
|
26861 | UInt32Value.decodeDelimited = function decodeDelimited(reader) {
|
26862 | if (!(reader instanceof $Reader))
|
26863 | reader = new $Reader(reader);
|
26864 | return this.decode(reader, reader.uint32());
|
26865 | };
|
26866 |
|
26867 | /**
|
26868 | * Verifies a UInt32Value message.
|
26869 | * @function verify
|
26870 | * @memberof google.protobuf.UInt32Value
|
26871 | * @static
|
26872 | * @param {Object.<string,*>} message Plain object to verify
|
26873 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
26874 | */
|
26875 | UInt32Value.verify = function verify(message) {
|
26876 | if (typeof message !== "object" || message === null)
|
26877 | return "object expected";
|
26878 | if (message.value != null && message.hasOwnProperty("value"))
|
26879 | if (!$util.isInteger(message.value))
|
26880 | return "value: integer expected";
|
26881 | return null;
|
26882 | };
|
26883 |
|
26884 | /**
|
26885 | * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types.
|
26886 | * @function fromObject
|
26887 | * @memberof google.protobuf.UInt32Value
|
26888 | * @static
|
26889 | * @param {Object.<string,*>} object Plain object
|
26890 | * @returns {google.protobuf.UInt32Value} UInt32Value
|
26891 | */
|
26892 | UInt32Value.fromObject = function fromObject(object) {
|
26893 | if (object instanceof $root.google.protobuf.UInt32Value)
|
26894 | return object;
|
26895 | var message = new $root.google.protobuf.UInt32Value();
|
26896 | if (object.value != null)
|
26897 | message.value = object.value >>> 0;
|
26898 | return message;
|
26899 | };
|
26900 |
|
26901 | /**
|
26902 | * Creates a plain object from a UInt32Value message. Also converts values to other types if specified.
|
26903 | * @function toObject
|
26904 | * @memberof google.protobuf.UInt32Value
|
26905 | * @static
|
26906 | * @param {google.protobuf.UInt32Value} message UInt32Value
|
26907 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
26908 | * @returns {Object.<string,*>} Plain object
|
26909 | */
|
26910 | UInt32Value.toObject = function toObject(message, options) {
|
26911 | if (!options)
|
26912 | options = {};
|
26913 | var object = {};
|
26914 | if (options.defaults)
|
26915 | object.value = 0;
|
26916 | if (message.value != null && message.hasOwnProperty("value"))
|
26917 | object.value = message.value;
|
26918 | return object;
|
26919 | };
|
26920 |
|
26921 | /**
|
26922 | * Converts this UInt32Value to JSON.
|
26923 | * @function toJSON
|
26924 | * @memberof google.protobuf.UInt32Value
|
26925 | * @instance
|
26926 | * @returns {Object.<string,*>} JSON object
|
26927 | */
|
26928 | UInt32Value.prototype.toJSON = function toJSON() {
|
26929 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
26930 | };
|
26931 |
|
26932 | return UInt32Value;
|
26933 | })();
|
26934 |
|
26935 | protobuf.BoolValue = (function() {
|
26936 |
|
26937 | /**
|
26938 | * Properties of a BoolValue.
|
26939 | * @memberof google.protobuf
|
26940 | * @interface IBoolValue
|
26941 | * @property {boolean|null} [value] BoolValue value
|
26942 | */
|
26943 |
|
26944 | /**
|
26945 | * Constructs a new BoolValue.
|
26946 | * @memberof google.protobuf
|
26947 | * @classdesc Represents a BoolValue.
|
26948 | * @implements IBoolValue
|
26949 | * @constructor
|
26950 | * @param {google.protobuf.IBoolValue=} [properties] Properties to set
|
26951 | */
|
26952 | function BoolValue(properties) {
|
26953 | if (properties)
|
26954 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
26955 | if (properties[keys[i]] != null)
|
26956 | this[keys[i]] = properties[keys[i]];
|
26957 | }
|
26958 |
|
26959 | /**
|
26960 | * BoolValue value.
|
26961 | * @member {boolean} value
|
26962 | * @memberof google.protobuf.BoolValue
|
26963 | * @instance
|
26964 | */
|
26965 | BoolValue.prototype.value = false;
|
26966 |
|
26967 | /**
|
26968 | * Creates a new BoolValue instance using the specified properties.
|
26969 | * @function create
|
26970 | * @memberof google.protobuf.BoolValue
|
26971 | * @static
|
26972 | * @param {google.protobuf.IBoolValue=} [properties] Properties to set
|
26973 | * @returns {google.protobuf.BoolValue} BoolValue instance
|
26974 | */
|
26975 | BoolValue.create = function create(properties) {
|
26976 | return new BoolValue(properties);
|
26977 | };
|
26978 |
|
26979 | /**
|
26980 | * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages.
|
26981 | * @function encode
|
26982 | * @memberof google.protobuf.BoolValue
|
26983 | * @static
|
26984 | * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode
|
26985 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
26986 | * @returns {$protobuf.Writer} Writer
|
26987 | */
|
26988 | BoolValue.encode = function encode(message, writer) {
|
26989 | if (!writer)
|
26990 | writer = $Writer.create();
|
26991 | if (message.value != null && Object.hasOwnProperty.call(message, "value"))
|
26992 | writer.uint32(/* id 1, wireType 0 =*/8).bool(message.value);
|
26993 | return writer;
|
26994 | };
|
26995 |
|
26996 | /**
|
26997 | * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages.
|
26998 | * @function encodeDelimited
|
26999 | * @memberof google.protobuf.BoolValue
|
27000 | * @static
|
27001 | * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode
|
27002 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
27003 | * @returns {$protobuf.Writer} Writer
|
27004 | */
|
27005 | BoolValue.encodeDelimited = function encodeDelimited(message, writer) {
|
27006 | return this.encode(message, writer).ldelim();
|
27007 | };
|
27008 |
|
27009 | /**
|
27010 | * Decodes a BoolValue message from the specified reader or buffer.
|
27011 | * @function decode
|
27012 | * @memberof google.protobuf.BoolValue
|
27013 | * @static
|
27014 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
27015 | * @param {number} [length] Message length if known beforehand
|
27016 | * @returns {google.protobuf.BoolValue} BoolValue
|
27017 | * @throws {Error} If the payload is not a reader or valid buffer
|
27018 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
27019 | */
|
27020 | BoolValue.decode = function decode(reader, length) {
|
27021 | if (!(reader instanceof $Reader))
|
27022 | reader = $Reader.create(reader);
|
27023 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BoolValue();
|
27024 | while (reader.pos < end) {
|
27025 | var tag = reader.uint32();
|
27026 | switch (tag >>> 3) {
|
27027 | case 1:
|
27028 | message.value = reader.bool();
|
27029 | break;
|
27030 | default:
|
27031 | reader.skipType(tag & 7);
|
27032 | break;
|
27033 | }
|
27034 | }
|
27035 | return message;
|
27036 | };
|
27037 |
|
27038 | /**
|
27039 | * Decodes a BoolValue message from the specified reader or buffer, length delimited.
|
27040 | * @function decodeDelimited
|
27041 | * @memberof google.protobuf.BoolValue
|
27042 | * @static
|
27043 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
27044 | * @returns {google.protobuf.BoolValue} BoolValue
|
27045 | * @throws {Error} If the payload is not a reader or valid buffer
|
27046 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
27047 | */
|
27048 | BoolValue.decodeDelimited = function decodeDelimited(reader) {
|
27049 | if (!(reader instanceof $Reader))
|
27050 | reader = new $Reader(reader);
|
27051 | return this.decode(reader, reader.uint32());
|
27052 | };
|
27053 |
|
27054 | /**
|
27055 | * Verifies a BoolValue message.
|
27056 | * @function verify
|
27057 | * @memberof google.protobuf.BoolValue
|
27058 | * @static
|
27059 | * @param {Object.<string,*>} message Plain object to verify
|
27060 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
27061 | */
|
27062 | BoolValue.verify = function verify(message) {
|
27063 | if (typeof message !== "object" || message === null)
|
27064 | return "object expected";
|
27065 | if (message.value != null && message.hasOwnProperty("value"))
|
27066 | if (typeof message.value !== "boolean")
|
27067 | return "value: boolean expected";
|
27068 | return null;
|
27069 | };
|
27070 |
|
27071 | /**
|
27072 | * Creates a BoolValue message from a plain object. Also converts values to their respective internal types.
|
27073 | * @function fromObject
|
27074 | * @memberof google.protobuf.BoolValue
|
27075 | * @static
|
27076 | * @param {Object.<string,*>} object Plain object
|
27077 | * @returns {google.protobuf.BoolValue} BoolValue
|
27078 | */
|
27079 | BoolValue.fromObject = function fromObject(object) {
|
27080 | if (object instanceof $root.google.protobuf.BoolValue)
|
27081 | return object;
|
27082 | var message = new $root.google.protobuf.BoolValue();
|
27083 | if (object.value != null)
|
27084 | message.value = Boolean(object.value);
|
27085 | return message;
|
27086 | };
|
27087 |
|
27088 | /**
|
27089 | * Creates a plain object from a BoolValue message. Also converts values to other types if specified.
|
27090 | * @function toObject
|
27091 | * @memberof google.protobuf.BoolValue
|
27092 | * @static
|
27093 | * @param {google.protobuf.BoolValue} message BoolValue
|
27094 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
27095 | * @returns {Object.<string,*>} Plain object
|
27096 | */
|
27097 | BoolValue.toObject = function toObject(message, options) {
|
27098 | if (!options)
|
27099 | options = {};
|
27100 | var object = {};
|
27101 | if (options.defaults)
|
27102 | object.value = false;
|
27103 | if (message.value != null && message.hasOwnProperty("value"))
|
27104 | object.value = message.value;
|
27105 | return object;
|
27106 | };
|
27107 |
|
27108 | /**
|
27109 | * Converts this BoolValue to JSON.
|
27110 | * @function toJSON
|
27111 | * @memberof google.protobuf.BoolValue
|
27112 | * @instance
|
27113 | * @returns {Object.<string,*>} JSON object
|
27114 | */
|
27115 | BoolValue.prototype.toJSON = function toJSON() {
|
27116 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
27117 | };
|
27118 |
|
27119 | return BoolValue;
|
27120 | })();
|
27121 |
|
27122 | protobuf.StringValue = (function() {
|
27123 |
|
27124 | /**
|
27125 | * Properties of a StringValue.
|
27126 | * @memberof google.protobuf
|
27127 | * @interface IStringValue
|
27128 | * @property {string|null} [value] StringValue value
|
27129 | */
|
27130 |
|
27131 | /**
|
27132 | * Constructs a new StringValue.
|
27133 | * @memberof google.protobuf
|
27134 | * @classdesc Represents a StringValue.
|
27135 | * @implements IStringValue
|
27136 | * @constructor
|
27137 | * @param {google.protobuf.IStringValue=} [properties] Properties to set
|
27138 | */
|
27139 | function StringValue(properties) {
|
27140 | if (properties)
|
27141 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
27142 | if (properties[keys[i]] != null)
|
27143 | this[keys[i]] = properties[keys[i]];
|
27144 | }
|
27145 |
|
27146 | /**
|
27147 | * StringValue value.
|
27148 | * @member {string} value
|
27149 | * @memberof google.protobuf.StringValue
|
27150 | * @instance
|
27151 | */
|
27152 | StringValue.prototype.value = "";
|
27153 |
|
27154 | /**
|
27155 | * Creates a new StringValue instance using the specified properties.
|
27156 | * @function create
|
27157 | * @memberof google.protobuf.StringValue
|
27158 | * @static
|
27159 | * @param {google.protobuf.IStringValue=} [properties] Properties to set
|
27160 | * @returns {google.protobuf.StringValue} StringValue instance
|
27161 | */
|
27162 | StringValue.create = function create(properties) {
|
27163 | return new StringValue(properties);
|
27164 | };
|
27165 |
|
27166 | /**
|
27167 | * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages.
|
27168 | * @function encode
|
27169 | * @memberof google.protobuf.StringValue
|
27170 | * @static
|
27171 | * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode
|
27172 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
27173 | * @returns {$protobuf.Writer} Writer
|
27174 | */
|
27175 | StringValue.encode = function encode(message, writer) {
|
27176 | if (!writer)
|
27177 | writer = $Writer.create();
|
27178 | if (message.value != null && Object.hasOwnProperty.call(message, "value"))
|
27179 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.value);
|
27180 | return writer;
|
27181 | };
|
27182 |
|
27183 | /**
|
27184 | * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages.
|
27185 | * @function encodeDelimited
|
27186 | * @memberof google.protobuf.StringValue
|
27187 | * @static
|
27188 | * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode
|
27189 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
27190 | * @returns {$protobuf.Writer} Writer
|
27191 | */
|
27192 | StringValue.encodeDelimited = function encodeDelimited(message, writer) {
|
27193 | return this.encode(message, writer).ldelim();
|
27194 | };
|
27195 |
|
27196 | /**
|
27197 | * Decodes a StringValue message from the specified reader or buffer.
|
27198 | * @function decode
|
27199 | * @memberof google.protobuf.StringValue
|
27200 | * @static
|
27201 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
27202 | * @param {number} [length] Message length if known beforehand
|
27203 | * @returns {google.protobuf.StringValue} StringValue
|
27204 | * @throws {Error} If the payload is not a reader or valid buffer
|
27205 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
27206 | */
|
27207 | StringValue.decode = function decode(reader, length) {
|
27208 | if (!(reader instanceof $Reader))
|
27209 | reader = $Reader.create(reader);
|
27210 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.StringValue();
|
27211 | while (reader.pos < end) {
|
27212 | var tag = reader.uint32();
|
27213 | switch (tag >>> 3) {
|
27214 | case 1:
|
27215 | message.value = reader.string();
|
27216 | break;
|
27217 | default:
|
27218 | reader.skipType(tag & 7);
|
27219 | break;
|
27220 | }
|
27221 | }
|
27222 | return message;
|
27223 | };
|
27224 |
|
27225 | /**
|
27226 | * Decodes a StringValue message from the specified reader or buffer, length delimited.
|
27227 | * @function decodeDelimited
|
27228 | * @memberof google.protobuf.StringValue
|
27229 | * @static
|
27230 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
27231 | * @returns {google.protobuf.StringValue} StringValue
|
27232 | * @throws {Error} If the payload is not a reader or valid buffer
|
27233 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
27234 | */
|
27235 | StringValue.decodeDelimited = function decodeDelimited(reader) {
|
27236 | if (!(reader instanceof $Reader))
|
27237 | reader = new $Reader(reader);
|
27238 | return this.decode(reader, reader.uint32());
|
27239 | };
|
27240 |
|
27241 | /**
|
27242 | * Verifies a StringValue message.
|
27243 | * @function verify
|
27244 | * @memberof google.protobuf.StringValue
|
27245 | * @static
|
27246 | * @param {Object.<string,*>} message Plain object to verify
|
27247 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
27248 | */
|
27249 | StringValue.verify = function verify(message) {
|
27250 | if (typeof message !== "object" || message === null)
|
27251 | return "object expected";
|
27252 | if (message.value != null && message.hasOwnProperty("value"))
|
27253 | if (!$util.isString(message.value))
|
27254 | return "value: string expected";
|
27255 | return null;
|
27256 | };
|
27257 |
|
27258 | /**
|
27259 | * Creates a StringValue message from a plain object. Also converts values to their respective internal types.
|
27260 | * @function fromObject
|
27261 | * @memberof google.protobuf.StringValue
|
27262 | * @static
|
27263 | * @param {Object.<string,*>} object Plain object
|
27264 | * @returns {google.protobuf.StringValue} StringValue
|
27265 | */
|
27266 | StringValue.fromObject = function fromObject(object) {
|
27267 | if (object instanceof $root.google.protobuf.StringValue)
|
27268 | return object;
|
27269 | var message = new $root.google.protobuf.StringValue();
|
27270 | if (object.value != null)
|
27271 | message.value = String(object.value);
|
27272 | return message;
|
27273 | };
|
27274 |
|
27275 | /**
|
27276 | * Creates a plain object from a StringValue message. Also converts values to other types if specified.
|
27277 | * @function toObject
|
27278 | * @memberof google.protobuf.StringValue
|
27279 | * @static
|
27280 | * @param {google.protobuf.StringValue} message StringValue
|
27281 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
27282 | * @returns {Object.<string,*>} Plain object
|
27283 | */
|
27284 | StringValue.toObject = function toObject(message, options) {
|
27285 | if (!options)
|
27286 | options = {};
|
27287 | var object = {};
|
27288 | if (options.defaults)
|
27289 | object.value = "";
|
27290 | if (message.value != null && message.hasOwnProperty("value"))
|
27291 | object.value = message.value;
|
27292 | return object;
|
27293 | };
|
27294 |
|
27295 | /**
|
27296 | * Converts this StringValue to JSON.
|
27297 | * @function toJSON
|
27298 | * @memberof google.protobuf.StringValue
|
27299 | * @instance
|
27300 | * @returns {Object.<string,*>} JSON object
|
27301 | */
|
27302 | StringValue.prototype.toJSON = function toJSON() {
|
27303 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
27304 | };
|
27305 |
|
27306 | return StringValue;
|
27307 | })();
|
27308 |
|
27309 | protobuf.BytesValue = (function() {
|
27310 |
|
27311 | /**
|
27312 | * Properties of a BytesValue.
|
27313 | * @memberof google.protobuf
|
27314 | * @interface IBytesValue
|
27315 | * @property {Uint8Array|null} [value] BytesValue value
|
27316 | */
|
27317 |
|
27318 | /**
|
27319 | * Constructs a new BytesValue.
|
27320 | * @memberof google.protobuf
|
27321 | * @classdesc Represents a BytesValue.
|
27322 | * @implements IBytesValue
|
27323 | * @constructor
|
27324 | * @param {google.protobuf.IBytesValue=} [properties] Properties to set
|
27325 | */
|
27326 | function BytesValue(properties) {
|
27327 | if (properties)
|
27328 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
27329 | if (properties[keys[i]] != null)
|
27330 | this[keys[i]] = properties[keys[i]];
|
27331 | }
|
27332 |
|
27333 | /**
|
27334 | * BytesValue value.
|
27335 | * @member {Uint8Array} value
|
27336 | * @memberof google.protobuf.BytesValue
|
27337 | * @instance
|
27338 | */
|
27339 | BytesValue.prototype.value = $util.newBuffer([]);
|
27340 |
|
27341 | /**
|
27342 | * Creates a new BytesValue instance using the specified properties.
|
27343 | * @function create
|
27344 | * @memberof google.protobuf.BytesValue
|
27345 | * @static
|
27346 | * @param {google.protobuf.IBytesValue=} [properties] Properties to set
|
27347 | * @returns {google.protobuf.BytesValue} BytesValue instance
|
27348 | */
|
27349 | BytesValue.create = function create(properties) {
|
27350 | return new BytesValue(properties);
|
27351 | };
|
27352 |
|
27353 | /**
|
27354 | * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages.
|
27355 | * @function encode
|
27356 | * @memberof google.protobuf.BytesValue
|
27357 | * @static
|
27358 | * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode
|
27359 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
27360 | * @returns {$protobuf.Writer} Writer
|
27361 | */
|
27362 | BytesValue.encode = function encode(message, writer) {
|
27363 | if (!writer)
|
27364 | writer = $Writer.create();
|
27365 | if (message.value != null && Object.hasOwnProperty.call(message, "value"))
|
27366 | writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.value);
|
27367 | return writer;
|
27368 | };
|
27369 |
|
27370 | /**
|
27371 | * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages.
|
27372 | * @function encodeDelimited
|
27373 | * @memberof google.protobuf.BytesValue
|
27374 | * @static
|
27375 | * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode
|
27376 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
27377 | * @returns {$protobuf.Writer} Writer
|
27378 | */
|
27379 | BytesValue.encodeDelimited = function encodeDelimited(message, writer) {
|
27380 | return this.encode(message, writer).ldelim();
|
27381 | };
|
27382 |
|
27383 | /**
|
27384 | * Decodes a BytesValue message from the specified reader or buffer.
|
27385 | * @function decode
|
27386 | * @memberof google.protobuf.BytesValue
|
27387 | * @static
|
27388 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
27389 | * @param {number} [length] Message length if known beforehand
|
27390 | * @returns {google.protobuf.BytesValue} BytesValue
|
27391 | * @throws {Error} If the payload is not a reader or valid buffer
|
27392 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
27393 | */
|
27394 | BytesValue.decode = function decode(reader, length) {
|
27395 | if (!(reader instanceof $Reader))
|
27396 | reader = $Reader.create(reader);
|
27397 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BytesValue();
|
27398 | while (reader.pos < end) {
|
27399 | var tag = reader.uint32();
|
27400 | switch (tag >>> 3) {
|
27401 | case 1:
|
27402 | message.value = reader.bytes();
|
27403 | break;
|
27404 | default:
|
27405 | reader.skipType(tag & 7);
|
27406 | break;
|
27407 | }
|
27408 | }
|
27409 | return message;
|
27410 | };
|
27411 |
|
27412 | /**
|
27413 | * Decodes a BytesValue message from the specified reader or buffer, length delimited.
|
27414 | * @function decodeDelimited
|
27415 | * @memberof google.protobuf.BytesValue
|
27416 | * @static
|
27417 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
27418 | * @returns {google.protobuf.BytesValue} BytesValue
|
27419 | * @throws {Error} If the payload is not a reader or valid buffer
|
27420 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
27421 | */
|
27422 | BytesValue.decodeDelimited = function decodeDelimited(reader) {
|
27423 | if (!(reader instanceof $Reader))
|
27424 | reader = new $Reader(reader);
|
27425 | return this.decode(reader, reader.uint32());
|
27426 | };
|
27427 |
|
27428 | /**
|
27429 | * Verifies a BytesValue message.
|
27430 | * @function verify
|
27431 | * @memberof google.protobuf.BytesValue
|
27432 | * @static
|
27433 | * @param {Object.<string,*>} message Plain object to verify
|
27434 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
27435 | */
|
27436 | BytesValue.verify = function verify(message) {
|
27437 | if (typeof message !== "object" || message === null)
|
27438 | return "object expected";
|
27439 | if (message.value != null && message.hasOwnProperty("value"))
|
27440 | if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value)))
|
27441 | return "value: buffer expected";
|
27442 | return null;
|
27443 | };
|
27444 |
|
27445 | /**
|
27446 | * Creates a BytesValue message from a plain object. Also converts values to their respective internal types.
|
27447 | * @function fromObject
|
27448 | * @memberof google.protobuf.BytesValue
|
27449 | * @static
|
27450 | * @param {Object.<string,*>} object Plain object
|
27451 | * @returns {google.protobuf.BytesValue} BytesValue
|
27452 | */
|
27453 | BytesValue.fromObject = function fromObject(object) {
|
27454 | if (object instanceof $root.google.protobuf.BytesValue)
|
27455 | return object;
|
27456 | var message = new $root.google.protobuf.BytesValue();
|
27457 | if (object.value != null)
|
27458 | if (typeof object.value === "string")
|
27459 | $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0);
|
27460 | else if (object.value.length)
|
27461 | message.value = object.value;
|
27462 | return message;
|
27463 | };
|
27464 |
|
27465 | /**
|
27466 | * Creates a plain object from a BytesValue message. Also converts values to other types if specified.
|
27467 | * @function toObject
|
27468 | * @memberof google.protobuf.BytesValue
|
27469 | * @static
|
27470 | * @param {google.protobuf.BytesValue} message BytesValue
|
27471 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
27472 | * @returns {Object.<string,*>} Plain object
|
27473 | */
|
27474 | BytesValue.toObject = function toObject(message, options) {
|
27475 | if (!options)
|
27476 | options = {};
|
27477 | var object = {};
|
27478 | if (options.defaults)
|
27479 | if (options.bytes === String)
|
27480 | object.value = "";
|
27481 | else {
|
27482 | object.value = [];
|
27483 | if (options.bytes !== Array)
|
27484 | object.value = $util.newBuffer(object.value);
|
27485 | }
|
27486 | if (message.value != null && message.hasOwnProperty("value"))
|
27487 | object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value;
|
27488 | return object;
|
27489 | };
|
27490 |
|
27491 | /**
|
27492 | * Converts this BytesValue to JSON.
|
27493 | * @function toJSON
|
27494 | * @memberof google.protobuf.BytesValue
|
27495 | * @instance
|
27496 | * @returns {Object.<string,*>} JSON object
|
27497 | */
|
27498 | BytesValue.prototype.toJSON = function toJSON() {
|
27499 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
27500 | };
|
27501 |
|
27502 | return BytesValue;
|
27503 | })();
|
27504 |
|
27505 | protobuf.FieldMask = (function() {
|
27506 |
|
27507 | /**
|
27508 | * Properties of a FieldMask.
|
27509 | * @memberof google.protobuf
|
27510 | * @interface IFieldMask
|
27511 | * @property {Array.<string>|null} [paths] FieldMask paths
|
27512 | */
|
27513 |
|
27514 | /**
|
27515 | * Constructs a new FieldMask.
|
27516 | * @memberof google.protobuf
|
27517 | * @classdesc Represents a FieldMask.
|
27518 | * @implements IFieldMask
|
27519 | * @constructor
|
27520 | * @param {google.protobuf.IFieldMask=} [properties] Properties to set
|
27521 | */
|
27522 | function FieldMask(properties) {
|
27523 | this.paths = [];
|
27524 | if (properties)
|
27525 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
27526 | if (properties[keys[i]] != null)
|
27527 | this[keys[i]] = properties[keys[i]];
|
27528 | }
|
27529 |
|
27530 | /**
|
27531 | * FieldMask paths.
|
27532 | * @member {Array.<string>} paths
|
27533 | * @memberof google.protobuf.FieldMask
|
27534 | * @instance
|
27535 | */
|
27536 | FieldMask.prototype.paths = $util.emptyArray;
|
27537 |
|
27538 | /**
|
27539 | * Creates a new FieldMask instance using the specified properties.
|
27540 | * @function create
|
27541 | * @memberof google.protobuf.FieldMask
|
27542 | * @static
|
27543 | * @param {google.protobuf.IFieldMask=} [properties] Properties to set
|
27544 | * @returns {google.protobuf.FieldMask} FieldMask instance
|
27545 | */
|
27546 | FieldMask.create = function create(properties) {
|
27547 | return new FieldMask(properties);
|
27548 | };
|
27549 |
|
27550 | /**
|
27551 | * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages.
|
27552 | * @function encode
|
27553 | * @memberof google.protobuf.FieldMask
|
27554 | * @static
|
27555 | * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode
|
27556 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
27557 | * @returns {$protobuf.Writer} Writer
|
27558 | */
|
27559 | FieldMask.encode = function encode(message, writer) {
|
27560 | if (!writer)
|
27561 | writer = $Writer.create();
|
27562 | if (message.paths != null && message.paths.length)
|
27563 | for (var i = 0; i < message.paths.length; ++i)
|
27564 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]);
|
27565 | return writer;
|
27566 | };
|
27567 |
|
27568 | /**
|
27569 | * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages.
|
27570 | * @function encodeDelimited
|
27571 | * @memberof google.protobuf.FieldMask
|
27572 | * @static
|
27573 | * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode
|
27574 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
27575 | * @returns {$protobuf.Writer} Writer
|
27576 | */
|
27577 | FieldMask.encodeDelimited = function encodeDelimited(message, writer) {
|
27578 | return this.encode(message, writer).ldelim();
|
27579 | };
|
27580 |
|
27581 | /**
|
27582 | * Decodes a FieldMask message from the specified reader or buffer.
|
27583 | * @function decode
|
27584 | * @memberof google.protobuf.FieldMask
|
27585 | * @static
|
27586 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
27587 | * @param {number} [length] Message length if known beforehand
|
27588 | * @returns {google.protobuf.FieldMask} FieldMask
|
27589 | * @throws {Error} If the payload is not a reader or valid buffer
|
27590 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
27591 | */
|
27592 | FieldMask.decode = function decode(reader, length) {
|
27593 | if (!(reader instanceof $Reader))
|
27594 | reader = $Reader.create(reader);
|
27595 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask();
|
27596 | while (reader.pos < end) {
|
27597 | var tag = reader.uint32();
|
27598 | switch (tag >>> 3) {
|
27599 | case 1:
|
27600 | if (!(message.paths && message.paths.length))
|
27601 | message.paths = [];
|
27602 | message.paths.push(reader.string());
|
27603 | break;
|
27604 | default:
|
27605 | reader.skipType(tag & 7);
|
27606 | break;
|
27607 | }
|
27608 | }
|
27609 | return message;
|
27610 | };
|
27611 |
|
27612 | /**
|
27613 | * Decodes a FieldMask message from the specified reader or buffer, length delimited.
|
27614 | * @function decodeDelimited
|
27615 | * @memberof google.protobuf.FieldMask
|
27616 | * @static
|
27617 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
27618 | * @returns {google.protobuf.FieldMask} FieldMask
|
27619 | * @throws {Error} If the payload is not a reader or valid buffer
|
27620 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
27621 | */
|
27622 | FieldMask.decodeDelimited = function decodeDelimited(reader) {
|
27623 | if (!(reader instanceof $Reader))
|
27624 | reader = new $Reader(reader);
|
27625 | return this.decode(reader, reader.uint32());
|
27626 | };
|
27627 |
|
27628 | /**
|
27629 | * Verifies a FieldMask message.
|
27630 | * @function verify
|
27631 | * @memberof google.protobuf.FieldMask
|
27632 | * @static
|
27633 | * @param {Object.<string,*>} message Plain object to verify
|
27634 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
27635 | */
|
27636 | FieldMask.verify = function verify(message) {
|
27637 | if (typeof message !== "object" || message === null)
|
27638 | return "object expected";
|
27639 | if (message.paths != null && message.hasOwnProperty("paths")) {
|
27640 | if (!Array.isArray(message.paths))
|
27641 | return "paths: array expected";
|
27642 | for (var i = 0; i < message.paths.length; ++i)
|
27643 | if (!$util.isString(message.paths[i]))
|
27644 | return "paths: string[] expected";
|
27645 | }
|
27646 | return null;
|
27647 | };
|
27648 |
|
27649 | /**
|
27650 | * Creates a FieldMask message from a plain object. Also converts values to their respective internal types.
|
27651 | * @function fromObject
|
27652 | * @memberof google.protobuf.FieldMask
|
27653 | * @static
|
27654 | * @param {Object.<string,*>} object Plain object
|
27655 | * @returns {google.protobuf.FieldMask} FieldMask
|
27656 | */
|
27657 | FieldMask.fromObject = function fromObject(object) {
|
27658 | if (object instanceof $root.google.protobuf.FieldMask)
|
27659 | return object;
|
27660 | var message = new $root.google.protobuf.FieldMask();
|
27661 | if (object.paths) {
|
27662 | if (!Array.isArray(object.paths))
|
27663 | throw TypeError(".google.protobuf.FieldMask.paths: array expected");
|
27664 | message.paths = [];
|
27665 | for (var i = 0; i < object.paths.length; ++i)
|
27666 | message.paths[i] = String(object.paths[i]);
|
27667 | }
|
27668 | return message;
|
27669 | };
|
27670 |
|
27671 | /**
|
27672 | * Creates a plain object from a FieldMask message. Also converts values to other types if specified.
|
27673 | * @function toObject
|
27674 | * @memberof google.protobuf.FieldMask
|
27675 | * @static
|
27676 | * @param {google.protobuf.FieldMask} message FieldMask
|
27677 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
27678 | * @returns {Object.<string,*>} Plain object
|
27679 | */
|
27680 | FieldMask.toObject = function toObject(message, options) {
|
27681 | if (!options)
|
27682 | options = {};
|
27683 | var object = {};
|
27684 | if (options.arrays || options.defaults)
|
27685 | object.paths = [];
|
27686 | if (message.paths && message.paths.length) {
|
27687 | object.paths = [];
|
27688 | for (var j = 0; j < message.paths.length; ++j)
|
27689 | object.paths[j] = message.paths[j];
|
27690 | }
|
27691 | return object;
|
27692 | };
|
27693 |
|
27694 | /**
|
27695 | * Converts this FieldMask to JSON.
|
27696 | * @function toJSON
|
27697 | * @memberof google.protobuf.FieldMask
|
27698 | * @instance
|
27699 | * @returns {Object.<string,*>} JSON object
|
27700 | */
|
27701 | FieldMask.prototype.toJSON = function toJSON() {
|
27702 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
27703 | };
|
27704 |
|
27705 | return FieldMask;
|
27706 | })();
|
27707 |
|
27708 | return protobuf;
|
27709 | })();
|
27710 |
|
27711 | google.longrunning = (function() {
|
27712 |
|
27713 | /**
|
27714 | * Namespace longrunning.
|
27715 | * @memberof google
|
27716 | * @namespace
|
27717 | */
|
27718 | var longrunning = {};
|
27719 |
|
27720 | longrunning.Operations = (function() {
|
27721 |
|
27722 | /**
|
27723 | * Constructs a new Operations service.
|
27724 | * @memberof google.longrunning
|
27725 | * @classdesc Represents an Operations
|
27726 | * @extends $protobuf.rpc.Service
|
27727 | * @constructor
|
27728 | * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
|
27729 | * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
|
27730 | * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
|
27731 | */
|
27732 | function Operations(rpcImpl, requestDelimited, responseDelimited) {
|
27733 | $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);
|
27734 | }
|
27735 |
|
27736 | (Operations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Operations;
|
27737 |
|
27738 | /**
|
27739 | * Creates new Operations service using the specified rpc implementation.
|
27740 | * @function create
|
27741 | * @memberof google.longrunning.Operations
|
27742 | * @static
|
27743 | * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
|
27744 | * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
|
27745 | * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
|
27746 | * @returns {Operations} RPC service. Useful where requests and/or responses are streamed.
|
27747 | */
|
27748 | Operations.create = function create(rpcImpl, requestDelimited, responseDelimited) {
|
27749 | return new this(rpcImpl, requestDelimited, responseDelimited);
|
27750 | };
|
27751 |
|
27752 | /**
|
27753 | * Callback as used by {@link google.longrunning.Operations#listOperations}.
|
27754 | * @memberof google.longrunning.Operations
|
27755 | * @typedef ListOperationsCallback
|
27756 | * @type {function}
|
27757 | * @param {Error|null} error Error, if any
|
27758 | * @param {google.longrunning.ListOperationsResponse} [response] ListOperationsResponse
|
27759 | */
|
27760 |
|
27761 | /**
|
27762 | * Calls ListOperations.
|
27763 | * @function listOperations
|
27764 | * @memberof google.longrunning.Operations
|
27765 | * @instance
|
27766 | * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object
|
27767 | * @param {google.longrunning.Operations.ListOperationsCallback} callback Node-style callback called with the error, if any, and ListOperationsResponse
|
27768 | * @returns {undefined}
|
27769 | * @variation 1
|
27770 | */
|
27771 | Object.defineProperty(Operations.prototype.listOperations = function listOperations(request, callback) {
|
27772 | return this.rpcCall(listOperations, $root.google.longrunning.ListOperationsRequest, $root.google.longrunning.ListOperationsResponse, request, callback);
|
27773 | }, "name", { value: "ListOperations" });
|
27774 |
|
27775 | /**
|
27776 | * Calls ListOperations.
|
27777 | * @function listOperations
|
27778 | * @memberof google.longrunning.Operations
|
27779 | * @instance
|
27780 | * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object
|
27781 | * @returns {Promise<google.longrunning.ListOperationsResponse>} Promise
|
27782 | * @variation 2
|
27783 | */
|
27784 |
|
27785 | /**
|
27786 | * Callback as used by {@link google.longrunning.Operations#getOperation}.
|
27787 | * @memberof google.longrunning.Operations
|
27788 | * @typedef GetOperationCallback
|
27789 | * @type {function}
|
27790 | * @param {Error|null} error Error, if any
|
27791 | * @param {google.longrunning.Operation} [response] Operation
|
27792 | */
|
27793 |
|
27794 | /**
|
27795 | * Calls GetOperation.
|
27796 | * @function getOperation
|
27797 | * @memberof google.longrunning.Operations
|
27798 | * @instance
|
27799 | * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object
|
27800 | * @param {google.longrunning.Operations.GetOperationCallback} callback Node-style callback called with the error, if any, and Operation
|
27801 | * @returns {undefined}
|
27802 | * @variation 1
|
27803 | */
|
27804 | Object.defineProperty(Operations.prototype.getOperation = function getOperation(request, callback) {
|
27805 | return this.rpcCall(getOperation, $root.google.longrunning.GetOperationRequest, $root.google.longrunning.Operation, request, callback);
|
27806 | }, "name", { value: "GetOperation" });
|
27807 |
|
27808 | /**
|
27809 | * Calls GetOperation.
|
27810 | * @function getOperation
|
27811 | * @memberof google.longrunning.Operations
|
27812 | * @instance
|
27813 | * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object
|
27814 | * @returns {Promise<google.longrunning.Operation>} Promise
|
27815 | * @variation 2
|
27816 | */
|
27817 |
|
27818 | /**
|
27819 | * Callback as used by {@link google.longrunning.Operations#deleteOperation}.
|
27820 | * @memberof google.longrunning.Operations
|
27821 | * @typedef DeleteOperationCallback
|
27822 | * @type {function}
|
27823 | * @param {Error|null} error Error, if any
|
27824 | * @param {google.protobuf.Empty} [response] Empty
|
27825 | */
|
27826 |
|
27827 | /**
|
27828 | * Calls DeleteOperation.
|
27829 | * @function deleteOperation
|
27830 | * @memberof google.longrunning.Operations
|
27831 | * @instance
|
27832 | * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object
|
27833 | * @param {google.longrunning.Operations.DeleteOperationCallback} callback Node-style callback called with the error, if any, and Empty
|
27834 | * @returns {undefined}
|
27835 | * @variation 1
|
27836 | */
|
27837 | Object.defineProperty(Operations.prototype.deleteOperation = function deleteOperation(request, callback) {
|
27838 | return this.rpcCall(deleteOperation, $root.google.longrunning.DeleteOperationRequest, $root.google.protobuf.Empty, request, callback);
|
27839 | }, "name", { value: "DeleteOperation" });
|
27840 |
|
27841 | /**
|
27842 | * Calls DeleteOperation.
|
27843 | * @function deleteOperation
|
27844 | * @memberof google.longrunning.Operations
|
27845 | * @instance
|
27846 | * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object
|
27847 | * @returns {Promise<google.protobuf.Empty>} Promise
|
27848 | * @variation 2
|
27849 | */
|
27850 |
|
27851 | /**
|
27852 | * Callback as used by {@link google.longrunning.Operations#cancelOperation}.
|
27853 | * @memberof google.longrunning.Operations
|
27854 | * @typedef CancelOperationCallback
|
27855 | * @type {function}
|
27856 | * @param {Error|null} error Error, if any
|
27857 | * @param {google.protobuf.Empty} [response] Empty
|
27858 | */
|
27859 |
|
27860 | /**
|
27861 | * Calls CancelOperation.
|
27862 | * @function cancelOperation
|
27863 | * @memberof google.longrunning.Operations
|
27864 | * @instance
|
27865 | * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object
|
27866 | * @param {google.longrunning.Operations.CancelOperationCallback} callback Node-style callback called with the error, if any, and Empty
|
27867 | * @returns {undefined}
|
27868 | * @variation 1
|
27869 | */
|
27870 | Object.defineProperty(Operations.prototype.cancelOperation = function cancelOperation(request, callback) {
|
27871 | return this.rpcCall(cancelOperation, $root.google.longrunning.CancelOperationRequest, $root.google.protobuf.Empty, request, callback);
|
27872 | }, "name", { value: "CancelOperation" });
|
27873 |
|
27874 | /**
|
27875 | * Calls CancelOperation.
|
27876 | * @function cancelOperation
|
27877 | * @memberof google.longrunning.Operations
|
27878 | * @instance
|
27879 | * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object
|
27880 | * @returns {Promise<google.protobuf.Empty>} Promise
|
27881 | * @variation 2
|
27882 | */
|
27883 |
|
27884 | /**
|
27885 | * Callback as used by {@link google.longrunning.Operations#waitOperation}.
|
27886 | * @memberof google.longrunning.Operations
|
27887 | * @typedef WaitOperationCallback
|
27888 | * @type {function}
|
27889 | * @param {Error|null} error Error, if any
|
27890 | * @param {google.longrunning.Operation} [response] Operation
|
27891 | */
|
27892 |
|
27893 | /**
|
27894 | * Calls WaitOperation.
|
27895 | * @function waitOperation
|
27896 | * @memberof google.longrunning.Operations
|
27897 | * @instance
|
27898 | * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object
|
27899 | * @param {google.longrunning.Operations.WaitOperationCallback} callback Node-style callback called with the error, if any, and Operation
|
27900 | * @returns {undefined}
|
27901 | * @variation 1
|
27902 | */
|
27903 | Object.defineProperty(Operations.prototype.waitOperation = function waitOperation(request, callback) {
|
27904 | return this.rpcCall(waitOperation, $root.google.longrunning.WaitOperationRequest, $root.google.longrunning.Operation, request, callback);
|
27905 | }, "name", { value: "WaitOperation" });
|
27906 |
|
27907 | /**
|
27908 | * Calls WaitOperation.
|
27909 | * @function waitOperation
|
27910 | * @memberof google.longrunning.Operations
|
27911 | * @instance
|
27912 | * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object
|
27913 | * @returns {Promise<google.longrunning.Operation>} Promise
|
27914 | * @variation 2
|
27915 | */
|
27916 |
|
27917 | return Operations;
|
27918 | })();
|
27919 |
|
27920 | longrunning.Operation = (function() {
|
27921 |
|
27922 | /**
|
27923 | * Properties of an Operation.
|
27924 | * @memberof google.longrunning
|
27925 | * @interface IOperation
|
27926 | * @property {string|null} [name] Operation name
|
27927 | * @property {google.protobuf.IAny|null} [metadata] Operation metadata
|
27928 | * @property {boolean|null} [done] Operation done
|
27929 | * @property {google.rpc.IStatus|null} [error] Operation error
|
27930 | * @property {google.protobuf.IAny|null} [response] Operation response
|
27931 | */
|
27932 |
|
27933 | /**
|
27934 | * Constructs a new Operation.
|
27935 | * @memberof google.longrunning
|
27936 | * @classdesc Represents an Operation.
|
27937 | * @implements IOperation
|
27938 | * @constructor
|
27939 | * @param {google.longrunning.IOperation=} [properties] Properties to set
|
27940 | */
|
27941 | function Operation(properties) {
|
27942 | if (properties)
|
27943 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
27944 | if (properties[keys[i]] != null)
|
27945 | this[keys[i]] = properties[keys[i]];
|
27946 | }
|
27947 |
|
27948 | /**
|
27949 | * Operation name.
|
27950 | * @member {string} name
|
27951 | * @memberof google.longrunning.Operation
|
27952 | * @instance
|
27953 | */
|
27954 | Operation.prototype.name = "";
|
27955 |
|
27956 | /**
|
27957 | * Operation metadata.
|
27958 | * @member {google.protobuf.IAny|null|undefined} metadata
|
27959 | * @memberof google.longrunning.Operation
|
27960 | * @instance
|
27961 | */
|
27962 | Operation.prototype.metadata = null;
|
27963 |
|
27964 | /**
|
27965 | * Operation done.
|
27966 | * @member {boolean} done
|
27967 | * @memberof google.longrunning.Operation
|
27968 | * @instance
|
27969 | */
|
27970 | Operation.prototype.done = false;
|
27971 |
|
27972 | /**
|
27973 | * Operation error.
|
27974 | * @member {google.rpc.IStatus|null|undefined} error
|
27975 | * @memberof google.longrunning.Operation
|
27976 | * @instance
|
27977 | */
|
27978 | Operation.prototype.error = null;
|
27979 |
|
27980 | /**
|
27981 | * Operation response.
|
27982 | * @member {google.protobuf.IAny|null|undefined} response
|
27983 | * @memberof google.longrunning.Operation
|
27984 | * @instance
|
27985 | */
|
27986 | Operation.prototype.response = null;
|
27987 |
|
27988 | // OneOf field names bound to virtual getters and setters
|
27989 | var $oneOfFields;
|
27990 |
|
27991 | /**
|
27992 | * Operation result.
|
27993 | * @member {"error"|"response"|undefined} result
|
27994 | * @memberof google.longrunning.Operation
|
27995 | * @instance
|
27996 | */
|
27997 | Object.defineProperty(Operation.prototype, "result", {
|
27998 | get: $util.oneOfGetter($oneOfFields = ["error", "response"]),
|
27999 | set: $util.oneOfSetter($oneOfFields)
|
28000 | });
|
28001 |
|
28002 | /**
|
28003 | * Creates a new Operation instance using the specified properties.
|
28004 | * @function create
|
28005 | * @memberof google.longrunning.Operation
|
28006 | * @static
|
28007 | * @param {google.longrunning.IOperation=} [properties] Properties to set
|
28008 | * @returns {google.longrunning.Operation} Operation instance
|
28009 | */
|
28010 | Operation.create = function create(properties) {
|
28011 | return new Operation(properties);
|
28012 | };
|
28013 |
|
28014 | /**
|
28015 | * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages.
|
28016 | * @function encode
|
28017 | * @memberof google.longrunning.Operation
|
28018 | * @static
|
28019 | * @param {google.longrunning.IOperation} message Operation message or plain object to encode
|
28020 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
28021 | * @returns {$protobuf.Writer} Writer
|
28022 | */
|
28023 | Operation.encode = function encode(message, writer) {
|
28024 | if (!writer)
|
28025 | writer = $Writer.create();
|
28026 | if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
28027 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
|
28028 | if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata"))
|
28029 | $root.google.protobuf.Any.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
28030 | if (message.done != null && Object.hasOwnProperty.call(message, "done"))
|
28031 | writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done);
|
28032 | if (message.error != null && Object.hasOwnProperty.call(message, "error"))
|
28033 | $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
|
28034 | if (message.response != null && Object.hasOwnProperty.call(message, "response"))
|
28035 | $root.google.protobuf.Any.encode(message.response, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
|
28036 | return writer;
|
28037 | };
|
28038 |
|
28039 | /**
|
28040 | * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages.
|
28041 | * @function encodeDelimited
|
28042 | * @memberof google.longrunning.Operation
|
28043 | * @static
|
28044 | * @param {google.longrunning.IOperation} message Operation message or plain object to encode
|
28045 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
28046 | * @returns {$protobuf.Writer} Writer
|
28047 | */
|
28048 | Operation.encodeDelimited = function encodeDelimited(message, writer) {
|
28049 | return this.encode(message, writer).ldelim();
|
28050 | };
|
28051 |
|
28052 | /**
|
28053 | * Decodes an Operation message from the specified reader or buffer.
|
28054 | * @function decode
|
28055 | * @memberof google.longrunning.Operation
|
28056 | * @static
|
28057 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
28058 | * @param {number} [length] Message length if known beforehand
|
28059 | * @returns {google.longrunning.Operation} Operation
|
28060 | * @throws {Error} If the payload is not a reader or valid buffer
|
28061 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
28062 | */
|
28063 | Operation.decode = function decode(reader, length) {
|
28064 | if (!(reader instanceof $Reader))
|
28065 | reader = $Reader.create(reader);
|
28066 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.Operation();
|
28067 | while (reader.pos < end) {
|
28068 | var tag = reader.uint32();
|
28069 | switch (tag >>> 3) {
|
28070 | case 1:
|
28071 | message.name = reader.string();
|
28072 | break;
|
28073 | case 2:
|
28074 | message.metadata = $root.google.protobuf.Any.decode(reader, reader.uint32());
|
28075 | break;
|
28076 | case 3:
|
28077 | message.done = reader.bool();
|
28078 | break;
|
28079 | case 4:
|
28080 | message.error = $root.google.rpc.Status.decode(reader, reader.uint32());
|
28081 | break;
|
28082 | case 5:
|
28083 | message.response = $root.google.protobuf.Any.decode(reader, reader.uint32());
|
28084 | break;
|
28085 | default:
|
28086 | reader.skipType(tag & 7);
|
28087 | break;
|
28088 | }
|
28089 | }
|
28090 | return message;
|
28091 | };
|
28092 |
|
28093 | /**
|
28094 | * Decodes an Operation message from the specified reader or buffer, length delimited.
|
28095 | * @function decodeDelimited
|
28096 | * @memberof google.longrunning.Operation
|
28097 | * @static
|
28098 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
28099 | * @returns {google.longrunning.Operation} Operation
|
28100 | * @throws {Error} If the payload is not a reader or valid buffer
|
28101 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
28102 | */
|
28103 | Operation.decodeDelimited = function decodeDelimited(reader) {
|
28104 | if (!(reader instanceof $Reader))
|
28105 | reader = new $Reader(reader);
|
28106 | return this.decode(reader, reader.uint32());
|
28107 | };
|
28108 |
|
28109 | /**
|
28110 | * Verifies an Operation message.
|
28111 | * @function verify
|
28112 | * @memberof google.longrunning.Operation
|
28113 | * @static
|
28114 | * @param {Object.<string,*>} message Plain object to verify
|
28115 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
28116 | */
|
28117 | Operation.verify = function verify(message) {
|
28118 | if (typeof message !== "object" || message === null)
|
28119 | return "object expected";
|
28120 | var properties = {};
|
28121 | if (message.name != null && message.hasOwnProperty("name"))
|
28122 | if (!$util.isString(message.name))
|
28123 | return "name: string expected";
|
28124 | if (message.metadata != null && message.hasOwnProperty("metadata")) {
|
28125 | var error = $root.google.protobuf.Any.verify(message.metadata);
|
28126 | if (error)
|
28127 | return "metadata." + error;
|
28128 | }
|
28129 | if (message.done != null && message.hasOwnProperty("done"))
|
28130 | if (typeof message.done !== "boolean")
|
28131 | return "done: boolean expected";
|
28132 | if (message.error != null && message.hasOwnProperty("error")) {
|
28133 | properties.result = 1;
|
28134 | {
|
28135 | var error = $root.google.rpc.Status.verify(message.error);
|
28136 | if (error)
|
28137 | return "error." + error;
|
28138 | }
|
28139 | }
|
28140 | if (message.response != null && message.hasOwnProperty("response")) {
|
28141 | if (properties.result === 1)
|
28142 | return "result: multiple values";
|
28143 | properties.result = 1;
|
28144 | {
|
28145 | var error = $root.google.protobuf.Any.verify(message.response);
|
28146 | if (error)
|
28147 | return "response." + error;
|
28148 | }
|
28149 | }
|
28150 | return null;
|
28151 | };
|
28152 |
|
28153 | /**
|
28154 | * Creates an Operation message from a plain object. Also converts values to their respective internal types.
|
28155 | * @function fromObject
|
28156 | * @memberof google.longrunning.Operation
|
28157 | * @static
|
28158 | * @param {Object.<string,*>} object Plain object
|
28159 | * @returns {google.longrunning.Operation} Operation
|
28160 | */
|
28161 | Operation.fromObject = function fromObject(object) {
|
28162 | if (object instanceof $root.google.longrunning.Operation)
|
28163 | return object;
|
28164 | var message = new $root.google.longrunning.Operation();
|
28165 | if (object.name != null)
|
28166 | message.name = String(object.name);
|
28167 | if (object.metadata != null) {
|
28168 | if (typeof object.metadata !== "object")
|
28169 | throw TypeError(".google.longrunning.Operation.metadata: object expected");
|
28170 | message.metadata = $root.google.protobuf.Any.fromObject(object.metadata);
|
28171 | }
|
28172 | if (object.done != null)
|
28173 | message.done = Boolean(object.done);
|
28174 | if (object.error != null) {
|
28175 | if (typeof object.error !== "object")
|
28176 | throw TypeError(".google.longrunning.Operation.error: object expected");
|
28177 | message.error = $root.google.rpc.Status.fromObject(object.error);
|
28178 | }
|
28179 | if (object.response != null) {
|
28180 | if (typeof object.response !== "object")
|
28181 | throw TypeError(".google.longrunning.Operation.response: object expected");
|
28182 | message.response = $root.google.protobuf.Any.fromObject(object.response);
|
28183 | }
|
28184 | return message;
|
28185 | };
|
28186 |
|
28187 | /**
|
28188 | * Creates a plain object from an Operation message. Also converts values to other types if specified.
|
28189 | * @function toObject
|
28190 | * @memberof google.longrunning.Operation
|
28191 | * @static
|
28192 | * @param {google.longrunning.Operation} message Operation
|
28193 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
28194 | * @returns {Object.<string,*>} Plain object
|
28195 | */
|
28196 | Operation.toObject = function toObject(message, options) {
|
28197 | if (!options)
|
28198 | options = {};
|
28199 | var object = {};
|
28200 | if (options.defaults) {
|
28201 | object.name = "";
|
28202 | object.metadata = null;
|
28203 | object.done = false;
|
28204 | }
|
28205 | if (message.name != null && message.hasOwnProperty("name"))
|
28206 | object.name = message.name;
|
28207 | if (message.metadata != null && message.hasOwnProperty("metadata"))
|
28208 | object.metadata = $root.google.protobuf.Any.toObject(message.metadata, options);
|
28209 | if (message.done != null && message.hasOwnProperty("done"))
|
28210 | object.done = message.done;
|
28211 | if (message.error != null && message.hasOwnProperty("error")) {
|
28212 | object.error = $root.google.rpc.Status.toObject(message.error, options);
|
28213 | if (options.oneofs)
|
28214 | object.result = "error";
|
28215 | }
|
28216 | if (message.response != null && message.hasOwnProperty("response")) {
|
28217 | object.response = $root.google.protobuf.Any.toObject(message.response, options);
|
28218 | if (options.oneofs)
|
28219 | object.result = "response";
|
28220 | }
|
28221 | return object;
|
28222 | };
|
28223 |
|
28224 | /**
|
28225 | * Converts this Operation to JSON.
|
28226 | * @function toJSON
|
28227 | * @memberof google.longrunning.Operation
|
28228 | * @instance
|
28229 | * @returns {Object.<string,*>} JSON object
|
28230 | */
|
28231 | Operation.prototype.toJSON = function toJSON() {
|
28232 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
28233 | };
|
28234 |
|
28235 | return Operation;
|
28236 | })();
|
28237 |
|
28238 | longrunning.GetOperationRequest = (function() {
|
28239 |
|
28240 | /**
|
28241 | * Properties of a GetOperationRequest.
|
28242 | * @memberof google.longrunning
|
28243 | * @interface IGetOperationRequest
|
28244 | * @property {string|null} [name] GetOperationRequest name
|
28245 | */
|
28246 |
|
28247 | /**
|
28248 | * Constructs a new GetOperationRequest.
|
28249 | * @memberof google.longrunning
|
28250 | * @classdesc Represents a GetOperationRequest.
|
28251 | * @implements IGetOperationRequest
|
28252 | * @constructor
|
28253 | * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set
|
28254 | */
|
28255 | function GetOperationRequest(properties) {
|
28256 | if (properties)
|
28257 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
28258 | if (properties[keys[i]] != null)
|
28259 | this[keys[i]] = properties[keys[i]];
|
28260 | }
|
28261 |
|
28262 | /**
|
28263 | * GetOperationRequest name.
|
28264 | * @member {string} name
|
28265 | * @memberof google.longrunning.GetOperationRequest
|
28266 | * @instance
|
28267 | */
|
28268 | GetOperationRequest.prototype.name = "";
|
28269 |
|
28270 | /**
|
28271 | * Creates a new GetOperationRequest instance using the specified properties.
|
28272 | * @function create
|
28273 | * @memberof google.longrunning.GetOperationRequest
|
28274 | * @static
|
28275 | * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set
|
28276 | * @returns {google.longrunning.GetOperationRequest} GetOperationRequest instance
|
28277 | */
|
28278 | GetOperationRequest.create = function create(properties) {
|
28279 | return new GetOperationRequest(properties);
|
28280 | };
|
28281 |
|
28282 | /**
|
28283 | * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages.
|
28284 | * @function encode
|
28285 | * @memberof google.longrunning.GetOperationRequest
|
28286 | * @static
|
28287 | * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode
|
28288 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
28289 | * @returns {$protobuf.Writer} Writer
|
28290 | */
|
28291 | GetOperationRequest.encode = function encode(message, writer) {
|
28292 | if (!writer)
|
28293 | writer = $Writer.create();
|
28294 | if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
28295 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
|
28296 | return writer;
|
28297 | };
|
28298 |
|
28299 | /**
|
28300 | * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages.
|
28301 | * @function encodeDelimited
|
28302 | * @memberof google.longrunning.GetOperationRequest
|
28303 | * @static
|
28304 | * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode
|
28305 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
28306 | * @returns {$protobuf.Writer} Writer
|
28307 | */
|
28308 | GetOperationRequest.encodeDelimited = function encodeDelimited(message, writer) {
|
28309 | return this.encode(message, writer).ldelim();
|
28310 | };
|
28311 |
|
28312 | /**
|
28313 | * Decodes a GetOperationRequest message from the specified reader or buffer.
|
28314 | * @function decode
|
28315 | * @memberof google.longrunning.GetOperationRequest
|
28316 | * @static
|
28317 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
28318 | * @param {number} [length] Message length if known beforehand
|
28319 | * @returns {google.longrunning.GetOperationRequest} GetOperationRequest
|
28320 | * @throws {Error} If the payload is not a reader or valid buffer
|
28321 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
28322 | */
|
28323 | GetOperationRequest.decode = function decode(reader, length) {
|
28324 | if (!(reader instanceof $Reader))
|
28325 | reader = $Reader.create(reader);
|
28326 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.GetOperationRequest();
|
28327 | while (reader.pos < end) {
|
28328 | var tag = reader.uint32();
|
28329 | switch (tag >>> 3) {
|
28330 | case 1:
|
28331 | message.name = reader.string();
|
28332 | break;
|
28333 | default:
|
28334 | reader.skipType(tag & 7);
|
28335 | break;
|
28336 | }
|
28337 | }
|
28338 | return message;
|
28339 | };
|
28340 |
|
28341 | /**
|
28342 | * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited.
|
28343 | * @function decodeDelimited
|
28344 | * @memberof google.longrunning.GetOperationRequest
|
28345 | * @static
|
28346 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
28347 | * @returns {google.longrunning.GetOperationRequest} GetOperationRequest
|
28348 | * @throws {Error} If the payload is not a reader or valid buffer
|
28349 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
28350 | */
|
28351 | GetOperationRequest.decodeDelimited = function decodeDelimited(reader) {
|
28352 | if (!(reader instanceof $Reader))
|
28353 | reader = new $Reader(reader);
|
28354 | return this.decode(reader, reader.uint32());
|
28355 | };
|
28356 |
|
28357 | /**
|
28358 | * Verifies a GetOperationRequest message.
|
28359 | * @function verify
|
28360 | * @memberof google.longrunning.GetOperationRequest
|
28361 | * @static
|
28362 | * @param {Object.<string,*>} message Plain object to verify
|
28363 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
28364 | */
|
28365 | GetOperationRequest.verify = function verify(message) {
|
28366 | if (typeof message !== "object" || message === null)
|
28367 | return "object expected";
|
28368 | if (message.name != null && message.hasOwnProperty("name"))
|
28369 | if (!$util.isString(message.name))
|
28370 | return "name: string expected";
|
28371 | return null;
|
28372 | };
|
28373 |
|
28374 | /**
|
28375 | * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types.
|
28376 | * @function fromObject
|
28377 | * @memberof google.longrunning.GetOperationRequest
|
28378 | * @static
|
28379 | * @param {Object.<string,*>} object Plain object
|
28380 | * @returns {google.longrunning.GetOperationRequest} GetOperationRequest
|
28381 | */
|
28382 | GetOperationRequest.fromObject = function fromObject(object) {
|
28383 | if (object instanceof $root.google.longrunning.GetOperationRequest)
|
28384 | return object;
|
28385 | var message = new $root.google.longrunning.GetOperationRequest();
|
28386 | if (object.name != null)
|
28387 | message.name = String(object.name);
|
28388 | return message;
|
28389 | };
|
28390 |
|
28391 | /**
|
28392 | * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified.
|
28393 | * @function toObject
|
28394 | * @memberof google.longrunning.GetOperationRequest
|
28395 | * @static
|
28396 | * @param {google.longrunning.GetOperationRequest} message GetOperationRequest
|
28397 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
28398 | * @returns {Object.<string,*>} Plain object
|
28399 | */
|
28400 | GetOperationRequest.toObject = function toObject(message, options) {
|
28401 | if (!options)
|
28402 | options = {};
|
28403 | var object = {};
|
28404 | if (options.defaults)
|
28405 | object.name = "";
|
28406 | if (message.name != null && message.hasOwnProperty("name"))
|
28407 | object.name = message.name;
|
28408 | return object;
|
28409 | };
|
28410 |
|
28411 | /**
|
28412 | * Converts this GetOperationRequest to JSON.
|
28413 | * @function toJSON
|
28414 | * @memberof google.longrunning.GetOperationRequest
|
28415 | * @instance
|
28416 | * @returns {Object.<string,*>} JSON object
|
28417 | */
|
28418 | GetOperationRequest.prototype.toJSON = function toJSON() {
|
28419 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
28420 | };
|
28421 |
|
28422 | return GetOperationRequest;
|
28423 | })();
|
28424 |
|
28425 | longrunning.ListOperationsRequest = (function() {
|
28426 |
|
28427 | /**
|
28428 | * Properties of a ListOperationsRequest.
|
28429 | * @memberof google.longrunning
|
28430 | * @interface IListOperationsRequest
|
28431 | * @property {string|null} [name] ListOperationsRequest name
|
28432 | * @property {string|null} [filter] ListOperationsRequest filter
|
28433 | * @property {number|null} [pageSize] ListOperationsRequest pageSize
|
28434 | * @property {string|null} [pageToken] ListOperationsRequest pageToken
|
28435 | */
|
28436 |
|
28437 | /**
|
28438 | * Constructs a new ListOperationsRequest.
|
28439 | * @memberof google.longrunning
|
28440 | * @classdesc Represents a ListOperationsRequest.
|
28441 | * @implements IListOperationsRequest
|
28442 | * @constructor
|
28443 | * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set
|
28444 | */
|
28445 | function ListOperationsRequest(properties) {
|
28446 | if (properties)
|
28447 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
28448 | if (properties[keys[i]] != null)
|
28449 | this[keys[i]] = properties[keys[i]];
|
28450 | }
|
28451 |
|
28452 | /**
|
28453 | * ListOperationsRequest name.
|
28454 | * @member {string} name
|
28455 | * @memberof google.longrunning.ListOperationsRequest
|
28456 | * @instance
|
28457 | */
|
28458 | ListOperationsRequest.prototype.name = "";
|
28459 |
|
28460 | /**
|
28461 | * ListOperationsRequest filter.
|
28462 | * @member {string} filter
|
28463 | * @memberof google.longrunning.ListOperationsRequest
|
28464 | * @instance
|
28465 | */
|
28466 | ListOperationsRequest.prototype.filter = "";
|
28467 |
|
28468 | /**
|
28469 | * ListOperationsRequest pageSize.
|
28470 | * @member {number} pageSize
|
28471 | * @memberof google.longrunning.ListOperationsRequest
|
28472 | * @instance
|
28473 | */
|
28474 | ListOperationsRequest.prototype.pageSize = 0;
|
28475 |
|
28476 | /**
|
28477 | * ListOperationsRequest pageToken.
|
28478 | * @member {string} pageToken
|
28479 | * @memberof google.longrunning.ListOperationsRequest
|
28480 | * @instance
|
28481 | */
|
28482 | ListOperationsRequest.prototype.pageToken = "";
|
28483 |
|
28484 | /**
|
28485 | * Creates a new ListOperationsRequest instance using the specified properties.
|
28486 | * @function create
|
28487 | * @memberof google.longrunning.ListOperationsRequest
|
28488 | * @static
|
28489 | * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set
|
28490 | * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest instance
|
28491 | */
|
28492 | ListOperationsRequest.create = function create(properties) {
|
28493 | return new ListOperationsRequest(properties);
|
28494 | };
|
28495 |
|
28496 | /**
|
28497 | * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages.
|
28498 | * @function encode
|
28499 | * @memberof google.longrunning.ListOperationsRequest
|
28500 | * @static
|
28501 | * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode
|
28502 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
28503 | * @returns {$protobuf.Writer} Writer
|
28504 | */
|
28505 | ListOperationsRequest.encode = function encode(message, writer) {
|
28506 | if (!writer)
|
28507 | writer = $Writer.create();
|
28508 | if (message.filter != null && Object.hasOwnProperty.call(message, "filter"))
|
28509 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter);
|
28510 | if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize"))
|
28511 | writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize);
|
28512 | if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken"))
|
28513 | writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken);
|
28514 | if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
28515 | writer.uint32(/* id 4, wireType 2 =*/34).string(message.name);
|
28516 | return writer;
|
28517 | };
|
28518 |
|
28519 | /**
|
28520 | * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages.
|
28521 | * @function encodeDelimited
|
28522 | * @memberof google.longrunning.ListOperationsRequest
|
28523 | * @static
|
28524 | * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode
|
28525 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
28526 | * @returns {$protobuf.Writer} Writer
|
28527 | */
|
28528 | ListOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) {
|
28529 | return this.encode(message, writer).ldelim();
|
28530 | };
|
28531 |
|
28532 | /**
|
28533 | * Decodes a ListOperationsRequest message from the specified reader or buffer.
|
28534 | * @function decode
|
28535 | * @memberof google.longrunning.ListOperationsRequest
|
28536 | * @static
|
28537 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
28538 | * @param {number} [length] Message length if known beforehand
|
28539 | * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest
|
28540 | * @throws {Error} If the payload is not a reader or valid buffer
|
28541 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
28542 | */
|
28543 | ListOperationsRequest.decode = function decode(reader, length) {
|
28544 | if (!(reader instanceof $Reader))
|
28545 | reader = $Reader.create(reader);
|
28546 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsRequest();
|
28547 | while (reader.pos < end) {
|
28548 | var tag = reader.uint32();
|
28549 | switch (tag >>> 3) {
|
28550 | case 4:
|
28551 | message.name = reader.string();
|
28552 | break;
|
28553 | case 1:
|
28554 | message.filter = reader.string();
|
28555 | break;
|
28556 | case 2:
|
28557 | message.pageSize = reader.int32();
|
28558 | break;
|
28559 | case 3:
|
28560 | message.pageToken = reader.string();
|
28561 | break;
|
28562 | default:
|
28563 | reader.skipType(tag & 7);
|
28564 | break;
|
28565 | }
|
28566 | }
|
28567 | return message;
|
28568 | };
|
28569 |
|
28570 | /**
|
28571 | * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited.
|
28572 | * @function decodeDelimited
|
28573 | * @memberof google.longrunning.ListOperationsRequest
|
28574 | * @static
|
28575 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
28576 | * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest
|
28577 | * @throws {Error} If the payload is not a reader or valid buffer
|
28578 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
28579 | */
|
28580 | ListOperationsRequest.decodeDelimited = function decodeDelimited(reader) {
|
28581 | if (!(reader instanceof $Reader))
|
28582 | reader = new $Reader(reader);
|
28583 | return this.decode(reader, reader.uint32());
|
28584 | };
|
28585 |
|
28586 | /**
|
28587 | * Verifies a ListOperationsRequest message.
|
28588 | * @function verify
|
28589 | * @memberof google.longrunning.ListOperationsRequest
|
28590 | * @static
|
28591 | * @param {Object.<string,*>} message Plain object to verify
|
28592 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
28593 | */
|
28594 | ListOperationsRequest.verify = function verify(message) {
|
28595 | if (typeof message !== "object" || message === null)
|
28596 | return "object expected";
|
28597 | if (message.name != null && message.hasOwnProperty("name"))
|
28598 | if (!$util.isString(message.name))
|
28599 | return "name: string expected";
|
28600 | if (message.filter != null && message.hasOwnProperty("filter"))
|
28601 | if (!$util.isString(message.filter))
|
28602 | return "filter: string expected";
|
28603 | if (message.pageSize != null && message.hasOwnProperty("pageSize"))
|
28604 | if (!$util.isInteger(message.pageSize))
|
28605 | return "pageSize: integer expected";
|
28606 | if (message.pageToken != null && message.hasOwnProperty("pageToken"))
|
28607 | if (!$util.isString(message.pageToken))
|
28608 | return "pageToken: string expected";
|
28609 | return null;
|
28610 | };
|
28611 |
|
28612 | /**
|
28613 | * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types.
|
28614 | * @function fromObject
|
28615 | * @memberof google.longrunning.ListOperationsRequest
|
28616 | * @static
|
28617 | * @param {Object.<string,*>} object Plain object
|
28618 | * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest
|
28619 | */
|
28620 | ListOperationsRequest.fromObject = function fromObject(object) {
|
28621 | if (object instanceof $root.google.longrunning.ListOperationsRequest)
|
28622 | return object;
|
28623 | var message = new $root.google.longrunning.ListOperationsRequest();
|
28624 | if (object.name != null)
|
28625 | message.name = String(object.name);
|
28626 | if (object.filter != null)
|
28627 | message.filter = String(object.filter);
|
28628 | if (object.pageSize != null)
|
28629 | message.pageSize = object.pageSize | 0;
|
28630 | if (object.pageToken != null)
|
28631 | message.pageToken = String(object.pageToken);
|
28632 | return message;
|
28633 | };
|
28634 |
|
28635 | /**
|
28636 | * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified.
|
28637 | * @function toObject
|
28638 | * @memberof google.longrunning.ListOperationsRequest
|
28639 | * @static
|
28640 | * @param {google.longrunning.ListOperationsRequest} message ListOperationsRequest
|
28641 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
28642 | * @returns {Object.<string,*>} Plain object
|
28643 | */
|
28644 | ListOperationsRequest.toObject = function toObject(message, options) {
|
28645 | if (!options)
|
28646 | options = {};
|
28647 | var object = {};
|
28648 | if (options.defaults) {
|
28649 | object.filter = "";
|
28650 | object.pageSize = 0;
|
28651 | object.pageToken = "";
|
28652 | object.name = "";
|
28653 | }
|
28654 | if (message.filter != null && message.hasOwnProperty("filter"))
|
28655 | object.filter = message.filter;
|
28656 | if (message.pageSize != null && message.hasOwnProperty("pageSize"))
|
28657 | object.pageSize = message.pageSize;
|
28658 | if (message.pageToken != null && message.hasOwnProperty("pageToken"))
|
28659 | object.pageToken = message.pageToken;
|
28660 | if (message.name != null && message.hasOwnProperty("name"))
|
28661 | object.name = message.name;
|
28662 | return object;
|
28663 | };
|
28664 |
|
28665 | /**
|
28666 | * Converts this ListOperationsRequest to JSON.
|
28667 | * @function toJSON
|
28668 | * @memberof google.longrunning.ListOperationsRequest
|
28669 | * @instance
|
28670 | * @returns {Object.<string,*>} JSON object
|
28671 | */
|
28672 | ListOperationsRequest.prototype.toJSON = function toJSON() {
|
28673 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
28674 | };
|
28675 |
|
28676 | return ListOperationsRequest;
|
28677 | })();
|
28678 |
|
28679 | longrunning.ListOperationsResponse = (function() {
|
28680 |
|
28681 | /**
|
28682 | * Properties of a ListOperationsResponse.
|
28683 | * @memberof google.longrunning
|
28684 | * @interface IListOperationsResponse
|
28685 | * @property {Array.<google.longrunning.IOperation>|null} [operations] ListOperationsResponse operations
|
28686 | * @property {string|null} [nextPageToken] ListOperationsResponse nextPageToken
|
28687 | */
|
28688 |
|
28689 | /**
|
28690 | * Constructs a new ListOperationsResponse.
|
28691 | * @memberof google.longrunning
|
28692 | * @classdesc Represents a ListOperationsResponse.
|
28693 | * @implements IListOperationsResponse
|
28694 | * @constructor
|
28695 | * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set
|
28696 | */
|
28697 | function ListOperationsResponse(properties) {
|
28698 | this.operations = [];
|
28699 | if (properties)
|
28700 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
28701 | if (properties[keys[i]] != null)
|
28702 | this[keys[i]] = properties[keys[i]];
|
28703 | }
|
28704 |
|
28705 | /**
|
28706 | * ListOperationsResponse operations.
|
28707 | * @member {Array.<google.longrunning.IOperation>} operations
|
28708 | * @memberof google.longrunning.ListOperationsResponse
|
28709 | * @instance
|
28710 | */
|
28711 | ListOperationsResponse.prototype.operations = $util.emptyArray;
|
28712 |
|
28713 | /**
|
28714 | * ListOperationsResponse nextPageToken.
|
28715 | * @member {string} nextPageToken
|
28716 | * @memberof google.longrunning.ListOperationsResponse
|
28717 | * @instance
|
28718 | */
|
28719 | ListOperationsResponse.prototype.nextPageToken = "";
|
28720 |
|
28721 | /**
|
28722 | * Creates a new ListOperationsResponse instance using the specified properties.
|
28723 | * @function create
|
28724 | * @memberof google.longrunning.ListOperationsResponse
|
28725 | * @static
|
28726 | * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set
|
28727 | * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse instance
|
28728 | */
|
28729 | ListOperationsResponse.create = function create(properties) {
|
28730 | return new ListOperationsResponse(properties);
|
28731 | };
|
28732 |
|
28733 | /**
|
28734 | * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages.
|
28735 | * @function encode
|
28736 | * @memberof google.longrunning.ListOperationsResponse
|
28737 | * @static
|
28738 | * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode
|
28739 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
28740 | * @returns {$protobuf.Writer} Writer
|
28741 | */
|
28742 | ListOperationsResponse.encode = function encode(message, writer) {
|
28743 | if (!writer)
|
28744 | writer = $Writer.create();
|
28745 | if (message.operations != null && message.operations.length)
|
28746 | for (var i = 0; i < message.operations.length; ++i)
|
28747 | $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
28748 | if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken"))
|
28749 | writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken);
|
28750 | return writer;
|
28751 | };
|
28752 |
|
28753 | /**
|
28754 | * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages.
|
28755 | * @function encodeDelimited
|
28756 | * @memberof google.longrunning.ListOperationsResponse
|
28757 | * @static
|
28758 | * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode
|
28759 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
28760 | * @returns {$protobuf.Writer} Writer
|
28761 | */
|
28762 | ListOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) {
|
28763 | return this.encode(message, writer).ldelim();
|
28764 | };
|
28765 |
|
28766 | /**
|
28767 | * Decodes a ListOperationsResponse message from the specified reader or buffer.
|
28768 | * @function decode
|
28769 | * @memberof google.longrunning.ListOperationsResponse
|
28770 | * @static
|
28771 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
28772 | * @param {number} [length] Message length if known beforehand
|
28773 | * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse
|
28774 | * @throws {Error} If the payload is not a reader or valid buffer
|
28775 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
28776 | */
|
28777 | ListOperationsResponse.decode = function decode(reader, length) {
|
28778 | if (!(reader instanceof $Reader))
|
28779 | reader = $Reader.create(reader);
|
28780 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsResponse();
|
28781 | while (reader.pos < end) {
|
28782 | var tag = reader.uint32();
|
28783 | switch (tag >>> 3) {
|
28784 | case 1:
|
28785 | if (!(message.operations && message.operations.length))
|
28786 | message.operations = [];
|
28787 | message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32()));
|
28788 | break;
|
28789 | case 2:
|
28790 | message.nextPageToken = reader.string();
|
28791 | break;
|
28792 | default:
|
28793 | reader.skipType(tag & 7);
|
28794 | break;
|
28795 | }
|
28796 | }
|
28797 | return message;
|
28798 | };
|
28799 |
|
28800 | /**
|
28801 | * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited.
|
28802 | * @function decodeDelimited
|
28803 | * @memberof google.longrunning.ListOperationsResponse
|
28804 | * @static
|
28805 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
28806 | * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse
|
28807 | * @throws {Error} If the payload is not a reader or valid buffer
|
28808 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
28809 | */
|
28810 | ListOperationsResponse.decodeDelimited = function decodeDelimited(reader) {
|
28811 | if (!(reader instanceof $Reader))
|
28812 | reader = new $Reader(reader);
|
28813 | return this.decode(reader, reader.uint32());
|
28814 | };
|
28815 |
|
28816 | /**
|
28817 | * Verifies a ListOperationsResponse message.
|
28818 | * @function verify
|
28819 | * @memberof google.longrunning.ListOperationsResponse
|
28820 | * @static
|
28821 | * @param {Object.<string,*>} message Plain object to verify
|
28822 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
28823 | */
|
28824 | ListOperationsResponse.verify = function verify(message) {
|
28825 | if (typeof message !== "object" || message === null)
|
28826 | return "object expected";
|
28827 | if (message.operations != null && message.hasOwnProperty("operations")) {
|
28828 | if (!Array.isArray(message.operations))
|
28829 | return "operations: array expected";
|
28830 | for (var i = 0; i < message.operations.length; ++i) {
|
28831 | var error = $root.google.longrunning.Operation.verify(message.operations[i]);
|
28832 | if (error)
|
28833 | return "operations." + error;
|
28834 | }
|
28835 | }
|
28836 | if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken"))
|
28837 | if (!$util.isString(message.nextPageToken))
|
28838 | return "nextPageToken: string expected";
|
28839 | return null;
|
28840 | };
|
28841 |
|
28842 | /**
|
28843 | * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types.
|
28844 | * @function fromObject
|
28845 | * @memberof google.longrunning.ListOperationsResponse
|
28846 | * @static
|
28847 | * @param {Object.<string,*>} object Plain object
|
28848 | * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse
|
28849 | */
|
28850 | ListOperationsResponse.fromObject = function fromObject(object) {
|
28851 | if (object instanceof $root.google.longrunning.ListOperationsResponse)
|
28852 | return object;
|
28853 | var message = new $root.google.longrunning.ListOperationsResponse();
|
28854 | if (object.operations) {
|
28855 | if (!Array.isArray(object.operations))
|
28856 | throw TypeError(".google.longrunning.ListOperationsResponse.operations: array expected");
|
28857 | message.operations = [];
|
28858 | for (var i = 0; i < object.operations.length; ++i) {
|
28859 | if (typeof object.operations[i] !== "object")
|
28860 | throw TypeError(".google.longrunning.ListOperationsResponse.operations: object expected");
|
28861 | message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]);
|
28862 | }
|
28863 | }
|
28864 | if (object.nextPageToken != null)
|
28865 | message.nextPageToken = String(object.nextPageToken);
|
28866 | return message;
|
28867 | };
|
28868 |
|
28869 | /**
|
28870 | * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified.
|
28871 | * @function toObject
|
28872 | * @memberof google.longrunning.ListOperationsResponse
|
28873 | * @static
|
28874 | * @param {google.longrunning.ListOperationsResponse} message ListOperationsResponse
|
28875 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
28876 | * @returns {Object.<string,*>} Plain object
|
28877 | */
|
28878 | ListOperationsResponse.toObject = function toObject(message, options) {
|
28879 | if (!options)
|
28880 | options = {};
|
28881 | var object = {};
|
28882 | if (options.arrays || options.defaults)
|
28883 | object.operations = [];
|
28884 | if (options.defaults)
|
28885 | object.nextPageToken = "";
|
28886 | if (message.operations && message.operations.length) {
|
28887 | object.operations = [];
|
28888 | for (var j = 0; j < message.operations.length; ++j)
|
28889 | object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options);
|
28890 | }
|
28891 | if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken"))
|
28892 | object.nextPageToken = message.nextPageToken;
|
28893 | return object;
|
28894 | };
|
28895 |
|
28896 | /**
|
28897 | * Converts this ListOperationsResponse to JSON.
|
28898 | * @function toJSON
|
28899 | * @memberof google.longrunning.ListOperationsResponse
|
28900 | * @instance
|
28901 | * @returns {Object.<string,*>} JSON object
|
28902 | */
|
28903 | ListOperationsResponse.prototype.toJSON = function toJSON() {
|
28904 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
28905 | };
|
28906 |
|
28907 | return ListOperationsResponse;
|
28908 | })();
|
28909 |
|
28910 | longrunning.CancelOperationRequest = (function() {
|
28911 |
|
28912 | /**
|
28913 | * Properties of a CancelOperationRequest.
|
28914 | * @memberof google.longrunning
|
28915 | * @interface ICancelOperationRequest
|
28916 | * @property {string|null} [name] CancelOperationRequest name
|
28917 | */
|
28918 |
|
28919 | /**
|
28920 | * Constructs a new CancelOperationRequest.
|
28921 | * @memberof google.longrunning
|
28922 | * @classdesc Represents a CancelOperationRequest.
|
28923 | * @implements ICancelOperationRequest
|
28924 | * @constructor
|
28925 | * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set
|
28926 | */
|
28927 | function CancelOperationRequest(properties) {
|
28928 | if (properties)
|
28929 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
28930 | if (properties[keys[i]] != null)
|
28931 | this[keys[i]] = properties[keys[i]];
|
28932 | }
|
28933 |
|
28934 | /**
|
28935 | * CancelOperationRequest name.
|
28936 | * @member {string} name
|
28937 | * @memberof google.longrunning.CancelOperationRequest
|
28938 | * @instance
|
28939 | */
|
28940 | CancelOperationRequest.prototype.name = "";
|
28941 |
|
28942 | /**
|
28943 | * Creates a new CancelOperationRequest instance using the specified properties.
|
28944 | * @function create
|
28945 | * @memberof google.longrunning.CancelOperationRequest
|
28946 | * @static
|
28947 | * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set
|
28948 | * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest instance
|
28949 | */
|
28950 | CancelOperationRequest.create = function create(properties) {
|
28951 | return new CancelOperationRequest(properties);
|
28952 | };
|
28953 |
|
28954 | /**
|
28955 | * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages.
|
28956 | * @function encode
|
28957 | * @memberof google.longrunning.CancelOperationRequest
|
28958 | * @static
|
28959 | * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode
|
28960 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
28961 | * @returns {$protobuf.Writer} Writer
|
28962 | */
|
28963 | CancelOperationRequest.encode = function encode(message, writer) {
|
28964 | if (!writer)
|
28965 | writer = $Writer.create();
|
28966 | if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
28967 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
|
28968 | return writer;
|
28969 | };
|
28970 |
|
28971 | /**
|
28972 | * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages.
|
28973 | * @function encodeDelimited
|
28974 | * @memberof google.longrunning.CancelOperationRequest
|
28975 | * @static
|
28976 | * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode
|
28977 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
28978 | * @returns {$protobuf.Writer} Writer
|
28979 | */
|
28980 | CancelOperationRequest.encodeDelimited = function encodeDelimited(message, writer) {
|
28981 | return this.encode(message, writer).ldelim();
|
28982 | };
|
28983 |
|
28984 | /**
|
28985 | * Decodes a CancelOperationRequest message from the specified reader or buffer.
|
28986 | * @function decode
|
28987 | * @memberof google.longrunning.CancelOperationRequest
|
28988 | * @static
|
28989 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
28990 | * @param {number} [length] Message length if known beforehand
|
28991 | * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest
|
28992 | * @throws {Error} If the payload is not a reader or valid buffer
|
28993 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
28994 | */
|
28995 | CancelOperationRequest.decode = function decode(reader, length) {
|
28996 | if (!(reader instanceof $Reader))
|
28997 | reader = $Reader.create(reader);
|
28998 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.CancelOperationRequest();
|
28999 | while (reader.pos < end) {
|
29000 | var tag = reader.uint32();
|
29001 | switch (tag >>> 3) {
|
29002 | case 1:
|
29003 | message.name = reader.string();
|
29004 | break;
|
29005 | default:
|
29006 | reader.skipType(tag & 7);
|
29007 | break;
|
29008 | }
|
29009 | }
|
29010 | return message;
|
29011 | };
|
29012 |
|
29013 | /**
|
29014 | * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited.
|
29015 | * @function decodeDelimited
|
29016 | * @memberof google.longrunning.CancelOperationRequest
|
29017 | * @static
|
29018 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
29019 | * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest
|
29020 | * @throws {Error} If the payload is not a reader or valid buffer
|
29021 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
29022 | */
|
29023 | CancelOperationRequest.decodeDelimited = function decodeDelimited(reader) {
|
29024 | if (!(reader instanceof $Reader))
|
29025 | reader = new $Reader(reader);
|
29026 | return this.decode(reader, reader.uint32());
|
29027 | };
|
29028 |
|
29029 | /**
|
29030 | * Verifies a CancelOperationRequest message.
|
29031 | * @function verify
|
29032 | * @memberof google.longrunning.CancelOperationRequest
|
29033 | * @static
|
29034 | * @param {Object.<string,*>} message Plain object to verify
|
29035 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
29036 | */
|
29037 | CancelOperationRequest.verify = function verify(message) {
|
29038 | if (typeof message !== "object" || message === null)
|
29039 | return "object expected";
|
29040 | if (message.name != null && message.hasOwnProperty("name"))
|
29041 | if (!$util.isString(message.name))
|
29042 | return "name: string expected";
|
29043 | return null;
|
29044 | };
|
29045 |
|
29046 | /**
|
29047 | * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types.
|
29048 | * @function fromObject
|
29049 | * @memberof google.longrunning.CancelOperationRequest
|
29050 | * @static
|
29051 | * @param {Object.<string,*>} object Plain object
|
29052 | * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest
|
29053 | */
|
29054 | CancelOperationRequest.fromObject = function fromObject(object) {
|
29055 | if (object instanceof $root.google.longrunning.CancelOperationRequest)
|
29056 | return object;
|
29057 | var message = new $root.google.longrunning.CancelOperationRequest();
|
29058 | if (object.name != null)
|
29059 | message.name = String(object.name);
|
29060 | return message;
|
29061 | };
|
29062 |
|
29063 | /**
|
29064 | * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified.
|
29065 | * @function toObject
|
29066 | * @memberof google.longrunning.CancelOperationRequest
|
29067 | * @static
|
29068 | * @param {google.longrunning.CancelOperationRequest} message CancelOperationRequest
|
29069 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
29070 | * @returns {Object.<string,*>} Plain object
|
29071 | */
|
29072 | CancelOperationRequest.toObject = function toObject(message, options) {
|
29073 | if (!options)
|
29074 | options = {};
|
29075 | var object = {};
|
29076 | if (options.defaults)
|
29077 | object.name = "";
|
29078 | if (message.name != null && message.hasOwnProperty("name"))
|
29079 | object.name = message.name;
|
29080 | return object;
|
29081 | };
|
29082 |
|
29083 | /**
|
29084 | * Converts this CancelOperationRequest to JSON.
|
29085 | * @function toJSON
|
29086 | * @memberof google.longrunning.CancelOperationRequest
|
29087 | * @instance
|
29088 | * @returns {Object.<string,*>} JSON object
|
29089 | */
|
29090 | CancelOperationRequest.prototype.toJSON = function toJSON() {
|
29091 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
29092 | };
|
29093 |
|
29094 | return CancelOperationRequest;
|
29095 | })();
|
29096 |
|
29097 | longrunning.DeleteOperationRequest = (function() {
|
29098 |
|
29099 | /**
|
29100 | * Properties of a DeleteOperationRequest.
|
29101 | * @memberof google.longrunning
|
29102 | * @interface IDeleteOperationRequest
|
29103 | * @property {string|null} [name] DeleteOperationRequest name
|
29104 | */
|
29105 |
|
29106 | /**
|
29107 | * Constructs a new DeleteOperationRequest.
|
29108 | * @memberof google.longrunning
|
29109 | * @classdesc Represents a DeleteOperationRequest.
|
29110 | * @implements IDeleteOperationRequest
|
29111 | * @constructor
|
29112 | * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set
|
29113 | */
|
29114 | function DeleteOperationRequest(properties) {
|
29115 | if (properties)
|
29116 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
29117 | if (properties[keys[i]] != null)
|
29118 | this[keys[i]] = properties[keys[i]];
|
29119 | }
|
29120 |
|
29121 | /**
|
29122 | * DeleteOperationRequest name.
|
29123 | * @member {string} name
|
29124 | * @memberof google.longrunning.DeleteOperationRequest
|
29125 | * @instance
|
29126 | */
|
29127 | DeleteOperationRequest.prototype.name = "";
|
29128 |
|
29129 | /**
|
29130 | * Creates a new DeleteOperationRequest instance using the specified properties.
|
29131 | * @function create
|
29132 | * @memberof google.longrunning.DeleteOperationRequest
|
29133 | * @static
|
29134 | * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set
|
29135 | * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest instance
|
29136 | */
|
29137 | DeleteOperationRequest.create = function create(properties) {
|
29138 | return new DeleteOperationRequest(properties);
|
29139 | };
|
29140 |
|
29141 | /**
|
29142 | * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages.
|
29143 | * @function encode
|
29144 | * @memberof google.longrunning.DeleteOperationRequest
|
29145 | * @static
|
29146 | * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode
|
29147 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
29148 | * @returns {$protobuf.Writer} Writer
|
29149 | */
|
29150 | DeleteOperationRequest.encode = function encode(message, writer) {
|
29151 | if (!writer)
|
29152 | writer = $Writer.create();
|
29153 | if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
29154 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
|
29155 | return writer;
|
29156 | };
|
29157 |
|
29158 | /**
|
29159 | * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages.
|
29160 | * @function encodeDelimited
|
29161 | * @memberof google.longrunning.DeleteOperationRequest
|
29162 | * @static
|
29163 | * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode
|
29164 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
29165 | * @returns {$protobuf.Writer} Writer
|
29166 | */
|
29167 | DeleteOperationRequest.encodeDelimited = function encodeDelimited(message, writer) {
|
29168 | return this.encode(message, writer).ldelim();
|
29169 | };
|
29170 |
|
29171 | /**
|
29172 | * Decodes a DeleteOperationRequest message from the specified reader or buffer.
|
29173 | * @function decode
|
29174 | * @memberof google.longrunning.DeleteOperationRequest
|
29175 | * @static
|
29176 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
29177 | * @param {number} [length] Message length if known beforehand
|
29178 | * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest
|
29179 | * @throws {Error} If the payload is not a reader or valid buffer
|
29180 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
29181 | */
|
29182 | DeleteOperationRequest.decode = function decode(reader, length) {
|
29183 | if (!(reader instanceof $Reader))
|
29184 | reader = $Reader.create(reader);
|
29185 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.DeleteOperationRequest();
|
29186 | while (reader.pos < end) {
|
29187 | var tag = reader.uint32();
|
29188 | switch (tag >>> 3) {
|
29189 | case 1:
|
29190 | message.name = reader.string();
|
29191 | break;
|
29192 | default:
|
29193 | reader.skipType(tag & 7);
|
29194 | break;
|
29195 | }
|
29196 | }
|
29197 | return message;
|
29198 | };
|
29199 |
|
29200 | /**
|
29201 | * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited.
|
29202 | * @function decodeDelimited
|
29203 | * @memberof google.longrunning.DeleteOperationRequest
|
29204 | * @static
|
29205 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
29206 | * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest
|
29207 | * @throws {Error} If the payload is not a reader or valid buffer
|
29208 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
29209 | */
|
29210 | DeleteOperationRequest.decodeDelimited = function decodeDelimited(reader) {
|
29211 | if (!(reader instanceof $Reader))
|
29212 | reader = new $Reader(reader);
|
29213 | return this.decode(reader, reader.uint32());
|
29214 | };
|
29215 |
|
29216 | /**
|
29217 | * Verifies a DeleteOperationRequest message.
|
29218 | * @function verify
|
29219 | * @memberof google.longrunning.DeleteOperationRequest
|
29220 | * @static
|
29221 | * @param {Object.<string,*>} message Plain object to verify
|
29222 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
29223 | */
|
29224 | DeleteOperationRequest.verify = function verify(message) {
|
29225 | if (typeof message !== "object" || message === null)
|
29226 | return "object expected";
|
29227 | if (message.name != null && message.hasOwnProperty("name"))
|
29228 | if (!$util.isString(message.name))
|
29229 | return "name: string expected";
|
29230 | return null;
|
29231 | };
|
29232 |
|
29233 | /**
|
29234 | * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types.
|
29235 | * @function fromObject
|
29236 | * @memberof google.longrunning.DeleteOperationRequest
|
29237 | * @static
|
29238 | * @param {Object.<string,*>} object Plain object
|
29239 | * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest
|
29240 | */
|
29241 | DeleteOperationRequest.fromObject = function fromObject(object) {
|
29242 | if (object instanceof $root.google.longrunning.DeleteOperationRequest)
|
29243 | return object;
|
29244 | var message = new $root.google.longrunning.DeleteOperationRequest();
|
29245 | if (object.name != null)
|
29246 | message.name = String(object.name);
|
29247 | return message;
|
29248 | };
|
29249 |
|
29250 | /**
|
29251 | * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified.
|
29252 | * @function toObject
|
29253 | * @memberof google.longrunning.DeleteOperationRequest
|
29254 | * @static
|
29255 | * @param {google.longrunning.DeleteOperationRequest} message DeleteOperationRequest
|
29256 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
29257 | * @returns {Object.<string,*>} Plain object
|
29258 | */
|
29259 | DeleteOperationRequest.toObject = function toObject(message, options) {
|
29260 | if (!options)
|
29261 | options = {};
|
29262 | var object = {};
|
29263 | if (options.defaults)
|
29264 | object.name = "";
|
29265 | if (message.name != null && message.hasOwnProperty("name"))
|
29266 | object.name = message.name;
|
29267 | return object;
|
29268 | };
|
29269 |
|
29270 | /**
|
29271 | * Converts this DeleteOperationRequest to JSON.
|
29272 | * @function toJSON
|
29273 | * @memberof google.longrunning.DeleteOperationRequest
|
29274 | * @instance
|
29275 | * @returns {Object.<string,*>} JSON object
|
29276 | */
|
29277 | DeleteOperationRequest.prototype.toJSON = function toJSON() {
|
29278 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
29279 | };
|
29280 |
|
29281 | return DeleteOperationRequest;
|
29282 | })();
|
29283 |
|
29284 | longrunning.WaitOperationRequest = (function() {
|
29285 |
|
29286 | /**
|
29287 | * Properties of a WaitOperationRequest.
|
29288 | * @memberof google.longrunning
|
29289 | * @interface IWaitOperationRequest
|
29290 | * @property {string|null} [name] WaitOperationRequest name
|
29291 | * @property {google.protobuf.IDuration|null} [timeout] WaitOperationRequest timeout
|
29292 | */
|
29293 |
|
29294 | /**
|
29295 | * Constructs a new WaitOperationRequest.
|
29296 | * @memberof google.longrunning
|
29297 | * @classdesc Represents a WaitOperationRequest.
|
29298 | * @implements IWaitOperationRequest
|
29299 | * @constructor
|
29300 | * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set
|
29301 | */
|
29302 | function WaitOperationRequest(properties) {
|
29303 | if (properties)
|
29304 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
29305 | if (properties[keys[i]] != null)
|
29306 | this[keys[i]] = properties[keys[i]];
|
29307 | }
|
29308 |
|
29309 | /**
|
29310 | * WaitOperationRequest name.
|
29311 | * @member {string} name
|
29312 | * @memberof google.longrunning.WaitOperationRequest
|
29313 | * @instance
|
29314 | */
|
29315 | WaitOperationRequest.prototype.name = "";
|
29316 |
|
29317 | /**
|
29318 | * WaitOperationRequest timeout.
|
29319 | * @member {google.protobuf.IDuration|null|undefined} timeout
|
29320 | * @memberof google.longrunning.WaitOperationRequest
|
29321 | * @instance
|
29322 | */
|
29323 | WaitOperationRequest.prototype.timeout = null;
|
29324 |
|
29325 | /**
|
29326 | * Creates a new WaitOperationRequest instance using the specified properties.
|
29327 | * @function create
|
29328 | * @memberof google.longrunning.WaitOperationRequest
|
29329 | * @static
|
29330 | * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set
|
29331 | * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest instance
|
29332 | */
|
29333 | WaitOperationRequest.create = function create(properties) {
|
29334 | return new WaitOperationRequest(properties);
|
29335 | };
|
29336 |
|
29337 | /**
|
29338 | * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages.
|
29339 | * @function encode
|
29340 | * @memberof google.longrunning.WaitOperationRequest
|
29341 | * @static
|
29342 | * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode
|
29343 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
29344 | * @returns {$protobuf.Writer} Writer
|
29345 | */
|
29346 | WaitOperationRequest.encode = function encode(message, writer) {
|
29347 | if (!writer)
|
29348 | writer = $Writer.create();
|
29349 | if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
29350 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
|
29351 | if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout"))
|
29352 | $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
29353 | return writer;
|
29354 | };
|
29355 |
|
29356 | /**
|
29357 | * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages.
|
29358 | * @function encodeDelimited
|
29359 | * @memberof google.longrunning.WaitOperationRequest
|
29360 | * @static
|
29361 | * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode
|
29362 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
29363 | * @returns {$protobuf.Writer} Writer
|
29364 | */
|
29365 | WaitOperationRequest.encodeDelimited = function encodeDelimited(message, writer) {
|
29366 | return this.encode(message, writer).ldelim();
|
29367 | };
|
29368 |
|
29369 | /**
|
29370 | * Decodes a WaitOperationRequest message from the specified reader or buffer.
|
29371 | * @function decode
|
29372 | * @memberof google.longrunning.WaitOperationRequest
|
29373 | * @static
|
29374 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
29375 | * @param {number} [length] Message length if known beforehand
|
29376 | * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest
|
29377 | * @throws {Error} If the payload is not a reader or valid buffer
|
29378 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
29379 | */
|
29380 | WaitOperationRequest.decode = function decode(reader, length) {
|
29381 | if (!(reader instanceof $Reader))
|
29382 | reader = $Reader.create(reader);
|
29383 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.WaitOperationRequest();
|
29384 | while (reader.pos < end) {
|
29385 | var tag = reader.uint32();
|
29386 | switch (tag >>> 3) {
|
29387 | case 1:
|
29388 | message.name = reader.string();
|
29389 | break;
|
29390 | case 2:
|
29391 | message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32());
|
29392 | break;
|
29393 | default:
|
29394 | reader.skipType(tag & 7);
|
29395 | break;
|
29396 | }
|
29397 | }
|
29398 | return message;
|
29399 | };
|
29400 |
|
29401 | /**
|
29402 | * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited.
|
29403 | * @function decodeDelimited
|
29404 | * @memberof google.longrunning.WaitOperationRequest
|
29405 | * @static
|
29406 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
29407 | * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest
|
29408 | * @throws {Error} If the payload is not a reader or valid buffer
|
29409 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
29410 | */
|
29411 | WaitOperationRequest.decodeDelimited = function decodeDelimited(reader) {
|
29412 | if (!(reader instanceof $Reader))
|
29413 | reader = new $Reader(reader);
|
29414 | return this.decode(reader, reader.uint32());
|
29415 | };
|
29416 |
|
29417 | /**
|
29418 | * Verifies a WaitOperationRequest message.
|
29419 | * @function verify
|
29420 | * @memberof google.longrunning.WaitOperationRequest
|
29421 | * @static
|
29422 | * @param {Object.<string,*>} message Plain object to verify
|
29423 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
29424 | */
|
29425 | WaitOperationRequest.verify = function verify(message) {
|
29426 | if (typeof message !== "object" || message === null)
|
29427 | return "object expected";
|
29428 | if (message.name != null && message.hasOwnProperty("name"))
|
29429 | if (!$util.isString(message.name))
|
29430 | return "name: string expected";
|
29431 | if (message.timeout != null && message.hasOwnProperty("timeout")) {
|
29432 | var error = $root.google.protobuf.Duration.verify(message.timeout);
|
29433 | if (error)
|
29434 | return "timeout." + error;
|
29435 | }
|
29436 | return null;
|
29437 | };
|
29438 |
|
29439 | /**
|
29440 | * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types.
|
29441 | * @function fromObject
|
29442 | * @memberof google.longrunning.WaitOperationRequest
|
29443 | * @static
|
29444 | * @param {Object.<string,*>} object Plain object
|
29445 | * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest
|
29446 | */
|
29447 | WaitOperationRequest.fromObject = function fromObject(object) {
|
29448 | if (object instanceof $root.google.longrunning.WaitOperationRequest)
|
29449 | return object;
|
29450 | var message = new $root.google.longrunning.WaitOperationRequest();
|
29451 | if (object.name != null)
|
29452 | message.name = String(object.name);
|
29453 | if (object.timeout != null) {
|
29454 | if (typeof object.timeout !== "object")
|
29455 | throw TypeError(".google.longrunning.WaitOperationRequest.timeout: object expected");
|
29456 | message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout);
|
29457 | }
|
29458 | return message;
|
29459 | };
|
29460 |
|
29461 | /**
|
29462 | * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified.
|
29463 | * @function toObject
|
29464 | * @memberof google.longrunning.WaitOperationRequest
|
29465 | * @static
|
29466 | * @param {google.longrunning.WaitOperationRequest} message WaitOperationRequest
|
29467 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
29468 | * @returns {Object.<string,*>} Plain object
|
29469 | */
|
29470 | WaitOperationRequest.toObject = function toObject(message, options) {
|
29471 | if (!options)
|
29472 | options = {};
|
29473 | var object = {};
|
29474 | if (options.defaults) {
|
29475 | object.name = "";
|
29476 | object.timeout = null;
|
29477 | }
|
29478 | if (message.name != null && message.hasOwnProperty("name"))
|
29479 | object.name = message.name;
|
29480 | if (message.timeout != null && message.hasOwnProperty("timeout"))
|
29481 | object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options);
|
29482 | return object;
|
29483 | };
|
29484 |
|
29485 | /**
|
29486 | * Converts this WaitOperationRequest to JSON.
|
29487 | * @function toJSON
|
29488 | * @memberof google.longrunning.WaitOperationRequest
|
29489 | * @instance
|
29490 | * @returns {Object.<string,*>} JSON object
|
29491 | */
|
29492 | WaitOperationRequest.prototype.toJSON = function toJSON() {
|
29493 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
29494 | };
|
29495 |
|
29496 | return WaitOperationRequest;
|
29497 | })();
|
29498 |
|
29499 | longrunning.OperationInfo = (function() {
|
29500 |
|
29501 | /**
|
29502 | * Properties of an OperationInfo.
|
29503 | * @memberof google.longrunning
|
29504 | * @interface IOperationInfo
|
29505 | * @property {string|null} [responseType] OperationInfo responseType
|
29506 | * @property {string|null} [metadataType] OperationInfo metadataType
|
29507 | */
|
29508 |
|
29509 | /**
|
29510 | * Constructs a new OperationInfo.
|
29511 | * @memberof google.longrunning
|
29512 | * @classdesc Represents an OperationInfo.
|
29513 | * @implements IOperationInfo
|
29514 | * @constructor
|
29515 | * @param {google.longrunning.IOperationInfo=} [properties] Properties to set
|
29516 | */
|
29517 | function OperationInfo(properties) {
|
29518 | if (properties)
|
29519 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
29520 | if (properties[keys[i]] != null)
|
29521 | this[keys[i]] = properties[keys[i]];
|
29522 | }
|
29523 |
|
29524 | /**
|
29525 | * OperationInfo responseType.
|
29526 | * @member {string} responseType
|
29527 | * @memberof google.longrunning.OperationInfo
|
29528 | * @instance
|
29529 | */
|
29530 | OperationInfo.prototype.responseType = "";
|
29531 |
|
29532 | /**
|
29533 | * OperationInfo metadataType.
|
29534 | * @member {string} metadataType
|
29535 | * @memberof google.longrunning.OperationInfo
|
29536 | * @instance
|
29537 | */
|
29538 | OperationInfo.prototype.metadataType = "";
|
29539 |
|
29540 | /**
|
29541 | * Creates a new OperationInfo instance using the specified properties.
|
29542 | * @function create
|
29543 | * @memberof google.longrunning.OperationInfo
|
29544 | * @static
|
29545 | * @param {google.longrunning.IOperationInfo=} [properties] Properties to set
|
29546 | * @returns {google.longrunning.OperationInfo} OperationInfo instance
|
29547 | */
|
29548 | OperationInfo.create = function create(properties) {
|
29549 | return new OperationInfo(properties);
|
29550 | };
|
29551 |
|
29552 | /**
|
29553 | * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages.
|
29554 | * @function encode
|
29555 | * @memberof google.longrunning.OperationInfo
|
29556 | * @static
|
29557 | * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode
|
29558 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
29559 | * @returns {$protobuf.Writer} Writer
|
29560 | */
|
29561 | OperationInfo.encode = function encode(message, writer) {
|
29562 | if (!writer)
|
29563 | writer = $Writer.create();
|
29564 | if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType"))
|
29565 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType);
|
29566 | if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType"))
|
29567 | writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataType);
|
29568 | return writer;
|
29569 | };
|
29570 |
|
29571 | /**
|
29572 | * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages.
|
29573 | * @function encodeDelimited
|
29574 | * @memberof google.longrunning.OperationInfo
|
29575 | * @static
|
29576 | * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode
|
29577 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
29578 | * @returns {$protobuf.Writer} Writer
|
29579 | */
|
29580 | OperationInfo.encodeDelimited = function encodeDelimited(message, writer) {
|
29581 | return this.encode(message, writer).ldelim();
|
29582 | };
|
29583 |
|
29584 | /**
|
29585 | * Decodes an OperationInfo message from the specified reader or buffer.
|
29586 | * @function decode
|
29587 | * @memberof google.longrunning.OperationInfo
|
29588 | * @static
|
29589 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
29590 | * @param {number} [length] Message length if known beforehand
|
29591 | * @returns {google.longrunning.OperationInfo} OperationInfo
|
29592 | * @throws {Error} If the payload is not a reader or valid buffer
|
29593 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
29594 | */
|
29595 | OperationInfo.decode = function decode(reader, length) {
|
29596 | if (!(reader instanceof $Reader))
|
29597 | reader = $Reader.create(reader);
|
29598 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.OperationInfo();
|
29599 | while (reader.pos < end) {
|
29600 | var tag = reader.uint32();
|
29601 | switch (tag >>> 3) {
|
29602 | case 1:
|
29603 | message.responseType = reader.string();
|
29604 | break;
|
29605 | case 2:
|
29606 | message.metadataType = reader.string();
|
29607 | break;
|
29608 | default:
|
29609 | reader.skipType(tag & 7);
|
29610 | break;
|
29611 | }
|
29612 | }
|
29613 | return message;
|
29614 | };
|
29615 |
|
29616 | /**
|
29617 | * Decodes an OperationInfo message from the specified reader or buffer, length delimited.
|
29618 | * @function decodeDelimited
|
29619 | * @memberof google.longrunning.OperationInfo
|
29620 | * @static
|
29621 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
29622 | * @returns {google.longrunning.OperationInfo} OperationInfo
|
29623 | * @throws {Error} If the payload is not a reader or valid buffer
|
29624 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
29625 | */
|
29626 | OperationInfo.decodeDelimited = function decodeDelimited(reader) {
|
29627 | if (!(reader instanceof $Reader))
|
29628 | reader = new $Reader(reader);
|
29629 | return this.decode(reader, reader.uint32());
|
29630 | };
|
29631 |
|
29632 | /**
|
29633 | * Verifies an OperationInfo message.
|
29634 | * @function verify
|
29635 | * @memberof google.longrunning.OperationInfo
|
29636 | * @static
|
29637 | * @param {Object.<string,*>} message Plain object to verify
|
29638 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
29639 | */
|
29640 | OperationInfo.verify = function verify(message) {
|
29641 | if (typeof message !== "object" || message === null)
|
29642 | return "object expected";
|
29643 | if (message.responseType != null && message.hasOwnProperty("responseType"))
|
29644 | if (!$util.isString(message.responseType))
|
29645 | return "responseType: string expected";
|
29646 | if (message.metadataType != null && message.hasOwnProperty("metadataType"))
|
29647 | if (!$util.isString(message.metadataType))
|
29648 | return "metadataType: string expected";
|
29649 | return null;
|
29650 | };
|
29651 |
|
29652 | /**
|
29653 | * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types.
|
29654 | * @function fromObject
|
29655 | * @memberof google.longrunning.OperationInfo
|
29656 | * @static
|
29657 | * @param {Object.<string,*>} object Plain object
|
29658 | * @returns {google.longrunning.OperationInfo} OperationInfo
|
29659 | */
|
29660 | OperationInfo.fromObject = function fromObject(object) {
|
29661 | if (object instanceof $root.google.longrunning.OperationInfo)
|
29662 | return object;
|
29663 | var message = new $root.google.longrunning.OperationInfo();
|
29664 | if (object.responseType != null)
|
29665 | message.responseType = String(object.responseType);
|
29666 | if (object.metadataType != null)
|
29667 | message.metadataType = String(object.metadataType);
|
29668 | return message;
|
29669 | };
|
29670 |
|
29671 | /**
|
29672 | * Creates a plain object from an OperationInfo message. Also converts values to other types if specified.
|
29673 | * @function toObject
|
29674 | * @memberof google.longrunning.OperationInfo
|
29675 | * @static
|
29676 | * @param {google.longrunning.OperationInfo} message OperationInfo
|
29677 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
29678 | * @returns {Object.<string,*>} Plain object
|
29679 | */
|
29680 | OperationInfo.toObject = function toObject(message, options) {
|
29681 | if (!options)
|
29682 | options = {};
|
29683 | var object = {};
|
29684 | if (options.defaults) {
|
29685 | object.responseType = "";
|
29686 | object.metadataType = "";
|
29687 | }
|
29688 | if (message.responseType != null && message.hasOwnProperty("responseType"))
|
29689 | object.responseType = message.responseType;
|
29690 | if (message.metadataType != null && message.hasOwnProperty("metadataType"))
|
29691 | object.metadataType = message.metadataType;
|
29692 | return object;
|
29693 | };
|
29694 |
|
29695 | /**
|
29696 | * Converts this OperationInfo to JSON.
|
29697 | * @function toJSON
|
29698 | * @memberof google.longrunning.OperationInfo
|
29699 | * @instance
|
29700 | * @returns {Object.<string,*>} JSON object
|
29701 | */
|
29702 | OperationInfo.prototype.toJSON = function toJSON() {
|
29703 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
29704 | };
|
29705 |
|
29706 | return OperationInfo;
|
29707 | })();
|
29708 |
|
29709 | return longrunning;
|
29710 | })();
|
29711 |
|
29712 | google.rpc = (function() {
|
29713 |
|
29714 | /**
|
29715 | * Namespace rpc.
|
29716 | * @memberof google
|
29717 | * @namespace
|
29718 | */
|
29719 | var rpc = {};
|
29720 |
|
29721 | rpc.Status = (function() {
|
29722 |
|
29723 | /**
|
29724 | * Properties of a Status.
|
29725 | * @memberof google.rpc
|
29726 | * @interface IStatus
|
29727 | * @property {number|null} [code] Status code
|
29728 | * @property {string|null} [message] Status message
|
29729 | * @property {Array.<google.protobuf.IAny>|null} [details] Status details
|
29730 | */
|
29731 |
|
29732 | /**
|
29733 | * Constructs a new Status.
|
29734 | * @memberof google.rpc
|
29735 | * @classdesc Represents a Status.
|
29736 | * @implements IStatus
|
29737 | * @constructor
|
29738 | * @param {google.rpc.IStatus=} [properties] Properties to set
|
29739 | */
|
29740 | function Status(properties) {
|
29741 | this.details = [];
|
29742 | if (properties)
|
29743 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
29744 | if (properties[keys[i]] != null)
|
29745 | this[keys[i]] = properties[keys[i]];
|
29746 | }
|
29747 |
|
29748 | /**
|
29749 | * Status code.
|
29750 | * @member {number} code
|
29751 | * @memberof google.rpc.Status
|
29752 | * @instance
|
29753 | */
|
29754 | Status.prototype.code = 0;
|
29755 |
|
29756 | /**
|
29757 | * Status message.
|
29758 | * @member {string} message
|
29759 | * @memberof google.rpc.Status
|
29760 | * @instance
|
29761 | */
|
29762 | Status.prototype.message = "";
|
29763 |
|
29764 | /**
|
29765 | * Status details.
|
29766 | * @member {Array.<google.protobuf.IAny>} details
|
29767 | * @memberof google.rpc.Status
|
29768 | * @instance
|
29769 | */
|
29770 | Status.prototype.details = $util.emptyArray;
|
29771 |
|
29772 | /**
|
29773 | * Creates a new Status instance using the specified properties.
|
29774 | * @function create
|
29775 | * @memberof google.rpc.Status
|
29776 | * @static
|
29777 | * @param {google.rpc.IStatus=} [properties] Properties to set
|
29778 | * @returns {google.rpc.Status} Status instance
|
29779 | */
|
29780 | Status.create = function create(properties) {
|
29781 | return new Status(properties);
|
29782 | };
|
29783 |
|
29784 | /**
|
29785 | * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages.
|
29786 | * @function encode
|
29787 | * @memberof google.rpc.Status
|
29788 | * @static
|
29789 | * @param {google.rpc.IStatus} message Status message or plain object to encode
|
29790 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
29791 | * @returns {$protobuf.Writer} Writer
|
29792 | */
|
29793 | Status.encode = function encode(message, writer) {
|
29794 | if (!writer)
|
29795 | writer = $Writer.create();
|
29796 | if (message.code != null && Object.hasOwnProperty.call(message, "code"))
|
29797 | writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code);
|
29798 | if (message.message != null && Object.hasOwnProperty.call(message, "message"))
|
29799 | writer.uint32(/* id 2, wireType 2 =*/18).string(message.message);
|
29800 | if (message.details != null && message.details.length)
|
29801 | for (var i = 0; i < message.details.length; ++i)
|
29802 | $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
|
29803 | return writer;
|
29804 | };
|
29805 |
|
29806 | /**
|
29807 | * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages.
|
29808 | * @function encodeDelimited
|
29809 | * @memberof google.rpc.Status
|
29810 | * @static
|
29811 | * @param {google.rpc.IStatus} message Status message or plain object to encode
|
29812 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
29813 | * @returns {$protobuf.Writer} Writer
|
29814 | */
|
29815 | Status.encodeDelimited = function encodeDelimited(message, writer) {
|
29816 | return this.encode(message, writer).ldelim();
|
29817 | };
|
29818 |
|
29819 | /**
|
29820 | * Decodes a Status message from the specified reader or buffer.
|
29821 | * @function decode
|
29822 | * @memberof google.rpc.Status
|
29823 | * @static
|
29824 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
29825 | * @param {number} [length] Message length if known beforehand
|
29826 | * @returns {google.rpc.Status} Status
|
29827 | * @throws {Error} If the payload is not a reader or valid buffer
|
29828 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
29829 | */
|
29830 | Status.decode = function decode(reader, length) {
|
29831 | if (!(reader instanceof $Reader))
|
29832 | reader = $Reader.create(reader);
|
29833 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status();
|
29834 | while (reader.pos < end) {
|
29835 | var tag = reader.uint32();
|
29836 | switch (tag >>> 3) {
|
29837 | case 1:
|
29838 | message.code = reader.int32();
|
29839 | break;
|
29840 | case 2:
|
29841 | message.message = reader.string();
|
29842 | break;
|
29843 | case 3:
|
29844 | if (!(message.details && message.details.length))
|
29845 | message.details = [];
|
29846 | message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32()));
|
29847 | break;
|
29848 | default:
|
29849 | reader.skipType(tag & 7);
|
29850 | break;
|
29851 | }
|
29852 | }
|
29853 | return message;
|
29854 | };
|
29855 |
|
29856 | /**
|
29857 | * Decodes a Status message from the specified reader or buffer, length delimited.
|
29858 | * @function decodeDelimited
|
29859 | * @memberof google.rpc.Status
|
29860 | * @static
|
29861 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
29862 | * @returns {google.rpc.Status} Status
|
29863 | * @throws {Error} If the payload is not a reader or valid buffer
|
29864 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
29865 | */
|
29866 | Status.decodeDelimited = function decodeDelimited(reader) {
|
29867 | if (!(reader instanceof $Reader))
|
29868 | reader = new $Reader(reader);
|
29869 | return this.decode(reader, reader.uint32());
|
29870 | };
|
29871 |
|
29872 | /**
|
29873 | * Verifies a Status message.
|
29874 | * @function verify
|
29875 | * @memberof google.rpc.Status
|
29876 | * @static
|
29877 | * @param {Object.<string,*>} message Plain object to verify
|
29878 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
29879 | */
|
29880 | Status.verify = function verify(message) {
|
29881 | if (typeof message !== "object" || message === null)
|
29882 | return "object expected";
|
29883 | if (message.code != null && message.hasOwnProperty("code"))
|
29884 | if (!$util.isInteger(message.code))
|
29885 | return "code: integer expected";
|
29886 | if (message.message != null && message.hasOwnProperty("message"))
|
29887 | if (!$util.isString(message.message))
|
29888 | return "message: string expected";
|
29889 | if (message.details != null && message.hasOwnProperty("details")) {
|
29890 | if (!Array.isArray(message.details))
|
29891 | return "details: array expected";
|
29892 | for (var i = 0; i < message.details.length; ++i) {
|
29893 | var error = $root.google.protobuf.Any.verify(message.details[i]);
|
29894 | if (error)
|
29895 | return "details." + error;
|
29896 | }
|
29897 | }
|
29898 | return null;
|
29899 | };
|
29900 |
|
29901 | /**
|
29902 | * Creates a Status message from a plain object. Also converts values to their respective internal types.
|
29903 | * @function fromObject
|
29904 | * @memberof google.rpc.Status
|
29905 | * @static
|
29906 | * @param {Object.<string,*>} object Plain object
|
29907 | * @returns {google.rpc.Status} Status
|
29908 | */
|
29909 | Status.fromObject = function fromObject(object) {
|
29910 | if (object instanceof $root.google.rpc.Status)
|
29911 | return object;
|
29912 | var message = new $root.google.rpc.Status();
|
29913 | if (object.code != null)
|
29914 | message.code = object.code | 0;
|
29915 | if (object.message != null)
|
29916 | message.message = String(object.message);
|
29917 | if (object.details) {
|
29918 | if (!Array.isArray(object.details))
|
29919 | throw TypeError(".google.rpc.Status.details: array expected");
|
29920 | message.details = [];
|
29921 | for (var i = 0; i < object.details.length; ++i) {
|
29922 | if (typeof object.details[i] !== "object")
|
29923 | throw TypeError(".google.rpc.Status.details: object expected");
|
29924 | message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]);
|
29925 | }
|
29926 | }
|
29927 | return message;
|
29928 | };
|
29929 |
|
29930 | /**
|
29931 | * Creates a plain object from a Status message. Also converts values to other types if specified.
|
29932 | * @function toObject
|
29933 | * @memberof google.rpc.Status
|
29934 | * @static
|
29935 | * @param {google.rpc.Status} message Status
|
29936 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
29937 | * @returns {Object.<string,*>} Plain object
|
29938 | */
|
29939 | Status.toObject = function toObject(message, options) {
|
29940 | if (!options)
|
29941 | options = {};
|
29942 | var object = {};
|
29943 | if (options.arrays || options.defaults)
|
29944 | object.details = [];
|
29945 | if (options.defaults) {
|
29946 | object.code = 0;
|
29947 | object.message = "";
|
29948 | }
|
29949 | if (message.code != null && message.hasOwnProperty("code"))
|
29950 | object.code = message.code;
|
29951 | if (message.message != null && message.hasOwnProperty("message"))
|
29952 | object.message = message.message;
|
29953 | if (message.details && message.details.length) {
|
29954 | object.details = [];
|
29955 | for (var j = 0; j < message.details.length; ++j)
|
29956 | object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options);
|
29957 | }
|
29958 | return object;
|
29959 | };
|
29960 |
|
29961 | /**
|
29962 | * Converts this Status to JSON.
|
29963 | * @function toJSON
|
29964 | * @memberof google.rpc.Status
|
29965 | * @instance
|
29966 | * @returns {Object.<string,*>} JSON object
|
29967 | */
|
29968 | Status.prototype.toJSON = function toJSON() {
|
29969 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
29970 | };
|
29971 |
|
29972 | return Status;
|
29973 | })();
|
29974 |
|
29975 | return rpc;
|
29976 | })();
|
29977 |
|
29978 | return google;
|
29979 | })();
|
29980 |
|
29981 | return $root;
|
29982 | });
|