1 | // Copyright 2022 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 | * @property {google.cloud.speech.v1.ITranscriptOutputConfig|null} [outputConfig] LongRunningRecognizeRequest outputConfig
|
432 | */
|
433 |
|
434 | /**
|
435 | * Constructs a new LongRunningRecognizeRequest.
|
436 | * @memberof google.cloud.speech.v1
|
437 | * @classdesc Represents a LongRunningRecognizeRequest.
|
438 | * @implements ILongRunningRecognizeRequest
|
439 | * @constructor
|
440 | * @param {google.cloud.speech.v1.ILongRunningRecognizeRequest=} [properties] Properties to set
|
441 | */
|
442 | function LongRunningRecognizeRequest(properties) {
|
443 | if (properties)
|
444 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
445 | if (properties[keys[i]] != null)
|
446 | this[keys[i]] = properties[keys[i]];
|
447 | }
|
448 |
|
449 | /**
|
450 | * LongRunningRecognizeRequest config.
|
451 | * @member {google.cloud.speech.v1.IRecognitionConfig|null|undefined} config
|
452 | * @memberof google.cloud.speech.v1.LongRunningRecognizeRequest
|
453 | * @instance
|
454 | */
|
455 | LongRunningRecognizeRequest.prototype.config = null;
|
456 |
|
457 | /**
|
458 | * LongRunningRecognizeRequest audio.
|
459 | * @member {google.cloud.speech.v1.IRecognitionAudio|null|undefined} audio
|
460 | * @memberof google.cloud.speech.v1.LongRunningRecognizeRequest
|
461 | * @instance
|
462 | */
|
463 | LongRunningRecognizeRequest.prototype.audio = null;
|
464 |
|
465 | /**
|
466 | * LongRunningRecognizeRequest outputConfig.
|
467 | * @member {google.cloud.speech.v1.ITranscriptOutputConfig|null|undefined} outputConfig
|
468 | * @memberof google.cloud.speech.v1.LongRunningRecognizeRequest
|
469 | * @instance
|
470 | */
|
471 | LongRunningRecognizeRequest.prototype.outputConfig = null;
|
472 |
|
473 | /**
|
474 | * Creates a new LongRunningRecognizeRequest instance using the specified properties.
|
475 | * @function create
|
476 | * @memberof google.cloud.speech.v1.LongRunningRecognizeRequest
|
477 | * @static
|
478 | * @param {google.cloud.speech.v1.ILongRunningRecognizeRequest=} [properties] Properties to set
|
479 | * @returns {google.cloud.speech.v1.LongRunningRecognizeRequest} LongRunningRecognizeRequest instance
|
480 | */
|
481 | LongRunningRecognizeRequest.create = function create(properties) {
|
482 | return new LongRunningRecognizeRequest(properties);
|
483 | };
|
484 |
|
485 | /**
|
486 | * Encodes the specified LongRunningRecognizeRequest message. Does not implicitly {@link google.cloud.speech.v1.LongRunningRecognizeRequest.verify|verify} messages.
|
487 | * @function encode
|
488 | * @memberof google.cloud.speech.v1.LongRunningRecognizeRequest
|
489 | * @static
|
490 | * @param {google.cloud.speech.v1.ILongRunningRecognizeRequest} message LongRunningRecognizeRequest message or plain object to encode
|
491 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
492 | * @returns {$protobuf.Writer} Writer
|
493 | */
|
494 | LongRunningRecognizeRequest.encode = function encode(message, writer) {
|
495 | if (!writer)
|
496 | writer = $Writer.create();
|
497 | if (message.config != null && Object.hasOwnProperty.call(message, "config"))
|
498 | $root.google.cloud.speech.v1.RecognitionConfig.encode(message.config, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
499 | if (message.audio != null && Object.hasOwnProperty.call(message, "audio"))
|
500 | $root.google.cloud.speech.v1.RecognitionAudio.encode(message.audio, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
501 | if (message.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig"))
|
502 | $root.google.cloud.speech.v1.TranscriptOutputConfig.encode(message.outputConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
|
503 | return writer;
|
504 | };
|
505 |
|
506 | /**
|
507 | * Encodes the specified LongRunningRecognizeRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1.LongRunningRecognizeRequest.verify|verify} messages.
|
508 | * @function encodeDelimited
|
509 | * @memberof google.cloud.speech.v1.LongRunningRecognizeRequest
|
510 | * @static
|
511 | * @param {google.cloud.speech.v1.ILongRunningRecognizeRequest} message LongRunningRecognizeRequest message or plain object to encode
|
512 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
513 | * @returns {$protobuf.Writer} Writer
|
514 | */
|
515 | LongRunningRecognizeRequest.encodeDelimited = function encodeDelimited(message, writer) {
|
516 | return this.encode(message, writer).ldelim();
|
517 | };
|
518 |
|
519 | /**
|
520 | * Decodes a LongRunningRecognizeRequest message from the specified reader or buffer.
|
521 | * @function decode
|
522 | * @memberof google.cloud.speech.v1.LongRunningRecognizeRequest
|
523 | * @static
|
524 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
525 | * @param {number} [length] Message length if known beforehand
|
526 | * @returns {google.cloud.speech.v1.LongRunningRecognizeRequest} LongRunningRecognizeRequest
|
527 | * @throws {Error} If the payload is not a reader or valid buffer
|
528 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
529 | */
|
530 | LongRunningRecognizeRequest.decode = function decode(reader, length) {
|
531 | if (!(reader instanceof $Reader))
|
532 | reader = $Reader.create(reader);
|
533 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.LongRunningRecognizeRequest();
|
534 | while (reader.pos < end) {
|
535 | var tag = reader.uint32();
|
536 | switch (tag >>> 3) {
|
537 | case 1:
|
538 | message.config = $root.google.cloud.speech.v1.RecognitionConfig.decode(reader, reader.uint32());
|
539 | break;
|
540 | case 2:
|
541 | message.audio = $root.google.cloud.speech.v1.RecognitionAudio.decode(reader, reader.uint32());
|
542 | break;
|
543 | case 4:
|
544 | message.outputConfig = $root.google.cloud.speech.v1.TranscriptOutputConfig.decode(reader, reader.uint32());
|
545 | break;
|
546 | default:
|
547 | reader.skipType(tag & 7);
|
548 | break;
|
549 | }
|
550 | }
|
551 | return message;
|
552 | };
|
553 |
|
554 | /**
|
555 | * Decodes a LongRunningRecognizeRequest message from the specified reader or buffer, length delimited.
|
556 | * @function decodeDelimited
|
557 | * @memberof google.cloud.speech.v1.LongRunningRecognizeRequest
|
558 | * @static
|
559 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
560 | * @returns {google.cloud.speech.v1.LongRunningRecognizeRequest} LongRunningRecognizeRequest
|
561 | * @throws {Error} If the payload is not a reader or valid buffer
|
562 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
563 | */
|
564 | LongRunningRecognizeRequest.decodeDelimited = function decodeDelimited(reader) {
|
565 | if (!(reader instanceof $Reader))
|
566 | reader = new $Reader(reader);
|
567 | return this.decode(reader, reader.uint32());
|
568 | };
|
569 |
|
570 | /**
|
571 | * Verifies a LongRunningRecognizeRequest message.
|
572 | * @function verify
|
573 | * @memberof google.cloud.speech.v1.LongRunningRecognizeRequest
|
574 | * @static
|
575 | * @param {Object.<string,*>} message Plain object to verify
|
576 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
577 | */
|
578 | LongRunningRecognizeRequest.verify = function verify(message) {
|
579 | if (typeof message !== "object" || message === null)
|
580 | return "object expected";
|
581 | if (message.config != null && message.hasOwnProperty("config")) {
|
582 | var error = $root.google.cloud.speech.v1.RecognitionConfig.verify(message.config);
|
583 | if (error)
|
584 | return "config." + error;
|
585 | }
|
586 | if (message.audio != null && message.hasOwnProperty("audio")) {
|
587 | var error = $root.google.cloud.speech.v1.RecognitionAudio.verify(message.audio);
|
588 | if (error)
|
589 | return "audio." + error;
|
590 | }
|
591 | if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) {
|
592 | var error = $root.google.cloud.speech.v1.TranscriptOutputConfig.verify(message.outputConfig);
|
593 | if (error)
|
594 | return "outputConfig." + error;
|
595 | }
|
596 | return null;
|
597 | };
|
598 |
|
599 | /**
|
600 | * Creates a LongRunningRecognizeRequest message from a plain object. Also converts values to their respective internal types.
|
601 | * @function fromObject
|
602 | * @memberof google.cloud.speech.v1.LongRunningRecognizeRequest
|
603 | * @static
|
604 | * @param {Object.<string,*>} object Plain object
|
605 | * @returns {google.cloud.speech.v1.LongRunningRecognizeRequest} LongRunningRecognizeRequest
|
606 | */
|
607 | LongRunningRecognizeRequest.fromObject = function fromObject(object) {
|
608 | if (object instanceof $root.google.cloud.speech.v1.LongRunningRecognizeRequest)
|
609 | return object;
|
610 | var message = new $root.google.cloud.speech.v1.LongRunningRecognizeRequest();
|
611 | if (object.config != null) {
|
612 | if (typeof object.config !== "object")
|
613 | throw TypeError(".google.cloud.speech.v1.LongRunningRecognizeRequest.config: object expected");
|
614 | message.config = $root.google.cloud.speech.v1.RecognitionConfig.fromObject(object.config);
|
615 | }
|
616 | if (object.audio != null) {
|
617 | if (typeof object.audio !== "object")
|
618 | throw TypeError(".google.cloud.speech.v1.LongRunningRecognizeRequest.audio: object expected");
|
619 | message.audio = $root.google.cloud.speech.v1.RecognitionAudio.fromObject(object.audio);
|
620 | }
|
621 | if (object.outputConfig != null) {
|
622 | if (typeof object.outputConfig !== "object")
|
623 | throw TypeError(".google.cloud.speech.v1.LongRunningRecognizeRequest.outputConfig: object expected");
|
624 | message.outputConfig = $root.google.cloud.speech.v1.TranscriptOutputConfig.fromObject(object.outputConfig);
|
625 | }
|
626 | return message;
|
627 | };
|
628 |
|
629 | /**
|
630 | * Creates a plain object from a LongRunningRecognizeRequest message. Also converts values to other types if specified.
|
631 | * @function toObject
|
632 | * @memberof google.cloud.speech.v1.LongRunningRecognizeRequest
|
633 | * @static
|
634 | * @param {google.cloud.speech.v1.LongRunningRecognizeRequest} message LongRunningRecognizeRequest
|
635 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
636 | * @returns {Object.<string,*>} Plain object
|
637 | */
|
638 | LongRunningRecognizeRequest.toObject = function toObject(message, options) {
|
639 | if (!options)
|
640 | options = {};
|
641 | var object = {};
|
642 | if (options.defaults) {
|
643 | object.config = null;
|
644 | object.audio = null;
|
645 | object.outputConfig = null;
|
646 | }
|
647 | if (message.config != null && message.hasOwnProperty("config"))
|
648 | object.config = $root.google.cloud.speech.v1.RecognitionConfig.toObject(message.config, options);
|
649 | if (message.audio != null && message.hasOwnProperty("audio"))
|
650 | object.audio = $root.google.cloud.speech.v1.RecognitionAudio.toObject(message.audio, options);
|
651 | if (message.outputConfig != null && message.hasOwnProperty("outputConfig"))
|
652 | object.outputConfig = $root.google.cloud.speech.v1.TranscriptOutputConfig.toObject(message.outputConfig, options);
|
653 | return object;
|
654 | };
|
655 |
|
656 | /**
|
657 | * Converts this LongRunningRecognizeRequest to JSON.
|
658 | * @function toJSON
|
659 | * @memberof google.cloud.speech.v1.LongRunningRecognizeRequest
|
660 | * @instance
|
661 | * @returns {Object.<string,*>} JSON object
|
662 | */
|
663 | LongRunningRecognizeRequest.prototype.toJSON = function toJSON() {
|
664 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
665 | };
|
666 |
|
667 | return LongRunningRecognizeRequest;
|
668 | })();
|
669 |
|
670 | v1.TranscriptOutputConfig = (function() {
|
671 |
|
672 | /**
|
673 | * Properties of a TranscriptOutputConfig.
|
674 | * @memberof google.cloud.speech.v1
|
675 | * @interface ITranscriptOutputConfig
|
676 | * @property {string|null} [gcsUri] TranscriptOutputConfig gcsUri
|
677 | */
|
678 |
|
679 | /**
|
680 | * Constructs a new TranscriptOutputConfig.
|
681 | * @memberof google.cloud.speech.v1
|
682 | * @classdesc Represents a TranscriptOutputConfig.
|
683 | * @implements ITranscriptOutputConfig
|
684 | * @constructor
|
685 | * @param {google.cloud.speech.v1.ITranscriptOutputConfig=} [properties] Properties to set
|
686 | */
|
687 | function TranscriptOutputConfig(properties) {
|
688 | if (properties)
|
689 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
690 | if (properties[keys[i]] != null)
|
691 | this[keys[i]] = properties[keys[i]];
|
692 | }
|
693 |
|
694 | /**
|
695 | * TranscriptOutputConfig gcsUri.
|
696 | * @member {string|null|undefined} gcsUri
|
697 | * @memberof google.cloud.speech.v1.TranscriptOutputConfig
|
698 | * @instance
|
699 | */
|
700 | TranscriptOutputConfig.prototype.gcsUri = null;
|
701 |
|
702 | // OneOf field names bound to virtual getters and setters
|
703 | var $oneOfFields;
|
704 |
|
705 | /**
|
706 | * TranscriptOutputConfig outputType.
|
707 | * @member {"gcsUri"|undefined} outputType
|
708 | * @memberof google.cloud.speech.v1.TranscriptOutputConfig
|
709 | * @instance
|
710 | */
|
711 | Object.defineProperty(TranscriptOutputConfig.prototype, "outputType", {
|
712 | get: $util.oneOfGetter($oneOfFields = ["gcsUri"]),
|
713 | set: $util.oneOfSetter($oneOfFields)
|
714 | });
|
715 |
|
716 | /**
|
717 | * Creates a new TranscriptOutputConfig instance using the specified properties.
|
718 | * @function create
|
719 | * @memberof google.cloud.speech.v1.TranscriptOutputConfig
|
720 | * @static
|
721 | * @param {google.cloud.speech.v1.ITranscriptOutputConfig=} [properties] Properties to set
|
722 | * @returns {google.cloud.speech.v1.TranscriptOutputConfig} TranscriptOutputConfig instance
|
723 | */
|
724 | TranscriptOutputConfig.create = function create(properties) {
|
725 | return new TranscriptOutputConfig(properties);
|
726 | };
|
727 |
|
728 | /**
|
729 | * Encodes the specified TranscriptOutputConfig message. Does not implicitly {@link google.cloud.speech.v1.TranscriptOutputConfig.verify|verify} messages.
|
730 | * @function encode
|
731 | * @memberof google.cloud.speech.v1.TranscriptOutputConfig
|
732 | * @static
|
733 | * @param {google.cloud.speech.v1.ITranscriptOutputConfig} message TranscriptOutputConfig message or plain object to encode
|
734 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
735 | * @returns {$protobuf.Writer} Writer
|
736 | */
|
737 | TranscriptOutputConfig.encode = function encode(message, writer) {
|
738 | if (!writer)
|
739 | writer = $Writer.create();
|
740 | if (message.gcsUri != null && Object.hasOwnProperty.call(message, "gcsUri"))
|
741 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcsUri);
|
742 | return writer;
|
743 | };
|
744 |
|
745 | /**
|
746 | * Encodes the specified TranscriptOutputConfig message, length delimited. Does not implicitly {@link google.cloud.speech.v1.TranscriptOutputConfig.verify|verify} messages.
|
747 | * @function encodeDelimited
|
748 | * @memberof google.cloud.speech.v1.TranscriptOutputConfig
|
749 | * @static
|
750 | * @param {google.cloud.speech.v1.ITranscriptOutputConfig} message TranscriptOutputConfig message or plain object to encode
|
751 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
752 | * @returns {$protobuf.Writer} Writer
|
753 | */
|
754 | TranscriptOutputConfig.encodeDelimited = function encodeDelimited(message, writer) {
|
755 | return this.encode(message, writer).ldelim();
|
756 | };
|
757 |
|
758 | /**
|
759 | * Decodes a TranscriptOutputConfig message from the specified reader or buffer.
|
760 | * @function decode
|
761 | * @memberof google.cloud.speech.v1.TranscriptOutputConfig
|
762 | * @static
|
763 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
764 | * @param {number} [length] Message length if known beforehand
|
765 | * @returns {google.cloud.speech.v1.TranscriptOutputConfig} TranscriptOutputConfig
|
766 | * @throws {Error} If the payload is not a reader or valid buffer
|
767 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
768 | */
|
769 | TranscriptOutputConfig.decode = function decode(reader, length) {
|
770 | if (!(reader instanceof $Reader))
|
771 | reader = $Reader.create(reader);
|
772 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.TranscriptOutputConfig();
|
773 | while (reader.pos < end) {
|
774 | var tag = reader.uint32();
|
775 | switch (tag >>> 3) {
|
776 | case 1:
|
777 | message.gcsUri = reader.string();
|
778 | break;
|
779 | default:
|
780 | reader.skipType(tag & 7);
|
781 | break;
|
782 | }
|
783 | }
|
784 | return message;
|
785 | };
|
786 |
|
787 | /**
|
788 | * Decodes a TranscriptOutputConfig message from the specified reader or buffer, length delimited.
|
789 | * @function decodeDelimited
|
790 | * @memberof google.cloud.speech.v1.TranscriptOutputConfig
|
791 | * @static
|
792 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
793 | * @returns {google.cloud.speech.v1.TranscriptOutputConfig} TranscriptOutputConfig
|
794 | * @throws {Error} If the payload is not a reader or valid buffer
|
795 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
796 | */
|
797 | TranscriptOutputConfig.decodeDelimited = function decodeDelimited(reader) {
|
798 | if (!(reader instanceof $Reader))
|
799 | reader = new $Reader(reader);
|
800 | return this.decode(reader, reader.uint32());
|
801 | };
|
802 |
|
803 | /**
|
804 | * Verifies a TranscriptOutputConfig message.
|
805 | * @function verify
|
806 | * @memberof google.cloud.speech.v1.TranscriptOutputConfig
|
807 | * @static
|
808 | * @param {Object.<string,*>} message Plain object to verify
|
809 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
810 | */
|
811 | TranscriptOutputConfig.verify = function verify(message) {
|
812 | if (typeof message !== "object" || message === null)
|
813 | return "object expected";
|
814 | var properties = {};
|
815 | if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) {
|
816 | properties.outputType = 1;
|
817 | if (!$util.isString(message.gcsUri))
|
818 | return "gcsUri: string expected";
|
819 | }
|
820 | return null;
|
821 | };
|
822 |
|
823 | /**
|
824 | * Creates a TranscriptOutputConfig message from a plain object. Also converts values to their respective internal types.
|
825 | * @function fromObject
|
826 | * @memberof google.cloud.speech.v1.TranscriptOutputConfig
|
827 | * @static
|
828 | * @param {Object.<string,*>} object Plain object
|
829 | * @returns {google.cloud.speech.v1.TranscriptOutputConfig} TranscriptOutputConfig
|
830 | */
|
831 | TranscriptOutputConfig.fromObject = function fromObject(object) {
|
832 | if (object instanceof $root.google.cloud.speech.v1.TranscriptOutputConfig)
|
833 | return object;
|
834 | var message = new $root.google.cloud.speech.v1.TranscriptOutputConfig();
|
835 | if (object.gcsUri != null)
|
836 | message.gcsUri = String(object.gcsUri);
|
837 | return message;
|
838 | };
|
839 |
|
840 | /**
|
841 | * Creates a plain object from a TranscriptOutputConfig message. Also converts values to other types if specified.
|
842 | * @function toObject
|
843 | * @memberof google.cloud.speech.v1.TranscriptOutputConfig
|
844 | * @static
|
845 | * @param {google.cloud.speech.v1.TranscriptOutputConfig} message TranscriptOutputConfig
|
846 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
847 | * @returns {Object.<string,*>} Plain object
|
848 | */
|
849 | TranscriptOutputConfig.toObject = function toObject(message, options) {
|
850 | if (!options)
|
851 | options = {};
|
852 | var object = {};
|
853 | if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) {
|
854 | object.gcsUri = message.gcsUri;
|
855 | if (options.oneofs)
|
856 | object.outputType = "gcsUri";
|
857 | }
|
858 | return object;
|
859 | };
|
860 |
|
861 | /**
|
862 | * Converts this TranscriptOutputConfig to JSON.
|
863 | * @function toJSON
|
864 | * @memberof google.cloud.speech.v1.TranscriptOutputConfig
|
865 | * @instance
|
866 | * @returns {Object.<string,*>} JSON object
|
867 | */
|
868 | TranscriptOutputConfig.prototype.toJSON = function toJSON() {
|
869 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
870 | };
|
871 |
|
872 | return TranscriptOutputConfig;
|
873 | })();
|
874 |
|
875 | v1.StreamingRecognizeRequest = (function() {
|
876 |
|
877 | /**
|
878 | * Properties of a StreamingRecognizeRequest.
|
879 | * @memberof google.cloud.speech.v1
|
880 | * @interface IStreamingRecognizeRequest
|
881 | * @property {google.cloud.speech.v1.IStreamingRecognitionConfig|null} [streamingConfig] StreamingRecognizeRequest streamingConfig
|
882 | * @property {Uint8Array|null} [audioContent] StreamingRecognizeRequest audioContent
|
883 | */
|
884 |
|
885 | /**
|
886 | * Constructs a new StreamingRecognizeRequest.
|
887 | * @memberof google.cloud.speech.v1
|
888 | * @classdesc Represents a StreamingRecognizeRequest.
|
889 | * @implements IStreamingRecognizeRequest
|
890 | * @constructor
|
891 | * @param {google.cloud.speech.v1.IStreamingRecognizeRequest=} [properties] Properties to set
|
892 | */
|
893 | function StreamingRecognizeRequest(properties) {
|
894 | if (properties)
|
895 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
896 | if (properties[keys[i]] != null)
|
897 | this[keys[i]] = properties[keys[i]];
|
898 | }
|
899 |
|
900 | /**
|
901 | * StreamingRecognizeRequest streamingConfig.
|
902 | * @member {google.cloud.speech.v1.IStreamingRecognitionConfig|null|undefined} streamingConfig
|
903 | * @memberof google.cloud.speech.v1.StreamingRecognizeRequest
|
904 | * @instance
|
905 | */
|
906 | StreamingRecognizeRequest.prototype.streamingConfig = null;
|
907 |
|
908 | /**
|
909 | * StreamingRecognizeRequest audioContent.
|
910 | * @member {Uint8Array|null|undefined} audioContent
|
911 | * @memberof google.cloud.speech.v1.StreamingRecognizeRequest
|
912 | * @instance
|
913 | */
|
914 | StreamingRecognizeRequest.prototype.audioContent = null;
|
915 |
|
916 | // OneOf field names bound to virtual getters and setters
|
917 | var $oneOfFields;
|
918 |
|
919 | /**
|
920 | * StreamingRecognizeRequest streamingRequest.
|
921 | * @member {"streamingConfig"|"audioContent"|undefined} streamingRequest
|
922 | * @memberof google.cloud.speech.v1.StreamingRecognizeRequest
|
923 | * @instance
|
924 | */
|
925 | Object.defineProperty(StreamingRecognizeRequest.prototype, "streamingRequest", {
|
926 | get: $util.oneOfGetter($oneOfFields = ["streamingConfig", "audioContent"]),
|
927 | set: $util.oneOfSetter($oneOfFields)
|
928 | });
|
929 |
|
930 | /**
|
931 | * Creates a new StreamingRecognizeRequest instance using the specified properties.
|
932 | * @function create
|
933 | * @memberof google.cloud.speech.v1.StreamingRecognizeRequest
|
934 | * @static
|
935 | * @param {google.cloud.speech.v1.IStreamingRecognizeRequest=} [properties] Properties to set
|
936 | * @returns {google.cloud.speech.v1.StreamingRecognizeRequest} StreamingRecognizeRequest instance
|
937 | */
|
938 | StreamingRecognizeRequest.create = function create(properties) {
|
939 | return new StreamingRecognizeRequest(properties);
|
940 | };
|
941 |
|
942 | /**
|
943 | * Encodes the specified StreamingRecognizeRequest message. Does not implicitly {@link google.cloud.speech.v1.StreamingRecognizeRequest.verify|verify} messages.
|
944 | * @function encode
|
945 | * @memberof google.cloud.speech.v1.StreamingRecognizeRequest
|
946 | * @static
|
947 | * @param {google.cloud.speech.v1.IStreamingRecognizeRequest} message StreamingRecognizeRequest message or plain object to encode
|
948 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
949 | * @returns {$protobuf.Writer} Writer
|
950 | */
|
951 | StreamingRecognizeRequest.encode = function encode(message, writer) {
|
952 | if (!writer)
|
953 | writer = $Writer.create();
|
954 | if (message.streamingConfig != null && Object.hasOwnProperty.call(message, "streamingConfig"))
|
955 | $root.google.cloud.speech.v1.StreamingRecognitionConfig.encode(message.streamingConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
956 | if (message.audioContent != null && Object.hasOwnProperty.call(message, "audioContent"))
|
957 | writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.audioContent);
|
958 | return writer;
|
959 | };
|
960 |
|
961 | /**
|
962 | * Encodes the specified StreamingRecognizeRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1.StreamingRecognizeRequest.verify|verify} messages.
|
963 | * @function encodeDelimited
|
964 | * @memberof google.cloud.speech.v1.StreamingRecognizeRequest
|
965 | * @static
|
966 | * @param {google.cloud.speech.v1.IStreamingRecognizeRequest} message StreamingRecognizeRequest message or plain object to encode
|
967 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
968 | * @returns {$protobuf.Writer} Writer
|
969 | */
|
970 | StreamingRecognizeRequest.encodeDelimited = function encodeDelimited(message, writer) {
|
971 | return this.encode(message, writer).ldelim();
|
972 | };
|
973 |
|
974 | /**
|
975 | * Decodes a StreamingRecognizeRequest message from the specified reader or buffer.
|
976 | * @function decode
|
977 | * @memberof google.cloud.speech.v1.StreamingRecognizeRequest
|
978 | * @static
|
979 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
980 | * @param {number} [length] Message length if known beforehand
|
981 | * @returns {google.cloud.speech.v1.StreamingRecognizeRequest} StreamingRecognizeRequest
|
982 | * @throws {Error} If the payload is not a reader or valid buffer
|
983 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
984 | */
|
985 | StreamingRecognizeRequest.decode = function decode(reader, length) {
|
986 | if (!(reader instanceof $Reader))
|
987 | reader = $Reader.create(reader);
|
988 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.StreamingRecognizeRequest();
|
989 | while (reader.pos < end) {
|
990 | var tag = reader.uint32();
|
991 | switch (tag >>> 3) {
|
992 | case 1:
|
993 | message.streamingConfig = $root.google.cloud.speech.v1.StreamingRecognitionConfig.decode(reader, reader.uint32());
|
994 | break;
|
995 | case 2:
|
996 | message.audioContent = reader.bytes();
|
997 | break;
|
998 | default:
|
999 | reader.skipType(tag & 7);
|
1000 | break;
|
1001 | }
|
1002 | }
|
1003 | return message;
|
1004 | };
|
1005 |
|
1006 | /**
|
1007 | * Decodes a StreamingRecognizeRequest message from the specified reader or buffer, length delimited.
|
1008 | * @function decodeDelimited
|
1009 | * @memberof google.cloud.speech.v1.StreamingRecognizeRequest
|
1010 | * @static
|
1011 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
1012 | * @returns {google.cloud.speech.v1.StreamingRecognizeRequest} StreamingRecognizeRequest
|
1013 | * @throws {Error} If the payload is not a reader or valid buffer
|
1014 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
1015 | */
|
1016 | StreamingRecognizeRequest.decodeDelimited = function decodeDelimited(reader) {
|
1017 | if (!(reader instanceof $Reader))
|
1018 | reader = new $Reader(reader);
|
1019 | return this.decode(reader, reader.uint32());
|
1020 | };
|
1021 |
|
1022 | /**
|
1023 | * Verifies a StreamingRecognizeRequest message.
|
1024 | * @function verify
|
1025 | * @memberof google.cloud.speech.v1.StreamingRecognizeRequest
|
1026 | * @static
|
1027 | * @param {Object.<string,*>} message Plain object to verify
|
1028 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
1029 | */
|
1030 | StreamingRecognizeRequest.verify = function verify(message) {
|
1031 | if (typeof message !== "object" || message === null)
|
1032 | return "object expected";
|
1033 | var properties = {};
|
1034 | if (message.streamingConfig != null && message.hasOwnProperty("streamingConfig")) {
|
1035 | properties.streamingRequest = 1;
|
1036 | {
|
1037 | var error = $root.google.cloud.speech.v1.StreamingRecognitionConfig.verify(message.streamingConfig);
|
1038 | if (error)
|
1039 | return "streamingConfig." + error;
|
1040 | }
|
1041 | }
|
1042 | if (message.audioContent != null && message.hasOwnProperty("audioContent")) {
|
1043 | if (properties.streamingRequest === 1)
|
1044 | return "streamingRequest: multiple values";
|
1045 | properties.streamingRequest = 1;
|
1046 | if (!(message.audioContent && typeof message.audioContent.length === "number" || $util.isString(message.audioContent)))
|
1047 | return "audioContent: buffer expected";
|
1048 | }
|
1049 | return null;
|
1050 | };
|
1051 |
|
1052 | /**
|
1053 | * Creates a StreamingRecognizeRequest message from a plain object. Also converts values to their respective internal types.
|
1054 | * @function fromObject
|
1055 | * @memberof google.cloud.speech.v1.StreamingRecognizeRequest
|
1056 | * @static
|
1057 | * @param {Object.<string,*>} object Plain object
|
1058 | * @returns {google.cloud.speech.v1.StreamingRecognizeRequest} StreamingRecognizeRequest
|
1059 | */
|
1060 | StreamingRecognizeRequest.fromObject = function fromObject(object) {
|
1061 | if (object instanceof $root.google.cloud.speech.v1.StreamingRecognizeRequest)
|
1062 | return object;
|
1063 | var message = new $root.google.cloud.speech.v1.StreamingRecognizeRequest();
|
1064 | if (object.streamingConfig != null) {
|
1065 | if (typeof object.streamingConfig !== "object")
|
1066 | throw TypeError(".google.cloud.speech.v1.StreamingRecognizeRequest.streamingConfig: object expected");
|
1067 | message.streamingConfig = $root.google.cloud.speech.v1.StreamingRecognitionConfig.fromObject(object.streamingConfig);
|
1068 | }
|
1069 | if (object.audioContent != null)
|
1070 | if (typeof object.audioContent === "string")
|
1071 | $util.base64.decode(object.audioContent, message.audioContent = $util.newBuffer($util.base64.length(object.audioContent)), 0);
|
1072 | else if (object.audioContent.length)
|
1073 | message.audioContent = object.audioContent;
|
1074 | return message;
|
1075 | };
|
1076 |
|
1077 | /**
|
1078 | * Creates a plain object from a StreamingRecognizeRequest message. Also converts values to other types if specified.
|
1079 | * @function toObject
|
1080 | * @memberof google.cloud.speech.v1.StreamingRecognizeRequest
|
1081 | * @static
|
1082 | * @param {google.cloud.speech.v1.StreamingRecognizeRequest} message StreamingRecognizeRequest
|
1083 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
1084 | * @returns {Object.<string,*>} Plain object
|
1085 | */
|
1086 | StreamingRecognizeRequest.toObject = function toObject(message, options) {
|
1087 | if (!options)
|
1088 | options = {};
|
1089 | var object = {};
|
1090 | if (message.streamingConfig != null && message.hasOwnProperty("streamingConfig")) {
|
1091 | object.streamingConfig = $root.google.cloud.speech.v1.StreamingRecognitionConfig.toObject(message.streamingConfig, options);
|
1092 | if (options.oneofs)
|
1093 | object.streamingRequest = "streamingConfig";
|
1094 | }
|
1095 | if (message.audioContent != null && message.hasOwnProperty("audioContent")) {
|
1096 | 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;
|
1097 | if (options.oneofs)
|
1098 | object.streamingRequest = "audioContent";
|
1099 | }
|
1100 | return object;
|
1101 | };
|
1102 |
|
1103 | /**
|
1104 | * Converts this StreamingRecognizeRequest to JSON.
|
1105 | * @function toJSON
|
1106 | * @memberof google.cloud.speech.v1.StreamingRecognizeRequest
|
1107 | * @instance
|
1108 | * @returns {Object.<string,*>} JSON object
|
1109 | */
|
1110 | StreamingRecognizeRequest.prototype.toJSON = function toJSON() {
|
1111 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
1112 | };
|
1113 |
|
1114 | return StreamingRecognizeRequest;
|
1115 | })();
|
1116 |
|
1117 | v1.StreamingRecognitionConfig = (function() {
|
1118 |
|
1119 | /**
|
1120 | * Properties of a StreamingRecognitionConfig.
|
1121 | * @memberof google.cloud.speech.v1
|
1122 | * @interface IStreamingRecognitionConfig
|
1123 | * @property {google.cloud.speech.v1.IRecognitionConfig|null} [config] StreamingRecognitionConfig config
|
1124 | * @property {boolean|null} [singleUtterance] StreamingRecognitionConfig singleUtterance
|
1125 | * @property {boolean|null} [interimResults] StreamingRecognitionConfig interimResults
|
1126 | */
|
1127 |
|
1128 | /**
|
1129 | * Constructs a new StreamingRecognitionConfig.
|
1130 | * @memberof google.cloud.speech.v1
|
1131 | * @classdesc Represents a StreamingRecognitionConfig.
|
1132 | * @implements IStreamingRecognitionConfig
|
1133 | * @constructor
|
1134 | * @param {google.cloud.speech.v1.IStreamingRecognitionConfig=} [properties] Properties to set
|
1135 | */
|
1136 | function StreamingRecognitionConfig(properties) {
|
1137 | if (properties)
|
1138 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
1139 | if (properties[keys[i]] != null)
|
1140 | this[keys[i]] = properties[keys[i]];
|
1141 | }
|
1142 |
|
1143 | /**
|
1144 | * StreamingRecognitionConfig config.
|
1145 | * @member {google.cloud.speech.v1.IRecognitionConfig|null|undefined} config
|
1146 | * @memberof google.cloud.speech.v1.StreamingRecognitionConfig
|
1147 | * @instance
|
1148 | */
|
1149 | StreamingRecognitionConfig.prototype.config = null;
|
1150 |
|
1151 | /**
|
1152 | * StreamingRecognitionConfig singleUtterance.
|
1153 | * @member {boolean} singleUtterance
|
1154 | * @memberof google.cloud.speech.v1.StreamingRecognitionConfig
|
1155 | * @instance
|
1156 | */
|
1157 | StreamingRecognitionConfig.prototype.singleUtterance = false;
|
1158 |
|
1159 | /**
|
1160 | * StreamingRecognitionConfig interimResults.
|
1161 | * @member {boolean} interimResults
|
1162 | * @memberof google.cloud.speech.v1.StreamingRecognitionConfig
|
1163 | * @instance
|
1164 | */
|
1165 | StreamingRecognitionConfig.prototype.interimResults = false;
|
1166 |
|
1167 | /**
|
1168 | * Creates a new StreamingRecognitionConfig instance using the specified properties.
|
1169 | * @function create
|
1170 | * @memberof google.cloud.speech.v1.StreamingRecognitionConfig
|
1171 | * @static
|
1172 | * @param {google.cloud.speech.v1.IStreamingRecognitionConfig=} [properties] Properties to set
|
1173 | * @returns {google.cloud.speech.v1.StreamingRecognitionConfig} StreamingRecognitionConfig instance
|
1174 | */
|
1175 | StreamingRecognitionConfig.create = function create(properties) {
|
1176 | return new StreamingRecognitionConfig(properties);
|
1177 | };
|
1178 |
|
1179 | /**
|
1180 | * Encodes the specified StreamingRecognitionConfig message. Does not implicitly {@link google.cloud.speech.v1.StreamingRecognitionConfig.verify|verify} messages.
|
1181 | * @function encode
|
1182 | * @memberof google.cloud.speech.v1.StreamingRecognitionConfig
|
1183 | * @static
|
1184 | * @param {google.cloud.speech.v1.IStreamingRecognitionConfig} message StreamingRecognitionConfig message or plain object to encode
|
1185 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
1186 | * @returns {$protobuf.Writer} Writer
|
1187 | */
|
1188 | StreamingRecognitionConfig.encode = function encode(message, writer) {
|
1189 | if (!writer)
|
1190 | writer = $Writer.create();
|
1191 | if (message.config != null && Object.hasOwnProperty.call(message, "config"))
|
1192 | $root.google.cloud.speech.v1.RecognitionConfig.encode(message.config, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
1193 | if (message.singleUtterance != null && Object.hasOwnProperty.call(message, "singleUtterance"))
|
1194 | writer.uint32(/* id 2, wireType 0 =*/16).bool(message.singleUtterance);
|
1195 | if (message.interimResults != null && Object.hasOwnProperty.call(message, "interimResults"))
|
1196 | writer.uint32(/* id 3, wireType 0 =*/24).bool(message.interimResults);
|
1197 | return writer;
|
1198 | };
|
1199 |
|
1200 | /**
|
1201 | * Encodes the specified StreamingRecognitionConfig message, length delimited. Does not implicitly {@link google.cloud.speech.v1.StreamingRecognitionConfig.verify|verify} messages.
|
1202 | * @function encodeDelimited
|
1203 | * @memberof google.cloud.speech.v1.StreamingRecognitionConfig
|
1204 | * @static
|
1205 | * @param {google.cloud.speech.v1.IStreamingRecognitionConfig} message StreamingRecognitionConfig message or plain object to encode
|
1206 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
1207 | * @returns {$protobuf.Writer} Writer
|
1208 | */
|
1209 | StreamingRecognitionConfig.encodeDelimited = function encodeDelimited(message, writer) {
|
1210 | return this.encode(message, writer).ldelim();
|
1211 | };
|
1212 |
|
1213 | /**
|
1214 | * Decodes a StreamingRecognitionConfig message from the specified reader or buffer.
|
1215 | * @function decode
|
1216 | * @memberof google.cloud.speech.v1.StreamingRecognitionConfig
|
1217 | * @static
|
1218 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
1219 | * @param {number} [length] Message length if known beforehand
|
1220 | * @returns {google.cloud.speech.v1.StreamingRecognitionConfig} StreamingRecognitionConfig
|
1221 | * @throws {Error} If the payload is not a reader or valid buffer
|
1222 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
1223 | */
|
1224 | StreamingRecognitionConfig.decode = function decode(reader, length) {
|
1225 | if (!(reader instanceof $Reader))
|
1226 | reader = $Reader.create(reader);
|
1227 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.StreamingRecognitionConfig();
|
1228 | while (reader.pos < end) {
|
1229 | var tag = reader.uint32();
|
1230 | switch (tag >>> 3) {
|
1231 | case 1:
|
1232 | message.config = $root.google.cloud.speech.v1.RecognitionConfig.decode(reader, reader.uint32());
|
1233 | break;
|
1234 | case 2:
|
1235 | message.singleUtterance = reader.bool();
|
1236 | break;
|
1237 | case 3:
|
1238 | message.interimResults = reader.bool();
|
1239 | break;
|
1240 | default:
|
1241 | reader.skipType(tag & 7);
|
1242 | break;
|
1243 | }
|
1244 | }
|
1245 | return message;
|
1246 | };
|
1247 |
|
1248 | /**
|
1249 | * Decodes a StreamingRecognitionConfig message from the specified reader or buffer, length delimited.
|
1250 | * @function decodeDelimited
|
1251 | * @memberof google.cloud.speech.v1.StreamingRecognitionConfig
|
1252 | * @static
|
1253 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
1254 | * @returns {google.cloud.speech.v1.StreamingRecognitionConfig} StreamingRecognitionConfig
|
1255 | * @throws {Error} If the payload is not a reader or valid buffer
|
1256 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
1257 | */
|
1258 | StreamingRecognitionConfig.decodeDelimited = function decodeDelimited(reader) {
|
1259 | if (!(reader instanceof $Reader))
|
1260 | reader = new $Reader(reader);
|
1261 | return this.decode(reader, reader.uint32());
|
1262 | };
|
1263 |
|
1264 | /**
|
1265 | * Verifies a StreamingRecognitionConfig message.
|
1266 | * @function verify
|
1267 | * @memberof google.cloud.speech.v1.StreamingRecognitionConfig
|
1268 | * @static
|
1269 | * @param {Object.<string,*>} message Plain object to verify
|
1270 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
1271 | */
|
1272 | StreamingRecognitionConfig.verify = function verify(message) {
|
1273 | if (typeof message !== "object" || message === null)
|
1274 | return "object expected";
|
1275 | if (message.config != null && message.hasOwnProperty("config")) {
|
1276 | var error = $root.google.cloud.speech.v1.RecognitionConfig.verify(message.config);
|
1277 | if (error)
|
1278 | return "config." + error;
|
1279 | }
|
1280 | if (message.singleUtterance != null && message.hasOwnProperty("singleUtterance"))
|
1281 | if (typeof message.singleUtterance !== "boolean")
|
1282 | return "singleUtterance: boolean expected";
|
1283 | if (message.interimResults != null && message.hasOwnProperty("interimResults"))
|
1284 | if (typeof message.interimResults !== "boolean")
|
1285 | return "interimResults: boolean expected";
|
1286 | return null;
|
1287 | };
|
1288 |
|
1289 | /**
|
1290 | * Creates a StreamingRecognitionConfig message from a plain object. Also converts values to their respective internal types.
|
1291 | * @function fromObject
|
1292 | * @memberof google.cloud.speech.v1.StreamingRecognitionConfig
|
1293 | * @static
|
1294 | * @param {Object.<string,*>} object Plain object
|
1295 | * @returns {google.cloud.speech.v1.StreamingRecognitionConfig} StreamingRecognitionConfig
|
1296 | */
|
1297 | StreamingRecognitionConfig.fromObject = function fromObject(object) {
|
1298 | if (object instanceof $root.google.cloud.speech.v1.StreamingRecognitionConfig)
|
1299 | return object;
|
1300 | var message = new $root.google.cloud.speech.v1.StreamingRecognitionConfig();
|
1301 | if (object.config != null) {
|
1302 | if (typeof object.config !== "object")
|
1303 | throw TypeError(".google.cloud.speech.v1.StreamingRecognitionConfig.config: object expected");
|
1304 | message.config = $root.google.cloud.speech.v1.RecognitionConfig.fromObject(object.config);
|
1305 | }
|
1306 | if (object.singleUtterance != null)
|
1307 | message.singleUtterance = Boolean(object.singleUtterance);
|
1308 | if (object.interimResults != null)
|
1309 | message.interimResults = Boolean(object.interimResults);
|
1310 | return message;
|
1311 | };
|
1312 |
|
1313 | /**
|
1314 | * Creates a plain object from a StreamingRecognitionConfig message. Also converts values to other types if specified.
|
1315 | * @function toObject
|
1316 | * @memberof google.cloud.speech.v1.StreamingRecognitionConfig
|
1317 | * @static
|
1318 | * @param {google.cloud.speech.v1.StreamingRecognitionConfig} message StreamingRecognitionConfig
|
1319 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
1320 | * @returns {Object.<string,*>} Plain object
|
1321 | */
|
1322 | StreamingRecognitionConfig.toObject = function toObject(message, options) {
|
1323 | if (!options)
|
1324 | options = {};
|
1325 | var object = {};
|
1326 | if (options.defaults) {
|
1327 | object.config = null;
|
1328 | object.singleUtterance = false;
|
1329 | object.interimResults = false;
|
1330 | }
|
1331 | if (message.config != null && message.hasOwnProperty("config"))
|
1332 | object.config = $root.google.cloud.speech.v1.RecognitionConfig.toObject(message.config, options);
|
1333 | if (message.singleUtterance != null && message.hasOwnProperty("singleUtterance"))
|
1334 | object.singleUtterance = message.singleUtterance;
|
1335 | if (message.interimResults != null && message.hasOwnProperty("interimResults"))
|
1336 | object.interimResults = message.interimResults;
|
1337 | return object;
|
1338 | };
|
1339 |
|
1340 | /**
|
1341 | * Converts this StreamingRecognitionConfig to JSON.
|
1342 | * @function toJSON
|
1343 | * @memberof google.cloud.speech.v1.StreamingRecognitionConfig
|
1344 | * @instance
|
1345 | * @returns {Object.<string,*>} JSON object
|
1346 | */
|
1347 | StreamingRecognitionConfig.prototype.toJSON = function toJSON() {
|
1348 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
1349 | };
|
1350 |
|
1351 | return StreamingRecognitionConfig;
|
1352 | })();
|
1353 |
|
1354 | v1.RecognitionConfig = (function() {
|
1355 |
|
1356 | /**
|
1357 | * Properties of a RecognitionConfig.
|
1358 | * @memberof google.cloud.speech.v1
|
1359 | * @interface IRecognitionConfig
|
1360 | * @property {google.cloud.speech.v1.RecognitionConfig.AudioEncoding|null} [encoding] RecognitionConfig encoding
|
1361 | * @property {number|null} [sampleRateHertz] RecognitionConfig sampleRateHertz
|
1362 | * @property {number|null} [audioChannelCount] RecognitionConfig audioChannelCount
|
1363 | * @property {boolean|null} [enableSeparateRecognitionPerChannel] RecognitionConfig enableSeparateRecognitionPerChannel
|
1364 | * @property {string|null} [languageCode] RecognitionConfig languageCode
|
1365 | * @property {Array.<string>|null} [alternativeLanguageCodes] RecognitionConfig alternativeLanguageCodes
|
1366 | * @property {number|null} [maxAlternatives] RecognitionConfig maxAlternatives
|
1367 | * @property {boolean|null} [profanityFilter] RecognitionConfig profanityFilter
|
1368 | * @property {google.cloud.speech.v1.ISpeechAdaptation|null} [adaptation] RecognitionConfig adaptation
|
1369 | * @property {Array.<google.cloud.speech.v1.ISpeechContext>|null} [speechContexts] RecognitionConfig speechContexts
|
1370 | * @property {boolean|null} [enableWordTimeOffsets] RecognitionConfig enableWordTimeOffsets
|
1371 | * @property {boolean|null} [enableWordConfidence] RecognitionConfig enableWordConfidence
|
1372 | * @property {boolean|null} [enableAutomaticPunctuation] RecognitionConfig enableAutomaticPunctuation
|
1373 | * @property {google.protobuf.IBoolValue|null} [enableSpokenPunctuation] RecognitionConfig enableSpokenPunctuation
|
1374 | * @property {google.protobuf.IBoolValue|null} [enableSpokenEmojis] RecognitionConfig enableSpokenEmojis
|
1375 | * @property {google.cloud.speech.v1.ISpeakerDiarizationConfig|null} [diarizationConfig] RecognitionConfig diarizationConfig
|
1376 | * @property {google.cloud.speech.v1.IRecognitionMetadata|null} [metadata] RecognitionConfig metadata
|
1377 | * @property {string|null} [model] RecognitionConfig model
|
1378 | * @property {boolean|null} [useEnhanced] RecognitionConfig useEnhanced
|
1379 | */
|
1380 |
|
1381 | /**
|
1382 | * Constructs a new RecognitionConfig.
|
1383 | * @memberof google.cloud.speech.v1
|
1384 | * @classdesc Represents a RecognitionConfig.
|
1385 | * @implements IRecognitionConfig
|
1386 | * @constructor
|
1387 | * @param {google.cloud.speech.v1.IRecognitionConfig=} [properties] Properties to set
|
1388 | */
|
1389 | function RecognitionConfig(properties) {
|
1390 | this.alternativeLanguageCodes = [];
|
1391 | this.speechContexts = [];
|
1392 | if (properties)
|
1393 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
1394 | if (properties[keys[i]] != null)
|
1395 | this[keys[i]] = properties[keys[i]];
|
1396 | }
|
1397 |
|
1398 | /**
|
1399 | * RecognitionConfig encoding.
|
1400 | * @member {google.cloud.speech.v1.RecognitionConfig.AudioEncoding} encoding
|
1401 | * @memberof google.cloud.speech.v1.RecognitionConfig
|
1402 | * @instance
|
1403 | */
|
1404 | RecognitionConfig.prototype.encoding = 0;
|
1405 |
|
1406 | /**
|
1407 | * RecognitionConfig sampleRateHertz.
|
1408 | * @member {number} sampleRateHertz
|
1409 | * @memberof google.cloud.speech.v1.RecognitionConfig
|
1410 | * @instance
|
1411 | */
|
1412 | RecognitionConfig.prototype.sampleRateHertz = 0;
|
1413 |
|
1414 | /**
|
1415 | * RecognitionConfig audioChannelCount.
|
1416 | * @member {number} audioChannelCount
|
1417 | * @memberof google.cloud.speech.v1.RecognitionConfig
|
1418 | * @instance
|
1419 | */
|
1420 | RecognitionConfig.prototype.audioChannelCount = 0;
|
1421 |
|
1422 | /**
|
1423 | * RecognitionConfig enableSeparateRecognitionPerChannel.
|
1424 | * @member {boolean} enableSeparateRecognitionPerChannel
|
1425 | * @memberof google.cloud.speech.v1.RecognitionConfig
|
1426 | * @instance
|
1427 | */
|
1428 | RecognitionConfig.prototype.enableSeparateRecognitionPerChannel = false;
|
1429 |
|
1430 | /**
|
1431 | * RecognitionConfig languageCode.
|
1432 | * @member {string} languageCode
|
1433 | * @memberof google.cloud.speech.v1.RecognitionConfig
|
1434 | * @instance
|
1435 | */
|
1436 | RecognitionConfig.prototype.languageCode = "";
|
1437 |
|
1438 | /**
|
1439 | * RecognitionConfig alternativeLanguageCodes.
|
1440 | * @member {Array.<string>} alternativeLanguageCodes
|
1441 | * @memberof google.cloud.speech.v1.RecognitionConfig
|
1442 | * @instance
|
1443 | */
|
1444 | RecognitionConfig.prototype.alternativeLanguageCodes = $util.emptyArray;
|
1445 |
|
1446 | /**
|
1447 | * RecognitionConfig maxAlternatives.
|
1448 | * @member {number} maxAlternatives
|
1449 | * @memberof google.cloud.speech.v1.RecognitionConfig
|
1450 | * @instance
|
1451 | */
|
1452 | RecognitionConfig.prototype.maxAlternatives = 0;
|
1453 |
|
1454 | /**
|
1455 | * RecognitionConfig profanityFilter.
|
1456 | * @member {boolean} profanityFilter
|
1457 | * @memberof google.cloud.speech.v1.RecognitionConfig
|
1458 | * @instance
|
1459 | */
|
1460 | RecognitionConfig.prototype.profanityFilter = false;
|
1461 |
|
1462 | /**
|
1463 | * RecognitionConfig adaptation.
|
1464 | * @member {google.cloud.speech.v1.ISpeechAdaptation|null|undefined} adaptation
|
1465 | * @memberof google.cloud.speech.v1.RecognitionConfig
|
1466 | * @instance
|
1467 | */
|
1468 | RecognitionConfig.prototype.adaptation = null;
|
1469 |
|
1470 | /**
|
1471 | * RecognitionConfig speechContexts.
|
1472 | * @member {Array.<google.cloud.speech.v1.ISpeechContext>} speechContexts
|
1473 | * @memberof google.cloud.speech.v1.RecognitionConfig
|
1474 | * @instance
|
1475 | */
|
1476 | RecognitionConfig.prototype.speechContexts = $util.emptyArray;
|
1477 |
|
1478 | /**
|
1479 | * RecognitionConfig enableWordTimeOffsets.
|
1480 | * @member {boolean} enableWordTimeOffsets
|
1481 | * @memberof google.cloud.speech.v1.RecognitionConfig
|
1482 | * @instance
|
1483 | */
|
1484 | RecognitionConfig.prototype.enableWordTimeOffsets = false;
|
1485 |
|
1486 | /**
|
1487 | * RecognitionConfig enableWordConfidence.
|
1488 | * @member {boolean} enableWordConfidence
|
1489 | * @memberof google.cloud.speech.v1.RecognitionConfig
|
1490 | * @instance
|
1491 | */
|
1492 | RecognitionConfig.prototype.enableWordConfidence = false;
|
1493 |
|
1494 | /**
|
1495 | * RecognitionConfig enableAutomaticPunctuation.
|
1496 | * @member {boolean} enableAutomaticPunctuation
|
1497 | * @memberof google.cloud.speech.v1.RecognitionConfig
|
1498 | * @instance
|
1499 | */
|
1500 | RecognitionConfig.prototype.enableAutomaticPunctuation = false;
|
1501 |
|
1502 | /**
|
1503 | * RecognitionConfig enableSpokenPunctuation.
|
1504 | * @member {google.protobuf.IBoolValue|null|undefined} enableSpokenPunctuation
|
1505 | * @memberof google.cloud.speech.v1.RecognitionConfig
|
1506 | * @instance
|
1507 | */
|
1508 | RecognitionConfig.prototype.enableSpokenPunctuation = null;
|
1509 |
|
1510 | /**
|
1511 | * RecognitionConfig enableSpokenEmojis.
|
1512 | * @member {google.protobuf.IBoolValue|null|undefined} enableSpokenEmojis
|
1513 | * @memberof google.cloud.speech.v1.RecognitionConfig
|
1514 | * @instance
|
1515 | */
|
1516 | RecognitionConfig.prototype.enableSpokenEmojis = null;
|
1517 |
|
1518 | /**
|
1519 | * RecognitionConfig diarizationConfig.
|
1520 | * @member {google.cloud.speech.v1.ISpeakerDiarizationConfig|null|undefined} diarizationConfig
|
1521 | * @memberof google.cloud.speech.v1.RecognitionConfig
|
1522 | * @instance
|
1523 | */
|
1524 | RecognitionConfig.prototype.diarizationConfig = null;
|
1525 |
|
1526 | /**
|
1527 | * RecognitionConfig metadata.
|
1528 | * @member {google.cloud.speech.v1.IRecognitionMetadata|null|undefined} metadata
|
1529 | * @memberof google.cloud.speech.v1.RecognitionConfig
|
1530 | * @instance
|
1531 | */
|
1532 | RecognitionConfig.prototype.metadata = null;
|
1533 |
|
1534 | /**
|
1535 | * RecognitionConfig model.
|
1536 | * @member {string} model
|
1537 | * @memberof google.cloud.speech.v1.RecognitionConfig
|
1538 | * @instance
|
1539 | */
|
1540 | RecognitionConfig.prototype.model = "";
|
1541 |
|
1542 | /**
|
1543 | * RecognitionConfig useEnhanced.
|
1544 | * @member {boolean} useEnhanced
|
1545 | * @memberof google.cloud.speech.v1.RecognitionConfig
|
1546 | * @instance
|
1547 | */
|
1548 | RecognitionConfig.prototype.useEnhanced = false;
|
1549 |
|
1550 | /**
|
1551 | * Creates a new RecognitionConfig instance using the specified properties.
|
1552 | * @function create
|
1553 | * @memberof google.cloud.speech.v1.RecognitionConfig
|
1554 | * @static
|
1555 | * @param {google.cloud.speech.v1.IRecognitionConfig=} [properties] Properties to set
|
1556 | * @returns {google.cloud.speech.v1.RecognitionConfig} RecognitionConfig instance
|
1557 | */
|
1558 | RecognitionConfig.create = function create(properties) {
|
1559 | return new RecognitionConfig(properties);
|
1560 | };
|
1561 |
|
1562 | /**
|
1563 | * Encodes the specified RecognitionConfig message. Does not implicitly {@link google.cloud.speech.v1.RecognitionConfig.verify|verify} messages.
|
1564 | * @function encode
|
1565 | * @memberof google.cloud.speech.v1.RecognitionConfig
|
1566 | * @static
|
1567 | * @param {google.cloud.speech.v1.IRecognitionConfig} message RecognitionConfig message or plain object to encode
|
1568 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
1569 | * @returns {$protobuf.Writer} Writer
|
1570 | */
|
1571 | RecognitionConfig.encode = function encode(message, writer) {
|
1572 | if (!writer)
|
1573 | writer = $Writer.create();
|
1574 | if (message.encoding != null && Object.hasOwnProperty.call(message, "encoding"))
|
1575 | writer.uint32(/* id 1, wireType 0 =*/8).int32(message.encoding);
|
1576 | if (message.sampleRateHertz != null && Object.hasOwnProperty.call(message, "sampleRateHertz"))
|
1577 | writer.uint32(/* id 2, wireType 0 =*/16).int32(message.sampleRateHertz);
|
1578 | if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode"))
|
1579 | writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCode);
|
1580 | if (message.maxAlternatives != null && Object.hasOwnProperty.call(message, "maxAlternatives"))
|
1581 | writer.uint32(/* id 4, wireType 0 =*/32).int32(message.maxAlternatives);
|
1582 | if (message.profanityFilter != null && Object.hasOwnProperty.call(message, "profanityFilter"))
|
1583 | writer.uint32(/* id 5, wireType 0 =*/40).bool(message.profanityFilter);
|
1584 | if (message.speechContexts != null && message.speechContexts.length)
|
1585 | for (var i = 0; i < message.speechContexts.length; ++i)
|
1586 | $root.google.cloud.speech.v1.SpeechContext.encode(message.speechContexts[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
|
1587 | if (message.audioChannelCount != null && Object.hasOwnProperty.call(message, "audioChannelCount"))
|
1588 | writer.uint32(/* id 7, wireType 0 =*/56).int32(message.audioChannelCount);
|
1589 | if (message.enableWordTimeOffsets != null && Object.hasOwnProperty.call(message, "enableWordTimeOffsets"))
|
1590 | writer.uint32(/* id 8, wireType 0 =*/64).bool(message.enableWordTimeOffsets);
|
1591 | if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata"))
|
1592 | $root.google.cloud.speech.v1.RecognitionMetadata.encode(message.metadata, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim();
|
1593 | if (message.enableAutomaticPunctuation != null && Object.hasOwnProperty.call(message, "enableAutomaticPunctuation"))
|
1594 | writer.uint32(/* id 11, wireType 0 =*/88).bool(message.enableAutomaticPunctuation);
|
1595 | if (message.enableSeparateRecognitionPerChannel != null && Object.hasOwnProperty.call(message, "enableSeparateRecognitionPerChannel"))
|
1596 | writer.uint32(/* id 12, wireType 0 =*/96).bool(message.enableSeparateRecognitionPerChannel);
|
1597 | if (message.model != null && Object.hasOwnProperty.call(message, "model"))
|
1598 | writer.uint32(/* id 13, wireType 2 =*/106).string(message.model);
|
1599 | if (message.useEnhanced != null && Object.hasOwnProperty.call(message, "useEnhanced"))
|
1600 | writer.uint32(/* id 14, wireType 0 =*/112).bool(message.useEnhanced);
|
1601 | if (message.enableWordConfidence != null && Object.hasOwnProperty.call(message, "enableWordConfidence"))
|
1602 | writer.uint32(/* id 15, wireType 0 =*/120).bool(message.enableWordConfidence);
|
1603 | if (message.alternativeLanguageCodes != null && message.alternativeLanguageCodes.length)
|
1604 | for (var i = 0; i < message.alternativeLanguageCodes.length; ++i)
|
1605 | writer.uint32(/* id 18, wireType 2 =*/146).string(message.alternativeLanguageCodes[i]);
|
1606 | if (message.diarizationConfig != null && Object.hasOwnProperty.call(message, "diarizationConfig"))
|
1607 | $root.google.cloud.speech.v1.SpeakerDiarizationConfig.encode(message.diarizationConfig, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim();
|
1608 | if (message.adaptation != null && Object.hasOwnProperty.call(message, "adaptation"))
|
1609 | $root.google.cloud.speech.v1.SpeechAdaptation.encode(message.adaptation, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim();
|
1610 | if (message.enableSpokenPunctuation != null && Object.hasOwnProperty.call(message, "enableSpokenPunctuation"))
|
1611 | $root.google.protobuf.BoolValue.encode(message.enableSpokenPunctuation, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim();
|
1612 | if (message.enableSpokenEmojis != null && Object.hasOwnProperty.call(message, "enableSpokenEmojis"))
|
1613 | $root.google.protobuf.BoolValue.encode(message.enableSpokenEmojis, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim();
|
1614 | return writer;
|
1615 | };
|
1616 |
|
1617 | /**
|
1618 | * Encodes the specified RecognitionConfig message, length delimited. Does not implicitly {@link google.cloud.speech.v1.RecognitionConfig.verify|verify} messages.
|
1619 | * @function encodeDelimited
|
1620 | * @memberof google.cloud.speech.v1.RecognitionConfig
|
1621 | * @static
|
1622 | * @param {google.cloud.speech.v1.IRecognitionConfig} message RecognitionConfig message or plain object to encode
|
1623 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
1624 | * @returns {$protobuf.Writer} Writer
|
1625 | */
|
1626 | RecognitionConfig.encodeDelimited = function encodeDelimited(message, writer) {
|
1627 | return this.encode(message, writer).ldelim();
|
1628 | };
|
1629 |
|
1630 | /**
|
1631 | * Decodes a RecognitionConfig message from the specified reader or buffer.
|
1632 | * @function decode
|
1633 | * @memberof google.cloud.speech.v1.RecognitionConfig
|
1634 | * @static
|
1635 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
1636 | * @param {number} [length] Message length if known beforehand
|
1637 | * @returns {google.cloud.speech.v1.RecognitionConfig} RecognitionConfig
|
1638 | * @throws {Error} If the payload is not a reader or valid buffer
|
1639 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
1640 | */
|
1641 | RecognitionConfig.decode = function decode(reader, length) {
|
1642 | if (!(reader instanceof $Reader))
|
1643 | reader = $Reader.create(reader);
|
1644 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.RecognitionConfig();
|
1645 | while (reader.pos < end) {
|
1646 | var tag = reader.uint32();
|
1647 | switch (tag >>> 3) {
|
1648 | case 1:
|
1649 | message.encoding = reader.int32();
|
1650 | break;
|
1651 | case 2:
|
1652 | message.sampleRateHertz = reader.int32();
|
1653 | break;
|
1654 | case 7:
|
1655 | message.audioChannelCount = reader.int32();
|
1656 | break;
|
1657 | case 12:
|
1658 | message.enableSeparateRecognitionPerChannel = reader.bool();
|
1659 | break;
|
1660 | case 3:
|
1661 | message.languageCode = reader.string();
|
1662 | break;
|
1663 | case 18:
|
1664 | if (!(message.alternativeLanguageCodes && message.alternativeLanguageCodes.length))
|
1665 | message.alternativeLanguageCodes = [];
|
1666 | message.alternativeLanguageCodes.push(reader.string());
|
1667 | break;
|
1668 | case 4:
|
1669 | message.maxAlternatives = reader.int32();
|
1670 | break;
|
1671 | case 5:
|
1672 | message.profanityFilter = reader.bool();
|
1673 | break;
|
1674 | case 20:
|
1675 | message.adaptation = $root.google.cloud.speech.v1.SpeechAdaptation.decode(reader, reader.uint32());
|
1676 | break;
|
1677 | case 6:
|
1678 | if (!(message.speechContexts && message.speechContexts.length))
|
1679 | message.speechContexts = [];
|
1680 | message.speechContexts.push($root.google.cloud.speech.v1.SpeechContext.decode(reader, reader.uint32()));
|
1681 | break;
|
1682 | case 8:
|
1683 | message.enableWordTimeOffsets = reader.bool();
|
1684 | break;
|
1685 | case 15:
|
1686 | message.enableWordConfidence = reader.bool();
|
1687 | break;
|
1688 | case 11:
|
1689 | message.enableAutomaticPunctuation = reader.bool();
|
1690 | break;
|
1691 | case 22:
|
1692 | message.enableSpokenPunctuation = $root.google.protobuf.BoolValue.decode(reader, reader.uint32());
|
1693 | break;
|
1694 | case 23:
|
1695 | message.enableSpokenEmojis = $root.google.protobuf.BoolValue.decode(reader, reader.uint32());
|
1696 | break;
|
1697 | case 19:
|
1698 | message.diarizationConfig = $root.google.cloud.speech.v1.SpeakerDiarizationConfig.decode(reader, reader.uint32());
|
1699 | break;
|
1700 | case 9:
|
1701 | message.metadata = $root.google.cloud.speech.v1.RecognitionMetadata.decode(reader, reader.uint32());
|
1702 | break;
|
1703 | case 13:
|
1704 | message.model = reader.string();
|
1705 | break;
|
1706 | case 14:
|
1707 | message.useEnhanced = reader.bool();
|
1708 | break;
|
1709 | default:
|
1710 | reader.skipType(tag & 7);
|
1711 | break;
|
1712 | }
|
1713 | }
|
1714 | return message;
|
1715 | };
|
1716 |
|
1717 | /**
|
1718 | * Decodes a RecognitionConfig message from the specified reader or buffer, length delimited.
|
1719 | * @function decodeDelimited
|
1720 | * @memberof google.cloud.speech.v1.RecognitionConfig
|
1721 | * @static
|
1722 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
1723 | * @returns {google.cloud.speech.v1.RecognitionConfig} RecognitionConfig
|
1724 | * @throws {Error} If the payload is not a reader or valid buffer
|
1725 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
1726 | */
|
1727 | RecognitionConfig.decodeDelimited = function decodeDelimited(reader) {
|
1728 | if (!(reader instanceof $Reader))
|
1729 | reader = new $Reader(reader);
|
1730 | return this.decode(reader, reader.uint32());
|
1731 | };
|
1732 |
|
1733 | /**
|
1734 | * Verifies a RecognitionConfig message.
|
1735 | * @function verify
|
1736 | * @memberof google.cloud.speech.v1.RecognitionConfig
|
1737 | * @static
|
1738 | * @param {Object.<string,*>} message Plain object to verify
|
1739 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
1740 | */
|
1741 | RecognitionConfig.verify = function verify(message) {
|
1742 | if (typeof message !== "object" || message === null)
|
1743 | return "object expected";
|
1744 | if (message.encoding != null && message.hasOwnProperty("encoding"))
|
1745 | switch (message.encoding) {
|
1746 | default:
|
1747 | return "encoding: enum value expected";
|
1748 | case 0:
|
1749 | case 1:
|
1750 | case 2:
|
1751 | case 3:
|
1752 | case 4:
|
1753 | case 5:
|
1754 | case 6:
|
1755 | case 7:
|
1756 | case 9:
|
1757 | break;
|
1758 | }
|
1759 | if (message.sampleRateHertz != null && message.hasOwnProperty("sampleRateHertz"))
|
1760 | if (!$util.isInteger(message.sampleRateHertz))
|
1761 | return "sampleRateHertz: integer expected";
|
1762 | if (message.audioChannelCount != null && message.hasOwnProperty("audioChannelCount"))
|
1763 | if (!$util.isInteger(message.audioChannelCount))
|
1764 | return "audioChannelCount: integer expected";
|
1765 | if (message.enableSeparateRecognitionPerChannel != null && message.hasOwnProperty("enableSeparateRecognitionPerChannel"))
|
1766 | if (typeof message.enableSeparateRecognitionPerChannel !== "boolean")
|
1767 | return "enableSeparateRecognitionPerChannel: boolean expected";
|
1768 | if (message.languageCode != null && message.hasOwnProperty("languageCode"))
|
1769 | if (!$util.isString(message.languageCode))
|
1770 | return "languageCode: string expected";
|
1771 | if (message.alternativeLanguageCodes != null && message.hasOwnProperty("alternativeLanguageCodes")) {
|
1772 | if (!Array.isArray(message.alternativeLanguageCodes))
|
1773 | return "alternativeLanguageCodes: array expected";
|
1774 | for (var i = 0; i < message.alternativeLanguageCodes.length; ++i)
|
1775 | if (!$util.isString(message.alternativeLanguageCodes[i]))
|
1776 | return "alternativeLanguageCodes: string[] expected";
|
1777 | }
|
1778 | if (message.maxAlternatives != null && message.hasOwnProperty("maxAlternatives"))
|
1779 | if (!$util.isInteger(message.maxAlternatives))
|
1780 | return "maxAlternatives: integer expected";
|
1781 | if (message.profanityFilter != null && message.hasOwnProperty("profanityFilter"))
|
1782 | if (typeof message.profanityFilter !== "boolean")
|
1783 | return "profanityFilter: boolean expected";
|
1784 | if (message.adaptation != null && message.hasOwnProperty("adaptation")) {
|
1785 | var error = $root.google.cloud.speech.v1.SpeechAdaptation.verify(message.adaptation);
|
1786 | if (error)
|
1787 | return "adaptation." + error;
|
1788 | }
|
1789 | if (message.speechContexts != null && message.hasOwnProperty("speechContexts")) {
|
1790 | if (!Array.isArray(message.speechContexts))
|
1791 | return "speechContexts: array expected";
|
1792 | for (var i = 0; i < message.speechContexts.length; ++i) {
|
1793 | var error = $root.google.cloud.speech.v1.SpeechContext.verify(message.speechContexts[i]);
|
1794 | if (error)
|
1795 | return "speechContexts." + error;
|
1796 | }
|
1797 | }
|
1798 | if (message.enableWordTimeOffsets != null && message.hasOwnProperty("enableWordTimeOffsets"))
|
1799 | if (typeof message.enableWordTimeOffsets !== "boolean")
|
1800 | return "enableWordTimeOffsets: boolean expected";
|
1801 | if (message.enableWordConfidence != null && message.hasOwnProperty("enableWordConfidence"))
|
1802 | if (typeof message.enableWordConfidence !== "boolean")
|
1803 | return "enableWordConfidence: boolean expected";
|
1804 | if (message.enableAutomaticPunctuation != null && message.hasOwnProperty("enableAutomaticPunctuation"))
|
1805 | if (typeof message.enableAutomaticPunctuation !== "boolean")
|
1806 | return "enableAutomaticPunctuation: boolean expected";
|
1807 | if (message.enableSpokenPunctuation != null && message.hasOwnProperty("enableSpokenPunctuation")) {
|
1808 | var error = $root.google.protobuf.BoolValue.verify(message.enableSpokenPunctuation);
|
1809 | if (error)
|
1810 | return "enableSpokenPunctuation." + error;
|
1811 | }
|
1812 | if (message.enableSpokenEmojis != null && message.hasOwnProperty("enableSpokenEmojis")) {
|
1813 | var error = $root.google.protobuf.BoolValue.verify(message.enableSpokenEmojis);
|
1814 | if (error)
|
1815 | return "enableSpokenEmojis." + error;
|
1816 | }
|
1817 | if (message.diarizationConfig != null && message.hasOwnProperty("diarizationConfig")) {
|
1818 | var error = $root.google.cloud.speech.v1.SpeakerDiarizationConfig.verify(message.diarizationConfig);
|
1819 | if (error)
|
1820 | return "diarizationConfig." + error;
|
1821 | }
|
1822 | if (message.metadata != null && message.hasOwnProperty("metadata")) {
|
1823 | var error = $root.google.cloud.speech.v1.RecognitionMetadata.verify(message.metadata);
|
1824 | if (error)
|
1825 | return "metadata." + error;
|
1826 | }
|
1827 | if (message.model != null && message.hasOwnProperty("model"))
|
1828 | if (!$util.isString(message.model))
|
1829 | return "model: string expected";
|
1830 | if (message.useEnhanced != null && message.hasOwnProperty("useEnhanced"))
|
1831 | if (typeof message.useEnhanced !== "boolean")
|
1832 | return "useEnhanced: boolean expected";
|
1833 | return null;
|
1834 | };
|
1835 |
|
1836 | /**
|
1837 | * Creates a RecognitionConfig message from a plain object. Also converts values to their respective internal types.
|
1838 | * @function fromObject
|
1839 | * @memberof google.cloud.speech.v1.RecognitionConfig
|
1840 | * @static
|
1841 | * @param {Object.<string,*>} object Plain object
|
1842 | * @returns {google.cloud.speech.v1.RecognitionConfig} RecognitionConfig
|
1843 | */
|
1844 | RecognitionConfig.fromObject = function fromObject(object) {
|
1845 | if (object instanceof $root.google.cloud.speech.v1.RecognitionConfig)
|
1846 | return object;
|
1847 | var message = new $root.google.cloud.speech.v1.RecognitionConfig();
|
1848 | switch (object.encoding) {
|
1849 | case "ENCODING_UNSPECIFIED":
|
1850 | case 0:
|
1851 | message.encoding = 0;
|
1852 | break;
|
1853 | case "LINEAR16":
|
1854 | case 1:
|
1855 | message.encoding = 1;
|
1856 | break;
|
1857 | case "FLAC":
|
1858 | case 2:
|
1859 | message.encoding = 2;
|
1860 | break;
|
1861 | case "MULAW":
|
1862 | case 3:
|
1863 | message.encoding = 3;
|
1864 | break;
|
1865 | case "AMR":
|
1866 | case 4:
|
1867 | message.encoding = 4;
|
1868 | break;
|
1869 | case "AMR_WB":
|
1870 | case 5:
|
1871 | message.encoding = 5;
|
1872 | break;
|
1873 | case "OGG_OPUS":
|
1874 | case 6:
|
1875 | message.encoding = 6;
|
1876 | break;
|
1877 | case "SPEEX_WITH_HEADER_BYTE":
|
1878 | case 7:
|
1879 | message.encoding = 7;
|
1880 | break;
|
1881 | case "WEBM_OPUS":
|
1882 | case 9:
|
1883 | message.encoding = 9;
|
1884 | break;
|
1885 | }
|
1886 | if (object.sampleRateHertz != null)
|
1887 | message.sampleRateHertz = object.sampleRateHertz | 0;
|
1888 | if (object.audioChannelCount != null)
|
1889 | message.audioChannelCount = object.audioChannelCount | 0;
|
1890 | if (object.enableSeparateRecognitionPerChannel != null)
|
1891 | message.enableSeparateRecognitionPerChannel = Boolean(object.enableSeparateRecognitionPerChannel);
|
1892 | if (object.languageCode != null)
|
1893 | message.languageCode = String(object.languageCode);
|
1894 | if (object.alternativeLanguageCodes) {
|
1895 | if (!Array.isArray(object.alternativeLanguageCodes))
|
1896 | throw TypeError(".google.cloud.speech.v1.RecognitionConfig.alternativeLanguageCodes: array expected");
|
1897 | message.alternativeLanguageCodes = [];
|
1898 | for (var i = 0; i < object.alternativeLanguageCodes.length; ++i)
|
1899 | message.alternativeLanguageCodes[i] = String(object.alternativeLanguageCodes[i]);
|
1900 | }
|
1901 | if (object.maxAlternatives != null)
|
1902 | message.maxAlternatives = object.maxAlternatives | 0;
|
1903 | if (object.profanityFilter != null)
|
1904 | message.profanityFilter = Boolean(object.profanityFilter);
|
1905 | if (object.adaptation != null) {
|
1906 | if (typeof object.adaptation !== "object")
|
1907 | throw TypeError(".google.cloud.speech.v1.RecognitionConfig.adaptation: object expected");
|
1908 | message.adaptation = $root.google.cloud.speech.v1.SpeechAdaptation.fromObject(object.adaptation);
|
1909 | }
|
1910 | if (object.speechContexts) {
|
1911 | if (!Array.isArray(object.speechContexts))
|
1912 | throw TypeError(".google.cloud.speech.v1.RecognitionConfig.speechContexts: array expected");
|
1913 | message.speechContexts = [];
|
1914 | for (var i = 0; i < object.speechContexts.length; ++i) {
|
1915 | if (typeof object.speechContexts[i] !== "object")
|
1916 | throw TypeError(".google.cloud.speech.v1.RecognitionConfig.speechContexts: object expected");
|
1917 | message.speechContexts[i] = $root.google.cloud.speech.v1.SpeechContext.fromObject(object.speechContexts[i]);
|
1918 | }
|
1919 | }
|
1920 | if (object.enableWordTimeOffsets != null)
|
1921 | message.enableWordTimeOffsets = Boolean(object.enableWordTimeOffsets);
|
1922 | if (object.enableWordConfidence != null)
|
1923 | message.enableWordConfidence = Boolean(object.enableWordConfidence);
|
1924 | if (object.enableAutomaticPunctuation != null)
|
1925 | message.enableAutomaticPunctuation = Boolean(object.enableAutomaticPunctuation);
|
1926 | if (object.enableSpokenPunctuation != null) {
|
1927 | if (typeof object.enableSpokenPunctuation !== "object")
|
1928 | throw TypeError(".google.cloud.speech.v1.RecognitionConfig.enableSpokenPunctuation: object expected");
|
1929 | message.enableSpokenPunctuation = $root.google.protobuf.BoolValue.fromObject(object.enableSpokenPunctuation);
|
1930 | }
|
1931 | if (object.enableSpokenEmojis != null) {
|
1932 | if (typeof object.enableSpokenEmojis !== "object")
|
1933 | throw TypeError(".google.cloud.speech.v1.RecognitionConfig.enableSpokenEmojis: object expected");
|
1934 | message.enableSpokenEmojis = $root.google.protobuf.BoolValue.fromObject(object.enableSpokenEmojis);
|
1935 | }
|
1936 | if (object.diarizationConfig != null) {
|
1937 | if (typeof object.diarizationConfig !== "object")
|
1938 | throw TypeError(".google.cloud.speech.v1.RecognitionConfig.diarizationConfig: object expected");
|
1939 | message.diarizationConfig = $root.google.cloud.speech.v1.SpeakerDiarizationConfig.fromObject(object.diarizationConfig);
|
1940 | }
|
1941 | if (object.metadata != null) {
|
1942 | if (typeof object.metadata !== "object")
|
1943 | throw TypeError(".google.cloud.speech.v1.RecognitionConfig.metadata: object expected");
|
1944 | message.metadata = $root.google.cloud.speech.v1.RecognitionMetadata.fromObject(object.metadata);
|
1945 | }
|
1946 | if (object.model != null)
|
1947 | message.model = String(object.model);
|
1948 | if (object.useEnhanced != null)
|
1949 | message.useEnhanced = Boolean(object.useEnhanced);
|
1950 | return message;
|
1951 | };
|
1952 |
|
1953 | /**
|
1954 | * Creates a plain object from a RecognitionConfig message. Also converts values to other types if specified.
|
1955 | * @function toObject
|
1956 | * @memberof google.cloud.speech.v1.RecognitionConfig
|
1957 | * @static
|
1958 | * @param {google.cloud.speech.v1.RecognitionConfig} message RecognitionConfig
|
1959 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
1960 | * @returns {Object.<string,*>} Plain object
|
1961 | */
|
1962 | RecognitionConfig.toObject = function toObject(message, options) {
|
1963 | if (!options)
|
1964 | options = {};
|
1965 | var object = {};
|
1966 | if (options.arrays || options.defaults) {
|
1967 | object.speechContexts = [];
|
1968 | object.alternativeLanguageCodes = [];
|
1969 | }
|
1970 | if (options.defaults) {
|
1971 | object.encoding = options.enums === String ? "ENCODING_UNSPECIFIED" : 0;
|
1972 | object.sampleRateHertz = 0;
|
1973 | object.languageCode = "";
|
1974 | object.maxAlternatives = 0;
|
1975 | object.profanityFilter = false;
|
1976 | object.audioChannelCount = 0;
|
1977 | object.enableWordTimeOffsets = false;
|
1978 | object.metadata = null;
|
1979 | object.enableAutomaticPunctuation = false;
|
1980 | object.enableSeparateRecognitionPerChannel = false;
|
1981 | object.model = "";
|
1982 | object.useEnhanced = false;
|
1983 | object.enableWordConfidence = false;
|
1984 | object.diarizationConfig = null;
|
1985 | object.adaptation = null;
|
1986 | object.enableSpokenPunctuation = null;
|
1987 | object.enableSpokenEmojis = null;
|
1988 | }
|
1989 | if (message.encoding != null && message.hasOwnProperty("encoding"))
|
1990 | object.encoding = options.enums === String ? $root.google.cloud.speech.v1.RecognitionConfig.AudioEncoding[message.encoding] : message.encoding;
|
1991 | if (message.sampleRateHertz != null && message.hasOwnProperty("sampleRateHertz"))
|
1992 | object.sampleRateHertz = message.sampleRateHertz;
|
1993 | if (message.languageCode != null && message.hasOwnProperty("languageCode"))
|
1994 | object.languageCode = message.languageCode;
|
1995 | if (message.maxAlternatives != null && message.hasOwnProperty("maxAlternatives"))
|
1996 | object.maxAlternatives = message.maxAlternatives;
|
1997 | if (message.profanityFilter != null && message.hasOwnProperty("profanityFilter"))
|
1998 | object.profanityFilter = message.profanityFilter;
|
1999 | if (message.speechContexts && message.speechContexts.length) {
|
2000 | object.speechContexts = [];
|
2001 | for (var j = 0; j < message.speechContexts.length; ++j)
|
2002 | object.speechContexts[j] = $root.google.cloud.speech.v1.SpeechContext.toObject(message.speechContexts[j], options);
|
2003 | }
|
2004 | if (message.audioChannelCount != null && message.hasOwnProperty("audioChannelCount"))
|
2005 | object.audioChannelCount = message.audioChannelCount;
|
2006 | if (message.enableWordTimeOffsets != null && message.hasOwnProperty("enableWordTimeOffsets"))
|
2007 | object.enableWordTimeOffsets = message.enableWordTimeOffsets;
|
2008 | if (message.metadata != null && message.hasOwnProperty("metadata"))
|
2009 | object.metadata = $root.google.cloud.speech.v1.RecognitionMetadata.toObject(message.metadata, options);
|
2010 | if (message.enableAutomaticPunctuation != null && message.hasOwnProperty("enableAutomaticPunctuation"))
|
2011 | object.enableAutomaticPunctuation = message.enableAutomaticPunctuation;
|
2012 | if (message.enableSeparateRecognitionPerChannel != null && message.hasOwnProperty("enableSeparateRecognitionPerChannel"))
|
2013 | object.enableSeparateRecognitionPerChannel = message.enableSeparateRecognitionPerChannel;
|
2014 | if (message.model != null && message.hasOwnProperty("model"))
|
2015 | object.model = message.model;
|
2016 | if (message.useEnhanced != null && message.hasOwnProperty("useEnhanced"))
|
2017 | object.useEnhanced = message.useEnhanced;
|
2018 | if (message.enableWordConfidence != null && message.hasOwnProperty("enableWordConfidence"))
|
2019 | object.enableWordConfidence = message.enableWordConfidence;
|
2020 | if (message.alternativeLanguageCodes && message.alternativeLanguageCodes.length) {
|
2021 | object.alternativeLanguageCodes = [];
|
2022 | for (var j = 0; j < message.alternativeLanguageCodes.length; ++j)
|
2023 | object.alternativeLanguageCodes[j] = message.alternativeLanguageCodes[j];
|
2024 | }
|
2025 | if (message.diarizationConfig != null && message.hasOwnProperty("diarizationConfig"))
|
2026 | object.diarizationConfig = $root.google.cloud.speech.v1.SpeakerDiarizationConfig.toObject(message.diarizationConfig, options);
|
2027 | if (message.adaptation != null && message.hasOwnProperty("adaptation"))
|
2028 | object.adaptation = $root.google.cloud.speech.v1.SpeechAdaptation.toObject(message.adaptation, options);
|
2029 | if (message.enableSpokenPunctuation != null && message.hasOwnProperty("enableSpokenPunctuation"))
|
2030 | object.enableSpokenPunctuation = $root.google.protobuf.BoolValue.toObject(message.enableSpokenPunctuation, options);
|
2031 | if (message.enableSpokenEmojis != null && message.hasOwnProperty("enableSpokenEmojis"))
|
2032 | object.enableSpokenEmojis = $root.google.protobuf.BoolValue.toObject(message.enableSpokenEmojis, options);
|
2033 | return object;
|
2034 | };
|
2035 |
|
2036 | /**
|
2037 | * Converts this RecognitionConfig to JSON.
|
2038 | * @function toJSON
|
2039 | * @memberof google.cloud.speech.v1.RecognitionConfig
|
2040 | * @instance
|
2041 | * @returns {Object.<string,*>} JSON object
|
2042 | */
|
2043 | RecognitionConfig.prototype.toJSON = function toJSON() {
|
2044 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
2045 | };
|
2046 |
|
2047 | /**
|
2048 | * AudioEncoding enum.
|
2049 | * @name google.cloud.speech.v1.RecognitionConfig.AudioEncoding
|
2050 | * @enum {number}
|
2051 | * @property {number} ENCODING_UNSPECIFIED=0 ENCODING_UNSPECIFIED value
|
2052 | * @property {number} LINEAR16=1 LINEAR16 value
|
2053 | * @property {number} FLAC=2 FLAC value
|
2054 | * @property {number} MULAW=3 MULAW value
|
2055 | * @property {number} AMR=4 AMR value
|
2056 | * @property {number} AMR_WB=5 AMR_WB value
|
2057 | * @property {number} OGG_OPUS=6 OGG_OPUS value
|
2058 | * @property {number} SPEEX_WITH_HEADER_BYTE=7 SPEEX_WITH_HEADER_BYTE value
|
2059 | * @property {number} WEBM_OPUS=9 WEBM_OPUS value
|
2060 | */
|
2061 | RecognitionConfig.AudioEncoding = (function() {
|
2062 | var valuesById = {}, values = Object.create(valuesById);
|
2063 | values[valuesById[0] = "ENCODING_UNSPECIFIED"] = 0;
|
2064 | values[valuesById[1] = "LINEAR16"] = 1;
|
2065 | values[valuesById[2] = "FLAC"] = 2;
|
2066 | values[valuesById[3] = "MULAW"] = 3;
|
2067 | values[valuesById[4] = "AMR"] = 4;
|
2068 | values[valuesById[5] = "AMR_WB"] = 5;
|
2069 | values[valuesById[6] = "OGG_OPUS"] = 6;
|
2070 | values[valuesById[7] = "SPEEX_WITH_HEADER_BYTE"] = 7;
|
2071 | values[valuesById[9] = "WEBM_OPUS"] = 9;
|
2072 | return values;
|
2073 | })();
|
2074 |
|
2075 | return RecognitionConfig;
|
2076 | })();
|
2077 |
|
2078 | v1.SpeakerDiarizationConfig = (function() {
|
2079 |
|
2080 | /**
|
2081 | * Properties of a SpeakerDiarizationConfig.
|
2082 | * @memberof google.cloud.speech.v1
|
2083 | * @interface ISpeakerDiarizationConfig
|
2084 | * @property {boolean|null} [enableSpeakerDiarization] SpeakerDiarizationConfig enableSpeakerDiarization
|
2085 | * @property {number|null} [minSpeakerCount] SpeakerDiarizationConfig minSpeakerCount
|
2086 | * @property {number|null} [maxSpeakerCount] SpeakerDiarizationConfig maxSpeakerCount
|
2087 | * @property {number|null} [speakerTag] SpeakerDiarizationConfig speakerTag
|
2088 | */
|
2089 |
|
2090 | /**
|
2091 | * Constructs a new SpeakerDiarizationConfig.
|
2092 | * @memberof google.cloud.speech.v1
|
2093 | * @classdesc Represents a SpeakerDiarizationConfig.
|
2094 | * @implements ISpeakerDiarizationConfig
|
2095 | * @constructor
|
2096 | * @param {google.cloud.speech.v1.ISpeakerDiarizationConfig=} [properties] Properties to set
|
2097 | */
|
2098 | function SpeakerDiarizationConfig(properties) {
|
2099 | if (properties)
|
2100 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
2101 | if (properties[keys[i]] != null)
|
2102 | this[keys[i]] = properties[keys[i]];
|
2103 | }
|
2104 |
|
2105 | /**
|
2106 | * SpeakerDiarizationConfig enableSpeakerDiarization.
|
2107 | * @member {boolean} enableSpeakerDiarization
|
2108 | * @memberof google.cloud.speech.v1.SpeakerDiarizationConfig
|
2109 | * @instance
|
2110 | */
|
2111 | SpeakerDiarizationConfig.prototype.enableSpeakerDiarization = false;
|
2112 |
|
2113 | /**
|
2114 | * SpeakerDiarizationConfig minSpeakerCount.
|
2115 | * @member {number} minSpeakerCount
|
2116 | * @memberof google.cloud.speech.v1.SpeakerDiarizationConfig
|
2117 | * @instance
|
2118 | */
|
2119 | SpeakerDiarizationConfig.prototype.minSpeakerCount = 0;
|
2120 |
|
2121 | /**
|
2122 | * SpeakerDiarizationConfig maxSpeakerCount.
|
2123 | * @member {number} maxSpeakerCount
|
2124 | * @memberof google.cloud.speech.v1.SpeakerDiarizationConfig
|
2125 | * @instance
|
2126 | */
|
2127 | SpeakerDiarizationConfig.prototype.maxSpeakerCount = 0;
|
2128 |
|
2129 | /**
|
2130 | * SpeakerDiarizationConfig speakerTag.
|
2131 | * @member {number} speakerTag
|
2132 | * @memberof google.cloud.speech.v1.SpeakerDiarizationConfig
|
2133 | * @instance
|
2134 | */
|
2135 | SpeakerDiarizationConfig.prototype.speakerTag = 0;
|
2136 |
|
2137 | /**
|
2138 | * Creates a new SpeakerDiarizationConfig instance using the specified properties.
|
2139 | * @function create
|
2140 | * @memberof google.cloud.speech.v1.SpeakerDiarizationConfig
|
2141 | * @static
|
2142 | * @param {google.cloud.speech.v1.ISpeakerDiarizationConfig=} [properties] Properties to set
|
2143 | * @returns {google.cloud.speech.v1.SpeakerDiarizationConfig} SpeakerDiarizationConfig instance
|
2144 | */
|
2145 | SpeakerDiarizationConfig.create = function create(properties) {
|
2146 | return new SpeakerDiarizationConfig(properties);
|
2147 | };
|
2148 |
|
2149 | /**
|
2150 | * Encodes the specified SpeakerDiarizationConfig message. Does not implicitly {@link google.cloud.speech.v1.SpeakerDiarizationConfig.verify|verify} messages.
|
2151 | * @function encode
|
2152 | * @memberof google.cloud.speech.v1.SpeakerDiarizationConfig
|
2153 | * @static
|
2154 | * @param {google.cloud.speech.v1.ISpeakerDiarizationConfig} message SpeakerDiarizationConfig message or plain object to encode
|
2155 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
2156 | * @returns {$protobuf.Writer} Writer
|
2157 | */
|
2158 | SpeakerDiarizationConfig.encode = function encode(message, writer) {
|
2159 | if (!writer)
|
2160 | writer = $Writer.create();
|
2161 | if (message.enableSpeakerDiarization != null && Object.hasOwnProperty.call(message, "enableSpeakerDiarization"))
|
2162 | writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enableSpeakerDiarization);
|
2163 | if (message.minSpeakerCount != null && Object.hasOwnProperty.call(message, "minSpeakerCount"))
|
2164 | writer.uint32(/* id 2, wireType 0 =*/16).int32(message.minSpeakerCount);
|
2165 | if (message.maxSpeakerCount != null && Object.hasOwnProperty.call(message, "maxSpeakerCount"))
|
2166 | writer.uint32(/* id 3, wireType 0 =*/24).int32(message.maxSpeakerCount);
|
2167 | if (message.speakerTag != null && Object.hasOwnProperty.call(message, "speakerTag"))
|
2168 | writer.uint32(/* id 5, wireType 0 =*/40).int32(message.speakerTag);
|
2169 | return writer;
|
2170 | };
|
2171 |
|
2172 | /**
|
2173 | * Encodes the specified SpeakerDiarizationConfig message, length delimited. Does not implicitly {@link google.cloud.speech.v1.SpeakerDiarizationConfig.verify|verify} messages.
|
2174 | * @function encodeDelimited
|
2175 | * @memberof google.cloud.speech.v1.SpeakerDiarizationConfig
|
2176 | * @static
|
2177 | * @param {google.cloud.speech.v1.ISpeakerDiarizationConfig} message SpeakerDiarizationConfig message or plain object to encode
|
2178 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
2179 | * @returns {$protobuf.Writer} Writer
|
2180 | */
|
2181 | SpeakerDiarizationConfig.encodeDelimited = function encodeDelimited(message, writer) {
|
2182 | return this.encode(message, writer).ldelim();
|
2183 | };
|
2184 |
|
2185 | /**
|
2186 | * Decodes a SpeakerDiarizationConfig message from the specified reader or buffer.
|
2187 | * @function decode
|
2188 | * @memberof google.cloud.speech.v1.SpeakerDiarizationConfig
|
2189 | * @static
|
2190 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
2191 | * @param {number} [length] Message length if known beforehand
|
2192 | * @returns {google.cloud.speech.v1.SpeakerDiarizationConfig} SpeakerDiarizationConfig
|
2193 | * @throws {Error} If the payload is not a reader or valid buffer
|
2194 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
2195 | */
|
2196 | SpeakerDiarizationConfig.decode = function decode(reader, length) {
|
2197 | if (!(reader instanceof $Reader))
|
2198 | reader = $Reader.create(reader);
|
2199 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.SpeakerDiarizationConfig();
|
2200 | while (reader.pos < end) {
|
2201 | var tag = reader.uint32();
|
2202 | switch (tag >>> 3) {
|
2203 | case 1:
|
2204 | message.enableSpeakerDiarization = reader.bool();
|
2205 | break;
|
2206 | case 2:
|
2207 | message.minSpeakerCount = reader.int32();
|
2208 | break;
|
2209 | case 3:
|
2210 | message.maxSpeakerCount = reader.int32();
|
2211 | break;
|
2212 | case 5:
|
2213 | message.speakerTag = reader.int32();
|
2214 | break;
|
2215 | default:
|
2216 | reader.skipType(tag & 7);
|
2217 | break;
|
2218 | }
|
2219 | }
|
2220 | return message;
|
2221 | };
|
2222 |
|
2223 | /**
|
2224 | * Decodes a SpeakerDiarizationConfig message from the specified reader or buffer, length delimited.
|
2225 | * @function decodeDelimited
|
2226 | * @memberof google.cloud.speech.v1.SpeakerDiarizationConfig
|
2227 | * @static
|
2228 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
2229 | * @returns {google.cloud.speech.v1.SpeakerDiarizationConfig} SpeakerDiarizationConfig
|
2230 | * @throws {Error} If the payload is not a reader or valid buffer
|
2231 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
2232 | */
|
2233 | SpeakerDiarizationConfig.decodeDelimited = function decodeDelimited(reader) {
|
2234 | if (!(reader instanceof $Reader))
|
2235 | reader = new $Reader(reader);
|
2236 | return this.decode(reader, reader.uint32());
|
2237 | };
|
2238 |
|
2239 | /**
|
2240 | * Verifies a SpeakerDiarizationConfig message.
|
2241 | * @function verify
|
2242 | * @memberof google.cloud.speech.v1.SpeakerDiarizationConfig
|
2243 | * @static
|
2244 | * @param {Object.<string,*>} message Plain object to verify
|
2245 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
2246 | */
|
2247 | SpeakerDiarizationConfig.verify = function verify(message) {
|
2248 | if (typeof message !== "object" || message === null)
|
2249 | return "object expected";
|
2250 | if (message.enableSpeakerDiarization != null && message.hasOwnProperty("enableSpeakerDiarization"))
|
2251 | if (typeof message.enableSpeakerDiarization !== "boolean")
|
2252 | return "enableSpeakerDiarization: boolean expected";
|
2253 | if (message.minSpeakerCount != null && message.hasOwnProperty("minSpeakerCount"))
|
2254 | if (!$util.isInteger(message.minSpeakerCount))
|
2255 | return "minSpeakerCount: integer expected";
|
2256 | if (message.maxSpeakerCount != null && message.hasOwnProperty("maxSpeakerCount"))
|
2257 | if (!$util.isInteger(message.maxSpeakerCount))
|
2258 | return "maxSpeakerCount: integer expected";
|
2259 | if (message.speakerTag != null && message.hasOwnProperty("speakerTag"))
|
2260 | if (!$util.isInteger(message.speakerTag))
|
2261 | return "speakerTag: integer expected";
|
2262 | return null;
|
2263 | };
|
2264 |
|
2265 | /**
|
2266 | * Creates a SpeakerDiarizationConfig message from a plain object. Also converts values to their respective internal types.
|
2267 | * @function fromObject
|
2268 | * @memberof google.cloud.speech.v1.SpeakerDiarizationConfig
|
2269 | * @static
|
2270 | * @param {Object.<string,*>} object Plain object
|
2271 | * @returns {google.cloud.speech.v1.SpeakerDiarizationConfig} SpeakerDiarizationConfig
|
2272 | */
|
2273 | SpeakerDiarizationConfig.fromObject = function fromObject(object) {
|
2274 | if (object instanceof $root.google.cloud.speech.v1.SpeakerDiarizationConfig)
|
2275 | return object;
|
2276 | var message = new $root.google.cloud.speech.v1.SpeakerDiarizationConfig();
|
2277 | if (object.enableSpeakerDiarization != null)
|
2278 | message.enableSpeakerDiarization = Boolean(object.enableSpeakerDiarization);
|
2279 | if (object.minSpeakerCount != null)
|
2280 | message.minSpeakerCount = object.minSpeakerCount | 0;
|
2281 | if (object.maxSpeakerCount != null)
|
2282 | message.maxSpeakerCount = object.maxSpeakerCount | 0;
|
2283 | if (object.speakerTag != null)
|
2284 | message.speakerTag = object.speakerTag | 0;
|
2285 | return message;
|
2286 | };
|
2287 |
|
2288 | /**
|
2289 | * Creates a plain object from a SpeakerDiarizationConfig message. Also converts values to other types if specified.
|
2290 | * @function toObject
|
2291 | * @memberof google.cloud.speech.v1.SpeakerDiarizationConfig
|
2292 | * @static
|
2293 | * @param {google.cloud.speech.v1.SpeakerDiarizationConfig} message SpeakerDiarizationConfig
|
2294 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
2295 | * @returns {Object.<string,*>} Plain object
|
2296 | */
|
2297 | SpeakerDiarizationConfig.toObject = function toObject(message, options) {
|
2298 | if (!options)
|
2299 | options = {};
|
2300 | var object = {};
|
2301 | if (options.defaults) {
|
2302 | object.enableSpeakerDiarization = false;
|
2303 | object.minSpeakerCount = 0;
|
2304 | object.maxSpeakerCount = 0;
|
2305 | object.speakerTag = 0;
|
2306 | }
|
2307 | if (message.enableSpeakerDiarization != null && message.hasOwnProperty("enableSpeakerDiarization"))
|
2308 | object.enableSpeakerDiarization = message.enableSpeakerDiarization;
|
2309 | if (message.minSpeakerCount != null && message.hasOwnProperty("minSpeakerCount"))
|
2310 | object.minSpeakerCount = message.minSpeakerCount;
|
2311 | if (message.maxSpeakerCount != null && message.hasOwnProperty("maxSpeakerCount"))
|
2312 | object.maxSpeakerCount = message.maxSpeakerCount;
|
2313 | if (message.speakerTag != null && message.hasOwnProperty("speakerTag"))
|
2314 | object.speakerTag = message.speakerTag;
|
2315 | return object;
|
2316 | };
|
2317 |
|
2318 | /**
|
2319 | * Converts this SpeakerDiarizationConfig to JSON.
|
2320 | * @function toJSON
|
2321 | * @memberof google.cloud.speech.v1.SpeakerDiarizationConfig
|
2322 | * @instance
|
2323 | * @returns {Object.<string,*>} JSON object
|
2324 | */
|
2325 | SpeakerDiarizationConfig.prototype.toJSON = function toJSON() {
|
2326 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
2327 | };
|
2328 |
|
2329 | return SpeakerDiarizationConfig;
|
2330 | })();
|
2331 |
|
2332 | v1.RecognitionMetadata = (function() {
|
2333 |
|
2334 | /**
|
2335 | * Properties of a RecognitionMetadata.
|
2336 | * @memberof google.cloud.speech.v1
|
2337 | * @interface IRecognitionMetadata
|
2338 | * @property {google.cloud.speech.v1.RecognitionMetadata.InteractionType|null} [interactionType] RecognitionMetadata interactionType
|
2339 | * @property {number|null} [industryNaicsCodeOfAudio] RecognitionMetadata industryNaicsCodeOfAudio
|
2340 | * @property {google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance|null} [microphoneDistance] RecognitionMetadata microphoneDistance
|
2341 | * @property {google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType|null} [originalMediaType] RecognitionMetadata originalMediaType
|
2342 | * @property {google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType|null} [recordingDeviceType] RecognitionMetadata recordingDeviceType
|
2343 | * @property {string|null} [recordingDeviceName] RecognitionMetadata recordingDeviceName
|
2344 | * @property {string|null} [originalMimeType] RecognitionMetadata originalMimeType
|
2345 | * @property {string|null} [audioTopic] RecognitionMetadata audioTopic
|
2346 | */
|
2347 |
|
2348 | /**
|
2349 | * Constructs a new RecognitionMetadata.
|
2350 | * @memberof google.cloud.speech.v1
|
2351 | * @classdesc Represents a RecognitionMetadata.
|
2352 | * @implements IRecognitionMetadata
|
2353 | * @constructor
|
2354 | * @param {google.cloud.speech.v1.IRecognitionMetadata=} [properties] Properties to set
|
2355 | */
|
2356 | function RecognitionMetadata(properties) {
|
2357 | if (properties)
|
2358 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
2359 | if (properties[keys[i]] != null)
|
2360 | this[keys[i]] = properties[keys[i]];
|
2361 | }
|
2362 |
|
2363 | /**
|
2364 | * RecognitionMetadata interactionType.
|
2365 | * @member {google.cloud.speech.v1.RecognitionMetadata.InteractionType} interactionType
|
2366 | * @memberof google.cloud.speech.v1.RecognitionMetadata
|
2367 | * @instance
|
2368 | */
|
2369 | RecognitionMetadata.prototype.interactionType = 0;
|
2370 |
|
2371 | /**
|
2372 | * RecognitionMetadata industryNaicsCodeOfAudio.
|
2373 | * @member {number} industryNaicsCodeOfAudio
|
2374 | * @memberof google.cloud.speech.v1.RecognitionMetadata
|
2375 | * @instance
|
2376 | */
|
2377 | RecognitionMetadata.prototype.industryNaicsCodeOfAudio = 0;
|
2378 |
|
2379 | /**
|
2380 | * RecognitionMetadata microphoneDistance.
|
2381 | * @member {google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance} microphoneDistance
|
2382 | * @memberof google.cloud.speech.v1.RecognitionMetadata
|
2383 | * @instance
|
2384 | */
|
2385 | RecognitionMetadata.prototype.microphoneDistance = 0;
|
2386 |
|
2387 | /**
|
2388 | * RecognitionMetadata originalMediaType.
|
2389 | * @member {google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType} originalMediaType
|
2390 | * @memberof google.cloud.speech.v1.RecognitionMetadata
|
2391 | * @instance
|
2392 | */
|
2393 | RecognitionMetadata.prototype.originalMediaType = 0;
|
2394 |
|
2395 | /**
|
2396 | * RecognitionMetadata recordingDeviceType.
|
2397 | * @member {google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType} recordingDeviceType
|
2398 | * @memberof google.cloud.speech.v1.RecognitionMetadata
|
2399 | * @instance
|
2400 | */
|
2401 | RecognitionMetadata.prototype.recordingDeviceType = 0;
|
2402 |
|
2403 | /**
|
2404 | * RecognitionMetadata recordingDeviceName.
|
2405 | * @member {string} recordingDeviceName
|
2406 | * @memberof google.cloud.speech.v1.RecognitionMetadata
|
2407 | * @instance
|
2408 | */
|
2409 | RecognitionMetadata.prototype.recordingDeviceName = "";
|
2410 |
|
2411 | /**
|
2412 | * RecognitionMetadata originalMimeType.
|
2413 | * @member {string} originalMimeType
|
2414 | * @memberof google.cloud.speech.v1.RecognitionMetadata
|
2415 | * @instance
|
2416 | */
|
2417 | RecognitionMetadata.prototype.originalMimeType = "";
|
2418 |
|
2419 | /**
|
2420 | * RecognitionMetadata audioTopic.
|
2421 | * @member {string} audioTopic
|
2422 | * @memberof google.cloud.speech.v1.RecognitionMetadata
|
2423 | * @instance
|
2424 | */
|
2425 | RecognitionMetadata.prototype.audioTopic = "";
|
2426 |
|
2427 | /**
|
2428 | * Creates a new RecognitionMetadata instance using the specified properties.
|
2429 | * @function create
|
2430 | * @memberof google.cloud.speech.v1.RecognitionMetadata
|
2431 | * @static
|
2432 | * @param {google.cloud.speech.v1.IRecognitionMetadata=} [properties] Properties to set
|
2433 | * @returns {google.cloud.speech.v1.RecognitionMetadata} RecognitionMetadata instance
|
2434 | */
|
2435 | RecognitionMetadata.create = function create(properties) {
|
2436 | return new RecognitionMetadata(properties);
|
2437 | };
|
2438 |
|
2439 | /**
|
2440 | * Encodes the specified RecognitionMetadata message. Does not implicitly {@link google.cloud.speech.v1.RecognitionMetadata.verify|verify} messages.
|
2441 | * @function encode
|
2442 | * @memberof google.cloud.speech.v1.RecognitionMetadata
|
2443 | * @static
|
2444 | * @param {google.cloud.speech.v1.IRecognitionMetadata} message RecognitionMetadata message or plain object to encode
|
2445 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
2446 | * @returns {$protobuf.Writer} Writer
|
2447 | */
|
2448 | RecognitionMetadata.encode = function encode(message, writer) {
|
2449 | if (!writer)
|
2450 | writer = $Writer.create();
|
2451 | if (message.interactionType != null && Object.hasOwnProperty.call(message, "interactionType"))
|
2452 | writer.uint32(/* id 1, wireType 0 =*/8).int32(message.interactionType);
|
2453 | if (message.industryNaicsCodeOfAudio != null && Object.hasOwnProperty.call(message, "industryNaicsCodeOfAudio"))
|
2454 | writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.industryNaicsCodeOfAudio);
|
2455 | if (message.microphoneDistance != null && Object.hasOwnProperty.call(message, "microphoneDistance"))
|
2456 | writer.uint32(/* id 4, wireType 0 =*/32).int32(message.microphoneDistance);
|
2457 | if (message.originalMediaType != null && Object.hasOwnProperty.call(message, "originalMediaType"))
|
2458 | writer.uint32(/* id 5, wireType 0 =*/40).int32(message.originalMediaType);
|
2459 | if (message.recordingDeviceType != null && Object.hasOwnProperty.call(message, "recordingDeviceType"))
|
2460 | writer.uint32(/* id 6, wireType 0 =*/48).int32(message.recordingDeviceType);
|
2461 | if (message.recordingDeviceName != null && Object.hasOwnProperty.call(message, "recordingDeviceName"))
|
2462 | writer.uint32(/* id 7, wireType 2 =*/58).string(message.recordingDeviceName);
|
2463 | if (message.originalMimeType != null && Object.hasOwnProperty.call(message, "originalMimeType"))
|
2464 | writer.uint32(/* id 8, wireType 2 =*/66).string(message.originalMimeType);
|
2465 | if (message.audioTopic != null && Object.hasOwnProperty.call(message, "audioTopic"))
|
2466 | writer.uint32(/* id 10, wireType 2 =*/82).string(message.audioTopic);
|
2467 | return writer;
|
2468 | };
|
2469 |
|
2470 | /**
|
2471 | * Encodes the specified RecognitionMetadata message, length delimited. Does not implicitly {@link google.cloud.speech.v1.RecognitionMetadata.verify|verify} messages.
|
2472 | * @function encodeDelimited
|
2473 | * @memberof google.cloud.speech.v1.RecognitionMetadata
|
2474 | * @static
|
2475 | * @param {google.cloud.speech.v1.IRecognitionMetadata} message RecognitionMetadata message or plain object to encode
|
2476 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
2477 | * @returns {$protobuf.Writer} Writer
|
2478 | */
|
2479 | RecognitionMetadata.encodeDelimited = function encodeDelimited(message, writer) {
|
2480 | return this.encode(message, writer).ldelim();
|
2481 | };
|
2482 |
|
2483 | /**
|
2484 | * Decodes a RecognitionMetadata message from the specified reader or buffer.
|
2485 | * @function decode
|
2486 | * @memberof google.cloud.speech.v1.RecognitionMetadata
|
2487 | * @static
|
2488 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
2489 | * @param {number} [length] Message length if known beforehand
|
2490 | * @returns {google.cloud.speech.v1.RecognitionMetadata} RecognitionMetadata
|
2491 | * @throws {Error} If the payload is not a reader or valid buffer
|
2492 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
2493 | */
|
2494 | RecognitionMetadata.decode = function decode(reader, length) {
|
2495 | if (!(reader instanceof $Reader))
|
2496 | reader = $Reader.create(reader);
|
2497 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.RecognitionMetadata();
|
2498 | while (reader.pos < end) {
|
2499 | var tag = reader.uint32();
|
2500 | switch (tag >>> 3) {
|
2501 | case 1:
|
2502 | message.interactionType = reader.int32();
|
2503 | break;
|
2504 | case 3:
|
2505 | message.industryNaicsCodeOfAudio = reader.uint32();
|
2506 | break;
|
2507 | case 4:
|
2508 | message.microphoneDistance = reader.int32();
|
2509 | break;
|
2510 | case 5:
|
2511 | message.originalMediaType = reader.int32();
|
2512 | break;
|
2513 | case 6:
|
2514 | message.recordingDeviceType = reader.int32();
|
2515 | break;
|
2516 | case 7:
|
2517 | message.recordingDeviceName = reader.string();
|
2518 | break;
|
2519 | case 8:
|
2520 | message.originalMimeType = reader.string();
|
2521 | break;
|
2522 | case 10:
|
2523 | message.audioTopic = reader.string();
|
2524 | break;
|
2525 | default:
|
2526 | reader.skipType(tag & 7);
|
2527 | break;
|
2528 | }
|
2529 | }
|
2530 | return message;
|
2531 | };
|
2532 |
|
2533 | /**
|
2534 | * Decodes a RecognitionMetadata message from the specified reader or buffer, length delimited.
|
2535 | * @function decodeDelimited
|
2536 | * @memberof google.cloud.speech.v1.RecognitionMetadata
|
2537 | * @static
|
2538 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
2539 | * @returns {google.cloud.speech.v1.RecognitionMetadata} RecognitionMetadata
|
2540 | * @throws {Error} If the payload is not a reader or valid buffer
|
2541 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
2542 | */
|
2543 | RecognitionMetadata.decodeDelimited = function decodeDelimited(reader) {
|
2544 | if (!(reader instanceof $Reader))
|
2545 | reader = new $Reader(reader);
|
2546 | return this.decode(reader, reader.uint32());
|
2547 | };
|
2548 |
|
2549 | /**
|
2550 | * Verifies a RecognitionMetadata message.
|
2551 | * @function verify
|
2552 | * @memberof google.cloud.speech.v1.RecognitionMetadata
|
2553 | * @static
|
2554 | * @param {Object.<string,*>} message Plain object to verify
|
2555 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
2556 | */
|
2557 | RecognitionMetadata.verify = function verify(message) {
|
2558 | if (typeof message !== "object" || message === null)
|
2559 | return "object expected";
|
2560 | if (message.interactionType != null && message.hasOwnProperty("interactionType"))
|
2561 | switch (message.interactionType) {
|
2562 | default:
|
2563 | return "interactionType: enum value expected";
|
2564 | case 0:
|
2565 | case 1:
|
2566 | case 2:
|
2567 | case 3:
|
2568 | case 4:
|
2569 | case 5:
|
2570 | case 6:
|
2571 | case 7:
|
2572 | case 8:
|
2573 | break;
|
2574 | }
|
2575 | if (message.industryNaicsCodeOfAudio != null && message.hasOwnProperty("industryNaicsCodeOfAudio"))
|
2576 | if (!$util.isInteger(message.industryNaicsCodeOfAudio))
|
2577 | return "industryNaicsCodeOfAudio: integer expected";
|
2578 | if (message.microphoneDistance != null && message.hasOwnProperty("microphoneDistance"))
|
2579 | switch (message.microphoneDistance) {
|
2580 | default:
|
2581 | return "microphoneDistance: enum value expected";
|
2582 | case 0:
|
2583 | case 1:
|
2584 | case 2:
|
2585 | case 3:
|
2586 | break;
|
2587 | }
|
2588 | if (message.originalMediaType != null && message.hasOwnProperty("originalMediaType"))
|
2589 | switch (message.originalMediaType) {
|
2590 | default:
|
2591 | return "originalMediaType: enum value expected";
|
2592 | case 0:
|
2593 | case 1:
|
2594 | case 2:
|
2595 | break;
|
2596 | }
|
2597 | if (message.recordingDeviceType != null && message.hasOwnProperty("recordingDeviceType"))
|
2598 | switch (message.recordingDeviceType) {
|
2599 | default:
|
2600 | return "recordingDeviceType: enum value expected";
|
2601 | case 0:
|
2602 | case 1:
|
2603 | case 2:
|
2604 | case 3:
|
2605 | case 4:
|
2606 | case 5:
|
2607 | case 6:
|
2608 | break;
|
2609 | }
|
2610 | if (message.recordingDeviceName != null && message.hasOwnProperty("recordingDeviceName"))
|
2611 | if (!$util.isString(message.recordingDeviceName))
|
2612 | return "recordingDeviceName: string expected";
|
2613 | if (message.originalMimeType != null && message.hasOwnProperty("originalMimeType"))
|
2614 | if (!$util.isString(message.originalMimeType))
|
2615 | return "originalMimeType: string expected";
|
2616 | if (message.audioTopic != null && message.hasOwnProperty("audioTopic"))
|
2617 | if (!$util.isString(message.audioTopic))
|
2618 | return "audioTopic: string expected";
|
2619 | return null;
|
2620 | };
|
2621 |
|
2622 | /**
|
2623 | * Creates a RecognitionMetadata message from a plain object. Also converts values to their respective internal types.
|
2624 | * @function fromObject
|
2625 | * @memberof google.cloud.speech.v1.RecognitionMetadata
|
2626 | * @static
|
2627 | * @param {Object.<string,*>} object Plain object
|
2628 | * @returns {google.cloud.speech.v1.RecognitionMetadata} RecognitionMetadata
|
2629 | */
|
2630 | RecognitionMetadata.fromObject = function fromObject(object) {
|
2631 | if (object instanceof $root.google.cloud.speech.v1.RecognitionMetadata)
|
2632 | return object;
|
2633 | var message = new $root.google.cloud.speech.v1.RecognitionMetadata();
|
2634 | switch (object.interactionType) {
|
2635 | case "INTERACTION_TYPE_UNSPECIFIED":
|
2636 | case 0:
|
2637 | message.interactionType = 0;
|
2638 | break;
|
2639 | case "DISCUSSION":
|
2640 | case 1:
|
2641 | message.interactionType = 1;
|
2642 | break;
|
2643 | case "PRESENTATION":
|
2644 | case 2:
|
2645 | message.interactionType = 2;
|
2646 | break;
|
2647 | case "PHONE_CALL":
|
2648 | case 3:
|
2649 | message.interactionType = 3;
|
2650 | break;
|
2651 | case "VOICEMAIL":
|
2652 | case 4:
|
2653 | message.interactionType = 4;
|
2654 | break;
|
2655 | case "PROFESSIONALLY_PRODUCED":
|
2656 | case 5:
|
2657 | message.interactionType = 5;
|
2658 | break;
|
2659 | case "VOICE_SEARCH":
|
2660 | case 6:
|
2661 | message.interactionType = 6;
|
2662 | break;
|
2663 | case "VOICE_COMMAND":
|
2664 | case 7:
|
2665 | message.interactionType = 7;
|
2666 | break;
|
2667 | case "DICTATION":
|
2668 | case 8:
|
2669 | message.interactionType = 8;
|
2670 | break;
|
2671 | }
|
2672 | if (object.industryNaicsCodeOfAudio != null)
|
2673 | message.industryNaicsCodeOfAudio = object.industryNaicsCodeOfAudio >>> 0;
|
2674 | switch (object.microphoneDistance) {
|
2675 | case "MICROPHONE_DISTANCE_UNSPECIFIED":
|
2676 | case 0:
|
2677 | message.microphoneDistance = 0;
|
2678 | break;
|
2679 | case "NEARFIELD":
|
2680 | case 1:
|
2681 | message.microphoneDistance = 1;
|
2682 | break;
|
2683 | case "MIDFIELD":
|
2684 | case 2:
|
2685 | message.microphoneDistance = 2;
|
2686 | break;
|
2687 | case "FARFIELD":
|
2688 | case 3:
|
2689 | message.microphoneDistance = 3;
|
2690 | break;
|
2691 | }
|
2692 | switch (object.originalMediaType) {
|
2693 | case "ORIGINAL_MEDIA_TYPE_UNSPECIFIED":
|
2694 | case 0:
|
2695 | message.originalMediaType = 0;
|
2696 | break;
|
2697 | case "AUDIO":
|
2698 | case 1:
|
2699 | message.originalMediaType = 1;
|
2700 | break;
|
2701 | case "VIDEO":
|
2702 | case 2:
|
2703 | message.originalMediaType = 2;
|
2704 | break;
|
2705 | }
|
2706 | switch (object.recordingDeviceType) {
|
2707 | case "RECORDING_DEVICE_TYPE_UNSPECIFIED":
|
2708 | case 0:
|
2709 | message.recordingDeviceType = 0;
|
2710 | break;
|
2711 | case "SMARTPHONE":
|
2712 | case 1:
|
2713 | message.recordingDeviceType = 1;
|
2714 | break;
|
2715 | case "PC":
|
2716 | case 2:
|
2717 | message.recordingDeviceType = 2;
|
2718 | break;
|
2719 | case "PHONE_LINE":
|
2720 | case 3:
|
2721 | message.recordingDeviceType = 3;
|
2722 | break;
|
2723 | case "VEHICLE":
|
2724 | case 4:
|
2725 | message.recordingDeviceType = 4;
|
2726 | break;
|
2727 | case "OTHER_OUTDOOR_DEVICE":
|
2728 | case 5:
|
2729 | message.recordingDeviceType = 5;
|
2730 | break;
|
2731 | case "OTHER_INDOOR_DEVICE":
|
2732 | case 6:
|
2733 | message.recordingDeviceType = 6;
|
2734 | break;
|
2735 | }
|
2736 | if (object.recordingDeviceName != null)
|
2737 | message.recordingDeviceName = String(object.recordingDeviceName);
|
2738 | if (object.originalMimeType != null)
|
2739 | message.originalMimeType = String(object.originalMimeType);
|
2740 | if (object.audioTopic != null)
|
2741 | message.audioTopic = String(object.audioTopic);
|
2742 | return message;
|
2743 | };
|
2744 |
|
2745 | /**
|
2746 | * Creates a plain object from a RecognitionMetadata message. Also converts values to other types if specified.
|
2747 | * @function toObject
|
2748 | * @memberof google.cloud.speech.v1.RecognitionMetadata
|
2749 | * @static
|
2750 | * @param {google.cloud.speech.v1.RecognitionMetadata} message RecognitionMetadata
|
2751 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
2752 | * @returns {Object.<string,*>} Plain object
|
2753 | */
|
2754 | RecognitionMetadata.toObject = function toObject(message, options) {
|
2755 | if (!options)
|
2756 | options = {};
|
2757 | var object = {};
|
2758 | if (options.defaults) {
|
2759 | object.interactionType = options.enums === String ? "INTERACTION_TYPE_UNSPECIFIED" : 0;
|
2760 | object.industryNaicsCodeOfAudio = 0;
|
2761 | object.microphoneDistance = options.enums === String ? "MICROPHONE_DISTANCE_UNSPECIFIED" : 0;
|
2762 | object.originalMediaType = options.enums === String ? "ORIGINAL_MEDIA_TYPE_UNSPECIFIED" : 0;
|
2763 | object.recordingDeviceType = options.enums === String ? "RECORDING_DEVICE_TYPE_UNSPECIFIED" : 0;
|
2764 | object.recordingDeviceName = "";
|
2765 | object.originalMimeType = "";
|
2766 | object.audioTopic = "";
|
2767 | }
|
2768 | if (message.interactionType != null && message.hasOwnProperty("interactionType"))
|
2769 | object.interactionType = options.enums === String ? $root.google.cloud.speech.v1.RecognitionMetadata.InteractionType[message.interactionType] : message.interactionType;
|
2770 | if (message.industryNaicsCodeOfAudio != null && message.hasOwnProperty("industryNaicsCodeOfAudio"))
|
2771 | object.industryNaicsCodeOfAudio = message.industryNaicsCodeOfAudio;
|
2772 | if (message.microphoneDistance != null && message.hasOwnProperty("microphoneDistance"))
|
2773 | object.microphoneDistance = options.enums === String ? $root.google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance[message.microphoneDistance] : message.microphoneDistance;
|
2774 | if (message.originalMediaType != null && message.hasOwnProperty("originalMediaType"))
|
2775 | object.originalMediaType = options.enums === String ? $root.google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType[message.originalMediaType] : message.originalMediaType;
|
2776 | if (message.recordingDeviceType != null && message.hasOwnProperty("recordingDeviceType"))
|
2777 | object.recordingDeviceType = options.enums === String ? $root.google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType[message.recordingDeviceType] : message.recordingDeviceType;
|
2778 | if (message.recordingDeviceName != null && message.hasOwnProperty("recordingDeviceName"))
|
2779 | object.recordingDeviceName = message.recordingDeviceName;
|
2780 | if (message.originalMimeType != null && message.hasOwnProperty("originalMimeType"))
|
2781 | object.originalMimeType = message.originalMimeType;
|
2782 | if (message.audioTopic != null && message.hasOwnProperty("audioTopic"))
|
2783 | object.audioTopic = message.audioTopic;
|
2784 | return object;
|
2785 | };
|
2786 |
|
2787 | /**
|
2788 | * Converts this RecognitionMetadata to JSON.
|
2789 | * @function toJSON
|
2790 | * @memberof google.cloud.speech.v1.RecognitionMetadata
|
2791 | * @instance
|
2792 | * @returns {Object.<string,*>} JSON object
|
2793 | */
|
2794 | RecognitionMetadata.prototype.toJSON = function toJSON() {
|
2795 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
2796 | };
|
2797 |
|
2798 | /**
|
2799 | * InteractionType enum.
|
2800 | * @name google.cloud.speech.v1.RecognitionMetadata.InteractionType
|
2801 | * @enum {number}
|
2802 | * @property {number} INTERACTION_TYPE_UNSPECIFIED=0 INTERACTION_TYPE_UNSPECIFIED value
|
2803 | * @property {number} DISCUSSION=1 DISCUSSION value
|
2804 | * @property {number} PRESENTATION=2 PRESENTATION value
|
2805 | * @property {number} PHONE_CALL=3 PHONE_CALL value
|
2806 | * @property {number} VOICEMAIL=4 VOICEMAIL value
|
2807 | * @property {number} PROFESSIONALLY_PRODUCED=5 PROFESSIONALLY_PRODUCED value
|
2808 | * @property {number} VOICE_SEARCH=6 VOICE_SEARCH value
|
2809 | * @property {number} VOICE_COMMAND=7 VOICE_COMMAND value
|
2810 | * @property {number} DICTATION=8 DICTATION value
|
2811 | */
|
2812 | RecognitionMetadata.InteractionType = (function() {
|
2813 | var valuesById = {}, values = Object.create(valuesById);
|
2814 | values[valuesById[0] = "INTERACTION_TYPE_UNSPECIFIED"] = 0;
|
2815 | values[valuesById[1] = "DISCUSSION"] = 1;
|
2816 | values[valuesById[2] = "PRESENTATION"] = 2;
|
2817 | values[valuesById[3] = "PHONE_CALL"] = 3;
|
2818 | values[valuesById[4] = "VOICEMAIL"] = 4;
|
2819 | values[valuesById[5] = "PROFESSIONALLY_PRODUCED"] = 5;
|
2820 | values[valuesById[6] = "VOICE_SEARCH"] = 6;
|
2821 | values[valuesById[7] = "VOICE_COMMAND"] = 7;
|
2822 | values[valuesById[8] = "DICTATION"] = 8;
|
2823 | return values;
|
2824 | })();
|
2825 |
|
2826 | /**
|
2827 | * MicrophoneDistance enum.
|
2828 | * @name google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance
|
2829 | * @enum {number}
|
2830 | * @property {number} MICROPHONE_DISTANCE_UNSPECIFIED=0 MICROPHONE_DISTANCE_UNSPECIFIED value
|
2831 | * @property {number} NEARFIELD=1 NEARFIELD value
|
2832 | * @property {number} MIDFIELD=2 MIDFIELD value
|
2833 | * @property {number} FARFIELD=3 FARFIELD value
|
2834 | */
|
2835 | RecognitionMetadata.MicrophoneDistance = (function() {
|
2836 | var valuesById = {}, values = Object.create(valuesById);
|
2837 | values[valuesById[0] = "MICROPHONE_DISTANCE_UNSPECIFIED"] = 0;
|
2838 | values[valuesById[1] = "NEARFIELD"] = 1;
|
2839 | values[valuesById[2] = "MIDFIELD"] = 2;
|
2840 | values[valuesById[3] = "FARFIELD"] = 3;
|
2841 | return values;
|
2842 | })();
|
2843 |
|
2844 | /**
|
2845 | * OriginalMediaType enum.
|
2846 | * @name google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType
|
2847 | * @enum {number}
|
2848 | * @property {number} ORIGINAL_MEDIA_TYPE_UNSPECIFIED=0 ORIGINAL_MEDIA_TYPE_UNSPECIFIED value
|
2849 | * @property {number} AUDIO=1 AUDIO value
|
2850 | * @property {number} VIDEO=2 VIDEO value
|
2851 | */
|
2852 | RecognitionMetadata.OriginalMediaType = (function() {
|
2853 | var valuesById = {}, values = Object.create(valuesById);
|
2854 | values[valuesById[0] = "ORIGINAL_MEDIA_TYPE_UNSPECIFIED"] = 0;
|
2855 | values[valuesById[1] = "AUDIO"] = 1;
|
2856 | values[valuesById[2] = "VIDEO"] = 2;
|
2857 | return values;
|
2858 | })();
|
2859 |
|
2860 | /**
|
2861 | * RecordingDeviceType enum.
|
2862 | * @name google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType
|
2863 | * @enum {number}
|
2864 | * @property {number} RECORDING_DEVICE_TYPE_UNSPECIFIED=0 RECORDING_DEVICE_TYPE_UNSPECIFIED value
|
2865 | * @property {number} SMARTPHONE=1 SMARTPHONE value
|
2866 | * @property {number} PC=2 PC value
|
2867 | * @property {number} PHONE_LINE=3 PHONE_LINE value
|
2868 | * @property {number} VEHICLE=4 VEHICLE value
|
2869 | * @property {number} OTHER_OUTDOOR_DEVICE=5 OTHER_OUTDOOR_DEVICE value
|
2870 | * @property {number} OTHER_INDOOR_DEVICE=6 OTHER_INDOOR_DEVICE value
|
2871 | */
|
2872 | RecognitionMetadata.RecordingDeviceType = (function() {
|
2873 | var valuesById = {}, values = Object.create(valuesById);
|
2874 | values[valuesById[0] = "RECORDING_DEVICE_TYPE_UNSPECIFIED"] = 0;
|
2875 | values[valuesById[1] = "SMARTPHONE"] = 1;
|
2876 | values[valuesById[2] = "PC"] = 2;
|
2877 | values[valuesById[3] = "PHONE_LINE"] = 3;
|
2878 | values[valuesById[4] = "VEHICLE"] = 4;
|
2879 | values[valuesById[5] = "OTHER_OUTDOOR_DEVICE"] = 5;
|
2880 | values[valuesById[6] = "OTHER_INDOOR_DEVICE"] = 6;
|
2881 | return values;
|
2882 | })();
|
2883 |
|
2884 | return RecognitionMetadata;
|
2885 | })();
|
2886 |
|
2887 | v1.SpeechContext = (function() {
|
2888 |
|
2889 | /**
|
2890 | * Properties of a SpeechContext.
|
2891 | * @memberof google.cloud.speech.v1
|
2892 | * @interface ISpeechContext
|
2893 | * @property {Array.<string>|null} [phrases] SpeechContext phrases
|
2894 | * @property {number|null} [boost] SpeechContext boost
|
2895 | */
|
2896 |
|
2897 | /**
|
2898 | * Constructs a new SpeechContext.
|
2899 | * @memberof google.cloud.speech.v1
|
2900 | * @classdesc Represents a SpeechContext.
|
2901 | * @implements ISpeechContext
|
2902 | * @constructor
|
2903 | * @param {google.cloud.speech.v1.ISpeechContext=} [properties] Properties to set
|
2904 | */
|
2905 | function SpeechContext(properties) {
|
2906 | this.phrases = [];
|
2907 | if (properties)
|
2908 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
2909 | if (properties[keys[i]] != null)
|
2910 | this[keys[i]] = properties[keys[i]];
|
2911 | }
|
2912 |
|
2913 | /**
|
2914 | * SpeechContext phrases.
|
2915 | * @member {Array.<string>} phrases
|
2916 | * @memberof google.cloud.speech.v1.SpeechContext
|
2917 | * @instance
|
2918 | */
|
2919 | SpeechContext.prototype.phrases = $util.emptyArray;
|
2920 |
|
2921 | /**
|
2922 | * SpeechContext boost.
|
2923 | * @member {number} boost
|
2924 | * @memberof google.cloud.speech.v1.SpeechContext
|
2925 | * @instance
|
2926 | */
|
2927 | SpeechContext.prototype.boost = 0;
|
2928 |
|
2929 | /**
|
2930 | * Creates a new SpeechContext instance using the specified properties.
|
2931 | * @function create
|
2932 | * @memberof google.cloud.speech.v1.SpeechContext
|
2933 | * @static
|
2934 | * @param {google.cloud.speech.v1.ISpeechContext=} [properties] Properties to set
|
2935 | * @returns {google.cloud.speech.v1.SpeechContext} SpeechContext instance
|
2936 | */
|
2937 | SpeechContext.create = function create(properties) {
|
2938 | return new SpeechContext(properties);
|
2939 | };
|
2940 |
|
2941 | /**
|
2942 | * Encodes the specified SpeechContext message. Does not implicitly {@link google.cloud.speech.v1.SpeechContext.verify|verify} messages.
|
2943 | * @function encode
|
2944 | * @memberof google.cloud.speech.v1.SpeechContext
|
2945 | * @static
|
2946 | * @param {google.cloud.speech.v1.ISpeechContext} message SpeechContext message or plain object to encode
|
2947 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
2948 | * @returns {$protobuf.Writer} Writer
|
2949 | */
|
2950 | SpeechContext.encode = function encode(message, writer) {
|
2951 | if (!writer)
|
2952 | writer = $Writer.create();
|
2953 | if (message.phrases != null && message.phrases.length)
|
2954 | for (var i = 0; i < message.phrases.length; ++i)
|
2955 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.phrases[i]);
|
2956 | if (message.boost != null && Object.hasOwnProperty.call(message, "boost"))
|
2957 | writer.uint32(/* id 4, wireType 5 =*/37).float(message.boost);
|
2958 | return writer;
|
2959 | };
|
2960 |
|
2961 | /**
|
2962 | * Encodes the specified SpeechContext message, length delimited. Does not implicitly {@link google.cloud.speech.v1.SpeechContext.verify|verify} messages.
|
2963 | * @function encodeDelimited
|
2964 | * @memberof google.cloud.speech.v1.SpeechContext
|
2965 | * @static
|
2966 | * @param {google.cloud.speech.v1.ISpeechContext} message SpeechContext message or plain object to encode
|
2967 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
2968 | * @returns {$protobuf.Writer} Writer
|
2969 | */
|
2970 | SpeechContext.encodeDelimited = function encodeDelimited(message, writer) {
|
2971 | return this.encode(message, writer).ldelim();
|
2972 | };
|
2973 |
|
2974 | /**
|
2975 | * Decodes a SpeechContext message from the specified reader or buffer.
|
2976 | * @function decode
|
2977 | * @memberof google.cloud.speech.v1.SpeechContext
|
2978 | * @static
|
2979 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
2980 | * @param {number} [length] Message length if known beforehand
|
2981 | * @returns {google.cloud.speech.v1.SpeechContext} SpeechContext
|
2982 | * @throws {Error} If the payload is not a reader or valid buffer
|
2983 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
2984 | */
|
2985 | SpeechContext.decode = function decode(reader, length) {
|
2986 | if (!(reader instanceof $Reader))
|
2987 | reader = $Reader.create(reader);
|
2988 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.SpeechContext();
|
2989 | while (reader.pos < end) {
|
2990 | var tag = reader.uint32();
|
2991 | switch (tag >>> 3) {
|
2992 | case 1:
|
2993 | if (!(message.phrases && message.phrases.length))
|
2994 | message.phrases = [];
|
2995 | message.phrases.push(reader.string());
|
2996 | break;
|
2997 | case 4:
|
2998 | message.boost = reader.float();
|
2999 | break;
|
3000 | default:
|
3001 | reader.skipType(tag & 7);
|
3002 | break;
|
3003 | }
|
3004 | }
|
3005 | return message;
|
3006 | };
|
3007 |
|
3008 | /**
|
3009 | * Decodes a SpeechContext message from the specified reader or buffer, length delimited.
|
3010 | * @function decodeDelimited
|
3011 | * @memberof google.cloud.speech.v1.SpeechContext
|
3012 | * @static
|
3013 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
3014 | * @returns {google.cloud.speech.v1.SpeechContext} SpeechContext
|
3015 | * @throws {Error} If the payload is not a reader or valid buffer
|
3016 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
3017 | */
|
3018 | SpeechContext.decodeDelimited = function decodeDelimited(reader) {
|
3019 | if (!(reader instanceof $Reader))
|
3020 | reader = new $Reader(reader);
|
3021 | return this.decode(reader, reader.uint32());
|
3022 | };
|
3023 |
|
3024 | /**
|
3025 | * Verifies a SpeechContext message.
|
3026 | * @function verify
|
3027 | * @memberof google.cloud.speech.v1.SpeechContext
|
3028 | * @static
|
3029 | * @param {Object.<string,*>} message Plain object to verify
|
3030 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
3031 | */
|
3032 | SpeechContext.verify = function verify(message) {
|
3033 | if (typeof message !== "object" || message === null)
|
3034 | return "object expected";
|
3035 | if (message.phrases != null && message.hasOwnProperty("phrases")) {
|
3036 | if (!Array.isArray(message.phrases))
|
3037 | return "phrases: array expected";
|
3038 | for (var i = 0; i < message.phrases.length; ++i)
|
3039 | if (!$util.isString(message.phrases[i]))
|
3040 | return "phrases: string[] expected";
|
3041 | }
|
3042 | if (message.boost != null && message.hasOwnProperty("boost"))
|
3043 | if (typeof message.boost !== "number")
|
3044 | return "boost: number expected";
|
3045 | return null;
|
3046 | };
|
3047 |
|
3048 | /**
|
3049 | * Creates a SpeechContext message from a plain object. Also converts values to their respective internal types.
|
3050 | * @function fromObject
|
3051 | * @memberof google.cloud.speech.v1.SpeechContext
|
3052 | * @static
|
3053 | * @param {Object.<string,*>} object Plain object
|
3054 | * @returns {google.cloud.speech.v1.SpeechContext} SpeechContext
|
3055 | */
|
3056 | SpeechContext.fromObject = function fromObject(object) {
|
3057 | if (object instanceof $root.google.cloud.speech.v1.SpeechContext)
|
3058 | return object;
|
3059 | var message = new $root.google.cloud.speech.v1.SpeechContext();
|
3060 | if (object.phrases) {
|
3061 | if (!Array.isArray(object.phrases))
|
3062 | throw TypeError(".google.cloud.speech.v1.SpeechContext.phrases: array expected");
|
3063 | message.phrases = [];
|
3064 | for (var i = 0; i < object.phrases.length; ++i)
|
3065 | message.phrases[i] = String(object.phrases[i]);
|
3066 | }
|
3067 | if (object.boost != null)
|
3068 | message.boost = Number(object.boost);
|
3069 | return message;
|
3070 | };
|
3071 |
|
3072 | /**
|
3073 | * Creates a plain object from a SpeechContext message. Also converts values to other types if specified.
|
3074 | * @function toObject
|
3075 | * @memberof google.cloud.speech.v1.SpeechContext
|
3076 | * @static
|
3077 | * @param {google.cloud.speech.v1.SpeechContext} message SpeechContext
|
3078 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
3079 | * @returns {Object.<string,*>} Plain object
|
3080 | */
|
3081 | SpeechContext.toObject = function toObject(message, options) {
|
3082 | if (!options)
|
3083 | options = {};
|
3084 | var object = {};
|
3085 | if (options.arrays || options.defaults)
|
3086 | object.phrases = [];
|
3087 | if (options.defaults)
|
3088 | object.boost = 0;
|
3089 | if (message.phrases && message.phrases.length) {
|
3090 | object.phrases = [];
|
3091 | for (var j = 0; j < message.phrases.length; ++j)
|
3092 | object.phrases[j] = message.phrases[j];
|
3093 | }
|
3094 | if (message.boost != null && message.hasOwnProperty("boost"))
|
3095 | object.boost = options.json && !isFinite(message.boost) ? String(message.boost) : message.boost;
|
3096 | return object;
|
3097 | };
|
3098 |
|
3099 | /**
|
3100 | * Converts this SpeechContext to JSON.
|
3101 | * @function toJSON
|
3102 | * @memberof google.cloud.speech.v1.SpeechContext
|
3103 | * @instance
|
3104 | * @returns {Object.<string,*>} JSON object
|
3105 | */
|
3106 | SpeechContext.prototype.toJSON = function toJSON() {
|
3107 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
3108 | };
|
3109 |
|
3110 | return SpeechContext;
|
3111 | })();
|
3112 |
|
3113 | v1.RecognitionAudio = (function() {
|
3114 |
|
3115 | /**
|
3116 | * Properties of a RecognitionAudio.
|
3117 | * @memberof google.cloud.speech.v1
|
3118 | * @interface IRecognitionAudio
|
3119 | * @property {Uint8Array|null} [content] RecognitionAudio content
|
3120 | * @property {string|null} [uri] RecognitionAudio uri
|
3121 | */
|
3122 |
|
3123 | /**
|
3124 | * Constructs a new RecognitionAudio.
|
3125 | * @memberof google.cloud.speech.v1
|
3126 | * @classdesc Represents a RecognitionAudio.
|
3127 | * @implements IRecognitionAudio
|
3128 | * @constructor
|
3129 | * @param {google.cloud.speech.v1.IRecognitionAudio=} [properties] Properties to set
|
3130 | */
|
3131 | function RecognitionAudio(properties) {
|
3132 | if (properties)
|
3133 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
3134 | if (properties[keys[i]] != null)
|
3135 | this[keys[i]] = properties[keys[i]];
|
3136 | }
|
3137 |
|
3138 | /**
|
3139 | * RecognitionAudio content.
|
3140 | * @member {Uint8Array|null|undefined} content
|
3141 | * @memberof google.cloud.speech.v1.RecognitionAudio
|
3142 | * @instance
|
3143 | */
|
3144 | RecognitionAudio.prototype.content = null;
|
3145 |
|
3146 | /**
|
3147 | * RecognitionAudio uri.
|
3148 | * @member {string|null|undefined} uri
|
3149 | * @memberof google.cloud.speech.v1.RecognitionAudio
|
3150 | * @instance
|
3151 | */
|
3152 | RecognitionAudio.prototype.uri = null;
|
3153 |
|
3154 | // OneOf field names bound to virtual getters and setters
|
3155 | var $oneOfFields;
|
3156 |
|
3157 | /**
|
3158 | * RecognitionAudio audioSource.
|
3159 | * @member {"content"|"uri"|undefined} audioSource
|
3160 | * @memberof google.cloud.speech.v1.RecognitionAudio
|
3161 | * @instance
|
3162 | */
|
3163 | Object.defineProperty(RecognitionAudio.prototype, "audioSource", {
|
3164 | get: $util.oneOfGetter($oneOfFields = ["content", "uri"]),
|
3165 | set: $util.oneOfSetter($oneOfFields)
|
3166 | });
|
3167 |
|
3168 | /**
|
3169 | * Creates a new RecognitionAudio instance using the specified properties.
|
3170 | * @function create
|
3171 | * @memberof google.cloud.speech.v1.RecognitionAudio
|
3172 | * @static
|
3173 | * @param {google.cloud.speech.v1.IRecognitionAudio=} [properties] Properties to set
|
3174 | * @returns {google.cloud.speech.v1.RecognitionAudio} RecognitionAudio instance
|
3175 | */
|
3176 | RecognitionAudio.create = function create(properties) {
|
3177 | return new RecognitionAudio(properties);
|
3178 | };
|
3179 |
|
3180 | /**
|
3181 | * Encodes the specified RecognitionAudio message. Does not implicitly {@link google.cloud.speech.v1.RecognitionAudio.verify|verify} messages.
|
3182 | * @function encode
|
3183 | * @memberof google.cloud.speech.v1.RecognitionAudio
|
3184 | * @static
|
3185 | * @param {google.cloud.speech.v1.IRecognitionAudio} message RecognitionAudio message or plain object to encode
|
3186 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
3187 | * @returns {$protobuf.Writer} Writer
|
3188 | */
|
3189 | RecognitionAudio.encode = function encode(message, writer) {
|
3190 | if (!writer)
|
3191 | writer = $Writer.create();
|
3192 | if (message.content != null && Object.hasOwnProperty.call(message, "content"))
|
3193 | writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.content);
|
3194 | if (message.uri != null && Object.hasOwnProperty.call(message, "uri"))
|
3195 | writer.uint32(/* id 2, wireType 2 =*/18).string(message.uri);
|
3196 | return writer;
|
3197 | };
|
3198 |
|
3199 | /**
|
3200 | * Encodes the specified RecognitionAudio message, length delimited. Does not implicitly {@link google.cloud.speech.v1.RecognitionAudio.verify|verify} messages.
|
3201 | * @function encodeDelimited
|
3202 | * @memberof google.cloud.speech.v1.RecognitionAudio
|
3203 | * @static
|
3204 | * @param {google.cloud.speech.v1.IRecognitionAudio} message RecognitionAudio message or plain object to encode
|
3205 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
3206 | * @returns {$protobuf.Writer} Writer
|
3207 | */
|
3208 | RecognitionAudio.encodeDelimited = function encodeDelimited(message, writer) {
|
3209 | return this.encode(message, writer).ldelim();
|
3210 | };
|
3211 |
|
3212 | /**
|
3213 | * Decodes a RecognitionAudio message from the specified reader or buffer.
|
3214 | * @function decode
|
3215 | * @memberof google.cloud.speech.v1.RecognitionAudio
|
3216 | * @static
|
3217 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
3218 | * @param {number} [length] Message length if known beforehand
|
3219 | * @returns {google.cloud.speech.v1.RecognitionAudio} RecognitionAudio
|
3220 | * @throws {Error} If the payload is not a reader or valid buffer
|
3221 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
3222 | */
|
3223 | RecognitionAudio.decode = function decode(reader, length) {
|
3224 | if (!(reader instanceof $Reader))
|
3225 | reader = $Reader.create(reader);
|
3226 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.RecognitionAudio();
|
3227 | while (reader.pos < end) {
|
3228 | var tag = reader.uint32();
|
3229 | switch (tag >>> 3) {
|
3230 | case 1:
|
3231 | message.content = reader.bytes();
|
3232 | break;
|
3233 | case 2:
|
3234 | message.uri = reader.string();
|
3235 | break;
|
3236 | default:
|
3237 | reader.skipType(tag & 7);
|
3238 | break;
|
3239 | }
|
3240 | }
|
3241 | return message;
|
3242 | };
|
3243 |
|
3244 | /**
|
3245 | * Decodes a RecognitionAudio message from the specified reader or buffer, length delimited.
|
3246 | * @function decodeDelimited
|
3247 | * @memberof google.cloud.speech.v1.RecognitionAudio
|
3248 | * @static
|
3249 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
3250 | * @returns {google.cloud.speech.v1.RecognitionAudio} RecognitionAudio
|
3251 | * @throws {Error} If the payload is not a reader or valid buffer
|
3252 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
3253 | */
|
3254 | RecognitionAudio.decodeDelimited = function decodeDelimited(reader) {
|
3255 | if (!(reader instanceof $Reader))
|
3256 | reader = new $Reader(reader);
|
3257 | return this.decode(reader, reader.uint32());
|
3258 | };
|
3259 |
|
3260 | /**
|
3261 | * Verifies a RecognitionAudio message.
|
3262 | * @function verify
|
3263 | * @memberof google.cloud.speech.v1.RecognitionAudio
|
3264 | * @static
|
3265 | * @param {Object.<string,*>} message Plain object to verify
|
3266 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
3267 | */
|
3268 | RecognitionAudio.verify = function verify(message) {
|
3269 | if (typeof message !== "object" || message === null)
|
3270 | return "object expected";
|
3271 | var properties = {};
|
3272 | if (message.content != null && message.hasOwnProperty("content")) {
|
3273 | properties.audioSource = 1;
|
3274 | if (!(message.content && typeof message.content.length === "number" || $util.isString(message.content)))
|
3275 | return "content: buffer expected";
|
3276 | }
|
3277 | if (message.uri != null && message.hasOwnProperty("uri")) {
|
3278 | if (properties.audioSource === 1)
|
3279 | return "audioSource: multiple values";
|
3280 | properties.audioSource = 1;
|
3281 | if (!$util.isString(message.uri))
|
3282 | return "uri: string expected";
|
3283 | }
|
3284 | return null;
|
3285 | };
|
3286 |
|
3287 | /**
|
3288 | * Creates a RecognitionAudio message from a plain object. Also converts values to their respective internal types.
|
3289 | * @function fromObject
|
3290 | * @memberof google.cloud.speech.v1.RecognitionAudio
|
3291 | * @static
|
3292 | * @param {Object.<string,*>} object Plain object
|
3293 | * @returns {google.cloud.speech.v1.RecognitionAudio} RecognitionAudio
|
3294 | */
|
3295 | RecognitionAudio.fromObject = function fromObject(object) {
|
3296 | if (object instanceof $root.google.cloud.speech.v1.RecognitionAudio)
|
3297 | return object;
|
3298 | var message = new $root.google.cloud.speech.v1.RecognitionAudio();
|
3299 | if (object.content != null)
|
3300 | if (typeof object.content === "string")
|
3301 | $util.base64.decode(object.content, message.content = $util.newBuffer($util.base64.length(object.content)), 0);
|
3302 | else if (object.content.length)
|
3303 | message.content = object.content;
|
3304 | if (object.uri != null)
|
3305 | message.uri = String(object.uri);
|
3306 | return message;
|
3307 | };
|
3308 |
|
3309 | /**
|
3310 | * Creates a plain object from a RecognitionAudio message. Also converts values to other types if specified.
|
3311 | * @function toObject
|
3312 | * @memberof google.cloud.speech.v1.RecognitionAudio
|
3313 | * @static
|
3314 | * @param {google.cloud.speech.v1.RecognitionAudio} message RecognitionAudio
|
3315 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
3316 | * @returns {Object.<string,*>} Plain object
|
3317 | */
|
3318 | RecognitionAudio.toObject = function toObject(message, options) {
|
3319 | if (!options)
|
3320 | options = {};
|
3321 | var object = {};
|
3322 | if (message.content != null && message.hasOwnProperty("content")) {
|
3323 | 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;
|
3324 | if (options.oneofs)
|
3325 | object.audioSource = "content";
|
3326 | }
|
3327 | if (message.uri != null && message.hasOwnProperty("uri")) {
|
3328 | object.uri = message.uri;
|
3329 | if (options.oneofs)
|
3330 | object.audioSource = "uri";
|
3331 | }
|
3332 | return object;
|
3333 | };
|
3334 |
|
3335 | /**
|
3336 | * Converts this RecognitionAudio to JSON.
|
3337 | * @function toJSON
|
3338 | * @memberof google.cloud.speech.v1.RecognitionAudio
|
3339 | * @instance
|
3340 | * @returns {Object.<string,*>} JSON object
|
3341 | */
|
3342 | RecognitionAudio.prototype.toJSON = function toJSON() {
|
3343 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
3344 | };
|
3345 |
|
3346 | return RecognitionAudio;
|
3347 | })();
|
3348 |
|
3349 | v1.RecognizeResponse = (function() {
|
3350 |
|
3351 | /**
|
3352 | * Properties of a RecognizeResponse.
|
3353 | * @memberof google.cloud.speech.v1
|
3354 | * @interface IRecognizeResponse
|
3355 | * @property {Array.<google.cloud.speech.v1.ISpeechRecognitionResult>|null} [results] RecognizeResponse results
|
3356 | * @property {google.protobuf.IDuration|null} [totalBilledTime] RecognizeResponse totalBilledTime
|
3357 | */
|
3358 |
|
3359 | /**
|
3360 | * Constructs a new RecognizeResponse.
|
3361 | * @memberof google.cloud.speech.v1
|
3362 | * @classdesc Represents a RecognizeResponse.
|
3363 | * @implements IRecognizeResponse
|
3364 | * @constructor
|
3365 | * @param {google.cloud.speech.v1.IRecognizeResponse=} [properties] Properties to set
|
3366 | */
|
3367 | function RecognizeResponse(properties) {
|
3368 | this.results = [];
|
3369 | if (properties)
|
3370 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
3371 | if (properties[keys[i]] != null)
|
3372 | this[keys[i]] = properties[keys[i]];
|
3373 | }
|
3374 |
|
3375 | /**
|
3376 | * RecognizeResponse results.
|
3377 | * @member {Array.<google.cloud.speech.v1.ISpeechRecognitionResult>} results
|
3378 | * @memberof google.cloud.speech.v1.RecognizeResponse
|
3379 | * @instance
|
3380 | */
|
3381 | RecognizeResponse.prototype.results = $util.emptyArray;
|
3382 |
|
3383 | /**
|
3384 | * RecognizeResponse totalBilledTime.
|
3385 | * @member {google.protobuf.IDuration|null|undefined} totalBilledTime
|
3386 | * @memberof google.cloud.speech.v1.RecognizeResponse
|
3387 | * @instance
|
3388 | */
|
3389 | RecognizeResponse.prototype.totalBilledTime = null;
|
3390 |
|
3391 | /**
|
3392 | * Creates a new RecognizeResponse instance using the specified properties.
|
3393 | * @function create
|
3394 | * @memberof google.cloud.speech.v1.RecognizeResponse
|
3395 | * @static
|
3396 | * @param {google.cloud.speech.v1.IRecognizeResponse=} [properties] Properties to set
|
3397 | * @returns {google.cloud.speech.v1.RecognizeResponse} RecognizeResponse instance
|
3398 | */
|
3399 | RecognizeResponse.create = function create(properties) {
|
3400 | return new RecognizeResponse(properties);
|
3401 | };
|
3402 |
|
3403 | /**
|
3404 | * Encodes the specified RecognizeResponse message. Does not implicitly {@link google.cloud.speech.v1.RecognizeResponse.verify|verify} messages.
|
3405 | * @function encode
|
3406 | * @memberof google.cloud.speech.v1.RecognizeResponse
|
3407 | * @static
|
3408 | * @param {google.cloud.speech.v1.IRecognizeResponse} message RecognizeResponse message or plain object to encode
|
3409 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
3410 | * @returns {$protobuf.Writer} Writer
|
3411 | */
|
3412 | RecognizeResponse.encode = function encode(message, writer) {
|
3413 | if (!writer)
|
3414 | writer = $Writer.create();
|
3415 | if (message.results != null && message.results.length)
|
3416 | for (var i = 0; i < message.results.length; ++i)
|
3417 | $root.google.cloud.speech.v1.SpeechRecognitionResult.encode(message.results[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
3418 | if (message.totalBilledTime != null && Object.hasOwnProperty.call(message, "totalBilledTime"))
|
3419 | $root.google.protobuf.Duration.encode(message.totalBilledTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
|
3420 | return writer;
|
3421 | };
|
3422 |
|
3423 | /**
|
3424 | * Encodes the specified RecognizeResponse message, length delimited. Does not implicitly {@link google.cloud.speech.v1.RecognizeResponse.verify|verify} messages.
|
3425 | * @function encodeDelimited
|
3426 | * @memberof google.cloud.speech.v1.RecognizeResponse
|
3427 | * @static
|
3428 | * @param {google.cloud.speech.v1.IRecognizeResponse} message RecognizeResponse message or plain object to encode
|
3429 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
3430 | * @returns {$protobuf.Writer} Writer
|
3431 | */
|
3432 | RecognizeResponse.encodeDelimited = function encodeDelimited(message, writer) {
|
3433 | return this.encode(message, writer).ldelim();
|
3434 | };
|
3435 |
|
3436 | /**
|
3437 | * Decodes a RecognizeResponse message from the specified reader or buffer.
|
3438 | * @function decode
|
3439 | * @memberof google.cloud.speech.v1.RecognizeResponse
|
3440 | * @static
|
3441 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
3442 | * @param {number} [length] Message length if known beforehand
|
3443 | * @returns {google.cloud.speech.v1.RecognizeResponse} RecognizeResponse
|
3444 | * @throws {Error} If the payload is not a reader or valid buffer
|
3445 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
3446 | */
|
3447 | RecognizeResponse.decode = function decode(reader, length) {
|
3448 | if (!(reader instanceof $Reader))
|
3449 | reader = $Reader.create(reader);
|
3450 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.RecognizeResponse();
|
3451 | while (reader.pos < end) {
|
3452 | var tag = reader.uint32();
|
3453 | switch (tag >>> 3) {
|
3454 | case 2:
|
3455 | if (!(message.results && message.results.length))
|
3456 | message.results = [];
|
3457 | message.results.push($root.google.cloud.speech.v1.SpeechRecognitionResult.decode(reader, reader.uint32()));
|
3458 | break;
|
3459 | case 3:
|
3460 | message.totalBilledTime = $root.google.protobuf.Duration.decode(reader, reader.uint32());
|
3461 | break;
|
3462 | default:
|
3463 | reader.skipType(tag & 7);
|
3464 | break;
|
3465 | }
|
3466 | }
|
3467 | return message;
|
3468 | };
|
3469 |
|
3470 | /**
|
3471 | * Decodes a RecognizeResponse message from the specified reader or buffer, length delimited.
|
3472 | * @function decodeDelimited
|
3473 | * @memberof google.cloud.speech.v1.RecognizeResponse
|
3474 | * @static
|
3475 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
3476 | * @returns {google.cloud.speech.v1.RecognizeResponse} RecognizeResponse
|
3477 | * @throws {Error} If the payload is not a reader or valid buffer
|
3478 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
3479 | */
|
3480 | RecognizeResponse.decodeDelimited = function decodeDelimited(reader) {
|
3481 | if (!(reader instanceof $Reader))
|
3482 | reader = new $Reader(reader);
|
3483 | return this.decode(reader, reader.uint32());
|
3484 | };
|
3485 |
|
3486 | /**
|
3487 | * Verifies a RecognizeResponse message.
|
3488 | * @function verify
|
3489 | * @memberof google.cloud.speech.v1.RecognizeResponse
|
3490 | * @static
|
3491 | * @param {Object.<string,*>} message Plain object to verify
|
3492 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
3493 | */
|
3494 | RecognizeResponse.verify = function verify(message) {
|
3495 | if (typeof message !== "object" || message === null)
|
3496 | return "object expected";
|
3497 | if (message.results != null && message.hasOwnProperty("results")) {
|
3498 | if (!Array.isArray(message.results))
|
3499 | return "results: array expected";
|
3500 | for (var i = 0; i < message.results.length; ++i) {
|
3501 | var error = $root.google.cloud.speech.v1.SpeechRecognitionResult.verify(message.results[i]);
|
3502 | if (error)
|
3503 | return "results." + error;
|
3504 | }
|
3505 | }
|
3506 | if (message.totalBilledTime != null && message.hasOwnProperty("totalBilledTime")) {
|
3507 | var error = $root.google.protobuf.Duration.verify(message.totalBilledTime);
|
3508 | if (error)
|
3509 | return "totalBilledTime." + error;
|
3510 | }
|
3511 | return null;
|
3512 | };
|
3513 |
|
3514 | /**
|
3515 | * Creates a RecognizeResponse message from a plain object. Also converts values to their respective internal types.
|
3516 | * @function fromObject
|
3517 | * @memberof google.cloud.speech.v1.RecognizeResponse
|
3518 | * @static
|
3519 | * @param {Object.<string,*>} object Plain object
|
3520 | * @returns {google.cloud.speech.v1.RecognizeResponse} RecognizeResponse
|
3521 | */
|
3522 | RecognizeResponse.fromObject = function fromObject(object) {
|
3523 | if (object instanceof $root.google.cloud.speech.v1.RecognizeResponse)
|
3524 | return object;
|
3525 | var message = new $root.google.cloud.speech.v1.RecognizeResponse();
|
3526 | if (object.results) {
|
3527 | if (!Array.isArray(object.results))
|
3528 | throw TypeError(".google.cloud.speech.v1.RecognizeResponse.results: array expected");
|
3529 | message.results = [];
|
3530 | for (var i = 0; i < object.results.length; ++i) {
|
3531 | if (typeof object.results[i] !== "object")
|
3532 | throw TypeError(".google.cloud.speech.v1.RecognizeResponse.results: object expected");
|
3533 | message.results[i] = $root.google.cloud.speech.v1.SpeechRecognitionResult.fromObject(object.results[i]);
|
3534 | }
|
3535 | }
|
3536 | if (object.totalBilledTime != null) {
|
3537 | if (typeof object.totalBilledTime !== "object")
|
3538 | throw TypeError(".google.cloud.speech.v1.RecognizeResponse.totalBilledTime: object expected");
|
3539 | message.totalBilledTime = $root.google.protobuf.Duration.fromObject(object.totalBilledTime);
|
3540 | }
|
3541 | return message;
|
3542 | };
|
3543 |
|
3544 | /**
|
3545 | * Creates a plain object from a RecognizeResponse message. Also converts values to other types if specified.
|
3546 | * @function toObject
|
3547 | * @memberof google.cloud.speech.v1.RecognizeResponse
|
3548 | * @static
|
3549 | * @param {google.cloud.speech.v1.RecognizeResponse} message RecognizeResponse
|
3550 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
3551 | * @returns {Object.<string,*>} Plain object
|
3552 | */
|
3553 | RecognizeResponse.toObject = function toObject(message, options) {
|
3554 | if (!options)
|
3555 | options = {};
|
3556 | var object = {};
|
3557 | if (options.arrays || options.defaults)
|
3558 | object.results = [];
|
3559 | if (options.defaults)
|
3560 | object.totalBilledTime = null;
|
3561 | if (message.results && message.results.length) {
|
3562 | object.results = [];
|
3563 | for (var j = 0; j < message.results.length; ++j)
|
3564 | object.results[j] = $root.google.cloud.speech.v1.SpeechRecognitionResult.toObject(message.results[j], options);
|
3565 | }
|
3566 | if (message.totalBilledTime != null && message.hasOwnProperty("totalBilledTime"))
|
3567 | object.totalBilledTime = $root.google.protobuf.Duration.toObject(message.totalBilledTime, options);
|
3568 | return object;
|
3569 | };
|
3570 |
|
3571 | /**
|
3572 | * Converts this RecognizeResponse to JSON.
|
3573 | * @function toJSON
|
3574 | * @memberof google.cloud.speech.v1.RecognizeResponse
|
3575 | * @instance
|
3576 | * @returns {Object.<string,*>} JSON object
|
3577 | */
|
3578 | RecognizeResponse.prototype.toJSON = function toJSON() {
|
3579 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
3580 | };
|
3581 |
|
3582 | return RecognizeResponse;
|
3583 | })();
|
3584 |
|
3585 | v1.LongRunningRecognizeResponse = (function() {
|
3586 |
|
3587 | /**
|
3588 | * Properties of a LongRunningRecognizeResponse.
|
3589 | * @memberof google.cloud.speech.v1
|
3590 | * @interface ILongRunningRecognizeResponse
|
3591 | * @property {Array.<google.cloud.speech.v1.ISpeechRecognitionResult>|null} [results] LongRunningRecognizeResponse results
|
3592 | * @property {google.protobuf.IDuration|null} [totalBilledTime] LongRunningRecognizeResponse totalBilledTime
|
3593 | * @property {google.cloud.speech.v1.ITranscriptOutputConfig|null} [outputConfig] LongRunningRecognizeResponse outputConfig
|
3594 | * @property {google.rpc.IStatus|null} [outputError] LongRunningRecognizeResponse outputError
|
3595 | */
|
3596 |
|
3597 | /**
|
3598 | * Constructs a new LongRunningRecognizeResponse.
|
3599 | * @memberof google.cloud.speech.v1
|
3600 | * @classdesc Represents a LongRunningRecognizeResponse.
|
3601 | * @implements ILongRunningRecognizeResponse
|
3602 | * @constructor
|
3603 | * @param {google.cloud.speech.v1.ILongRunningRecognizeResponse=} [properties] Properties to set
|
3604 | */
|
3605 | function LongRunningRecognizeResponse(properties) {
|
3606 | this.results = [];
|
3607 | if (properties)
|
3608 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
3609 | if (properties[keys[i]] != null)
|
3610 | this[keys[i]] = properties[keys[i]];
|
3611 | }
|
3612 |
|
3613 | /**
|
3614 | * LongRunningRecognizeResponse results.
|
3615 | * @member {Array.<google.cloud.speech.v1.ISpeechRecognitionResult>} results
|
3616 | * @memberof google.cloud.speech.v1.LongRunningRecognizeResponse
|
3617 | * @instance
|
3618 | */
|
3619 | LongRunningRecognizeResponse.prototype.results = $util.emptyArray;
|
3620 |
|
3621 | /**
|
3622 | * LongRunningRecognizeResponse totalBilledTime.
|
3623 | * @member {google.protobuf.IDuration|null|undefined} totalBilledTime
|
3624 | * @memberof google.cloud.speech.v1.LongRunningRecognizeResponse
|
3625 | * @instance
|
3626 | */
|
3627 | LongRunningRecognizeResponse.prototype.totalBilledTime = null;
|
3628 |
|
3629 | /**
|
3630 | * LongRunningRecognizeResponse outputConfig.
|
3631 | * @member {google.cloud.speech.v1.ITranscriptOutputConfig|null|undefined} outputConfig
|
3632 | * @memberof google.cloud.speech.v1.LongRunningRecognizeResponse
|
3633 | * @instance
|
3634 | */
|
3635 | LongRunningRecognizeResponse.prototype.outputConfig = null;
|
3636 |
|
3637 | /**
|
3638 | * LongRunningRecognizeResponse outputError.
|
3639 | * @member {google.rpc.IStatus|null|undefined} outputError
|
3640 | * @memberof google.cloud.speech.v1.LongRunningRecognizeResponse
|
3641 | * @instance
|
3642 | */
|
3643 | LongRunningRecognizeResponse.prototype.outputError = null;
|
3644 |
|
3645 | /**
|
3646 | * Creates a new LongRunningRecognizeResponse instance using the specified properties.
|
3647 | * @function create
|
3648 | * @memberof google.cloud.speech.v1.LongRunningRecognizeResponse
|
3649 | * @static
|
3650 | * @param {google.cloud.speech.v1.ILongRunningRecognizeResponse=} [properties] Properties to set
|
3651 | * @returns {google.cloud.speech.v1.LongRunningRecognizeResponse} LongRunningRecognizeResponse instance
|
3652 | */
|
3653 | LongRunningRecognizeResponse.create = function create(properties) {
|
3654 | return new LongRunningRecognizeResponse(properties);
|
3655 | };
|
3656 |
|
3657 | /**
|
3658 | * Encodes the specified LongRunningRecognizeResponse message. Does not implicitly {@link google.cloud.speech.v1.LongRunningRecognizeResponse.verify|verify} messages.
|
3659 | * @function encode
|
3660 | * @memberof google.cloud.speech.v1.LongRunningRecognizeResponse
|
3661 | * @static
|
3662 | * @param {google.cloud.speech.v1.ILongRunningRecognizeResponse} message LongRunningRecognizeResponse message or plain object to encode
|
3663 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
3664 | * @returns {$protobuf.Writer} Writer
|
3665 | */
|
3666 | LongRunningRecognizeResponse.encode = function encode(message, writer) {
|
3667 | if (!writer)
|
3668 | writer = $Writer.create();
|
3669 | if (message.results != null && message.results.length)
|
3670 | for (var i = 0; i < message.results.length; ++i)
|
3671 | $root.google.cloud.speech.v1.SpeechRecognitionResult.encode(message.results[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
3672 | if (message.totalBilledTime != null && Object.hasOwnProperty.call(message, "totalBilledTime"))
|
3673 | $root.google.protobuf.Duration.encode(message.totalBilledTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
|
3674 | if (message.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig"))
|
3675 | $root.google.cloud.speech.v1.TranscriptOutputConfig.encode(message.outputConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
|
3676 | if (message.outputError != null && Object.hasOwnProperty.call(message, "outputError"))
|
3677 | $root.google.rpc.Status.encode(message.outputError, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();
|
3678 | return writer;
|
3679 | };
|
3680 |
|
3681 | /**
|
3682 | * Encodes the specified LongRunningRecognizeResponse message, length delimited. Does not implicitly {@link google.cloud.speech.v1.LongRunningRecognizeResponse.verify|verify} messages.
|
3683 | * @function encodeDelimited
|
3684 | * @memberof google.cloud.speech.v1.LongRunningRecognizeResponse
|
3685 | * @static
|
3686 | * @param {google.cloud.speech.v1.ILongRunningRecognizeResponse} message LongRunningRecognizeResponse message or plain object to encode
|
3687 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
3688 | * @returns {$protobuf.Writer} Writer
|
3689 | */
|
3690 | LongRunningRecognizeResponse.encodeDelimited = function encodeDelimited(message, writer) {
|
3691 | return this.encode(message, writer).ldelim();
|
3692 | };
|
3693 |
|
3694 | /**
|
3695 | * Decodes a LongRunningRecognizeResponse message from the specified reader or buffer.
|
3696 | * @function decode
|
3697 | * @memberof google.cloud.speech.v1.LongRunningRecognizeResponse
|
3698 | * @static
|
3699 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
3700 | * @param {number} [length] Message length if known beforehand
|
3701 | * @returns {google.cloud.speech.v1.LongRunningRecognizeResponse} LongRunningRecognizeResponse
|
3702 | * @throws {Error} If the payload is not a reader or valid buffer
|
3703 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
3704 | */
|
3705 | LongRunningRecognizeResponse.decode = function decode(reader, length) {
|
3706 | if (!(reader instanceof $Reader))
|
3707 | reader = $Reader.create(reader);
|
3708 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.LongRunningRecognizeResponse();
|
3709 | while (reader.pos < end) {
|
3710 | var tag = reader.uint32();
|
3711 | switch (tag >>> 3) {
|
3712 | case 2:
|
3713 | if (!(message.results && message.results.length))
|
3714 | message.results = [];
|
3715 | message.results.push($root.google.cloud.speech.v1.SpeechRecognitionResult.decode(reader, reader.uint32()));
|
3716 | break;
|
3717 | case 3:
|
3718 | message.totalBilledTime = $root.google.protobuf.Duration.decode(reader, reader.uint32());
|
3719 | break;
|
3720 | case 6:
|
3721 | message.outputConfig = $root.google.cloud.speech.v1.TranscriptOutputConfig.decode(reader, reader.uint32());
|
3722 | break;
|
3723 | case 7:
|
3724 | message.outputError = $root.google.rpc.Status.decode(reader, reader.uint32());
|
3725 | break;
|
3726 | default:
|
3727 | reader.skipType(tag & 7);
|
3728 | break;
|
3729 | }
|
3730 | }
|
3731 | return message;
|
3732 | };
|
3733 |
|
3734 | /**
|
3735 | * Decodes a LongRunningRecognizeResponse message from the specified reader or buffer, length delimited.
|
3736 | * @function decodeDelimited
|
3737 | * @memberof google.cloud.speech.v1.LongRunningRecognizeResponse
|
3738 | * @static
|
3739 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
3740 | * @returns {google.cloud.speech.v1.LongRunningRecognizeResponse} LongRunningRecognizeResponse
|
3741 | * @throws {Error} If the payload is not a reader or valid buffer
|
3742 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
3743 | */
|
3744 | LongRunningRecognizeResponse.decodeDelimited = function decodeDelimited(reader) {
|
3745 | if (!(reader instanceof $Reader))
|
3746 | reader = new $Reader(reader);
|
3747 | return this.decode(reader, reader.uint32());
|
3748 | };
|
3749 |
|
3750 | /**
|
3751 | * Verifies a LongRunningRecognizeResponse message.
|
3752 | * @function verify
|
3753 | * @memberof google.cloud.speech.v1.LongRunningRecognizeResponse
|
3754 | * @static
|
3755 | * @param {Object.<string,*>} message Plain object to verify
|
3756 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
3757 | */
|
3758 | LongRunningRecognizeResponse.verify = function verify(message) {
|
3759 | if (typeof message !== "object" || message === null)
|
3760 | return "object expected";
|
3761 | if (message.results != null && message.hasOwnProperty("results")) {
|
3762 | if (!Array.isArray(message.results))
|
3763 | return "results: array expected";
|
3764 | for (var i = 0; i < message.results.length; ++i) {
|
3765 | var error = $root.google.cloud.speech.v1.SpeechRecognitionResult.verify(message.results[i]);
|
3766 | if (error)
|
3767 | return "results." + error;
|
3768 | }
|
3769 | }
|
3770 | if (message.totalBilledTime != null && message.hasOwnProperty("totalBilledTime")) {
|
3771 | var error = $root.google.protobuf.Duration.verify(message.totalBilledTime);
|
3772 | if (error)
|
3773 | return "totalBilledTime." + error;
|
3774 | }
|
3775 | if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) {
|
3776 | var error = $root.google.cloud.speech.v1.TranscriptOutputConfig.verify(message.outputConfig);
|
3777 | if (error)
|
3778 | return "outputConfig." + error;
|
3779 | }
|
3780 | if (message.outputError != null && message.hasOwnProperty("outputError")) {
|
3781 | var error = $root.google.rpc.Status.verify(message.outputError);
|
3782 | if (error)
|
3783 | return "outputError." + error;
|
3784 | }
|
3785 | return null;
|
3786 | };
|
3787 |
|
3788 | /**
|
3789 | * Creates a LongRunningRecognizeResponse message from a plain object. Also converts values to their respective internal types.
|
3790 | * @function fromObject
|
3791 | * @memberof google.cloud.speech.v1.LongRunningRecognizeResponse
|
3792 | * @static
|
3793 | * @param {Object.<string,*>} object Plain object
|
3794 | * @returns {google.cloud.speech.v1.LongRunningRecognizeResponse} LongRunningRecognizeResponse
|
3795 | */
|
3796 | LongRunningRecognizeResponse.fromObject = function fromObject(object) {
|
3797 | if (object instanceof $root.google.cloud.speech.v1.LongRunningRecognizeResponse)
|
3798 | return object;
|
3799 | var message = new $root.google.cloud.speech.v1.LongRunningRecognizeResponse();
|
3800 | if (object.results) {
|
3801 | if (!Array.isArray(object.results))
|
3802 | throw TypeError(".google.cloud.speech.v1.LongRunningRecognizeResponse.results: array expected");
|
3803 | message.results = [];
|
3804 | for (var i = 0; i < object.results.length; ++i) {
|
3805 | if (typeof object.results[i] !== "object")
|
3806 | throw TypeError(".google.cloud.speech.v1.LongRunningRecognizeResponse.results: object expected");
|
3807 | message.results[i] = $root.google.cloud.speech.v1.SpeechRecognitionResult.fromObject(object.results[i]);
|
3808 | }
|
3809 | }
|
3810 | if (object.totalBilledTime != null) {
|
3811 | if (typeof object.totalBilledTime !== "object")
|
3812 | throw TypeError(".google.cloud.speech.v1.LongRunningRecognizeResponse.totalBilledTime: object expected");
|
3813 | message.totalBilledTime = $root.google.protobuf.Duration.fromObject(object.totalBilledTime);
|
3814 | }
|
3815 | if (object.outputConfig != null) {
|
3816 | if (typeof object.outputConfig !== "object")
|
3817 | throw TypeError(".google.cloud.speech.v1.LongRunningRecognizeResponse.outputConfig: object expected");
|
3818 | message.outputConfig = $root.google.cloud.speech.v1.TranscriptOutputConfig.fromObject(object.outputConfig);
|
3819 | }
|
3820 | if (object.outputError != null) {
|
3821 | if (typeof object.outputError !== "object")
|
3822 | throw TypeError(".google.cloud.speech.v1.LongRunningRecognizeResponse.outputError: object expected");
|
3823 | message.outputError = $root.google.rpc.Status.fromObject(object.outputError);
|
3824 | }
|
3825 | return message;
|
3826 | };
|
3827 |
|
3828 | /**
|
3829 | * Creates a plain object from a LongRunningRecognizeResponse message. Also converts values to other types if specified.
|
3830 | * @function toObject
|
3831 | * @memberof google.cloud.speech.v1.LongRunningRecognizeResponse
|
3832 | * @static
|
3833 | * @param {google.cloud.speech.v1.LongRunningRecognizeResponse} message LongRunningRecognizeResponse
|
3834 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
3835 | * @returns {Object.<string,*>} Plain object
|
3836 | */
|
3837 | LongRunningRecognizeResponse.toObject = function toObject(message, options) {
|
3838 | if (!options)
|
3839 | options = {};
|
3840 | var object = {};
|
3841 | if (options.arrays || options.defaults)
|
3842 | object.results = [];
|
3843 | if (options.defaults) {
|
3844 | object.totalBilledTime = null;
|
3845 | object.outputConfig = null;
|
3846 | object.outputError = null;
|
3847 | }
|
3848 | if (message.results && message.results.length) {
|
3849 | object.results = [];
|
3850 | for (var j = 0; j < message.results.length; ++j)
|
3851 | object.results[j] = $root.google.cloud.speech.v1.SpeechRecognitionResult.toObject(message.results[j], options);
|
3852 | }
|
3853 | if (message.totalBilledTime != null && message.hasOwnProperty("totalBilledTime"))
|
3854 | object.totalBilledTime = $root.google.protobuf.Duration.toObject(message.totalBilledTime, options);
|
3855 | if (message.outputConfig != null && message.hasOwnProperty("outputConfig"))
|
3856 | object.outputConfig = $root.google.cloud.speech.v1.TranscriptOutputConfig.toObject(message.outputConfig, options);
|
3857 | if (message.outputError != null && message.hasOwnProperty("outputError"))
|
3858 | object.outputError = $root.google.rpc.Status.toObject(message.outputError, options);
|
3859 | return object;
|
3860 | };
|
3861 |
|
3862 | /**
|
3863 | * Converts this LongRunningRecognizeResponse to JSON.
|
3864 | * @function toJSON
|
3865 | * @memberof google.cloud.speech.v1.LongRunningRecognizeResponse
|
3866 | * @instance
|
3867 | * @returns {Object.<string,*>} JSON object
|
3868 | */
|
3869 | LongRunningRecognizeResponse.prototype.toJSON = function toJSON() {
|
3870 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
3871 | };
|
3872 |
|
3873 | return LongRunningRecognizeResponse;
|
3874 | })();
|
3875 |
|
3876 | v1.LongRunningRecognizeMetadata = (function() {
|
3877 |
|
3878 | /**
|
3879 | * Properties of a LongRunningRecognizeMetadata.
|
3880 | * @memberof google.cloud.speech.v1
|
3881 | * @interface ILongRunningRecognizeMetadata
|
3882 | * @property {number|null} [progressPercent] LongRunningRecognizeMetadata progressPercent
|
3883 | * @property {google.protobuf.ITimestamp|null} [startTime] LongRunningRecognizeMetadata startTime
|
3884 | * @property {google.protobuf.ITimestamp|null} [lastUpdateTime] LongRunningRecognizeMetadata lastUpdateTime
|
3885 | * @property {string|null} [uri] LongRunningRecognizeMetadata uri
|
3886 | */
|
3887 |
|
3888 | /**
|
3889 | * Constructs a new LongRunningRecognizeMetadata.
|
3890 | * @memberof google.cloud.speech.v1
|
3891 | * @classdesc Represents a LongRunningRecognizeMetadata.
|
3892 | * @implements ILongRunningRecognizeMetadata
|
3893 | * @constructor
|
3894 | * @param {google.cloud.speech.v1.ILongRunningRecognizeMetadata=} [properties] Properties to set
|
3895 | */
|
3896 | function LongRunningRecognizeMetadata(properties) {
|
3897 | if (properties)
|
3898 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
3899 | if (properties[keys[i]] != null)
|
3900 | this[keys[i]] = properties[keys[i]];
|
3901 | }
|
3902 |
|
3903 | /**
|
3904 | * LongRunningRecognizeMetadata progressPercent.
|
3905 | * @member {number} progressPercent
|
3906 | * @memberof google.cloud.speech.v1.LongRunningRecognizeMetadata
|
3907 | * @instance
|
3908 | */
|
3909 | LongRunningRecognizeMetadata.prototype.progressPercent = 0;
|
3910 |
|
3911 | /**
|
3912 | * LongRunningRecognizeMetadata startTime.
|
3913 | * @member {google.protobuf.ITimestamp|null|undefined} startTime
|
3914 | * @memberof google.cloud.speech.v1.LongRunningRecognizeMetadata
|
3915 | * @instance
|
3916 | */
|
3917 | LongRunningRecognizeMetadata.prototype.startTime = null;
|
3918 |
|
3919 | /**
|
3920 | * LongRunningRecognizeMetadata lastUpdateTime.
|
3921 | * @member {google.protobuf.ITimestamp|null|undefined} lastUpdateTime
|
3922 | * @memberof google.cloud.speech.v1.LongRunningRecognizeMetadata
|
3923 | * @instance
|
3924 | */
|
3925 | LongRunningRecognizeMetadata.prototype.lastUpdateTime = null;
|
3926 |
|
3927 | /**
|
3928 | * LongRunningRecognizeMetadata uri.
|
3929 | * @member {string} uri
|
3930 | * @memberof google.cloud.speech.v1.LongRunningRecognizeMetadata
|
3931 | * @instance
|
3932 | */
|
3933 | LongRunningRecognizeMetadata.prototype.uri = "";
|
3934 |
|
3935 | /**
|
3936 | * Creates a new LongRunningRecognizeMetadata instance using the specified properties.
|
3937 | * @function create
|
3938 | * @memberof google.cloud.speech.v1.LongRunningRecognizeMetadata
|
3939 | * @static
|
3940 | * @param {google.cloud.speech.v1.ILongRunningRecognizeMetadata=} [properties] Properties to set
|
3941 | * @returns {google.cloud.speech.v1.LongRunningRecognizeMetadata} LongRunningRecognizeMetadata instance
|
3942 | */
|
3943 | LongRunningRecognizeMetadata.create = function create(properties) {
|
3944 | return new LongRunningRecognizeMetadata(properties);
|
3945 | };
|
3946 |
|
3947 | /**
|
3948 | * Encodes the specified LongRunningRecognizeMetadata message. Does not implicitly {@link google.cloud.speech.v1.LongRunningRecognizeMetadata.verify|verify} messages.
|
3949 | * @function encode
|
3950 | * @memberof google.cloud.speech.v1.LongRunningRecognizeMetadata
|
3951 | * @static
|
3952 | * @param {google.cloud.speech.v1.ILongRunningRecognizeMetadata} message LongRunningRecognizeMetadata message or plain object to encode
|
3953 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
3954 | * @returns {$protobuf.Writer} Writer
|
3955 | */
|
3956 | LongRunningRecognizeMetadata.encode = function encode(message, writer) {
|
3957 | if (!writer)
|
3958 | writer = $Writer.create();
|
3959 | if (message.progressPercent != null && Object.hasOwnProperty.call(message, "progressPercent"))
|
3960 | writer.uint32(/* id 1, wireType 0 =*/8).int32(message.progressPercent);
|
3961 | if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime"))
|
3962 | $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
3963 | if (message.lastUpdateTime != null && Object.hasOwnProperty.call(message, "lastUpdateTime"))
|
3964 | $root.google.protobuf.Timestamp.encode(message.lastUpdateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
|
3965 | if (message.uri != null && Object.hasOwnProperty.call(message, "uri"))
|
3966 | writer.uint32(/* id 4, wireType 2 =*/34).string(message.uri);
|
3967 | return writer;
|
3968 | };
|
3969 |
|
3970 | /**
|
3971 | * Encodes the specified LongRunningRecognizeMetadata message, length delimited. Does not implicitly {@link google.cloud.speech.v1.LongRunningRecognizeMetadata.verify|verify} messages.
|
3972 | * @function encodeDelimited
|
3973 | * @memberof google.cloud.speech.v1.LongRunningRecognizeMetadata
|
3974 | * @static
|
3975 | * @param {google.cloud.speech.v1.ILongRunningRecognizeMetadata} message LongRunningRecognizeMetadata message or plain object to encode
|
3976 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
3977 | * @returns {$protobuf.Writer} Writer
|
3978 | */
|
3979 | LongRunningRecognizeMetadata.encodeDelimited = function encodeDelimited(message, writer) {
|
3980 | return this.encode(message, writer).ldelim();
|
3981 | };
|
3982 |
|
3983 | /**
|
3984 | * Decodes a LongRunningRecognizeMetadata message from the specified reader or buffer.
|
3985 | * @function decode
|
3986 | * @memberof google.cloud.speech.v1.LongRunningRecognizeMetadata
|
3987 | * @static
|
3988 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
3989 | * @param {number} [length] Message length if known beforehand
|
3990 | * @returns {google.cloud.speech.v1.LongRunningRecognizeMetadata} LongRunningRecognizeMetadata
|
3991 | * @throws {Error} If the payload is not a reader or valid buffer
|
3992 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
3993 | */
|
3994 | LongRunningRecognizeMetadata.decode = function decode(reader, length) {
|
3995 | if (!(reader instanceof $Reader))
|
3996 | reader = $Reader.create(reader);
|
3997 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.LongRunningRecognizeMetadata();
|
3998 | while (reader.pos < end) {
|
3999 | var tag = reader.uint32();
|
4000 | switch (tag >>> 3) {
|
4001 | case 1:
|
4002 | message.progressPercent = reader.int32();
|
4003 | break;
|
4004 | case 2:
|
4005 | message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
|
4006 | break;
|
4007 | case 3:
|
4008 | message.lastUpdateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
|
4009 | break;
|
4010 | case 4:
|
4011 | message.uri = reader.string();
|
4012 | break;
|
4013 | default:
|
4014 | reader.skipType(tag & 7);
|
4015 | break;
|
4016 | }
|
4017 | }
|
4018 | return message;
|
4019 | };
|
4020 |
|
4021 | /**
|
4022 | * Decodes a LongRunningRecognizeMetadata message from the specified reader or buffer, length delimited.
|
4023 | * @function decodeDelimited
|
4024 | * @memberof google.cloud.speech.v1.LongRunningRecognizeMetadata
|
4025 | * @static
|
4026 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
4027 | * @returns {google.cloud.speech.v1.LongRunningRecognizeMetadata} LongRunningRecognizeMetadata
|
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 | LongRunningRecognizeMetadata.decodeDelimited = function decodeDelimited(reader) {
|
4032 | if (!(reader instanceof $Reader))
|
4033 | reader = new $Reader(reader);
|
4034 | return this.decode(reader, reader.uint32());
|
4035 | };
|
4036 |
|
4037 | /**
|
4038 | * Verifies a LongRunningRecognizeMetadata message.
|
4039 | * @function verify
|
4040 | * @memberof google.cloud.speech.v1.LongRunningRecognizeMetadata
|
4041 | * @static
|
4042 | * @param {Object.<string,*>} message Plain object to verify
|
4043 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
4044 | */
|
4045 | LongRunningRecognizeMetadata.verify = function verify(message) {
|
4046 | if (typeof message !== "object" || message === null)
|
4047 | return "object expected";
|
4048 | if (message.progressPercent != null && message.hasOwnProperty("progressPercent"))
|
4049 | if (!$util.isInteger(message.progressPercent))
|
4050 | return "progressPercent: integer expected";
|
4051 | if (message.startTime != null && message.hasOwnProperty("startTime")) {
|
4052 | var error = $root.google.protobuf.Timestamp.verify(message.startTime);
|
4053 | if (error)
|
4054 | return "startTime." + error;
|
4055 | }
|
4056 | if (message.lastUpdateTime != null && message.hasOwnProperty("lastUpdateTime")) {
|
4057 | var error = $root.google.protobuf.Timestamp.verify(message.lastUpdateTime);
|
4058 | if (error)
|
4059 | return "lastUpdateTime." + error;
|
4060 | }
|
4061 | if (message.uri != null && message.hasOwnProperty("uri"))
|
4062 | if (!$util.isString(message.uri))
|
4063 | return "uri: string expected";
|
4064 | return null;
|
4065 | };
|
4066 |
|
4067 | /**
|
4068 | * Creates a LongRunningRecognizeMetadata message from a plain object. Also converts values to their respective internal types.
|
4069 | * @function fromObject
|
4070 | * @memberof google.cloud.speech.v1.LongRunningRecognizeMetadata
|
4071 | * @static
|
4072 | * @param {Object.<string,*>} object Plain object
|
4073 | * @returns {google.cloud.speech.v1.LongRunningRecognizeMetadata} LongRunningRecognizeMetadata
|
4074 | */
|
4075 | LongRunningRecognizeMetadata.fromObject = function fromObject(object) {
|
4076 | if (object instanceof $root.google.cloud.speech.v1.LongRunningRecognizeMetadata)
|
4077 | return object;
|
4078 | var message = new $root.google.cloud.speech.v1.LongRunningRecognizeMetadata();
|
4079 | if (object.progressPercent != null)
|
4080 | message.progressPercent = object.progressPercent | 0;
|
4081 | if (object.startTime != null) {
|
4082 | if (typeof object.startTime !== "object")
|
4083 | throw TypeError(".google.cloud.speech.v1.LongRunningRecognizeMetadata.startTime: object expected");
|
4084 | message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime);
|
4085 | }
|
4086 | if (object.lastUpdateTime != null) {
|
4087 | if (typeof object.lastUpdateTime !== "object")
|
4088 | throw TypeError(".google.cloud.speech.v1.LongRunningRecognizeMetadata.lastUpdateTime: object expected");
|
4089 | message.lastUpdateTime = $root.google.protobuf.Timestamp.fromObject(object.lastUpdateTime);
|
4090 | }
|
4091 | if (object.uri != null)
|
4092 | message.uri = String(object.uri);
|
4093 | return message;
|
4094 | };
|
4095 |
|
4096 | /**
|
4097 | * Creates a plain object from a LongRunningRecognizeMetadata message. Also converts values to other types if specified.
|
4098 | * @function toObject
|
4099 | * @memberof google.cloud.speech.v1.LongRunningRecognizeMetadata
|
4100 | * @static
|
4101 | * @param {google.cloud.speech.v1.LongRunningRecognizeMetadata} message LongRunningRecognizeMetadata
|
4102 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
4103 | * @returns {Object.<string,*>} Plain object
|
4104 | */
|
4105 | LongRunningRecognizeMetadata.toObject = function toObject(message, options) {
|
4106 | if (!options)
|
4107 | options = {};
|
4108 | var object = {};
|
4109 | if (options.defaults) {
|
4110 | object.progressPercent = 0;
|
4111 | object.startTime = null;
|
4112 | object.lastUpdateTime = null;
|
4113 | object.uri = "";
|
4114 | }
|
4115 | if (message.progressPercent != null && message.hasOwnProperty("progressPercent"))
|
4116 | object.progressPercent = message.progressPercent;
|
4117 | if (message.startTime != null && message.hasOwnProperty("startTime"))
|
4118 | object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options);
|
4119 | if (message.lastUpdateTime != null && message.hasOwnProperty("lastUpdateTime"))
|
4120 | object.lastUpdateTime = $root.google.protobuf.Timestamp.toObject(message.lastUpdateTime, options);
|
4121 | if (message.uri != null && message.hasOwnProperty("uri"))
|
4122 | object.uri = message.uri;
|
4123 | return object;
|
4124 | };
|
4125 |
|
4126 | /**
|
4127 | * Converts this LongRunningRecognizeMetadata to JSON.
|
4128 | * @function toJSON
|
4129 | * @memberof google.cloud.speech.v1.LongRunningRecognizeMetadata
|
4130 | * @instance
|
4131 | * @returns {Object.<string,*>} JSON object
|
4132 | */
|
4133 | LongRunningRecognizeMetadata.prototype.toJSON = function toJSON() {
|
4134 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
4135 | };
|
4136 |
|
4137 | return LongRunningRecognizeMetadata;
|
4138 | })();
|
4139 |
|
4140 | v1.StreamingRecognizeResponse = (function() {
|
4141 |
|
4142 | /**
|
4143 | * Properties of a StreamingRecognizeResponse.
|
4144 | * @memberof google.cloud.speech.v1
|
4145 | * @interface IStreamingRecognizeResponse
|
4146 | * @property {google.rpc.IStatus|null} [error] StreamingRecognizeResponse error
|
4147 | * @property {Array.<google.cloud.speech.v1.IStreamingRecognitionResult>|null} [results] StreamingRecognizeResponse results
|
4148 | * @property {google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType|null} [speechEventType] StreamingRecognizeResponse speechEventType
|
4149 | * @property {google.protobuf.IDuration|null} [totalBilledTime] StreamingRecognizeResponse totalBilledTime
|
4150 | */
|
4151 |
|
4152 | /**
|
4153 | * Constructs a new StreamingRecognizeResponse.
|
4154 | * @memberof google.cloud.speech.v1
|
4155 | * @classdesc Represents a StreamingRecognizeResponse.
|
4156 | * @implements IStreamingRecognizeResponse
|
4157 | * @constructor
|
4158 | * @param {google.cloud.speech.v1.IStreamingRecognizeResponse=} [properties] Properties to set
|
4159 | */
|
4160 | function StreamingRecognizeResponse(properties) {
|
4161 | this.results = [];
|
4162 | if (properties)
|
4163 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
4164 | if (properties[keys[i]] != null)
|
4165 | this[keys[i]] = properties[keys[i]];
|
4166 | }
|
4167 |
|
4168 | /**
|
4169 | * StreamingRecognizeResponse error.
|
4170 | * @member {google.rpc.IStatus|null|undefined} error
|
4171 | * @memberof google.cloud.speech.v1.StreamingRecognizeResponse
|
4172 | * @instance
|
4173 | */
|
4174 | StreamingRecognizeResponse.prototype.error = null;
|
4175 |
|
4176 | /**
|
4177 | * StreamingRecognizeResponse results.
|
4178 | * @member {Array.<google.cloud.speech.v1.IStreamingRecognitionResult>} results
|
4179 | * @memberof google.cloud.speech.v1.StreamingRecognizeResponse
|
4180 | * @instance
|
4181 | */
|
4182 | StreamingRecognizeResponse.prototype.results = $util.emptyArray;
|
4183 |
|
4184 | /**
|
4185 | * StreamingRecognizeResponse speechEventType.
|
4186 | * @member {google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType} speechEventType
|
4187 | * @memberof google.cloud.speech.v1.StreamingRecognizeResponse
|
4188 | * @instance
|
4189 | */
|
4190 | StreamingRecognizeResponse.prototype.speechEventType = 0;
|
4191 |
|
4192 | /**
|
4193 | * StreamingRecognizeResponse totalBilledTime.
|
4194 | * @member {google.protobuf.IDuration|null|undefined} totalBilledTime
|
4195 | * @memberof google.cloud.speech.v1.StreamingRecognizeResponse
|
4196 | * @instance
|
4197 | */
|
4198 | StreamingRecognizeResponse.prototype.totalBilledTime = null;
|
4199 |
|
4200 | /**
|
4201 | * Creates a new StreamingRecognizeResponse instance using the specified properties.
|
4202 | * @function create
|
4203 | * @memberof google.cloud.speech.v1.StreamingRecognizeResponse
|
4204 | * @static
|
4205 | * @param {google.cloud.speech.v1.IStreamingRecognizeResponse=} [properties] Properties to set
|
4206 | * @returns {google.cloud.speech.v1.StreamingRecognizeResponse} StreamingRecognizeResponse instance
|
4207 | */
|
4208 | StreamingRecognizeResponse.create = function create(properties) {
|
4209 | return new StreamingRecognizeResponse(properties);
|
4210 | };
|
4211 |
|
4212 | /**
|
4213 | * Encodes the specified StreamingRecognizeResponse message. Does not implicitly {@link google.cloud.speech.v1.StreamingRecognizeResponse.verify|verify} messages.
|
4214 | * @function encode
|
4215 | * @memberof google.cloud.speech.v1.StreamingRecognizeResponse
|
4216 | * @static
|
4217 | * @param {google.cloud.speech.v1.IStreamingRecognizeResponse} message StreamingRecognizeResponse message or plain object to encode
|
4218 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
4219 | * @returns {$protobuf.Writer} Writer
|
4220 | */
|
4221 | StreamingRecognizeResponse.encode = function encode(message, writer) {
|
4222 | if (!writer)
|
4223 | writer = $Writer.create();
|
4224 | if (message.error != null && Object.hasOwnProperty.call(message, "error"))
|
4225 | $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
4226 | if (message.results != null && message.results.length)
|
4227 | for (var i = 0; i < message.results.length; ++i)
|
4228 | $root.google.cloud.speech.v1.StreamingRecognitionResult.encode(message.results[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
4229 | if (message.speechEventType != null && Object.hasOwnProperty.call(message, "speechEventType"))
|
4230 | writer.uint32(/* id 4, wireType 0 =*/32).int32(message.speechEventType);
|
4231 | if (message.totalBilledTime != null && Object.hasOwnProperty.call(message, "totalBilledTime"))
|
4232 | $root.google.protobuf.Duration.encode(message.totalBilledTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
|
4233 | return writer;
|
4234 | };
|
4235 |
|
4236 | /**
|
4237 | * Encodes the specified StreamingRecognizeResponse message, length delimited. Does not implicitly {@link google.cloud.speech.v1.StreamingRecognizeResponse.verify|verify} messages.
|
4238 | * @function encodeDelimited
|
4239 | * @memberof google.cloud.speech.v1.StreamingRecognizeResponse
|
4240 | * @static
|
4241 | * @param {google.cloud.speech.v1.IStreamingRecognizeResponse} message StreamingRecognizeResponse message or plain object to encode
|
4242 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
4243 | * @returns {$protobuf.Writer} Writer
|
4244 | */
|
4245 | StreamingRecognizeResponse.encodeDelimited = function encodeDelimited(message, writer) {
|
4246 | return this.encode(message, writer).ldelim();
|
4247 | };
|
4248 |
|
4249 | /**
|
4250 | * Decodes a StreamingRecognizeResponse message from the specified reader or buffer.
|
4251 | * @function decode
|
4252 | * @memberof google.cloud.speech.v1.StreamingRecognizeResponse
|
4253 | * @static
|
4254 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
4255 | * @param {number} [length] Message length if known beforehand
|
4256 | * @returns {google.cloud.speech.v1.StreamingRecognizeResponse} StreamingRecognizeResponse
|
4257 | * @throws {Error} If the payload is not a reader or valid buffer
|
4258 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
4259 | */
|
4260 | StreamingRecognizeResponse.decode = function decode(reader, length) {
|
4261 | if (!(reader instanceof $Reader))
|
4262 | reader = $Reader.create(reader);
|
4263 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.StreamingRecognizeResponse();
|
4264 | while (reader.pos < end) {
|
4265 | var tag = reader.uint32();
|
4266 | switch (tag >>> 3) {
|
4267 | case 1:
|
4268 | message.error = $root.google.rpc.Status.decode(reader, reader.uint32());
|
4269 | break;
|
4270 | case 2:
|
4271 | if (!(message.results && message.results.length))
|
4272 | message.results = [];
|
4273 | message.results.push($root.google.cloud.speech.v1.StreamingRecognitionResult.decode(reader, reader.uint32()));
|
4274 | break;
|
4275 | case 4:
|
4276 | message.speechEventType = reader.int32();
|
4277 | break;
|
4278 | case 5:
|
4279 | message.totalBilledTime = $root.google.protobuf.Duration.decode(reader, reader.uint32());
|
4280 | break;
|
4281 | default:
|
4282 | reader.skipType(tag & 7);
|
4283 | break;
|
4284 | }
|
4285 | }
|
4286 | return message;
|
4287 | };
|
4288 |
|
4289 | /**
|
4290 | * Decodes a StreamingRecognizeResponse message from the specified reader or buffer, length delimited.
|
4291 | * @function decodeDelimited
|
4292 | * @memberof google.cloud.speech.v1.StreamingRecognizeResponse
|
4293 | * @static
|
4294 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
4295 | * @returns {google.cloud.speech.v1.StreamingRecognizeResponse} StreamingRecognizeResponse
|
4296 | * @throws {Error} If the payload is not a reader or valid buffer
|
4297 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
4298 | */
|
4299 | StreamingRecognizeResponse.decodeDelimited = function decodeDelimited(reader) {
|
4300 | if (!(reader instanceof $Reader))
|
4301 | reader = new $Reader(reader);
|
4302 | return this.decode(reader, reader.uint32());
|
4303 | };
|
4304 |
|
4305 | /**
|
4306 | * Verifies a StreamingRecognizeResponse message.
|
4307 | * @function verify
|
4308 | * @memberof google.cloud.speech.v1.StreamingRecognizeResponse
|
4309 | * @static
|
4310 | * @param {Object.<string,*>} message Plain object to verify
|
4311 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
4312 | */
|
4313 | StreamingRecognizeResponse.verify = function verify(message) {
|
4314 | if (typeof message !== "object" || message === null)
|
4315 | return "object expected";
|
4316 | if (message.error != null && message.hasOwnProperty("error")) {
|
4317 | var error = $root.google.rpc.Status.verify(message.error);
|
4318 | if (error)
|
4319 | return "error." + error;
|
4320 | }
|
4321 | if (message.results != null && message.hasOwnProperty("results")) {
|
4322 | if (!Array.isArray(message.results))
|
4323 | return "results: array expected";
|
4324 | for (var i = 0; i < message.results.length; ++i) {
|
4325 | var error = $root.google.cloud.speech.v1.StreamingRecognitionResult.verify(message.results[i]);
|
4326 | if (error)
|
4327 | return "results." + error;
|
4328 | }
|
4329 | }
|
4330 | if (message.speechEventType != null && message.hasOwnProperty("speechEventType"))
|
4331 | switch (message.speechEventType) {
|
4332 | default:
|
4333 | return "speechEventType: enum value expected";
|
4334 | case 0:
|
4335 | case 1:
|
4336 | break;
|
4337 | }
|
4338 | if (message.totalBilledTime != null && message.hasOwnProperty("totalBilledTime")) {
|
4339 | var error = $root.google.protobuf.Duration.verify(message.totalBilledTime);
|
4340 | if (error)
|
4341 | return "totalBilledTime." + error;
|
4342 | }
|
4343 | return null;
|
4344 | };
|
4345 |
|
4346 | /**
|
4347 | * Creates a StreamingRecognizeResponse message from a plain object. Also converts values to their respective internal types.
|
4348 | * @function fromObject
|
4349 | * @memberof google.cloud.speech.v1.StreamingRecognizeResponse
|
4350 | * @static
|
4351 | * @param {Object.<string,*>} object Plain object
|
4352 | * @returns {google.cloud.speech.v1.StreamingRecognizeResponse} StreamingRecognizeResponse
|
4353 | */
|
4354 | StreamingRecognizeResponse.fromObject = function fromObject(object) {
|
4355 | if (object instanceof $root.google.cloud.speech.v1.StreamingRecognizeResponse)
|
4356 | return object;
|
4357 | var message = new $root.google.cloud.speech.v1.StreamingRecognizeResponse();
|
4358 | if (object.error != null) {
|
4359 | if (typeof object.error !== "object")
|
4360 | throw TypeError(".google.cloud.speech.v1.StreamingRecognizeResponse.error: object expected");
|
4361 | message.error = $root.google.rpc.Status.fromObject(object.error);
|
4362 | }
|
4363 | if (object.results) {
|
4364 | if (!Array.isArray(object.results))
|
4365 | throw TypeError(".google.cloud.speech.v1.StreamingRecognizeResponse.results: array expected");
|
4366 | message.results = [];
|
4367 | for (var i = 0; i < object.results.length; ++i) {
|
4368 | if (typeof object.results[i] !== "object")
|
4369 | throw TypeError(".google.cloud.speech.v1.StreamingRecognizeResponse.results: object expected");
|
4370 | message.results[i] = $root.google.cloud.speech.v1.StreamingRecognitionResult.fromObject(object.results[i]);
|
4371 | }
|
4372 | }
|
4373 | switch (object.speechEventType) {
|
4374 | case "SPEECH_EVENT_UNSPECIFIED":
|
4375 | case 0:
|
4376 | message.speechEventType = 0;
|
4377 | break;
|
4378 | case "END_OF_SINGLE_UTTERANCE":
|
4379 | case 1:
|
4380 | message.speechEventType = 1;
|
4381 | break;
|
4382 | }
|
4383 | if (object.totalBilledTime != null) {
|
4384 | if (typeof object.totalBilledTime !== "object")
|
4385 | throw TypeError(".google.cloud.speech.v1.StreamingRecognizeResponse.totalBilledTime: object expected");
|
4386 | message.totalBilledTime = $root.google.protobuf.Duration.fromObject(object.totalBilledTime);
|
4387 | }
|
4388 | return message;
|
4389 | };
|
4390 |
|
4391 | /**
|
4392 | * Creates a plain object from a StreamingRecognizeResponse message. Also converts values to other types if specified.
|
4393 | * @function toObject
|
4394 | * @memberof google.cloud.speech.v1.StreamingRecognizeResponse
|
4395 | * @static
|
4396 | * @param {google.cloud.speech.v1.StreamingRecognizeResponse} message StreamingRecognizeResponse
|
4397 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
4398 | * @returns {Object.<string,*>} Plain object
|
4399 | */
|
4400 | StreamingRecognizeResponse.toObject = function toObject(message, options) {
|
4401 | if (!options)
|
4402 | options = {};
|
4403 | var object = {};
|
4404 | if (options.arrays || options.defaults)
|
4405 | object.results = [];
|
4406 | if (options.defaults) {
|
4407 | object.error = null;
|
4408 | object.speechEventType = options.enums === String ? "SPEECH_EVENT_UNSPECIFIED" : 0;
|
4409 | object.totalBilledTime = null;
|
4410 | }
|
4411 | if (message.error != null && message.hasOwnProperty("error"))
|
4412 | object.error = $root.google.rpc.Status.toObject(message.error, options);
|
4413 | if (message.results && message.results.length) {
|
4414 | object.results = [];
|
4415 | for (var j = 0; j < message.results.length; ++j)
|
4416 | object.results[j] = $root.google.cloud.speech.v1.StreamingRecognitionResult.toObject(message.results[j], options);
|
4417 | }
|
4418 | if (message.speechEventType != null && message.hasOwnProperty("speechEventType"))
|
4419 | object.speechEventType = options.enums === String ? $root.google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType[message.speechEventType] : message.speechEventType;
|
4420 | if (message.totalBilledTime != null && message.hasOwnProperty("totalBilledTime"))
|
4421 | object.totalBilledTime = $root.google.protobuf.Duration.toObject(message.totalBilledTime, options);
|
4422 | return object;
|
4423 | };
|
4424 |
|
4425 | /**
|
4426 | * Converts this StreamingRecognizeResponse to JSON.
|
4427 | * @function toJSON
|
4428 | * @memberof google.cloud.speech.v1.StreamingRecognizeResponse
|
4429 | * @instance
|
4430 | * @returns {Object.<string,*>} JSON object
|
4431 | */
|
4432 | StreamingRecognizeResponse.prototype.toJSON = function toJSON() {
|
4433 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
4434 | };
|
4435 |
|
4436 | /**
|
4437 | * SpeechEventType enum.
|
4438 | * @name google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType
|
4439 | * @enum {number}
|
4440 | * @property {number} SPEECH_EVENT_UNSPECIFIED=0 SPEECH_EVENT_UNSPECIFIED value
|
4441 | * @property {number} END_OF_SINGLE_UTTERANCE=1 END_OF_SINGLE_UTTERANCE value
|
4442 | */
|
4443 | StreamingRecognizeResponse.SpeechEventType = (function() {
|
4444 | var valuesById = {}, values = Object.create(valuesById);
|
4445 | values[valuesById[0] = "SPEECH_EVENT_UNSPECIFIED"] = 0;
|
4446 | values[valuesById[1] = "END_OF_SINGLE_UTTERANCE"] = 1;
|
4447 | return values;
|
4448 | })();
|
4449 |
|
4450 | return StreamingRecognizeResponse;
|
4451 | })();
|
4452 |
|
4453 | v1.StreamingRecognitionResult = (function() {
|
4454 |
|
4455 | /**
|
4456 | * Properties of a StreamingRecognitionResult.
|
4457 | * @memberof google.cloud.speech.v1
|
4458 | * @interface IStreamingRecognitionResult
|
4459 | * @property {Array.<google.cloud.speech.v1.ISpeechRecognitionAlternative>|null} [alternatives] StreamingRecognitionResult alternatives
|
4460 | * @property {boolean|null} [isFinal] StreamingRecognitionResult isFinal
|
4461 | * @property {number|null} [stability] StreamingRecognitionResult stability
|
4462 | * @property {google.protobuf.IDuration|null} [resultEndTime] StreamingRecognitionResult resultEndTime
|
4463 | * @property {number|null} [channelTag] StreamingRecognitionResult channelTag
|
4464 | * @property {string|null} [languageCode] StreamingRecognitionResult languageCode
|
4465 | */
|
4466 |
|
4467 | /**
|
4468 | * Constructs a new StreamingRecognitionResult.
|
4469 | * @memberof google.cloud.speech.v1
|
4470 | * @classdesc Represents a StreamingRecognitionResult.
|
4471 | * @implements IStreamingRecognitionResult
|
4472 | * @constructor
|
4473 | * @param {google.cloud.speech.v1.IStreamingRecognitionResult=} [properties] Properties to set
|
4474 | */
|
4475 | function StreamingRecognitionResult(properties) {
|
4476 | this.alternatives = [];
|
4477 | if (properties)
|
4478 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
4479 | if (properties[keys[i]] != null)
|
4480 | this[keys[i]] = properties[keys[i]];
|
4481 | }
|
4482 |
|
4483 | /**
|
4484 | * StreamingRecognitionResult alternatives.
|
4485 | * @member {Array.<google.cloud.speech.v1.ISpeechRecognitionAlternative>} alternatives
|
4486 | * @memberof google.cloud.speech.v1.StreamingRecognitionResult
|
4487 | * @instance
|
4488 | */
|
4489 | StreamingRecognitionResult.prototype.alternatives = $util.emptyArray;
|
4490 |
|
4491 | /**
|
4492 | * StreamingRecognitionResult isFinal.
|
4493 | * @member {boolean} isFinal
|
4494 | * @memberof google.cloud.speech.v1.StreamingRecognitionResult
|
4495 | * @instance
|
4496 | */
|
4497 | StreamingRecognitionResult.prototype.isFinal = false;
|
4498 |
|
4499 | /**
|
4500 | * StreamingRecognitionResult stability.
|
4501 | * @member {number} stability
|
4502 | * @memberof google.cloud.speech.v1.StreamingRecognitionResult
|
4503 | * @instance
|
4504 | */
|
4505 | StreamingRecognitionResult.prototype.stability = 0;
|
4506 |
|
4507 | /**
|
4508 | * StreamingRecognitionResult resultEndTime.
|
4509 | * @member {google.protobuf.IDuration|null|undefined} resultEndTime
|
4510 | * @memberof google.cloud.speech.v1.StreamingRecognitionResult
|
4511 | * @instance
|
4512 | */
|
4513 | StreamingRecognitionResult.prototype.resultEndTime = null;
|
4514 |
|
4515 | /**
|
4516 | * StreamingRecognitionResult channelTag.
|
4517 | * @member {number} channelTag
|
4518 | * @memberof google.cloud.speech.v1.StreamingRecognitionResult
|
4519 | * @instance
|
4520 | */
|
4521 | StreamingRecognitionResult.prototype.channelTag = 0;
|
4522 |
|
4523 | /**
|
4524 | * StreamingRecognitionResult languageCode.
|
4525 | * @member {string} languageCode
|
4526 | * @memberof google.cloud.speech.v1.StreamingRecognitionResult
|
4527 | * @instance
|
4528 | */
|
4529 | StreamingRecognitionResult.prototype.languageCode = "";
|
4530 |
|
4531 | /**
|
4532 | * Creates a new StreamingRecognitionResult instance using the specified properties.
|
4533 | * @function create
|
4534 | * @memberof google.cloud.speech.v1.StreamingRecognitionResult
|
4535 | * @static
|
4536 | * @param {google.cloud.speech.v1.IStreamingRecognitionResult=} [properties] Properties to set
|
4537 | * @returns {google.cloud.speech.v1.StreamingRecognitionResult} StreamingRecognitionResult instance
|
4538 | */
|
4539 | StreamingRecognitionResult.create = function create(properties) {
|
4540 | return new StreamingRecognitionResult(properties);
|
4541 | };
|
4542 |
|
4543 | /**
|
4544 | * Encodes the specified StreamingRecognitionResult message. Does not implicitly {@link google.cloud.speech.v1.StreamingRecognitionResult.verify|verify} messages.
|
4545 | * @function encode
|
4546 | * @memberof google.cloud.speech.v1.StreamingRecognitionResult
|
4547 | * @static
|
4548 | * @param {google.cloud.speech.v1.IStreamingRecognitionResult} message StreamingRecognitionResult message or plain object to encode
|
4549 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
4550 | * @returns {$protobuf.Writer} Writer
|
4551 | */
|
4552 | StreamingRecognitionResult.encode = function encode(message, writer) {
|
4553 | if (!writer)
|
4554 | writer = $Writer.create();
|
4555 | if (message.alternatives != null && message.alternatives.length)
|
4556 | for (var i = 0; i < message.alternatives.length; ++i)
|
4557 | $root.google.cloud.speech.v1.SpeechRecognitionAlternative.encode(message.alternatives[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
4558 | if (message.isFinal != null && Object.hasOwnProperty.call(message, "isFinal"))
|
4559 | writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isFinal);
|
4560 | if (message.stability != null && Object.hasOwnProperty.call(message, "stability"))
|
4561 | writer.uint32(/* id 3, wireType 5 =*/29).float(message.stability);
|
4562 | if (message.resultEndTime != null && Object.hasOwnProperty.call(message, "resultEndTime"))
|
4563 | $root.google.protobuf.Duration.encode(message.resultEndTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
|
4564 | if (message.channelTag != null && Object.hasOwnProperty.call(message, "channelTag"))
|
4565 | writer.uint32(/* id 5, wireType 0 =*/40).int32(message.channelTag);
|
4566 | if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode"))
|
4567 | writer.uint32(/* id 6, wireType 2 =*/50).string(message.languageCode);
|
4568 | return writer;
|
4569 | };
|
4570 |
|
4571 | /**
|
4572 | * Encodes the specified StreamingRecognitionResult message, length delimited. Does not implicitly {@link google.cloud.speech.v1.StreamingRecognitionResult.verify|verify} messages.
|
4573 | * @function encodeDelimited
|
4574 | * @memberof google.cloud.speech.v1.StreamingRecognitionResult
|
4575 | * @static
|
4576 | * @param {google.cloud.speech.v1.IStreamingRecognitionResult} message StreamingRecognitionResult message or plain object to encode
|
4577 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
4578 | * @returns {$protobuf.Writer} Writer
|
4579 | */
|
4580 | StreamingRecognitionResult.encodeDelimited = function encodeDelimited(message, writer) {
|
4581 | return this.encode(message, writer).ldelim();
|
4582 | };
|
4583 |
|
4584 | /**
|
4585 | * Decodes a StreamingRecognitionResult message from the specified reader or buffer.
|
4586 | * @function decode
|
4587 | * @memberof google.cloud.speech.v1.StreamingRecognitionResult
|
4588 | * @static
|
4589 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
4590 | * @param {number} [length] Message length if known beforehand
|
4591 | * @returns {google.cloud.speech.v1.StreamingRecognitionResult} StreamingRecognitionResult
|
4592 | * @throws {Error} If the payload is not a reader or valid buffer
|
4593 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
4594 | */
|
4595 | StreamingRecognitionResult.decode = function decode(reader, length) {
|
4596 | if (!(reader instanceof $Reader))
|
4597 | reader = $Reader.create(reader);
|
4598 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.StreamingRecognitionResult();
|
4599 | while (reader.pos < end) {
|
4600 | var tag = reader.uint32();
|
4601 | switch (tag >>> 3) {
|
4602 | case 1:
|
4603 | if (!(message.alternatives && message.alternatives.length))
|
4604 | message.alternatives = [];
|
4605 | message.alternatives.push($root.google.cloud.speech.v1.SpeechRecognitionAlternative.decode(reader, reader.uint32()));
|
4606 | break;
|
4607 | case 2:
|
4608 | message.isFinal = reader.bool();
|
4609 | break;
|
4610 | case 3:
|
4611 | message.stability = reader.float();
|
4612 | break;
|
4613 | case 4:
|
4614 | message.resultEndTime = $root.google.protobuf.Duration.decode(reader, reader.uint32());
|
4615 | break;
|
4616 | case 5:
|
4617 | message.channelTag = reader.int32();
|
4618 | break;
|
4619 | case 6:
|
4620 | message.languageCode = reader.string();
|
4621 | break;
|
4622 | default:
|
4623 | reader.skipType(tag & 7);
|
4624 | break;
|
4625 | }
|
4626 | }
|
4627 | return message;
|
4628 | };
|
4629 |
|
4630 | /**
|
4631 | * Decodes a StreamingRecognitionResult message from the specified reader or buffer, length delimited.
|
4632 | * @function decodeDelimited
|
4633 | * @memberof google.cloud.speech.v1.StreamingRecognitionResult
|
4634 | * @static
|
4635 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
4636 | * @returns {google.cloud.speech.v1.StreamingRecognitionResult} StreamingRecognitionResult
|
4637 | * @throws {Error} If the payload is not a reader or valid buffer
|
4638 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
4639 | */
|
4640 | StreamingRecognitionResult.decodeDelimited = function decodeDelimited(reader) {
|
4641 | if (!(reader instanceof $Reader))
|
4642 | reader = new $Reader(reader);
|
4643 | return this.decode(reader, reader.uint32());
|
4644 | };
|
4645 |
|
4646 | /**
|
4647 | * Verifies a StreamingRecognitionResult message.
|
4648 | * @function verify
|
4649 | * @memberof google.cloud.speech.v1.StreamingRecognitionResult
|
4650 | * @static
|
4651 | * @param {Object.<string,*>} message Plain object to verify
|
4652 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
4653 | */
|
4654 | StreamingRecognitionResult.verify = function verify(message) {
|
4655 | if (typeof message !== "object" || message === null)
|
4656 | return "object expected";
|
4657 | if (message.alternatives != null && message.hasOwnProperty("alternatives")) {
|
4658 | if (!Array.isArray(message.alternatives))
|
4659 | return "alternatives: array expected";
|
4660 | for (var i = 0; i < message.alternatives.length; ++i) {
|
4661 | var error = $root.google.cloud.speech.v1.SpeechRecognitionAlternative.verify(message.alternatives[i]);
|
4662 | if (error)
|
4663 | return "alternatives." + error;
|
4664 | }
|
4665 | }
|
4666 | if (message.isFinal != null && message.hasOwnProperty("isFinal"))
|
4667 | if (typeof message.isFinal !== "boolean")
|
4668 | return "isFinal: boolean expected";
|
4669 | if (message.stability != null && message.hasOwnProperty("stability"))
|
4670 | if (typeof message.stability !== "number")
|
4671 | return "stability: number expected";
|
4672 | if (message.resultEndTime != null && message.hasOwnProperty("resultEndTime")) {
|
4673 | var error = $root.google.protobuf.Duration.verify(message.resultEndTime);
|
4674 | if (error)
|
4675 | return "resultEndTime." + error;
|
4676 | }
|
4677 | if (message.channelTag != null && message.hasOwnProperty("channelTag"))
|
4678 | if (!$util.isInteger(message.channelTag))
|
4679 | return "channelTag: integer expected";
|
4680 | if (message.languageCode != null && message.hasOwnProperty("languageCode"))
|
4681 | if (!$util.isString(message.languageCode))
|
4682 | return "languageCode: string expected";
|
4683 | return null;
|
4684 | };
|
4685 |
|
4686 | /**
|
4687 | * Creates a StreamingRecognitionResult message from a plain object. Also converts values to their respective internal types.
|
4688 | * @function fromObject
|
4689 | * @memberof google.cloud.speech.v1.StreamingRecognitionResult
|
4690 | * @static
|
4691 | * @param {Object.<string,*>} object Plain object
|
4692 | * @returns {google.cloud.speech.v1.StreamingRecognitionResult} StreamingRecognitionResult
|
4693 | */
|
4694 | StreamingRecognitionResult.fromObject = function fromObject(object) {
|
4695 | if (object instanceof $root.google.cloud.speech.v1.StreamingRecognitionResult)
|
4696 | return object;
|
4697 | var message = new $root.google.cloud.speech.v1.StreamingRecognitionResult();
|
4698 | if (object.alternatives) {
|
4699 | if (!Array.isArray(object.alternatives))
|
4700 | throw TypeError(".google.cloud.speech.v1.StreamingRecognitionResult.alternatives: array expected");
|
4701 | message.alternatives = [];
|
4702 | for (var i = 0; i < object.alternatives.length; ++i) {
|
4703 | if (typeof object.alternatives[i] !== "object")
|
4704 | throw TypeError(".google.cloud.speech.v1.StreamingRecognitionResult.alternatives: object expected");
|
4705 | message.alternatives[i] = $root.google.cloud.speech.v1.SpeechRecognitionAlternative.fromObject(object.alternatives[i]);
|
4706 | }
|
4707 | }
|
4708 | if (object.isFinal != null)
|
4709 | message.isFinal = Boolean(object.isFinal);
|
4710 | if (object.stability != null)
|
4711 | message.stability = Number(object.stability);
|
4712 | if (object.resultEndTime != null) {
|
4713 | if (typeof object.resultEndTime !== "object")
|
4714 | throw TypeError(".google.cloud.speech.v1.StreamingRecognitionResult.resultEndTime: object expected");
|
4715 | message.resultEndTime = $root.google.protobuf.Duration.fromObject(object.resultEndTime);
|
4716 | }
|
4717 | if (object.channelTag != null)
|
4718 | message.channelTag = object.channelTag | 0;
|
4719 | if (object.languageCode != null)
|
4720 | message.languageCode = String(object.languageCode);
|
4721 | return message;
|
4722 | };
|
4723 |
|
4724 | /**
|
4725 | * Creates a plain object from a StreamingRecognitionResult message. Also converts values to other types if specified.
|
4726 | * @function toObject
|
4727 | * @memberof google.cloud.speech.v1.StreamingRecognitionResult
|
4728 | * @static
|
4729 | * @param {google.cloud.speech.v1.StreamingRecognitionResult} message StreamingRecognitionResult
|
4730 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
4731 | * @returns {Object.<string,*>} Plain object
|
4732 | */
|
4733 | StreamingRecognitionResult.toObject = function toObject(message, options) {
|
4734 | if (!options)
|
4735 | options = {};
|
4736 | var object = {};
|
4737 | if (options.arrays || options.defaults)
|
4738 | object.alternatives = [];
|
4739 | if (options.defaults) {
|
4740 | object.isFinal = false;
|
4741 | object.stability = 0;
|
4742 | object.resultEndTime = null;
|
4743 | object.channelTag = 0;
|
4744 | object.languageCode = "";
|
4745 | }
|
4746 | if (message.alternatives && message.alternatives.length) {
|
4747 | object.alternatives = [];
|
4748 | for (var j = 0; j < message.alternatives.length; ++j)
|
4749 | object.alternatives[j] = $root.google.cloud.speech.v1.SpeechRecognitionAlternative.toObject(message.alternatives[j], options);
|
4750 | }
|
4751 | if (message.isFinal != null && message.hasOwnProperty("isFinal"))
|
4752 | object.isFinal = message.isFinal;
|
4753 | if (message.stability != null && message.hasOwnProperty("stability"))
|
4754 | object.stability = options.json && !isFinite(message.stability) ? String(message.stability) : message.stability;
|
4755 | if (message.resultEndTime != null && message.hasOwnProperty("resultEndTime"))
|
4756 | object.resultEndTime = $root.google.protobuf.Duration.toObject(message.resultEndTime, options);
|
4757 | if (message.channelTag != null && message.hasOwnProperty("channelTag"))
|
4758 | object.channelTag = message.channelTag;
|
4759 | if (message.languageCode != null && message.hasOwnProperty("languageCode"))
|
4760 | object.languageCode = message.languageCode;
|
4761 | return object;
|
4762 | };
|
4763 |
|
4764 | /**
|
4765 | * Converts this StreamingRecognitionResult to JSON.
|
4766 | * @function toJSON
|
4767 | * @memberof google.cloud.speech.v1.StreamingRecognitionResult
|
4768 | * @instance
|
4769 | * @returns {Object.<string,*>} JSON object
|
4770 | */
|
4771 | StreamingRecognitionResult.prototype.toJSON = function toJSON() {
|
4772 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
4773 | };
|
4774 |
|
4775 | return StreamingRecognitionResult;
|
4776 | })();
|
4777 |
|
4778 | v1.SpeechRecognitionResult = (function() {
|
4779 |
|
4780 | /**
|
4781 | * Properties of a SpeechRecognitionResult.
|
4782 | * @memberof google.cloud.speech.v1
|
4783 | * @interface ISpeechRecognitionResult
|
4784 | * @property {Array.<google.cloud.speech.v1.ISpeechRecognitionAlternative>|null} [alternatives] SpeechRecognitionResult alternatives
|
4785 | * @property {number|null} [channelTag] SpeechRecognitionResult channelTag
|
4786 | * @property {google.protobuf.IDuration|null} [resultEndTime] SpeechRecognitionResult resultEndTime
|
4787 | * @property {string|null} [languageCode] SpeechRecognitionResult languageCode
|
4788 | */
|
4789 |
|
4790 | /**
|
4791 | * Constructs a new SpeechRecognitionResult.
|
4792 | * @memberof google.cloud.speech.v1
|
4793 | * @classdesc Represents a SpeechRecognitionResult.
|
4794 | * @implements ISpeechRecognitionResult
|
4795 | * @constructor
|
4796 | * @param {google.cloud.speech.v1.ISpeechRecognitionResult=} [properties] Properties to set
|
4797 | */
|
4798 | function SpeechRecognitionResult(properties) {
|
4799 | this.alternatives = [];
|
4800 | if (properties)
|
4801 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
4802 | if (properties[keys[i]] != null)
|
4803 | this[keys[i]] = properties[keys[i]];
|
4804 | }
|
4805 |
|
4806 | /**
|
4807 | * SpeechRecognitionResult alternatives.
|
4808 | * @member {Array.<google.cloud.speech.v1.ISpeechRecognitionAlternative>} alternatives
|
4809 | * @memberof google.cloud.speech.v1.SpeechRecognitionResult
|
4810 | * @instance
|
4811 | */
|
4812 | SpeechRecognitionResult.prototype.alternatives = $util.emptyArray;
|
4813 |
|
4814 | /**
|
4815 | * SpeechRecognitionResult channelTag.
|
4816 | * @member {number} channelTag
|
4817 | * @memberof google.cloud.speech.v1.SpeechRecognitionResult
|
4818 | * @instance
|
4819 | */
|
4820 | SpeechRecognitionResult.prototype.channelTag = 0;
|
4821 |
|
4822 | /**
|
4823 | * SpeechRecognitionResult resultEndTime.
|
4824 | * @member {google.protobuf.IDuration|null|undefined} resultEndTime
|
4825 | * @memberof google.cloud.speech.v1.SpeechRecognitionResult
|
4826 | * @instance
|
4827 | */
|
4828 | SpeechRecognitionResult.prototype.resultEndTime = null;
|
4829 |
|
4830 | /**
|
4831 | * SpeechRecognitionResult languageCode.
|
4832 | * @member {string} languageCode
|
4833 | * @memberof google.cloud.speech.v1.SpeechRecognitionResult
|
4834 | * @instance
|
4835 | */
|
4836 | SpeechRecognitionResult.prototype.languageCode = "";
|
4837 |
|
4838 | /**
|
4839 | * Creates a new SpeechRecognitionResult instance using the specified properties.
|
4840 | * @function create
|
4841 | * @memberof google.cloud.speech.v1.SpeechRecognitionResult
|
4842 | * @static
|
4843 | * @param {google.cloud.speech.v1.ISpeechRecognitionResult=} [properties] Properties to set
|
4844 | * @returns {google.cloud.speech.v1.SpeechRecognitionResult} SpeechRecognitionResult instance
|
4845 | */
|
4846 | SpeechRecognitionResult.create = function create(properties) {
|
4847 | return new SpeechRecognitionResult(properties);
|
4848 | };
|
4849 |
|
4850 | /**
|
4851 | * Encodes the specified SpeechRecognitionResult message. Does not implicitly {@link google.cloud.speech.v1.SpeechRecognitionResult.verify|verify} messages.
|
4852 | * @function encode
|
4853 | * @memberof google.cloud.speech.v1.SpeechRecognitionResult
|
4854 | * @static
|
4855 | * @param {google.cloud.speech.v1.ISpeechRecognitionResult} message SpeechRecognitionResult message or plain object to encode
|
4856 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
4857 | * @returns {$protobuf.Writer} Writer
|
4858 | */
|
4859 | SpeechRecognitionResult.encode = function encode(message, writer) {
|
4860 | if (!writer)
|
4861 | writer = $Writer.create();
|
4862 | if (message.alternatives != null && message.alternatives.length)
|
4863 | for (var i = 0; i < message.alternatives.length; ++i)
|
4864 | $root.google.cloud.speech.v1.SpeechRecognitionAlternative.encode(message.alternatives[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
4865 | if (message.channelTag != null && Object.hasOwnProperty.call(message, "channelTag"))
|
4866 | writer.uint32(/* id 2, wireType 0 =*/16).int32(message.channelTag);
|
4867 | if (message.resultEndTime != null && Object.hasOwnProperty.call(message, "resultEndTime"))
|
4868 | $root.google.protobuf.Duration.encode(message.resultEndTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
|
4869 | if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode"))
|
4870 | writer.uint32(/* id 5, wireType 2 =*/42).string(message.languageCode);
|
4871 | return writer;
|
4872 | };
|
4873 |
|
4874 | /**
|
4875 | * Encodes the specified SpeechRecognitionResult message, length delimited. Does not implicitly {@link google.cloud.speech.v1.SpeechRecognitionResult.verify|verify} messages.
|
4876 | * @function encodeDelimited
|
4877 | * @memberof google.cloud.speech.v1.SpeechRecognitionResult
|
4878 | * @static
|
4879 | * @param {google.cloud.speech.v1.ISpeechRecognitionResult} message SpeechRecognitionResult message or plain object to encode
|
4880 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
4881 | * @returns {$protobuf.Writer} Writer
|
4882 | */
|
4883 | SpeechRecognitionResult.encodeDelimited = function encodeDelimited(message, writer) {
|
4884 | return this.encode(message, writer).ldelim();
|
4885 | };
|
4886 |
|
4887 | /**
|
4888 | * Decodes a SpeechRecognitionResult message from the specified reader or buffer.
|
4889 | * @function decode
|
4890 | * @memberof google.cloud.speech.v1.SpeechRecognitionResult
|
4891 | * @static
|
4892 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
4893 | * @param {number} [length] Message length if known beforehand
|
4894 | * @returns {google.cloud.speech.v1.SpeechRecognitionResult} SpeechRecognitionResult
|
4895 | * @throws {Error} If the payload is not a reader or valid buffer
|
4896 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
4897 | */
|
4898 | SpeechRecognitionResult.decode = function decode(reader, length) {
|
4899 | if (!(reader instanceof $Reader))
|
4900 | reader = $Reader.create(reader);
|
4901 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.SpeechRecognitionResult();
|
4902 | while (reader.pos < end) {
|
4903 | var tag = reader.uint32();
|
4904 | switch (tag >>> 3) {
|
4905 | case 1:
|
4906 | if (!(message.alternatives && message.alternatives.length))
|
4907 | message.alternatives = [];
|
4908 | message.alternatives.push($root.google.cloud.speech.v1.SpeechRecognitionAlternative.decode(reader, reader.uint32()));
|
4909 | break;
|
4910 | case 2:
|
4911 | message.channelTag = reader.int32();
|
4912 | break;
|
4913 | case 4:
|
4914 | message.resultEndTime = $root.google.protobuf.Duration.decode(reader, reader.uint32());
|
4915 | break;
|
4916 | case 5:
|
4917 | message.languageCode = reader.string();
|
4918 | break;
|
4919 | default:
|
4920 | reader.skipType(tag & 7);
|
4921 | break;
|
4922 | }
|
4923 | }
|
4924 | return message;
|
4925 | };
|
4926 |
|
4927 | /**
|
4928 | * Decodes a SpeechRecognitionResult message from the specified reader or buffer, length delimited.
|
4929 | * @function decodeDelimited
|
4930 | * @memberof google.cloud.speech.v1.SpeechRecognitionResult
|
4931 | * @static
|
4932 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
4933 | * @returns {google.cloud.speech.v1.SpeechRecognitionResult} SpeechRecognitionResult
|
4934 | * @throws {Error} If the payload is not a reader or valid buffer
|
4935 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
4936 | */
|
4937 | SpeechRecognitionResult.decodeDelimited = function decodeDelimited(reader) {
|
4938 | if (!(reader instanceof $Reader))
|
4939 | reader = new $Reader(reader);
|
4940 | return this.decode(reader, reader.uint32());
|
4941 | };
|
4942 |
|
4943 | /**
|
4944 | * Verifies a SpeechRecognitionResult message.
|
4945 | * @function verify
|
4946 | * @memberof google.cloud.speech.v1.SpeechRecognitionResult
|
4947 | * @static
|
4948 | * @param {Object.<string,*>} message Plain object to verify
|
4949 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
4950 | */
|
4951 | SpeechRecognitionResult.verify = function verify(message) {
|
4952 | if (typeof message !== "object" || message === null)
|
4953 | return "object expected";
|
4954 | if (message.alternatives != null && message.hasOwnProperty("alternatives")) {
|
4955 | if (!Array.isArray(message.alternatives))
|
4956 | return "alternatives: array expected";
|
4957 | for (var i = 0; i < message.alternatives.length; ++i) {
|
4958 | var error = $root.google.cloud.speech.v1.SpeechRecognitionAlternative.verify(message.alternatives[i]);
|
4959 | if (error)
|
4960 | return "alternatives." + error;
|
4961 | }
|
4962 | }
|
4963 | if (message.channelTag != null && message.hasOwnProperty("channelTag"))
|
4964 | if (!$util.isInteger(message.channelTag))
|
4965 | return "channelTag: integer expected";
|
4966 | if (message.resultEndTime != null && message.hasOwnProperty("resultEndTime")) {
|
4967 | var error = $root.google.protobuf.Duration.verify(message.resultEndTime);
|
4968 | if (error)
|
4969 | return "resultEndTime." + error;
|
4970 | }
|
4971 | if (message.languageCode != null && message.hasOwnProperty("languageCode"))
|
4972 | if (!$util.isString(message.languageCode))
|
4973 | return "languageCode: string expected";
|
4974 | return null;
|
4975 | };
|
4976 |
|
4977 | /**
|
4978 | * Creates a SpeechRecognitionResult message from a plain object. Also converts values to their respective internal types.
|
4979 | * @function fromObject
|
4980 | * @memberof google.cloud.speech.v1.SpeechRecognitionResult
|
4981 | * @static
|
4982 | * @param {Object.<string,*>} object Plain object
|
4983 | * @returns {google.cloud.speech.v1.SpeechRecognitionResult} SpeechRecognitionResult
|
4984 | */
|
4985 | SpeechRecognitionResult.fromObject = function fromObject(object) {
|
4986 | if (object instanceof $root.google.cloud.speech.v1.SpeechRecognitionResult)
|
4987 | return object;
|
4988 | var message = new $root.google.cloud.speech.v1.SpeechRecognitionResult();
|
4989 | if (object.alternatives) {
|
4990 | if (!Array.isArray(object.alternatives))
|
4991 | throw TypeError(".google.cloud.speech.v1.SpeechRecognitionResult.alternatives: array expected");
|
4992 | message.alternatives = [];
|
4993 | for (var i = 0; i < object.alternatives.length; ++i) {
|
4994 | if (typeof object.alternatives[i] !== "object")
|
4995 | throw TypeError(".google.cloud.speech.v1.SpeechRecognitionResult.alternatives: object expected");
|
4996 | message.alternatives[i] = $root.google.cloud.speech.v1.SpeechRecognitionAlternative.fromObject(object.alternatives[i]);
|
4997 | }
|
4998 | }
|
4999 | if (object.channelTag != null)
|
5000 | message.channelTag = object.channelTag | 0;
|
5001 | if (object.resultEndTime != null) {
|
5002 | if (typeof object.resultEndTime !== "object")
|
5003 | throw TypeError(".google.cloud.speech.v1.SpeechRecognitionResult.resultEndTime: object expected");
|
5004 | message.resultEndTime = $root.google.protobuf.Duration.fromObject(object.resultEndTime);
|
5005 | }
|
5006 | if (object.languageCode != null)
|
5007 | message.languageCode = String(object.languageCode);
|
5008 | return message;
|
5009 | };
|
5010 |
|
5011 | /**
|
5012 | * Creates a plain object from a SpeechRecognitionResult message. Also converts values to other types if specified.
|
5013 | * @function toObject
|
5014 | * @memberof google.cloud.speech.v1.SpeechRecognitionResult
|
5015 | * @static
|
5016 | * @param {google.cloud.speech.v1.SpeechRecognitionResult} message SpeechRecognitionResult
|
5017 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
5018 | * @returns {Object.<string,*>} Plain object
|
5019 | */
|
5020 | SpeechRecognitionResult.toObject = function toObject(message, options) {
|
5021 | if (!options)
|
5022 | options = {};
|
5023 | var object = {};
|
5024 | if (options.arrays || options.defaults)
|
5025 | object.alternatives = [];
|
5026 | if (options.defaults) {
|
5027 | object.channelTag = 0;
|
5028 | object.resultEndTime = null;
|
5029 | object.languageCode = "";
|
5030 | }
|
5031 | if (message.alternatives && message.alternatives.length) {
|
5032 | object.alternatives = [];
|
5033 | for (var j = 0; j < message.alternatives.length; ++j)
|
5034 | object.alternatives[j] = $root.google.cloud.speech.v1.SpeechRecognitionAlternative.toObject(message.alternatives[j], options);
|
5035 | }
|
5036 | if (message.channelTag != null && message.hasOwnProperty("channelTag"))
|
5037 | object.channelTag = message.channelTag;
|
5038 | if (message.resultEndTime != null && message.hasOwnProperty("resultEndTime"))
|
5039 | object.resultEndTime = $root.google.protobuf.Duration.toObject(message.resultEndTime, options);
|
5040 | if (message.languageCode != null && message.hasOwnProperty("languageCode"))
|
5041 | object.languageCode = message.languageCode;
|
5042 | return object;
|
5043 | };
|
5044 |
|
5045 | /**
|
5046 | * Converts this SpeechRecognitionResult to JSON.
|
5047 | * @function toJSON
|
5048 | * @memberof google.cloud.speech.v1.SpeechRecognitionResult
|
5049 | * @instance
|
5050 | * @returns {Object.<string,*>} JSON object
|
5051 | */
|
5052 | SpeechRecognitionResult.prototype.toJSON = function toJSON() {
|
5053 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
5054 | };
|
5055 |
|
5056 | return SpeechRecognitionResult;
|
5057 | })();
|
5058 |
|
5059 | v1.SpeechRecognitionAlternative = (function() {
|
5060 |
|
5061 | /**
|
5062 | * Properties of a SpeechRecognitionAlternative.
|
5063 | * @memberof google.cloud.speech.v1
|
5064 | * @interface ISpeechRecognitionAlternative
|
5065 | * @property {string|null} [transcript] SpeechRecognitionAlternative transcript
|
5066 | * @property {number|null} [confidence] SpeechRecognitionAlternative confidence
|
5067 | * @property {Array.<google.cloud.speech.v1.IWordInfo>|null} [words] SpeechRecognitionAlternative words
|
5068 | */
|
5069 |
|
5070 | /**
|
5071 | * Constructs a new SpeechRecognitionAlternative.
|
5072 | * @memberof google.cloud.speech.v1
|
5073 | * @classdesc Represents a SpeechRecognitionAlternative.
|
5074 | * @implements ISpeechRecognitionAlternative
|
5075 | * @constructor
|
5076 | * @param {google.cloud.speech.v1.ISpeechRecognitionAlternative=} [properties] Properties to set
|
5077 | */
|
5078 | function SpeechRecognitionAlternative(properties) {
|
5079 | this.words = [];
|
5080 | if (properties)
|
5081 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
5082 | if (properties[keys[i]] != null)
|
5083 | this[keys[i]] = properties[keys[i]];
|
5084 | }
|
5085 |
|
5086 | /**
|
5087 | * SpeechRecognitionAlternative transcript.
|
5088 | * @member {string} transcript
|
5089 | * @memberof google.cloud.speech.v1.SpeechRecognitionAlternative
|
5090 | * @instance
|
5091 | */
|
5092 | SpeechRecognitionAlternative.prototype.transcript = "";
|
5093 |
|
5094 | /**
|
5095 | * SpeechRecognitionAlternative confidence.
|
5096 | * @member {number} confidence
|
5097 | * @memberof google.cloud.speech.v1.SpeechRecognitionAlternative
|
5098 | * @instance
|
5099 | */
|
5100 | SpeechRecognitionAlternative.prototype.confidence = 0;
|
5101 |
|
5102 | /**
|
5103 | * SpeechRecognitionAlternative words.
|
5104 | * @member {Array.<google.cloud.speech.v1.IWordInfo>} words
|
5105 | * @memberof google.cloud.speech.v1.SpeechRecognitionAlternative
|
5106 | * @instance
|
5107 | */
|
5108 | SpeechRecognitionAlternative.prototype.words = $util.emptyArray;
|
5109 |
|
5110 | /**
|
5111 | * Creates a new SpeechRecognitionAlternative instance using the specified properties.
|
5112 | * @function create
|
5113 | * @memberof google.cloud.speech.v1.SpeechRecognitionAlternative
|
5114 | * @static
|
5115 | * @param {google.cloud.speech.v1.ISpeechRecognitionAlternative=} [properties] Properties to set
|
5116 | * @returns {google.cloud.speech.v1.SpeechRecognitionAlternative} SpeechRecognitionAlternative instance
|
5117 | */
|
5118 | SpeechRecognitionAlternative.create = function create(properties) {
|
5119 | return new SpeechRecognitionAlternative(properties);
|
5120 | };
|
5121 |
|
5122 | /**
|
5123 | * Encodes the specified SpeechRecognitionAlternative message. Does not implicitly {@link google.cloud.speech.v1.SpeechRecognitionAlternative.verify|verify} messages.
|
5124 | * @function encode
|
5125 | * @memberof google.cloud.speech.v1.SpeechRecognitionAlternative
|
5126 | * @static
|
5127 | * @param {google.cloud.speech.v1.ISpeechRecognitionAlternative} message SpeechRecognitionAlternative message or plain object to encode
|
5128 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
5129 | * @returns {$protobuf.Writer} Writer
|
5130 | */
|
5131 | SpeechRecognitionAlternative.encode = function encode(message, writer) {
|
5132 | if (!writer)
|
5133 | writer = $Writer.create();
|
5134 | if (message.transcript != null && Object.hasOwnProperty.call(message, "transcript"))
|
5135 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.transcript);
|
5136 | if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence"))
|
5137 | writer.uint32(/* id 2, wireType 5 =*/21).float(message.confidence);
|
5138 | if (message.words != null && message.words.length)
|
5139 | for (var i = 0; i < message.words.length; ++i)
|
5140 | $root.google.cloud.speech.v1.WordInfo.encode(message.words[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
|
5141 | return writer;
|
5142 | };
|
5143 |
|
5144 | /**
|
5145 | * Encodes the specified SpeechRecognitionAlternative message, length delimited. Does not implicitly {@link google.cloud.speech.v1.SpeechRecognitionAlternative.verify|verify} messages.
|
5146 | * @function encodeDelimited
|
5147 | * @memberof google.cloud.speech.v1.SpeechRecognitionAlternative
|
5148 | * @static
|
5149 | * @param {google.cloud.speech.v1.ISpeechRecognitionAlternative} message SpeechRecognitionAlternative message or plain object to encode
|
5150 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
5151 | * @returns {$protobuf.Writer} Writer
|
5152 | */
|
5153 | SpeechRecognitionAlternative.encodeDelimited = function encodeDelimited(message, writer) {
|
5154 | return this.encode(message, writer).ldelim();
|
5155 | };
|
5156 |
|
5157 | /**
|
5158 | * Decodes a SpeechRecognitionAlternative message from the specified reader or buffer.
|
5159 | * @function decode
|
5160 | * @memberof google.cloud.speech.v1.SpeechRecognitionAlternative
|
5161 | * @static
|
5162 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
5163 | * @param {number} [length] Message length if known beforehand
|
5164 | * @returns {google.cloud.speech.v1.SpeechRecognitionAlternative} SpeechRecognitionAlternative
|
5165 | * @throws {Error} If the payload is not a reader or valid buffer
|
5166 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
5167 | */
|
5168 | SpeechRecognitionAlternative.decode = function decode(reader, length) {
|
5169 | if (!(reader instanceof $Reader))
|
5170 | reader = $Reader.create(reader);
|
5171 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.SpeechRecognitionAlternative();
|
5172 | while (reader.pos < end) {
|
5173 | var tag = reader.uint32();
|
5174 | switch (tag >>> 3) {
|
5175 | case 1:
|
5176 | message.transcript = reader.string();
|
5177 | break;
|
5178 | case 2:
|
5179 | message.confidence = reader.float();
|
5180 | break;
|
5181 | case 3:
|
5182 | if (!(message.words && message.words.length))
|
5183 | message.words = [];
|
5184 | message.words.push($root.google.cloud.speech.v1.WordInfo.decode(reader, reader.uint32()));
|
5185 | break;
|
5186 | default:
|
5187 | reader.skipType(tag & 7);
|
5188 | break;
|
5189 | }
|
5190 | }
|
5191 | return message;
|
5192 | };
|
5193 |
|
5194 | /**
|
5195 | * Decodes a SpeechRecognitionAlternative message from the specified reader or buffer, length delimited.
|
5196 | * @function decodeDelimited
|
5197 | * @memberof google.cloud.speech.v1.SpeechRecognitionAlternative
|
5198 | * @static
|
5199 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
5200 | * @returns {google.cloud.speech.v1.SpeechRecognitionAlternative} SpeechRecognitionAlternative
|
5201 | * @throws {Error} If the payload is not a reader or valid buffer
|
5202 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
5203 | */
|
5204 | SpeechRecognitionAlternative.decodeDelimited = function decodeDelimited(reader) {
|
5205 | if (!(reader instanceof $Reader))
|
5206 | reader = new $Reader(reader);
|
5207 | return this.decode(reader, reader.uint32());
|
5208 | };
|
5209 |
|
5210 | /**
|
5211 | * Verifies a SpeechRecognitionAlternative message.
|
5212 | * @function verify
|
5213 | * @memberof google.cloud.speech.v1.SpeechRecognitionAlternative
|
5214 | * @static
|
5215 | * @param {Object.<string,*>} message Plain object to verify
|
5216 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
5217 | */
|
5218 | SpeechRecognitionAlternative.verify = function verify(message) {
|
5219 | if (typeof message !== "object" || message === null)
|
5220 | return "object expected";
|
5221 | if (message.transcript != null && message.hasOwnProperty("transcript"))
|
5222 | if (!$util.isString(message.transcript))
|
5223 | return "transcript: string expected";
|
5224 | if (message.confidence != null && message.hasOwnProperty("confidence"))
|
5225 | if (typeof message.confidence !== "number")
|
5226 | return "confidence: number expected";
|
5227 | if (message.words != null && message.hasOwnProperty("words")) {
|
5228 | if (!Array.isArray(message.words))
|
5229 | return "words: array expected";
|
5230 | for (var i = 0; i < message.words.length; ++i) {
|
5231 | var error = $root.google.cloud.speech.v1.WordInfo.verify(message.words[i]);
|
5232 | if (error)
|
5233 | return "words." + error;
|
5234 | }
|
5235 | }
|
5236 | return null;
|
5237 | };
|
5238 |
|
5239 | /**
|
5240 | * Creates a SpeechRecognitionAlternative message from a plain object. Also converts values to their respective internal types.
|
5241 | * @function fromObject
|
5242 | * @memberof google.cloud.speech.v1.SpeechRecognitionAlternative
|
5243 | * @static
|
5244 | * @param {Object.<string,*>} object Plain object
|
5245 | * @returns {google.cloud.speech.v1.SpeechRecognitionAlternative} SpeechRecognitionAlternative
|
5246 | */
|
5247 | SpeechRecognitionAlternative.fromObject = function fromObject(object) {
|
5248 | if (object instanceof $root.google.cloud.speech.v1.SpeechRecognitionAlternative)
|
5249 | return object;
|
5250 | var message = new $root.google.cloud.speech.v1.SpeechRecognitionAlternative();
|
5251 | if (object.transcript != null)
|
5252 | message.transcript = String(object.transcript);
|
5253 | if (object.confidence != null)
|
5254 | message.confidence = Number(object.confidence);
|
5255 | if (object.words) {
|
5256 | if (!Array.isArray(object.words))
|
5257 | throw TypeError(".google.cloud.speech.v1.SpeechRecognitionAlternative.words: array expected");
|
5258 | message.words = [];
|
5259 | for (var i = 0; i < object.words.length; ++i) {
|
5260 | if (typeof object.words[i] !== "object")
|
5261 | throw TypeError(".google.cloud.speech.v1.SpeechRecognitionAlternative.words: object expected");
|
5262 | message.words[i] = $root.google.cloud.speech.v1.WordInfo.fromObject(object.words[i]);
|
5263 | }
|
5264 | }
|
5265 | return message;
|
5266 | };
|
5267 |
|
5268 | /**
|
5269 | * Creates a plain object from a SpeechRecognitionAlternative message. Also converts values to other types if specified.
|
5270 | * @function toObject
|
5271 | * @memberof google.cloud.speech.v1.SpeechRecognitionAlternative
|
5272 | * @static
|
5273 | * @param {google.cloud.speech.v1.SpeechRecognitionAlternative} message SpeechRecognitionAlternative
|
5274 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
5275 | * @returns {Object.<string,*>} Plain object
|
5276 | */
|
5277 | SpeechRecognitionAlternative.toObject = function toObject(message, options) {
|
5278 | if (!options)
|
5279 | options = {};
|
5280 | var object = {};
|
5281 | if (options.arrays || options.defaults)
|
5282 | object.words = [];
|
5283 | if (options.defaults) {
|
5284 | object.transcript = "";
|
5285 | object.confidence = 0;
|
5286 | }
|
5287 | if (message.transcript != null && message.hasOwnProperty("transcript"))
|
5288 | object.transcript = message.transcript;
|
5289 | if (message.confidence != null && message.hasOwnProperty("confidence"))
|
5290 | object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence;
|
5291 | if (message.words && message.words.length) {
|
5292 | object.words = [];
|
5293 | for (var j = 0; j < message.words.length; ++j)
|
5294 | object.words[j] = $root.google.cloud.speech.v1.WordInfo.toObject(message.words[j], options);
|
5295 | }
|
5296 | return object;
|
5297 | };
|
5298 |
|
5299 | /**
|
5300 | * Converts this SpeechRecognitionAlternative to JSON.
|
5301 | * @function toJSON
|
5302 | * @memberof google.cloud.speech.v1.SpeechRecognitionAlternative
|
5303 | * @instance
|
5304 | * @returns {Object.<string,*>} JSON object
|
5305 | */
|
5306 | SpeechRecognitionAlternative.prototype.toJSON = function toJSON() {
|
5307 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
5308 | };
|
5309 |
|
5310 | return SpeechRecognitionAlternative;
|
5311 | })();
|
5312 |
|
5313 | v1.WordInfo = (function() {
|
5314 |
|
5315 | /**
|
5316 | * Properties of a WordInfo.
|
5317 | * @memberof google.cloud.speech.v1
|
5318 | * @interface IWordInfo
|
5319 | * @property {google.protobuf.IDuration|null} [startTime] WordInfo startTime
|
5320 | * @property {google.protobuf.IDuration|null} [endTime] WordInfo endTime
|
5321 | * @property {string|null} [word] WordInfo word
|
5322 | * @property {number|null} [confidence] WordInfo confidence
|
5323 | * @property {number|null} [speakerTag] WordInfo speakerTag
|
5324 | */
|
5325 |
|
5326 | /**
|
5327 | * Constructs a new WordInfo.
|
5328 | * @memberof google.cloud.speech.v1
|
5329 | * @classdesc Represents a WordInfo.
|
5330 | * @implements IWordInfo
|
5331 | * @constructor
|
5332 | * @param {google.cloud.speech.v1.IWordInfo=} [properties] Properties to set
|
5333 | */
|
5334 | function WordInfo(properties) {
|
5335 | if (properties)
|
5336 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
5337 | if (properties[keys[i]] != null)
|
5338 | this[keys[i]] = properties[keys[i]];
|
5339 | }
|
5340 |
|
5341 | /**
|
5342 | * WordInfo startTime.
|
5343 | * @member {google.protobuf.IDuration|null|undefined} startTime
|
5344 | * @memberof google.cloud.speech.v1.WordInfo
|
5345 | * @instance
|
5346 | */
|
5347 | WordInfo.prototype.startTime = null;
|
5348 |
|
5349 | /**
|
5350 | * WordInfo endTime.
|
5351 | * @member {google.protobuf.IDuration|null|undefined} endTime
|
5352 | * @memberof google.cloud.speech.v1.WordInfo
|
5353 | * @instance
|
5354 | */
|
5355 | WordInfo.prototype.endTime = null;
|
5356 |
|
5357 | /**
|
5358 | * WordInfo word.
|
5359 | * @member {string} word
|
5360 | * @memberof google.cloud.speech.v1.WordInfo
|
5361 | * @instance
|
5362 | */
|
5363 | WordInfo.prototype.word = "";
|
5364 |
|
5365 | /**
|
5366 | * WordInfo confidence.
|
5367 | * @member {number} confidence
|
5368 | * @memberof google.cloud.speech.v1.WordInfo
|
5369 | * @instance
|
5370 | */
|
5371 | WordInfo.prototype.confidence = 0;
|
5372 |
|
5373 | /**
|
5374 | * WordInfo speakerTag.
|
5375 | * @member {number} speakerTag
|
5376 | * @memberof google.cloud.speech.v1.WordInfo
|
5377 | * @instance
|
5378 | */
|
5379 | WordInfo.prototype.speakerTag = 0;
|
5380 |
|
5381 | /**
|
5382 | * Creates a new WordInfo instance using the specified properties.
|
5383 | * @function create
|
5384 | * @memberof google.cloud.speech.v1.WordInfo
|
5385 | * @static
|
5386 | * @param {google.cloud.speech.v1.IWordInfo=} [properties] Properties to set
|
5387 | * @returns {google.cloud.speech.v1.WordInfo} WordInfo instance
|
5388 | */
|
5389 | WordInfo.create = function create(properties) {
|
5390 | return new WordInfo(properties);
|
5391 | };
|
5392 |
|
5393 | /**
|
5394 | * Encodes the specified WordInfo message. Does not implicitly {@link google.cloud.speech.v1.WordInfo.verify|verify} messages.
|
5395 | * @function encode
|
5396 | * @memberof google.cloud.speech.v1.WordInfo
|
5397 | * @static
|
5398 | * @param {google.cloud.speech.v1.IWordInfo} message WordInfo message or plain object to encode
|
5399 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
5400 | * @returns {$protobuf.Writer} Writer
|
5401 | */
|
5402 | WordInfo.encode = function encode(message, writer) {
|
5403 | if (!writer)
|
5404 | writer = $Writer.create();
|
5405 | if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime"))
|
5406 | $root.google.protobuf.Duration.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
5407 | if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime"))
|
5408 | $root.google.protobuf.Duration.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
5409 | if (message.word != null && Object.hasOwnProperty.call(message, "word"))
|
5410 | writer.uint32(/* id 3, wireType 2 =*/26).string(message.word);
|
5411 | if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence"))
|
5412 | writer.uint32(/* id 4, wireType 5 =*/37).float(message.confidence);
|
5413 | if (message.speakerTag != null && Object.hasOwnProperty.call(message, "speakerTag"))
|
5414 | writer.uint32(/* id 5, wireType 0 =*/40).int32(message.speakerTag);
|
5415 | return writer;
|
5416 | };
|
5417 |
|
5418 | /**
|
5419 | * Encodes the specified WordInfo message, length delimited. Does not implicitly {@link google.cloud.speech.v1.WordInfo.verify|verify} messages.
|
5420 | * @function encodeDelimited
|
5421 | * @memberof google.cloud.speech.v1.WordInfo
|
5422 | * @static
|
5423 | * @param {google.cloud.speech.v1.IWordInfo} message WordInfo message or plain object to encode
|
5424 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
5425 | * @returns {$protobuf.Writer} Writer
|
5426 | */
|
5427 | WordInfo.encodeDelimited = function encodeDelimited(message, writer) {
|
5428 | return this.encode(message, writer).ldelim();
|
5429 | };
|
5430 |
|
5431 | /**
|
5432 | * Decodes a WordInfo message from the specified reader or buffer.
|
5433 | * @function decode
|
5434 | * @memberof google.cloud.speech.v1.WordInfo
|
5435 | * @static
|
5436 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
5437 | * @param {number} [length] Message length if known beforehand
|
5438 | * @returns {google.cloud.speech.v1.WordInfo} WordInfo
|
5439 | * @throws {Error} If the payload is not a reader or valid buffer
|
5440 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
5441 | */
|
5442 | WordInfo.decode = function decode(reader, length) {
|
5443 | if (!(reader instanceof $Reader))
|
5444 | reader = $Reader.create(reader);
|
5445 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.WordInfo();
|
5446 | while (reader.pos < end) {
|
5447 | var tag = reader.uint32();
|
5448 | switch (tag >>> 3) {
|
5449 | case 1:
|
5450 | message.startTime = $root.google.protobuf.Duration.decode(reader, reader.uint32());
|
5451 | break;
|
5452 | case 2:
|
5453 | message.endTime = $root.google.protobuf.Duration.decode(reader, reader.uint32());
|
5454 | break;
|
5455 | case 3:
|
5456 | message.word = reader.string();
|
5457 | break;
|
5458 | case 4:
|
5459 | message.confidence = reader.float();
|
5460 | break;
|
5461 | case 5:
|
5462 | message.speakerTag = reader.int32();
|
5463 | break;
|
5464 | default:
|
5465 | reader.skipType(tag & 7);
|
5466 | break;
|
5467 | }
|
5468 | }
|
5469 | return message;
|
5470 | };
|
5471 |
|
5472 | /**
|
5473 | * Decodes a WordInfo message from the specified reader or buffer, length delimited.
|
5474 | * @function decodeDelimited
|
5475 | * @memberof google.cloud.speech.v1.WordInfo
|
5476 | * @static
|
5477 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
5478 | * @returns {google.cloud.speech.v1.WordInfo} WordInfo
|
5479 | * @throws {Error} If the payload is not a reader or valid buffer
|
5480 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
5481 | */
|
5482 | WordInfo.decodeDelimited = function decodeDelimited(reader) {
|
5483 | if (!(reader instanceof $Reader))
|
5484 | reader = new $Reader(reader);
|
5485 | return this.decode(reader, reader.uint32());
|
5486 | };
|
5487 |
|
5488 | /**
|
5489 | * Verifies a WordInfo message.
|
5490 | * @function verify
|
5491 | * @memberof google.cloud.speech.v1.WordInfo
|
5492 | * @static
|
5493 | * @param {Object.<string,*>} message Plain object to verify
|
5494 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
5495 | */
|
5496 | WordInfo.verify = function verify(message) {
|
5497 | if (typeof message !== "object" || message === null)
|
5498 | return "object expected";
|
5499 | if (message.startTime != null && message.hasOwnProperty("startTime")) {
|
5500 | var error = $root.google.protobuf.Duration.verify(message.startTime);
|
5501 | if (error)
|
5502 | return "startTime." + error;
|
5503 | }
|
5504 | if (message.endTime != null && message.hasOwnProperty("endTime")) {
|
5505 | var error = $root.google.protobuf.Duration.verify(message.endTime);
|
5506 | if (error)
|
5507 | return "endTime." + error;
|
5508 | }
|
5509 | if (message.word != null && message.hasOwnProperty("word"))
|
5510 | if (!$util.isString(message.word))
|
5511 | return "word: string expected";
|
5512 | if (message.confidence != null && message.hasOwnProperty("confidence"))
|
5513 | if (typeof message.confidence !== "number")
|
5514 | return "confidence: number expected";
|
5515 | if (message.speakerTag != null && message.hasOwnProperty("speakerTag"))
|
5516 | if (!$util.isInteger(message.speakerTag))
|
5517 | return "speakerTag: integer expected";
|
5518 | return null;
|
5519 | };
|
5520 |
|
5521 | /**
|
5522 | * Creates a WordInfo message from a plain object. Also converts values to their respective internal types.
|
5523 | * @function fromObject
|
5524 | * @memberof google.cloud.speech.v1.WordInfo
|
5525 | * @static
|
5526 | * @param {Object.<string,*>} object Plain object
|
5527 | * @returns {google.cloud.speech.v1.WordInfo} WordInfo
|
5528 | */
|
5529 | WordInfo.fromObject = function fromObject(object) {
|
5530 | if (object instanceof $root.google.cloud.speech.v1.WordInfo)
|
5531 | return object;
|
5532 | var message = new $root.google.cloud.speech.v1.WordInfo();
|
5533 | if (object.startTime != null) {
|
5534 | if (typeof object.startTime !== "object")
|
5535 | throw TypeError(".google.cloud.speech.v1.WordInfo.startTime: object expected");
|
5536 | message.startTime = $root.google.protobuf.Duration.fromObject(object.startTime);
|
5537 | }
|
5538 | if (object.endTime != null) {
|
5539 | if (typeof object.endTime !== "object")
|
5540 | throw TypeError(".google.cloud.speech.v1.WordInfo.endTime: object expected");
|
5541 | message.endTime = $root.google.protobuf.Duration.fromObject(object.endTime);
|
5542 | }
|
5543 | if (object.word != null)
|
5544 | message.word = String(object.word);
|
5545 | if (object.confidence != null)
|
5546 | message.confidence = Number(object.confidence);
|
5547 | if (object.speakerTag != null)
|
5548 | message.speakerTag = object.speakerTag | 0;
|
5549 | return message;
|
5550 | };
|
5551 |
|
5552 | /**
|
5553 | * Creates a plain object from a WordInfo message. Also converts values to other types if specified.
|
5554 | * @function toObject
|
5555 | * @memberof google.cloud.speech.v1.WordInfo
|
5556 | * @static
|
5557 | * @param {google.cloud.speech.v1.WordInfo} message WordInfo
|
5558 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
5559 | * @returns {Object.<string,*>} Plain object
|
5560 | */
|
5561 | WordInfo.toObject = function toObject(message, options) {
|
5562 | if (!options)
|
5563 | options = {};
|
5564 | var object = {};
|
5565 | if (options.defaults) {
|
5566 | object.startTime = null;
|
5567 | object.endTime = null;
|
5568 | object.word = "";
|
5569 | object.confidence = 0;
|
5570 | object.speakerTag = 0;
|
5571 | }
|
5572 | if (message.startTime != null && message.hasOwnProperty("startTime"))
|
5573 | object.startTime = $root.google.protobuf.Duration.toObject(message.startTime, options);
|
5574 | if (message.endTime != null && message.hasOwnProperty("endTime"))
|
5575 | object.endTime = $root.google.protobuf.Duration.toObject(message.endTime, options);
|
5576 | if (message.word != null && message.hasOwnProperty("word"))
|
5577 | object.word = message.word;
|
5578 | if (message.confidence != null && message.hasOwnProperty("confidence"))
|
5579 | object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence;
|
5580 | if (message.speakerTag != null && message.hasOwnProperty("speakerTag"))
|
5581 | object.speakerTag = message.speakerTag;
|
5582 | return object;
|
5583 | };
|
5584 |
|
5585 | /**
|
5586 | * Converts this WordInfo to JSON.
|
5587 | * @function toJSON
|
5588 | * @memberof google.cloud.speech.v1.WordInfo
|
5589 | * @instance
|
5590 | * @returns {Object.<string,*>} JSON object
|
5591 | */
|
5592 | WordInfo.prototype.toJSON = function toJSON() {
|
5593 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
5594 | };
|
5595 |
|
5596 | return WordInfo;
|
5597 | })();
|
5598 |
|
5599 | v1.CustomClass = (function() {
|
5600 |
|
5601 | /**
|
5602 | * Properties of a CustomClass.
|
5603 | * @memberof google.cloud.speech.v1
|
5604 | * @interface ICustomClass
|
5605 | * @property {string|null} [name] CustomClass name
|
5606 | * @property {string|null} [customClassId] CustomClass customClassId
|
5607 | * @property {Array.<google.cloud.speech.v1.CustomClass.IClassItem>|null} [items] CustomClass items
|
5608 | */
|
5609 |
|
5610 | /**
|
5611 | * Constructs a new CustomClass.
|
5612 | * @memberof google.cloud.speech.v1
|
5613 | * @classdesc Represents a CustomClass.
|
5614 | * @implements ICustomClass
|
5615 | * @constructor
|
5616 | * @param {google.cloud.speech.v1.ICustomClass=} [properties] Properties to set
|
5617 | */
|
5618 | function CustomClass(properties) {
|
5619 | this.items = [];
|
5620 | if (properties)
|
5621 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
5622 | if (properties[keys[i]] != null)
|
5623 | this[keys[i]] = properties[keys[i]];
|
5624 | }
|
5625 |
|
5626 | /**
|
5627 | * CustomClass name.
|
5628 | * @member {string} name
|
5629 | * @memberof google.cloud.speech.v1.CustomClass
|
5630 | * @instance
|
5631 | */
|
5632 | CustomClass.prototype.name = "";
|
5633 |
|
5634 | /**
|
5635 | * CustomClass customClassId.
|
5636 | * @member {string} customClassId
|
5637 | * @memberof google.cloud.speech.v1.CustomClass
|
5638 | * @instance
|
5639 | */
|
5640 | CustomClass.prototype.customClassId = "";
|
5641 |
|
5642 | /**
|
5643 | * CustomClass items.
|
5644 | * @member {Array.<google.cloud.speech.v1.CustomClass.IClassItem>} items
|
5645 | * @memberof google.cloud.speech.v1.CustomClass
|
5646 | * @instance
|
5647 | */
|
5648 | CustomClass.prototype.items = $util.emptyArray;
|
5649 |
|
5650 | /**
|
5651 | * Creates a new CustomClass instance using the specified properties.
|
5652 | * @function create
|
5653 | * @memberof google.cloud.speech.v1.CustomClass
|
5654 | * @static
|
5655 | * @param {google.cloud.speech.v1.ICustomClass=} [properties] Properties to set
|
5656 | * @returns {google.cloud.speech.v1.CustomClass} CustomClass instance
|
5657 | */
|
5658 | CustomClass.create = function create(properties) {
|
5659 | return new CustomClass(properties);
|
5660 | };
|
5661 |
|
5662 | /**
|
5663 | * Encodes the specified CustomClass message. Does not implicitly {@link google.cloud.speech.v1.CustomClass.verify|verify} messages.
|
5664 | * @function encode
|
5665 | * @memberof google.cloud.speech.v1.CustomClass
|
5666 | * @static
|
5667 | * @param {google.cloud.speech.v1.ICustomClass} message CustomClass message or plain object to encode
|
5668 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
5669 | * @returns {$protobuf.Writer} Writer
|
5670 | */
|
5671 | CustomClass.encode = function encode(message, writer) {
|
5672 | if (!writer)
|
5673 | writer = $Writer.create();
|
5674 | if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
5675 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
|
5676 | if (message.customClassId != null && Object.hasOwnProperty.call(message, "customClassId"))
|
5677 | writer.uint32(/* id 2, wireType 2 =*/18).string(message.customClassId);
|
5678 | if (message.items != null && message.items.length)
|
5679 | for (var i = 0; i < message.items.length; ++i)
|
5680 | $root.google.cloud.speech.v1.CustomClass.ClassItem.encode(message.items[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
|
5681 | return writer;
|
5682 | };
|
5683 |
|
5684 | /**
|
5685 | * Encodes the specified CustomClass message, length delimited. Does not implicitly {@link google.cloud.speech.v1.CustomClass.verify|verify} messages.
|
5686 | * @function encodeDelimited
|
5687 | * @memberof google.cloud.speech.v1.CustomClass
|
5688 | * @static
|
5689 | * @param {google.cloud.speech.v1.ICustomClass} message CustomClass message or plain object to encode
|
5690 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
5691 | * @returns {$protobuf.Writer} Writer
|
5692 | */
|
5693 | CustomClass.encodeDelimited = function encodeDelimited(message, writer) {
|
5694 | return this.encode(message, writer).ldelim();
|
5695 | };
|
5696 |
|
5697 | /**
|
5698 | * Decodes a CustomClass message from the specified reader or buffer.
|
5699 | * @function decode
|
5700 | * @memberof google.cloud.speech.v1.CustomClass
|
5701 | * @static
|
5702 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
5703 | * @param {number} [length] Message length if known beforehand
|
5704 | * @returns {google.cloud.speech.v1.CustomClass} CustomClass
|
5705 | * @throws {Error} If the payload is not a reader or valid buffer
|
5706 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
5707 | */
|
5708 | CustomClass.decode = function decode(reader, length) {
|
5709 | if (!(reader instanceof $Reader))
|
5710 | reader = $Reader.create(reader);
|
5711 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.CustomClass();
|
5712 | while (reader.pos < end) {
|
5713 | var tag = reader.uint32();
|
5714 | switch (tag >>> 3) {
|
5715 | case 1:
|
5716 | message.name = reader.string();
|
5717 | break;
|
5718 | case 2:
|
5719 | message.customClassId = reader.string();
|
5720 | break;
|
5721 | case 3:
|
5722 | if (!(message.items && message.items.length))
|
5723 | message.items = [];
|
5724 | message.items.push($root.google.cloud.speech.v1.CustomClass.ClassItem.decode(reader, reader.uint32()));
|
5725 | break;
|
5726 | default:
|
5727 | reader.skipType(tag & 7);
|
5728 | break;
|
5729 | }
|
5730 | }
|
5731 | return message;
|
5732 | };
|
5733 |
|
5734 | /**
|
5735 | * Decodes a CustomClass message from the specified reader or buffer, length delimited.
|
5736 | * @function decodeDelimited
|
5737 | * @memberof google.cloud.speech.v1.CustomClass
|
5738 | * @static
|
5739 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
5740 | * @returns {google.cloud.speech.v1.CustomClass} CustomClass
|
5741 | * @throws {Error} If the payload is not a reader or valid buffer
|
5742 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
5743 | */
|
5744 | CustomClass.decodeDelimited = function decodeDelimited(reader) {
|
5745 | if (!(reader instanceof $Reader))
|
5746 | reader = new $Reader(reader);
|
5747 | return this.decode(reader, reader.uint32());
|
5748 | };
|
5749 |
|
5750 | /**
|
5751 | * Verifies a CustomClass message.
|
5752 | * @function verify
|
5753 | * @memberof google.cloud.speech.v1.CustomClass
|
5754 | * @static
|
5755 | * @param {Object.<string,*>} message Plain object to verify
|
5756 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
5757 | */
|
5758 | CustomClass.verify = function verify(message) {
|
5759 | if (typeof message !== "object" || message === null)
|
5760 | return "object expected";
|
5761 | if (message.name != null && message.hasOwnProperty("name"))
|
5762 | if (!$util.isString(message.name))
|
5763 | return "name: string expected";
|
5764 | if (message.customClassId != null && message.hasOwnProperty("customClassId"))
|
5765 | if (!$util.isString(message.customClassId))
|
5766 | return "customClassId: string expected";
|
5767 | if (message.items != null && message.hasOwnProperty("items")) {
|
5768 | if (!Array.isArray(message.items))
|
5769 | return "items: array expected";
|
5770 | for (var i = 0; i < message.items.length; ++i) {
|
5771 | var error = $root.google.cloud.speech.v1.CustomClass.ClassItem.verify(message.items[i]);
|
5772 | if (error)
|
5773 | return "items." + error;
|
5774 | }
|
5775 | }
|
5776 | return null;
|
5777 | };
|
5778 |
|
5779 | /**
|
5780 | * Creates a CustomClass message from a plain object. Also converts values to their respective internal types.
|
5781 | * @function fromObject
|
5782 | * @memberof google.cloud.speech.v1.CustomClass
|
5783 | * @static
|
5784 | * @param {Object.<string,*>} object Plain object
|
5785 | * @returns {google.cloud.speech.v1.CustomClass} CustomClass
|
5786 | */
|
5787 | CustomClass.fromObject = function fromObject(object) {
|
5788 | if (object instanceof $root.google.cloud.speech.v1.CustomClass)
|
5789 | return object;
|
5790 | var message = new $root.google.cloud.speech.v1.CustomClass();
|
5791 | if (object.name != null)
|
5792 | message.name = String(object.name);
|
5793 | if (object.customClassId != null)
|
5794 | message.customClassId = String(object.customClassId);
|
5795 | if (object.items) {
|
5796 | if (!Array.isArray(object.items))
|
5797 | throw TypeError(".google.cloud.speech.v1.CustomClass.items: array expected");
|
5798 | message.items = [];
|
5799 | for (var i = 0; i < object.items.length; ++i) {
|
5800 | if (typeof object.items[i] !== "object")
|
5801 | throw TypeError(".google.cloud.speech.v1.CustomClass.items: object expected");
|
5802 | message.items[i] = $root.google.cloud.speech.v1.CustomClass.ClassItem.fromObject(object.items[i]);
|
5803 | }
|
5804 | }
|
5805 | return message;
|
5806 | };
|
5807 |
|
5808 | /**
|
5809 | * Creates a plain object from a CustomClass message. Also converts values to other types if specified.
|
5810 | * @function toObject
|
5811 | * @memberof google.cloud.speech.v1.CustomClass
|
5812 | * @static
|
5813 | * @param {google.cloud.speech.v1.CustomClass} message CustomClass
|
5814 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
5815 | * @returns {Object.<string,*>} Plain object
|
5816 | */
|
5817 | CustomClass.toObject = function toObject(message, options) {
|
5818 | if (!options)
|
5819 | options = {};
|
5820 | var object = {};
|
5821 | if (options.arrays || options.defaults)
|
5822 | object.items = [];
|
5823 | if (options.defaults) {
|
5824 | object.name = "";
|
5825 | object.customClassId = "";
|
5826 | }
|
5827 | if (message.name != null && message.hasOwnProperty("name"))
|
5828 | object.name = message.name;
|
5829 | if (message.customClassId != null && message.hasOwnProperty("customClassId"))
|
5830 | object.customClassId = message.customClassId;
|
5831 | if (message.items && message.items.length) {
|
5832 | object.items = [];
|
5833 | for (var j = 0; j < message.items.length; ++j)
|
5834 | object.items[j] = $root.google.cloud.speech.v1.CustomClass.ClassItem.toObject(message.items[j], options);
|
5835 | }
|
5836 | return object;
|
5837 | };
|
5838 |
|
5839 | /**
|
5840 | * Converts this CustomClass to JSON.
|
5841 | * @function toJSON
|
5842 | * @memberof google.cloud.speech.v1.CustomClass
|
5843 | * @instance
|
5844 | * @returns {Object.<string,*>} JSON object
|
5845 | */
|
5846 | CustomClass.prototype.toJSON = function toJSON() {
|
5847 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
5848 | };
|
5849 |
|
5850 | CustomClass.ClassItem = (function() {
|
5851 |
|
5852 | /**
|
5853 | * Properties of a ClassItem.
|
5854 | * @memberof google.cloud.speech.v1.CustomClass
|
5855 | * @interface IClassItem
|
5856 | * @property {string|null} [value] ClassItem value
|
5857 | */
|
5858 |
|
5859 | /**
|
5860 | * Constructs a new ClassItem.
|
5861 | * @memberof google.cloud.speech.v1.CustomClass
|
5862 | * @classdesc Represents a ClassItem.
|
5863 | * @implements IClassItem
|
5864 | * @constructor
|
5865 | * @param {google.cloud.speech.v1.CustomClass.IClassItem=} [properties] Properties to set
|
5866 | */
|
5867 | function ClassItem(properties) {
|
5868 | if (properties)
|
5869 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
5870 | if (properties[keys[i]] != null)
|
5871 | this[keys[i]] = properties[keys[i]];
|
5872 | }
|
5873 |
|
5874 | /**
|
5875 | * ClassItem value.
|
5876 | * @member {string} value
|
5877 | * @memberof google.cloud.speech.v1.CustomClass.ClassItem
|
5878 | * @instance
|
5879 | */
|
5880 | ClassItem.prototype.value = "";
|
5881 |
|
5882 | /**
|
5883 | * Creates a new ClassItem instance using the specified properties.
|
5884 | * @function create
|
5885 | * @memberof google.cloud.speech.v1.CustomClass.ClassItem
|
5886 | * @static
|
5887 | * @param {google.cloud.speech.v1.CustomClass.IClassItem=} [properties] Properties to set
|
5888 | * @returns {google.cloud.speech.v1.CustomClass.ClassItem} ClassItem instance
|
5889 | */
|
5890 | ClassItem.create = function create(properties) {
|
5891 | return new ClassItem(properties);
|
5892 | };
|
5893 |
|
5894 | /**
|
5895 | * Encodes the specified ClassItem message. Does not implicitly {@link google.cloud.speech.v1.CustomClass.ClassItem.verify|verify} messages.
|
5896 | * @function encode
|
5897 | * @memberof google.cloud.speech.v1.CustomClass.ClassItem
|
5898 | * @static
|
5899 | * @param {google.cloud.speech.v1.CustomClass.IClassItem} message ClassItem message or plain object to encode
|
5900 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
5901 | * @returns {$protobuf.Writer} Writer
|
5902 | */
|
5903 | ClassItem.encode = function encode(message, writer) {
|
5904 | if (!writer)
|
5905 | writer = $Writer.create();
|
5906 | if (message.value != null && Object.hasOwnProperty.call(message, "value"))
|
5907 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.value);
|
5908 | return writer;
|
5909 | };
|
5910 |
|
5911 | /**
|
5912 | * Encodes the specified ClassItem message, length delimited. Does not implicitly {@link google.cloud.speech.v1.CustomClass.ClassItem.verify|verify} messages.
|
5913 | * @function encodeDelimited
|
5914 | * @memberof google.cloud.speech.v1.CustomClass.ClassItem
|
5915 | * @static
|
5916 | * @param {google.cloud.speech.v1.CustomClass.IClassItem} message ClassItem message or plain object to encode
|
5917 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
5918 | * @returns {$protobuf.Writer} Writer
|
5919 | */
|
5920 | ClassItem.encodeDelimited = function encodeDelimited(message, writer) {
|
5921 | return this.encode(message, writer).ldelim();
|
5922 | };
|
5923 |
|
5924 | /**
|
5925 | * Decodes a ClassItem message from the specified reader or buffer.
|
5926 | * @function decode
|
5927 | * @memberof google.cloud.speech.v1.CustomClass.ClassItem
|
5928 | * @static
|
5929 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
5930 | * @param {number} [length] Message length if known beforehand
|
5931 | * @returns {google.cloud.speech.v1.CustomClass.ClassItem} ClassItem
|
5932 | * @throws {Error} If the payload is not a reader or valid buffer
|
5933 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
5934 | */
|
5935 | ClassItem.decode = function decode(reader, length) {
|
5936 | if (!(reader instanceof $Reader))
|
5937 | reader = $Reader.create(reader);
|
5938 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.CustomClass.ClassItem();
|
5939 | while (reader.pos < end) {
|
5940 | var tag = reader.uint32();
|
5941 | switch (tag >>> 3) {
|
5942 | case 1:
|
5943 | message.value = reader.string();
|
5944 | break;
|
5945 | default:
|
5946 | reader.skipType(tag & 7);
|
5947 | break;
|
5948 | }
|
5949 | }
|
5950 | return message;
|
5951 | };
|
5952 |
|
5953 | /**
|
5954 | * Decodes a ClassItem message from the specified reader or buffer, length delimited.
|
5955 | * @function decodeDelimited
|
5956 | * @memberof google.cloud.speech.v1.CustomClass.ClassItem
|
5957 | * @static
|
5958 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
5959 | * @returns {google.cloud.speech.v1.CustomClass.ClassItem} ClassItem
|
5960 | * @throws {Error} If the payload is not a reader or valid buffer
|
5961 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
5962 | */
|
5963 | ClassItem.decodeDelimited = function decodeDelimited(reader) {
|
5964 | if (!(reader instanceof $Reader))
|
5965 | reader = new $Reader(reader);
|
5966 | return this.decode(reader, reader.uint32());
|
5967 | };
|
5968 |
|
5969 | /**
|
5970 | * Verifies a ClassItem message.
|
5971 | * @function verify
|
5972 | * @memberof google.cloud.speech.v1.CustomClass.ClassItem
|
5973 | * @static
|
5974 | * @param {Object.<string,*>} message Plain object to verify
|
5975 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
5976 | */
|
5977 | ClassItem.verify = function verify(message) {
|
5978 | if (typeof message !== "object" || message === null)
|
5979 | return "object expected";
|
5980 | if (message.value != null && message.hasOwnProperty("value"))
|
5981 | if (!$util.isString(message.value))
|
5982 | return "value: string expected";
|
5983 | return null;
|
5984 | };
|
5985 |
|
5986 | /**
|
5987 | * Creates a ClassItem message from a plain object. Also converts values to their respective internal types.
|
5988 | * @function fromObject
|
5989 | * @memberof google.cloud.speech.v1.CustomClass.ClassItem
|
5990 | * @static
|
5991 | * @param {Object.<string,*>} object Plain object
|
5992 | * @returns {google.cloud.speech.v1.CustomClass.ClassItem} ClassItem
|
5993 | */
|
5994 | ClassItem.fromObject = function fromObject(object) {
|
5995 | if (object instanceof $root.google.cloud.speech.v1.CustomClass.ClassItem)
|
5996 | return object;
|
5997 | var message = new $root.google.cloud.speech.v1.CustomClass.ClassItem();
|
5998 | if (object.value != null)
|
5999 | message.value = String(object.value);
|
6000 | return message;
|
6001 | };
|
6002 |
|
6003 | /**
|
6004 | * Creates a plain object from a ClassItem message. Also converts values to other types if specified.
|
6005 | * @function toObject
|
6006 | * @memberof google.cloud.speech.v1.CustomClass.ClassItem
|
6007 | * @static
|
6008 | * @param {google.cloud.speech.v1.CustomClass.ClassItem} message ClassItem
|
6009 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
6010 | * @returns {Object.<string,*>} Plain object
|
6011 | */
|
6012 | ClassItem.toObject = function toObject(message, options) {
|
6013 | if (!options)
|
6014 | options = {};
|
6015 | var object = {};
|
6016 | if (options.defaults)
|
6017 | object.value = "";
|
6018 | if (message.value != null && message.hasOwnProperty("value"))
|
6019 | object.value = message.value;
|
6020 | return object;
|
6021 | };
|
6022 |
|
6023 | /**
|
6024 | * Converts this ClassItem to JSON.
|
6025 | * @function toJSON
|
6026 | * @memberof google.cloud.speech.v1.CustomClass.ClassItem
|
6027 | * @instance
|
6028 | * @returns {Object.<string,*>} JSON object
|
6029 | */
|
6030 | ClassItem.prototype.toJSON = function toJSON() {
|
6031 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
6032 | };
|
6033 |
|
6034 | return ClassItem;
|
6035 | })();
|
6036 |
|
6037 | return CustomClass;
|
6038 | })();
|
6039 |
|
6040 | v1.PhraseSet = (function() {
|
6041 |
|
6042 | /**
|
6043 | * Properties of a PhraseSet.
|
6044 | * @memberof google.cloud.speech.v1
|
6045 | * @interface IPhraseSet
|
6046 | * @property {string|null} [name] PhraseSet name
|
6047 | * @property {Array.<google.cloud.speech.v1.PhraseSet.IPhrase>|null} [phrases] PhraseSet phrases
|
6048 | * @property {number|null} [boost] PhraseSet boost
|
6049 | */
|
6050 |
|
6051 | /**
|
6052 | * Constructs a new PhraseSet.
|
6053 | * @memberof google.cloud.speech.v1
|
6054 | * @classdesc Represents a PhraseSet.
|
6055 | * @implements IPhraseSet
|
6056 | * @constructor
|
6057 | * @param {google.cloud.speech.v1.IPhraseSet=} [properties] Properties to set
|
6058 | */
|
6059 | function PhraseSet(properties) {
|
6060 | this.phrases = [];
|
6061 | if (properties)
|
6062 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
6063 | if (properties[keys[i]] != null)
|
6064 | this[keys[i]] = properties[keys[i]];
|
6065 | }
|
6066 |
|
6067 | /**
|
6068 | * PhraseSet name.
|
6069 | * @member {string} name
|
6070 | * @memberof google.cloud.speech.v1.PhraseSet
|
6071 | * @instance
|
6072 | */
|
6073 | PhraseSet.prototype.name = "";
|
6074 |
|
6075 | /**
|
6076 | * PhraseSet phrases.
|
6077 | * @member {Array.<google.cloud.speech.v1.PhraseSet.IPhrase>} phrases
|
6078 | * @memberof google.cloud.speech.v1.PhraseSet
|
6079 | * @instance
|
6080 | */
|
6081 | PhraseSet.prototype.phrases = $util.emptyArray;
|
6082 |
|
6083 | /**
|
6084 | * PhraseSet boost.
|
6085 | * @member {number} boost
|
6086 | * @memberof google.cloud.speech.v1.PhraseSet
|
6087 | * @instance
|
6088 | */
|
6089 | PhraseSet.prototype.boost = 0;
|
6090 |
|
6091 | /**
|
6092 | * Creates a new PhraseSet instance using the specified properties.
|
6093 | * @function create
|
6094 | * @memberof google.cloud.speech.v1.PhraseSet
|
6095 | * @static
|
6096 | * @param {google.cloud.speech.v1.IPhraseSet=} [properties] Properties to set
|
6097 | * @returns {google.cloud.speech.v1.PhraseSet} PhraseSet instance
|
6098 | */
|
6099 | PhraseSet.create = function create(properties) {
|
6100 | return new PhraseSet(properties);
|
6101 | };
|
6102 |
|
6103 | /**
|
6104 | * Encodes the specified PhraseSet message. Does not implicitly {@link google.cloud.speech.v1.PhraseSet.verify|verify} messages.
|
6105 | * @function encode
|
6106 | * @memberof google.cloud.speech.v1.PhraseSet
|
6107 | * @static
|
6108 | * @param {google.cloud.speech.v1.IPhraseSet} message PhraseSet message or plain object to encode
|
6109 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
6110 | * @returns {$protobuf.Writer} Writer
|
6111 | */
|
6112 | PhraseSet.encode = function encode(message, writer) {
|
6113 | if (!writer)
|
6114 | writer = $Writer.create();
|
6115 | if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
6116 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
|
6117 | if (message.phrases != null && message.phrases.length)
|
6118 | for (var i = 0; i < message.phrases.length; ++i)
|
6119 | $root.google.cloud.speech.v1.PhraseSet.Phrase.encode(message.phrases[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
6120 | if (message.boost != null && Object.hasOwnProperty.call(message, "boost"))
|
6121 | writer.uint32(/* id 4, wireType 5 =*/37).float(message.boost);
|
6122 | return writer;
|
6123 | };
|
6124 |
|
6125 | /**
|
6126 | * Encodes the specified PhraseSet message, length delimited. Does not implicitly {@link google.cloud.speech.v1.PhraseSet.verify|verify} messages.
|
6127 | * @function encodeDelimited
|
6128 | * @memberof google.cloud.speech.v1.PhraseSet
|
6129 | * @static
|
6130 | * @param {google.cloud.speech.v1.IPhraseSet} message PhraseSet message or plain object to encode
|
6131 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
6132 | * @returns {$protobuf.Writer} Writer
|
6133 | */
|
6134 | PhraseSet.encodeDelimited = function encodeDelimited(message, writer) {
|
6135 | return this.encode(message, writer).ldelim();
|
6136 | };
|
6137 |
|
6138 | /**
|
6139 | * Decodes a PhraseSet message from the specified reader or buffer.
|
6140 | * @function decode
|
6141 | * @memberof google.cloud.speech.v1.PhraseSet
|
6142 | * @static
|
6143 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
6144 | * @param {number} [length] Message length if known beforehand
|
6145 | * @returns {google.cloud.speech.v1.PhraseSet} PhraseSet
|
6146 | * @throws {Error} If the payload is not a reader or valid buffer
|
6147 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
6148 | */
|
6149 | PhraseSet.decode = function decode(reader, length) {
|
6150 | if (!(reader instanceof $Reader))
|
6151 | reader = $Reader.create(reader);
|
6152 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.PhraseSet();
|
6153 | while (reader.pos < end) {
|
6154 | var tag = reader.uint32();
|
6155 | switch (tag >>> 3) {
|
6156 | case 1:
|
6157 | message.name = reader.string();
|
6158 | break;
|
6159 | case 2:
|
6160 | if (!(message.phrases && message.phrases.length))
|
6161 | message.phrases = [];
|
6162 | message.phrases.push($root.google.cloud.speech.v1.PhraseSet.Phrase.decode(reader, reader.uint32()));
|
6163 | break;
|
6164 | case 4:
|
6165 | message.boost = reader.float();
|
6166 | break;
|
6167 | default:
|
6168 | reader.skipType(tag & 7);
|
6169 | break;
|
6170 | }
|
6171 | }
|
6172 | return message;
|
6173 | };
|
6174 |
|
6175 | /**
|
6176 | * Decodes a PhraseSet message from the specified reader or buffer, length delimited.
|
6177 | * @function decodeDelimited
|
6178 | * @memberof google.cloud.speech.v1.PhraseSet
|
6179 | * @static
|
6180 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
6181 | * @returns {google.cloud.speech.v1.PhraseSet} PhraseSet
|
6182 | * @throws {Error} If the payload is not a reader or valid buffer
|
6183 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
6184 | */
|
6185 | PhraseSet.decodeDelimited = function decodeDelimited(reader) {
|
6186 | if (!(reader instanceof $Reader))
|
6187 | reader = new $Reader(reader);
|
6188 | return this.decode(reader, reader.uint32());
|
6189 | };
|
6190 |
|
6191 | /**
|
6192 | * Verifies a PhraseSet message.
|
6193 | * @function verify
|
6194 | * @memberof google.cloud.speech.v1.PhraseSet
|
6195 | * @static
|
6196 | * @param {Object.<string,*>} message Plain object to verify
|
6197 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
6198 | */
|
6199 | PhraseSet.verify = function verify(message) {
|
6200 | if (typeof message !== "object" || message === null)
|
6201 | return "object expected";
|
6202 | if (message.name != null && message.hasOwnProperty("name"))
|
6203 | if (!$util.isString(message.name))
|
6204 | return "name: string expected";
|
6205 | if (message.phrases != null && message.hasOwnProperty("phrases")) {
|
6206 | if (!Array.isArray(message.phrases))
|
6207 | return "phrases: array expected";
|
6208 | for (var i = 0; i < message.phrases.length; ++i) {
|
6209 | var error = $root.google.cloud.speech.v1.PhraseSet.Phrase.verify(message.phrases[i]);
|
6210 | if (error)
|
6211 | return "phrases." + error;
|
6212 | }
|
6213 | }
|
6214 | if (message.boost != null && message.hasOwnProperty("boost"))
|
6215 | if (typeof message.boost !== "number")
|
6216 | return "boost: number expected";
|
6217 | return null;
|
6218 | };
|
6219 |
|
6220 | /**
|
6221 | * Creates a PhraseSet message from a plain object. Also converts values to their respective internal types.
|
6222 | * @function fromObject
|
6223 | * @memberof google.cloud.speech.v1.PhraseSet
|
6224 | * @static
|
6225 | * @param {Object.<string,*>} object Plain object
|
6226 | * @returns {google.cloud.speech.v1.PhraseSet} PhraseSet
|
6227 | */
|
6228 | PhraseSet.fromObject = function fromObject(object) {
|
6229 | if (object instanceof $root.google.cloud.speech.v1.PhraseSet)
|
6230 | return object;
|
6231 | var message = new $root.google.cloud.speech.v1.PhraseSet();
|
6232 | if (object.name != null)
|
6233 | message.name = String(object.name);
|
6234 | if (object.phrases) {
|
6235 | if (!Array.isArray(object.phrases))
|
6236 | throw TypeError(".google.cloud.speech.v1.PhraseSet.phrases: array expected");
|
6237 | message.phrases = [];
|
6238 | for (var i = 0; i < object.phrases.length; ++i) {
|
6239 | if (typeof object.phrases[i] !== "object")
|
6240 | throw TypeError(".google.cloud.speech.v1.PhraseSet.phrases: object expected");
|
6241 | message.phrases[i] = $root.google.cloud.speech.v1.PhraseSet.Phrase.fromObject(object.phrases[i]);
|
6242 | }
|
6243 | }
|
6244 | if (object.boost != null)
|
6245 | message.boost = Number(object.boost);
|
6246 | return message;
|
6247 | };
|
6248 |
|
6249 | /**
|
6250 | * Creates a plain object from a PhraseSet message. Also converts values to other types if specified.
|
6251 | * @function toObject
|
6252 | * @memberof google.cloud.speech.v1.PhraseSet
|
6253 | * @static
|
6254 | * @param {google.cloud.speech.v1.PhraseSet} message PhraseSet
|
6255 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
6256 | * @returns {Object.<string,*>} Plain object
|
6257 | */
|
6258 | PhraseSet.toObject = function toObject(message, options) {
|
6259 | if (!options)
|
6260 | options = {};
|
6261 | var object = {};
|
6262 | if (options.arrays || options.defaults)
|
6263 | object.phrases = [];
|
6264 | if (options.defaults) {
|
6265 | object.name = "";
|
6266 | object.boost = 0;
|
6267 | }
|
6268 | if (message.name != null && message.hasOwnProperty("name"))
|
6269 | object.name = message.name;
|
6270 | if (message.phrases && message.phrases.length) {
|
6271 | object.phrases = [];
|
6272 | for (var j = 0; j < message.phrases.length; ++j)
|
6273 | object.phrases[j] = $root.google.cloud.speech.v1.PhraseSet.Phrase.toObject(message.phrases[j], options);
|
6274 | }
|
6275 | if (message.boost != null && message.hasOwnProperty("boost"))
|
6276 | object.boost = options.json && !isFinite(message.boost) ? String(message.boost) : message.boost;
|
6277 | return object;
|
6278 | };
|
6279 |
|
6280 | /**
|
6281 | * Converts this PhraseSet to JSON.
|
6282 | * @function toJSON
|
6283 | * @memberof google.cloud.speech.v1.PhraseSet
|
6284 | * @instance
|
6285 | * @returns {Object.<string,*>} JSON object
|
6286 | */
|
6287 | PhraseSet.prototype.toJSON = function toJSON() {
|
6288 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
6289 | };
|
6290 |
|
6291 | PhraseSet.Phrase = (function() {
|
6292 |
|
6293 | /**
|
6294 | * Properties of a Phrase.
|
6295 | * @memberof google.cloud.speech.v1.PhraseSet
|
6296 | * @interface IPhrase
|
6297 | * @property {string|null} [value] Phrase value
|
6298 | * @property {number|null} [boost] Phrase boost
|
6299 | */
|
6300 |
|
6301 | /**
|
6302 | * Constructs a new Phrase.
|
6303 | * @memberof google.cloud.speech.v1.PhraseSet
|
6304 | * @classdesc Represents a Phrase.
|
6305 | * @implements IPhrase
|
6306 | * @constructor
|
6307 | * @param {google.cloud.speech.v1.PhraseSet.IPhrase=} [properties] Properties to set
|
6308 | */
|
6309 | function Phrase(properties) {
|
6310 | if (properties)
|
6311 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
6312 | if (properties[keys[i]] != null)
|
6313 | this[keys[i]] = properties[keys[i]];
|
6314 | }
|
6315 |
|
6316 | /**
|
6317 | * Phrase value.
|
6318 | * @member {string} value
|
6319 | * @memberof google.cloud.speech.v1.PhraseSet.Phrase
|
6320 | * @instance
|
6321 | */
|
6322 | Phrase.prototype.value = "";
|
6323 |
|
6324 | /**
|
6325 | * Phrase boost.
|
6326 | * @member {number} boost
|
6327 | * @memberof google.cloud.speech.v1.PhraseSet.Phrase
|
6328 | * @instance
|
6329 | */
|
6330 | Phrase.prototype.boost = 0;
|
6331 |
|
6332 | /**
|
6333 | * Creates a new Phrase instance using the specified properties.
|
6334 | * @function create
|
6335 | * @memberof google.cloud.speech.v1.PhraseSet.Phrase
|
6336 | * @static
|
6337 | * @param {google.cloud.speech.v1.PhraseSet.IPhrase=} [properties] Properties to set
|
6338 | * @returns {google.cloud.speech.v1.PhraseSet.Phrase} Phrase instance
|
6339 | */
|
6340 | Phrase.create = function create(properties) {
|
6341 | return new Phrase(properties);
|
6342 | };
|
6343 |
|
6344 | /**
|
6345 | * Encodes the specified Phrase message. Does not implicitly {@link google.cloud.speech.v1.PhraseSet.Phrase.verify|verify} messages.
|
6346 | * @function encode
|
6347 | * @memberof google.cloud.speech.v1.PhraseSet.Phrase
|
6348 | * @static
|
6349 | * @param {google.cloud.speech.v1.PhraseSet.IPhrase} message Phrase message or plain object to encode
|
6350 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
6351 | * @returns {$protobuf.Writer} Writer
|
6352 | */
|
6353 | Phrase.encode = function encode(message, writer) {
|
6354 | if (!writer)
|
6355 | writer = $Writer.create();
|
6356 | if (message.value != null && Object.hasOwnProperty.call(message, "value"))
|
6357 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.value);
|
6358 | if (message.boost != null && Object.hasOwnProperty.call(message, "boost"))
|
6359 | writer.uint32(/* id 2, wireType 5 =*/21).float(message.boost);
|
6360 | return writer;
|
6361 | };
|
6362 |
|
6363 | /**
|
6364 | * Encodes the specified Phrase message, length delimited. Does not implicitly {@link google.cloud.speech.v1.PhraseSet.Phrase.verify|verify} messages.
|
6365 | * @function encodeDelimited
|
6366 | * @memberof google.cloud.speech.v1.PhraseSet.Phrase
|
6367 | * @static
|
6368 | * @param {google.cloud.speech.v1.PhraseSet.IPhrase} message Phrase message or plain object to encode
|
6369 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
6370 | * @returns {$protobuf.Writer} Writer
|
6371 | */
|
6372 | Phrase.encodeDelimited = function encodeDelimited(message, writer) {
|
6373 | return this.encode(message, writer).ldelim();
|
6374 | };
|
6375 |
|
6376 | /**
|
6377 | * Decodes a Phrase message from the specified reader or buffer.
|
6378 | * @function decode
|
6379 | * @memberof google.cloud.speech.v1.PhraseSet.Phrase
|
6380 | * @static
|
6381 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
6382 | * @param {number} [length] Message length if known beforehand
|
6383 | * @returns {google.cloud.speech.v1.PhraseSet.Phrase} Phrase
|
6384 | * @throws {Error} If the payload is not a reader or valid buffer
|
6385 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
6386 | */
|
6387 | Phrase.decode = function decode(reader, length) {
|
6388 | if (!(reader instanceof $Reader))
|
6389 | reader = $Reader.create(reader);
|
6390 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.PhraseSet.Phrase();
|
6391 | while (reader.pos < end) {
|
6392 | var tag = reader.uint32();
|
6393 | switch (tag >>> 3) {
|
6394 | case 1:
|
6395 | message.value = reader.string();
|
6396 | break;
|
6397 | case 2:
|
6398 | message.boost = reader.float();
|
6399 | break;
|
6400 | default:
|
6401 | reader.skipType(tag & 7);
|
6402 | break;
|
6403 | }
|
6404 | }
|
6405 | return message;
|
6406 | };
|
6407 |
|
6408 | /**
|
6409 | * Decodes a Phrase message from the specified reader or buffer, length delimited.
|
6410 | * @function decodeDelimited
|
6411 | * @memberof google.cloud.speech.v1.PhraseSet.Phrase
|
6412 | * @static
|
6413 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
6414 | * @returns {google.cloud.speech.v1.PhraseSet.Phrase} Phrase
|
6415 | * @throws {Error} If the payload is not a reader or valid buffer
|
6416 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
6417 | */
|
6418 | Phrase.decodeDelimited = function decodeDelimited(reader) {
|
6419 | if (!(reader instanceof $Reader))
|
6420 | reader = new $Reader(reader);
|
6421 | return this.decode(reader, reader.uint32());
|
6422 | };
|
6423 |
|
6424 | /**
|
6425 | * Verifies a Phrase message.
|
6426 | * @function verify
|
6427 | * @memberof google.cloud.speech.v1.PhraseSet.Phrase
|
6428 | * @static
|
6429 | * @param {Object.<string,*>} message Plain object to verify
|
6430 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
6431 | */
|
6432 | Phrase.verify = function verify(message) {
|
6433 | if (typeof message !== "object" || message === null)
|
6434 | return "object expected";
|
6435 | if (message.value != null && message.hasOwnProperty("value"))
|
6436 | if (!$util.isString(message.value))
|
6437 | return "value: string expected";
|
6438 | if (message.boost != null && message.hasOwnProperty("boost"))
|
6439 | if (typeof message.boost !== "number")
|
6440 | return "boost: number expected";
|
6441 | return null;
|
6442 | };
|
6443 |
|
6444 | /**
|
6445 | * Creates a Phrase message from a plain object. Also converts values to their respective internal types.
|
6446 | * @function fromObject
|
6447 | * @memberof google.cloud.speech.v1.PhraseSet.Phrase
|
6448 | * @static
|
6449 | * @param {Object.<string,*>} object Plain object
|
6450 | * @returns {google.cloud.speech.v1.PhraseSet.Phrase} Phrase
|
6451 | */
|
6452 | Phrase.fromObject = function fromObject(object) {
|
6453 | if (object instanceof $root.google.cloud.speech.v1.PhraseSet.Phrase)
|
6454 | return object;
|
6455 | var message = new $root.google.cloud.speech.v1.PhraseSet.Phrase();
|
6456 | if (object.value != null)
|
6457 | message.value = String(object.value);
|
6458 | if (object.boost != null)
|
6459 | message.boost = Number(object.boost);
|
6460 | return message;
|
6461 | };
|
6462 |
|
6463 | /**
|
6464 | * Creates a plain object from a Phrase message. Also converts values to other types if specified.
|
6465 | * @function toObject
|
6466 | * @memberof google.cloud.speech.v1.PhraseSet.Phrase
|
6467 | * @static
|
6468 | * @param {google.cloud.speech.v1.PhraseSet.Phrase} message Phrase
|
6469 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
6470 | * @returns {Object.<string,*>} Plain object
|
6471 | */
|
6472 | Phrase.toObject = function toObject(message, options) {
|
6473 | if (!options)
|
6474 | options = {};
|
6475 | var object = {};
|
6476 | if (options.defaults) {
|
6477 | object.value = "";
|
6478 | object.boost = 0;
|
6479 | }
|
6480 | if (message.value != null && message.hasOwnProperty("value"))
|
6481 | object.value = message.value;
|
6482 | if (message.boost != null && message.hasOwnProperty("boost"))
|
6483 | object.boost = options.json && !isFinite(message.boost) ? String(message.boost) : message.boost;
|
6484 | return object;
|
6485 | };
|
6486 |
|
6487 | /**
|
6488 | * Converts this Phrase to JSON.
|
6489 | * @function toJSON
|
6490 | * @memberof google.cloud.speech.v1.PhraseSet.Phrase
|
6491 | * @instance
|
6492 | * @returns {Object.<string,*>} JSON object
|
6493 | */
|
6494 | Phrase.prototype.toJSON = function toJSON() {
|
6495 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
6496 | };
|
6497 |
|
6498 | return Phrase;
|
6499 | })();
|
6500 |
|
6501 | return PhraseSet;
|
6502 | })();
|
6503 |
|
6504 | v1.SpeechAdaptation = (function() {
|
6505 |
|
6506 | /**
|
6507 | * Properties of a SpeechAdaptation.
|
6508 | * @memberof google.cloud.speech.v1
|
6509 | * @interface ISpeechAdaptation
|
6510 | * @property {Array.<google.cloud.speech.v1.IPhraseSet>|null} [phraseSets] SpeechAdaptation phraseSets
|
6511 | * @property {Array.<string>|null} [phraseSetReferences] SpeechAdaptation phraseSetReferences
|
6512 | * @property {Array.<google.cloud.speech.v1.ICustomClass>|null} [customClasses] SpeechAdaptation customClasses
|
6513 | */
|
6514 |
|
6515 | /**
|
6516 | * Constructs a new SpeechAdaptation.
|
6517 | * @memberof google.cloud.speech.v1
|
6518 | * @classdesc Represents a SpeechAdaptation.
|
6519 | * @implements ISpeechAdaptation
|
6520 | * @constructor
|
6521 | * @param {google.cloud.speech.v1.ISpeechAdaptation=} [properties] Properties to set
|
6522 | */
|
6523 | function SpeechAdaptation(properties) {
|
6524 | this.phraseSets = [];
|
6525 | this.phraseSetReferences = [];
|
6526 | this.customClasses = [];
|
6527 | if (properties)
|
6528 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
6529 | if (properties[keys[i]] != null)
|
6530 | this[keys[i]] = properties[keys[i]];
|
6531 | }
|
6532 |
|
6533 | /**
|
6534 | * SpeechAdaptation phraseSets.
|
6535 | * @member {Array.<google.cloud.speech.v1.IPhraseSet>} phraseSets
|
6536 | * @memberof google.cloud.speech.v1.SpeechAdaptation
|
6537 | * @instance
|
6538 | */
|
6539 | SpeechAdaptation.prototype.phraseSets = $util.emptyArray;
|
6540 |
|
6541 | /**
|
6542 | * SpeechAdaptation phraseSetReferences.
|
6543 | * @member {Array.<string>} phraseSetReferences
|
6544 | * @memberof google.cloud.speech.v1.SpeechAdaptation
|
6545 | * @instance
|
6546 | */
|
6547 | SpeechAdaptation.prototype.phraseSetReferences = $util.emptyArray;
|
6548 |
|
6549 | /**
|
6550 | * SpeechAdaptation customClasses.
|
6551 | * @member {Array.<google.cloud.speech.v1.ICustomClass>} customClasses
|
6552 | * @memberof google.cloud.speech.v1.SpeechAdaptation
|
6553 | * @instance
|
6554 | */
|
6555 | SpeechAdaptation.prototype.customClasses = $util.emptyArray;
|
6556 |
|
6557 | /**
|
6558 | * Creates a new SpeechAdaptation instance using the specified properties.
|
6559 | * @function create
|
6560 | * @memberof google.cloud.speech.v1.SpeechAdaptation
|
6561 | * @static
|
6562 | * @param {google.cloud.speech.v1.ISpeechAdaptation=} [properties] Properties to set
|
6563 | * @returns {google.cloud.speech.v1.SpeechAdaptation} SpeechAdaptation instance
|
6564 | */
|
6565 | SpeechAdaptation.create = function create(properties) {
|
6566 | return new SpeechAdaptation(properties);
|
6567 | };
|
6568 |
|
6569 | /**
|
6570 | * Encodes the specified SpeechAdaptation message. Does not implicitly {@link google.cloud.speech.v1.SpeechAdaptation.verify|verify} messages.
|
6571 | * @function encode
|
6572 | * @memberof google.cloud.speech.v1.SpeechAdaptation
|
6573 | * @static
|
6574 | * @param {google.cloud.speech.v1.ISpeechAdaptation} message SpeechAdaptation message or plain object to encode
|
6575 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
6576 | * @returns {$protobuf.Writer} Writer
|
6577 | */
|
6578 | SpeechAdaptation.encode = function encode(message, writer) {
|
6579 | if (!writer)
|
6580 | writer = $Writer.create();
|
6581 | if (message.phraseSets != null && message.phraseSets.length)
|
6582 | for (var i = 0; i < message.phraseSets.length; ++i)
|
6583 | $root.google.cloud.speech.v1.PhraseSet.encode(message.phraseSets[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
6584 | if (message.phraseSetReferences != null && message.phraseSetReferences.length)
|
6585 | for (var i = 0; i < message.phraseSetReferences.length; ++i)
|
6586 | writer.uint32(/* id 2, wireType 2 =*/18).string(message.phraseSetReferences[i]);
|
6587 | if (message.customClasses != null && message.customClasses.length)
|
6588 | for (var i = 0; i < message.customClasses.length; ++i)
|
6589 | $root.google.cloud.speech.v1.CustomClass.encode(message.customClasses[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
|
6590 | return writer;
|
6591 | };
|
6592 |
|
6593 | /**
|
6594 | * Encodes the specified SpeechAdaptation message, length delimited. Does not implicitly {@link google.cloud.speech.v1.SpeechAdaptation.verify|verify} messages.
|
6595 | * @function encodeDelimited
|
6596 | * @memberof google.cloud.speech.v1.SpeechAdaptation
|
6597 | * @static
|
6598 | * @param {google.cloud.speech.v1.ISpeechAdaptation} message SpeechAdaptation message or plain object to encode
|
6599 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
6600 | * @returns {$protobuf.Writer} Writer
|
6601 | */
|
6602 | SpeechAdaptation.encodeDelimited = function encodeDelimited(message, writer) {
|
6603 | return this.encode(message, writer).ldelim();
|
6604 | };
|
6605 |
|
6606 | /**
|
6607 | * Decodes a SpeechAdaptation message from the specified reader or buffer.
|
6608 | * @function decode
|
6609 | * @memberof google.cloud.speech.v1.SpeechAdaptation
|
6610 | * @static
|
6611 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
6612 | * @param {number} [length] Message length if known beforehand
|
6613 | * @returns {google.cloud.speech.v1.SpeechAdaptation} SpeechAdaptation
|
6614 | * @throws {Error} If the payload is not a reader or valid buffer
|
6615 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
6616 | */
|
6617 | SpeechAdaptation.decode = function decode(reader, length) {
|
6618 | if (!(reader instanceof $Reader))
|
6619 | reader = $Reader.create(reader);
|
6620 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1.SpeechAdaptation();
|
6621 | while (reader.pos < end) {
|
6622 | var tag = reader.uint32();
|
6623 | switch (tag >>> 3) {
|
6624 | case 1:
|
6625 | if (!(message.phraseSets && message.phraseSets.length))
|
6626 | message.phraseSets = [];
|
6627 | message.phraseSets.push($root.google.cloud.speech.v1.PhraseSet.decode(reader, reader.uint32()));
|
6628 | break;
|
6629 | case 2:
|
6630 | if (!(message.phraseSetReferences && message.phraseSetReferences.length))
|
6631 | message.phraseSetReferences = [];
|
6632 | message.phraseSetReferences.push(reader.string());
|
6633 | break;
|
6634 | case 3:
|
6635 | if (!(message.customClasses && message.customClasses.length))
|
6636 | message.customClasses = [];
|
6637 | message.customClasses.push($root.google.cloud.speech.v1.CustomClass.decode(reader, reader.uint32()));
|
6638 | break;
|
6639 | default:
|
6640 | reader.skipType(tag & 7);
|
6641 | break;
|
6642 | }
|
6643 | }
|
6644 | return message;
|
6645 | };
|
6646 |
|
6647 | /**
|
6648 | * Decodes a SpeechAdaptation message from the specified reader or buffer, length delimited.
|
6649 | * @function decodeDelimited
|
6650 | * @memberof google.cloud.speech.v1.SpeechAdaptation
|
6651 | * @static
|
6652 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
6653 | * @returns {google.cloud.speech.v1.SpeechAdaptation} SpeechAdaptation
|
6654 | * @throws {Error} If the payload is not a reader or valid buffer
|
6655 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
6656 | */
|
6657 | SpeechAdaptation.decodeDelimited = function decodeDelimited(reader) {
|
6658 | if (!(reader instanceof $Reader))
|
6659 | reader = new $Reader(reader);
|
6660 | return this.decode(reader, reader.uint32());
|
6661 | };
|
6662 |
|
6663 | /**
|
6664 | * Verifies a SpeechAdaptation message.
|
6665 | * @function verify
|
6666 | * @memberof google.cloud.speech.v1.SpeechAdaptation
|
6667 | * @static
|
6668 | * @param {Object.<string,*>} message Plain object to verify
|
6669 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
6670 | */
|
6671 | SpeechAdaptation.verify = function verify(message) {
|
6672 | if (typeof message !== "object" || message === null)
|
6673 | return "object expected";
|
6674 | if (message.phraseSets != null && message.hasOwnProperty("phraseSets")) {
|
6675 | if (!Array.isArray(message.phraseSets))
|
6676 | return "phraseSets: array expected";
|
6677 | for (var i = 0; i < message.phraseSets.length; ++i) {
|
6678 | var error = $root.google.cloud.speech.v1.PhraseSet.verify(message.phraseSets[i]);
|
6679 | if (error)
|
6680 | return "phraseSets." + error;
|
6681 | }
|
6682 | }
|
6683 | if (message.phraseSetReferences != null && message.hasOwnProperty("phraseSetReferences")) {
|
6684 | if (!Array.isArray(message.phraseSetReferences))
|
6685 | return "phraseSetReferences: array expected";
|
6686 | for (var i = 0; i < message.phraseSetReferences.length; ++i)
|
6687 | if (!$util.isString(message.phraseSetReferences[i]))
|
6688 | return "phraseSetReferences: string[] expected";
|
6689 | }
|
6690 | if (message.customClasses != null && message.hasOwnProperty("customClasses")) {
|
6691 | if (!Array.isArray(message.customClasses))
|
6692 | return "customClasses: array expected";
|
6693 | for (var i = 0; i < message.customClasses.length; ++i) {
|
6694 | var error = $root.google.cloud.speech.v1.CustomClass.verify(message.customClasses[i]);
|
6695 | if (error)
|
6696 | return "customClasses." + error;
|
6697 | }
|
6698 | }
|
6699 | return null;
|
6700 | };
|
6701 |
|
6702 | /**
|
6703 | * Creates a SpeechAdaptation message from a plain object. Also converts values to their respective internal types.
|
6704 | * @function fromObject
|
6705 | * @memberof google.cloud.speech.v1.SpeechAdaptation
|
6706 | * @static
|
6707 | * @param {Object.<string,*>} object Plain object
|
6708 | * @returns {google.cloud.speech.v1.SpeechAdaptation} SpeechAdaptation
|
6709 | */
|
6710 | SpeechAdaptation.fromObject = function fromObject(object) {
|
6711 | if (object instanceof $root.google.cloud.speech.v1.SpeechAdaptation)
|
6712 | return object;
|
6713 | var message = new $root.google.cloud.speech.v1.SpeechAdaptation();
|
6714 | if (object.phraseSets) {
|
6715 | if (!Array.isArray(object.phraseSets))
|
6716 | throw TypeError(".google.cloud.speech.v1.SpeechAdaptation.phraseSets: array expected");
|
6717 | message.phraseSets = [];
|
6718 | for (var i = 0; i < object.phraseSets.length; ++i) {
|
6719 | if (typeof object.phraseSets[i] !== "object")
|
6720 | throw TypeError(".google.cloud.speech.v1.SpeechAdaptation.phraseSets: object expected");
|
6721 | message.phraseSets[i] = $root.google.cloud.speech.v1.PhraseSet.fromObject(object.phraseSets[i]);
|
6722 | }
|
6723 | }
|
6724 | if (object.phraseSetReferences) {
|
6725 | if (!Array.isArray(object.phraseSetReferences))
|
6726 | throw TypeError(".google.cloud.speech.v1.SpeechAdaptation.phraseSetReferences: array expected");
|
6727 | message.phraseSetReferences = [];
|
6728 | for (var i = 0; i < object.phraseSetReferences.length; ++i)
|
6729 | message.phraseSetReferences[i] = String(object.phraseSetReferences[i]);
|
6730 | }
|
6731 | if (object.customClasses) {
|
6732 | if (!Array.isArray(object.customClasses))
|
6733 | throw TypeError(".google.cloud.speech.v1.SpeechAdaptation.customClasses: array expected");
|
6734 | message.customClasses = [];
|
6735 | for (var i = 0; i < object.customClasses.length; ++i) {
|
6736 | if (typeof object.customClasses[i] !== "object")
|
6737 | throw TypeError(".google.cloud.speech.v1.SpeechAdaptation.customClasses: object expected");
|
6738 | message.customClasses[i] = $root.google.cloud.speech.v1.CustomClass.fromObject(object.customClasses[i]);
|
6739 | }
|
6740 | }
|
6741 | return message;
|
6742 | };
|
6743 |
|
6744 | /**
|
6745 | * Creates a plain object from a SpeechAdaptation message. Also converts values to other types if specified.
|
6746 | * @function toObject
|
6747 | * @memberof google.cloud.speech.v1.SpeechAdaptation
|
6748 | * @static
|
6749 | * @param {google.cloud.speech.v1.SpeechAdaptation} message SpeechAdaptation
|
6750 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
6751 | * @returns {Object.<string,*>} Plain object
|
6752 | */
|
6753 | SpeechAdaptation.toObject = function toObject(message, options) {
|
6754 | if (!options)
|
6755 | options = {};
|
6756 | var object = {};
|
6757 | if (options.arrays || options.defaults) {
|
6758 | object.phraseSets = [];
|
6759 | object.phraseSetReferences = [];
|
6760 | object.customClasses = [];
|
6761 | }
|
6762 | if (message.phraseSets && message.phraseSets.length) {
|
6763 | object.phraseSets = [];
|
6764 | for (var j = 0; j < message.phraseSets.length; ++j)
|
6765 | object.phraseSets[j] = $root.google.cloud.speech.v1.PhraseSet.toObject(message.phraseSets[j], options);
|
6766 | }
|
6767 | if (message.phraseSetReferences && message.phraseSetReferences.length) {
|
6768 | object.phraseSetReferences = [];
|
6769 | for (var j = 0; j < message.phraseSetReferences.length; ++j)
|
6770 | object.phraseSetReferences[j] = message.phraseSetReferences[j];
|
6771 | }
|
6772 | if (message.customClasses && message.customClasses.length) {
|
6773 | object.customClasses = [];
|
6774 | for (var j = 0; j < message.customClasses.length; ++j)
|
6775 | object.customClasses[j] = $root.google.cloud.speech.v1.CustomClass.toObject(message.customClasses[j], options);
|
6776 | }
|
6777 | return object;
|
6778 | };
|
6779 |
|
6780 | /**
|
6781 | * Converts this SpeechAdaptation to JSON.
|
6782 | * @function toJSON
|
6783 | * @memberof google.cloud.speech.v1.SpeechAdaptation
|
6784 | * @instance
|
6785 | * @returns {Object.<string,*>} JSON object
|
6786 | */
|
6787 | SpeechAdaptation.prototype.toJSON = function toJSON() {
|
6788 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
6789 | };
|
6790 |
|
6791 | return SpeechAdaptation;
|
6792 | })();
|
6793 |
|
6794 | return v1;
|
6795 | })();
|
6796 |
|
6797 | speech.v1p1beta1 = (function() {
|
6798 |
|
6799 | /**
|
6800 | * Namespace v1p1beta1.
|
6801 | * @memberof google.cloud.speech
|
6802 | * @namespace
|
6803 | */
|
6804 | var v1p1beta1 = {};
|
6805 |
|
6806 | v1p1beta1.Speech = (function() {
|
6807 |
|
6808 | /**
|
6809 | * Constructs a new Speech service.
|
6810 | * @memberof google.cloud.speech.v1p1beta1
|
6811 | * @classdesc Represents a Speech
|
6812 | * @extends $protobuf.rpc.Service
|
6813 | * @constructor
|
6814 | * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
|
6815 | * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
|
6816 | * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
|
6817 | */
|
6818 | function Speech(rpcImpl, requestDelimited, responseDelimited) {
|
6819 | $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);
|
6820 | }
|
6821 |
|
6822 | (Speech.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Speech;
|
6823 |
|
6824 | /**
|
6825 | * Creates new Speech service using the specified rpc implementation.
|
6826 | * @function create
|
6827 | * @memberof google.cloud.speech.v1p1beta1.Speech
|
6828 | * @static
|
6829 | * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
|
6830 | * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
|
6831 | * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
|
6832 | * @returns {Speech} RPC service. Useful where requests and/or responses are streamed.
|
6833 | */
|
6834 | Speech.create = function create(rpcImpl, requestDelimited, responseDelimited) {
|
6835 | return new this(rpcImpl, requestDelimited, responseDelimited);
|
6836 | };
|
6837 |
|
6838 | /**
|
6839 | * Callback as used by {@link google.cloud.speech.v1p1beta1.Speech#recognize}.
|
6840 | * @memberof google.cloud.speech.v1p1beta1.Speech
|
6841 | * @typedef RecognizeCallback
|
6842 | * @type {function}
|
6843 | * @param {Error|null} error Error, if any
|
6844 | * @param {google.cloud.speech.v1p1beta1.RecognizeResponse} [response] RecognizeResponse
|
6845 | */
|
6846 |
|
6847 | /**
|
6848 | * Calls Recognize.
|
6849 | * @function recognize
|
6850 | * @memberof google.cloud.speech.v1p1beta1.Speech
|
6851 | * @instance
|
6852 | * @param {google.cloud.speech.v1p1beta1.IRecognizeRequest} request RecognizeRequest message or plain object
|
6853 | * @param {google.cloud.speech.v1p1beta1.Speech.RecognizeCallback} callback Node-style callback called with the error, if any, and RecognizeResponse
|
6854 | * @returns {undefined}
|
6855 | * @variation 1
|
6856 | */
|
6857 | Object.defineProperty(Speech.prototype.recognize = function recognize(request, callback) {
|
6858 | return this.rpcCall(recognize, $root.google.cloud.speech.v1p1beta1.RecognizeRequest, $root.google.cloud.speech.v1p1beta1.RecognizeResponse, request, callback);
|
6859 | }, "name", { value: "Recognize" });
|
6860 |
|
6861 | /**
|
6862 | * Calls Recognize.
|
6863 | * @function recognize
|
6864 | * @memberof google.cloud.speech.v1p1beta1.Speech
|
6865 | * @instance
|
6866 | * @param {google.cloud.speech.v1p1beta1.IRecognizeRequest} request RecognizeRequest message or plain object
|
6867 | * @returns {Promise<google.cloud.speech.v1p1beta1.RecognizeResponse>} Promise
|
6868 | * @variation 2
|
6869 | */
|
6870 |
|
6871 | /**
|
6872 | * Callback as used by {@link google.cloud.speech.v1p1beta1.Speech#longRunningRecognize}.
|
6873 | * @memberof google.cloud.speech.v1p1beta1.Speech
|
6874 | * @typedef LongRunningRecognizeCallback
|
6875 | * @type {function}
|
6876 | * @param {Error|null} error Error, if any
|
6877 | * @param {google.longrunning.Operation} [response] Operation
|
6878 | */
|
6879 |
|
6880 | /**
|
6881 | * Calls LongRunningRecognize.
|
6882 | * @function longRunningRecognize
|
6883 | * @memberof google.cloud.speech.v1p1beta1.Speech
|
6884 | * @instance
|
6885 | * @param {google.cloud.speech.v1p1beta1.ILongRunningRecognizeRequest} request LongRunningRecognizeRequest message or plain object
|
6886 | * @param {google.cloud.speech.v1p1beta1.Speech.LongRunningRecognizeCallback} callback Node-style callback called with the error, if any, and Operation
|
6887 | * @returns {undefined}
|
6888 | * @variation 1
|
6889 | */
|
6890 | Object.defineProperty(Speech.prototype.longRunningRecognize = function longRunningRecognize(request, callback) {
|
6891 | return this.rpcCall(longRunningRecognize, $root.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest, $root.google.longrunning.Operation, request, callback);
|
6892 | }, "name", { value: "LongRunningRecognize" });
|
6893 |
|
6894 | /**
|
6895 | * Calls LongRunningRecognize.
|
6896 | * @function longRunningRecognize
|
6897 | * @memberof google.cloud.speech.v1p1beta1.Speech
|
6898 | * @instance
|
6899 | * @param {google.cloud.speech.v1p1beta1.ILongRunningRecognizeRequest} request LongRunningRecognizeRequest message or plain object
|
6900 | * @returns {Promise<google.longrunning.Operation>} Promise
|
6901 | * @variation 2
|
6902 | */
|
6903 |
|
6904 | /**
|
6905 | * Callback as used by {@link google.cloud.speech.v1p1beta1.Speech#streamingRecognize}.
|
6906 | * @memberof google.cloud.speech.v1p1beta1.Speech
|
6907 | * @typedef StreamingRecognizeCallback
|
6908 | * @type {function}
|
6909 | * @param {Error|null} error Error, if any
|
6910 | * @param {google.cloud.speech.v1p1beta1.StreamingRecognizeResponse} [response] StreamingRecognizeResponse
|
6911 | */
|
6912 |
|
6913 | /**
|
6914 | * Calls StreamingRecognize.
|
6915 | * @function streamingRecognize
|
6916 | * @memberof google.cloud.speech.v1p1beta1.Speech
|
6917 | * @instance
|
6918 | * @param {google.cloud.speech.v1p1beta1.IStreamingRecognizeRequest} request StreamingRecognizeRequest message or plain object
|
6919 | * @param {google.cloud.speech.v1p1beta1.Speech.StreamingRecognizeCallback} callback Node-style callback called with the error, if any, and StreamingRecognizeResponse
|
6920 | * @returns {undefined}
|
6921 | * @variation 1
|
6922 | */
|
6923 | Object.defineProperty(Speech.prototype.streamingRecognize = function streamingRecognize(request, callback) {
|
6924 | return this.rpcCall(streamingRecognize, $root.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest, $root.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse, request, callback);
|
6925 | }, "name", { value: "StreamingRecognize" });
|
6926 |
|
6927 | /**
|
6928 | * Calls StreamingRecognize.
|
6929 | * @function streamingRecognize
|
6930 | * @memberof google.cloud.speech.v1p1beta1.Speech
|
6931 | * @instance
|
6932 | * @param {google.cloud.speech.v1p1beta1.IStreamingRecognizeRequest} request StreamingRecognizeRequest message or plain object
|
6933 | * @returns {Promise<google.cloud.speech.v1p1beta1.StreamingRecognizeResponse>} Promise
|
6934 | * @variation 2
|
6935 | */
|
6936 |
|
6937 | return Speech;
|
6938 | })();
|
6939 |
|
6940 | v1p1beta1.RecognizeRequest = (function() {
|
6941 |
|
6942 | /**
|
6943 | * Properties of a RecognizeRequest.
|
6944 | * @memberof google.cloud.speech.v1p1beta1
|
6945 | * @interface IRecognizeRequest
|
6946 | * @property {google.cloud.speech.v1p1beta1.IRecognitionConfig|null} [config] RecognizeRequest config
|
6947 | * @property {google.cloud.speech.v1p1beta1.IRecognitionAudio|null} [audio] RecognizeRequest audio
|
6948 | */
|
6949 |
|
6950 | /**
|
6951 | * Constructs a new RecognizeRequest.
|
6952 | * @memberof google.cloud.speech.v1p1beta1
|
6953 | * @classdesc Represents a RecognizeRequest.
|
6954 | * @implements IRecognizeRequest
|
6955 | * @constructor
|
6956 | * @param {google.cloud.speech.v1p1beta1.IRecognizeRequest=} [properties] Properties to set
|
6957 | */
|
6958 | function RecognizeRequest(properties) {
|
6959 | if (properties)
|
6960 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
6961 | if (properties[keys[i]] != null)
|
6962 | this[keys[i]] = properties[keys[i]];
|
6963 | }
|
6964 |
|
6965 | /**
|
6966 | * RecognizeRequest config.
|
6967 | * @member {google.cloud.speech.v1p1beta1.IRecognitionConfig|null|undefined} config
|
6968 | * @memberof google.cloud.speech.v1p1beta1.RecognizeRequest
|
6969 | * @instance
|
6970 | */
|
6971 | RecognizeRequest.prototype.config = null;
|
6972 |
|
6973 | /**
|
6974 | * RecognizeRequest audio.
|
6975 | * @member {google.cloud.speech.v1p1beta1.IRecognitionAudio|null|undefined} audio
|
6976 | * @memberof google.cloud.speech.v1p1beta1.RecognizeRequest
|
6977 | * @instance
|
6978 | */
|
6979 | RecognizeRequest.prototype.audio = null;
|
6980 |
|
6981 | /**
|
6982 | * Creates a new RecognizeRequest instance using the specified properties.
|
6983 | * @function create
|
6984 | * @memberof google.cloud.speech.v1p1beta1.RecognizeRequest
|
6985 | * @static
|
6986 | * @param {google.cloud.speech.v1p1beta1.IRecognizeRequest=} [properties] Properties to set
|
6987 | * @returns {google.cloud.speech.v1p1beta1.RecognizeRequest} RecognizeRequest instance
|
6988 | */
|
6989 | RecognizeRequest.create = function create(properties) {
|
6990 | return new RecognizeRequest(properties);
|
6991 | };
|
6992 |
|
6993 | /**
|
6994 | * Encodes the specified RecognizeRequest message. Does not implicitly {@link google.cloud.speech.v1p1beta1.RecognizeRequest.verify|verify} messages.
|
6995 | * @function encode
|
6996 | * @memberof google.cloud.speech.v1p1beta1.RecognizeRequest
|
6997 | * @static
|
6998 | * @param {google.cloud.speech.v1p1beta1.IRecognizeRequest} message RecognizeRequest message or plain object to encode
|
6999 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
7000 | * @returns {$protobuf.Writer} Writer
|
7001 | */
|
7002 | RecognizeRequest.encode = function encode(message, writer) {
|
7003 | if (!writer)
|
7004 | writer = $Writer.create();
|
7005 | if (message.config != null && Object.hasOwnProperty.call(message, "config"))
|
7006 | $root.google.cloud.speech.v1p1beta1.RecognitionConfig.encode(message.config, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
7007 | if (message.audio != null && Object.hasOwnProperty.call(message, "audio"))
|
7008 | $root.google.cloud.speech.v1p1beta1.RecognitionAudio.encode(message.audio, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
7009 | return writer;
|
7010 | };
|
7011 |
|
7012 | /**
|
7013 | * Encodes the specified RecognizeRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.RecognizeRequest.verify|verify} messages.
|
7014 | * @function encodeDelimited
|
7015 | * @memberof google.cloud.speech.v1p1beta1.RecognizeRequest
|
7016 | * @static
|
7017 | * @param {google.cloud.speech.v1p1beta1.IRecognizeRequest} message RecognizeRequest message or plain object to encode
|
7018 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
7019 | * @returns {$protobuf.Writer} Writer
|
7020 | */
|
7021 | RecognizeRequest.encodeDelimited = function encodeDelimited(message, writer) {
|
7022 | return this.encode(message, writer).ldelim();
|
7023 | };
|
7024 |
|
7025 | /**
|
7026 | * Decodes a RecognizeRequest message from the specified reader or buffer.
|
7027 | * @function decode
|
7028 | * @memberof google.cloud.speech.v1p1beta1.RecognizeRequest
|
7029 | * @static
|
7030 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
7031 | * @param {number} [length] Message length if known beforehand
|
7032 | * @returns {google.cloud.speech.v1p1beta1.RecognizeRequest} RecognizeRequest
|
7033 | * @throws {Error} If the payload is not a reader or valid buffer
|
7034 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
7035 | */
|
7036 | RecognizeRequest.decode = function decode(reader, length) {
|
7037 | if (!(reader instanceof $Reader))
|
7038 | reader = $Reader.create(reader);
|
7039 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.RecognizeRequest();
|
7040 | while (reader.pos < end) {
|
7041 | var tag = reader.uint32();
|
7042 | switch (tag >>> 3) {
|
7043 | case 1:
|
7044 | message.config = $root.google.cloud.speech.v1p1beta1.RecognitionConfig.decode(reader, reader.uint32());
|
7045 | break;
|
7046 | case 2:
|
7047 | message.audio = $root.google.cloud.speech.v1p1beta1.RecognitionAudio.decode(reader, reader.uint32());
|
7048 | break;
|
7049 | default:
|
7050 | reader.skipType(tag & 7);
|
7051 | break;
|
7052 | }
|
7053 | }
|
7054 | return message;
|
7055 | };
|
7056 |
|
7057 | /**
|
7058 | * Decodes a RecognizeRequest message from the specified reader or buffer, length delimited.
|
7059 | * @function decodeDelimited
|
7060 | * @memberof google.cloud.speech.v1p1beta1.RecognizeRequest
|
7061 | * @static
|
7062 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
7063 | * @returns {google.cloud.speech.v1p1beta1.RecognizeRequest} RecognizeRequest
|
7064 | * @throws {Error} If the payload is not a reader or valid buffer
|
7065 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
7066 | */
|
7067 | RecognizeRequest.decodeDelimited = function decodeDelimited(reader) {
|
7068 | if (!(reader instanceof $Reader))
|
7069 | reader = new $Reader(reader);
|
7070 | return this.decode(reader, reader.uint32());
|
7071 | };
|
7072 |
|
7073 | /**
|
7074 | * Verifies a RecognizeRequest message.
|
7075 | * @function verify
|
7076 | * @memberof google.cloud.speech.v1p1beta1.RecognizeRequest
|
7077 | * @static
|
7078 | * @param {Object.<string,*>} message Plain object to verify
|
7079 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
7080 | */
|
7081 | RecognizeRequest.verify = function verify(message) {
|
7082 | if (typeof message !== "object" || message === null)
|
7083 | return "object expected";
|
7084 | if (message.config != null && message.hasOwnProperty("config")) {
|
7085 | var error = $root.google.cloud.speech.v1p1beta1.RecognitionConfig.verify(message.config);
|
7086 | if (error)
|
7087 | return "config." + error;
|
7088 | }
|
7089 | if (message.audio != null && message.hasOwnProperty("audio")) {
|
7090 | var error = $root.google.cloud.speech.v1p1beta1.RecognitionAudio.verify(message.audio);
|
7091 | if (error)
|
7092 | return "audio." + error;
|
7093 | }
|
7094 | return null;
|
7095 | };
|
7096 |
|
7097 | /**
|
7098 | * Creates a RecognizeRequest message from a plain object. Also converts values to their respective internal types.
|
7099 | * @function fromObject
|
7100 | * @memberof google.cloud.speech.v1p1beta1.RecognizeRequest
|
7101 | * @static
|
7102 | * @param {Object.<string,*>} object Plain object
|
7103 | * @returns {google.cloud.speech.v1p1beta1.RecognizeRequest} RecognizeRequest
|
7104 | */
|
7105 | RecognizeRequest.fromObject = function fromObject(object) {
|
7106 | if (object instanceof $root.google.cloud.speech.v1p1beta1.RecognizeRequest)
|
7107 | return object;
|
7108 | var message = new $root.google.cloud.speech.v1p1beta1.RecognizeRequest();
|
7109 | if (object.config != null) {
|
7110 | if (typeof object.config !== "object")
|
7111 | throw TypeError(".google.cloud.speech.v1p1beta1.RecognizeRequest.config: object expected");
|
7112 | message.config = $root.google.cloud.speech.v1p1beta1.RecognitionConfig.fromObject(object.config);
|
7113 | }
|
7114 | if (object.audio != null) {
|
7115 | if (typeof object.audio !== "object")
|
7116 | throw TypeError(".google.cloud.speech.v1p1beta1.RecognizeRequest.audio: object expected");
|
7117 | message.audio = $root.google.cloud.speech.v1p1beta1.RecognitionAudio.fromObject(object.audio);
|
7118 | }
|
7119 | return message;
|
7120 | };
|
7121 |
|
7122 | /**
|
7123 | * Creates a plain object from a RecognizeRequest message. Also converts values to other types if specified.
|
7124 | * @function toObject
|
7125 | * @memberof google.cloud.speech.v1p1beta1.RecognizeRequest
|
7126 | * @static
|
7127 | * @param {google.cloud.speech.v1p1beta1.RecognizeRequest} message RecognizeRequest
|
7128 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
7129 | * @returns {Object.<string,*>} Plain object
|
7130 | */
|
7131 | RecognizeRequest.toObject = function toObject(message, options) {
|
7132 | if (!options)
|
7133 | options = {};
|
7134 | var object = {};
|
7135 | if (options.defaults) {
|
7136 | object.config = null;
|
7137 | object.audio = null;
|
7138 | }
|
7139 | if (message.config != null && message.hasOwnProperty("config"))
|
7140 | object.config = $root.google.cloud.speech.v1p1beta1.RecognitionConfig.toObject(message.config, options);
|
7141 | if (message.audio != null && message.hasOwnProperty("audio"))
|
7142 | object.audio = $root.google.cloud.speech.v1p1beta1.RecognitionAudio.toObject(message.audio, options);
|
7143 | return object;
|
7144 | };
|
7145 |
|
7146 | /**
|
7147 | * Converts this RecognizeRequest to JSON.
|
7148 | * @function toJSON
|
7149 | * @memberof google.cloud.speech.v1p1beta1.RecognizeRequest
|
7150 | * @instance
|
7151 | * @returns {Object.<string,*>} JSON object
|
7152 | */
|
7153 | RecognizeRequest.prototype.toJSON = function toJSON() {
|
7154 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
7155 | };
|
7156 |
|
7157 | return RecognizeRequest;
|
7158 | })();
|
7159 |
|
7160 | v1p1beta1.LongRunningRecognizeRequest = (function() {
|
7161 |
|
7162 | /**
|
7163 | * Properties of a LongRunningRecognizeRequest.
|
7164 | * @memberof google.cloud.speech.v1p1beta1
|
7165 | * @interface ILongRunningRecognizeRequest
|
7166 | * @property {google.cloud.speech.v1p1beta1.IRecognitionConfig|null} [config] LongRunningRecognizeRequest config
|
7167 | * @property {google.cloud.speech.v1p1beta1.IRecognitionAudio|null} [audio] LongRunningRecognizeRequest audio
|
7168 | * @property {google.cloud.speech.v1p1beta1.ITranscriptOutputConfig|null} [outputConfig] LongRunningRecognizeRequest outputConfig
|
7169 | */
|
7170 |
|
7171 | /**
|
7172 | * Constructs a new LongRunningRecognizeRequest.
|
7173 | * @memberof google.cloud.speech.v1p1beta1
|
7174 | * @classdesc Represents a LongRunningRecognizeRequest.
|
7175 | * @implements ILongRunningRecognizeRequest
|
7176 | * @constructor
|
7177 | * @param {google.cloud.speech.v1p1beta1.ILongRunningRecognizeRequest=} [properties] Properties to set
|
7178 | */
|
7179 | function LongRunningRecognizeRequest(properties) {
|
7180 | if (properties)
|
7181 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
7182 | if (properties[keys[i]] != null)
|
7183 | this[keys[i]] = properties[keys[i]];
|
7184 | }
|
7185 |
|
7186 | /**
|
7187 | * LongRunningRecognizeRequest config.
|
7188 | * @member {google.cloud.speech.v1p1beta1.IRecognitionConfig|null|undefined} config
|
7189 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest
|
7190 | * @instance
|
7191 | */
|
7192 | LongRunningRecognizeRequest.prototype.config = null;
|
7193 |
|
7194 | /**
|
7195 | * LongRunningRecognizeRequest audio.
|
7196 | * @member {google.cloud.speech.v1p1beta1.IRecognitionAudio|null|undefined} audio
|
7197 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest
|
7198 | * @instance
|
7199 | */
|
7200 | LongRunningRecognizeRequest.prototype.audio = null;
|
7201 |
|
7202 | /**
|
7203 | * LongRunningRecognizeRequest outputConfig.
|
7204 | * @member {google.cloud.speech.v1p1beta1.ITranscriptOutputConfig|null|undefined} outputConfig
|
7205 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest
|
7206 | * @instance
|
7207 | */
|
7208 | LongRunningRecognizeRequest.prototype.outputConfig = null;
|
7209 |
|
7210 | /**
|
7211 | * Creates a new LongRunningRecognizeRequest instance using the specified properties.
|
7212 | * @function create
|
7213 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest
|
7214 | * @static
|
7215 | * @param {google.cloud.speech.v1p1beta1.ILongRunningRecognizeRequest=} [properties] Properties to set
|
7216 | * @returns {google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest} LongRunningRecognizeRequest instance
|
7217 | */
|
7218 | LongRunningRecognizeRequest.create = function create(properties) {
|
7219 | return new LongRunningRecognizeRequest(properties);
|
7220 | };
|
7221 |
|
7222 | /**
|
7223 | * Encodes the specified LongRunningRecognizeRequest message. Does not implicitly {@link google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest.verify|verify} messages.
|
7224 | * @function encode
|
7225 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest
|
7226 | * @static
|
7227 | * @param {google.cloud.speech.v1p1beta1.ILongRunningRecognizeRequest} message LongRunningRecognizeRequest message or plain object to encode
|
7228 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
7229 | * @returns {$protobuf.Writer} Writer
|
7230 | */
|
7231 | LongRunningRecognizeRequest.encode = function encode(message, writer) {
|
7232 | if (!writer)
|
7233 | writer = $Writer.create();
|
7234 | if (message.config != null && Object.hasOwnProperty.call(message, "config"))
|
7235 | $root.google.cloud.speech.v1p1beta1.RecognitionConfig.encode(message.config, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
7236 | if (message.audio != null && Object.hasOwnProperty.call(message, "audio"))
|
7237 | $root.google.cloud.speech.v1p1beta1.RecognitionAudio.encode(message.audio, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
7238 | if (message.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig"))
|
7239 | $root.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.encode(message.outputConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
|
7240 | return writer;
|
7241 | };
|
7242 |
|
7243 | /**
|
7244 | * Encodes the specified LongRunningRecognizeRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest.verify|verify} messages.
|
7245 | * @function encodeDelimited
|
7246 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest
|
7247 | * @static
|
7248 | * @param {google.cloud.speech.v1p1beta1.ILongRunningRecognizeRequest} message LongRunningRecognizeRequest message or plain object to encode
|
7249 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
7250 | * @returns {$protobuf.Writer} Writer
|
7251 | */
|
7252 | LongRunningRecognizeRequest.encodeDelimited = function encodeDelimited(message, writer) {
|
7253 | return this.encode(message, writer).ldelim();
|
7254 | };
|
7255 |
|
7256 | /**
|
7257 | * Decodes a LongRunningRecognizeRequest message from the specified reader or buffer.
|
7258 | * @function decode
|
7259 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest
|
7260 | * @static
|
7261 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
7262 | * @param {number} [length] Message length if known beforehand
|
7263 | * @returns {google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest} LongRunningRecognizeRequest
|
7264 | * @throws {Error} If the payload is not a reader or valid buffer
|
7265 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
7266 | */
|
7267 | LongRunningRecognizeRequest.decode = function decode(reader, length) {
|
7268 | if (!(reader instanceof $Reader))
|
7269 | reader = $Reader.create(reader);
|
7270 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest();
|
7271 | while (reader.pos < end) {
|
7272 | var tag = reader.uint32();
|
7273 | switch (tag >>> 3) {
|
7274 | case 1:
|
7275 | message.config = $root.google.cloud.speech.v1p1beta1.RecognitionConfig.decode(reader, reader.uint32());
|
7276 | break;
|
7277 | case 2:
|
7278 | message.audio = $root.google.cloud.speech.v1p1beta1.RecognitionAudio.decode(reader, reader.uint32());
|
7279 | break;
|
7280 | case 4:
|
7281 | message.outputConfig = $root.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.decode(reader, reader.uint32());
|
7282 | break;
|
7283 | default:
|
7284 | reader.skipType(tag & 7);
|
7285 | break;
|
7286 | }
|
7287 | }
|
7288 | return message;
|
7289 | };
|
7290 |
|
7291 | /**
|
7292 | * Decodes a LongRunningRecognizeRequest message from the specified reader or buffer, length delimited.
|
7293 | * @function decodeDelimited
|
7294 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest
|
7295 | * @static
|
7296 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
7297 | * @returns {google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest} LongRunningRecognizeRequest
|
7298 | * @throws {Error} If the payload is not a reader or valid buffer
|
7299 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
7300 | */
|
7301 | LongRunningRecognizeRequest.decodeDelimited = function decodeDelimited(reader) {
|
7302 | if (!(reader instanceof $Reader))
|
7303 | reader = new $Reader(reader);
|
7304 | return this.decode(reader, reader.uint32());
|
7305 | };
|
7306 |
|
7307 | /**
|
7308 | * Verifies a LongRunningRecognizeRequest message.
|
7309 | * @function verify
|
7310 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest
|
7311 | * @static
|
7312 | * @param {Object.<string,*>} message Plain object to verify
|
7313 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
7314 | */
|
7315 | LongRunningRecognizeRequest.verify = function verify(message) {
|
7316 | if (typeof message !== "object" || message === null)
|
7317 | return "object expected";
|
7318 | if (message.config != null && message.hasOwnProperty("config")) {
|
7319 | var error = $root.google.cloud.speech.v1p1beta1.RecognitionConfig.verify(message.config);
|
7320 | if (error)
|
7321 | return "config." + error;
|
7322 | }
|
7323 | if (message.audio != null && message.hasOwnProperty("audio")) {
|
7324 | var error = $root.google.cloud.speech.v1p1beta1.RecognitionAudio.verify(message.audio);
|
7325 | if (error)
|
7326 | return "audio." + error;
|
7327 | }
|
7328 | if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) {
|
7329 | var error = $root.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.verify(message.outputConfig);
|
7330 | if (error)
|
7331 | return "outputConfig." + error;
|
7332 | }
|
7333 | return null;
|
7334 | };
|
7335 |
|
7336 | /**
|
7337 | * Creates a LongRunningRecognizeRequest message from a plain object. Also converts values to their respective internal types.
|
7338 | * @function fromObject
|
7339 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest
|
7340 | * @static
|
7341 | * @param {Object.<string,*>} object Plain object
|
7342 | * @returns {google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest} LongRunningRecognizeRequest
|
7343 | */
|
7344 | LongRunningRecognizeRequest.fromObject = function fromObject(object) {
|
7345 | if (object instanceof $root.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest)
|
7346 | return object;
|
7347 | var message = new $root.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest();
|
7348 | if (object.config != null) {
|
7349 | if (typeof object.config !== "object")
|
7350 | throw TypeError(".google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest.config: object expected");
|
7351 | message.config = $root.google.cloud.speech.v1p1beta1.RecognitionConfig.fromObject(object.config);
|
7352 | }
|
7353 | if (object.audio != null) {
|
7354 | if (typeof object.audio !== "object")
|
7355 | throw TypeError(".google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest.audio: object expected");
|
7356 | message.audio = $root.google.cloud.speech.v1p1beta1.RecognitionAudio.fromObject(object.audio);
|
7357 | }
|
7358 | if (object.outputConfig != null) {
|
7359 | if (typeof object.outputConfig !== "object")
|
7360 | throw TypeError(".google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest.outputConfig: object expected");
|
7361 | message.outputConfig = $root.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.fromObject(object.outputConfig);
|
7362 | }
|
7363 | return message;
|
7364 | };
|
7365 |
|
7366 | /**
|
7367 | * Creates a plain object from a LongRunningRecognizeRequest message. Also converts values to other types if specified.
|
7368 | * @function toObject
|
7369 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest
|
7370 | * @static
|
7371 | * @param {google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest} message LongRunningRecognizeRequest
|
7372 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
7373 | * @returns {Object.<string,*>} Plain object
|
7374 | */
|
7375 | LongRunningRecognizeRequest.toObject = function toObject(message, options) {
|
7376 | if (!options)
|
7377 | options = {};
|
7378 | var object = {};
|
7379 | if (options.defaults) {
|
7380 | object.config = null;
|
7381 | object.audio = null;
|
7382 | object.outputConfig = null;
|
7383 | }
|
7384 | if (message.config != null && message.hasOwnProperty("config"))
|
7385 | object.config = $root.google.cloud.speech.v1p1beta1.RecognitionConfig.toObject(message.config, options);
|
7386 | if (message.audio != null && message.hasOwnProperty("audio"))
|
7387 | object.audio = $root.google.cloud.speech.v1p1beta1.RecognitionAudio.toObject(message.audio, options);
|
7388 | if (message.outputConfig != null && message.hasOwnProperty("outputConfig"))
|
7389 | object.outputConfig = $root.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.toObject(message.outputConfig, options);
|
7390 | return object;
|
7391 | };
|
7392 |
|
7393 | /**
|
7394 | * Converts this LongRunningRecognizeRequest to JSON.
|
7395 | * @function toJSON
|
7396 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest
|
7397 | * @instance
|
7398 | * @returns {Object.<string,*>} JSON object
|
7399 | */
|
7400 | LongRunningRecognizeRequest.prototype.toJSON = function toJSON() {
|
7401 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
7402 | };
|
7403 |
|
7404 | return LongRunningRecognizeRequest;
|
7405 | })();
|
7406 |
|
7407 | v1p1beta1.TranscriptOutputConfig = (function() {
|
7408 |
|
7409 | /**
|
7410 | * Properties of a TranscriptOutputConfig.
|
7411 | * @memberof google.cloud.speech.v1p1beta1
|
7412 | * @interface ITranscriptOutputConfig
|
7413 | * @property {string|null} [gcsUri] TranscriptOutputConfig gcsUri
|
7414 | */
|
7415 |
|
7416 | /**
|
7417 | * Constructs a new TranscriptOutputConfig.
|
7418 | * @memberof google.cloud.speech.v1p1beta1
|
7419 | * @classdesc Represents a TranscriptOutputConfig.
|
7420 | * @implements ITranscriptOutputConfig
|
7421 | * @constructor
|
7422 | * @param {google.cloud.speech.v1p1beta1.ITranscriptOutputConfig=} [properties] Properties to set
|
7423 | */
|
7424 | function TranscriptOutputConfig(properties) {
|
7425 | if (properties)
|
7426 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
7427 | if (properties[keys[i]] != null)
|
7428 | this[keys[i]] = properties[keys[i]];
|
7429 | }
|
7430 |
|
7431 | /**
|
7432 | * TranscriptOutputConfig gcsUri.
|
7433 | * @member {string|null|undefined} gcsUri
|
7434 | * @memberof google.cloud.speech.v1p1beta1.TranscriptOutputConfig
|
7435 | * @instance
|
7436 | */
|
7437 | TranscriptOutputConfig.prototype.gcsUri = null;
|
7438 |
|
7439 | // OneOf field names bound to virtual getters and setters
|
7440 | var $oneOfFields;
|
7441 |
|
7442 | /**
|
7443 | * TranscriptOutputConfig outputType.
|
7444 | * @member {"gcsUri"|undefined} outputType
|
7445 | * @memberof google.cloud.speech.v1p1beta1.TranscriptOutputConfig
|
7446 | * @instance
|
7447 | */
|
7448 | Object.defineProperty(TranscriptOutputConfig.prototype, "outputType", {
|
7449 | get: $util.oneOfGetter($oneOfFields = ["gcsUri"]),
|
7450 | set: $util.oneOfSetter($oneOfFields)
|
7451 | });
|
7452 |
|
7453 | /**
|
7454 | * Creates a new TranscriptOutputConfig instance using the specified properties.
|
7455 | * @function create
|
7456 | * @memberof google.cloud.speech.v1p1beta1.TranscriptOutputConfig
|
7457 | * @static
|
7458 | * @param {google.cloud.speech.v1p1beta1.ITranscriptOutputConfig=} [properties] Properties to set
|
7459 | * @returns {google.cloud.speech.v1p1beta1.TranscriptOutputConfig} TranscriptOutputConfig instance
|
7460 | */
|
7461 | TranscriptOutputConfig.create = function create(properties) {
|
7462 | return new TranscriptOutputConfig(properties);
|
7463 | };
|
7464 |
|
7465 | /**
|
7466 | * Encodes the specified TranscriptOutputConfig message. Does not implicitly {@link google.cloud.speech.v1p1beta1.TranscriptOutputConfig.verify|verify} messages.
|
7467 | * @function encode
|
7468 | * @memberof google.cloud.speech.v1p1beta1.TranscriptOutputConfig
|
7469 | * @static
|
7470 | * @param {google.cloud.speech.v1p1beta1.ITranscriptOutputConfig} message TranscriptOutputConfig message or plain object to encode
|
7471 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
7472 | * @returns {$protobuf.Writer} Writer
|
7473 | */
|
7474 | TranscriptOutputConfig.encode = function encode(message, writer) {
|
7475 | if (!writer)
|
7476 | writer = $Writer.create();
|
7477 | if (message.gcsUri != null && Object.hasOwnProperty.call(message, "gcsUri"))
|
7478 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcsUri);
|
7479 | return writer;
|
7480 | };
|
7481 |
|
7482 | /**
|
7483 | * Encodes the specified TranscriptOutputConfig message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.TranscriptOutputConfig.verify|verify} messages.
|
7484 | * @function encodeDelimited
|
7485 | * @memberof google.cloud.speech.v1p1beta1.TranscriptOutputConfig
|
7486 | * @static
|
7487 | * @param {google.cloud.speech.v1p1beta1.ITranscriptOutputConfig} message TranscriptOutputConfig message or plain object to encode
|
7488 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
7489 | * @returns {$protobuf.Writer} Writer
|
7490 | */
|
7491 | TranscriptOutputConfig.encodeDelimited = function encodeDelimited(message, writer) {
|
7492 | return this.encode(message, writer).ldelim();
|
7493 | };
|
7494 |
|
7495 | /**
|
7496 | * Decodes a TranscriptOutputConfig message from the specified reader or buffer.
|
7497 | * @function decode
|
7498 | * @memberof google.cloud.speech.v1p1beta1.TranscriptOutputConfig
|
7499 | * @static
|
7500 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
7501 | * @param {number} [length] Message length if known beforehand
|
7502 | * @returns {google.cloud.speech.v1p1beta1.TranscriptOutputConfig} TranscriptOutputConfig
|
7503 | * @throws {Error} If the payload is not a reader or valid buffer
|
7504 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
7505 | */
|
7506 | TranscriptOutputConfig.decode = function decode(reader, length) {
|
7507 | if (!(reader instanceof $Reader))
|
7508 | reader = $Reader.create(reader);
|
7509 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.TranscriptOutputConfig();
|
7510 | while (reader.pos < end) {
|
7511 | var tag = reader.uint32();
|
7512 | switch (tag >>> 3) {
|
7513 | case 1:
|
7514 | message.gcsUri = reader.string();
|
7515 | break;
|
7516 | default:
|
7517 | reader.skipType(tag & 7);
|
7518 | break;
|
7519 | }
|
7520 | }
|
7521 | return message;
|
7522 | };
|
7523 |
|
7524 | /**
|
7525 | * Decodes a TranscriptOutputConfig message from the specified reader or buffer, length delimited.
|
7526 | * @function decodeDelimited
|
7527 | * @memberof google.cloud.speech.v1p1beta1.TranscriptOutputConfig
|
7528 | * @static
|
7529 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
7530 | * @returns {google.cloud.speech.v1p1beta1.TranscriptOutputConfig} TranscriptOutputConfig
|
7531 | * @throws {Error} If the payload is not a reader or valid buffer
|
7532 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
7533 | */
|
7534 | TranscriptOutputConfig.decodeDelimited = function decodeDelimited(reader) {
|
7535 | if (!(reader instanceof $Reader))
|
7536 | reader = new $Reader(reader);
|
7537 | return this.decode(reader, reader.uint32());
|
7538 | };
|
7539 |
|
7540 | /**
|
7541 | * Verifies a TranscriptOutputConfig message.
|
7542 | * @function verify
|
7543 | * @memberof google.cloud.speech.v1p1beta1.TranscriptOutputConfig
|
7544 | * @static
|
7545 | * @param {Object.<string,*>} message Plain object to verify
|
7546 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
7547 | */
|
7548 | TranscriptOutputConfig.verify = function verify(message) {
|
7549 | if (typeof message !== "object" || message === null)
|
7550 | return "object expected";
|
7551 | var properties = {};
|
7552 | if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) {
|
7553 | properties.outputType = 1;
|
7554 | if (!$util.isString(message.gcsUri))
|
7555 | return "gcsUri: string expected";
|
7556 | }
|
7557 | return null;
|
7558 | };
|
7559 |
|
7560 | /**
|
7561 | * Creates a TranscriptOutputConfig message from a plain object. Also converts values to their respective internal types.
|
7562 | * @function fromObject
|
7563 | * @memberof google.cloud.speech.v1p1beta1.TranscriptOutputConfig
|
7564 | * @static
|
7565 | * @param {Object.<string,*>} object Plain object
|
7566 | * @returns {google.cloud.speech.v1p1beta1.TranscriptOutputConfig} TranscriptOutputConfig
|
7567 | */
|
7568 | TranscriptOutputConfig.fromObject = function fromObject(object) {
|
7569 | if (object instanceof $root.google.cloud.speech.v1p1beta1.TranscriptOutputConfig)
|
7570 | return object;
|
7571 | var message = new $root.google.cloud.speech.v1p1beta1.TranscriptOutputConfig();
|
7572 | if (object.gcsUri != null)
|
7573 | message.gcsUri = String(object.gcsUri);
|
7574 | return message;
|
7575 | };
|
7576 |
|
7577 | /**
|
7578 | * Creates a plain object from a TranscriptOutputConfig message. Also converts values to other types if specified.
|
7579 | * @function toObject
|
7580 | * @memberof google.cloud.speech.v1p1beta1.TranscriptOutputConfig
|
7581 | * @static
|
7582 | * @param {google.cloud.speech.v1p1beta1.TranscriptOutputConfig} message TranscriptOutputConfig
|
7583 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
7584 | * @returns {Object.<string,*>} Plain object
|
7585 | */
|
7586 | TranscriptOutputConfig.toObject = function toObject(message, options) {
|
7587 | if (!options)
|
7588 | options = {};
|
7589 | var object = {};
|
7590 | if (message.gcsUri != null && message.hasOwnProperty("gcsUri")) {
|
7591 | object.gcsUri = message.gcsUri;
|
7592 | if (options.oneofs)
|
7593 | object.outputType = "gcsUri";
|
7594 | }
|
7595 | return object;
|
7596 | };
|
7597 |
|
7598 | /**
|
7599 | * Converts this TranscriptOutputConfig to JSON.
|
7600 | * @function toJSON
|
7601 | * @memberof google.cloud.speech.v1p1beta1.TranscriptOutputConfig
|
7602 | * @instance
|
7603 | * @returns {Object.<string,*>} JSON object
|
7604 | */
|
7605 | TranscriptOutputConfig.prototype.toJSON = function toJSON() {
|
7606 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
7607 | };
|
7608 |
|
7609 | return TranscriptOutputConfig;
|
7610 | })();
|
7611 |
|
7612 | v1p1beta1.StreamingRecognizeRequest = (function() {
|
7613 |
|
7614 | /**
|
7615 | * Properties of a StreamingRecognizeRequest.
|
7616 | * @memberof google.cloud.speech.v1p1beta1
|
7617 | * @interface IStreamingRecognizeRequest
|
7618 | * @property {google.cloud.speech.v1p1beta1.IStreamingRecognitionConfig|null} [streamingConfig] StreamingRecognizeRequest streamingConfig
|
7619 | * @property {Uint8Array|null} [audioContent] StreamingRecognizeRequest audioContent
|
7620 | */
|
7621 |
|
7622 | /**
|
7623 | * Constructs a new StreamingRecognizeRequest.
|
7624 | * @memberof google.cloud.speech.v1p1beta1
|
7625 | * @classdesc Represents a StreamingRecognizeRequest.
|
7626 | * @implements IStreamingRecognizeRequest
|
7627 | * @constructor
|
7628 | * @param {google.cloud.speech.v1p1beta1.IStreamingRecognizeRequest=} [properties] Properties to set
|
7629 | */
|
7630 | function StreamingRecognizeRequest(properties) {
|
7631 | if (properties)
|
7632 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
7633 | if (properties[keys[i]] != null)
|
7634 | this[keys[i]] = properties[keys[i]];
|
7635 | }
|
7636 |
|
7637 | /**
|
7638 | * StreamingRecognizeRequest streamingConfig.
|
7639 | * @member {google.cloud.speech.v1p1beta1.IStreamingRecognitionConfig|null|undefined} streamingConfig
|
7640 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeRequest
|
7641 | * @instance
|
7642 | */
|
7643 | StreamingRecognizeRequest.prototype.streamingConfig = null;
|
7644 |
|
7645 | /**
|
7646 | * StreamingRecognizeRequest audioContent.
|
7647 | * @member {Uint8Array|null|undefined} audioContent
|
7648 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeRequest
|
7649 | * @instance
|
7650 | */
|
7651 | StreamingRecognizeRequest.prototype.audioContent = null;
|
7652 |
|
7653 | // OneOf field names bound to virtual getters and setters
|
7654 | var $oneOfFields;
|
7655 |
|
7656 | /**
|
7657 | * StreamingRecognizeRequest streamingRequest.
|
7658 | * @member {"streamingConfig"|"audioContent"|undefined} streamingRequest
|
7659 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeRequest
|
7660 | * @instance
|
7661 | */
|
7662 | Object.defineProperty(StreamingRecognizeRequest.prototype, "streamingRequest", {
|
7663 | get: $util.oneOfGetter($oneOfFields = ["streamingConfig", "audioContent"]),
|
7664 | set: $util.oneOfSetter($oneOfFields)
|
7665 | });
|
7666 |
|
7667 | /**
|
7668 | * Creates a new StreamingRecognizeRequest instance using the specified properties.
|
7669 | * @function create
|
7670 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeRequest
|
7671 | * @static
|
7672 | * @param {google.cloud.speech.v1p1beta1.IStreamingRecognizeRequest=} [properties] Properties to set
|
7673 | * @returns {google.cloud.speech.v1p1beta1.StreamingRecognizeRequest} StreamingRecognizeRequest instance
|
7674 | */
|
7675 | StreamingRecognizeRequest.create = function create(properties) {
|
7676 | return new StreamingRecognizeRequest(properties);
|
7677 | };
|
7678 |
|
7679 | /**
|
7680 | * Encodes the specified StreamingRecognizeRequest message. Does not implicitly {@link google.cloud.speech.v1p1beta1.StreamingRecognizeRequest.verify|verify} messages.
|
7681 | * @function encode
|
7682 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeRequest
|
7683 | * @static
|
7684 | * @param {google.cloud.speech.v1p1beta1.IStreamingRecognizeRequest} message StreamingRecognizeRequest message or plain object to encode
|
7685 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
7686 | * @returns {$protobuf.Writer} Writer
|
7687 | */
|
7688 | StreamingRecognizeRequest.encode = function encode(message, writer) {
|
7689 | if (!writer)
|
7690 | writer = $Writer.create();
|
7691 | if (message.streamingConfig != null && Object.hasOwnProperty.call(message, "streamingConfig"))
|
7692 | $root.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.encode(message.streamingConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
7693 | if (message.audioContent != null && Object.hasOwnProperty.call(message, "audioContent"))
|
7694 | writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.audioContent);
|
7695 | return writer;
|
7696 | };
|
7697 |
|
7698 | /**
|
7699 | * Encodes the specified StreamingRecognizeRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.StreamingRecognizeRequest.verify|verify} messages.
|
7700 | * @function encodeDelimited
|
7701 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeRequest
|
7702 | * @static
|
7703 | * @param {google.cloud.speech.v1p1beta1.IStreamingRecognizeRequest} message StreamingRecognizeRequest message or plain object to encode
|
7704 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
7705 | * @returns {$protobuf.Writer} Writer
|
7706 | */
|
7707 | StreamingRecognizeRequest.encodeDelimited = function encodeDelimited(message, writer) {
|
7708 | return this.encode(message, writer).ldelim();
|
7709 | };
|
7710 |
|
7711 | /**
|
7712 | * Decodes a StreamingRecognizeRequest message from the specified reader or buffer.
|
7713 | * @function decode
|
7714 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeRequest
|
7715 | * @static
|
7716 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
7717 | * @param {number} [length] Message length if known beforehand
|
7718 | * @returns {google.cloud.speech.v1p1beta1.StreamingRecognizeRequest} StreamingRecognizeRequest
|
7719 | * @throws {Error} If the payload is not a reader or valid buffer
|
7720 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
7721 | */
|
7722 | StreamingRecognizeRequest.decode = function decode(reader, length) {
|
7723 | if (!(reader instanceof $Reader))
|
7724 | reader = $Reader.create(reader);
|
7725 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest();
|
7726 | while (reader.pos < end) {
|
7727 | var tag = reader.uint32();
|
7728 | switch (tag >>> 3) {
|
7729 | case 1:
|
7730 | message.streamingConfig = $root.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.decode(reader, reader.uint32());
|
7731 | break;
|
7732 | case 2:
|
7733 | message.audioContent = reader.bytes();
|
7734 | break;
|
7735 | default:
|
7736 | reader.skipType(tag & 7);
|
7737 | break;
|
7738 | }
|
7739 | }
|
7740 | return message;
|
7741 | };
|
7742 |
|
7743 | /**
|
7744 | * Decodes a StreamingRecognizeRequest message from the specified reader or buffer, length delimited.
|
7745 | * @function decodeDelimited
|
7746 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeRequest
|
7747 | * @static
|
7748 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
7749 | * @returns {google.cloud.speech.v1p1beta1.StreamingRecognizeRequest} StreamingRecognizeRequest
|
7750 | * @throws {Error} If the payload is not a reader or valid buffer
|
7751 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
7752 | */
|
7753 | StreamingRecognizeRequest.decodeDelimited = function decodeDelimited(reader) {
|
7754 | if (!(reader instanceof $Reader))
|
7755 | reader = new $Reader(reader);
|
7756 | return this.decode(reader, reader.uint32());
|
7757 | };
|
7758 |
|
7759 | /**
|
7760 | * Verifies a StreamingRecognizeRequest message.
|
7761 | * @function verify
|
7762 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeRequest
|
7763 | * @static
|
7764 | * @param {Object.<string,*>} message Plain object to verify
|
7765 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
7766 | */
|
7767 | StreamingRecognizeRequest.verify = function verify(message) {
|
7768 | if (typeof message !== "object" || message === null)
|
7769 | return "object expected";
|
7770 | var properties = {};
|
7771 | if (message.streamingConfig != null && message.hasOwnProperty("streamingConfig")) {
|
7772 | properties.streamingRequest = 1;
|
7773 | {
|
7774 | var error = $root.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.verify(message.streamingConfig);
|
7775 | if (error)
|
7776 | return "streamingConfig." + error;
|
7777 | }
|
7778 | }
|
7779 | if (message.audioContent != null && message.hasOwnProperty("audioContent")) {
|
7780 | if (properties.streamingRequest === 1)
|
7781 | return "streamingRequest: multiple values";
|
7782 | properties.streamingRequest = 1;
|
7783 | if (!(message.audioContent && typeof message.audioContent.length === "number" || $util.isString(message.audioContent)))
|
7784 | return "audioContent: buffer expected";
|
7785 | }
|
7786 | return null;
|
7787 | };
|
7788 |
|
7789 | /**
|
7790 | * Creates a StreamingRecognizeRequest message from a plain object. Also converts values to their respective internal types.
|
7791 | * @function fromObject
|
7792 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeRequest
|
7793 | * @static
|
7794 | * @param {Object.<string,*>} object Plain object
|
7795 | * @returns {google.cloud.speech.v1p1beta1.StreamingRecognizeRequest} StreamingRecognizeRequest
|
7796 | */
|
7797 | StreamingRecognizeRequest.fromObject = function fromObject(object) {
|
7798 | if (object instanceof $root.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest)
|
7799 | return object;
|
7800 | var message = new $root.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest();
|
7801 | if (object.streamingConfig != null) {
|
7802 | if (typeof object.streamingConfig !== "object")
|
7803 | throw TypeError(".google.cloud.speech.v1p1beta1.StreamingRecognizeRequest.streamingConfig: object expected");
|
7804 | message.streamingConfig = $root.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.fromObject(object.streamingConfig);
|
7805 | }
|
7806 | if (object.audioContent != null)
|
7807 | if (typeof object.audioContent === "string")
|
7808 | $util.base64.decode(object.audioContent, message.audioContent = $util.newBuffer($util.base64.length(object.audioContent)), 0);
|
7809 | else if (object.audioContent.length)
|
7810 | message.audioContent = object.audioContent;
|
7811 | return message;
|
7812 | };
|
7813 |
|
7814 | /**
|
7815 | * Creates a plain object from a StreamingRecognizeRequest message. Also converts values to other types if specified.
|
7816 | * @function toObject
|
7817 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeRequest
|
7818 | * @static
|
7819 | * @param {google.cloud.speech.v1p1beta1.StreamingRecognizeRequest} message StreamingRecognizeRequest
|
7820 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
7821 | * @returns {Object.<string,*>} Plain object
|
7822 | */
|
7823 | StreamingRecognizeRequest.toObject = function toObject(message, options) {
|
7824 | if (!options)
|
7825 | options = {};
|
7826 | var object = {};
|
7827 | if (message.streamingConfig != null && message.hasOwnProperty("streamingConfig")) {
|
7828 | object.streamingConfig = $root.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.toObject(message.streamingConfig, options);
|
7829 | if (options.oneofs)
|
7830 | object.streamingRequest = "streamingConfig";
|
7831 | }
|
7832 | if (message.audioContent != null && message.hasOwnProperty("audioContent")) {
|
7833 | 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;
|
7834 | if (options.oneofs)
|
7835 | object.streamingRequest = "audioContent";
|
7836 | }
|
7837 | return object;
|
7838 | };
|
7839 |
|
7840 | /**
|
7841 | * Converts this StreamingRecognizeRequest to JSON.
|
7842 | * @function toJSON
|
7843 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeRequest
|
7844 | * @instance
|
7845 | * @returns {Object.<string,*>} JSON object
|
7846 | */
|
7847 | StreamingRecognizeRequest.prototype.toJSON = function toJSON() {
|
7848 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
7849 | };
|
7850 |
|
7851 | return StreamingRecognizeRequest;
|
7852 | })();
|
7853 |
|
7854 | v1p1beta1.StreamingRecognitionConfig = (function() {
|
7855 |
|
7856 | /**
|
7857 | * Properties of a StreamingRecognitionConfig.
|
7858 | * @memberof google.cloud.speech.v1p1beta1
|
7859 | * @interface IStreamingRecognitionConfig
|
7860 | * @property {google.cloud.speech.v1p1beta1.IRecognitionConfig|null} [config] StreamingRecognitionConfig config
|
7861 | * @property {boolean|null} [singleUtterance] StreamingRecognitionConfig singleUtterance
|
7862 | * @property {boolean|null} [interimResults] StreamingRecognitionConfig interimResults
|
7863 | */
|
7864 |
|
7865 | /**
|
7866 | * Constructs a new StreamingRecognitionConfig.
|
7867 | * @memberof google.cloud.speech.v1p1beta1
|
7868 | * @classdesc Represents a StreamingRecognitionConfig.
|
7869 | * @implements IStreamingRecognitionConfig
|
7870 | * @constructor
|
7871 | * @param {google.cloud.speech.v1p1beta1.IStreamingRecognitionConfig=} [properties] Properties to set
|
7872 | */
|
7873 | function StreamingRecognitionConfig(properties) {
|
7874 | if (properties)
|
7875 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
7876 | if (properties[keys[i]] != null)
|
7877 | this[keys[i]] = properties[keys[i]];
|
7878 | }
|
7879 |
|
7880 | /**
|
7881 | * StreamingRecognitionConfig config.
|
7882 | * @member {google.cloud.speech.v1p1beta1.IRecognitionConfig|null|undefined} config
|
7883 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionConfig
|
7884 | * @instance
|
7885 | */
|
7886 | StreamingRecognitionConfig.prototype.config = null;
|
7887 |
|
7888 | /**
|
7889 | * StreamingRecognitionConfig singleUtterance.
|
7890 | * @member {boolean} singleUtterance
|
7891 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionConfig
|
7892 | * @instance
|
7893 | */
|
7894 | StreamingRecognitionConfig.prototype.singleUtterance = false;
|
7895 |
|
7896 | /**
|
7897 | * StreamingRecognitionConfig interimResults.
|
7898 | * @member {boolean} interimResults
|
7899 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionConfig
|
7900 | * @instance
|
7901 | */
|
7902 | StreamingRecognitionConfig.prototype.interimResults = false;
|
7903 |
|
7904 | /**
|
7905 | * Creates a new StreamingRecognitionConfig instance using the specified properties.
|
7906 | * @function create
|
7907 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionConfig
|
7908 | * @static
|
7909 | * @param {google.cloud.speech.v1p1beta1.IStreamingRecognitionConfig=} [properties] Properties to set
|
7910 | * @returns {google.cloud.speech.v1p1beta1.StreamingRecognitionConfig} StreamingRecognitionConfig instance
|
7911 | */
|
7912 | StreamingRecognitionConfig.create = function create(properties) {
|
7913 | return new StreamingRecognitionConfig(properties);
|
7914 | };
|
7915 |
|
7916 | /**
|
7917 | * Encodes the specified StreamingRecognitionConfig message. Does not implicitly {@link google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.verify|verify} messages.
|
7918 | * @function encode
|
7919 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionConfig
|
7920 | * @static
|
7921 | * @param {google.cloud.speech.v1p1beta1.IStreamingRecognitionConfig} message StreamingRecognitionConfig message or plain object to encode
|
7922 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
7923 | * @returns {$protobuf.Writer} Writer
|
7924 | */
|
7925 | StreamingRecognitionConfig.encode = function encode(message, writer) {
|
7926 | if (!writer)
|
7927 | writer = $Writer.create();
|
7928 | if (message.config != null && Object.hasOwnProperty.call(message, "config"))
|
7929 | $root.google.cloud.speech.v1p1beta1.RecognitionConfig.encode(message.config, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
7930 | if (message.singleUtterance != null && Object.hasOwnProperty.call(message, "singleUtterance"))
|
7931 | writer.uint32(/* id 2, wireType 0 =*/16).bool(message.singleUtterance);
|
7932 | if (message.interimResults != null && Object.hasOwnProperty.call(message, "interimResults"))
|
7933 | writer.uint32(/* id 3, wireType 0 =*/24).bool(message.interimResults);
|
7934 | return writer;
|
7935 | };
|
7936 |
|
7937 | /**
|
7938 | * Encodes the specified StreamingRecognitionConfig message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.verify|verify} messages.
|
7939 | * @function encodeDelimited
|
7940 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionConfig
|
7941 | * @static
|
7942 | * @param {google.cloud.speech.v1p1beta1.IStreamingRecognitionConfig} message StreamingRecognitionConfig message or plain object to encode
|
7943 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
7944 | * @returns {$protobuf.Writer} Writer
|
7945 | */
|
7946 | StreamingRecognitionConfig.encodeDelimited = function encodeDelimited(message, writer) {
|
7947 | return this.encode(message, writer).ldelim();
|
7948 | };
|
7949 |
|
7950 | /**
|
7951 | * Decodes a StreamingRecognitionConfig message from the specified reader or buffer.
|
7952 | * @function decode
|
7953 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionConfig
|
7954 | * @static
|
7955 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
7956 | * @param {number} [length] Message length if known beforehand
|
7957 | * @returns {google.cloud.speech.v1p1beta1.StreamingRecognitionConfig} StreamingRecognitionConfig
|
7958 | * @throws {Error} If the payload is not a reader or valid buffer
|
7959 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
7960 | */
|
7961 | StreamingRecognitionConfig.decode = function decode(reader, length) {
|
7962 | if (!(reader instanceof $Reader))
|
7963 | reader = $Reader.create(reader);
|
7964 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig();
|
7965 | while (reader.pos < end) {
|
7966 | var tag = reader.uint32();
|
7967 | switch (tag >>> 3) {
|
7968 | case 1:
|
7969 | message.config = $root.google.cloud.speech.v1p1beta1.RecognitionConfig.decode(reader, reader.uint32());
|
7970 | break;
|
7971 | case 2:
|
7972 | message.singleUtterance = reader.bool();
|
7973 | break;
|
7974 | case 3:
|
7975 | message.interimResults = reader.bool();
|
7976 | break;
|
7977 | default:
|
7978 | reader.skipType(tag & 7);
|
7979 | break;
|
7980 | }
|
7981 | }
|
7982 | return message;
|
7983 | };
|
7984 |
|
7985 | /**
|
7986 | * Decodes a StreamingRecognitionConfig message from the specified reader or buffer, length delimited.
|
7987 | * @function decodeDelimited
|
7988 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionConfig
|
7989 | * @static
|
7990 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
7991 | * @returns {google.cloud.speech.v1p1beta1.StreamingRecognitionConfig} StreamingRecognitionConfig
|
7992 | * @throws {Error} If the payload is not a reader or valid buffer
|
7993 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
7994 | */
|
7995 | StreamingRecognitionConfig.decodeDelimited = function decodeDelimited(reader) {
|
7996 | if (!(reader instanceof $Reader))
|
7997 | reader = new $Reader(reader);
|
7998 | return this.decode(reader, reader.uint32());
|
7999 | };
|
8000 |
|
8001 | /**
|
8002 | * Verifies a StreamingRecognitionConfig message.
|
8003 | * @function verify
|
8004 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionConfig
|
8005 | * @static
|
8006 | * @param {Object.<string,*>} message Plain object to verify
|
8007 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
8008 | */
|
8009 | StreamingRecognitionConfig.verify = function verify(message) {
|
8010 | if (typeof message !== "object" || message === null)
|
8011 | return "object expected";
|
8012 | if (message.config != null && message.hasOwnProperty("config")) {
|
8013 | var error = $root.google.cloud.speech.v1p1beta1.RecognitionConfig.verify(message.config);
|
8014 | if (error)
|
8015 | return "config." + error;
|
8016 | }
|
8017 | if (message.singleUtterance != null && message.hasOwnProperty("singleUtterance"))
|
8018 | if (typeof message.singleUtterance !== "boolean")
|
8019 | return "singleUtterance: boolean expected";
|
8020 | if (message.interimResults != null && message.hasOwnProperty("interimResults"))
|
8021 | if (typeof message.interimResults !== "boolean")
|
8022 | return "interimResults: boolean expected";
|
8023 | return null;
|
8024 | };
|
8025 |
|
8026 | /**
|
8027 | * Creates a StreamingRecognitionConfig message from a plain object. Also converts values to their respective internal types.
|
8028 | * @function fromObject
|
8029 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionConfig
|
8030 | * @static
|
8031 | * @param {Object.<string,*>} object Plain object
|
8032 | * @returns {google.cloud.speech.v1p1beta1.StreamingRecognitionConfig} StreamingRecognitionConfig
|
8033 | */
|
8034 | StreamingRecognitionConfig.fromObject = function fromObject(object) {
|
8035 | if (object instanceof $root.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig)
|
8036 | return object;
|
8037 | var message = new $root.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig();
|
8038 | if (object.config != null) {
|
8039 | if (typeof object.config !== "object")
|
8040 | throw TypeError(".google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.config: object expected");
|
8041 | message.config = $root.google.cloud.speech.v1p1beta1.RecognitionConfig.fromObject(object.config);
|
8042 | }
|
8043 | if (object.singleUtterance != null)
|
8044 | message.singleUtterance = Boolean(object.singleUtterance);
|
8045 | if (object.interimResults != null)
|
8046 | message.interimResults = Boolean(object.interimResults);
|
8047 | return message;
|
8048 | };
|
8049 |
|
8050 | /**
|
8051 | * Creates a plain object from a StreamingRecognitionConfig message. Also converts values to other types if specified.
|
8052 | * @function toObject
|
8053 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionConfig
|
8054 | * @static
|
8055 | * @param {google.cloud.speech.v1p1beta1.StreamingRecognitionConfig} message StreamingRecognitionConfig
|
8056 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
8057 | * @returns {Object.<string,*>} Plain object
|
8058 | */
|
8059 | StreamingRecognitionConfig.toObject = function toObject(message, options) {
|
8060 | if (!options)
|
8061 | options = {};
|
8062 | var object = {};
|
8063 | if (options.defaults) {
|
8064 | object.config = null;
|
8065 | object.singleUtterance = false;
|
8066 | object.interimResults = false;
|
8067 | }
|
8068 | if (message.config != null && message.hasOwnProperty("config"))
|
8069 | object.config = $root.google.cloud.speech.v1p1beta1.RecognitionConfig.toObject(message.config, options);
|
8070 | if (message.singleUtterance != null && message.hasOwnProperty("singleUtterance"))
|
8071 | object.singleUtterance = message.singleUtterance;
|
8072 | if (message.interimResults != null && message.hasOwnProperty("interimResults"))
|
8073 | object.interimResults = message.interimResults;
|
8074 | return object;
|
8075 | };
|
8076 |
|
8077 | /**
|
8078 | * Converts this StreamingRecognitionConfig to JSON.
|
8079 | * @function toJSON
|
8080 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionConfig
|
8081 | * @instance
|
8082 | * @returns {Object.<string,*>} JSON object
|
8083 | */
|
8084 | StreamingRecognitionConfig.prototype.toJSON = function toJSON() {
|
8085 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
8086 | };
|
8087 |
|
8088 | return StreamingRecognitionConfig;
|
8089 | })();
|
8090 |
|
8091 | v1p1beta1.RecognitionConfig = (function() {
|
8092 |
|
8093 | /**
|
8094 | * Properties of a RecognitionConfig.
|
8095 | * @memberof google.cloud.speech.v1p1beta1
|
8096 | * @interface IRecognitionConfig
|
8097 | * @property {google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding|null} [encoding] RecognitionConfig encoding
|
8098 | * @property {number|null} [sampleRateHertz] RecognitionConfig sampleRateHertz
|
8099 | * @property {number|null} [audioChannelCount] RecognitionConfig audioChannelCount
|
8100 | * @property {boolean|null} [enableSeparateRecognitionPerChannel] RecognitionConfig enableSeparateRecognitionPerChannel
|
8101 | * @property {string|null} [languageCode] RecognitionConfig languageCode
|
8102 | * @property {Array.<string>|null} [alternativeLanguageCodes] RecognitionConfig alternativeLanguageCodes
|
8103 | * @property {number|null} [maxAlternatives] RecognitionConfig maxAlternatives
|
8104 | * @property {boolean|null} [profanityFilter] RecognitionConfig profanityFilter
|
8105 | * @property {google.cloud.speech.v1p1beta1.ISpeechAdaptation|null} [adaptation] RecognitionConfig adaptation
|
8106 | * @property {google.cloud.speech.v1p1beta1.ITranscriptNormalization|null} [transcriptNormalization] RecognitionConfig transcriptNormalization
|
8107 | * @property {Array.<google.cloud.speech.v1p1beta1.ISpeechContext>|null} [speechContexts] RecognitionConfig speechContexts
|
8108 | * @property {boolean|null} [enableWordTimeOffsets] RecognitionConfig enableWordTimeOffsets
|
8109 | * @property {boolean|null} [enableWordConfidence] RecognitionConfig enableWordConfidence
|
8110 | * @property {boolean|null} [enableAutomaticPunctuation] RecognitionConfig enableAutomaticPunctuation
|
8111 | * @property {google.protobuf.IBoolValue|null} [enableSpokenPunctuation] RecognitionConfig enableSpokenPunctuation
|
8112 | * @property {google.protobuf.IBoolValue|null} [enableSpokenEmojis] RecognitionConfig enableSpokenEmojis
|
8113 | * @property {boolean|null} [enableSpeakerDiarization] RecognitionConfig enableSpeakerDiarization
|
8114 | * @property {number|null} [diarizationSpeakerCount] RecognitionConfig diarizationSpeakerCount
|
8115 | * @property {google.cloud.speech.v1p1beta1.ISpeakerDiarizationConfig|null} [diarizationConfig] RecognitionConfig diarizationConfig
|
8116 | * @property {google.cloud.speech.v1p1beta1.IRecognitionMetadata|null} [metadata] RecognitionConfig metadata
|
8117 | * @property {string|null} [model] RecognitionConfig model
|
8118 | * @property {boolean|null} [useEnhanced] RecognitionConfig useEnhanced
|
8119 | */
|
8120 |
|
8121 | /**
|
8122 | * Constructs a new RecognitionConfig.
|
8123 | * @memberof google.cloud.speech.v1p1beta1
|
8124 | * @classdesc Represents a RecognitionConfig.
|
8125 | * @implements IRecognitionConfig
|
8126 | * @constructor
|
8127 | * @param {google.cloud.speech.v1p1beta1.IRecognitionConfig=} [properties] Properties to set
|
8128 | */
|
8129 | function RecognitionConfig(properties) {
|
8130 | this.alternativeLanguageCodes = [];
|
8131 | this.speechContexts = [];
|
8132 | if (properties)
|
8133 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
8134 | if (properties[keys[i]] != null)
|
8135 | this[keys[i]] = properties[keys[i]];
|
8136 | }
|
8137 |
|
8138 | /**
|
8139 | * RecognitionConfig encoding.
|
8140 | * @member {google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding} encoding
|
8141 | * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig
|
8142 | * @instance
|
8143 | */
|
8144 | RecognitionConfig.prototype.encoding = 0;
|
8145 |
|
8146 | /**
|
8147 | * RecognitionConfig sampleRateHertz.
|
8148 | * @member {number} sampleRateHertz
|
8149 | * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig
|
8150 | * @instance
|
8151 | */
|
8152 | RecognitionConfig.prototype.sampleRateHertz = 0;
|
8153 |
|
8154 | /**
|
8155 | * RecognitionConfig audioChannelCount.
|
8156 | * @member {number} audioChannelCount
|
8157 | * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig
|
8158 | * @instance
|
8159 | */
|
8160 | RecognitionConfig.prototype.audioChannelCount = 0;
|
8161 |
|
8162 | /**
|
8163 | * RecognitionConfig enableSeparateRecognitionPerChannel.
|
8164 | * @member {boolean} enableSeparateRecognitionPerChannel
|
8165 | * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig
|
8166 | * @instance
|
8167 | */
|
8168 | RecognitionConfig.prototype.enableSeparateRecognitionPerChannel = false;
|
8169 |
|
8170 | /**
|
8171 | * RecognitionConfig languageCode.
|
8172 | * @member {string} languageCode
|
8173 | * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig
|
8174 | * @instance
|
8175 | */
|
8176 | RecognitionConfig.prototype.languageCode = "";
|
8177 |
|
8178 | /**
|
8179 | * RecognitionConfig alternativeLanguageCodes.
|
8180 | * @member {Array.<string>} alternativeLanguageCodes
|
8181 | * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig
|
8182 | * @instance
|
8183 | */
|
8184 | RecognitionConfig.prototype.alternativeLanguageCodes = $util.emptyArray;
|
8185 |
|
8186 | /**
|
8187 | * RecognitionConfig maxAlternatives.
|
8188 | * @member {number} maxAlternatives
|
8189 | * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig
|
8190 | * @instance
|
8191 | */
|
8192 | RecognitionConfig.prototype.maxAlternatives = 0;
|
8193 |
|
8194 | /**
|
8195 | * RecognitionConfig profanityFilter.
|
8196 | * @member {boolean} profanityFilter
|
8197 | * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig
|
8198 | * @instance
|
8199 | */
|
8200 | RecognitionConfig.prototype.profanityFilter = false;
|
8201 |
|
8202 | /**
|
8203 | * RecognitionConfig adaptation.
|
8204 | * @member {google.cloud.speech.v1p1beta1.ISpeechAdaptation|null|undefined} adaptation
|
8205 | * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig
|
8206 | * @instance
|
8207 | */
|
8208 | RecognitionConfig.prototype.adaptation = null;
|
8209 |
|
8210 | /**
|
8211 | * RecognitionConfig transcriptNormalization.
|
8212 | * @member {google.cloud.speech.v1p1beta1.ITranscriptNormalization|null|undefined} transcriptNormalization
|
8213 | * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig
|
8214 | * @instance
|
8215 | */
|
8216 | RecognitionConfig.prototype.transcriptNormalization = null;
|
8217 |
|
8218 | /**
|
8219 | * RecognitionConfig speechContexts.
|
8220 | * @member {Array.<google.cloud.speech.v1p1beta1.ISpeechContext>} speechContexts
|
8221 | * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig
|
8222 | * @instance
|
8223 | */
|
8224 | RecognitionConfig.prototype.speechContexts = $util.emptyArray;
|
8225 |
|
8226 | /**
|
8227 | * RecognitionConfig enableWordTimeOffsets.
|
8228 | * @member {boolean} enableWordTimeOffsets
|
8229 | * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig
|
8230 | * @instance
|
8231 | */
|
8232 | RecognitionConfig.prototype.enableWordTimeOffsets = false;
|
8233 |
|
8234 | /**
|
8235 | * RecognitionConfig enableWordConfidence.
|
8236 | * @member {boolean} enableWordConfidence
|
8237 | * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig
|
8238 | * @instance
|
8239 | */
|
8240 | RecognitionConfig.prototype.enableWordConfidence = false;
|
8241 |
|
8242 | /**
|
8243 | * RecognitionConfig enableAutomaticPunctuation.
|
8244 | * @member {boolean} enableAutomaticPunctuation
|
8245 | * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig
|
8246 | * @instance
|
8247 | */
|
8248 | RecognitionConfig.prototype.enableAutomaticPunctuation = false;
|
8249 |
|
8250 | /**
|
8251 | * RecognitionConfig enableSpokenPunctuation.
|
8252 | * @member {google.protobuf.IBoolValue|null|undefined} enableSpokenPunctuation
|
8253 | * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig
|
8254 | * @instance
|
8255 | */
|
8256 | RecognitionConfig.prototype.enableSpokenPunctuation = null;
|
8257 |
|
8258 | /**
|
8259 | * RecognitionConfig enableSpokenEmojis.
|
8260 | * @member {google.protobuf.IBoolValue|null|undefined} enableSpokenEmojis
|
8261 | * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig
|
8262 | * @instance
|
8263 | */
|
8264 | RecognitionConfig.prototype.enableSpokenEmojis = null;
|
8265 |
|
8266 | /**
|
8267 | * RecognitionConfig enableSpeakerDiarization.
|
8268 | * @member {boolean} enableSpeakerDiarization
|
8269 | * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig
|
8270 | * @instance
|
8271 | */
|
8272 | RecognitionConfig.prototype.enableSpeakerDiarization = false;
|
8273 |
|
8274 | /**
|
8275 | * RecognitionConfig diarizationSpeakerCount.
|
8276 | * @member {number} diarizationSpeakerCount
|
8277 | * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig
|
8278 | * @instance
|
8279 | */
|
8280 | RecognitionConfig.prototype.diarizationSpeakerCount = 0;
|
8281 |
|
8282 | /**
|
8283 | * RecognitionConfig diarizationConfig.
|
8284 | * @member {google.cloud.speech.v1p1beta1.ISpeakerDiarizationConfig|null|undefined} diarizationConfig
|
8285 | * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig
|
8286 | * @instance
|
8287 | */
|
8288 | RecognitionConfig.prototype.diarizationConfig = null;
|
8289 |
|
8290 | /**
|
8291 | * RecognitionConfig metadata.
|
8292 | * @member {google.cloud.speech.v1p1beta1.IRecognitionMetadata|null|undefined} metadata
|
8293 | * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig
|
8294 | * @instance
|
8295 | */
|
8296 | RecognitionConfig.prototype.metadata = null;
|
8297 |
|
8298 | /**
|
8299 | * RecognitionConfig model.
|
8300 | * @member {string} model
|
8301 | * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig
|
8302 | * @instance
|
8303 | */
|
8304 | RecognitionConfig.prototype.model = "";
|
8305 |
|
8306 | /**
|
8307 | * RecognitionConfig useEnhanced.
|
8308 | * @member {boolean} useEnhanced
|
8309 | * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig
|
8310 | * @instance
|
8311 | */
|
8312 | RecognitionConfig.prototype.useEnhanced = false;
|
8313 |
|
8314 | /**
|
8315 | * Creates a new RecognitionConfig instance using the specified properties.
|
8316 | * @function create
|
8317 | * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig
|
8318 | * @static
|
8319 | * @param {google.cloud.speech.v1p1beta1.IRecognitionConfig=} [properties] Properties to set
|
8320 | * @returns {google.cloud.speech.v1p1beta1.RecognitionConfig} RecognitionConfig instance
|
8321 | */
|
8322 | RecognitionConfig.create = function create(properties) {
|
8323 | return new RecognitionConfig(properties);
|
8324 | };
|
8325 |
|
8326 | /**
|
8327 | * Encodes the specified RecognitionConfig message. Does not implicitly {@link google.cloud.speech.v1p1beta1.RecognitionConfig.verify|verify} messages.
|
8328 | * @function encode
|
8329 | * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig
|
8330 | * @static
|
8331 | * @param {google.cloud.speech.v1p1beta1.IRecognitionConfig} message RecognitionConfig message or plain object to encode
|
8332 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
8333 | * @returns {$protobuf.Writer} Writer
|
8334 | */
|
8335 | RecognitionConfig.encode = function encode(message, writer) {
|
8336 | if (!writer)
|
8337 | writer = $Writer.create();
|
8338 | if (message.encoding != null && Object.hasOwnProperty.call(message, "encoding"))
|
8339 | writer.uint32(/* id 1, wireType 0 =*/8).int32(message.encoding);
|
8340 | if (message.sampleRateHertz != null && Object.hasOwnProperty.call(message, "sampleRateHertz"))
|
8341 | writer.uint32(/* id 2, wireType 0 =*/16).int32(message.sampleRateHertz);
|
8342 | if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode"))
|
8343 | writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCode);
|
8344 | if (message.maxAlternatives != null && Object.hasOwnProperty.call(message, "maxAlternatives"))
|
8345 | writer.uint32(/* id 4, wireType 0 =*/32).int32(message.maxAlternatives);
|
8346 | if (message.profanityFilter != null && Object.hasOwnProperty.call(message, "profanityFilter"))
|
8347 | writer.uint32(/* id 5, wireType 0 =*/40).bool(message.profanityFilter);
|
8348 | if (message.speechContexts != null && message.speechContexts.length)
|
8349 | for (var i = 0; i < message.speechContexts.length; ++i)
|
8350 | $root.google.cloud.speech.v1p1beta1.SpeechContext.encode(message.speechContexts[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
|
8351 | if (message.audioChannelCount != null && Object.hasOwnProperty.call(message, "audioChannelCount"))
|
8352 | writer.uint32(/* id 7, wireType 0 =*/56).int32(message.audioChannelCount);
|
8353 | if (message.enableWordTimeOffsets != null && Object.hasOwnProperty.call(message, "enableWordTimeOffsets"))
|
8354 | writer.uint32(/* id 8, wireType 0 =*/64).bool(message.enableWordTimeOffsets);
|
8355 | if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata"))
|
8356 | $root.google.cloud.speech.v1p1beta1.RecognitionMetadata.encode(message.metadata, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim();
|
8357 | if (message.enableAutomaticPunctuation != null && Object.hasOwnProperty.call(message, "enableAutomaticPunctuation"))
|
8358 | writer.uint32(/* id 11, wireType 0 =*/88).bool(message.enableAutomaticPunctuation);
|
8359 | if (message.enableSeparateRecognitionPerChannel != null && Object.hasOwnProperty.call(message, "enableSeparateRecognitionPerChannel"))
|
8360 | writer.uint32(/* id 12, wireType 0 =*/96).bool(message.enableSeparateRecognitionPerChannel);
|
8361 | if (message.model != null && Object.hasOwnProperty.call(message, "model"))
|
8362 | writer.uint32(/* id 13, wireType 2 =*/106).string(message.model);
|
8363 | if (message.useEnhanced != null && Object.hasOwnProperty.call(message, "useEnhanced"))
|
8364 | writer.uint32(/* id 14, wireType 0 =*/112).bool(message.useEnhanced);
|
8365 | if (message.enableWordConfidence != null && Object.hasOwnProperty.call(message, "enableWordConfidence"))
|
8366 | writer.uint32(/* id 15, wireType 0 =*/120).bool(message.enableWordConfidence);
|
8367 | if (message.enableSpeakerDiarization != null && Object.hasOwnProperty.call(message, "enableSpeakerDiarization"))
|
8368 | writer.uint32(/* id 16, wireType 0 =*/128).bool(message.enableSpeakerDiarization);
|
8369 | if (message.diarizationSpeakerCount != null && Object.hasOwnProperty.call(message, "diarizationSpeakerCount"))
|
8370 | writer.uint32(/* id 17, wireType 0 =*/136).int32(message.diarizationSpeakerCount);
|
8371 | if (message.alternativeLanguageCodes != null && message.alternativeLanguageCodes.length)
|
8372 | for (var i = 0; i < message.alternativeLanguageCodes.length; ++i)
|
8373 | writer.uint32(/* id 18, wireType 2 =*/146).string(message.alternativeLanguageCodes[i]);
|
8374 | if (message.diarizationConfig != null && Object.hasOwnProperty.call(message, "diarizationConfig"))
|
8375 | $root.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.encode(message.diarizationConfig, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim();
|
8376 | if (message.adaptation != null && Object.hasOwnProperty.call(message, "adaptation"))
|
8377 | $root.google.cloud.speech.v1p1beta1.SpeechAdaptation.encode(message.adaptation, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim();
|
8378 | if (message.enableSpokenPunctuation != null && Object.hasOwnProperty.call(message, "enableSpokenPunctuation"))
|
8379 | $root.google.protobuf.BoolValue.encode(message.enableSpokenPunctuation, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim();
|
8380 | if (message.enableSpokenEmojis != null && Object.hasOwnProperty.call(message, "enableSpokenEmojis"))
|
8381 | $root.google.protobuf.BoolValue.encode(message.enableSpokenEmojis, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim();
|
8382 | if (message.transcriptNormalization != null && Object.hasOwnProperty.call(message, "transcriptNormalization"))
|
8383 | $root.google.cloud.speech.v1p1beta1.TranscriptNormalization.encode(message.transcriptNormalization, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim();
|
8384 | return writer;
|
8385 | };
|
8386 |
|
8387 | /**
|
8388 | * Encodes the specified RecognitionConfig message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.RecognitionConfig.verify|verify} messages.
|
8389 | * @function encodeDelimited
|
8390 | * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig
|
8391 | * @static
|
8392 | * @param {google.cloud.speech.v1p1beta1.IRecognitionConfig} message RecognitionConfig message or plain object to encode
|
8393 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
8394 | * @returns {$protobuf.Writer} Writer
|
8395 | */
|
8396 | RecognitionConfig.encodeDelimited = function encodeDelimited(message, writer) {
|
8397 | return this.encode(message, writer).ldelim();
|
8398 | };
|
8399 |
|
8400 | /**
|
8401 | * Decodes a RecognitionConfig message from the specified reader or buffer.
|
8402 | * @function decode
|
8403 | * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig
|
8404 | * @static
|
8405 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
8406 | * @param {number} [length] Message length if known beforehand
|
8407 | * @returns {google.cloud.speech.v1p1beta1.RecognitionConfig} RecognitionConfig
|
8408 | * @throws {Error} If the payload is not a reader or valid buffer
|
8409 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
8410 | */
|
8411 | RecognitionConfig.decode = function decode(reader, length) {
|
8412 | if (!(reader instanceof $Reader))
|
8413 | reader = $Reader.create(reader);
|
8414 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.RecognitionConfig();
|
8415 | while (reader.pos < end) {
|
8416 | var tag = reader.uint32();
|
8417 | switch (tag >>> 3) {
|
8418 | case 1:
|
8419 | message.encoding = reader.int32();
|
8420 | break;
|
8421 | case 2:
|
8422 | message.sampleRateHertz = reader.int32();
|
8423 | break;
|
8424 | case 7:
|
8425 | message.audioChannelCount = reader.int32();
|
8426 | break;
|
8427 | case 12:
|
8428 | message.enableSeparateRecognitionPerChannel = reader.bool();
|
8429 | break;
|
8430 | case 3:
|
8431 | message.languageCode = reader.string();
|
8432 | break;
|
8433 | case 18:
|
8434 | if (!(message.alternativeLanguageCodes && message.alternativeLanguageCodes.length))
|
8435 | message.alternativeLanguageCodes = [];
|
8436 | message.alternativeLanguageCodes.push(reader.string());
|
8437 | break;
|
8438 | case 4:
|
8439 | message.maxAlternatives = reader.int32();
|
8440 | break;
|
8441 | case 5:
|
8442 | message.profanityFilter = reader.bool();
|
8443 | break;
|
8444 | case 20:
|
8445 | message.adaptation = $root.google.cloud.speech.v1p1beta1.SpeechAdaptation.decode(reader, reader.uint32());
|
8446 | break;
|
8447 | case 24:
|
8448 | message.transcriptNormalization = $root.google.cloud.speech.v1p1beta1.TranscriptNormalization.decode(reader, reader.uint32());
|
8449 | break;
|
8450 | case 6:
|
8451 | if (!(message.speechContexts && message.speechContexts.length))
|
8452 | message.speechContexts = [];
|
8453 | message.speechContexts.push($root.google.cloud.speech.v1p1beta1.SpeechContext.decode(reader, reader.uint32()));
|
8454 | break;
|
8455 | case 8:
|
8456 | message.enableWordTimeOffsets = reader.bool();
|
8457 | break;
|
8458 | case 15:
|
8459 | message.enableWordConfidence = reader.bool();
|
8460 | break;
|
8461 | case 11:
|
8462 | message.enableAutomaticPunctuation = reader.bool();
|
8463 | break;
|
8464 | case 22:
|
8465 | message.enableSpokenPunctuation = $root.google.protobuf.BoolValue.decode(reader, reader.uint32());
|
8466 | break;
|
8467 | case 23:
|
8468 | message.enableSpokenEmojis = $root.google.protobuf.BoolValue.decode(reader, reader.uint32());
|
8469 | break;
|
8470 | case 16:
|
8471 | message.enableSpeakerDiarization = reader.bool();
|
8472 | break;
|
8473 | case 17:
|
8474 | message.diarizationSpeakerCount = reader.int32();
|
8475 | break;
|
8476 | case 19:
|
8477 | message.diarizationConfig = $root.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.decode(reader, reader.uint32());
|
8478 | break;
|
8479 | case 9:
|
8480 | message.metadata = $root.google.cloud.speech.v1p1beta1.RecognitionMetadata.decode(reader, reader.uint32());
|
8481 | break;
|
8482 | case 13:
|
8483 | message.model = reader.string();
|
8484 | break;
|
8485 | case 14:
|
8486 | message.useEnhanced = reader.bool();
|
8487 | break;
|
8488 | default:
|
8489 | reader.skipType(tag & 7);
|
8490 | break;
|
8491 | }
|
8492 | }
|
8493 | return message;
|
8494 | };
|
8495 |
|
8496 | /**
|
8497 | * Decodes a RecognitionConfig message from the specified reader or buffer, length delimited.
|
8498 | * @function decodeDelimited
|
8499 | * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig
|
8500 | * @static
|
8501 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
8502 | * @returns {google.cloud.speech.v1p1beta1.RecognitionConfig} RecognitionConfig
|
8503 | * @throws {Error} If the payload is not a reader or valid buffer
|
8504 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
8505 | */
|
8506 | RecognitionConfig.decodeDelimited = function decodeDelimited(reader) {
|
8507 | if (!(reader instanceof $Reader))
|
8508 | reader = new $Reader(reader);
|
8509 | return this.decode(reader, reader.uint32());
|
8510 | };
|
8511 |
|
8512 | /**
|
8513 | * Verifies a RecognitionConfig message.
|
8514 | * @function verify
|
8515 | * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig
|
8516 | * @static
|
8517 | * @param {Object.<string,*>} message Plain object to verify
|
8518 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
8519 | */
|
8520 | RecognitionConfig.verify = function verify(message) {
|
8521 | if (typeof message !== "object" || message === null)
|
8522 | return "object expected";
|
8523 | if (message.encoding != null && message.hasOwnProperty("encoding"))
|
8524 | switch (message.encoding) {
|
8525 | default:
|
8526 | return "encoding: enum value expected";
|
8527 | case 0:
|
8528 | case 1:
|
8529 | case 2:
|
8530 | case 3:
|
8531 | case 4:
|
8532 | case 5:
|
8533 | case 6:
|
8534 | case 7:
|
8535 | case 8:
|
8536 | case 9:
|
8537 | break;
|
8538 | }
|
8539 | if (message.sampleRateHertz != null && message.hasOwnProperty("sampleRateHertz"))
|
8540 | if (!$util.isInteger(message.sampleRateHertz))
|
8541 | return "sampleRateHertz: integer expected";
|
8542 | if (message.audioChannelCount != null && message.hasOwnProperty("audioChannelCount"))
|
8543 | if (!$util.isInteger(message.audioChannelCount))
|
8544 | return "audioChannelCount: integer expected";
|
8545 | if (message.enableSeparateRecognitionPerChannel != null && message.hasOwnProperty("enableSeparateRecognitionPerChannel"))
|
8546 | if (typeof message.enableSeparateRecognitionPerChannel !== "boolean")
|
8547 | return "enableSeparateRecognitionPerChannel: boolean expected";
|
8548 | if (message.languageCode != null && message.hasOwnProperty("languageCode"))
|
8549 | if (!$util.isString(message.languageCode))
|
8550 | return "languageCode: string expected";
|
8551 | if (message.alternativeLanguageCodes != null && message.hasOwnProperty("alternativeLanguageCodes")) {
|
8552 | if (!Array.isArray(message.alternativeLanguageCodes))
|
8553 | return "alternativeLanguageCodes: array expected";
|
8554 | for (var i = 0; i < message.alternativeLanguageCodes.length; ++i)
|
8555 | if (!$util.isString(message.alternativeLanguageCodes[i]))
|
8556 | return "alternativeLanguageCodes: string[] expected";
|
8557 | }
|
8558 | if (message.maxAlternatives != null && message.hasOwnProperty("maxAlternatives"))
|
8559 | if (!$util.isInteger(message.maxAlternatives))
|
8560 | return "maxAlternatives: integer expected";
|
8561 | if (message.profanityFilter != null && message.hasOwnProperty("profanityFilter"))
|
8562 | if (typeof message.profanityFilter !== "boolean")
|
8563 | return "profanityFilter: boolean expected";
|
8564 | if (message.adaptation != null && message.hasOwnProperty("adaptation")) {
|
8565 | var error = $root.google.cloud.speech.v1p1beta1.SpeechAdaptation.verify(message.adaptation);
|
8566 | if (error)
|
8567 | return "adaptation." + error;
|
8568 | }
|
8569 | if (message.transcriptNormalization != null && message.hasOwnProperty("transcriptNormalization")) {
|
8570 | var error = $root.google.cloud.speech.v1p1beta1.TranscriptNormalization.verify(message.transcriptNormalization);
|
8571 | if (error)
|
8572 | return "transcriptNormalization." + error;
|
8573 | }
|
8574 | if (message.speechContexts != null && message.hasOwnProperty("speechContexts")) {
|
8575 | if (!Array.isArray(message.speechContexts))
|
8576 | return "speechContexts: array expected";
|
8577 | for (var i = 0; i < message.speechContexts.length; ++i) {
|
8578 | var error = $root.google.cloud.speech.v1p1beta1.SpeechContext.verify(message.speechContexts[i]);
|
8579 | if (error)
|
8580 | return "speechContexts." + error;
|
8581 | }
|
8582 | }
|
8583 | if (message.enableWordTimeOffsets != null && message.hasOwnProperty("enableWordTimeOffsets"))
|
8584 | if (typeof message.enableWordTimeOffsets !== "boolean")
|
8585 | return "enableWordTimeOffsets: boolean expected";
|
8586 | if (message.enableWordConfidence != null && message.hasOwnProperty("enableWordConfidence"))
|
8587 | if (typeof message.enableWordConfidence !== "boolean")
|
8588 | return "enableWordConfidence: boolean expected";
|
8589 | if (message.enableAutomaticPunctuation != null && message.hasOwnProperty("enableAutomaticPunctuation"))
|
8590 | if (typeof message.enableAutomaticPunctuation !== "boolean")
|
8591 | return "enableAutomaticPunctuation: boolean expected";
|
8592 | if (message.enableSpokenPunctuation != null && message.hasOwnProperty("enableSpokenPunctuation")) {
|
8593 | var error = $root.google.protobuf.BoolValue.verify(message.enableSpokenPunctuation);
|
8594 | if (error)
|
8595 | return "enableSpokenPunctuation." + error;
|
8596 | }
|
8597 | if (message.enableSpokenEmojis != null && message.hasOwnProperty("enableSpokenEmojis")) {
|
8598 | var error = $root.google.protobuf.BoolValue.verify(message.enableSpokenEmojis);
|
8599 | if (error)
|
8600 | return "enableSpokenEmojis." + error;
|
8601 | }
|
8602 | if (message.enableSpeakerDiarization != null && message.hasOwnProperty("enableSpeakerDiarization"))
|
8603 | if (typeof message.enableSpeakerDiarization !== "boolean")
|
8604 | return "enableSpeakerDiarization: boolean expected";
|
8605 | if (message.diarizationSpeakerCount != null && message.hasOwnProperty("diarizationSpeakerCount"))
|
8606 | if (!$util.isInteger(message.diarizationSpeakerCount))
|
8607 | return "diarizationSpeakerCount: integer expected";
|
8608 | if (message.diarizationConfig != null && message.hasOwnProperty("diarizationConfig")) {
|
8609 | var error = $root.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.verify(message.diarizationConfig);
|
8610 | if (error)
|
8611 | return "diarizationConfig." + error;
|
8612 | }
|
8613 | if (message.metadata != null && message.hasOwnProperty("metadata")) {
|
8614 | var error = $root.google.cloud.speech.v1p1beta1.RecognitionMetadata.verify(message.metadata);
|
8615 | if (error)
|
8616 | return "metadata." + error;
|
8617 | }
|
8618 | if (message.model != null && message.hasOwnProperty("model"))
|
8619 | if (!$util.isString(message.model))
|
8620 | return "model: string expected";
|
8621 | if (message.useEnhanced != null && message.hasOwnProperty("useEnhanced"))
|
8622 | if (typeof message.useEnhanced !== "boolean")
|
8623 | return "useEnhanced: boolean expected";
|
8624 | return null;
|
8625 | };
|
8626 |
|
8627 | /**
|
8628 | * Creates a RecognitionConfig message from a plain object. Also converts values to their respective internal types.
|
8629 | * @function fromObject
|
8630 | * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig
|
8631 | * @static
|
8632 | * @param {Object.<string,*>} object Plain object
|
8633 | * @returns {google.cloud.speech.v1p1beta1.RecognitionConfig} RecognitionConfig
|
8634 | */
|
8635 | RecognitionConfig.fromObject = function fromObject(object) {
|
8636 | if (object instanceof $root.google.cloud.speech.v1p1beta1.RecognitionConfig)
|
8637 | return object;
|
8638 | var message = new $root.google.cloud.speech.v1p1beta1.RecognitionConfig();
|
8639 | switch (object.encoding) {
|
8640 | case "ENCODING_UNSPECIFIED":
|
8641 | case 0:
|
8642 | message.encoding = 0;
|
8643 | break;
|
8644 | case "LINEAR16":
|
8645 | case 1:
|
8646 | message.encoding = 1;
|
8647 | break;
|
8648 | case "FLAC":
|
8649 | case 2:
|
8650 | message.encoding = 2;
|
8651 | break;
|
8652 | case "MULAW":
|
8653 | case 3:
|
8654 | message.encoding = 3;
|
8655 | break;
|
8656 | case "AMR":
|
8657 | case 4:
|
8658 | message.encoding = 4;
|
8659 | break;
|
8660 | case "AMR_WB":
|
8661 | case 5:
|
8662 | message.encoding = 5;
|
8663 | break;
|
8664 | case "OGG_OPUS":
|
8665 | case 6:
|
8666 | message.encoding = 6;
|
8667 | break;
|
8668 | case "SPEEX_WITH_HEADER_BYTE":
|
8669 | case 7:
|
8670 | message.encoding = 7;
|
8671 | break;
|
8672 | case "MP3":
|
8673 | case 8:
|
8674 | message.encoding = 8;
|
8675 | break;
|
8676 | case "WEBM_OPUS":
|
8677 | case 9:
|
8678 | message.encoding = 9;
|
8679 | break;
|
8680 | }
|
8681 | if (object.sampleRateHertz != null)
|
8682 | message.sampleRateHertz = object.sampleRateHertz | 0;
|
8683 | if (object.audioChannelCount != null)
|
8684 | message.audioChannelCount = object.audioChannelCount | 0;
|
8685 | if (object.enableSeparateRecognitionPerChannel != null)
|
8686 | message.enableSeparateRecognitionPerChannel = Boolean(object.enableSeparateRecognitionPerChannel);
|
8687 | if (object.languageCode != null)
|
8688 | message.languageCode = String(object.languageCode);
|
8689 | if (object.alternativeLanguageCodes) {
|
8690 | if (!Array.isArray(object.alternativeLanguageCodes))
|
8691 | throw TypeError(".google.cloud.speech.v1p1beta1.RecognitionConfig.alternativeLanguageCodes: array expected");
|
8692 | message.alternativeLanguageCodes = [];
|
8693 | for (var i = 0; i < object.alternativeLanguageCodes.length; ++i)
|
8694 | message.alternativeLanguageCodes[i] = String(object.alternativeLanguageCodes[i]);
|
8695 | }
|
8696 | if (object.maxAlternatives != null)
|
8697 | message.maxAlternatives = object.maxAlternatives | 0;
|
8698 | if (object.profanityFilter != null)
|
8699 | message.profanityFilter = Boolean(object.profanityFilter);
|
8700 | if (object.adaptation != null) {
|
8701 | if (typeof object.adaptation !== "object")
|
8702 | throw TypeError(".google.cloud.speech.v1p1beta1.RecognitionConfig.adaptation: object expected");
|
8703 | message.adaptation = $root.google.cloud.speech.v1p1beta1.SpeechAdaptation.fromObject(object.adaptation);
|
8704 | }
|
8705 | if (object.transcriptNormalization != null) {
|
8706 | if (typeof object.transcriptNormalization !== "object")
|
8707 | throw TypeError(".google.cloud.speech.v1p1beta1.RecognitionConfig.transcriptNormalization: object expected");
|
8708 | message.transcriptNormalization = $root.google.cloud.speech.v1p1beta1.TranscriptNormalization.fromObject(object.transcriptNormalization);
|
8709 | }
|
8710 | if (object.speechContexts) {
|
8711 | if (!Array.isArray(object.speechContexts))
|
8712 | throw TypeError(".google.cloud.speech.v1p1beta1.RecognitionConfig.speechContexts: array expected");
|
8713 | message.speechContexts = [];
|
8714 | for (var i = 0; i < object.speechContexts.length; ++i) {
|
8715 | if (typeof object.speechContexts[i] !== "object")
|
8716 | throw TypeError(".google.cloud.speech.v1p1beta1.RecognitionConfig.speechContexts: object expected");
|
8717 | message.speechContexts[i] = $root.google.cloud.speech.v1p1beta1.SpeechContext.fromObject(object.speechContexts[i]);
|
8718 | }
|
8719 | }
|
8720 | if (object.enableWordTimeOffsets != null)
|
8721 | message.enableWordTimeOffsets = Boolean(object.enableWordTimeOffsets);
|
8722 | if (object.enableWordConfidence != null)
|
8723 | message.enableWordConfidence = Boolean(object.enableWordConfidence);
|
8724 | if (object.enableAutomaticPunctuation != null)
|
8725 | message.enableAutomaticPunctuation = Boolean(object.enableAutomaticPunctuation);
|
8726 | if (object.enableSpokenPunctuation != null) {
|
8727 | if (typeof object.enableSpokenPunctuation !== "object")
|
8728 | throw TypeError(".google.cloud.speech.v1p1beta1.RecognitionConfig.enableSpokenPunctuation: object expected");
|
8729 | message.enableSpokenPunctuation = $root.google.protobuf.BoolValue.fromObject(object.enableSpokenPunctuation);
|
8730 | }
|
8731 | if (object.enableSpokenEmojis != null) {
|
8732 | if (typeof object.enableSpokenEmojis !== "object")
|
8733 | throw TypeError(".google.cloud.speech.v1p1beta1.RecognitionConfig.enableSpokenEmojis: object expected");
|
8734 | message.enableSpokenEmojis = $root.google.protobuf.BoolValue.fromObject(object.enableSpokenEmojis);
|
8735 | }
|
8736 | if (object.enableSpeakerDiarization != null)
|
8737 | message.enableSpeakerDiarization = Boolean(object.enableSpeakerDiarization);
|
8738 | if (object.diarizationSpeakerCount != null)
|
8739 | message.diarizationSpeakerCount = object.diarizationSpeakerCount | 0;
|
8740 | if (object.diarizationConfig != null) {
|
8741 | if (typeof object.diarizationConfig !== "object")
|
8742 | throw TypeError(".google.cloud.speech.v1p1beta1.RecognitionConfig.diarizationConfig: object expected");
|
8743 | message.diarizationConfig = $root.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.fromObject(object.diarizationConfig);
|
8744 | }
|
8745 | if (object.metadata != null) {
|
8746 | if (typeof object.metadata !== "object")
|
8747 | throw TypeError(".google.cloud.speech.v1p1beta1.RecognitionConfig.metadata: object expected");
|
8748 | message.metadata = $root.google.cloud.speech.v1p1beta1.RecognitionMetadata.fromObject(object.metadata);
|
8749 | }
|
8750 | if (object.model != null)
|
8751 | message.model = String(object.model);
|
8752 | if (object.useEnhanced != null)
|
8753 | message.useEnhanced = Boolean(object.useEnhanced);
|
8754 | return message;
|
8755 | };
|
8756 |
|
8757 | /**
|
8758 | * Creates a plain object from a RecognitionConfig message. Also converts values to other types if specified.
|
8759 | * @function toObject
|
8760 | * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig
|
8761 | * @static
|
8762 | * @param {google.cloud.speech.v1p1beta1.RecognitionConfig} message RecognitionConfig
|
8763 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
8764 | * @returns {Object.<string,*>} Plain object
|
8765 | */
|
8766 | RecognitionConfig.toObject = function toObject(message, options) {
|
8767 | if (!options)
|
8768 | options = {};
|
8769 | var object = {};
|
8770 | if (options.arrays || options.defaults) {
|
8771 | object.speechContexts = [];
|
8772 | object.alternativeLanguageCodes = [];
|
8773 | }
|
8774 | if (options.defaults) {
|
8775 | object.encoding = options.enums === String ? "ENCODING_UNSPECIFIED" : 0;
|
8776 | object.sampleRateHertz = 0;
|
8777 | object.languageCode = "";
|
8778 | object.maxAlternatives = 0;
|
8779 | object.profanityFilter = false;
|
8780 | object.audioChannelCount = 0;
|
8781 | object.enableWordTimeOffsets = false;
|
8782 | object.metadata = null;
|
8783 | object.enableAutomaticPunctuation = false;
|
8784 | object.enableSeparateRecognitionPerChannel = false;
|
8785 | object.model = "";
|
8786 | object.useEnhanced = false;
|
8787 | object.enableWordConfidence = false;
|
8788 | object.enableSpeakerDiarization = false;
|
8789 | object.diarizationSpeakerCount = 0;
|
8790 | object.diarizationConfig = null;
|
8791 | object.adaptation = null;
|
8792 | object.enableSpokenPunctuation = null;
|
8793 | object.enableSpokenEmojis = null;
|
8794 | object.transcriptNormalization = null;
|
8795 | }
|
8796 | if (message.encoding != null && message.hasOwnProperty("encoding"))
|
8797 | object.encoding = options.enums === String ? $root.google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding[message.encoding] : message.encoding;
|
8798 | if (message.sampleRateHertz != null && message.hasOwnProperty("sampleRateHertz"))
|
8799 | object.sampleRateHertz = message.sampleRateHertz;
|
8800 | if (message.languageCode != null && message.hasOwnProperty("languageCode"))
|
8801 | object.languageCode = message.languageCode;
|
8802 | if (message.maxAlternatives != null && message.hasOwnProperty("maxAlternatives"))
|
8803 | object.maxAlternatives = message.maxAlternatives;
|
8804 | if (message.profanityFilter != null && message.hasOwnProperty("profanityFilter"))
|
8805 | object.profanityFilter = message.profanityFilter;
|
8806 | if (message.speechContexts && message.speechContexts.length) {
|
8807 | object.speechContexts = [];
|
8808 | for (var j = 0; j < message.speechContexts.length; ++j)
|
8809 | object.speechContexts[j] = $root.google.cloud.speech.v1p1beta1.SpeechContext.toObject(message.speechContexts[j], options);
|
8810 | }
|
8811 | if (message.audioChannelCount != null && message.hasOwnProperty("audioChannelCount"))
|
8812 | object.audioChannelCount = message.audioChannelCount;
|
8813 | if (message.enableWordTimeOffsets != null && message.hasOwnProperty("enableWordTimeOffsets"))
|
8814 | object.enableWordTimeOffsets = message.enableWordTimeOffsets;
|
8815 | if (message.metadata != null && message.hasOwnProperty("metadata"))
|
8816 | object.metadata = $root.google.cloud.speech.v1p1beta1.RecognitionMetadata.toObject(message.metadata, options);
|
8817 | if (message.enableAutomaticPunctuation != null && message.hasOwnProperty("enableAutomaticPunctuation"))
|
8818 | object.enableAutomaticPunctuation = message.enableAutomaticPunctuation;
|
8819 | if (message.enableSeparateRecognitionPerChannel != null && message.hasOwnProperty("enableSeparateRecognitionPerChannel"))
|
8820 | object.enableSeparateRecognitionPerChannel = message.enableSeparateRecognitionPerChannel;
|
8821 | if (message.model != null && message.hasOwnProperty("model"))
|
8822 | object.model = message.model;
|
8823 | if (message.useEnhanced != null && message.hasOwnProperty("useEnhanced"))
|
8824 | object.useEnhanced = message.useEnhanced;
|
8825 | if (message.enableWordConfidence != null && message.hasOwnProperty("enableWordConfidence"))
|
8826 | object.enableWordConfidence = message.enableWordConfidence;
|
8827 | if (message.enableSpeakerDiarization != null && message.hasOwnProperty("enableSpeakerDiarization"))
|
8828 | object.enableSpeakerDiarization = message.enableSpeakerDiarization;
|
8829 | if (message.diarizationSpeakerCount != null && message.hasOwnProperty("diarizationSpeakerCount"))
|
8830 | object.diarizationSpeakerCount = message.diarizationSpeakerCount;
|
8831 | if (message.alternativeLanguageCodes && message.alternativeLanguageCodes.length) {
|
8832 | object.alternativeLanguageCodes = [];
|
8833 | for (var j = 0; j < message.alternativeLanguageCodes.length; ++j)
|
8834 | object.alternativeLanguageCodes[j] = message.alternativeLanguageCodes[j];
|
8835 | }
|
8836 | if (message.diarizationConfig != null && message.hasOwnProperty("diarizationConfig"))
|
8837 | object.diarizationConfig = $root.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.toObject(message.diarizationConfig, options);
|
8838 | if (message.adaptation != null && message.hasOwnProperty("adaptation"))
|
8839 | object.adaptation = $root.google.cloud.speech.v1p1beta1.SpeechAdaptation.toObject(message.adaptation, options);
|
8840 | if (message.enableSpokenPunctuation != null && message.hasOwnProperty("enableSpokenPunctuation"))
|
8841 | object.enableSpokenPunctuation = $root.google.protobuf.BoolValue.toObject(message.enableSpokenPunctuation, options);
|
8842 | if (message.enableSpokenEmojis != null && message.hasOwnProperty("enableSpokenEmojis"))
|
8843 | object.enableSpokenEmojis = $root.google.protobuf.BoolValue.toObject(message.enableSpokenEmojis, options);
|
8844 | if (message.transcriptNormalization != null && message.hasOwnProperty("transcriptNormalization"))
|
8845 | object.transcriptNormalization = $root.google.cloud.speech.v1p1beta1.TranscriptNormalization.toObject(message.transcriptNormalization, options);
|
8846 | return object;
|
8847 | };
|
8848 |
|
8849 | /**
|
8850 | * Converts this RecognitionConfig to JSON.
|
8851 | * @function toJSON
|
8852 | * @memberof google.cloud.speech.v1p1beta1.RecognitionConfig
|
8853 | * @instance
|
8854 | * @returns {Object.<string,*>} JSON object
|
8855 | */
|
8856 | RecognitionConfig.prototype.toJSON = function toJSON() {
|
8857 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
8858 | };
|
8859 |
|
8860 | /**
|
8861 | * AudioEncoding enum.
|
8862 | * @name google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding
|
8863 | * @enum {number}
|
8864 | * @property {number} ENCODING_UNSPECIFIED=0 ENCODING_UNSPECIFIED value
|
8865 | * @property {number} LINEAR16=1 LINEAR16 value
|
8866 | * @property {number} FLAC=2 FLAC value
|
8867 | * @property {number} MULAW=3 MULAW value
|
8868 | * @property {number} AMR=4 AMR value
|
8869 | * @property {number} AMR_WB=5 AMR_WB value
|
8870 | * @property {number} OGG_OPUS=6 OGG_OPUS value
|
8871 | * @property {number} SPEEX_WITH_HEADER_BYTE=7 SPEEX_WITH_HEADER_BYTE value
|
8872 | * @property {number} MP3=8 MP3 value
|
8873 | * @property {number} WEBM_OPUS=9 WEBM_OPUS value
|
8874 | */
|
8875 | RecognitionConfig.AudioEncoding = (function() {
|
8876 | var valuesById = {}, values = Object.create(valuesById);
|
8877 | values[valuesById[0] = "ENCODING_UNSPECIFIED"] = 0;
|
8878 | values[valuesById[1] = "LINEAR16"] = 1;
|
8879 | values[valuesById[2] = "FLAC"] = 2;
|
8880 | values[valuesById[3] = "MULAW"] = 3;
|
8881 | values[valuesById[4] = "AMR"] = 4;
|
8882 | values[valuesById[5] = "AMR_WB"] = 5;
|
8883 | values[valuesById[6] = "OGG_OPUS"] = 6;
|
8884 | values[valuesById[7] = "SPEEX_WITH_HEADER_BYTE"] = 7;
|
8885 | values[valuesById[8] = "MP3"] = 8;
|
8886 | values[valuesById[9] = "WEBM_OPUS"] = 9;
|
8887 | return values;
|
8888 | })();
|
8889 |
|
8890 | return RecognitionConfig;
|
8891 | })();
|
8892 |
|
8893 | v1p1beta1.SpeakerDiarizationConfig = (function() {
|
8894 |
|
8895 | /**
|
8896 | * Properties of a SpeakerDiarizationConfig.
|
8897 | * @memberof google.cloud.speech.v1p1beta1
|
8898 | * @interface ISpeakerDiarizationConfig
|
8899 | * @property {boolean|null} [enableSpeakerDiarization] SpeakerDiarizationConfig enableSpeakerDiarization
|
8900 | * @property {number|null} [minSpeakerCount] SpeakerDiarizationConfig minSpeakerCount
|
8901 | * @property {number|null} [maxSpeakerCount] SpeakerDiarizationConfig maxSpeakerCount
|
8902 | * @property {number|null} [speakerTag] SpeakerDiarizationConfig speakerTag
|
8903 | */
|
8904 |
|
8905 | /**
|
8906 | * Constructs a new SpeakerDiarizationConfig.
|
8907 | * @memberof google.cloud.speech.v1p1beta1
|
8908 | * @classdesc Represents a SpeakerDiarizationConfig.
|
8909 | * @implements ISpeakerDiarizationConfig
|
8910 | * @constructor
|
8911 | * @param {google.cloud.speech.v1p1beta1.ISpeakerDiarizationConfig=} [properties] Properties to set
|
8912 | */
|
8913 | function SpeakerDiarizationConfig(properties) {
|
8914 | if (properties)
|
8915 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
8916 | if (properties[keys[i]] != null)
|
8917 | this[keys[i]] = properties[keys[i]];
|
8918 | }
|
8919 |
|
8920 | /**
|
8921 | * SpeakerDiarizationConfig enableSpeakerDiarization.
|
8922 | * @member {boolean} enableSpeakerDiarization
|
8923 | * @memberof google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig
|
8924 | * @instance
|
8925 | */
|
8926 | SpeakerDiarizationConfig.prototype.enableSpeakerDiarization = false;
|
8927 |
|
8928 | /**
|
8929 | * SpeakerDiarizationConfig minSpeakerCount.
|
8930 | * @member {number} minSpeakerCount
|
8931 | * @memberof google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig
|
8932 | * @instance
|
8933 | */
|
8934 | SpeakerDiarizationConfig.prototype.minSpeakerCount = 0;
|
8935 |
|
8936 | /**
|
8937 | * SpeakerDiarizationConfig maxSpeakerCount.
|
8938 | * @member {number} maxSpeakerCount
|
8939 | * @memberof google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig
|
8940 | * @instance
|
8941 | */
|
8942 | SpeakerDiarizationConfig.prototype.maxSpeakerCount = 0;
|
8943 |
|
8944 | /**
|
8945 | * SpeakerDiarizationConfig speakerTag.
|
8946 | * @member {number} speakerTag
|
8947 | * @memberof google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig
|
8948 | * @instance
|
8949 | */
|
8950 | SpeakerDiarizationConfig.prototype.speakerTag = 0;
|
8951 |
|
8952 | /**
|
8953 | * Creates a new SpeakerDiarizationConfig instance using the specified properties.
|
8954 | * @function create
|
8955 | * @memberof google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig
|
8956 | * @static
|
8957 | * @param {google.cloud.speech.v1p1beta1.ISpeakerDiarizationConfig=} [properties] Properties to set
|
8958 | * @returns {google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig} SpeakerDiarizationConfig instance
|
8959 | */
|
8960 | SpeakerDiarizationConfig.create = function create(properties) {
|
8961 | return new SpeakerDiarizationConfig(properties);
|
8962 | };
|
8963 |
|
8964 | /**
|
8965 | * Encodes the specified SpeakerDiarizationConfig message. Does not implicitly {@link google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.verify|verify} messages.
|
8966 | * @function encode
|
8967 | * @memberof google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig
|
8968 | * @static
|
8969 | * @param {google.cloud.speech.v1p1beta1.ISpeakerDiarizationConfig} message SpeakerDiarizationConfig message or plain object to encode
|
8970 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
8971 | * @returns {$protobuf.Writer} Writer
|
8972 | */
|
8973 | SpeakerDiarizationConfig.encode = function encode(message, writer) {
|
8974 | if (!writer)
|
8975 | writer = $Writer.create();
|
8976 | if (message.enableSpeakerDiarization != null && Object.hasOwnProperty.call(message, "enableSpeakerDiarization"))
|
8977 | writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enableSpeakerDiarization);
|
8978 | if (message.minSpeakerCount != null && Object.hasOwnProperty.call(message, "minSpeakerCount"))
|
8979 | writer.uint32(/* id 2, wireType 0 =*/16).int32(message.minSpeakerCount);
|
8980 | if (message.maxSpeakerCount != null && Object.hasOwnProperty.call(message, "maxSpeakerCount"))
|
8981 | writer.uint32(/* id 3, wireType 0 =*/24).int32(message.maxSpeakerCount);
|
8982 | if (message.speakerTag != null && Object.hasOwnProperty.call(message, "speakerTag"))
|
8983 | writer.uint32(/* id 5, wireType 0 =*/40).int32(message.speakerTag);
|
8984 | return writer;
|
8985 | };
|
8986 |
|
8987 | /**
|
8988 | * Encodes the specified SpeakerDiarizationConfig message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.verify|verify} messages.
|
8989 | * @function encodeDelimited
|
8990 | * @memberof google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig
|
8991 | * @static
|
8992 | * @param {google.cloud.speech.v1p1beta1.ISpeakerDiarizationConfig} message SpeakerDiarizationConfig message or plain object to encode
|
8993 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
8994 | * @returns {$protobuf.Writer} Writer
|
8995 | */
|
8996 | SpeakerDiarizationConfig.encodeDelimited = function encodeDelimited(message, writer) {
|
8997 | return this.encode(message, writer).ldelim();
|
8998 | };
|
8999 |
|
9000 | /**
|
9001 | * Decodes a SpeakerDiarizationConfig message from the specified reader or buffer.
|
9002 | * @function decode
|
9003 | * @memberof google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig
|
9004 | * @static
|
9005 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
9006 | * @param {number} [length] Message length if known beforehand
|
9007 | * @returns {google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig} SpeakerDiarizationConfig
|
9008 | * @throws {Error} If the payload is not a reader or valid buffer
|
9009 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
9010 | */
|
9011 | SpeakerDiarizationConfig.decode = function decode(reader, length) {
|
9012 | if (!(reader instanceof $Reader))
|
9013 | reader = $Reader.create(reader);
|
9014 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig();
|
9015 | while (reader.pos < end) {
|
9016 | var tag = reader.uint32();
|
9017 | switch (tag >>> 3) {
|
9018 | case 1:
|
9019 | message.enableSpeakerDiarization = reader.bool();
|
9020 | break;
|
9021 | case 2:
|
9022 | message.minSpeakerCount = reader.int32();
|
9023 | break;
|
9024 | case 3:
|
9025 | message.maxSpeakerCount = reader.int32();
|
9026 | break;
|
9027 | case 5:
|
9028 | message.speakerTag = reader.int32();
|
9029 | break;
|
9030 | default:
|
9031 | reader.skipType(tag & 7);
|
9032 | break;
|
9033 | }
|
9034 | }
|
9035 | return message;
|
9036 | };
|
9037 |
|
9038 | /**
|
9039 | * Decodes a SpeakerDiarizationConfig message from the specified reader or buffer, length delimited.
|
9040 | * @function decodeDelimited
|
9041 | * @memberof google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig
|
9042 | * @static
|
9043 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
9044 | * @returns {google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig} SpeakerDiarizationConfig
|
9045 | * @throws {Error} If the payload is not a reader or valid buffer
|
9046 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
9047 | */
|
9048 | SpeakerDiarizationConfig.decodeDelimited = function decodeDelimited(reader) {
|
9049 | if (!(reader instanceof $Reader))
|
9050 | reader = new $Reader(reader);
|
9051 | return this.decode(reader, reader.uint32());
|
9052 | };
|
9053 |
|
9054 | /**
|
9055 | * Verifies a SpeakerDiarizationConfig message.
|
9056 | * @function verify
|
9057 | * @memberof google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig
|
9058 | * @static
|
9059 | * @param {Object.<string,*>} message Plain object to verify
|
9060 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
9061 | */
|
9062 | SpeakerDiarizationConfig.verify = function verify(message) {
|
9063 | if (typeof message !== "object" || message === null)
|
9064 | return "object expected";
|
9065 | if (message.enableSpeakerDiarization != null && message.hasOwnProperty("enableSpeakerDiarization"))
|
9066 | if (typeof message.enableSpeakerDiarization !== "boolean")
|
9067 | return "enableSpeakerDiarization: boolean expected";
|
9068 | if (message.minSpeakerCount != null && message.hasOwnProperty("minSpeakerCount"))
|
9069 | if (!$util.isInteger(message.minSpeakerCount))
|
9070 | return "minSpeakerCount: integer expected";
|
9071 | if (message.maxSpeakerCount != null && message.hasOwnProperty("maxSpeakerCount"))
|
9072 | if (!$util.isInteger(message.maxSpeakerCount))
|
9073 | return "maxSpeakerCount: integer expected";
|
9074 | if (message.speakerTag != null && message.hasOwnProperty("speakerTag"))
|
9075 | if (!$util.isInteger(message.speakerTag))
|
9076 | return "speakerTag: integer expected";
|
9077 | return null;
|
9078 | };
|
9079 |
|
9080 | /**
|
9081 | * Creates a SpeakerDiarizationConfig message from a plain object. Also converts values to their respective internal types.
|
9082 | * @function fromObject
|
9083 | * @memberof google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig
|
9084 | * @static
|
9085 | * @param {Object.<string,*>} object Plain object
|
9086 | * @returns {google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig} SpeakerDiarizationConfig
|
9087 | */
|
9088 | SpeakerDiarizationConfig.fromObject = function fromObject(object) {
|
9089 | if (object instanceof $root.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig)
|
9090 | return object;
|
9091 | var message = new $root.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig();
|
9092 | if (object.enableSpeakerDiarization != null)
|
9093 | message.enableSpeakerDiarization = Boolean(object.enableSpeakerDiarization);
|
9094 | if (object.minSpeakerCount != null)
|
9095 | message.minSpeakerCount = object.minSpeakerCount | 0;
|
9096 | if (object.maxSpeakerCount != null)
|
9097 | message.maxSpeakerCount = object.maxSpeakerCount | 0;
|
9098 | if (object.speakerTag != null)
|
9099 | message.speakerTag = object.speakerTag | 0;
|
9100 | return message;
|
9101 | };
|
9102 |
|
9103 | /**
|
9104 | * Creates a plain object from a SpeakerDiarizationConfig message. Also converts values to other types if specified.
|
9105 | * @function toObject
|
9106 | * @memberof google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig
|
9107 | * @static
|
9108 | * @param {google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig} message SpeakerDiarizationConfig
|
9109 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
9110 | * @returns {Object.<string,*>} Plain object
|
9111 | */
|
9112 | SpeakerDiarizationConfig.toObject = function toObject(message, options) {
|
9113 | if (!options)
|
9114 | options = {};
|
9115 | var object = {};
|
9116 | if (options.defaults) {
|
9117 | object.enableSpeakerDiarization = false;
|
9118 | object.minSpeakerCount = 0;
|
9119 | object.maxSpeakerCount = 0;
|
9120 | object.speakerTag = 0;
|
9121 | }
|
9122 | if (message.enableSpeakerDiarization != null && message.hasOwnProperty("enableSpeakerDiarization"))
|
9123 | object.enableSpeakerDiarization = message.enableSpeakerDiarization;
|
9124 | if (message.minSpeakerCount != null && message.hasOwnProperty("minSpeakerCount"))
|
9125 | object.minSpeakerCount = message.minSpeakerCount;
|
9126 | if (message.maxSpeakerCount != null && message.hasOwnProperty("maxSpeakerCount"))
|
9127 | object.maxSpeakerCount = message.maxSpeakerCount;
|
9128 | if (message.speakerTag != null && message.hasOwnProperty("speakerTag"))
|
9129 | object.speakerTag = message.speakerTag;
|
9130 | return object;
|
9131 | };
|
9132 |
|
9133 | /**
|
9134 | * Converts this SpeakerDiarizationConfig to JSON.
|
9135 | * @function toJSON
|
9136 | * @memberof google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig
|
9137 | * @instance
|
9138 | * @returns {Object.<string,*>} JSON object
|
9139 | */
|
9140 | SpeakerDiarizationConfig.prototype.toJSON = function toJSON() {
|
9141 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
9142 | };
|
9143 |
|
9144 | return SpeakerDiarizationConfig;
|
9145 | })();
|
9146 |
|
9147 | v1p1beta1.RecognitionMetadata = (function() {
|
9148 |
|
9149 | /**
|
9150 | * Properties of a RecognitionMetadata.
|
9151 | * @memberof google.cloud.speech.v1p1beta1
|
9152 | * @interface IRecognitionMetadata
|
9153 | * @property {google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType|null} [interactionType] RecognitionMetadata interactionType
|
9154 | * @property {number|null} [industryNaicsCodeOfAudio] RecognitionMetadata industryNaicsCodeOfAudio
|
9155 | * @property {google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance|null} [microphoneDistance] RecognitionMetadata microphoneDistance
|
9156 | * @property {google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType|null} [originalMediaType] RecognitionMetadata originalMediaType
|
9157 | * @property {google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType|null} [recordingDeviceType] RecognitionMetadata recordingDeviceType
|
9158 | * @property {string|null} [recordingDeviceName] RecognitionMetadata recordingDeviceName
|
9159 | * @property {string|null} [originalMimeType] RecognitionMetadata originalMimeType
|
9160 | * @property {number|Long|null} [obfuscatedId] RecognitionMetadata obfuscatedId
|
9161 | * @property {string|null} [audioTopic] RecognitionMetadata audioTopic
|
9162 | */
|
9163 |
|
9164 | /**
|
9165 | * Constructs a new RecognitionMetadata.
|
9166 | * @memberof google.cloud.speech.v1p1beta1
|
9167 | * @classdesc Represents a RecognitionMetadata.
|
9168 | * @implements IRecognitionMetadata
|
9169 | * @constructor
|
9170 | * @param {google.cloud.speech.v1p1beta1.IRecognitionMetadata=} [properties] Properties to set
|
9171 | */
|
9172 | function RecognitionMetadata(properties) {
|
9173 | if (properties)
|
9174 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
9175 | if (properties[keys[i]] != null)
|
9176 | this[keys[i]] = properties[keys[i]];
|
9177 | }
|
9178 |
|
9179 | /**
|
9180 | * RecognitionMetadata interactionType.
|
9181 | * @member {google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType} interactionType
|
9182 | * @memberof google.cloud.speech.v1p1beta1.RecognitionMetadata
|
9183 | * @instance
|
9184 | */
|
9185 | RecognitionMetadata.prototype.interactionType = 0;
|
9186 |
|
9187 | /**
|
9188 | * RecognitionMetadata industryNaicsCodeOfAudio.
|
9189 | * @member {number} industryNaicsCodeOfAudio
|
9190 | * @memberof google.cloud.speech.v1p1beta1.RecognitionMetadata
|
9191 | * @instance
|
9192 | */
|
9193 | RecognitionMetadata.prototype.industryNaicsCodeOfAudio = 0;
|
9194 |
|
9195 | /**
|
9196 | * RecognitionMetadata microphoneDistance.
|
9197 | * @member {google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance} microphoneDistance
|
9198 | * @memberof google.cloud.speech.v1p1beta1.RecognitionMetadata
|
9199 | * @instance
|
9200 | */
|
9201 | RecognitionMetadata.prototype.microphoneDistance = 0;
|
9202 |
|
9203 | /**
|
9204 | * RecognitionMetadata originalMediaType.
|
9205 | * @member {google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType} originalMediaType
|
9206 | * @memberof google.cloud.speech.v1p1beta1.RecognitionMetadata
|
9207 | * @instance
|
9208 | */
|
9209 | RecognitionMetadata.prototype.originalMediaType = 0;
|
9210 |
|
9211 | /**
|
9212 | * RecognitionMetadata recordingDeviceType.
|
9213 | * @member {google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType} recordingDeviceType
|
9214 | * @memberof google.cloud.speech.v1p1beta1.RecognitionMetadata
|
9215 | * @instance
|
9216 | */
|
9217 | RecognitionMetadata.prototype.recordingDeviceType = 0;
|
9218 |
|
9219 | /**
|
9220 | * RecognitionMetadata recordingDeviceName.
|
9221 | * @member {string} recordingDeviceName
|
9222 | * @memberof google.cloud.speech.v1p1beta1.RecognitionMetadata
|
9223 | * @instance
|
9224 | */
|
9225 | RecognitionMetadata.prototype.recordingDeviceName = "";
|
9226 |
|
9227 | /**
|
9228 | * RecognitionMetadata originalMimeType.
|
9229 | * @member {string} originalMimeType
|
9230 | * @memberof google.cloud.speech.v1p1beta1.RecognitionMetadata
|
9231 | * @instance
|
9232 | */
|
9233 | RecognitionMetadata.prototype.originalMimeType = "";
|
9234 |
|
9235 | /**
|
9236 | * RecognitionMetadata obfuscatedId.
|
9237 | * @member {number|Long} obfuscatedId
|
9238 | * @memberof google.cloud.speech.v1p1beta1.RecognitionMetadata
|
9239 | * @instance
|
9240 | */
|
9241 | RecognitionMetadata.prototype.obfuscatedId = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
9242 |
|
9243 | /**
|
9244 | * RecognitionMetadata audioTopic.
|
9245 | * @member {string} audioTopic
|
9246 | * @memberof google.cloud.speech.v1p1beta1.RecognitionMetadata
|
9247 | * @instance
|
9248 | */
|
9249 | RecognitionMetadata.prototype.audioTopic = "";
|
9250 |
|
9251 | /**
|
9252 | * Creates a new RecognitionMetadata instance using the specified properties.
|
9253 | * @function create
|
9254 | * @memberof google.cloud.speech.v1p1beta1.RecognitionMetadata
|
9255 | * @static
|
9256 | * @param {google.cloud.speech.v1p1beta1.IRecognitionMetadata=} [properties] Properties to set
|
9257 | * @returns {google.cloud.speech.v1p1beta1.RecognitionMetadata} RecognitionMetadata instance
|
9258 | */
|
9259 | RecognitionMetadata.create = function create(properties) {
|
9260 | return new RecognitionMetadata(properties);
|
9261 | };
|
9262 |
|
9263 | /**
|
9264 | * Encodes the specified RecognitionMetadata message. Does not implicitly {@link google.cloud.speech.v1p1beta1.RecognitionMetadata.verify|verify} messages.
|
9265 | * @function encode
|
9266 | * @memberof google.cloud.speech.v1p1beta1.RecognitionMetadata
|
9267 | * @static
|
9268 | * @param {google.cloud.speech.v1p1beta1.IRecognitionMetadata} message RecognitionMetadata message or plain object to encode
|
9269 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
9270 | * @returns {$protobuf.Writer} Writer
|
9271 | */
|
9272 | RecognitionMetadata.encode = function encode(message, writer) {
|
9273 | if (!writer)
|
9274 | writer = $Writer.create();
|
9275 | if (message.interactionType != null && Object.hasOwnProperty.call(message, "interactionType"))
|
9276 | writer.uint32(/* id 1, wireType 0 =*/8).int32(message.interactionType);
|
9277 | if (message.industryNaicsCodeOfAudio != null && Object.hasOwnProperty.call(message, "industryNaicsCodeOfAudio"))
|
9278 | writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.industryNaicsCodeOfAudio);
|
9279 | if (message.microphoneDistance != null && Object.hasOwnProperty.call(message, "microphoneDistance"))
|
9280 | writer.uint32(/* id 4, wireType 0 =*/32).int32(message.microphoneDistance);
|
9281 | if (message.originalMediaType != null && Object.hasOwnProperty.call(message, "originalMediaType"))
|
9282 | writer.uint32(/* id 5, wireType 0 =*/40).int32(message.originalMediaType);
|
9283 | if (message.recordingDeviceType != null && Object.hasOwnProperty.call(message, "recordingDeviceType"))
|
9284 | writer.uint32(/* id 6, wireType 0 =*/48).int32(message.recordingDeviceType);
|
9285 | if (message.recordingDeviceName != null && Object.hasOwnProperty.call(message, "recordingDeviceName"))
|
9286 | writer.uint32(/* id 7, wireType 2 =*/58).string(message.recordingDeviceName);
|
9287 | if (message.originalMimeType != null && Object.hasOwnProperty.call(message, "originalMimeType"))
|
9288 | writer.uint32(/* id 8, wireType 2 =*/66).string(message.originalMimeType);
|
9289 | if (message.obfuscatedId != null && Object.hasOwnProperty.call(message, "obfuscatedId"))
|
9290 | writer.uint32(/* id 9, wireType 0 =*/72).int64(message.obfuscatedId);
|
9291 | if (message.audioTopic != null && Object.hasOwnProperty.call(message, "audioTopic"))
|
9292 | writer.uint32(/* id 10, wireType 2 =*/82).string(message.audioTopic);
|
9293 | return writer;
|
9294 | };
|
9295 |
|
9296 | /**
|
9297 | * Encodes the specified RecognitionMetadata message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.RecognitionMetadata.verify|verify} messages.
|
9298 | * @function encodeDelimited
|
9299 | * @memberof google.cloud.speech.v1p1beta1.RecognitionMetadata
|
9300 | * @static
|
9301 | * @param {google.cloud.speech.v1p1beta1.IRecognitionMetadata} message RecognitionMetadata message or plain object to encode
|
9302 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
9303 | * @returns {$protobuf.Writer} Writer
|
9304 | */
|
9305 | RecognitionMetadata.encodeDelimited = function encodeDelimited(message, writer) {
|
9306 | return this.encode(message, writer).ldelim();
|
9307 | };
|
9308 |
|
9309 | /**
|
9310 | * Decodes a RecognitionMetadata message from the specified reader or buffer.
|
9311 | * @function decode
|
9312 | * @memberof google.cloud.speech.v1p1beta1.RecognitionMetadata
|
9313 | * @static
|
9314 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
9315 | * @param {number} [length] Message length if known beforehand
|
9316 | * @returns {google.cloud.speech.v1p1beta1.RecognitionMetadata} RecognitionMetadata
|
9317 | * @throws {Error} If the payload is not a reader or valid buffer
|
9318 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
9319 | */
|
9320 | RecognitionMetadata.decode = function decode(reader, length) {
|
9321 | if (!(reader instanceof $Reader))
|
9322 | reader = $Reader.create(reader);
|
9323 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.RecognitionMetadata();
|
9324 | while (reader.pos < end) {
|
9325 | var tag = reader.uint32();
|
9326 | switch (tag >>> 3) {
|
9327 | case 1:
|
9328 | message.interactionType = reader.int32();
|
9329 | break;
|
9330 | case 3:
|
9331 | message.industryNaicsCodeOfAudio = reader.uint32();
|
9332 | break;
|
9333 | case 4:
|
9334 | message.microphoneDistance = reader.int32();
|
9335 | break;
|
9336 | case 5:
|
9337 | message.originalMediaType = reader.int32();
|
9338 | break;
|
9339 | case 6:
|
9340 | message.recordingDeviceType = reader.int32();
|
9341 | break;
|
9342 | case 7:
|
9343 | message.recordingDeviceName = reader.string();
|
9344 | break;
|
9345 | case 8:
|
9346 | message.originalMimeType = reader.string();
|
9347 | break;
|
9348 | case 9:
|
9349 | message.obfuscatedId = reader.int64();
|
9350 | break;
|
9351 | case 10:
|
9352 | message.audioTopic = reader.string();
|
9353 | break;
|
9354 | default:
|
9355 | reader.skipType(tag & 7);
|
9356 | break;
|
9357 | }
|
9358 | }
|
9359 | return message;
|
9360 | };
|
9361 |
|
9362 | /**
|
9363 | * Decodes a RecognitionMetadata message from the specified reader or buffer, length delimited.
|
9364 | * @function decodeDelimited
|
9365 | * @memberof google.cloud.speech.v1p1beta1.RecognitionMetadata
|
9366 | * @static
|
9367 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
9368 | * @returns {google.cloud.speech.v1p1beta1.RecognitionMetadata} RecognitionMetadata
|
9369 | * @throws {Error} If the payload is not a reader or valid buffer
|
9370 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
9371 | */
|
9372 | RecognitionMetadata.decodeDelimited = function decodeDelimited(reader) {
|
9373 | if (!(reader instanceof $Reader))
|
9374 | reader = new $Reader(reader);
|
9375 | return this.decode(reader, reader.uint32());
|
9376 | };
|
9377 |
|
9378 | /**
|
9379 | * Verifies a RecognitionMetadata message.
|
9380 | * @function verify
|
9381 | * @memberof google.cloud.speech.v1p1beta1.RecognitionMetadata
|
9382 | * @static
|
9383 | * @param {Object.<string,*>} message Plain object to verify
|
9384 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
9385 | */
|
9386 | RecognitionMetadata.verify = function verify(message) {
|
9387 | if (typeof message !== "object" || message === null)
|
9388 | return "object expected";
|
9389 | if (message.interactionType != null && message.hasOwnProperty("interactionType"))
|
9390 | switch (message.interactionType) {
|
9391 | default:
|
9392 | return "interactionType: enum value expected";
|
9393 | case 0:
|
9394 | case 1:
|
9395 | case 2:
|
9396 | case 3:
|
9397 | case 4:
|
9398 | case 5:
|
9399 | case 6:
|
9400 | case 7:
|
9401 | case 8:
|
9402 | break;
|
9403 | }
|
9404 | if (message.industryNaicsCodeOfAudio != null && message.hasOwnProperty("industryNaicsCodeOfAudio"))
|
9405 | if (!$util.isInteger(message.industryNaicsCodeOfAudio))
|
9406 | return "industryNaicsCodeOfAudio: integer expected";
|
9407 | if (message.microphoneDistance != null && message.hasOwnProperty("microphoneDistance"))
|
9408 | switch (message.microphoneDistance) {
|
9409 | default:
|
9410 | return "microphoneDistance: enum value expected";
|
9411 | case 0:
|
9412 | case 1:
|
9413 | case 2:
|
9414 | case 3:
|
9415 | break;
|
9416 | }
|
9417 | if (message.originalMediaType != null && message.hasOwnProperty("originalMediaType"))
|
9418 | switch (message.originalMediaType) {
|
9419 | default:
|
9420 | return "originalMediaType: enum value expected";
|
9421 | case 0:
|
9422 | case 1:
|
9423 | case 2:
|
9424 | break;
|
9425 | }
|
9426 | if (message.recordingDeviceType != null && message.hasOwnProperty("recordingDeviceType"))
|
9427 | switch (message.recordingDeviceType) {
|
9428 | default:
|
9429 | return "recordingDeviceType: enum value expected";
|
9430 | case 0:
|
9431 | case 1:
|
9432 | case 2:
|
9433 | case 3:
|
9434 | case 4:
|
9435 | case 5:
|
9436 | case 6:
|
9437 | break;
|
9438 | }
|
9439 | if (message.recordingDeviceName != null && message.hasOwnProperty("recordingDeviceName"))
|
9440 | if (!$util.isString(message.recordingDeviceName))
|
9441 | return "recordingDeviceName: string expected";
|
9442 | if (message.originalMimeType != null && message.hasOwnProperty("originalMimeType"))
|
9443 | if (!$util.isString(message.originalMimeType))
|
9444 | return "originalMimeType: string expected";
|
9445 | if (message.obfuscatedId != null && message.hasOwnProperty("obfuscatedId"))
|
9446 | if (!$util.isInteger(message.obfuscatedId) && !(message.obfuscatedId && $util.isInteger(message.obfuscatedId.low) && $util.isInteger(message.obfuscatedId.high)))
|
9447 | return "obfuscatedId: integer|Long expected";
|
9448 | if (message.audioTopic != null && message.hasOwnProperty("audioTopic"))
|
9449 | if (!$util.isString(message.audioTopic))
|
9450 | return "audioTopic: string expected";
|
9451 | return null;
|
9452 | };
|
9453 |
|
9454 | /**
|
9455 | * Creates a RecognitionMetadata message from a plain object. Also converts values to their respective internal types.
|
9456 | * @function fromObject
|
9457 | * @memberof google.cloud.speech.v1p1beta1.RecognitionMetadata
|
9458 | * @static
|
9459 | * @param {Object.<string,*>} object Plain object
|
9460 | * @returns {google.cloud.speech.v1p1beta1.RecognitionMetadata} RecognitionMetadata
|
9461 | */
|
9462 | RecognitionMetadata.fromObject = function fromObject(object) {
|
9463 | if (object instanceof $root.google.cloud.speech.v1p1beta1.RecognitionMetadata)
|
9464 | return object;
|
9465 | var message = new $root.google.cloud.speech.v1p1beta1.RecognitionMetadata();
|
9466 | switch (object.interactionType) {
|
9467 | case "INTERACTION_TYPE_UNSPECIFIED":
|
9468 | case 0:
|
9469 | message.interactionType = 0;
|
9470 | break;
|
9471 | case "DISCUSSION":
|
9472 | case 1:
|
9473 | message.interactionType = 1;
|
9474 | break;
|
9475 | case "PRESENTATION":
|
9476 | case 2:
|
9477 | message.interactionType = 2;
|
9478 | break;
|
9479 | case "PHONE_CALL":
|
9480 | case 3:
|
9481 | message.interactionType = 3;
|
9482 | break;
|
9483 | case "VOICEMAIL":
|
9484 | case 4:
|
9485 | message.interactionType = 4;
|
9486 | break;
|
9487 | case "PROFESSIONALLY_PRODUCED":
|
9488 | case 5:
|
9489 | message.interactionType = 5;
|
9490 | break;
|
9491 | case "VOICE_SEARCH":
|
9492 | case 6:
|
9493 | message.interactionType = 6;
|
9494 | break;
|
9495 | case "VOICE_COMMAND":
|
9496 | case 7:
|
9497 | message.interactionType = 7;
|
9498 | break;
|
9499 | case "DICTATION":
|
9500 | case 8:
|
9501 | message.interactionType = 8;
|
9502 | break;
|
9503 | }
|
9504 | if (object.industryNaicsCodeOfAudio != null)
|
9505 | message.industryNaicsCodeOfAudio = object.industryNaicsCodeOfAudio >>> 0;
|
9506 | switch (object.microphoneDistance) {
|
9507 | case "MICROPHONE_DISTANCE_UNSPECIFIED":
|
9508 | case 0:
|
9509 | message.microphoneDistance = 0;
|
9510 | break;
|
9511 | case "NEARFIELD":
|
9512 | case 1:
|
9513 | message.microphoneDistance = 1;
|
9514 | break;
|
9515 | case "MIDFIELD":
|
9516 | case 2:
|
9517 | message.microphoneDistance = 2;
|
9518 | break;
|
9519 | case "FARFIELD":
|
9520 | case 3:
|
9521 | message.microphoneDistance = 3;
|
9522 | break;
|
9523 | }
|
9524 | switch (object.originalMediaType) {
|
9525 | case "ORIGINAL_MEDIA_TYPE_UNSPECIFIED":
|
9526 | case 0:
|
9527 | message.originalMediaType = 0;
|
9528 | break;
|
9529 | case "AUDIO":
|
9530 | case 1:
|
9531 | message.originalMediaType = 1;
|
9532 | break;
|
9533 | case "VIDEO":
|
9534 | case 2:
|
9535 | message.originalMediaType = 2;
|
9536 | break;
|
9537 | }
|
9538 | switch (object.recordingDeviceType) {
|
9539 | case "RECORDING_DEVICE_TYPE_UNSPECIFIED":
|
9540 | case 0:
|
9541 | message.recordingDeviceType = 0;
|
9542 | break;
|
9543 | case "SMARTPHONE":
|
9544 | case 1:
|
9545 | message.recordingDeviceType = 1;
|
9546 | break;
|
9547 | case "PC":
|
9548 | case 2:
|
9549 | message.recordingDeviceType = 2;
|
9550 | break;
|
9551 | case "PHONE_LINE":
|
9552 | case 3:
|
9553 | message.recordingDeviceType = 3;
|
9554 | break;
|
9555 | case "VEHICLE":
|
9556 | case 4:
|
9557 | message.recordingDeviceType = 4;
|
9558 | break;
|
9559 | case "OTHER_OUTDOOR_DEVICE":
|
9560 | case 5:
|
9561 | message.recordingDeviceType = 5;
|
9562 | break;
|
9563 | case "OTHER_INDOOR_DEVICE":
|
9564 | case 6:
|
9565 | message.recordingDeviceType = 6;
|
9566 | break;
|
9567 | }
|
9568 | if (object.recordingDeviceName != null)
|
9569 | message.recordingDeviceName = String(object.recordingDeviceName);
|
9570 | if (object.originalMimeType != null)
|
9571 | message.originalMimeType = String(object.originalMimeType);
|
9572 | if (object.obfuscatedId != null)
|
9573 | if ($util.Long)
|
9574 | (message.obfuscatedId = $util.Long.fromValue(object.obfuscatedId)).unsigned = false;
|
9575 | else if (typeof object.obfuscatedId === "string")
|
9576 | message.obfuscatedId = parseInt(object.obfuscatedId, 10);
|
9577 | else if (typeof object.obfuscatedId === "number")
|
9578 | message.obfuscatedId = object.obfuscatedId;
|
9579 | else if (typeof object.obfuscatedId === "object")
|
9580 | message.obfuscatedId = new $util.LongBits(object.obfuscatedId.low >>> 0, object.obfuscatedId.high >>> 0).toNumber();
|
9581 | if (object.audioTopic != null)
|
9582 | message.audioTopic = String(object.audioTopic);
|
9583 | return message;
|
9584 | };
|
9585 |
|
9586 | /**
|
9587 | * Creates a plain object from a RecognitionMetadata message. Also converts values to other types if specified.
|
9588 | * @function toObject
|
9589 | * @memberof google.cloud.speech.v1p1beta1.RecognitionMetadata
|
9590 | * @static
|
9591 | * @param {google.cloud.speech.v1p1beta1.RecognitionMetadata} message RecognitionMetadata
|
9592 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
9593 | * @returns {Object.<string,*>} Plain object
|
9594 | */
|
9595 | RecognitionMetadata.toObject = function toObject(message, options) {
|
9596 | if (!options)
|
9597 | options = {};
|
9598 | var object = {};
|
9599 | if (options.defaults) {
|
9600 | object.interactionType = options.enums === String ? "INTERACTION_TYPE_UNSPECIFIED" : 0;
|
9601 | object.industryNaicsCodeOfAudio = 0;
|
9602 | object.microphoneDistance = options.enums === String ? "MICROPHONE_DISTANCE_UNSPECIFIED" : 0;
|
9603 | object.originalMediaType = options.enums === String ? "ORIGINAL_MEDIA_TYPE_UNSPECIFIED" : 0;
|
9604 | object.recordingDeviceType = options.enums === String ? "RECORDING_DEVICE_TYPE_UNSPECIFIED" : 0;
|
9605 | object.recordingDeviceName = "";
|
9606 | object.originalMimeType = "";
|
9607 | if ($util.Long) {
|
9608 | var long = new $util.Long(0, 0, false);
|
9609 | object.obfuscatedId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
9610 | } else
|
9611 | object.obfuscatedId = options.longs === String ? "0" : 0;
|
9612 | object.audioTopic = "";
|
9613 | }
|
9614 | if (message.interactionType != null && message.hasOwnProperty("interactionType"))
|
9615 | object.interactionType = options.enums === String ? $root.google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType[message.interactionType] : message.interactionType;
|
9616 | if (message.industryNaicsCodeOfAudio != null && message.hasOwnProperty("industryNaicsCodeOfAudio"))
|
9617 | object.industryNaicsCodeOfAudio = message.industryNaicsCodeOfAudio;
|
9618 | if (message.microphoneDistance != null && message.hasOwnProperty("microphoneDistance"))
|
9619 | object.microphoneDistance = options.enums === String ? $root.google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance[message.microphoneDistance] : message.microphoneDistance;
|
9620 | if (message.originalMediaType != null && message.hasOwnProperty("originalMediaType"))
|
9621 | object.originalMediaType = options.enums === String ? $root.google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType[message.originalMediaType] : message.originalMediaType;
|
9622 | if (message.recordingDeviceType != null && message.hasOwnProperty("recordingDeviceType"))
|
9623 | object.recordingDeviceType = options.enums === String ? $root.google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType[message.recordingDeviceType] : message.recordingDeviceType;
|
9624 | if (message.recordingDeviceName != null && message.hasOwnProperty("recordingDeviceName"))
|
9625 | object.recordingDeviceName = message.recordingDeviceName;
|
9626 | if (message.originalMimeType != null && message.hasOwnProperty("originalMimeType"))
|
9627 | object.originalMimeType = message.originalMimeType;
|
9628 | if (message.obfuscatedId != null && message.hasOwnProperty("obfuscatedId"))
|
9629 | if (typeof message.obfuscatedId === "number")
|
9630 | object.obfuscatedId = options.longs === String ? String(message.obfuscatedId) : message.obfuscatedId;
|
9631 | else
|
9632 | 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;
|
9633 | if (message.audioTopic != null && message.hasOwnProperty("audioTopic"))
|
9634 | object.audioTopic = message.audioTopic;
|
9635 | return object;
|
9636 | };
|
9637 |
|
9638 | /**
|
9639 | * Converts this RecognitionMetadata to JSON.
|
9640 | * @function toJSON
|
9641 | * @memberof google.cloud.speech.v1p1beta1.RecognitionMetadata
|
9642 | * @instance
|
9643 | * @returns {Object.<string,*>} JSON object
|
9644 | */
|
9645 | RecognitionMetadata.prototype.toJSON = function toJSON() {
|
9646 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
9647 | };
|
9648 |
|
9649 | /**
|
9650 | * InteractionType enum.
|
9651 | * @name google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType
|
9652 | * @enum {number}
|
9653 | * @property {number} INTERACTION_TYPE_UNSPECIFIED=0 INTERACTION_TYPE_UNSPECIFIED value
|
9654 | * @property {number} DISCUSSION=1 DISCUSSION value
|
9655 | * @property {number} PRESENTATION=2 PRESENTATION value
|
9656 | * @property {number} PHONE_CALL=3 PHONE_CALL value
|
9657 | * @property {number} VOICEMAIL=4 VOICEMAIL value
|
9658 | * @property {number} PROFESSIONALLY_PRODUCED=5 PROFESSIONALLY_PRODUCED value
|
9659 | * @property {number} VOICE_SEARCH=6 VOICE_SEARCH value
|
9660 | * @property {number} VOICE_COMMAND=7 VOICE_COMMAND value
|
9661 | * @property {number} DICTATION=8 DICTATION value
|
9662 | */
|
9663 | RecognitionMetadata.InteractionType = (function() {
|
9664 | var valuesById = {}, values = Object.create(valuesById);
|
9665 | values[valuesById[0] = "INTERACTION_TYPE_UNSPECIFIED"] = 0;
|
9666 | values[valuesById[1] = "DISCUSSION"] = 1;
|
9667 | values[valuesById[2] = "PRESENTATION"] = 2;
|
9668 | values[valuesById[3] = "PHONE_CALL"] = 3;
|
9669 | values[valuesById[4] = "VOICEMAIL"] = 4;
|
9670 | values[valuesById[5] = "PROFESSIONALLY_PRODUCED"] = 5;
|
9671 | values[valuesById[6] = "VOICE_SEARCH"] = 6;
|
9672 | values[valuesById[7] = "VOICE_COMMAND"] = 7;
|
9673 | values[valuesById[8] = "DICTATION"] = 8;
|
9674 | return values;
|
9675 | })();
|
9676 |
|
9677 | /**
|
9678 | * MicrophoneDistance enum.
|
9679 | * @name google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance
|
9680 | * @enum {number}
|
9681 | * @property {number} MICROPHONE_DISTANCE_UNSPECIFIED=0 MICROPHONE_DISTANCE_UNSPECIFIED value
|
9682 | * @property {number} NEARFIELD=1 NEARFIELD value
|
9683 | * @property {number} MIDFIELD=2 MIDFIELD value
|
9684 | * @property {number} FARFIELD=3 FARFIELD value
|
9685 | */
|
9686 | RecognitionMetadata.MicrophoneDistance = (function() {
|
9687 | var valuesById = {}, values = Object.create(valuesById);
|
9688 | values[valuesById[0] = "MICROPHONE_DISTANCE_UNSPECIFIED"] = 0;
|
9689 | values[valuesById[1] = "NEARFIELD"] = 1;
|
9690 | values[valuesById[2] = "MIDFIELD"] = 2;
|
9691 | values[valuesById[3] = "FARFIELD"] = 3;
|
9692 | return values;
|
9693 | })();
|
9694 |
|
9695 | /**
|
9696 | * OriginalMediaType enum.
|
9697 | * @name google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType
|
9698 | * @enum {number}
|
9699 | * @property {number} ORIGINAL_MEDIA_TYPE_UNSPECIFIED=0 ORIGINAL_MEDIA_TYPE_UNSPECIFIED value
|
9700 | * @property {number} AUDIO=1 AUDIO value
|
9701 | * @property {number} VIDEO=2 VIDEO value
|
9702 | */
|
9703 | RecognitionMetadata.OriginalMediaType = (function() {
|
9704 | var valuesById = {}, values = Object.create(valuesById);
|
9705 | values[valuesById[0] = "ORIGINAL_MEDIA_TYPE_UNSPECIFIED"] = 0;
|
9706 | values[valuesById[1] = "AUDIO"] = 1;
|
9707 | values[valuesById[2] = "VIDEO"] = 2;
|
9708 | return values;
|
9709 | })();
|
9710 |
|
9711 | /**
|
9712 | * RecordingDeviceType enum.
|
9713 | * @name google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType
|
9714 | * @enum {number}
|
9715 | * @property {number} RECORDING_DEVICE_TYPE_UNSPECIFIED=0 RECORDING_DEVICE_TYPE_UNSPECIFIED value
|
9716 | * @property {number} SMARTPHONE=1 SMARTPHONE value
|
9717 | * @property {number} PC=2 PC value
|
9718 | * @property {number} PHONE_LINE=3 PHONE_LINE value
|
9719 | * @property {number} VEHICLE=4 VEHICLE value
|
9720 | * @property {number} OTHER_OUTDOOR_DEVICE=5 OTHER_OUTDOOR_DEVICE value
|
9721 | * @property {number} OTHER_INDOOR_DEVICE=6 OTHER_INDOOR_DEVICE value
|
9722 | */
|
9723 | RecognitionMetadata.RecordingDeviceType = (function() {
|
9724 | var valuesById = {}, values = Object.create(valuesById);
|
9725 | values[valuesById[0] = "RECORDING_DEVICE_TYPE_UNSPECIFIED"] = 0;
|
9726 | values[valuesById[1] = "SMARTPHONE"] = 1;
|
9727 | values[valuesById[2] = "PC"] = 2;
|
9728 | values[valuesById[3] = "PHONE_LINE"] = 3;
|
9729 | values[valuesById[4] = "VEHICLE"] = 4;
|
9730 | values[valuesById[5] = "OTHER_OUTDOOR_DEVICE"] = 5;
|
9731 | values[valuesById[6] = "OTHER_INDOOR_DEVICE"] = 6;
|
9732 | return values;
|
9733 | })();
|
9734 |
|
9735 | return RecognitionMetadata;
|
9736 | })();
|
9737 |
|
9738 | v1p1beta1.SpeechContext = (function() {
|
9739 |
|
9740 | /**
|
9741 | * Properties of a SpeechContext.
|
9742 | * @memberof google.cloud.speech.v1p1beta1
|
9743 | * @interface ISpeechContext
|
9744 | * @property {Array.<string>|null} [phrases] SpeechContext phrases
|
9745 | * @property {number|null} [boost] SpeechContext boost
|
9746 | */
|
9747 |
|
9748 | /**
|
9749 | * Constructs a new SpeechContext.
|
9750 | * @memberof google.cloud.speech.v1p1beta1
|
9751 | * @classdesc Represents a SpeechContext.
|
9752 | * @implements ISpeechContext
|
9753 | * @constructor
|
9754 | * @param {google.cloud.speech.v1p1beta1.ISpeechContext=} [properties] Properties to set
|
9755 | */
|
9756 | function SpeechContext(properties) {
|
9757 | this.phrases = [];
|
9758 | if (properties)
|
9759 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
9760 | if (properties[keys[i]] != null)
|
9761 | this[keys[i]] = properties[keys[i]];
|
9762 | }
|
9763 |
|
9764 | /**
|
9765 | * SpeechContext phrases.
|
9766 | * @member {Array.<string>} phrases
|
9767 | * @memberof google.cloud.speech.v1p1beta1.SpeechContext
|
9768 | * @instance
|
9769 | */
|
9770 | SpeechContext.prototype.phrases = $util.emptyArray;
|
9771 |
|
9772 | /**
|
9773 | * SpeechContext boost.
|
9774 | * @member {number} boost
|
9775 | * @memberof google.cloud.speech.v1p1beta1.SpeechContext
|
9776 | * @instance
|
9777 | */
|
9778 | SpeechContext.prototype.boost = 0;
|
9779 |
|
9780 | /**
|
9781 | * Creates a new SpeechContext instance using the specified properties.
|
9782 | * @function create
|
9783 | * @memberof google.cloud.speech.v1p1beta1.SpeechContext
|
9784 | * @static
|
9785 | * @param {google.cloud.speech.v1p1beta1.ISpeechContext=} [properties] Properties to set
|
9786 | * @returns {google.cloud.speech.v1p1beta1.SpeechContext} SpeechContext instance
|
9787 | */
|
9788 | SpeechContext.create = function create(properties) {
|
9789 | return new SpeechContext(properties);
|
9790 | };
|
9791 |
|
9792 | /**
|
9793 | * Encodes the specified SpeechContext message. Does not implicitly {@link google.cloud.speech.v1p1beta1.SpeechContext.verify|verify} messages.
|
9794 | * @function encode
|
9795 | * @memberof google.cloud.speech.v1p1beta1.SpeechContext
|
9796 | * @static
|
9797 | * @param {google.cloud.speech.v1p1beta1.ISpeechContext} message SpeechContext message or plain object to encode
|
9798 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
9799 | * @returns {$protobuf.Writer} Writer
|
9800 | */
|
9801 | SpeechContext.encode = function encode(message, writer) {
|
9802 | if (!writer)
|
9803 | writer = $Writer.create();
|
9804 | if (message.phrases != null && message.phrases.length)
|
9805 | for (var i = 0; i < message.phrases.length; ++i)
|
9806 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.phrases[i]);
|
9807 | if (message.boost != null && Object.hasOwnProperty.call(message, "boost"))
|
9808 | writer.uint32(/* id 4, wireType 5 =*/37).float(message.boost);
|
9809 | return writer;
|
9810 | };
|
9811 |
|
9812 | /**
|
9813 | * Encodes the specified SpeechContext message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.SpeechContext.verify|verify} messages.
|
9814 | * @function encodeDelimited
|
9815 | * @memberof google.cloud.speech.v1p1beta1.SpeechContext
|
9816 | * @static
|
9817 | * @param {google.cloud.speech.v1p1beta1.ISpeechContext} message SpeechContext message or plain object to encode
|
9818 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
9819 | * @returns {$protobuf.Writer} Writer
|
9820 | */
|
9821 | SpeechContext.encodeDelimited = function encodeDelimited(message, writer) {
|
9822 | return this.encode(message, writer).ldelim();
|
9823 | };
|
9824 |
|
9825 | /**
|
9826 | * Decodes a SpeechContext message from the specified reader or buffer.
|
9827 | * @function decode
|
9828 | * @memberof google.cloud.speech.v1p1beta1.SpeechContext
|
9829 | * @static
|
9830 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
9831 | * @param {number} [length] Message length if known beforehand
|
9832 | * @returns {google.cloud.speech.v1p1beta1.SpeechContext} SpeechContext
|
9833 | * @throws {Error} If the payload is not a reader or valid buffer
|
9834 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
9835 | */
|
9836 | SpeechContext.decode = function decode(reader, length) {
|
9837 | if (!(reader instanceof $Reader))
|
9838 | reader = $Reader.create(reader);
|
9839 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.SpeechContext();
|
9840 | while (reader.pos < end) {
|
9841 | var tag = reader.uint32();
|
9842 | switch (tag >>> 3) {
|
9843 | case 1:
|
9844 | if (!(message.phrases && message.phrases.length))
|
9845 | message.phrases = [];
|
9846 | message.phrases.push(reader.string());
|
9847 | break;
|
9848 | case 4:
|
9849 | message.boost = reader.float();
|
9850 | break;
|
9851 | default:
|
9852 | reader.skipType(tag & 7);
|
9853 | break;
|
9854 | }
|
9855 | }
|
9856 | return message;
|
9857 | };
|
9858 |
|
9859 | /**
|
9860 | * Decodes a SpeechContext message from the specified reader or buffer, length delimited.
|
9861 | * @function decodeDelimited
|
9862 | * @memberof google.cloud.speech.v1p1beta1.SpeechContext
|
9863 | * @static
|
9864 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
9865 | * @returns {google.cloud.speech.v1p1beta1.SpeechContext} SpeechContext
|
9866 | * @throws {Error} If the payload is not a reader or valid buffer
|
9867 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
9868 | */
|
9869 | SpeechContext.decodeDelimited = function decodeDelimited(reader) {
|
9870 | if (!(reader instanceof $Reader))
|
9871 | reader = new $Reader(reader);
|
9872 | return this.decode(reader, reader.uint32());
|
9873 | };
|
9874 |
|
9875 | /**
|
9876 | * Verifies a SpeechContext message.
|
9877 | * @function verify
|
9878 | * @memberof google.cloud.speech.v1p1beta1.SpeechContext
|
9879 | * @static
|
9880 | * @param {Object.<string,*>} message Plain object to verify
|
9881 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
9882 | */
|
9883 | SpeechContext.verify = function verify(message) {
|
9884 | if (typeof message !== "object" || message === null)
|
9885 | return "object expected";
|
9886 | if (message.phrases != null && message.hasOwnProperty("phrases")) {
|
9887 | if (!Array.isArray(message.phrases))
|
9888 | return "phrases: array expected";
|
9889 | for (var i = 0; i < message.phrases.length; ++i)
|
9890 | if (!$util.isString(message.phrases[i]))
|
9891 | return "phrases: string[] expected";
|
9892 | }
|
9893 | if (message.boost != null && message.hasOwnProperty("boost"))
|
9894 | if (typeof message.boost !== "number")
|
9895 | return "boost: number expected";
|
9896 | return null;
|
9897 | };
|
9898 |
|
9899 | /**
|
9900 | * Creates a SpeechContext message from a plain object. Also converts values to their respective internal types.
|
9901 | * @function fromObject
|
9902 | * @memberof google.cloud.speech.v1p1beta1.SpeechContext
|
9903 | * @static
|
9904 | * @param {Object.<string,*>} object Plain object
|
9905 | * @returns {google.cloud.speech.v1p1beta1.SpeechContext} SpeechContext
|
9906 | */
|
9907 | SpeechContext.fromObject = function fromObject(object) {
|
9908 | if (object instanceof $root.google.cloud.speech.v1p1beta1.SpeechContext)
|
9909 | return object;
|
9910 | var message = new $root.google.cloud.speech.v1p1beta1.SpeechContext();
|
9911 | if (object.phrases) {
|
9912 | if (!Array.isArray(object.phrases))
|
9913 | throw TypeError(".google.cloud.speech.v1p1beta1.SpeechContext.phrases: array expected");
|
9914 | message.phrases = [];
|
9915 | for (var i = 0; i < object.phrases.length; ++i)
|
9916 | message.phrases[i] = String(object.phrases[i]);
|
9917 | }
|
9918 | if (object.boost != null)
|
9919 | message.boost = Number(object.boost);
|
9920 | return message;
|
9921 | };
|
9922 |
|
9923 | /**
|
9924 | * Creates a plain object from a SpeechContext message. Also converts values to other types if specified.
|
9925 | * @function toObject
|
9926 | * @memberof google.cloud.speech.v1p1beta1.SpeechContext
|
9927 | * @static
|
9928 | * @param {google.cloud.speech.v1p1beta1.SpeechContext} message SpeechContext
|
9929 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
9930 | * @returns {Object.<string,*>} Plain object
|
9931 | */
|
9932 | SpeechContext.toObject = function toObject(message, options) {
|
9933 | if (!options)
|
9934 | options = {};
|
9935 | var object = {};
|
9936 | if (options.arrays || options.defaults)
|
9937 | object.phrases = [];
|
9938 | if (options.defaults)
|
9939 | object.boost = 0;
|
9940 | if (message.phrases && message.phrases.length) {
|
9941 | object.phrases = [];
|
9942 | for (var j = 0; j < message.phrases.length; ++j)
|
9943 | object.phrases[j] = message.phrases[j];
|
9944 | }
|
9945 | if (message.boost != null && message.hasOwnProperty("boost"))
|
9946 | object.boost = options.json && !isFinite(message.boost) ? String(message.boost) : message.boost;
|
9947 | return object;
|
9948 | };
|
9949 |
|
9950 | /**
|
9951 | * Converts this SpeechContext to JSON.
|
9952 | * @function toJSON
|
9953 | * @memberof google.cloud.speech.v1p1beta1.SpeechContext
|
9954 | * @instance
|
9955 | * @returns {Object.<string,*>} JSON object
|
9956 | */
|
9957 | SpeechContext.prototype.toJSON = function toJSON() {
|
9958 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
9959 | };
|
9960 |
|
9961 | return SpeechContext;
|
9962 | })();
|
9963 |
|
9964 | v1p1beta1.RecognitionAudio = (function() {
|
9965 |
|
9966 | /**
|
9967 | * Properties of a RecognitionAudio.
|
9968 | * @memberof google.cloud.speech.v1p1beta1
|
9969 | * @interface IRecognitionAudio
|
9970 | * @property {Uint8Array|null} [content] RecognitionAudio content
|
9971 | * @property {string|null} [uri] RecognitionAudio uri
|
9972 | */
|
9973 |
|
9974 | /**
|
9975 | * Constructs a new RecognitionAudio.
|
9976 | * @memberof google.cloud.speech.v1p1beta1
|
9977 | * @classdesc Represents a RecognitionAudio.
|
9978 | * @implements IRecognitionAudio
|
9979 | * @constructor
|
9980 | * @param {google.cloud.speech.v1p1beta1.IRecognitionAudio=} [properties] Properties to set
|
9981 | */
|
9982 | function RecognitionAudio(properties) {
|
9983 | if (properties)
|
9984 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
9985 | if (properties[keys[i]] != null)
|
9986 | this[keys[i]] = properties[keys[i]];
|
9987 | }
|
9988 |
|
9989 | /**
|
9990 | * RecognitionAudio content.
|
9991 | * @member {Uint8Array|null|undefined} content
|
9992 | * @memberof google.cloud.speech.v1p1beta1.RecognitionAudio
|
9993 | * @instance
|
9994 | */
|
9995 | RecognitionAudio.prototype.content = null;
|
9996 |
|
9997 | /**
|
9998 | * RecognitionAudio uri.
|
9999 | * @member {string|null|undefined} uri
|
10000 | * @memberof google.cloud.speech.v1p1beta1.RecognitionAudio
|
10001 | * @instance
|
10002 | */
|
10003 | RecognitionAudio.prototype.uri = null;
|
10004 |
|
10005 | // OneOf field names bound to virtual getters and setters
|
10006 | var $oneOfFields;
|
10007 |
|
10008 | /**
|
10009 | * RecognitionAudio audioSource.
|
10010 | * @member {"content"|"uri"|undefined} audioSource
|
10011 | * @memberof google.cloud.speech.v1p1beta1.RecognitionAudio
|
10012 | * @instance
|
10013 | */
|
10014 | Object.defineProperty(RecognitionAudio.prototype, "audioSource", {
|
10015 | get: $util.oneOfGetter($oneOfFields = ["content", "uri"]),
|
10016 | set: $util.oneOfSetter($oneOfFields)
|
10017 | });
|
10018 |
|
10019 | /**
|
10020 | * Creates a new RecognitionAudio instance using the specified properties.
|
10021 | * @function create
|
10022 | * @memberof google.cloud.speech.v1p1beta1.RecognitionAudio
|
10023 | * @static
|
10024 | * @param {google.cloud.speech.v1p1beta1.IRecognitionAudio=} [properties] Properties to set
|
10025 | * @returns {google.cloud.speech.v1p1beta1.RecognitionAudio} RecognitionAudio instance
|
10026 | */
|
10027 | RecognitionAudio.create = function create(properties) {
|
10028 | return new RecognitionAudio(properties);
|
10029 | };
|
10030 |
|
10031 | /**
|
10032 | * Encodes the specified RecognitionAudio message. Does not implicitly {@link google.cloud.speech.v1p1beta1.RecognitionAudio.verify|verify} messages.
|
10033 | * @function encode
|
10034 | * @memberof google.cloud.speech.v1p1beta1.RecognitionAudio
|
10035 | * @static
|
10036 | * @param {google.cloud.speech.v1p1beta1.IRecognitionAudio} message RecognitionAudio message or plain object to encode
|
10037 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
10038 | * @returns {$protobuf.Writer} Writer
|
10039 | */
|
10040 | RecognitionAudio.encode = function encode(message, writer) {
|
10041 | if (!writer)
|
10042 | writer = $Writer.create();
|
10043 | if (message.content != null && Object.hasOwnProperty.call(message, "content"))
|
10044 | writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.content);
|
10045 | if (message.uri != null && Object.hasOwnProperty.call(message, "uri"))
|
10046 | writer.uint32(/* id 2, wireType 2 =*/18).string(message.uri);
|
10047 | return writer;
|
10048 | };
|
10049 |
|
10050 | /**
|
10051 | * Encodes the specified RecognitionAudio message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.RecognitionAudio.verify|verify} messages.
|
10052 | * @function encodeDelimited
|
10053 | * @memberof google.cloud.speech.v1p1beta1.RecognitionAudio
|
10054 | * @static
|
10055 | * @param {google.cloud.speech.v1p1beta1.IRecognitionAudio} message RecognitionAudio message or plain object to encode
|
10056 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
10057 | * @returns {$protobuf.Writer} Writer
|
10058 | */
|
10059 | RecognitionAudio.encodeDelimited = function encodeDelimited(message, writer) {
|
10060 | return this.encode(message, writer).ldelim();
|
10061 | };
|
10062 |
|
10063 | /**
|
10064 | * Decodes a RecognitionAudio message from the specified reader or buffer.
|
10065 | * @function decode
|
10066 | * @memberof google.cloud.speech.v1p1beta1.RecognitionAudio
|
10067 | * @static
|
10068 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
10069 | * @param {number} [length] Message length if known beforehand
|
10070 | * @returns {google.cloud.speech.v1p1beta1.RecognitionAudio} RecognitionAudio
|
10071 | * @throws {Error} If the payload is not a reader or valid buffer
|
10072 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
10073 | */
|
10074 | RecognitionAudio.decode = function decode(reader, length) {
|
10075 | if (!(reader instanceof $Reader))
|
10076 | reader = $Reader.create(reader);
|
10077 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.RecognitionAudio();
|
10078 | while (reader.pos < end) {
|
10079 | var tag = reader.uint32();
|
10080 | switch (tag >>> 3) {
|
10081 | case 1:
|
10082 | message.content = reader.bytes();
|
10083 | break;
|
10084 | case 2:
|
10085 | message.uri = reader.string();
|
10086 | break;
|
10087 | default:
|
10088 | reader.skipType(tag & 7);
|
10089 | break;
|
10090 | }
|
10091 | }
|
10092 | return message;
|
10093 | };
|
10094 |
|
10095 | /**
|
10096 | * Decodes a RecognitionAudio message from the specified reader or buffer, length delimited.
|
10097 | * @function decodeDelimited
|
10098 | * @memberof google.cloud.speech.v1p1beta1.RecognitionAudio
|
10099 | * @static
|
10100 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
10101 | * @returns {google.cloud.speech.v1p1beta1.RecognitionAudio} RecognitionAudio
|
10102 | * @throws {Error} If the payload is not a reader or valid buffer
|
10103 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
10104 | */
|
10105 | RecognitionAudio.decodeDelimited = function decodeDelimited(reader) {
|
10106 | if (!(reader instanceof $Reader))
|
10107 | reader = new $Reader(reader);
|
10108 | return this.decode(reader, reader.uint32());
|
10109 | };
|
10110 |
|
10111 | /**
|
10112 | * Verifies a RecognitionAudio message.
|
10113 | * @function verify
|
10114 | * @memberof google.cloud.speech.v1p1beta1.RecognitionAudio
|
10115 | * @static
|
10116 | * @param {Object.<string,*>} message Plain object to verify
|
10117 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
10118 | */
|
10119 | RecognitionAudio.verify = function verify(message) {
|
10120 | if (typeof message !== "object" || message === null)
|
10121 | return "object expected";
|
10122 | var properties = {};
|
10123 | if (message.content != null && message.hasOwnProperty("content")) {
|
10124 | properties.audioSource = 1;
|
10125 | if (!(message.content && typeof message.content.length === "number" || $util.isString(message.content)))
|
10126 | return "content: buffer expected";
|
10127 | }
|
10128 | if (message.uri != null && message.hasOwnProperty("uri")) {
|
10129 | if (properties.audioSource === 1)
|
10130 | return "audioSource: multiple values";
|
10131 | properties.audioSource = 1;
|
10132 | if (!$util.isString(message.uri))
|
10133 | return "uri: string expected";
|
10134 | }
|
10135 | return null;
|
10136 | };
|
10137 |
|
10138 | /**
|
10139 | * Creates a RecognitionAudio message from a plain object. Also converts values to their respective internal types.
|
10140 | * @function fromObject
|
10141 | * @memberof google.cloud.speech.v1p1beta1.RecognitionAudio
|
10142 | * @static
|
10143 | * @param {Object.<string,*>} object Plain object
|
10144 | * @returns {google.cloud.speech.v1p1beta1.RecognitionAudio} RecognitionAudio
|
10145 | */
|
10146 | RecognitionAudio.fromObject = function fromObject(object) {
|
10147 | if (object instanceof $root.google.cloud.speech.v1p1beta1.RecognitionAudio)
|
10148 | return object;
|
10149 | var message = new $root.google.cloud.speech.v1p1beta1.RecognitionAudio();
|
10150 | if (object.content != null)
|
10151 | if (typeof object.content === "string")
|
10152 | $util.base64.decode(object.content, message.content = $util.newBuffer($util.base64.length(object.content)), 0);
|
10153 | else if (object.content.length)
|
10154 | message.content = object.content;
|
10155 | if (object.uri != null)
|
10156 | message.uri = String(object.uri);
|
10157 | return message;
|
10158 | };
|
10159 |
|
10160 | /**
|
10161 | * Creates a plain object from a RecognitionAudio message. Also converts values to other types if specified.
|
10162 | * @function toObject
|
10163 | * @memberof google.cloud.speech.v1p1beta1.RecognitionAudio
|
10164 | * @static
|
10165 | * @param {google.cloud.speech.v1p1beta1.RecognitionAudio} message RecognitionAudio
|
10166 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
10167 | * @returns {Object.<string,*>} Plain object
|
10168 | */
|
10169 | RecognitionAudio.toObject = function toObject(message, options) {
|
10170 | if (!options)
|
10171 | options = {};
|
10172 | var object = {};
|
10173 | if (message.content != null && message.hasOwnProperty("content")) {
|
10174 | 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;
|
10175 | if (options.oneofs)
|
10176 | object.audioSource = "content";
|
10177 | }
|
10178 | if (message.uri != null && message.hasOwnProperty("uri")) {
|
10179 | object.uri = message.uri;
|
10180 | if (options.oneofs)
|
10181 | object.audioSource = "uri";
|
10182 | }
|
10183 | return object;
|
10184 | };
|
10185 |
|
10186 | /**
|
10187 | * Converts this RecognitionAudio to JSON.
|
10188 | * @function toJSON
|
10189 | * @memberof google.cloud.speech.v1p1beta1.RecognitionAudio
|
10190 | * @instance
|
10191 | * @returns {Object.<string,*>} JSON object
|
10192 | */
|
10193 | RecognitionAudio.prototype.toJSON = function toJSON() {
|
10194 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
10195 | };
|
10196 |
|
10197 | return RecognitionAudio;
|
10198 | })();
|
10199 |
|
10200 | v1p1beta1.RecognizeResponse = (function() {
|
10201 |
|
10202 | /**
|
10203 | * Properties of a RecognizeResponse.
|
10204 | * @memberof google.cloud.speech.v1p1beta1
|
10205 | * @interface IRecognizeResponse
|
10206 | * @property {Array.<google.cloud.speech.v1p1beta1.ISpeechRecognitionResult>|null} [results] RecognizeResponse results
|
10207 | * @property {google.protobuf.IDuration|null} [totalBilledTime] RecognizeResponse totalBilledTime
|
10208 | */
|
10209 |
|
10210 | /**
|
10211 | * Constructs a new RecognizeResponse.
|
10212 | * @memberof google.cloud.speech.v1p1beta1
|
10213 | * @classdesc Represents a RecognizeResponse.
|
10214 | * @implements IRecognizeResponse
|
10215 | * @constructor
|
10216 | * @param {google.cloud.speech.v1p1beta1.IRecognizeResponse=} [properties] Properties to set
|
10217 | */
|
10218 | function RecognizeResponse(properties) {
|
10219 | this.results = [];
|
10220 | if (properties)
|
10221 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
10222 | if (properties[keys[i]] != null)
|
10223 | this[keys[i]] = properties[keys[i]];
|
10224 | }
|
10225 |
|
10226 | /**
|
10227 | * RecognizeResponse results.
|
10228 | * @member {Array.<google.cloud.speech.v1p1beta1.ISpeechRecognitionResult>} results
|
10229 | * @memberof google.cloud.speech.v1p1beta1.RecognizeResponse
|
10230 | * @instance
|
10231 | */
|
10232 | RecognizeResponse.prototype.results = $util.emptyArray;
|
10233 |
|
10234 | /**
|
10235 | * RecognizeResponse totalBilledTime.
|
10236 | * @member {google.protobuf.IDuration|null|undefined} totalBilledTime
|
10237 | * @memberof google.cloud.speech.v1p1beta1.RecognizeResponse
|
10238 | * @instance
|
10239 | */
|
10240 | RecognizeResponse.prototype.totalBilledTime = null;
|
10241 |
|
10242 | /**
|
10243 | * Creates a new RecognizeResponse instance using the specified properties.
|
10244 | * @function create
|
10245 | * @memberof google.cloud.speech.v1p1beta1.RecognizeResponse
|
10246 | * @static
|
10247 | * @param {google.cloud.speech.v1p1beta1.IRecognizeResponse=} [properties] Properties to set
|
10248 | * @returns {google.cloud.speech.v1p1beta1.RecognizeResponse} RecognizeResponse instance
|
10249 | */
|
10250 | RecognizeResponse.create = function create(properties) {
|
10251 | return new RecognizeResponse(properties);
|
10252 | };
|
10253 |
|
10254 | /**
|
10255 | * Encodes the specified RecognizeResponse message. Does not implicitly {@link google.cloud.speech.v1p1beta1.RecognizeResponse.verify|verify} messages.
|
10256 | * @function encode
|
10257 | * @memberof google.cloud.speech.v1p1beta1.RecognizeResponse
|
10258 | * @static
|
10259 | * @param {google.cloud.speech.v1p1beta1.IRecognizeResponse} message RecognizeResponse message or plain object to encode
|
10260 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
10261 | * @returns {$protobuf.Writer} Writer
|
10262 | */
|
10263 | RecognizeResponse.encode = function encode(message, writer) {
|
10264 | if (!writer)
|
10265 | writer = $Writer.create();
|
10266 | if (message.results != null && message.results.length)
|
10267 | for (var i = 0; i < message.results.length; ++i)
|
10268 | $root.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.encode(message.results[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
10269 | if (message.totalBilledTime != null && Object.hasOwnProperty.call(message, "totalBilledTime"))
|
10270 | $root.google.protobuf.Duration.encode(message.totalBilledTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
|
10271 | return writer;
|
10272 | };
|
10273 |
|
10274 | /**
|
10275 | * Encodes the specified RecognizeResponse message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.RecognizeResponse.verify|verify} messages.
|
10276 | * @function encodeDelimited
|
10277 | * @memberof google.cloud.speech.v1p1beta1.RecognizeResponse
|
10278 | * @static
|
10279 | * @param {google.cloud.speech.v1p1beta1.IRecognizeResponse} message RecognizeResponse message or plain object to encode
|
10280 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
10281 | * @returns {$protobuf.Writer} Writer
|
10282 | */
|
10283 | RecognizeResponse.encodeDelimited = function encodeDelimited(message, writer) {
|
10284 | return this.encode(message, writer).ldelim();
|
10285 | };
|
10286 |
|
10287 | /**
|
10288 | * Decodes a RecognizeResponse message from the specified reader or buffer.
|
10289 | * @function decode
|
10290 | * @memberof google.cloud.speech.v1p1beta1.RecognizeResponse
|
10291 | * @static
|
10292 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
10293 | * @param {number} [length] Message length if known beforehand
|
10294 | * @returns {google.cloud.speech.v1p1beta1.RecognizeResponse} RecognizeResponse
|
10295 | * @throws {Error} If the payload is not a reader or valid buffer
|
10296 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
10297 | */
|
10298 | RecognizeResponse.decode = function decode(reader, length) {
|
10299 | if (!(reader instanceof $Reader))
|
10300 | reader = $Reader.create(reader);
|
10301 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.RecognizeResponse();
|
10302 | while (reader.pos < end) {
|
10303 | var tag = reader.uint32();
|
10304 | switch (tag >>> 3) {
|
10305 | case 2:
|
10306 | if (!(message.results && message.results.length))
|
10307 | message.results = [];
|
10308 | message.results.push($root.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.decode(reader, reader.uint32()));
|
10309 | break;
|
10310 | case 3:
|
10311 | message.totalBilledTime = $root.google.protobuf.Duration.decode(reader, reader.uint32());
|
10312 | break;
|
10313 | default:
|
10314 | reader.skipType(tag & 7);
|
10315 | break;
|
10316 | }
|
10317 | }
|
10318 | return message;
|
10319 | };
|
10320 |
|
10321 | /**
|
10322 | * Decodes a RecognizeResponse message from the specified reader or buffer, length delimited.
|
10323 | * @function decodeDelimited
|
10324 | * @memberof google.cloud.speech.v1p1beta1.RecognizeResponse
|
10325 | * @static
|
10326 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
10327 | * @returns {google.cloud.speech.v1p1beta1.RecognizeResponse} RecognizeResponse
|
10328 | * @throws {Error} If the payload is not a reader or valid buffer
|
10329 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
10330 | */
|
10331 | RecognizeResponse.decodeDelimited = function decodeDelimited(reader) {
|
10332 | if (!(reader instanceof $Reader))
|
10333 | reader = new $Reader(reader);
|
10334 | return this.decode(reader, reader.uint32());
|
10335 | };
|
10336 |
|
10337 | /**
|
10338 | * Verifies a RecognizeResponse message.
|
10339 | * @function verify
|
10340 | * @memberof google.cloud.speech.v1p1beta1.RecognizeResponse
|
10341 | * @static
|
10342 | * @param {Object.<string,*>} message Plain object to verify
|
10343 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
10344 | */
|
10345 | RecognizeResponse.verify = function verify(message) {
|
10346 | if (typeof message !== "object" || message === null)
|
10347 | return "object expected";
|
10348 | if (message.results != null && message.hasOwnProperty("results")) {
|
10349 | if (!Array.isArray(message.results))
|
10350 | return "results: array expected";
|
10351 | for (var i = 0; i < message.results.length; ++i) {
|
10352 | var error = $root.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.verify(message.results[i]);
|
10353 | if (error)
|
10354 | return "results." + error;
|
10355 | }
|
10356 | }
|
10357 | if (message.totalBilledTime != null && message.hasOwnProperty("totalBilledTime")) {
|
10358 | var error = $root.google.protobuf.Duration.verify(message.totalBilledTime);
|
10359 | if (error)
|
10360 | return "totalBilledTime." + error;
|
10361 | }
|
10362 | return null;
|
10363 | };
|
10364 |
|
10365 | /**
|
10366 | * Creates a RecognizeResponse message from a plain object. Also converts values to their respective internal types.
|
10367 | * @function fromObject
|
10368 | * @memberof google.cloud.speech.v1p1beta1.RecognizeResponse
|
10369 | * @static
|
10370 | * @param {Object.<string,*>} object Plain object
|
10371 | * @returns {google.cloud.speech.v1p1beta1.RecognizeResponse} RecognizeResponse
|
10372 | */
|
10373 | RecognizeResponse.fromObject = function fromObject(object) {
|
10374 | if (object instanceof $root.google.cloud.speech.v1p1beta1.RecognizeResponse)
|
10375 | return object;
|
10376 | var message = new $root.google.cloud.speech.v1p1beta1.RecognizeResponse();
|
10377 | if (object.results) {
|
10378 | if (!Array.isArray(object.results))
|
10379 | throw TypeError(".google.cloud.speech.v1p1beta1.RecognizeResponse.results: array expected");
|
10380 | message.results = [];
|
10381 | for (var i = 0; i < object.results.length; ++i) {
|
10382 | if (typeof object.results[i] !== "object")
|
10383 | throw TypeError(".google.cloud.speech.v1p1beta1.RecognizeResponse.results: object expected");
|
10384 | message.results[i] = $root.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.fromObject(object.results[i]);
|
10385 | }
|
10386 | }
|
10387 | if (object.totalBilledTime != null) {
|
10388 | if (typeof object.totalBilledTime !== "object")
|
10389 | throw TypeError(".google.cloud.speech.v1p1beta1.RecognizeResponse.totalBilledTime: object expected");
|
10390 | message.totalBilledTime = $root.google.protobuf.Duration.fromObject(object.totalBilledTime);
|
10391 | }
|
10392 | return message;
|
10393 | };
|
10394 |
|
10395 | /**
|
10396 | * Creates a plain object from a RecognizeResponse message. Also converts values to other types if specified.
|
10397 | * @function toObject
|
10398 | * @memberof google.cloud.speech.v1p1beta1.RecognizeResponse
|
10399 | * @static
|
10400 | * @param {google.cloud.speech.v1p1beta1.RecognizeResponse} message RecognizeResponse
|
10401 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
10402 | * @returns {Object.<string,*>} Plain object
|
10403 | */
|
10404 | RecognizeResponse.toObject = function toObject(message, options) {
|
10405 | if (!options)
|
10406 | options = {};
|
10407 | var object = {};
|
10408 | if (options.arrays || options.defaults)
|
10409 | object.results = [];
|
10410 | if (options.defaults)
|
10411 | object.totalBilledTime = null;
|
10412 | if (message.results && message.results.length) {
|
10413 | object.results = [];
|
10414 | for (var j = 0; j < message.results.length; ++j)
|
10415 | object.results[j] = $root.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.toObject(message.results[j], options);
|
10416 | }
|
10417 | if (message.totalBilledTime != null && message.hasOwnProperty("totalBilledTime"))
|
10418 | object.totalBilledTime = $root.google.protobuf.Duration.toObject(message.totalBilledTime, options);
|
10419 | return object;
|
10420 | };
|
10421 |
|
10422 | /**
|
10423 | * Converts this RecognizeResponse to JSON.
|
10424 | * @function toJSON
|
10425 | * @memberof google.cloud.speech.v1p1beta1.RecognizeResponse
|
10426 | * @instance
|
10427 | * @returns {Object.<string,*>} JSON object
|
10428 | */
|
10429 | RecognizeResponse.prototype.toJSON = function toJSON() {
|
10430 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
10431 | };
|
10432 |
|
10433 | return RecognizeResponse;
|
10434 | })();
|
10435 |
|
10436 | v1p1beta1.LongRunningRecognizeResponse = (function() {
|
10437 |
|
10438 | /**
|
10439 | * Properties of a LongRunningRecognizeResponse.
|
10440 | * @memberof google.cloud.speech.v1p1beta1
|
10441 | * @interface ILongRunningRecognizeResponse
|
10442 | * @property {Array.<google.cloud.speech.v1p1beta1.ISpeechRecognitionResult>|null} [results] LongRunningRecognizeResponse results
|
10443 | * @property {google.protobuf.IDuration|null} [totalBilledTime] LongRunningRecognizeResponse totalBilledTime
|
10444 | * @property {google.cloud.speech.v1p1beta1.ITranscriptOutputConfig|null} [outputConfig] LongRunningRecognizeResponse outputConfig
|
10445 | * @property {google.rpc.IStatus|null} [outputError] LongRunningRecognizeResponse outputError
|
10446 | */
|
10447 |
|
10448 | /**
|
10449 | * Constructs a new LongRunningRecognizeResponse.
|
10450 | * @memberof google.cloud.speech.v1p1beta1
|
10451 | * @classdesc Represents a LongRunningRecognizeResponse.
|
10452 | * @implements ILongRunningRecognizeResponse
|
10453 | * @constructor
|
10454 | * @param {google.cloud.speech.v1p1beta1.ILongRunningRecognizeResponse=} [properties] Properties to set
|
10455 | */
|
10456 | function LongRunningRecognizeResponse(properties) {
|
10457 | this.results = [];
|
10458 | if (properties)
|
10459 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
10460 | if (properties[keys[i]] != null)
|
10461 | this[keys[i]] = properties[keys[i]];
|
10462 | }
|
10463 |
|
10464 | /**
|
10465 | * LongRunningRecognizeResponse results.
|
10466 | * @member {Array.<google.cloud.speech.v1p1beta1.ISpeechRecognitionResult>} results
|
10467 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse
|
10468 | * @instance
|
10469 | */
|
10470 | LongRunningRecognizeResponse.prototype.results = $util.emptyArray;
|
10471 |
|
10472 | /**
|
10473 | * LongRunningRecognizeResponse totalBilledTime.
|
10474 | * @member {google.protobuf.IDuration|null|undefined} totalBilledTime
|
10475 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse
|
10476 | * @instance
|
10477 | */
|
10478 | LongRunningRecognizeResponse.prototype.totalBilledTime = null;
|
10479 |
|
10480 | /**
|
10481 | * LongRunningRecognizeResponse outputConfig.
|
10482 | * @member {google.cloud.speech.v1p1beta1.ITranscriptOutputConfig|null|undefined} outputConfig
|
10483 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse
|
10484 | * @instance
|
10485 | */
|
10486 | LongRunningRecognizeResponse.prototype.outputConfig = null;
|
10487 |
|
10488 | /**
|
10489 | * LongRunningRecognizeResponse outputError.
|
10490 | * @member {google.rpc.IStatus|null|undefined} outputError
|
10491 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse
|
10492 | * @instance
|
10493 | */
|
10494 | LongRunningRecognizeResponse.prototype.outputError = null;
|
10495 |
|
10496 | /**
|
10497 | * Creates a new LongRunningRecognizeResponse instance using the specified properties.
|
10498 | * @function create
|
10499 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse
|
10500 | * @static
|
10501 | * @param {google.cloud.speech.v1p1beta1.ILongRunningRecognizeResponse=} [properties] Properties to set
|
10502 | * @returns {google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse} LongRunningRecognizeResponse instance
|
10503 | */
|
10504 | LongRunningRecognizeResponse.create = function create(properties) {
|
10505 | return new LongRunningRecognizeResponse(properties);
|
10506 | };
|
10507 |
|
10508 | /**
|
10509 | * Encodes the specified LongRunningRecognizeResponse message. Does not implicitly {@link google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse.verify|verify} messages.
|
10510 | * @function encode
|
10511 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse
|
10512 | * @static
|
10513 | * @param {google.cloud.speech.v1p1beta1.ILongRunningRecognizeResponse} message LongRunningRecognizeResponse message or plain object to encode
|
10514 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
10515 | * @returns {$protobuf.Writer} Writer
|
10516 | */
|
10517 | LongRunningRecognizeResponse.encode = function encode(message, writer) {
|
10518 | if (!writer)
|
10519 | writer = $Writer.create();
|
10520 | if (message.results != null && message.results.length)
|
10521 | for (var i = 0; i < message.results.length; ++i)
|
10522 | $root.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.encode(message.results[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
10523 | if (message.totalBilledTime != null && Object.hasOwnProperty.call(message, "totalBilledTime"))
|
10524 | $root.google.protobuf.Duration.encode(message.totalBilledTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
|
10525 | if (message.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig"))
|
10526 | $root.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.encode(message.outputConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
|
10527 | if (message.outputError != null && Object.hasOwnProperty.call(message, "outputError"))
|
10528 | $root.google.rpc.Status.encode(message.outputError, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();
|
10529 | return writer;
|
10530 | };
|
10531 |
|
10532 | /**
|
10533 | * Encodes the specified LongRunningRecognizeResponse message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse.verify|verify} messages.
|
10534 | * @function encodeDelimited
|
10535 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse
|
10536 | * @static
|
10537 | * @param {google.cloud.speech.v1p1beta1.ILongRunningRecognizeResponse} message LongRunningRecognizeResponse message or plain object to encode
|
10538 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
10539 | * @returns {$protobuf.Writer} Writer
|
10540 | */
|
10541 | LongRunningRecognizeResponse.encodeDelimited = function encodeDelimited(message, writer) {
|
10542 | return this.encode(message, writer).ldelim();
|
10543 | };
|
10544 |
|
10545 | /**
|
10546 | * Decodes a LongRunningRecognizeResponse message from the specified reader or buffer.
|
10547 | * @function decode
|
10548 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse
|
10549 | * @static
|
10550 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
10551 | * @param {number} [length] Message length if known beforehand
|
10552 | * @returns {google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse} LongRunningRecognizeResponse
|
10553 | * @throws {Error} If the payload is not a reader or valid buffer
|
10554 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
10555 | */
|
10556 | LongRunningRecognizeResponse.decode = function decode(reader, length) {
|
10557 | if (!(reader instanceof $Reader))
|
10558 | reader = $Reader.create(reader);
|
10559 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse();
|
10560 | while (reader.pos < end) {
|
10561 | var tag = reader.uint32();
|
10562 | switch (tag >>> 3) {
|
10563 | case 2:
|
10564 | if (!(message.results && message.results.length))
|
10565 | message.results = [];
|
10566 | message.results.push($root.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.decode(reader, reader.uint32()));
|
10567 | break;
|
10568 | case 3:
|
10569 | message.totalBilledTime = $root.google.protobuf.Duration.decode(reader, reader.uint32());
|
10570 | break;
|
10571 | case 6:
|
10572 | message.outputConfig = $root.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.decode(reader, reader.uint32());
|
10573 | break;
|
10574 | case 7:
|
10575 | message.outputError = $root.google.rpc.Status.decode(reader, reader.uint32());
|
10576 | break;
|
10577 | default:
|
10578 | reader.skipType(tag & 7);
|
10579 | break;
|
10580 | }
|
10581 | }
|
10582 | return message;
|
10583 | };
|
10584 |
|
10585 | /**
|
10586 | * Decodes a LongRunningRecognizeResponse message from the specified reader or buffer, length delimited.
|
10587 | * @function decodeDelimited
|
10588 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse
|
10589 | * @static
|
10590 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
10591 | * @returns {google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse} LongRunningRecognizeResponse
|
10592 | * @throws {Error} If the payload is not a reader or valid buffer
|
10593 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
10594 | */
|
10595 | LongRunningRecognizeResponse.decodeDelimited = function decodeDelimited(reader) {
|
10596 | if (!(reader instanceof $Reader))
|
10597 | reader = new $Reader(reader);
|
10598 | return this.decode(reader, reader.uint32());
|
10599 | };
|
10600 |
|
10601 | /**
|
10602 | * Verifies a LongRunningRecognizeResponse message.
|
10603 | * @function verify
|
10604 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse
|
10605 | * @static
|
10606 | * @param {Object.<string,*>} message Plain object to verify
|
10607 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
10608 | */
|
10609 | LongRunningRecognizeResponse.verify = function verify(message) {
|
10610 | if (typeof message !== "object" || message === null)
|
10611 | return "object expected";
|
10612 | if (message.results != null && message.hasOwnProperty("results")) {
|
10613 | if (!Array.isArray(message.results))
|
10614 | return "results: array expected";
|
10615 | for (var i = 0; i < message.results.length; ++i) {
|
10616 | var error = $root.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.verify(message.results[i]);
|
10617 | if (error)
|
10618 | return "results." + error;
|
10619 | }
|
10620 | }
|
10621 | if (message.totalBilledTime != null && message.hasOwnProperty("totalBilledTime")) {
|
10622 | var error = $root.google.protobuf.Duration.verify(message.totalBilledTime);
|
10623 | if (error)
|
10624 | return "totalBilledTime." + error;
|
10625 | }
|
10626 | if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) {
|
10627 | var error = $root.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.verify(message.outputConfig);
|
10628 | if (error)
|
10629 | return "outputConfig." + error;
|
10630 | }
|
10631 | if (message.outputError != null && message.hasOwnProperty("outputError")) {
|
10632 | var error = $root.google.rpc.Status.verify(message.outputError);
|
10633 | if (error)
|
10634 | return "outputError." + error;
|
10635 | }
|
10636 | return null;
|
10637 | };
|
10638 |
|
10639 | /**
|
10640 | * Creates a LongRunningRecognizeResponse message from a plain object. Also converts values to their respective internal types.
|
10641 | * @function fromObject
|
10642 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse
|
10643 | * @static
|
10644 | * @param {Object.<string,*>} object Plain object
|
10645 | * @returns {google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse} LongRunningRecognizeResponse
|
10646 | */
|
10647 | LongRunningRecognizeResponse.fromObject = function fromObject(object) {
|
10648 | if (object instanceof $root.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse)
|
10649 | return object;
|
10650 | var message = new $root.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse();
|
10651 | if (object.results) {
|
10652 | if (!Array.isArray(object.results))
|
10653 | throw TypeError(".google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse.results: array expected");
|
10654 | message.results = [];
|
10655 | for (var i = 0; i < object.results.length; ++i) {
|
10656 | if (typeof object.results[i] !== "object")
|
10657 | throw TypeError(".google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse.results: object expected");
|
10658 | message.results[i] = $root.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.fromObject(object.results[i]);
|
10659 | }
|
10660 | }
|
10661 | if (object.totalBilledTime != null) {
|
10662 | if (typeof object.totalBilledTime !== "object")
|
10663 | throw TypeError(".google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse.totalBilledTime: object expected");
|
10664 | message.totalBilledTime = $root.google.protobuf.Duration.fromObject(object.totalBilledTime);
|
10665 | }
|
10666 | if (object.outputConfig != null) {
|
10667 | if (typeof object.outputConfig !== "object")
|
10668 | throw TypeError(".google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse.outputConfig: object expected");
|
10669 | message.outputConfig = $root.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.fromObject(object.outputConfig);
|
10670 | }
|
10671 | if (object.outputError != null) {
|
10672 | if (typeof object.outputError !== "object")
|
10673 | throw TypeError(".google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse.outputError: object expected");
|
10674 | message.outputError = $root.google.rpc.Status.fromObject(object.outputError);
|
10675 | }
|
10676 | return message;
|
10677 | };
|
10678 |
|
10679 | /**
|
10680 | * Creates a plain object from a LongRunningRecognizeResponse message. Also converts values to other types if specified.
|
10681 | * @function toObject
|
10682 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse
|
10683 | * @static
|
10684 | * @param {google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse} message LongRunningRecognizeResponse
|
10685 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
10686 | * @returns {Object.<string,*>} Plain object
|
10687 | */
|
10688 | LongRunningRecognizeResponse.toObject = function toObject(message, options) {
|
10689 | if (!options)
|
10690 | options = {};
|
10691 | var object = {};
|
10692 | if (options.arrays || options.defaults)
|
10693 | object.results = [];
|
10694 | if (options.defaults) {
|
10695 | object.totalBilledTime = null;
|
10696 | object.outputConfig = null;
|
10697 | object.outputError = null;
|
10698 | }
|
10699 | if (message.results && message.results.length) {
|
10700 | object.results = [];
|
10701 | for (var j = 0; j < message.results.length; ++j)
|
10702 | object.results[j] = $root.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.toObject(message.results[j], options);
|
10703 | }
|
10704 | if (message.totalBilledTime != null && message.hasOwnProperty("totalBilledTime"))
|
10705 | object.totalBilledTime = $root.google.protobuf.Duration.toObject(message.totalBilledTime, options);
|
10706 | if (message.outputConfig != null && message.hasOwnProperty("outputConfig"))
|
10707 | object.outputConfig = $root.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.toObject(message.outputConfig, options);
|
10708 | if (message.outputError != null && message.hasOwnProperty("outputError"))
|
10709 | object.outputError = $root.google.rpc.Status.toObject(message.outputError, options);
|
10710 | return object;
|
10711 | };
|
10712 |
|
10713 | /**
|
10714 | * Converts this LongRunningRecognizeResponse to JSON.
|
10715 | * @function toJSON
|
10716 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse
|
10717 | * @instance
|
10718 | * @returns {Object.<string,*>} JSON object
|
10719 | */
|
10720 | LongRunningRecognizeResponse.prototype.toJSON = function toJSON() {
|
10721 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
10722 | };
|
10723 |
|
10724 | return LongRunningRecognizeResponse;
|
10725 | })();
|
10726 |
|
10727 | v1p1beta1.LongRunningRecognizeMetadata = (function() {
|
10728 |
|
10729 | /**
|
10730 | * Properties of a LongRunningRecognizeMetadata.
|
10731 | * @memberof google.cloud.speech.v1p1beta1
|
10732 | * @interface ILongRunningRecognizeMetadata
|
10733 | * @property {number|null} [progressPercent] LongRunningRecognizeMetadata progressPercent
|
10734 | * @property {google.protobuf.ITimestamp|null} [startTime] LongRunningRecognizeMetadata startTime
|
10735 | * @property {google.protobuf.ITimestamp|null} [lastUpdateTime] LongRunningRecognizeMetadata lastUpdateTime
|
10736 | * @property {string|null} [uri] LongRunningRecognizeMetadata uri
|
10737 | * @property {google.cloud.speech.v1p1beta1.ITranscriptOutputConfig|null} [outputConfig] LongRunningRecognizeMetadata outputConfig
|
10738 | */
|
10739 |
|
10740 | /**
|
10741 | * Constructs a new LongRunningRecognizeMetadata.
|
10742 | * @memberof google.cloud.speech.v1p1beta1
|
10743 | * @classdesc Represents a LongRunningRecognizeMetadata.
|
10744 | * @implements ILongRunningRecognizeMetadata
|
10745 | * @constructor
|
10746 | * @param {google.cloud.speech.v1p1beta1.ILongRunningRecognizeMetadata=} [properties] Properties to set
|
10747 | */
|
10748 | function LongRunningRecognizeMetadata(properties) {
|
10749 | if (properties)
|
10750 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
10751 | if (properties[keys[i]] != null)
|
10752 | this[keys[i]] = properties[keys[i]];
|
10753 | }
|
10754 |
|
10755 | /**
|
10756 | * LongRunningRecognizeMetadata progressPercent.
|
10757 | * @member {number} progressPercent
|
10758 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata
|
10759 | * @instance
|
10760 | */
|
10761 | LongRunningRecognizeMetadata.prototype.progressPercent = 0;
|
10762 |
|
10763 | /**
|
10764 | * LongRunningRecognizeMetadata startTime.
|
10765 | * @member {google.protobuf.ITimestamp|null|undefined} startTime
|
10766 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata
|
10767 | * @instance
|
10768 | */
|
10769 | LongRunningRecognizeMetadata.prototype.startTime = null;
|
10770 |
|
10771 | /**
|
10772 | * LongRunningRecognizeMetadata lastUpdateTime.
|
10773 | * @member {google.protobuf.ITimestamp|null|undefined} lastUpdateTime
|
10774 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata
|
10775 | * @instance
|
10776 | */
|
10777 | LongRunningRecognizeMetadata.prototype.lastUpdateTime = null;
|
10778 |
|
10779 | /**
|
10780 | * LongRunningRecognizeMetadata uri.
|
10781 | * @member {string} uri
|
10782 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata
|
10783 | * @instance
|
10784 | */
|
10785 | LongRunningRecognizeMetadata.prototype.uri = "";
|
10786 |
|
10787 | /**
|
10788 | * LongRunningRecognizeMetadata outputConfig.
|
10789 | * @member {google.cloud.speech.v1p1beta1.ITranscriptOutputConfig|null|undefined} outputConfig
|
10790 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata
|
10791 | * @instance
|
10792 | */
|
10793 | LongRunningRecognizeMetadata.prototype.outputConfig = null;
|
10794 |
|
10795 | /**
|
10796 | * Creates a new LongRunningRecognizeMetadata instance using the specified properties.
|
10797 | * @function create
|
10798 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata
|
10799 | * @static
|
10800 | * @param {google.cloud.speech.v1p1beta1.ILongRunningRecognizeMetadata=} [properties] Properties to set
|
10801 | * @returns {google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata} LongRunningRecognizeMetadata instance
|
10802 | */
|
10803 | LongRunningRecognizeMetadata.create = function create(properties) {
|
10804 | return new LongRunningRecognizeMetadata(properties);
|
10805 | };
|
10806 |
|
10807 | /**
|
10808 | * Encodes the specified LongRunningRecognizeMetadata message. Does not implicitly {@link google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata.verify|verify} messages.
|
10809 | * @function encode
|
10810 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata
|
10811 | * @static
|
10812 | * @param {google.cloud.speech.v1p1beta1.ILongRunningRecognizeMetadata} message LongRunningRecognizeMetadata message or plain object to encode
|
10813 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
10814 | * @returns {$protobuf.Writer} Writer
|
10815 | */
|
10816 | LongRunningRecognizeMetadata.encode = function encode(message, writer) {
|
10817 | if (!writer)
|
10818 | writer = $Writer.create();
|
10819 | if (message.progressPercent != null && Object.hasOwnProperty.call(message, "progressPercent"))
|
10820 | writer.uint32(/* id 1, wireType 0 =*/8).int32(message.progressPercent);
|
10821 | if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime"))
|
10822 | $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
10823 | if (message.lastUpdateTime != null && Object.hasOwnProperty.call(message, "lastUpdateTime"))
|
10824 | $root.google.protobuf.Timestamp.encode(message.lastUpdateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
|
10825 | if (message.uri != null && Object.hasOwnProperty.call(message, "uri"))
|
10826 | writer.uint32(/* id 4, wireType 2 =*/34).string(message.uri);
|
10827 | if (message.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig"))
|
10828 | $root.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.encode(message.outputConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
|
10829 | return writer;
|
10830 | };
|
10831 |
|
10832 | /**
|
10833 | * Encodes the specified LongRunningRecognizeMetadata message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata.verify|verify} messages.
|
10834 | * @function encodeDelimited
|
10835 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata
|
10836 | * @static
|
10837 | * @param {google.cloud.speech.v1p1beta1.ILongRunningRecognizeMetadata} message LongRunningRecognizeMetadata message or plain object to encode
|
10838 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
10839 | * @returns {$protobuf.Writer} Writer
|
10840 | */
|
10841 | LongRunningRecognizeMetadata.encodeDelimited = function encodeDelimited(message, writer) {
|
10842 | return this.encode(message, writer).ldelim();
|
10843 | };
|
10844 |
|
10845 | /**
|
10846 | * Decodes a LongRunningRecognizeMetadata message from the specified reader or buffer.
|
10847 | * @function decode
|
10848 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata
|
10849 | * @static
|
10850 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
10851 | * @param {number} [length] Message length if known beforehand
|
10852 | * @returns {google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata} LongRunningRecognizeMetadata
|
10853 | * @throws {Error} If the payload is not a reader or valid buffer
|
10854 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
10855 | */
|
10856 | LongRunningRecognizeMetadata.decode = function decode(reader, length) {
|
10857 | if (!(reader instanceof $Reader))
|
10858 | reader = $Reader.create(reader);
|
10859 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata();
|
10860 | while (reader.pos < end) {
|
10861 | var tag = reader.uint32();
|
10862 | switch (tag >>> 3) {
|
10863 | case 1:
|
10864 | message.progressPercent = reader.int32();
|
10865 | break;
|
10866 | case 2:
|
10867 | message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
|
10868 | break;
|
10869 | case 3:
|
10870 | message.lastUpdateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
|
10871 | break;
|
10872 | case 4:
|
10873 | message.uri = reader.string();
|
10874 | break;
|
10875 | case 5:
|
10876 | message.outputConfig = $root.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.decode(reader, reader.uint32());
|
10877 | break;
|
10878 | default:
|
10879 | reader.skipType(tag & 7);
|
10880 | break;
|
10881 | }
|
10882 | }
|
10883 | return message;
|
10884 | };
|
10885 |
|
10886 | /**
|
10887 | * Decodes a LongRunningRecognizeMetadata message from the specified reader or buffer, length delimited.
|
10888 | * @function decodeDelimited
|
10889 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata
|
10890 | * @static
|
10891 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
10892 | * @returns {google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata} LongRunningRecognizeMetadata
|
10893 | * @throws {Error} If the payload is not a reader or valid buffer
|
10894 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
10895 | */
|
10896 | LongRunningRecognizeMetadata.decodeDelimited = function decodeDelimited(reader) {
|
10897 | if (!(reader instanceof $Reader))
|
10898 | reader = new $Reader(reader);
|
10899 | return this.decode(reader, reader.uint32());
|
10900 | };
|
10901 |
|
10902 | /**
|
10903 | * Verifies a LongRunningRecognizeMetadata message.
|
10904 | * @function verify
|
10905 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata
|
10906 | * @static
|
10907 | * @param {Object.<string,*>} message Plain object to verify
|
10908 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
10909 | */
|
10910 | LongRunningRecognizeMetadata.verify = function verify(message) {
|
10911 | if (typeof message !== "object" || message === null)
|
10912 | return "object expected";
|
10913 | if (message.progressPercent != null && message.hasOwnProperty("progressPercent"))
|
10914 | if (!$util.isInteger(message.progressPercent))
|
10915 | return "progressPercent: integer expected";
|
10916 | if (message.startTime != null && message.hasOwnProperty("startTime")) {
|
10917 | var error = $root.google.protobuf.Timestamp.verify(message.startTime);
|
10918 | if (error)
|
10919 | return "startTime." + error;
|
10920 | }
|
10921 | if (message.lastUpdateTime != null && message.hasOwnProperty("lastUpdateTime")) {
|
10922 | var error = $root.google.protobuf.Timestamp.verify(message.lastUpdateTime);
|
10923 | if (error)
|
10924 | return "lastUpdateTime." + error;
|
10925 | }
|
10926 | if (message.uri != null && message.hasOwnProperty("uri"))
|
10927 | if (!$util.isString(message.uri))
|
10928 | return "uri: string expected";
|
10929 | if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) {
|
10930 | var error = $root.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.verify(message.outputConfig);
|
10931 | if (error)
|
10932 | return "outputConfig." + error;
|
10933 | }
|
10934 | return null;
|
10935 | };
|
10936 |
|
10937 | /**
|
10938 | * Creates a LongRunningRecognizeMetadata message from a plain object. Also converts values to their respective internal types.
|
10939 | * @function fromObject
|
10940 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata
|
10941 | * @static
|
10942 | * @param {Object.<string,*>} object Plain object
|
10943 | * @returns {google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata} LongRunningRecognizeMetadata
|
10944 | */
|
10945 | LongRunningRecognizeMetadata.fromObject = function fromObject(object) {
|
10946 | if (object instanceof $root.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata)
|
10947 | return object;
|
10948 | var message = new $root.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata();
|
10949 | if (object.progressPercent != null)
|
10950 | message.progressPercent = object.progressPercent | 0;
|
10951 | if (object.startTime != null) {
|
10952 | if (typeof object.startTime !== "object")
|
10953 | throw TypeError(".google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata.startTime: object expected");
|
10954 | message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime);
|
10955 | }
|
10956 | if (object.lastUpdateTime != null) {
|
10957 | if (typeof object.lastUpdateTime !== "object")
|
10958 | throw TypeError(".google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata.lastUpdateTime: object expected");
|
10959 | message.lastUpdateTime = $root.google.protobuf.Timestamp.fromObject(object.lastUpdateTime);
|
10960 | }
|
10961 | if (object.uri != null)
|
10962 | message.uri = String(object.uri);
|
10963 | if (object.outputConfig != null) {
|
10964 | if (typeof object.outputConfig !== "object")
|
10965 | throw TypeError(".google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata.outputConfig: object expected");
|
10966 | message.outputConfig = $root.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.fromObject(object.outputConfig);
|
10967 | }
|
10968 | return message;
|
10969 | };
|
10970 |
|
10971 | /**
|
10972 | * Creates a plain object from a LongRunningRecognizeMetadata message. Also converts values to other types if specified.
|
10973 | * @function toObject
|
10974 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata
|
10975 | * @static
|
10976 | * @param {google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata} message LongRunningRecognizeMetadata
|
10977 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
10978 | * @returns {Object.<string,*>} Plain object
|
10979 | */
|
10980 | LongRunningRecognizeMetadata.toObject = function toObject(message, options) {
|
10981 | if (!options)
|
10982 | options = {};
|
10983 | var object = {};
|
10984 | if (options.defaults) {
|
10985 | object.progressPercent = 0;
|
10986 | object.startTime = null;
|
10987 | object.lastUpdateTime = null;
|
10988 | object.uri = "";
|
10989 | object.outputConfig = null;
|
10990 | }
|
10991 | if (message.progressPercent != null && message.hasOwnProperty("progressPercent"))
|
10992 | object.progressPercent = message.progressPercent;
|
10993 | if (message.startTime != null && message.hasOwnProperty("startTime"))
|
10994 | object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options);
|
10995 | if (message.lastUpdateTime != null && message.hasOwnProperty("lastUpdateTime"))
|
10996 | object.lastUpdateTime = $root.google.protobuf.Timestamp.toObject(message.lastUpdateTime, options);
|
10997 | if (message.uri != null && message.hasOwnProperty("uri"))
|
10998 | object.uri = message.uri;
|
10999 | if (message.outputConfig != null && message.hasOwnProperty("outputConfig"))
|
11000 | object.outputConfig = $root.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.toObject(message.outputConfig, options);
|
11001 | return object;
|
11002 | };
|
11003 |
|
11004 | /**
|
11005 | * Converts this LongRunningRecognizeMetadata to JSON.
|
11006 | * @function toJSON
|
11007 | * @memberof google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata
|
11008 | * @instance
|
11009 | * @returns {Object.<string,*>} JSON object
|
11010 | */
|
11011 | LongRunningRecognizeMetadata.prototype.toJSON = function toJSON() {
|
11012 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
11013 | };
|
11014 |
|
11015 | return LongRunningRecognizeMetadata;
|
11016 | })();
|
11017 |
|
11018 | v1p1beta1.StreamingRecognizeResponse = (function() {
|
11019 |
|
11020 | /**
|
11021 | * Properties of a StreamingRecognizeResponse.
|
11022 | * @memberof google.cloud.speech.v1p1beta1
|
11023 | * @interface IStreamingRecognizeResponse
|
11024 | * @property {google.rpc.IStatus|null} [error] StreamingRecognizeResponse error
|
11025 | * @property {Array.<google.cloud.speech.v1p1beta1.IStreamingRecognitionResult>|null} [results] StreamingRecognizeResponse results
|
11026 | * @property {google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType|null} [speechEventType] StreamingRecognizeResponse speechEventType
|
11027 | * @property {google.protobuf.IDuration|null} [totalBilledTime] StreamingRecognizeResponse totalBilledTime
|
11028 | */
|
11029 |
|
11030 | /**
|
11031 | * Constructs a new StreamingRecognizeResponse.
|
11032 | * @memberof google.cloud.speech.v1p1beta1
|
11033 | * @classdesc Represents a StreamingRecognizeResponse.
|
11034 | * @implements IStreamingRecognizeResponse
|
11035 | * @constructor
|
11036 | * @param {google.cloud.speech.v1p1beta1.IStreamingRecognizeResponse=} [properties] Properties to set
|
11037 | */
|
11038 | function StreamingRecognizeResponse(properties) {
|
11039 | this.results = [];
|
11040 | if (properties)
|
11041 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
11042 | if (properties[keys[i]] != null)
|
11043 | this[keys[i]] = properties[keys[i]];
|
11044 | }
|
11045 |
|
11046 | /**
|
11047 | * StreamingRecognizeResponse error.
|
11048 | * @member {google.rpc.IStatus|null|undefined} error
|
11049 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeResponse
|
11050 | * @instance
|
11051 | */
|
11052 | StreamingRecognizeResponse.prototype.error = null;
|
11053 |
|
11054 | /**
|
11055 | * StreamingRecognizeResponse results.
|
11056 | * @member {Array.<google.cloud.speech.v1p1beta1.IStreamingRecognitionResult>} results
|
11057 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeResponse
|
11058 | * @instance
|
11059 | */
|
11060 | StreamingRecognizeResponse.prototype.results = $util.emptyArray;
|
11061 |
|
11062 | /**
|
11063 | * StreamingRecognizeResponse speechEventType.
|
11064 | * @member {google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType} speechEventType
|
11065 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeResponse
|
11066 | * @instance
|
11067 | */
|
11068 | StreamingRecognizeResponse.prototype.speechEventType = 0;
|
11069 |
|
11070 | /**
|
11071 | * StreamingRecognizeResponse totalBilledTime.
|
11072 | * @member {google.protobuf.IDuration|null|undefined} totalBilledTime
|
11073 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeResponse
|
11074 | * @instance
|
11075 | */
|
11076 | StreamingRecognizeResponse.prototype.totalBilledTime = null;
|
11077 |
|
11078 | /**
|
11079 | * Creates a new StreamingRecognizeResponse instance using the specified properties.
|
11080 | * @function create
|
11081 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeResponse
|
11082 | * @static
|
11083 | * @param {google.cloud.speech.v1p1beta1.IStreamingRecognizeResponse=} [properties] Properties to set
|
11084 | * @returns {google.cloud.speech.v1p1beta1.StreamingRecognizeResponse} StreamingRecognizeResponse instance
|
11085 | */
|
11086 | StreamingRecognizeResponse.create = function create(properties) {
|
11087 | return new StreamingRecognizeResponse(properties);
|
11088 | };
|
11089 |
|
11090 | /**
|
11091 | * Encodes the specified StreamingRecognizeResponse message. Does not implicitly {@link google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.verify|verify} messages.
|
11092 | * @function encode
|
11093 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeResponse
|
11094 | * @static
|
11095 | * @param {google.cloud.speech.v1p1beta1.IStreamingRecognizeResponse} message StreamingRecognizeResponse message or plain object to encode
|
11096 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
11097 | * @returns {$protobuf.Writer} Writer
|
11098 | */
|
11099 | StreamingRecognizeResponse.encode = function encode(message, writer) {
|
11100 | if (!writer)
|
11101 | writer = $Writer.create();
|
11102 | if (message.error != null && Object.hasOwnProperty.call(message, "error"))
|
11103 | $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
11104 | if (message.results != null && message.results.length)
|
11105 | for (var i = 0; i < message.results.length; ++i)
|
11106 | $root.google.cloud.speech.v1p1beta1.StreamingRecognitionResult.encode(message.results[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
11107 | if (message.speechEventType != null && Object.hasOwnProperty.call(message, "speechEventType"))
|
11108 | writer.uint32(/* id 4, wireType 0 =*/32).int32(message.speechEventType);
|
11109 | if (message.totalBilledTime != null && Object.hasOwnProperty.call(message, "totalBilledTime"))
|
11110 | $root.google.protobuf.Duration.encode(message.totalBilledTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
|
11111 | return writer;
|
11112 | };
|
11113 |
|
11114 | /**
|
11115 | * Encodes the specified StreamingRecognizeResponse message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.verify|verify} messages.
|
11116 | * @function encodeDelimited
|
11117 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeResponse
|
11118 | * @static
|
11119 | * @param {google.cloud.speech.v1p1beta1.IStreamingRecognizeResponse} message StreamingRecognizeResponse message or plain object to encode
|
11120 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
11121 | * @returns {$protobuf.Writer} Writer
|
11122 | */
|
11123 | StreamingRecognizeResponse.encodeDelimited = function encodeDelimited(message, writer) {
|
11124 | return this.encode(message, writer).ldelim();
|
11125 | };
|
11126 |
|
11127 | /**
|
11128 | * Decodes a StreamingRecognizeResponse message from the specified reader or buffer.
|
11129 | * @function decode
|
11130 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeResponse
|
11131 | * @static
|
11132 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
11133 | * @param {number} [length] Message length if known beforehand
|
11134 | * @returns {google.cloud.speech.v1p1beta1.StreamingRecognizeResponse} StreamingRecognizeResponse
|
11135 | * @throws {Error} If the payload is not a reader or valid buffer
|
11136 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
11137 | */
|
11138 | StreamingRecognizeResponse.decode = function decode(reader, length) {
|
11139 | if (!(reader instanceof $Reader))
|
11140 | reader = $Reader.create(reader);
|
11141 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse();
|
11142 | while (reader.pos < end) {
|
11143 | var tag = reader.uint32();
|
11144 | switch (tag >>> 3) {
|
11145 | case 1:
|
11146 | message.error = $root.google.rpc.Status.decode(reader, reader.uint32());
|
11147 | break;
|
11148 | case 2:
|
11149 | if (!(message.results && message.results.length))
|
11150 | message.results = [];
|
11151 | message.results.push($root.google.cloud.speech.v1p1beta1.StreamingRecognitionResult.decode(reader, reader.uint32()));
|
11152 | break;
|
11153 | case 4:
|
11154 | message.speechEventType = reader.int32();
|
11155 | break;
|
11156 | case 5:
|
11157 | message.totalBilledTime = $root.google.protobuf.Duration.decode(reader, reader.uint32());
|
11158 | break;
|
11159 | default:
|
11160 | reader.skipType(tag & 7);
|
11161 | break;
|
11162 | }
|
11163 | }
|
11164 | return message;
|
11165 | };
|
11166 |
|
11167 | /**
|
11168 | * Decodes a StreamingRecognizeResponse message from the specified reader or buffer, length delimited.
|
11169 | * @function decodeDelimited
|
11170 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeResponse
|
11171 | * @static
|
11172 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
11173 | * @returns {google.cloud.speech.v1p1beta1.StreamingRecognizeResponse} StreamingRecognizeResponse
|
11174 | * @throws {Error} If the payload is not a reader or valid buffer
|
11175 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
11176 | */
|
11177 | StreamingRecognizeResponse.decodeDelimited = function decodeDelimited(reader) {
|
11178 | if (!(reader instanceof $Reader))
|
11179 | reader = new $Reader(reader);
|
11180 | return this.decode(reader, reader.uint32());
|
11181 | };
|
11182 |
|
11183 | /**
|
11184 | * Verifies a StreamingRecognizeResponse message.
|
11185 | * @function verify
|
11186 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeResponse
|
11187 | * @static
|
11188 | * @param {Object.<string,*>} message Plain object to verify
|
11189 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
11190 | */
|
11191 | StreamingRecognizeResponse.verify = function verify(message) {
|
11192 | if (typeof message !== "object" || message === null)
|
11193 | return "object expected";
|
11194 | if (message.error != null && message.hasOwnProperty("error")) {
|
11195 | var error = $root.google.rpc.Status.verify(message.error);
|
11196 | if (error)
|
11197 | return "error." + error;
|
11198 | }
|
11199 | if (message.results != null && message.hasOwnProperty("results")) {
|
11200 | if (!Array.isArray(message.results))
|
11201 | return "results: array expected";
|
11202 | for (var i = 0; i < message.results.length; ++i) {
|
11203 | var error = $root.google.cloud.speech.v1p1beta1.StreamingRecognitionResult.verify(message.results[i]);
|
11204 | if (error)
|
11205 | return "results." + error;
|
11206 | }
|
11207 | }
|
11208 | if (message.speechEventType != null && message.hasOwnProperty("speechEventType"))
|
11209 | switch (message.speechEventType) {
|
11210 | default:
|
11211 | return "speechEventType: enum value expected";
|
11212 | case 0:
|
11213 | case 1:
|
11214 | break;
|
11215 | }
|
11216 | if (message.totalBilledTime != null && message.hasOwnProperty("totalBilledTime")) {
|
11217 | var error = $root.google.protobuf.Duration.verify(message.totalBilledTime);
|
11218 | if (error)
|
11219 | return "totalBilledTime." + error;
|
11220 | }
|
11221 | return null;
|
11222 | };
|
11223 |
|
11224 | /**
|
11225 | * Creates a StreamingRecognizeResponse message from a plain object. Also converts values to their respective internal types.
|
11226 | * @function fromObject
|
11227 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeResponse
|
11228 | * @static
|
11229 | * @param {Object.<string,*>} object Plain object
|
11230 | * @returns {google.cloud.speech.v1p1beta1.StreamingRecognizeResponse} StreamingRecognizeResponse
|
11231 | */
|
11232 | StreamingRecognizeResponse.fromObject = function fromObject(object) {
|
11233 | if (object instanceof $root.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse)
|
11234 | return object;
|
11235 | var message = new $root.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse();
|
11236 | if (object.error != null) {
|
11237 | if (typeof object.error !== "object")
|
11238 | throw TypeError(".google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.error: object expected");
|
11239 | message.error = $root.google.rpc.Status.fromObject(object.error);
|
11240 | }
|
11241 | if (object.results) {
|
11242 | if (!Array.isArray(object.results))
|
11243 | throw TypeError(".google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.results: array expected");
|
11244 | message.results = [];
|
11245 | for (var i = 0; i < object.results.length; ++i) {
|
11246 | if (typeof object.results[i] !== "object")
|
11247 | throw TypeError(".google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.results: object expected");
|
11248 | message.results[i] = $root.google.cloud.speech.v1p1beta1.StreamingRecognitionResult.fromObject(object.results[i]);
|
11249 | }
|
11250 | }
|
11251 | switch (object.speechEventType) {
|
11252 | case "SPEECH_EVENT_UNSPECIFIED":
|
11253 | case 0:
|
11254 | message.speechEventType = 0;
|
11255 | break;
|
11256 | case "END_OF_SINGLE_UTTERANCE":
|
11257 | case 1:
|
11258 | message.speechEventType = 1;
|
11259 | break;
|
11260 | }
|
11261 | if (object.totalBilledTime != null) {
|
11262 | if (typeof object.totalBilledTime !== "object")
|
11263 | throw TypeError(".google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.totalBilledTime: object expected");
|
11264 | message.totalBilledTime = $root.google.protobuf.Duration.fromObject(object.totalBilledTime);
|
11265 | }
|
11266 | return message;
|
11267 | };
|
11268 |
|
11269 | /**
|
11270 | * Creates a plain object from a StreamingRecognizeResponse message. Also converts values to other types if specified.
|
11271 | * @function toObject
|
11272 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeResponse
|
11273 | * @static
|
11274 | * @param {google.cloud.speech.v1p1beta1.StreamingRecognizeResponse} message StreamingRecognizeResponse
|
11275 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
11276 | * @returns {Object.<string,*>} Plain object
|
11277 | */
|
11278 | StreamingRecognizeResponse.toObject = function toObject(message, options) {
|
11279 | if (!options)
|
11280 | options = {};
|
11281 | var object = {};
|
11282 | if (options.arrays || options.defaults)
|
11283 | object.results = [];
|
11284 | if (options.defaults) {
|
11285 | object.error = null;
|
11286 | object.speechEventType = options.enums === String ? "SPEECH_EVENT_UNSPECIFIED" : 0;
|
11287 | object.totalBilledTime = null;
|
11288 | }
|
11289 | if (message.error != null && message.hasOwnProperty("error"))
|
11290 | object.error = $root.google.rpc.Status.toObject(message.error, options);
|
11291 | if (message.results && message.results.length) {
|
11292 | object.results = [];
|
11293 | for (var j = 0; j < message.results.length; ++j)
|
11294 | object.results[j] = $root.google.cloud.speech.v1p1beta1.StreamingRecognitionResult.toObject(message.results[j], options);
|
11295 | }
|
11296 | if (message.speechEventType != null && message.hasOwnProperty("speechEventType"))
|
11297 | object.speechEventType = options.enums === String ? $root.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType[message.speechEventType] : message.speechEventType;
|
11298 | if (message.totalBilledTime != null && message.hasOwnProperty("totalBilledTime"))
|
11299 | object.totalBilledTime = $root.google.protobuf.Duration.toObject(message.totalBilledTime, options);
|
11300 | return object;
|
11301 | };
|
11302 |
|
11303 | /**
|
11304 | * Converts this StreamingRecognizeResponse to JSON.
|
11305 | * @function toJSON
|
11306 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognizeResponse
|
11307 | * @instance
|
11308 | * @returns {Object.<string,*>} JSON object
|
11309 | */
|
11310 | StreamingRecognizeResponse.prototype.toJSON = function toJSON() {
|
11311 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
11312 | };
|
11313 |
|
11314 | /**
|
11315 | * SpeechEventType enum.
|
11316 | * @name google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType
|
11317 | * @enum {number}
|
11318 | * @property {number} SPEECH_EVENT_UNSPECIFIED=0 SPEECH_EVENT_UNSPECIFIED value
|
11319 | * @property {number} END_OF_SINGLE_UTTERANCE=1 END_OF_SINGLE_UTTERANCE value
|
11320 | */
|
11321 | StreamingRecognizeResponse.SpeechEventType = (function() {
|
11322 | var valuesById = {}, values = Object.create(valuesById);
|
11323 | values[valuesById[0] = "SPEECH_EVENT_UNSPECIFIED"] = 0;
|
11324 | values[valuesById[1] = "END_OF_SINGLE_UTTERANCE"] = 1;
|
11325 | return values;
|
11326 | })();
|
11327 |
|
11328 | return StreamingRecognizeResponse;
|
11329 | })();
|
11330 |
|
11331 | v1p1beta1.StreamingRecognitionResult = (function() {
|
11332 |
|
11333 | /**
|
11334 | * Properties of a StreamingRecognitionResult.
|
11335 | * @memberof google.cloud.speech.v1p1beta1
|
11336 | * @interface IStreamingRecognitionResult
|
11337 | * @property {Array.<google.cloud.speech.v1p1beta1.ISpeechRecognitionAlternative>|null} [alternatives] StreamingRecognitionResult alternatives
|
11338 | * @property {boolean|null} [isFinal] StreamingRecognitionResult isFinal
|
11339 | * @property {number|null} [stability] StreamingRecognitionResult stability
|
11340 | * @property {google.protobuf.IDuration|null} [resultEndTime] StreamingRecognitionResult resultEndTime
|
11341 | * @property {number|null} [channelTag] StreamingRecognitionResult channelTag
|
11342 | * @property {string|null} [languageCode] StreamingRecognitionResult languageCode
|
11343 | */
|
11344 |
|
11345 | /**
|
11346 | * Constructs a new StreamingRecognitionResult.
|
11347 | * @memberof google.cloud.speech.v1p1beta1
|
11348 | * @classdesc Represents a StreamingRecognitionResult.
|
11349 | * @implements IStreamingRecognitionResult
|
11350 | * @constructor
|
11351 | * @param {google.cloud.speech.v1p1beta1.IStreamingRecognitionResult=} [properties] Properties to set
|
11352 | */
|
11353 | function StreamingRecognitionResult(properties) {
|
11354 | this.alternatives = [];
|
11355 | if (properties)
|
11356 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
11357 | if (properties[keys[i]] != null)
|
11358 | this[keys[i]] = properties[keys[i]];
|
11359 | }
|
11360 |
|
11361 | /**
|
11362 | * StreamingRecognitionResult alternatives.
|
11363 | * @member {Array.<google.cloud.speech.v1p1beta1.ISpeechRecognitionAlternative>} alternatives
|
11364 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionResult
|
11365 | * @instance
|
11366 | */
|
11367 | StreamingRecognitionResult.prototype.alternatives = $util.emptyArray;
|
11368 |
|
11369 | /**
|
11370 | * StreamingRecognitionResult isFinal.
|
11371 | * @member {boolean} isFinal
|
11372 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionResult
|
11373 | * @instance
|
11374 | */
|
11375 | StreamingRecognitionResult.prototype.isFinal = false;
|
11376 |
|
11377 | /**
|
11378 | * StreamingRecognitionResult stability.
|
11379 | * @member {number} stability
|
11380 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionResult
|
11381 | * @instance
|
11382 | */
|
11383 | StreamingRecognitionResult.prototype.stability = 0;
|
11384 |
|
11385 | /**
|
11386 | * StreamingRecognitionResult resultEndTime.
|
11387 | * @member {google.protobuf.IDuration|null|undefined} resultEndTime
|
11388 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionResult
|
11389 | * @instance
|
11390 | */
|
11391 | StreamingRecognitionResult.prototype.resultEndTime = null;
|
11392 |
|
11393 | /**
|
11394 | * StreamingRecognitionResult channelTag.
|
11395 | * @member {number} channelTag
|
11396 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionResult
|
11397 | * @instance
|
11398 | */
|
11399 | StreamingRecognitionResult.prototype.channelTag = 0;
|
11400 |
|
11401 | /**
|
11402 | * StreamingRecognitionResult languageCode.
|
11403 | * @member {string} languageCode
|
11404 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionResult
|
11405 | * @instance
|
11406 | */
|
11407 | StreamingRecognitionResult.prototype.languageCode = "";
|
11408 |
|
11409 | /**
|
11410 | * Creates a new StreamingRecognitionResult instance using the specified properties.
|
11411 | * @function create
|
11412 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionResult
|
11413 | * @static
|
11414 | * @param {google.cloud.speech.v1p1beta1.IStreamingRecognitionResult=} [properties] Properties to set
|
11415 | * @returns {google.cloud.speech.v1p1beta1.StreamingRecognitionResult} StreamingRecognitionResult instance
|
11416 | */
|
11417 | StreamingRecognitionResult.create = function create(properties) {
|
11418 | return new StreamingRecognitionResult(properties);
|
11419 | };
|
11420 |
|
11421 | /**
|
11422 | * Encodes the specified StreamingRecognitionResult message. Does not implicitly {@link google.cloud.speech.v1p1beta1.StreamingRecognitionResult.verify|verify} messages.
|
11423 | * @function encode
|
11424 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionResult
|
11425 | * @static
|
11426 | * @param {google.cloud.speech.v1p1beta1.IStreamingRecognitionResult} message StreamingRecognitionResult message or plain object to encode
|
11427 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
11428 | * @returns {$protobuf.Writer} Writer
|
11429 | */
|
11430 | StreamingRecognitionResult.encode = function encode(message, writer) {
|
11431 | if (!writer)
|
11432 | writer = $Writer.create();
|
11433 | if (message.alternatives != null && message.alternatives.length)
|
11434 | for (var i = 0; i < message.alternatives.length; ++i)
|
11435 | $root.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.encode(message.alternatives[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
11436 | if (message.isFinal != null && Object.hasOwnProperty.call(message, "isFinal"))
|
11437 | writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isFinal);
|
11438 | if (message.stability != null && Object.hasOwnProperty.call(message, "stability"))
|
11439 | writer.uint32(/* id 3, wireType 5 =*/29).float(message.stability);
|
11440 | if (message.resultEndTime != null && Object.hasOwnProperty.call(message, "resultEndTime"))
|
11441 | $root.google.protobuf.Duration.encode(message.resultEndTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
|
11442 | if (message.channelTag != null && Object.hasOwnProperty.call(message, "channelTag"))
|
11443 | writer.uint32(/* id 5, wireType 0 =*/40).int32(message.channelTag);
|
11444 | if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode"))
|
11445 | writer.uint32(/* id 6, wireType 2 =*/50).string(message.languageCode);
|
11446 | return writer;
|
11447 | };
|
11448 |
|
11449 | /**
|
11450 | * Encodes the specified StreamingRecognitionResult message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.StreamingRecognitionResult.verify|verify} messages.
|
11451 | * @function encodeDelimited
|
11452 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionResult
|
11453 | * @static
|
11454 | * @param {google.cloud.speech.v1p1beta1.IStreamingRecognitionResult} message StreamingRecognitionResult message or plain object to encode
|
11455 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
11456 | * @returns {$protobuf.Writer} Writer
|
11457 | */
|
11458 | StreamingRecognitionResult.encodeDelimited = function encodeDelimited(message, writer) {
|
11459 | return this.encode(message, writer).ldelim();
|
11460 | };
|
11461 |
|
11462 | /**
|
11463 | * Decodes a StreamingRecognitionResult message from the specified reader or buffer.
|
11464 | * @function decode
|
11465 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionResult
|
11466 | * @static
|
11467 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
11468 | * @param {number} [length] Message length if known beforehand
|
11469 | * @returns {google.cloud.speech.v1p1beta1.StreamingRecognitionResult} StreamingRecognitionResult
|
11470 | * @throws {Error} If the payload is not a reader or valid buffer
|
11471 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
11472 | */
|
11473 | StreamingRecognitionResult.decode = function decode(reader, length) {
|
11474 | if (!(reader instanceof $Reader))
|
11475 | reader = $Reader.create(reader);
|
11476 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.StreamingRecognitionResult();
|
11477 | while (reader.pos < end) {
|
11478 | var tag = reader.uint32();
|
11479 | switch (tag >>> 3) {
|
11480 | case 1:
|
11481 | if (!(message.alternatives && message.alternatives.length))
|
11482 | message.alternatives = [];
|
11483 | message.alternatives.push($root.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.decode(reader, reader.uint32()));
|
11484 | break;
|
11485 | case 2:
|
11486 | message.isFinal = reader.bool();
|
11487 | break;
|
11488 | case 3:
|
11489 | message.stability = reader.float();
|
11490 | break;
|
11491 | case 4:
|
11492 | message.resultEndTime = $root.google.protobuf.Duration.decode(reader, reader.uint32());
|
11493 | break;
|
11494 | case 5:
|
11495 | message.channelTag = reader.int32();
|
11496 | break;
|
11497 | case 6:
|
11498 | message.languageCode = reader.string();
|
11499 | break;
|
11500 | default:
|
11501 | reader.skipType(tag & 7);
|
11502 | break;
|
11503 | }
|
11504 | }
|
11505 | return message;
|
11506 | };
|
11507 |
|
11508 | /**
|
11509 | * Decodes a StreamingRecognitionResult message from the specified reader or buffer, length delimited.
|
11510 | * @function decodeDelimited
|
11511 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionResult
|
11512 | * @static
|
11513 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
11514 | * @returns {google.cloud.speech.v1p1beta1.StreamingRecognitionResult} StreamingRecognitionResult
|
11515 | * @throws {Error} If the payload is not a reader or valid buffer
|
11516 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
11517 | */
|
11518 | StreamingRecognitionResult.decodeDelimited = function decodeDelimited(reader) {
|
11519 | if (!(reader instanceof $Reader))
|
11520 | reader = new $Reader(reader);
|
11521 | return this.decode(reader, reader.uint32());
|
11522 | };
|
11523 |
|
11524 | /**
|
11525 | * Verifies a StreamingRecognitionResult message.
|
11526 | * @function verify
|
11527 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionResult
|
11528 | * @static
|
11529 | * @param {Object.<string,*>} message Plain object to verify
|
11530 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
11531 | */
|
11532 | StreamingRecognitionResult.verify = function verify(message) {
|
11533 | if (typeof message !== "object" || message === null)
|
11534 | return "object expected";
|
11535 | if (message.alternatives != null && message.hasOwnProperty("alternatives")) {
|
11536 | if (!Array.isArray(message.alternatives))
|
11537 | return "alternatives: array expected";
|
11538 | for (var i = 0; i < message.alternatives.length; ++i) {
|
11539 | var error = $root.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.verify(message.alternatives[i]);
|
11540 | if (error)
|
11541 | return "alternatives." + error;
|
11542 | }
|
11543 | }
|
11544 | if (message.isFinal != null && message.hasOwnProperty("isFinal"))
|
11545 | if (typeof message.isFinal !== "boolean")
|
11546 | return "isFinal: boolean expected";
|
11547 | if (message.stability != null && message.hasOwnProperty("stability"))
|
11548 | if (typeof message.stability !== "number")
|
11549 | return "stability: number expected";
|
11550 | if (message.resultEndTime != null && message.hasOwnProperty("resultEndTime")) {
|
11551 | var error = $root.google.protobuf.Duration.verify(message.resultEndTime);
|
11552 | if (error)
|
11553 | return "resultEndTime." + error;
|
11554 | }
|
11555 | if (message.channelTag != null && message.hasOwnProperty("channelTag"))
|
11556 | if (!$util.isInteger(message.channelTag))
|
11557 | return "channelTag: integer expected";
|
11558 | if (message.languageCode != null && message.hasOwnProperty("languageCode"))
|
11559 | if (!$util.isString(message.languageCode))
|
11560 | return "languageCode: string expected";
|
11561 | return null;
|
11562 | };
|
11563 |
|
11564 | /**
|
11565 | * Creates a StreamingRecognitionResult message from a plain object. Also converts values to their respective internal types.
|
11566 | * @function fromObject
|
11567 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionResult
|
11568 | * @static
|
11569 | * @param {Object.<string,*>} object Plain object
|
11570 | * @returns {google.cloud.speech.v1p1beta1.StreamingRecognitionResult} StreamingRecognitionResult
|
11571 | */
|
11572 | StreamingRecognitionResult.fromObject = function fromObject(object) {
|
11573 | if (object instanceof $root.google.cloud.speech.v1p1beta1.StreamingRecognitionResult)
|
11574 | return object;
|
11575 | var message = new $root.google.cloud.speech.v1p1beta1.StreamingRecognitionResult();
|
11576 | if (object.alternatives) {
|
11577 | if (!Array.isArray(object.alternatives))
|
11578 | throw TypeError(".google.cloud.speech.v1p1beta1.StreamingRecognitionResult.alternatives: array expected");
|
11579 | message.alternatives = [];
|
11580 | for (var i = 0; i < object.alternatives.length; ++i) {
|
11581 | if (typeof object.alternatives[i] !== "object")
|
11582 | throw TypeError(".google.cloud.speech.v1p1beta1.StreamingRecognitionResult.alternatives: object expected");
|
11583 | message.alternatives[i] = $root.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.fromObject(object.alternatives[i]);
|
11584 | }
|
11585 | }
|
11586 | if (object.isFinal != null)
|
11587 | message.isFinal = Boolean(object.isFinal);
|
11588 | if (object.stability != null)
|
11589 | message.stability = Number(object.stability);
|
11590 | if (object.resultEndTime != null) {
|
11591 | if (typeof object.resultEndTime !== "object")
|
11592 | throw TypeError(".google.cloud.speech.v1p1beta1.StreamingRecognitionResult.resultEndTime: object expected");
|
11593 | message.resultEndTime = $root.google.protobuf.Duration.fromObject(object.resultEndTime);
|
11594 | }
|
11595 | if (object.channelTag != null)
|
11596 | message.channelTag = object.channelTag | 0;
|
11597 | if (object.languageCode != null)
|
11598 | message.languageCode = String(object.languageCode);
|
11599 | return message;
|
11600 | };
|
11601 |
|
11602 | /**
|
11603 | * Creates a plain object from a StreamingRecognitionResult message. Also converts values to other types if specified.
|
11604 | * @function toObject
|
11605 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionResult
|
11606 | * @static
|
11607 | * @param {google.cloud.speech.v1p1beta1.StreamingRecognitionResult} message StreamingRecognitionResult
|
11608 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
11609 | * @returns {Object.<string,*>} Plain object
|
11610 | */
|
11611 | StreamingRecognitionResult.toObject = function toObject(message, options) {
|
11612 | if (!options)
|
11613 | options = {};
|
11614 | var object = {};
|
11615 | if (options.arrays || options.defaults)
|
11616 | object.alternatives = [];
|
11617 | if (options.defaults) {
|
11618 | object.isFinal = false;
|
11619 | object.stability = 0;
|
11620 | object.resultEndTime = null;
|
11621 | object.channelTag = 0;
|
11622 | object.languageCode = "";
|
11623 | }
|
11624 | if (message.alternatives && message.alternatives.length) {
|
11625 | object.alternatives = [];
|
11626 | for (var j = 0; j < message.alternatives.length; ++j)
|
11627 | object.alternatives[j] = $root.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.toObject(message.alternatives[j], options);
|
11628 | }
|
11629 | if (message.isFinal != null && message.hasOwnProperty("isFinal"))
|
11630 | object.isFinal = message.isFinal;
|
11631 | if (message.stability != null && message.hasOwnProperty("stability"))
|
11632 | object.stability = options.json && !isFinite(message.stability) ? String(message.stability) : message.stability;
|
11633 | if (message.resultEndTime != null && message.hasOwnProperty("resultEndTime"))
|
11634 | object.resultEndTime = $root.google.protobuf.Duration.toObject(message.resultEndTime, options);
|
11635 | if (message.channelTag != null && message.hasOwnProperty("channelTag"))
|
11636 | object.channelTag = message.channelTag;
|
11637 | if (message.languageCode != null && message.hasOwnProperty("languageCode"))
|
11638 | object.languageCode = message.languageCode;
|
11639 | return object;
|
11640 | };
|
11641 |
|
11642 | /**
|
11643 | * Converts this StreamingRecognitionResult to JSON.
|
11644 | * @function toJSON
|
11645 | * @memberof google.cloud.speech.v1p1beta1.StreamingRecognitionResult
|
11646 | * @instance
|
11647 | * @returns {Object.<string,*>} JSON object
|
11648 | */
|
11649 | StreamingRecognitionResult.prototype.toJSON = function toJSON() {
|
11650 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
11651 | };
|
11652 |
|
11653 | return StreamingRecognitionResult;
|
11654 | })();
|
11655 |
|
11656 | v1p1beta1.SpeechRecognitionResult = (function() {
|
11657 |
|
11658 | /**
|
11659 | * Properties of a SpeechRecognitionResult.
|
11660 | * @memberof google.cloud.speech.v1p1beta1
|
11661 | * @interface ISpeechRecognitionResult
|
11662 | * @property {Array.<google.cloud.speech.v1p1beta1.ISpeechRecognitionAlternative>|null} [alternatives] SpeechRecognitionResult alternatives
|
11663 | * @property {number|null} [channelTag] SpeechRecognitionResult channelTag
|
11664 | * @property {google.protobuf.IDuration|null} [resultEndTime] SpeechRecognitionResult resultEndTime
|
11665 | * @property {string|null} [languageCode] SpeechRecognitionResult languageCode
|
11666 | */
|
11667 |
|
11668 | /**
|
11669 | * Constructs a new SpeechRecognitionResult.
|
11670 | * @memberof google.cloud.speech.v1p1beta1
|
11671 | * @classdesc Represents a SpeechRecognitionResult.
|
11672 | * @implements ISpeechRecognitionResult
|
11673 | * @constructor
|
11674 | * @param {google.cloud.speech.v1p1beta1.ISpeechRecognitionResult=} [properties] Properties to set
|
11675 | */
|
11676 | function SpeechRecognitionResult(properties) {
|
11677 | this.alternatives = [];
|
11678 | if (properties)
|
11679 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
11680 | if (properties[keys[i]] != null)
|
11681 | this[keys[i]] = properties[keys[i]];
|
11682 | }
|
11683 |
|
11684 | /**
|
11685 | * SpeechRecognitionResult alternatives.
|
11686 | * @member {Array.<google.cloud.speech.v1p1beta1.ISpeechRecognitionAlternative>} alternatives
|
11687 | * @memberof google.cloud.speech.v1p1beta1.SpeechRecognitionResult
|
11688 | * @instance
|
11689 | */
|
11690 | SpeechRecognitionResult.prototype.alternatives = $util.emptyArray;
|
11691 |
|
11692 | /**
|
11693 | * SpeechRecognitionResult channelTag.
|
11694 | * @member {number} channelTag
|
11695 | * @memberof google.cloud.speech.v1p1beta1.SpeechRecognitionResult
|
11696 | * @instance
|
11697 | */
|
11698 | SpeechRecognitionResult.prototype.channelTag = 0;
|
11699 |
|
11700 | /**
|
11701 | * SpeechRecognitionResult resultEndTime.
|
11702 | * @member {google.protobuf.IDuration|null|undefined} resultEndTime
|
11703 | * @memberof google.cloud.speech.v1p1beta1.SpeechRecognitionResult
|
11704 | * @instance
|
11705 | */
|
11706 | SpeechRecognitionResult.prototype.resultEndTime = null;
|
11707 |
|
11708 | /**
|
11709 | * SpeechRecognitionResult languageCode.
|
11710 | * @member {string} languageCode
|
11711 | * @memberof google.cloud.speech.v1p1beta1.SpeechRecognitionResult
|
11712 | * @instance
|
11713 | */
|
11714 | SpeechRecognitionResult.prototype.languageCode = "";
|
11715 |
|
11716 | /**
|
11717 | * Creates a new SpeechRecognitionResult instance using the specified properties.
|
11718 | * @function create
|
11719 | * @memberof google.cloud.speech.v1p1beta1.SpeechRecognitionResult
|
11720 | * @static
|
11721 | * @param {google.cloud.speech.v1p1beta1.ISpeechRecognitionResult=} [properties] Properties to set
|
11722 | * @returns {google.cloud.speech.v1p1beta1.SpeechRecognitionResult} SpeechRecognitionResult instance
|
11723 | */
|
11724 | SpeechRecognitionResult.create = function create(properties) {
|
11725 | return new SpeechRecognitionResult(properties);
|
11726 | };
|
11727 |
|
11728 | /**
|
11729 | * Encodes the specified SpeechRecognitionResult message. Does not implicitly {@link google.cloud.speech.v1p1beta1.SpeechRecognitionResult.verify|verify} messages.
|
11730 | * @function encode
|
11731 | * @memberof google.cloud.speech.v1p1beta1.SpeechRecognitionResult
|
11732 | * @static
|
11733 | * @param {google.cloud.speech.v1p1beta1.ISpeechRecognitionResult} message SpeechRecognitionResult message or plain object to encode
|
11734 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
11735 | * @returns {$protobuf.Writer} Writer
|
11736 | */
|
11737 | SpeechRecognitionResult.encode = function encode(message, writer) {
|
11738 | if (!writer)
|
11739 | writer = $Writer.create();
|
11740 | if (message.alternatives != null && message.alternatives.length)
|
11741 | for (var i = 0; i < message.alternatives.length; ++i)
|
11742 | $root.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.encode(message.alternatives[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
11743 | if (message.channelTag != null && Object.hasOwnProperty.call(message, "channelTag"))
|
11744 | writer.uint32(/* id 2, wireType 0 =*/16).int32(message.channelTag);
|
11745 | if (message.resultEndTime != null && Object.hasOwnProperty.call(message, "resultEndTime"))
|
11746 | $root.google.protobuf.Duration.encode(message.resultEndTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
|
11747 | if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode"))
|
11748 | writer.uint32(/* id 5, wireType 2 =*/42).string(message.languageCode);
|
11749 | return writer;
|
11750 | };
|
11751 |
|
11752 | /**
|
11753 | * Encodes the specified SpeechRecognitionResult message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.SpeechRecognitionResult.verify|verify} messages.
|
11754 | * @function encodeDelimited
|
11755 | * @memberof google.cloud.speech.v1p1beta1.SpeechRecognitionResult
|
11756 | * @static
|
11757 | * @param {google.cloud.speech.v1p1beta1.ISpeechRecognitionResult} message SpeechRecognitionResult message or plain object to encode
|
11758 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
11759 | * @returns {$protobuf.Writer} Writer
|
11760 | */
|
11761 | SpeechRecognitionResult.encodeDelimited = function encodeDelimited(message, writer) {
|
11762 | return this.encode(message, writer).ldelim();
|
11763 | };
|
11764 |
|
11765 | /**
|
11766 | * Decodes a SpeechRecognitionResult message from the specified reader or buffer.
|
11767 | * @function decode
|
11768 | * @memberof google.cloud.speech.v1p1beta1.SpeechRecognitionResult
|
11769 | * @static
|
11770 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
11771 | * @param {number} [length] Message length if known beforehand
|
11772 | * @returns {google.cloud.speech.v1p1beta1.SpeechRecognitionResult} SpeechRecognitionResult
|
11773 | * @throws {Error} If the payload is not a reader or valid buffer
|
11774 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
11775 | */
|
11776 | SpeechRecognitionResult.decode = function decode(reader, length) {
|
11777 | if (!(reader instanceof $Reader))
|
11778 | reader = $Reader.create(reader);
|
11779 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.SpeechRecognitionResult();
|
11780 | while (reader.pos < end) {
|
11781 | var tag = reader.uint32();
|
11782 | switch (tag >>> 3) {
|
11783 | case 1:
|
11784 | if (!(message.alternatives && message.alternatives.length))
|
11785 | message.alternatives = [];
|
11786 | message.alternatives.push($root.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.decode(reader, reader.uint32()));
|
11787 | break;
|
11788 | case 2:
|
11789 | message.channelTag = reader.int32();
|
11790 | break;
|
11791 | case 4:
|
11792 | message.resultEndTime = $root.google.protobuf.Duration.decode(reader, reader.uint32());
|
11793 | break;
|
11794 | case 5:
|
11795 | message.languageCode = reader.string();
|
11796 | break;
|
11797 | default:
|
11798 | reader.skipType(tag & 7);
|
11799 | break;
|
11800 | }
|
11801 | }
|
11802 | return message;
|
11803 | };
|
11804 |
|
11805 | /**
|
11806 | * Decodes a SpeechRecognitionResult message from the specified reader or buffer, length delimited.
|
11807 | * @function decodeDelimited
|
11808 | * @memberof google.cloud.speech.v1p1beta1.SpeechRecognitionResult
|
11809 | * @static
|
11810 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
11811 | * @returns {google.cloud.speech.v1p1beta1.SpeechRecognitionResult} SpeechRecognitionResult
|
11812 | * @throws {Error} If the payload is not a reader or valid buffer
|
11813 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
11814 | */
|
11815 | SpeechRecognitionResult.decodeDelimited = function decodeDelimited(reader) {
|
11816 | if (!(reader instanceof $Reader))
|
11817 | reader = new $Reader(reader);
|
11818 | return this.decode(reader, reader.uint32());
|
11819 | };
|
11820 |
|
11821 | /**
|
11822 | * Verifies a SpeechRecognitionResult message.
|
11823 | * @function verify
|
11824 | * @memberof google.cloud.speech.v1p1beta1.SpeechRecognitionResult
|
11825 | * @static
|
11826 | * @param {Object.<string,*>} message Plain object to verify
|
11827 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
11828 | */
|
11829 | SpeechRecognitionResult.verify = function verify(message) {
|
11830 | if (typeof message !== "object" || message === null)
|
11831 | return "object expected";
|
11832 | if (message.alternatives != null && message.hasOwnProperty("alternatives")) {
|
11833 | if (!Array.isArray(message.alternatives))
|
11834 | return "alternatives: array expected";
|
11835 | for (var i = 0; i < message.alternatives.length; ++i) {
|
11836 | var error = $root.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.verify(message.alternatives[i]);
|
11837 | if (error)
|
11838 | return "alternatives." + error;
|
11839 | }
|
11840 | }
|
11841 | if (message.channelTag != null && message.hasOwnProperty("channelTag"))
|
11842 | if (!$util.isInteger(message.channelTag))
|
11843 | return "channelTag: integer expected";
|
11844 | if (message.resultEndTime != null && message.hasOwnProperty("resultEndTime")) {
|
11845 | var error = $root.google.protobuf.Duration.verify(message.resultEndTime);
|
11846 | if (error)
|
11847 | return "resultEndTime." + error;
|
11848 | }
|
11849 | if (message.languageCode != null && message.hasOwnProperty("languageCode"))
|
11850 | if (!$util.isString(message.languageCode))
|
11851 | return "languageCode: string expected";
|
11852 | return null;
|
11853 | };
|
11854 |
|
11855 | /**
|
11856 | * Creates a SpeechRecognitionResult message from a plain object. Also converts values to their respective internal types.
|
11857 | * @function fromObject
|
11858 | * @memberof google.cloud.speech.v1p1beta1.SpeechRecognitionResult
|
11859 | * @static
|
11860 | * @param {Object.<string,*>} object Plain object
|
11861 | * @returns {google.cloud.speech.v1p1beta1.SpeechRecognitionResult} SpeechRecognitionResult
|
11862 | */
|
11863 | SpeechRecognitionResult.fromObject = function fromObject(object) {
|
11864 | if (object instanceof $root.google.cloud.speech.v1p1beta1.SpeechRecognitionResult)
|
11865 | return object;
|
11866 | var message = new $root.google.cloud.speech.v1p1beta1.SpeechRecognitionResult();
|
11867 | if (object.alternatives) {
|
11868 | if (!Array.isArray(object.alternatives))
|
11869 | throw TypeError(".google.cloud.speech.v1p1beta1.SpeechRecognitionResult.alternatives: array expected");
|
11870 | message.alternatives = [];
|
11871 | for (var i = 0; i < object.alternatives.length; ++i) {
|
11872 | if (typeof object.alternatives[i] !== "object")
|
11873 | throw TypeError(".google.cloud.speech.v1p1beta1.SpeechRecognitionResult.alternatives: object expected");
|
11874 | message.alternatives[i] = $root.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.fromObject(object.alternatives[i]);
|
11875 | }
|
11876 | }
|
11877 | if (object.channelTag != null)
|
11878 | message.channelTag = object.channelTag | 0;
|
11879 | if (object.resultEndTime != null) {
|
11880 | if (typeof object.resultEndTime !== "object")
|
11881 | throw TypeError(".google.cloud.speech.v1p1beta1.SpeechRecognitionResult.resultEndTime: object expected");
|
11882 | message.resultEndTime = $root.google.protobuf.Duration.fromObject(object.resultEndTime);
|
11883 | }
|
11884 | if (object.languageCode != null)
|
11885 | message.languageCode = String(object.languageCode);
|
11886 | return message;
|
11887 | };
|
11888 |
|
11889 | /**
|
11890 | * Creates a plain object from a SpeechRecognitionResult message. Also converts values to other types if specified.
|
11891 | * @function toObject
|
11892 | * @memberof google.cloud.speech.v1p1beta1.SpeechRecognitionResult
|
11893 | * @static
|
11894 | * @param {google.cloud.speech.v1p1beta1.SpeechRecognitionResult} message SpeechRecognitionResult
|
11895 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
11896 | * @returns {Object.<string,*>} Plain object
|
11897 | */
|
11898 | SpeechRecognitionResult.toObject = function toObject(message, options) {
|
11899 | if (!options)
|
11900 | options = {};
|
11901 | var object = {};
|
11902 | if (options.arrays || options.defaults)
|
11903 | object.alternatives = [];
|
11904 | if (options.defaults) {
|
11905 | object.channelTag = 0;
|
11906 | object.resultEndTime = null;
|
11907 | object.languageCode = "";
|
11908 | }
|
11909 | if (message.alternatives && message.alternatives.length) {
|
11910 | object.alternatives = [];
|
11911 | for (var j = 0; j < message.alternatives.length; ++j)
|
11912 | object.alternatives[j] = $root.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.toObject(message.alternatives[j], options);
|
11913 | }
|
11914 | if (message.channelTag != null && message.hasOwnProperty("channelTag"))
|
11915 | object.channelTag = message.channelTag;
|
11916 | if (message.resultEndTime != null && message.hasOwnProperty("resultEndTime"))
|
11917 | object.resultEndTime = $root.google.protobuf.Duration.toObject(message.resultEndTime, options);
|
11918 | if (message.languageCode != null && message.hasOwnProperty("languageCode"))
|
11919 | object.languageCode = message.languageCode;
|
11920 | return object;
|
11921 | };
|
11922 |
|
11923 | /**
|
11924 | * Converts this SpeechRecognitionResult to JSON.
|
11925 | * @function toJSON
|
11926 | * @memberof google.cloud.speech.v1p1beta1.SpeechRecognitionResult
|
11927 | * @instance
|
11928 | * @returns {Object.<string,*>} JSON object
|
11929 | */
|
11930 | SpeechRecognitionResult.prototype.toJSON = function toJSON() {
|
11931 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
11932 | };
|
11933 |
|
11934 | return SpeechRecognitionResult;
|
11935 | })();
|
11936 |
|
11937 | v1p1beta1.SpeechRecognitionAlternative = (function() {
|
11938 |
|
11939 | /**
|
11940 | * Properties of a SpeechRecognitionAlternative.
|
11941 | * @memberof google.cloud.speech.v1p1beta1
|
11942 | * @interface ISpeechRecognitionAlternative
|
11943 | * @property {string|null} [transcript] SpeechRecognitionAlternative transcript
|
11944 | * @property {number|null} [confidence] SpeechRecognitionAlternative confidence
|
11945 | * @property {Array.<google.cloud.speech.v1p1beta1.IWordInfo>|null} [words] SpeechRecognitionAlternative words
|
11946 | */
|
11947 |
|
11948 | /**
|
11949 | * Constructs a new SpeechRecognitionAlternative.
|
11950 | * @memberof google.cloud.speech.v1p1beta1
|
11951 | * @classdesc Represents a SpeechRecognitionAlternative.
|
11952 | * @implements ISpeechRecognitionAlternative
|
11953 | * @constructor
|
11954 | * @param {google.cloud.speech.v1p1beta1.ISpeechRecognitionAlternative=} [properties] Properties to set
|
11955 | */
|
11956 | function SpeechRecognitionAlternative(properties) {
|
11957 | this.words = [];
|
11958 | if (properties)
|
11959 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
11960 | if (properties[keys[i]] != null)
|
11961 | this[keys[i]] = properties[keys[i]];
|
11962 | }
|
11963 |
|
11964 | /**
|
11965 | * SpeechRecognitionAlternative transcript.
|
11966 | * @member {string} transcript
|
11967 | * @memberof google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative
|
11968 | * @instance
|
11969 | */
|
11970 | SpeechRecognitionAlternative.prototype.transcript = "";
|
11971 |
|
11972 | /**
|
11973 | * SpeechRecognitionAlternative confidence.
|
11974 | * @member {number} confidence
|
11975 | * @memberof google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative
|
11976 | * @instance
|
11977 | */
|
11978 | SpeechRecognitionAlternative.prototype.confidence = 0;
|
11979 |
|
11980 | /**
|
11981 | * SpeechRecognitionAlternative words.
|
11982 | * @member {Array.<google.cloud.speech.v1p1beta1.IWordInfo>} words
|
11983 | * @memberof google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative
|
11984 | * @instance
|
11985 | */
|
11986 | SpeechRecognitionAlternative.prototype.words = $util.emptyArray;
|
11987 |
|
11988 | /**
|
11989 | * Creates a new SpeechRecognitionAlternative instance using the specified properties.
|
11990 | * @function create
|
11991 | * @memberof google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative
|
11992 | * @static
|
11993 | * @param {google.cloud.speech.v1p1beta1.ISpeechRecognitionAlternative=} [properties] Properties to set
|
11994 | * @returns {google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative} SpeechRecognitionAlternative instance
|
11995 | */
|
11996 | SpeechRecognitionAlternative.create = function create(properties) {
|
11997 | return new SpeechRecognitionAlternative(properties);
|
11998 | };
|
11999 |
|
12000 | /**
|
12001 | * Encodes the specified SpeechRecognitionAlternative message. Does not implicitly {@link google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.verify|verify} messages.
|
12002 | * @function encode
|
12003 | * @memberof google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative
|
12004 | * @static
|
12005 | * @param {google.cloud.speech.v1p1beta1.ISpeechRecognitionAlternative} message SpeechRecognitionAlternative message or plain object to encode
|
12006 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
12007 | * @returns {$protobuf.Writer} Writer
|
12008 | */
|
12009 | SpeechRecognitionAlternative.encode = function encode(message, writer) {
|
12010 | if (!writer)
|
12011 | writer = $Writer.create();
|
12012 | if (message.transcript != null && Object.hasOwnProperty.call(message, "transcript"))
|
12013 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.transcript);
|
12014 | if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence"))
|
12015 | writer.uint32(/* id 2, wireType 5 =*/21).float(message.confidence);
|
12016 | if (message.words != null && message.words.length)
|
12017 | for (var i = 0; i < message.words.length; ++i)
|
12018 | $root.google.cloud.speech.v1p1beta1.WordInfo.encode(message.words[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
|
12019 | return writer;
|
12020 | };
|
12021 |
|
12022 | /**
|
12023 | * Encodes the specified SpeechRecognitionAlternative message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.verify|verify} messages.
|
12024 | * @function encodeDelimited
|
12025 | * @memberof google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative
|
12026 | * @static
|
12027 | * @param {google.cloud.speech.v1p1beta1.ISpeechRecognitionAlternative} message SpeechRecognitionAlternative message or plain object to encode
|
12028 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
12029 | * @returns {$protobuf.Writer} Writer
|
12030 | */
|
12031 | SpeechRecognitionAlternative.encodeDelimited = function encodeDelimited(message, writer) {
|
12032 | return this.encode(message, writer).ldelim();
|
12033 | };
|
12034 |
|
12035 | /**
|
12036 | * Decodes a SpeechRecognitionAlternative message from the specified reader or buffer.
|
12037 | * @function decode
|
12038 | * @memberof google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative
|
12039 | * @static
|
12040 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
12041 | * @param {number} [length] Message length if known beforehand
|
12042 | * @returns {google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative} SpeechRecognitionAlternative
|
12043 | * @throws {Error} If the payload is not a reader or valid buffer
|
12044 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
12045 | */
|
12046 | SpeechRecognitionAlternative.decode = function decode(reader, length) {
|
12047 | if (!(reader instanceof $Reader))
|
12048 | reader = $Reader.create(reader);
|
12049 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative();
|
12050 | while (reader.pos < end) {
|
12051 | var tag = reader.uint32();
|
12052 | switch (tag >>> 3) {
|
12053 | case 1:
|
12054 | message.transcript = reader.string();
|
12055 | break;
|
12056 | case 2:
|
12057 | message.confidence = reader.float();
|
12058 | break;
|
12059 | case 3:
|
12060 | if (!(message.words && message.words.length))
|
12061 | message.words = [];
|
12062 | message.words.push($root.google.cloud.speech.v1p1beta1.WordInfo.decode(reader, reader.uint32()));
|
12063 | break;
|
12064 | default:
|
12065 | reader.skipType(tag & 7);
|
12066 | break;
|
12067 | }
|
12068 | }
|
12069 | return message;
|
12070 | };
|
12071 |
|
12072 | /**
|
12073 | * Decodes a SpeechRecognitionAlternative message from the specified reader or buffer, length delimited.
|
12074 | * @function decodeDelimited
|
12075 | * @memberof google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative
|
12076 | * @static
|
12077 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
12078 | * @returns {google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative} SpeechRecognitionAlternative
|
12079 | * @throws {Error} If the payload is not a reader or valid buffer
|
12080 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
12081 | */
|
12082 | SpeechRecognitionAlternative.decodeDelimited = function decodeDelimited(reader) {
|
12083 | if (!(reader instanceof $Reader))
|
12084 | reader = new $Reader(reader);
|
12085 | return this.decode(reader, reader.uint32());
|
12086 | };
|
12087 |
|
12088 | /**
|
12089 | * Verifies a SpeechRecognitionAlternative message.
|
12090 | * @function verify
|
12091 | * @memberof google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative
|
12092 | * @static
|
12093 | * @param {Object.<string,*>} message Plain object to verify
|
12094 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
12095 | */
|
12096 | SpeechRecognitionAlternative.verify = function verify(message) {
|
12097 | if (typeof message !== "object" || message === null)
|
12098 | return "object expected";
|
12099 | if (message.transcript != null && message.hasOwnProperty("transcript"))
|
12100 | if (!$util.isString(message.transcript))
|
12101 | return "transcript: string expected";
|
12102 | if (message.confidence != null && message.hasOwnProperty("confidence"))
|
12103 | if (typeof message.confidence !== "number")
|
12104 | return "confidence: number expected";
|
12105 | if (message.words != null && message.hasOwnProperty("words")) {
|
12106 | if (!Array.isArray(message.words))
|
12107 | return "words: array expected";
|
12108 | for (var i = 0; i < message.words.length; ++i) {
|
12109 | var error = $root.google.cloud.speech.v1p1beta1.WordInfo.verify(message.words[i]);
|
12110 | if (error)
|
12111 | return "words." + error;
|
12112 | }
|
12113 | }
|
12114 | return null;
|
12115 | };
|
12116 |
|
12117 | /**
|
12118 | * Creates a SpeechRecognitionAlternative message from a plain object. Also converts values to their respective internal types.
|
12119 | * @function fromObject
|
12120 | * @memberof google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative
|
12121 | * @static
|
12122 | * @param {Object.<string,*>} object Plain object
|
12123 | * @returns {google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative} SpeechRecognitionAlternative
|
12124 | */
|
12125 | SpeechRecognitionAlternative.fromObject = function fromObject(object) {
|
12126 | if (object instanceof $root.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative)
|
12127 | return object;
|
12128 | var message = new $root.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative();
|
12129 | if (object.transcript != null)
|
12130 | message.transcript = String(object.transcript);
|
12131 | if (object.confidence != null)
|
12132 | message.confidence = Number(object.confidence);
|
12133 | if (object.words) {
|
12134 | if (!Array.isArray(object.words))
|
12135 | throw TypeError(".google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.words: array expected");
|
12136 | message.words = [];
|
12137 | for (var i = 0; i < object.words.length; ++i) {
|
12138 | if (typeof object.words[i] !== "object")
|
12139 | throw TypeError(".google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.words: object expected");
|
12140 | message.words[i] = $root.google.cloud.speech.v1p1beta1.WordInfo.fromObject(object.words[i]);
|
12141 | }
|
12142 | }
|
12143 | return message;
|
12144 | };
|
12145 |
|
12146 | /**
|
12147 | * Creates a plain object from a SpeechRecognitionAlternative message. Also converts values to other types if specified.
|
12148 | * @function toObject
|
12149 | * @memberof google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative
|
12150 | * @static
|
12151 | * @param {google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative} message SpeechRecognitionAlternative
|
12152 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
12153 | * @returns {Object.<string,*>} Plain object
|
12154 | */
|
12155 | SpeechRecognitionAlternative.toObject = function toObject(message, options) {
|
12156 | if (!options)
|
12157 | options = {};
|
12158 | var object = {};
|
12159 | if (options.arrays || options.defaults)
|
12160 | object.words = [];
|
12161 | if (options.defaults) {
|
12162 | object.transcript = "";
|
12163 | object.confidence = 0;
|
12164 | }
|
12165 | if (message.transcript != null && message.hasOwnProperty("transcript"))
|
12166 | object.transcript = message.transcript;
|
12167 | if (message.confidence != null && message.hasOwnProperty("confidence"))
|
12168 | object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence;
|
12169 | if (message.words && message.words.length) {
|
12170 | object.words = [];
|
12171 | for (var j = 0; j < message.words.length; ++j)
|
12172 | object.words[j] = $root.google.cloud.speech.v1p1beta1.WordInfo.toObject(message.words[j], options);
|
12173 | }
|
12174 | return object;
|
12175 | };
|
12176 |
|
12177 | /**
|
12178 | * Converts this SpeechRecognitionAlternative to JSON.
|
12179 | * @function toJSON
|
12180 | * @memberof google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative
|
12181 | * @instance
|
12182 | * @returns {Object.<string,*>} JSON object
|
12183 | */
|
12184 | SpeechRecognitionAlternative.prototype.toJSON = function toJSON() {
|
12185 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
12186 | };
|
12187 |
|
12188 | return SpeechRecognitionAlternative;
|
12189 | })();
|
12190 |
|
12191 | v1p1beta1.WordInfo = (function() {
|
12192 |
|
12193 | /**
|
12194 | * Properties of a WordInfo.
|
12195 | * @memberof google.cloud.speech.v1p1beta1
|
12196 | * @interface IWordInfo
|
12197 | * @property {google.protobuf.IDuration|null} [startTime] WordInfo startTime
|
12198 | * @property {google.protobuf.IDuration|null} [endTime] WordInfo endTime
|
12199 | * @property {string|null} [word] WordInfo word
|
12200 | * @property {number|null} [confidence] WordInfo confidence
|
12201 | * @property {number|null} [speakerTag] WordInfo speakerTag
|
12202 | */
|
12203 |
|
12204 | /**
|
12205 | * Constructs a new WordInfo.
|
12206 | * @memberof google.cloud.speech.v1p1beta1
|
12207 | * @classdesc Represents a WordInfo.
|
12208 | * @implements IWordInfo
|
12209 | * @constructor
|
12210 | * @param {google.cloud.speech.v1p1beta1.IWordInfo=} [properties] Properties to set
|
12211 | */
|
12212 | function WordInfo(properties) {
|
12213 | if (properties)
|
12214 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
12215 | if (properties[keys[i]] != null)
|
12216 | this[keys[i]] = properties[keys[i]];
|
12217 | }
|
12218 |
|
12219 | /**
|
12220 | * WordInfo startTime.
|
12221 | * @member {google.protobuf.IDuration|null|undefined} startTime
|
12222 | * @memberof google.cloud.speech.v1p1beta1.WordInfo
|
12223 | * @instance
|
12224 | */
|
12225 | WordInfo.prototype.startTime = null;
|
12226 |
|
12227 | /**
|
12228 | * WordInfo endTime.
|
12229 | * @member {google.protobuf.IDuration|null|undefined} endTime
|
12230 | * @memberof google.cloud.speech.v1p1beta1.WordInfo
|
12231 | * @instance
|
12232 | */
|
12233 | WordInfo.prototype.endTime = null;
|
12234 |
|
12235 | /**
|
12236 | * WordInfo word.
|
12237 | * @member {string} word
|
12238 | * @memberof google.cloud.speech.v1p1beta1.WordInfo
|
12239 | * @instance
|
12240 | */
|
12241 | WordInfo.prototype.word = "";
|
12242 |
|
12243 | /**
|
12244 | * WordInfo confidence.
|
12245 | * @member {number} confidence
|
12246 | * @memberof google.cloud.speech.v1p1beta1.WordInfo
|
12247 | * @instance
|
12248 | */
|
12249 | WordInfo.prototype.confidence = 0;
|
12250 |
|
12251 | /**
|
12252 | * WordInfo speakerTag.
|
12253 | * @member {number} speakerTag
|
12254 | * @memberof google.cloud.speech.v1p1beta1.WordInfo
|
12255 | * @instance
|
12256 | */
|
12257 | WordInfo.prototype.speakerTag = 0;
|
12258 |
|
12259 | /**
|
12260 | * Creates a new WordInfo instance using the specified properties.
|
12261 | * @function create
|
12262 | * @memberof google.cloud.speech.v1p1beta1.WordInfo
|
12263 | * @static
|
12264 | * @param {google.cloud.speech.v1p1beta1.IWordInfo=} [properties] Properties to set
|
12265 | * @returns {google.cloud.speech.v1p1beta1.WordInfo} WordInfo instance
|
12266 | */
|
12267 | WordInfo.create = function create(properties) {
|
12268 | return new WordInfo(properties);
|
12269 | };
|
12270 |
|
12271 | /**
|
12272 | * Encodes the specified WordInfo message. Does not implicitly {@link google.cloud.speech.v1p1beta1.WordInfo.verify|verify} messages.
|
12273 | * @function encode
|
12274 | * @memberof google.cloud.speech.v1p1beta1.WordInfo
|
12275 | * @static
|
12276 | * @param {google.cloud.speech.v1p1beta1.IWordInfo} message WordInfo message or plain object to encode
|
12277 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
12278 | * @returns {$protobuf.Writer} Writer
|
12279 | */
|
12280 | WordInfo.encode = function encode(message, writer) {
|
12281 | if (!writer)
|
12282 | writer = $Writer.create();
|
12283 | if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime"))
|
12284 | $root.google.protobuf.Duration.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
12285 | if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime"))
|
12286 | $root.google.protobuf.Duration.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
12287 | if (message.word != null && Object.hasOwnProperty.call(message, "word"))
|
12288 | writer.uint32(/* id 3, wireType 2 =*/26).string(message.word);
|
12289 | if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence"))
|
12290 | writer.uint32(/* id 4, wireType 5 =*/37).float(message.confidence);
|
12291 | if (message.speakerTag != null && Object.hasOwnProperty.call(message, "speakerTag"))
|
12292 | writer.uint32(/* id 5, wireType 0 =*/40).int32(message.speakerTag);
|
12293 | return writer;
|
12294 | };
|
12295 |
|
12296 | /**
|
12297 | * Encodes the specified WordInfo message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.WordInfo.verify|verify} messages.
|
12298 | * @function encodeDelimited
|
12299 | * @memberof google.cloud.speech.v1p1beta1.WordInfo
|
12300 | * @static
|
12301 | * @param {google.cloud.speech.v1p1beta1.IWordInfo} message WordInfo message or plain object to encode
|
12302 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
12303 | * @returns {$protobuf.Writer} Writer
|
12304 | */
|
12305 | WordInfo.encodeDelimited = function encodeDelimited(message, writer) {
|
12306 | return this.encode(message, writer).ldelim();
|
12307 | };
|
12308 |
|
12309 | /**
|
12310 | * Decodes a WordInfo message from the specified reader or buffer.
|
12311 | * @function decode
|
12312 | * @memberof google.cloud.speech.v1p1beta1.WordInfo
|
12313 | * @static
|
12314 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
12315 | * @param {number} [length] Message length if known beforehand
|
12316 | * @returns {google.cloud.speech.v1p1beta1.WordInfo} WordInfo
|
12317 | * @throws {Error} If the payload is not a reader or valid buffer
|
12318 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
12319 | */
|
12320 | WordInfo.decode = function decode(reader, length) {
|
12321 | if (!(reader instanceof $Reader))
|
12322 | reader = $Reader.create(reader);
|
12323 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.WordInfo();
|
12324 | while (reader.pos < end) {
|
12325 | var tag = reader.uint32();
|
12326 | switch (tag >>> 3) {
|
12327 | case 1:
|
12328 | message.startTime = $root.google.protobuf.Duration.decode(reader, reader.uint32());
|
12329 | break;
|
12330 | case 2:
|
12331 | message.endTime = $root.google.protobuf.Duration.decode(reader, reader.uint32());
|
12332 | break;
|
12333 | case 3:
|
12334 | message.word = reader.string();
|
12335 | break;
|
12336 | case 4:
|
12337 | message.confidence = reader.float();
|
12338 | break;
|
12339 | case 5:
|
12340 | message.speakerTag = reader.int32();
|
12341 | break;
|
12342 | default:
|
12343 | reader.skipType(tag & 7);
|
12344 | break;
|
12345 | }
|
12346 | }
|
12347 | return message;
|
12348 | };
|
12349 |
|
12350 | /**
|
12351 | * Decodes a WordInfo message from the specified reader or buffer, length delimited.
|
12352 | * @function decodeDelimited
|
12353 | * @memberof google.cloud.speech.v1p1beta1.WordInfo
|
12354 | * @static
|
12355 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
12356 | * @returns {google.cloud.speech.v1p1beta1.WordInfo} WordInfo
|
12357 | * @throws {Error} If the payload is not a reader or valid buffer
|
12358 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
12359 | */
|
12360 | WordInfo.decodeDelimited = function decodeDelimited(reader) {
|
12361 | if (!(reader instanceof $Reader))
|
12362 | reader = new $Reader(reader);
|
12363 | return this.decode(reader, reader.uint32());
|
12364 | };
|
12365 |
|
12366 | /**
|
12367 | * Verifies a WordInfo message.
|
12368 | * @function verify
|
12369 | * @memberof google.cloud.speech.v1p1beta1.WordInfo
|
12370 | * @static
|
12371 | * @param {Object.<string,*>} message Plain object to verify
|
12372 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
12373 | */
|
12374 | WordInfo.verify = function verify(message) {
|
12375 | if (typeof message !== "object" || message === null)
|
12376 | return "object expected";
|
12377 | if (message.startTime != null && message.hasOwnProperty("startTime")) {
|
12378 | var error = $root.google.protobuf.Duration.verify(message.startTime);
|
12379 | if (error)
|
12380 | return "startTime." + error;
|
12381 | }
|
12382 | if (message.endTime != null && message.hasOwnProperty("endTime")) {
|
12383 | var error = $root.google.protobuf.Duration.verify(message.endTime);
|
12384 | if (error)
|
12385 | return "endTime." + error;
|
12386 | }
|
12387 | if (message.word != null && message.hasOwnProperty("word"))
|
12388 | if (!$util.isString(message.word))
|
12389 | return "word: string expected";
|
12390 | if (message.confidence != null && message.hasOwnProperty("confidence"))
|
12391 | if (typeof message.confidence !== "number")
|
12392 | return "confidence: number expected";
|
12393 | if (message.speakerTag != null && message.hasOwnProperty("speakerTag"))
|
12394 | if (!$util.isInteger(message.speakerTag))
|
12395 | return "speakerTag: integer expected";
|
12396 | return null;
|
12397 | };
|
12398 |
|
12399 | /**
|
12400 | * Creates a WordInfo message from a plain object. Also converts values to their respective internal types.
|
12401 | * @function fromObject
|
12402 | * @memberof google.cloud.speech.v1p1beta1.WordInfo
|
12403 | * @static
|
12404 | * @param {Object.<string,*>} object Plain object
|
12405 | * @returns {google.cloud.speech.v1p1beta1.WordInfo} WordInfo
|
12406 | */
|
12407 | WordInfo.fromObject = function fromObject(object) {
|
12408 | if (object instanceof $root.google.cloud.speech.v1p1beta1.WordInfo)
|
12409 | return object;
|
12410 | var message = new $root.google.cloud.speech.v1p1beta1.WordInfo();
|
12411 | if (object.startTime != null) {
|
12412 | if (typeof object.startTime !== "object")
|
12413 | throw TypeError(".google.cloud.speech.v1p1beta1.WordInfo.startTime: object expected");
|
12414 | message.startTime = $root.google.protobuf.Duration.fromObject(object.startTime);
|
12415 | }
|
12416 | if (object.endTime != null) {
|
12417 | if (typeof object.endTime !== "object")
|
12418 | throw TypeError(".google.cloud.speech.v1p1beta1.WordInfo.endTime: object expected");
|
12419 | message.endTime = $root.google.protobuf.Duration.fromObject(object.endTime);
|
12420 | }
|
12421 | if (object.word != null)
|
12422 | message.word = String(object.word);
|
12423 | if (object.confidence != null)
|
12424 | message.confidence = Number(object.confidence);
|
12425 | if (object.speakerTag != null)
|
12426 | message.speakerTag = object.speakerTag | 0;
|
12427 | return message;
|
12428 | };
|
12429 |
|
12430 | /**
|
12431 | * Creates a plain object from a WordInfo message. Also converts values to other types if specified.
|
12432 | * @function toObject
|
12433 | * @memberof google.cloud.speech.v1p1beta1.WordInfo
|
12434 | * @static
|
12435 | * @param {google.cloud.speech.v1p1beta1.WordInfo} message WordInfo
|
12436 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
12437 | * @returns {Object.<string,*>} Plain object
|
12438 | */
|
12439 | WordInfo.toObject = function toObject(message, options) {
|
12440 | if (!options)
|
12441 | options = {};
|
12442 | var object = {};
|
12443 | if (options.defaults) {
|
12444 | object.startTime = null;
|
12445 | object.endTime = null;
|
12446 | object.word = "";
|
12447 | object.confidence = 0;
|
12448 | object.speakerTag = 0;
|
12449 | }
|
12450 | if (message.startTime != null && message.hasOwnProperty("startTime"))
|
12451 | object.startTime = $root.google.protobuf.Duration.toObject(message.startTime, options);
|
12452 | if (message.endTime != null && message.hasOwnProperty("endTime"))
|
12453 | object.endTime = $root.google.protobuf.Duration.toObject(message.endTime, options);
|
12454 | if (message.word != null && message.hasOwnProperty("word"))
|
12455 | object.word = message.word;
|
12456 | if (message.confidence != null && message.hasOwnProperty("confidence"))
|
12457 | object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence;
|
12458 | if (message.speakerTag != null && message.hasOwnProperty("speakerTag"))
|
12459 | object.speakerTag = message.speakerTag;
|
12460 | return object;
|
12461 | };
|
12462 |
|
12463 | /**
|
12464 | * Converts this WordInfo to JSON.
|
12465 | * @function toJSON
|
12466 | * @memberof google.cloud.speech.v1p1beta1.WordInfo
|
12467 | * @instance
|
12468 | * @returns {Object.<string,*>} JSON object
|
12469 | */
|
12470 | WordInfo.prototype.toJSON = function toJSON() {
|
12471 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
12472 | };
|
12473 |
|
12474 | return WordInfo;
|
12475 | })();
|
12476 |
|
12477 | v1p1beta1.CustomClass = (function() {
|
12478 |
|
12479 | /**
|
12480 | * Properties of a CustomClass.
|
12481 | * @memberof google.cloud.speech.v1p1beta1
|
12482 | * @interface ICustomClass
|
12483 | * @property {string|null} [name] CustomClass name
|
12484 | * @property {string|null} [customClassId] CustomClass customClassId
|
12485 | * @property {Array.<google.cloud.speech.v1p1beta1.CustomClass.IClassItem>|null} [items] CustomClass items
|
12486 | */
|
12487 |
|
12488 | /**
|
12489 | * Constructs a new CustomClass.
|
12490 | * @memberof google.cloud.speech.v1p1beta1
|
12491 | * @classdesc Represents a CustomClass.
|
12492 | * @implements ICustomClass
|
12493 | * @constructor
|
12494 | * @param {google.cloud.speech.v1p1beta1.ICustomClass=} [properties] Properties to set
|
12495 | */
|
12496 | function CustomClass(properties) {
|
12497 | this.items = [];
|
12498 | if (properties)
|
12499 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
12500 | if (properties[keys[i]] != null)
|
12501 | this[keys[i]] = properties[keys[i]];
|
12502 | }
|
12503 |
|
12504 | /**
|
12505 | * CustomClass name.
|
12506 | * @member {string} name
|
12507 | * @memberof google.cloud.speech.v1p1beta1.CustomClass
|
12508 | * @instance
|
12509 | */
|
12510 | CustomClass.prototype.name = "";
|
12511 |
|
12512 | /**
|
12513 | * CustomClass customClassId.
|
12514 | * @member {string} customClassId
|
12515 | * @memberof google.cloud.speech.v1p1beta1.CustomClass
|
12516 | * @instance
|
12517 | */
|
12518 | CustomClass.prototype.customClassId = "";
|
12519 |
|
12520 | /**
|
12521 | * CustomClass items.
|
12522 | * @member {Array.<google.cloud.speech.v1p1beta1.CustomClass.IClassItem>} items
|
12523 | * @memberof google.cloud.speech.v1p1beta1.CustomClass
|
12524 | * @instance
|
12525 | */
|
12526 | CustomClass.prototype.items = $util.emptyArray;
|
12527 |
|
12528 | /**
|
12529 | * Creates a new CustomClass instance using the specified properties.
|
12530 | * @function create
|
12531 | * @memberof google.cloud.speech.v1p1beta1.CustomClass
|
12532 | * @static
|
12533 | * @param {google.cloud.speech.v1p1beta1.ICustomClass=} [properties] Properties to set
|
12534 | * @returns {google.cloud.speech.v1p1beta1.CustomClass} CustomClass instance
|
12535 | */
|
12536 | CustomClass.create = function create(properties) {
|
12537 | return new CustomClass(properties);
|
12538 | };
|
12539 |
|
12540 | /**
|
12541 | * Encodes the specified CustomClass message. Does not implicitly {@link google.cloud.speech.v1p1beta1.CustomClass.verify|verify} messages.
|
12542 | * @function encode
|
12543 | * @memberof google.cloud.speech.v1p1beta1.CustomClass
|
12544 | * @static
|
12545 | * @param {google.cloud.speech.v1p1beta1.ICustomClass} message CustomClass message or plain object to encode
|
12546 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
12547 | * @returns {$protobuf.Writer} Writer
|
12548 | */
|
12549 | CustomClass.encode = function encode(message, writer) {
|
12550 | if (!writer)
|
12551 | writer = $Writer.create();
|
12552 | if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
12553 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
|
12554 | if (message.customClassId != null && Object.hasOwnProperty.call(message, "customClassId"))
|
12555 | writer.uint32(/* id 2, wireType 2 =*/18).string(message.customClassId);
|
12556 | if (message.items != null && message.items.length)
|
12557 | for (var i = 0; i < message.items.length; ++i)
|
12558 | $root.google.cloud.speech.v1p1beta1.CustomClass.ClassItem.encode(message.items[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
|
12559 | return writer;
|
12560 | };
|
12561 |
|
12562 | /**
|
12563 | * Encodes the specified CustomClass message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.CustomClass.verify|verify} messages.
|
12564 | * @function encodeDelimited
|
12565 | * @memberof google.cloud.speech.v1p1beta1.CustomClass
|
12566 | * @static
|
12567 | * @param {google.cloud.speech.v1p1beta1.ICustomClass} message CustomClass message or plain object to encode
|
12568 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
12569 | * @returns {$protobuf.Writer} Writer
|
12570 | */
|
12571 | CustomClass.encodeDelimited = function encodeDelimited(message, writer) {
|
12572 | return this.encode(message, writer).ldelim();
|
12573 | };
|
12574 |
|
12575 | /**
|
12576 | * Decodes a CustomClass message from the specified reader or buffer.
|
12577 | * @function decode
|
12578 | * @memberof google.cloud.speech.v1p1beta1.CustomClass
|
12579 | * @static
|
12580 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
12581 | * @param {number} [length] Message length if known beforehand
|
12582 | * @returns {google.cloud.speech.v1p1beta1.CustomClass} CustomClass
|
12583 | * @throws {Error} If the payload is not a reader or valid buffer
|
12584 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
12585 | */
|
12586 | CustomClass.decode = function decode(reader, length) {
|
12587 | if (!(reader instanceof $Reader))
|
12588 | reader = $Reader.create(reader);
|
12589 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.CustomClass();
|
12590 | while (reader.pos < end) {
|
12591 | var tag = reader.uint32();
|
12592 | switch (tag >>> 3) {
|
12593 | case 1:
|
12594 | message.name = reader.string();
|
12595 | break;
|
12596 | case 2:
|
12597 | message.customClassId = reader.string();
|
12598 | break;
|
12599 | case 3:
|
12600 | if (!(message.items && message.items.length))
|
12601 | message.items = [];
|
12602 | message.items.push($root.google.cloud.speech.v1p1beta1.CustomClass.ClassItem.decode(reader, reader.uint32()));
|
12603 | break;
|
12604 | default:
|
12605 | reader.skipType(tag & 7);
|
12606 | break;
|
12607 | }
|
12608 | }
|
12609 | return message;
|
12610 | };
|
12611 |
|
12612 | /**
|
12613 | * Decodes a CustomClass message from the specified reader or buffer, length delimited.
|
12614 | * @function decodeDelimited
|
12615 | * @memberof google.cloud.speech.v1p1beta1.CustomClass
|
12616 | * @static
|
12617 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
12618 | * @returns {google.cloud.speech.v1p1beta1.CustomClass} CustomClass
|
12619 | * @throws {Error} If the payload is not a reader or valid buffer
|
12620 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
12621 | */
|
12622 | CustomClass.decodeDelimited = function decodeDelimited(reader) {
|
12623 | if (!(reader instanceof $Reader))
|
12624 | reader = new $Reader(reader);
|
12625 | return this.decode(reader, reader.uint32());
|
12626 | };
|
12627 |
|
12628 | /**
|
12629 | * Verifies a CustomClass message.
|
12630 | * @function verify
|
12631 | * @memberof google.cloud.speech.v1p1beta1.CustomClass
|
12632 | * @static
|
12633 | * @param {Object.<string,*>} message Plain object to verify
|
12634 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
12635 | */
|
12636 | CustomClass.verify = function verify(message) {
|
12637 | if (typeof message !== "object" || message === null)
|
12638 | return "object expected";
|
12639 | if (message.name != null && message.hasOwnProperty("name"))
|
12640 | if (!$util.isString(message.name))
|
12641 | return "name: string expected";
|
12642 | if (message.customClassId != null && message.hasOwnProperty("customClassId"))
|
12643 | if (!$util.isString(message.customClassId))
|
12644 | return "customClassId: string expected";
|
12645 | if (message.items != null && message.hasOwnProperty("items")) {
|
12646 | if (!Array.isArray(message.items))
|
12647 | return "items: array expected";
|
12648 | for (var i = 0; i < message.items.length; ++i) {
|
12649 | var error = $root.google.cloud.speech.v1p1beta1.CustomClass.ClassItem.verify(message.items[i]);
|
12650 | if (error)
|
12651 | return "items." + error;
|
12652 | }
|
12653 | }
|
12654 | return null;
|
12655 | };
|
12656 |
|
12657 | /**
|
12658 | * Creates a CustomClass message from a plain object. Also converts values to their respective internal types.
|
12659 | * @function fromObject
|
12660 | * @memberof google.cloud.speech.v1p1beta1.CustomClass
|
12661 | * @static
|
12662 | * @param {Object.<string,*>} object Plain object
|
12663 | * @returns {google.cloud.speech.v1p1beta1.CustomClass} CustomClass
|
12664 | */
|
12665 | CustomClass.fromObject = function fromObject(object) {
|
12666 | if (object instanceof $root.google.cloud.speech.v1p1beta1.CustomClass)
|
12667 | return object;
|
12668 | var message = new $root.google.cloud.speech.v1p1beta1.CustomClass();
|
12669 | if (object.name != null)
|
12670 | message.name = String(object.name);
|
12671 | if (object.customClassId != null)
|
12672 | message.customClassId = String(object.customClassId);
|
12673 | if (object.items) {
|
12674 | if (!Array.isArray(object.items))
|
12675 | throw TypeError(".google.cloud.speech.v1p1beta1.CustomClass.items: array expected");
|
12676 | message.items = [];
|
12677 | for (var i = 0; i < object.items.length; ++i) {
|
12678 | if (typeof object.items[i] !== "object")
|
12679 | throw TypeError(".google.cloud.speech.v1p1beta1.CustomClass.items: object expected");
|
12680 | message.items[i] = $root.google.cloud.speech.v1p1beta1.CustomClass.ClassItem.fromObject(object.items[i]);
|
12681 | }
|
12682 | }
|
12683 | return message;
|
12684 | };
|
12685 |
|
12686 | /**
|
12687 | * Creates a plain object from a CustomClass message. Also converts values to other types if specified.
|
12688 | * @function toObject
|
12689 | * @memberof google.cloud.speech.v1p1beta1.CustomClass
|
12690 | * @static
|
12691 | * @param {google.cloud.speech.v1p1beta1.CustomClass} message CustomClass
|
12692 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
12693 | * @returns {Object.<string,*>} Plain object
|
12694 | */
|
12695 | CustomClass.toObject = function toObject(message, options) {
|
12696 | if (!options)
|
12697 | options = {};
|
12698 | var object = {};
|
12699 | if (options.arrays || options.defaults)
|
12700 | object.items = [];
|
12701 | if (options.defaults) {
|
12702 | object.name = "";
|
12703 | object.customClassId = "";
|
12704 | }
|
12705 | if (message.name != null && message.hasOwnProperty("name"))
|
12706 | object.name = message.name;
|
12707 | if (message.customClassId != null && message.hasOwnProperty("customClassId"))
|
12708 | object.customClassId = message.customClassId;
|
12709 | if (message.items && message.items.length) {
|
12710 | object.items = [];
|
12711 | for (var j = 0; j < message.items.length; ++j)
|
12712 | object.items[j] = $root.google.cloud.speech.v1p1beta1.CustomClass.ClassItem.toObject(message.items[j], options);
|
12713 | }
|
12714 | return object;
|
12715 | };
|
12716 |
|
12717 | /**
|
12718 | * Converts this CustomClass to JSON.
|
12719 | * @function toJSON
|
12720 | * @memberof google.cloud.speech.v1p1beta1.CustomClass
|
12721 | * @instance
|
12722 | * @returns {Object.<string,*>} JSON object
|
12723 | */
|
12724 | CustomClass.prototype.toJSON = function toJSON() {
|
12725 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
12726 | };
|
12727 |
|
12728 | CustomClass.ClassItem = (function() {
|
12729 |
|
12730 | /**
|
12731 | * Properties of a ClassItem.
|
12732 | * @memberof google.cloud.speech.v1p1beta1.CustomClass
|
12733 | * @interface IClassItem
|
12734 | * @property {string|null} [value] ClassItem value
|
12735 | */
|
12736 |
|
12737 | /**
|
12738 | * Constructs a new ClassItem.
|
12739 | * @memberof google.cloud.speech.v1p1beta1.CustomClass
|
12740 | * @classdesc Represents a ClassItem.
|
12741 | * @implements IClassItem
|
12742 | * @constructor
|
12743 | * @param {google.cloud.speech.v1p1beta1.CustomClass.IClassItem=} [properties] Properties to set
|
12744 | */
|
12745 | function ClassItem(properties) {
|
12746 | if (properties)
|
12747 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
12748 | if (properties[keys[i]] != null)
|
12749 | this[keys[i]] = properties[keys[i]];
|
12750 | }
|
12751 |
|
12752 | /**
|
12753 | * ClassItem value.
|
12754 | * @member {string} value
|
12755 | * @memberof google.cloud.speech.v1p1beta1.CustomClass.ClassItem
|
12756 | * @instance
|
12757 | */
|
12758 | ClassItem.prototype.value = "";
|
12759 |
|
12760 | /**
|
12761 | * Creates a new ClassItem instance using the specified properties.
|
12762 | * @function create
|
12763 | * @memberof google.cloud.speech.v1p1beta1.CustomClass.ClassItem
|
12764 | * @static
|
12765 | * @param {google.cloud.speech.v1p1beta1.CustomClass.IClassItem=} [properties] Properties to set
|
12766 | * @returns {google.cloud.speech.v1p1beta1.CustomClass.ClassItem} ClassItem instance
|
12767 | */
|
12768 | ClassItem.create = function create(properties) {
|
12769 | return new ClassItem(properties);
|
12770 | };
|
12771 |
|
12772 | /**
|
12773 | * Encodes the specified ClassItem message. Does not implicitly {@link google.cloud.speech.v1p1beta1.CustomClass.ClassItem.verify|verify} messages.
|
12774 | * @function encode
|
12775 | * @memberof google.cloud.speech.v1p1beta1.CustomClass.ClassItem
|
12776 | * @static
|
12777 | * @param {google.cloud.speech.v1p1beta1.CustomClass.IClassItem} message ClassItem message or plain object to encode
|
12778 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
12779 | * @returns {$protobuf.Writer} Writer
|
12780 | */
|
12781 | ClassItem.encode = function encode(message, writer) {
|
12782 | if (!writer)
|
12783 | writer = $Writer.create();
|
12784 | if (message.value != null && Object.hasOwnProperty.call(message, "value"))
|
12785 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.value);
|
12786 | return writer;
|
12787 | };
|
12788 |
|
12789 | /**
|
12790 | * Encodes the specified ClassItem message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.CustomClass.ClassItem.verify|verify} messages.
|
12791 | * @function encodeDelimited
|
12792 | * @memberof google.cloud.speech.v1p1beta1.CustomClass.ClassItem
|
12793 | * @static
|
12794 | * @param {google.cloud.speech.v1p1beta1.CustomClass.IClassItem} message ClassItem message or plain object to encode
|
12795 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
12796 | * @returns {$protobuf.Writer} Writer
|
12797 | */
|
12798 | ClassItem.encodeDelimited = function encodeDelimited(message, writer) {
|
12799 | return this.encode(message, writer).ldelim();
|
12800 | };
|
12801 |
|
12802 | /**
|
12803 | * Decodes a ClassItem message from the specified reader or buffer.
|
12804 | * @function decode
|
12805 | * @memberof google.cloud.speech.v1p1beta1.CustomClass.ClassItem
|
12806 | * @static
|
12807 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
12808 | * @param {number} [length] Message length if known beforehand
|
12809 | * @returns {google.cloud.speech.v1p1beta1.CustomClass.ClassItem} ClassItem
|
12810 | * @throws {Error} If the payload is not a reader or valid buffer
|
12811 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
12812 | */
|
12813 | ClassItem.decode = function decode(reader, length) {
|
12814 | if (!(reader instanceof $Reader))
|
12815 | reader = $Reader.create(reader);
|
12816 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.CustomClass.ClassItem();
|
12817 | while (reader.pos < end) {
|
12818 | var tag = reader.uint32();
|
12819 | switch (tag >>> 3) {
|
12820 | case 1:
|
12821 | message.value = reader.string();
|
12822 | break;
|
12823 | default:
|
12824 | reader.skipType(tag & 7);
|
12825 | break;
|
12826 | }
|
12827 | }
|
12828 | return message;
|
12829 | };
|
12830 |
|
12831 | /**
|
12832 | * Decodes a ClassItem message from the specified reader or buffer, length delimited.
|
12833 | * @function decodeDelimited
|
12834 | * @memberof google.cloud.speech.v1p1beta1.CustomClass.ClassItem
|
12835 | * @static
|
12836 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
12837 | * @returns {google.cloud.speech.v1p1beta1.CustomClass.ClassItem} ClassItem
|
12838 | * @throws {Error} If the payload is not a reader or valid buffer
|
12839 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
12840 | */
|
12841 | ClassItem.decodeDelimited = function decodeDelimited(reader) {
|
12842 | if (!(reader instanceof $Reader))
|
12843 | reader = new $Reader(reader);
|
12844 | return this.decode(reader, reader.uint32());
|
12845 | };
|
12846 |
|
12847 | /**
|
12848 | * Verifies a ClassItem message.
|
12849 | * @function verify
|
12850 | * @memberof google.cloud.speech.v1p1beta1.CustomClass.ClassItem
|
12851 | * @static
|
12852 | * @param {Object.<string,*>} message Plain object to verify
|
12853 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
12854 | */
|
12855 | ClassItem.verify = function verify(message) {
|
12856 | if (typeof message !== "object" || message === null)
|
12857 | return "object expected";
|
12858 | if (message.value != null && message.hasOwnProperty("value"))
|
12859 | if (!$util.isString(message.value))
|
12860 | return "value: string expected";
|
12861 | return null;
|
12862 | };
|
12863 |
|
12864 | /**
|
12865 | * Creates a ClassItem message from a plain object. Also converts values to their respective internal types.
|
12866 | * @function fromObject
|
12867 | * @memberof google.cloud.speech.v1p1beta1.CustomClass.ClassItem
|
12868 | * @static
|
12869 | * @param {Object.<string,*>} object Plain object
|
12870 | * @returns {google.cloud.speech.v1p1beta1.CustomClass.ClassItem} ClassItem
|
12871 | */
|
12872 | ClassItem.fromObject = function fromObject(object) {
|
12873 | if (object instanceof $root.google.cloud.speech.v1p1beta1.CustomClass.ClassItem)
|
12874 | return object;
|
12875 | var message = new $root.google.cloud.speech.v1p1beta1.CustomClass.ClassItem();
|
12876 | if (object.value != null)
|
12877 | message.value = String(object.value);
|
12878 | return message;
|
12879 | };
|
12880 |
|
12881 | /**
|
12882 | * Creates a plain object from a ClassItem message. Also converts values to other types if specified.
|
12883 | * @function toObject
|
12884 | * @memberof google.cloud.speech.v1p1beta1.CustomClass.ClassItem
|
12885 | * @static
|
12886 | * @param {google.cloud.speech.v1p1beta1.CustomClass.ClassItem} message ClassItem
|
12887 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
12888 | * @returns {Object.<string,*>} Plain object
|
12889 | */
|
12890 | ClassItem.toObject = function toObject(message, options) {
|
12891 | if (!options)
|
12892 | options = {};
|
12893 | var object = {};
|
12894 | if (options.defaults)
|
12895 | object.value = "";
|
12896 | if (message.value != null && message.hasOwnProperty("value"))
|
12897 | object.value = message.value;
|
12898 | return object;
|
12899 | };
|
12900 |
|
12901 | /**
|
12902 | * Converts this ClassItem to JSON.
|
12903 | * @function toJSON
|
12904 | * @memberof google.cloud.speech.v1p1beta1.CustomClass.ClassItem
|
12905 | * @instance
|
12906 | * @returns {Object.<string,*>} JSON object
|
12907 | */
|
12908 | ClassItem.prototype.toJSON = function toJSON() {
|
12909 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
12910 | };
|
12911 |
|
12912 | return ClassItem;
|
12913 | })();
|
12914 |
|
12915 | return CustomClass;
|
12916 | })();
|
12917 |
|
12918 | v1p1beta1.PhraseSet = (function() {
|
12919 |
|
12920 | /**
|
12921 | * Properties of a PhraseSet.
|
12922 | * @memberof google.cloud.speech.v1p1beta1
|
12923 | * @interface IPhraseSet
|
12924 | * @property {string|null} [name] PhraseSet name
|
12925 | * @property {Array.<google.cloud.speech.v1p1beta1.PhraseSet.IPhrase>|null} [phrases] PhraseSet phrases
|
12926 | * @property {number|null} [boost] PhraseSet boost
|
12927 | */
|
12928 |
|
12929 | /**
|
12930 | * Constructs a new PhraseSet.
|
12931 | * @memberof google.cloud.speech.v1p1beta1
|
12932 | * @classdesc Represents a PhraseSet.
|
12933 | * @implements IPhraseSet
|
12934 | * @constructor
|
12935 | * @param {google.cloud.speech.v1p1beta1.IPhraseSet=} [properties] Properties to set
|
12936 | */
|
12937 | function PhraseSet(properties) {
|
12938 | this.phrases = [];
|
12939 | if (properties)
|
12940 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
12941 | if (properties[keys[i]] != null)
|
12942 | this[keys[i]] = properties[keys[i]];
|
12943 | }
|
12944 |
|
12945 | /**
|
12946 | * PhraseSet name.
|
12947 | * @member {string} name
|
12948 | * @memberof google.cloud.speech.v1p1beta1.PhraseSet
|
12949 | * @instance
|
12950 | */
|
12951 | PhraseSet.prototype.name = "";
|
12952 |
|
12953 | /**
|
12954 | * PhraseSet phrases.
|
12955 | * @member {Array.<google.cloud.speech.v1p1beta1.PhraseSet.IPhrase>} phrases
|
12956 | * @memberof google.cloud.speech.v1p1beta1.PhraseSet
|
12957 | * @instance
|
12958 | */
|
12959 | PhraseSet.prototype.phrases = $util.emptyArray;
|
12960 |
|
12961 | /**
|
12962 | * PhraseSet boost.
|
12963 | * @member {number} boost
|
12964 | * @memberof google.cloud.speech.v1p1beta1.PhraseSet
|
12965 | * @instance
|
12966 | */
|
12967 | PhraseSet.prototype.boost = 0;
|
12968 |
|
12969 | /**
|
12970 | * Creates a new PhraseSet instance using the specified properties.
|
12971 | * @function create
|
12972 | * @memberof google.cloud.speech.v1p1beta1.PhraseSet
|
12973 | * @static
|
12974 | * @param {google.cloud.speech.v1p1beta1.IPhraseSet=} [properties] Properties to set
|
12975 | * @returns {google.cloud.speech.v1p1beta1.PhraseSet} PhraseSet instance
|
12976 | */
|
12977 | PhraseSet.create = function create(properties) {
|
12978 | return new PhraseSet(properties);
|
12979 | };
|
12980 |
|
12981 | /**
|
12982 | * Encodes the specified PhraseSet message. Does not implicitly {@link google.cloud.speech.v1p1beta1.PhraseSet.verify|verify} messages.
|
12983 | * @function encode
|
12984 | * @memberof google.cloud.speech.v1p1beta1.PhraseSet
|
12985 | * @static
|
12986 | * @param {google.cloud.speech.v1p1beta1.IPhraseSet} message PhraseSet message or plain object to encode
|
12987 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
12988 | * @returns {$protobuf.Writer} Writer
|
12989 | */
|
12990 | PhraseSet.encode = function encode(message, writer) {
|
12991 | if (!writer)
|
12992 | writer = $Writer.create();
|
12993 | if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
12994 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
|
12995 | if (message.phrases != null && message.phrases.length)
|
12996 | for (var i = 0; i < message.phrases.length; ++i)
|
12997 | $root.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.encode(message.phrases[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
12998 | if (message.boost != null && Object.hasOwnProperty.call(message, "boost"))
|
12999 | writer.uint32(/* id 4, wireType 5 =*/37).float(message.boost);
|
13000 | return writer;
|
13001 | };
|
13002 |
|
13003 | /**
|
13004 | * Encodes the specified PhraseSet message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.PhraseSet.verify|verify} messages.
|
13005 | * @function encodeDelimited
|
13006 | * @memberof google.cloud.speech.v1p1beta1.PhraseSet
|
13007 | * @static
|
13008 | * @param {google.cloud.speech.v1p1beta1.IPhraseSet} message PhraseSet message or plain object to encode
|
13009 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
13010 | * @returns {$protobuf.Writer} Writer
|
13011 | */
|
13012 | PhraseSet.encodeDelimited = function encodeDelimited(message, writer) {
|
13013 | return this.encode(message, writer).ldelim();
|
13014 | };
|
13015 |
|
13016 | /**
|
13017 | * Decodes a PhraseSet message from the specified reader or buffer.
|
13018 | * @function decode
|
13019 | * @memberof google.cloud.speech.v1p1beta1.PhraseSet
|
13020 | * @static
|
13021 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
13022 | * @param {number} [length] Message length if known beforehand
|
13023 | * @returns {google.cloud.speech.v1p1beta1.PhraseSet} PhraseSet
|
13024 | * @throws {Error} If the payload is not a reader or valid buffer
|
13025 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
13026 | */
|
13027 | PhraseSet.decode = function decode(reader, length) {
|
13028 | if (!(reader instanceof $Reader))
|
13029 | reader = $Reader.create(reader);
|
13030 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.PhraseSet();
|
13031 | while (reader.pos < end) {
|
13032 | var tag = reader.uint32();
|
13033 | switch (tag >>> 3) {
|
13034 | case 1:
|
13035 | message.name = reader.string();
|
13036 | break;
|
13037 | case 2:
|
13038 | if (!(message.phrases && message.phrases.length))
|
13039 | message.phrases = [];
|
13040 | message.phrases.push($root.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.decode(reader, reader.uint32()));
|
13041 | break;
|
13042 | case 4:
|
13043 | message.boost = reader.float();
|
13044 | break;
|
13045 | default:
|
13046 | reader.skipType(tag & 7);
|
13047 | break;
|
13048 | }
|
13049 | }
|
13050 | return message;
|
13051 | };
|
13052 |
|
13053 | /**
|
13054 | * Decodes a PhraseSet message from the specified reader or buffer, length delimited.
|
13055 | * @function decodeDelimited
|
13056 | * @memberof google.cloud.speech.v1p1beta1.PhraseSet
|
13057 | * @static
|
13058 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
13059 | * @returns {google.cloud.speech.v1p1beta1.PhraseSet} PhraseSet
|
13060 | * @throws {Error} If the payload is not a reader or valid buffer
|
13061 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
13062 | */
|
13063 | PhraseSet.decodeDelimited = function decodeDelimited(reader) {
|
13064 | if (!(reader instanceof $Reader))
|
13065 | reader = new $Reader(reader);
|
13066 | return this.decode(reader, reader.uint32());
|
13067 | };
|
13068 |
|
13069 | /**
|
13070 | * Verifies a PhraseSet message.
|
13071 | * @function verify
|
13072 | * @memberof google.cloud.speech.v1p1beta1.PhraseSet
|
13073 | * @static
|
13074 | * @param {Object.<string,*>} message Plain object to verify
|
13075 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
13076 | */
|
13077 | PhraseSet.verify = function verify(message) {
|
13078 | if (typeof message !== "object" || message === null)
|
13079 | return "object expected";
|
13080 | if (message.name != null && message.hasOwnProperty("name"))
|
13081 | if (!$util.isString(message.name))
|
13082 | return "name: string expected";
|
13083 | if (message.phrases != null && message.hasOwnProperty("phrases")) {
|
13084 | if (!Array.isArray(message.phrases))
|
13085 | return "phrases: array expected";
|
13086 | for (var i = 0; i < message.phrases.length; ++i) {
|
13087 | var error = $root.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.verify(message.phrases[i]);
|
13088 | if (error)
|
13089 | return "phrases." + error;
|
13090 | }
|
13091 | }
|
13092 | if (message.boost != null && message.hasOwnProperty("boost"))
|
13093 | if (typeof message.boost !== "number")
|
13094 | return "boost: number expected";
|
13095 | return null;
|
13096 | };
|
13097 |
|
13098 | /**
|
13099 | * Creates a PhraseSet message from a plain object. Also converts values to their respective internal types.
|
13100 | * @function fromObject
|
13101 | * @memberof google.cloud.speech.v1p1beta1.PhraseSet
|
13102 | * @static
|
13103 | * @param {Object.<string,*>} object Plain object
|
13104 | * @returns {google.cloud.speech.v1p1beta1.PhraseSet} PhraseSet
|
13105 | */
|
13106 | PhraseSet.fromObject = function fromObject(object) {
|
13107 | if (object instanceof $root.google.cloud.speech.v1p1beta1.PhraseSet)
|
13108 | return object;
|
13109 | var message = new $root.google.cloud.speech.v1p1beta1.PhraseSet();
|
13110 | if (object.name != null)
|
13111 | message.name = String(object.name);
|
13112 | if (object.phrases) {
|
13113 | if (!Array.isArray(object.phrases))
|
13114 | throw TypeError(".google.cloud.speech.v1p1beta1.PhraseSet.phrases: array expected");
|
13115 | message.phrases = [];
|
13116 | for (var i = 0; i < object.phrases.length; ++i) {
|
13117 | if (typeof object.phrases[i] !== "object")
|
13118 | throw TypeError(".google.cloud.speech.v1p1beta1.PhraseSet.phrases: object expected");
|
13119 | message.phrases[i] = $root.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.fromObject(object.phrases[i]);
|
13120 | }
|
13121 | }
|
13122 | if (object.boost != null)
|
13123 | message.boost = Number(object.boost);
|
13124 | return message;
|
13125 | };
|
13126 |
|
13127 | /**
|
13128 | * Creates a plain object from a PhraseSet message. Also converts values to other types if specified.
|
13129 | * @function toObject
|
13130 | * @memberof google.cloud.speech.v1p1beta1.PhraseSet
|
13131 | * @static
|
13132 | * @param {google.cloud.speech.v1p1beta1.PhraseSet} message PhraseSet
|
13133 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
13134 | * @returns {Object.<string,*>} Plain object
|
13135 | */
|
13136 | PhraseSet.toObject = function toObject(message, options) {
|
13137 | if (!options)
|
13138 | options = {};
|
13139 | var object = {};
|
13140 | if (options.arrays || options.defaults)
|
13141 | object.phrases = [];
|
13142 | if (options.defaults) {
|
13143 | object.name = "";
|
13144 | object.boost = 0;
|
13145 | }
|
13146 | if (message.name != null && message.hasOwnProperty("name"))
|
13147 | object.name = message.name;
|
13148 | if (message.phrases && message.phrases.length) {
|
13149 | object.phrases = [];
|
13150 | for (var j = 0; j < message.phrases.length; ++j)
|
13151 | object.phrases[j] = $root.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.toObject(message.phrases[j], options);
|
13152 | }
|
13153 | if (message.boost != null && message.hasOwnProperty("boost"))
|
13154 | object.boost = options.json && !isFinite(message.boost) ? String(message.boost) : message.boost;
|
13155 | return object;
|
13156 | };
|
13157 |
|
13158 | /**
|
13159 | * Converts this PhraseSet to JSON.
|
13160 | * @function toJSON
|
13161 | * @memberof google.cloud.speech.v1p1beta1.PhraseSet
|
13162 | * @instance
|
13163 | * @returns {Object.<string,*>} JSON object
|
13164 | */
|
13165 | PhraseSet.prototype.toJSON = function toJSON() {
|
13166 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
13167 | };
|
13168 |
|
13169 | PhraseSet.Phrase = (function() {
|
13170 |
|
13171 | /**
|
13172 | * Properties of a Phrase.
|
13173 | * @memberof google.cloud.speech.v1p1beta1.PhraseSet
|
13174 | * @interface IPhrase
|
13175 | * @property {string|null} [value] Phrase value
|
13176 | * @property {number|null} [boost] Phrase boost
|
13177 | */
|
13178 |
|
13179 | /**
|
13180 | * Constructs a new Phrase.
|
13181 | * @memberof google.cloud.speech.v1p1beta1.PhraseSet
|
13182 | * @classdesc Represents a Phrase.
|
13183 | * @implements IPhrase
|
13184 | * @constructor
|
13185 | * @param {google.cloud.speech.v1p1beta1.PhraseSet.IPhrase=} [properties] Properties to set
|
13186 | */
|
13187 | function Phrase(properties) {
|
13188 | if (properties)
|
13189 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
13190 | if (properties[keys[i]] != null)
|
13191 | this[keys[i]] = properties[keys[i]];
|
13192 | }
|
13193 |
|
13194 | /**
|
13195 | * Phrase value.
|
13196 | * @member {string} value
|
13197 | * @memberof google.cloud.speech.v1p1beta1.PhraseSet.Phrase
|
13198 | * @instance
|
13199 | */
|
13200 | Phrase.prototype.value = "";
|
13201 |
|
13202 | /**
|
13203 | * Phrase boost.
|
13204 | * @member {number} boost
|
13205 | * @memberof google.cloud.speech.v1p1beta1.PhraseSet.Phrase
|
13206 | * @instance
|
13207 | */
|
13208 | Phrase.prototype.boost = 0;
|
13209 |
|
13210 | /**
|
13211 | * Creates a new Phrase instance using the specified properties.
|
13212 | * @function create
|
13213 | * @memberof google.cloud.speech.v1p1beta1.PhraseSet.Phrase
|
13214 | * @static
|
13215 | * @param {google.cloud.speech.v1p1beta1.PhraseSet.IPhrase=} [properties] Properties to set
|
13216 | * @returns {google.cloud.speech.v1p1beta1.PhraseSet.Phrase} Phrase instance
|
13217 | */
|
13218 | Phrase.create = function create(properties) {
|
13219 | return new Phrase(properties);
|
13220 | };
|
13221 |
|
13222 | /**
|
13223 | * Encodes the specified Phrase message. Does not implicitly {@link google.cloud.speech.v1p1beta1.PhraseSet.Phrase.verify|verify} messages.
|
13224 | * @function encode
|
13225 | * @memberof google.cloud.speech.v1p1beta1.PhraseSet.Phrase
|
13226 | * @static
|
13227 | * @param {google.cloud.speech.v1p1beta1.PhraseSet.IPhrase} message Phrase message or plain object to encode
|
13228 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
13229 | * @returns {$protobuf.Writer} Writer
|
13230 | */
|
13231 | Phrase.encode = function encode(message, writer) {
|
13232 | if (!writer)
|
13233 | writer = $Writer.create();
|
13234 | if (message.value != null && Object.hasOwnProperty.call(message, "value"))
|
13235 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.value);
|
13236 | if (message.boost != null && Object.hasOwnProperty.call(message, "boost"))
|
13237 | writer.uint32(/* id 2, wireType 5 =*/21).float(message.boost);
|
13238 | return writer;
|
13239 | };
|
13240 |
|
13241 | /**
|
13242 | * Encodes the specified Phrase message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.PhraseSet.Phrase.verify|verify} messages.
|
13243 | * @function encodeDelimited
|
13244 | * @memberof google.cloud.speech.v1p1beta1.PhraseSet.Phrase
|
13245 | * @static
|
13246 | * @param {google.cloud.speech.v1p1beta1.PhraseSet.IPhrase} message Phrase message or plain object to encode
|
13247 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
13248 | * @returns {$protobuf.Writer} Writer
|
13249 | */
|
13250 | Phrase.encodeDelimited = function encodeDelimited(message, writer) {
|
13251 | return this.encode(message, writer).ldelim();
|
13252 | };
|
13253 |
|
13254 | /**
|
13255 | * Decodes a Phrase message from the specified reader or buffer.
|
13256 | * @function decode
|
13257 | * @memberof google.cloud.speech.v1p1beta1.PhraseSet.Phrase
|
13258 | * @static
|
13259 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
13260 | * @param {number} [length] Message length if known beforehand
|
13261 | * @returns {google.cloud.speech.v1p1beta1.PhraseSet.Phrase} Phrase
|
13262 | * @throws {Error} If the payload is not a reader or valid buffer
|
13263 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
13264 | */
|
13265 | Phrase.decode = function decode(reader, length) {
|
13266 | if (!(reader instanceof $Reader))
|
13267 | reader = $Reader.create(reader);
|
13268 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.PhraseSet.Phrase();
|
13269 | while (reader.pos < end) {
|
13270 | var tag = reader.uint32();
|
13271 | switch (tag >>> 3) {
|
13272 | case 1:
|
13273 | message.value = reader.string();
|
13274 | break;
|
13275 | case 2:
|
13276 | message.boost = reader.float();
|
13277 | break;
|
13278 | default:
|
13279 | reader.skipType(tag & 7);
|
13280 | break;
|
13281 | }
|
13282 | }
|
13283 | return message;
|
13284 | };
|
13285 |
|
13286 | /**
|
13287 | * Decodes a Phrase message from the specified reader or buffer, length delimited.
|
13288 | * @function decodeDelimited
|
13289 | * @memberof google.cloud.speech.v1p1beta1.PhraseSet.Phrase
|
13290 | * @static
|
13291 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
13292 | * @returns {google.cloud.speech.v1p1beta1.PhraseSet.Phrase} Phrase
|
13293 | * @throws {Error} If the payload is not a reader or valid buffer
|
13294 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
13295 | */
|
13296 | Phrase.decodeDelimited = function decodeDelimited(reader) {
|
13297 | if (!(reader instanceof $Reader))
|
13298 | reader = new $Reader(reader);
|
13299 | return this.decode(reader, reader.uint32());
|
13300 | };
|
13301 |
|
13302 | /**
|
13303 | * Verifies a Phrase message.
|
13304 | * @function verify
|
13305 | * @memberof google.cloud.speech.v1p1beta1.PhraseSet.Phrase
|
13306 | * @static
|
13307 | * @param {Object.<string,*>} message Plain object to verify
|
13308 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
13309 | */
|
13310 | Phrase.verify = function verify(message) {
|
13311 | if (typeof message !== "object" || message === null)
|
13312 | return "object expected";
|
13313 | if (message.value != null && message.hasOwnProperty("value"))
|
13314 | if (!$util.isString(message.value))
|
13315 | return "value: string expected";
|
13316 | if (message.boost != null && message.hasOwnProperty("boost"))
|
13317 | if (typeof message.boost !== "number")
|
13318 | return "boost: number expected";
|
13319 | return null;
|
13320 | };
|
13321 |
|
13322 | /**
|
13323 | * Creates a Phrase message from a plain object. Also converts values to their respective internal types.
|
13324 | * @function fromObject
|
13325 | * @memberof google.cloud.speech.v1p1beta1.PhraseSet.Phrase
|
13326 | * @static
|
13327 | * @param {Object.<string,*>} object Plain object
|
13328 | * @returns {google.cloud.speech.v1p1beta1.PhraseSet.Phrase} Phrase
|
13329 | */
|
13330 | Phrase.fromObject = function fromObject(object) {
|
13331 | if (object instanceof $root.google.cloud.speech.v1p1beta1.PhraseSet.Phrase)
|
13332 | return object;
|
13333 | var message = new $root.google.cloud.speech.v1p1beta1.PhraseSet.Phrase();
|
13334 | if (object.value != null)
|
13335 | message.value = String(object.value);
|
13336 | if (object.boost != null)
|
13337 | message.boost = Number(object.boost);
|
13338 | return message;
|
13339 | };
|
13340 |
|
13341 | /**
|
13342 | * Creates a plain object from a Phrase message. Also converts values to other types if specified.
|
13343 | * @function toObject
|
13344 | * @memberof google.cloud.speech.v1p1beta1.PhraseSet.Phrase
|
13345 | * @static
|
13346 | * @param {google.cloud.speech.v1p1beta1.PhraseSet.Phrase} message Phrase
|
13347 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
13348 | * @returns {Object.<string,*>} Plain object
|
13349 | */
|
13350 | Phrase.toObject = function toObject(message, options) {
|
13351 | if (!options)
|
13352 | options = {};
|
13353 | var object = {};
|
13354 | if (options.defaults) {
|
13355 | object.value = "";
|
13356 | object.boost = 0;
|
13357 | }
|
13358 | if (message.value != null && message.hasOwnProperty("value"))
|
13359 | object.value = message.value;
|
13360 | if (message.boost != null && message.hasOwnProperty("boost"))
|
13361 | object.boost = options.json && !isFinite(message.boost) ? String(message.boost) : message.boost;
|
13362 | return object;
|
13363 | };
|
13364 |
|
13365 | /**
|
13366 | * Converts this Phrase to JSON.
|
13367 | * @function toJSON
|
13368 | * @memberof google.cloud.speech.v1p1beta1.PhraseSet.Phrase
|
13369 | * @instance
|
13370 | * @returns {Object.<string,*>} JSON object
|
13371 | */
|
13372 | Phrase.prototype.toJSON = function toJSON() {
|
13373 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
13374 | };
|
13375 |
|
13376 | return Phrase;
|
13377 | })();
|
13378 |
|
13379 | return PhraseSet;
|
13380 | })();
|
13381 |
|
13382 | v1p1beta1.SpeechAdaptation = (function() {
|
13383 |
|
13384 | /**
|
13385 | * Properties of a SpeechAdaptation.
|
13386 | * @memberof google.cloud.speech.v1p1beta1
|
13387 | * @interface ISpeechAdaptation
|
13388 | * @property {Array.<google.cloud.speech.v1p1beta1.IPhraseSet>|null} [phraseSets] SpeechAdaptation phraseSets
|
13389 | * @property {Array.<string>|null} [phraseSetReferences] SpeechAdaptation phraseSetReferences
|
13390 | * @property {Array.<google.cloud.speech.v1p1beta1.ICustomClass>|null} [customClasses] SpeechAdaptation customClasses
|
13391 | */
|
13392 |
|
13393 | /**
|
13394 | * Constructs a new SpeechAdaptation.
|
13395 | * @memberof google.cloud.speech.v1p1beta1
|
13396 | * @classdesc Represents a SpeechAdaptation.
|
13397 | * @implements ISpeechAdaptation
|
13398 | * @constructor
|
13399 | * @param {google.cloud.speech.v1p1beta1.ISpeechAdaptation=} [properties] Properties to set
|
13400 | */
|
13401 | function SpeechAdaptation(properties) {
|
13402 | this.phraseSets = [];
|
13403 | this.phraseSetReferences = [];
|
13404 | this.customClasses = [];
|
13405 | if (properties)
|
13406 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
13407 | if (properties[keys[i]] != null)
|
13408 | this[keys[i]] = properties[keys[i]];
|
13409 | }
|
13410 |
|
13411 | /**
|
13412 | * SpeechAdaptation phraseSets.
|
13413 | * @member {Array.<google.cloud.speech.v1p1beta1.IPhraseSet>} phraseSets
|
13414 | * @memberof google.cloud.speech.v1p1beta1.SpeechAdaptation
|
13415 | * @instance
|
13416 | */
|
13417 | SpeechAdaptation.prototype.phraseSets = $util.emptyArray;
|
13418 |
|
13419 | /**
|
13420 | * SpeechAdaptation phraseSetReferences.
|
13421 | * @member {Array.<string>} phraseSetReferences
|
13422 | * @memberof google.cloud.speech.v1p1beta1.SpeechAdaptation
|
13423 | * @instance
|
13424 | */
|
13425 | SpeechAdaptation.prototype.phraseSetReferences = $util.emptyArray;
|
13426 |
|
13427 | /**
|
13428 | * SpeechAdaptation customClasses.
|
13429 | * @member {Array.<google.cloud.speech.v1p1beta1.ICustomClass>} customClasses
|
13430 | * @memberof google.cloud.speech.v1p1beta1.SpeechAdaptation
|
13431 | * @instance
|
13432 | */
|
13433 | SpeechAdaptation.prototype.customClasses = $util.emptyArray;
|
13434 |
|
13435 | /**
|
13436 | * Creates a new SpeechAdaptation instance using the specified properties.
|
13437 | * @function create
|
13438 | * @memberof google.cloud.speech.v1p1beta1.SpeechAdaptation
|
13439 | * @static
|
13440 | * @param {google.cloud.speech.v1p1beta1.ISpeechAdaptation=} [properties] Properties to set
|
13441 | * @returns {google.cloud.speech.v1p1beta1.SpeechAdaptation} SpeechAdaptation instance
|
13442 | */
|
13443 | SpeechAdaptation.create = function create(properties) {
|
13444 | return new SpeechAdaptation(properties);
|
13445 | };
|
13446 |
|
13447 | /**
|
13448 | * Encodes the specified SpeechAdaptation message. Does not implicitly {@link google.cloud.speech.v1p1beta1.SpeechAdaptation.verify|verify} messages.
|
13449 | * @function encode
|
13450 | * @memberof google.cloud.speech.v1p1beta1.SpeechAdaptation
|
13451 | * @static
|
13452 | * @param {google.cloud.speech.v1p1beta1.ISpeechAdaptation} message SpeechAdaptation message or plain object to encode
|
13453 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
13454 | * @returns {$protobuf.Writer} Writer
|
13455 | */
|
13456 | SpeechAdaptation.encode = function encode(message, writer) {
|
13457 | if (!writer)
|
13458 | writer = $Writer.create();
|
13459 | if (message.phraseSets != null && message.phraseSets.length)
|
13460 | for (var i = 0; i < message.phraseSets.length; ++i)
|
13461 | $root.google.cloud.speech.v1p1beta1.PhraseSet.encode(message.phraseSets[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
13462 | if (message.phraseSetReferences != null && message.phraseSetReferences.length)
|
13463 | for (var i = 0; i < message.phraseSetReferences.length; ++i)
|
13464 | writer.uint32(/* id 2, wireType 2 =*/18).string(message.phraseSetReferences[i]);
|
13465 | if (message.customClasses != null && message.customClasses.length)
|
13466 | for (var i = 0; i < message.customClasses.length; ++i)
|
13467 | $root.google.cloud.speech.v1p1beta1.CustomClass.encode(message.customClasses[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
|
13468 | return writer;
|
13469 | };
|
13470 |
|
13471 | /**
|
13472 | * Encodes the specified SpeechAdaptation message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.SpeechAdaptation.verify|verify} messages.
|
13473 | * @function encodeDelimited
|
13474 | * @memberof google.cloud.speech.v1p1beta1.SpeechAdaptation
|
13475 | * @static
|
13476 | * @param {google.cloud.speech.v1p1beta1.ISpeechAdaptation} message SpeechAdaptation message or plain object to encode
|
13477 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
13478 | * @returns {$protobuf.Writer} Writer
|
13479 | */
|
13480 | SpeechAdaptation.encodeDelimited = function encodeDelimited(message, writer) {
|
13481 | return this.encode(message, writer).ldelim();
|
13482 | };
|
13483 |
|
13484 | /**
|
13485 | * Decodes a SpeechAdaptation message from the specified reader or buffer.
|
13486 | * @function decode
|
13487 | * @memberof google.cloud.speech.v1p1beta1.SpeechAdaptation
|
13488 | * @static
|
13489 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
13490 | * @param {number} [length] Message length if known beforehand
|
13491 | * @returns {google.cloud.speech.v1p1beta1.SpeechAdaptation} SpeechAdaptation
|
13492 | * @throws {Error} If the payload is not a reader or valid buffer
|
13493 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
13494 | */
|
13495 | SpeechAdaptation.decode = function decode(reader, length) {
|
13496 | if (!(reader instanceof $Reader))
|
13497 | reader = $Reader.create(reader);
|
13498 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.SpeechAdaptation();
|
13499 | while (reader.pos < end) {
|
13500 | var tag = reader.uint32();
|
13501 | switch (tag >>> 3) {
|
13502 | case 1:
|
13503 | if (!(message.phraseSets && message.phraseSets.length))
|
13504 | message.phraseSets = [];
|
13505 | message.phraseSets.push($root.google.cloud.speech.v1p1beta1.PhraseSet.decode(reader, reader.uint32()));
|
13506 | break;
|
13507 | case 2:
|
13508 | if (!(message.phraseSetReferences && message.phraseSetReferences.length))
|
13509 | message.phraseSetReferences = [];
|
13510 | message.phraseSetReferences.push(reader.string());
|
13511 | break;
|
13512 | case 3:
|
13513 | if (!(message.customClasses && message.customClasses.length))
|
13514 | message.customClasses = [];
|
13515 | message.customClasses.push($root.google.cloud.speech.v1p1beta1.CustomClass.decode(reader, reader.uint32()));
|
13516 | break;
|
13517 | default:
|
13518 | reader.skipType(tag & 7);
|
13519 | break;
|
13520 | }
|
13521 | }
|
13522 | return message;
|
13523 | };
|
13524 |
|
13525 | /**
|
13526 | * Decodes a SpeechAdaptation message from the specified reader or buffer, length delimited.
|
13527 | * @function decodeDelimited
|
13528 | * @memberof google.cloud.speech.v1p1beta1.SpeechAdaptation
|
13529 | * @static
|
13530 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
13531 | * @returns {google.cloud.speech.v1p1beta1.SpeechAdaptation} SpeechAdaptation
|
13532 | * @throws {Error} If the payload is not a reader or valid buffer
|
13533 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
13534 | */
|
13535 | SpeechAdaptation.decodeDelimited = function decodeDelimited(reader) {
|
13536 | if (!(reader instanceof $Reader))
|
13537 | reader = new $Reader(reader);
|
13538 | return this.decode(reader, reader.uint32());
|
13539 | };
|
13540 |
|
13541 | /**
|
13542 | * Verifies a SpeechAdaptation message.
|
13543 | * @function verify
|
13544 | * @memberof google.cloud.speech.v1p1beta1.SpeechAdaptation
|
13545 | * @static
|
13546 | * @param {Object.<string,*>} message Plain object to verify
|
13547 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
13548 | */
|
13549 | SpeechAdaptation.verify = function verify(message) {
|
13550 | if (typeof message !== "object" || message === null)
|
13551 | return "object expected";
|
13552 | if (message.phraseSets != null && message.hasOwnProperty("phraseSets")) {
|
13553 | if (!Array.isArray(message.phraseSets))
|
13554 | return "phraseSets: array expected";
|
13555 | for (var i = 0; i < message.phraseSets.length; ++i) {
|
13556 | var error = $root.google.cloud.speech.v1p1beta1.PhraseSet.verify(message.phraseSets[i]);
|
13557 | if (error)
|
13558 | return "phraseSets." + error;
|
13559 | }
|
13560 | }
|
13561 | if (message.phraseSetReferences != null && message.hasOwnProperty("phraseSetReferences")) {
|
13562 | if (!Array.isArray(message.phraseSetReferences))
|
13563 | return "phraseSetReferences: array expected";
|
13564 | for (var i = 0; i < message.phraseSetReferences.length; ++i)
|
13565 | if (!$util.isString(message.phraseSetReferences[i]))
|
13566 | return "phraseSetReferences: string[] expected";
|
13567 | }
|
13568 | if (message.customClasses != null && message.hasOwnProperty("customClasses")) {
|
13569 | if (!Array.isArray(message.customClasses))
|
13570 | return "customClasses: array expected";
|
13571 | for (var i = 0; i < message.customClasses.length; ++i) {
|
13572 | var error = $root.google.cloud.speech.v1p1beta1.CustomClass.verify(message.customClasses[i]);
|
13573 | if (error)
|
13574 | return "customClasses." + error;
|
13575 | }
|
13576 | }
|
13577 | return null;
|
13578 | };
|
13579 |
|
13580 | /**
|
13581 | * Creates a SpeechAdaptation message from a plain object. Also converts values to their respective internal types.
|
13582 | * @function fromObject
|
13583 | * @memberof google.cloud.speech.v1p1beta1.SpeechAdaptation
|
13584 | * @static
|
13585 | * @param {Object.<string,*>} object Plain object
|
13586 | * @returns {google.cloud.speech.v1p1beta1.SpeechAdaptation} SpeechAdaptation
|
13587 | */
|
13588 | SpeechAdaptation.fromObject = function fromObject(object) {
|
13589 | if (object instanceof $root.google.cloud.speech.v1p1beta1.SpeechAdaptation)
|
13590 | return object;
|
13591 | var message = new $root.google.cloud.speech.v1p1beta1.SpeechAdaptation();
|
13592 | if (object.phraseSets) {
|
13593 | if (!Array.isArray(object.phraseSets))
|
13594 | throw TypeError(".google.cloud.speech.v1p1beta1.SpeechAdaptation.phraseSets: array expected");
|
13595 | message.phraseSets = [];
|
13596 | for (var i = 0; i < object.phraseSets.length; ++i) {
|
13597 | if (typeof object.phraseSets[i] !== "object")
|
13598 | throw TypeError(".google.cloud.speech.v1p1beta1.SpeechAdaptation.phraseSets: object expected");
|
13599 | message.phraseSets[i] = $root.google.cloud.speech.v1p1beta1.PhraseSet.fromObject(object.phraseSets[i]);
|
13600 | }
|
13601 | }
|
13602 | if (object.phraseSetReferences) {
|
13603 | if (!Array.isArray(object.phraseSetReferences))
|
13604 | throw TypeError(".google.cloud.speech.v1p1beta1.SpeechAdaptation.phraseSetReferences: array expected");
|
13605 | message.phraseSetReferences = [];
|
13606 | for (var i = 0; i < object.phraseSetReferences.length; ++i)
|
13607 | message.phraseSetReferences[i] = String(object.phraseSetReferences[i]);
|
13608 | }
|
13609 | if (object.customClasses) {
|
13610 | if (!Array.isArray(object.customClasses))
|
13611 | throw TypeError(".google.cloud.speech.v1p1beta1.SpeechAdaptation.customClasses: array expected");
|
13612 | message.customClasses = [];
|
13613 | for (var i = 0; i < object.customClasses.length; ++i) {
|
13614 | if (typeof object.customClasses[i] !== "object")
|
13615 | throw TypeError(".google.cloud.speech.v1p1beta1.SpeechAdaptation.customClasses: object expected");
|
13616 | message.customClasses[i] = $root.google.cloud.speech.v1p1beta1.CustomClass.fromObject(object.customClasses[i]);
|
13617 | }
|
13618 | }
|
13619 | return message;
|
13620 | };
|
13621 |
|
13622 | /**
|
13623 | * Creates a plain object from a SpeechAdaptation message. Also converts values to other types if specified.
|
13624 | * @function toObject
|
13625 | * @memberof google.cloud.speech.v1p1beta1.SpeechAdaptation
|
13626 | * @static
|
13627 | * @param {google.cloud.speech.v1p1beta1.SpeechAdaptation} message SpeechAdaptation
|
13628 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
13629 | * @returns {Object.<string,*>} Plain object
|
13630 | */
|
13631 | SpeechAdaptation.toObject = function toObject(message, options) {
|
13632 | if (!options)
|
13633 | options = {};
|
13634 | var object = {};
|
13635 | if (options.arrays || options.defaults) {
|
13636 | object.phraseSets = [];
|
13637 | object.phraseSetReferences = [];
|
13638 | object.customClasses = [];
|
13639 | }
|
13640 | if (message.phraseSets && message.phraseSets.length) {
|
13641 | object.phraseSets = [];
|
13642 | for (var j = 0; j < message.phraseSets.length; ++j)
|
13643 | object.phraseSets[j] = $root.google.cloud.speech.v1p1beta1.PhraseSet.toObject(message.phraseSets[j], options);
|
13644 | }
|
13645 | if (message.phraseSetReferences && message.phraseSetReferences.length) {
|
13646 | object.phraseSetReferences = [];
|
13647 | for (var j = 0; j < message.phraseSetReferences.length; ++j)
|
13648 | object.phraseSetReferences[j] = message.phraseSetReferences[j];
|
13649 | }
|
13650 | if (message.customClasses && message.customClasses.length) {
|
13651 | object.customClasses = [];
|
13652 | for (var j = 0; j < message.customClasses.length; ++j)
|
13653 | object.customClasses[j] = $root.google.cloud.speech.v1p1beta1.CustomClass.toObject(message.customClasses[j], options);
|
13654 | }
|
13655 | return object;
|
13656 | };
|
13657 |
|
13658 | /**
|
13659 | * Converts this SpeechAdaptation to JSON.
|
13660 | * @function toJSON
|
13661 | * @memberof google.cloud.speech.v1p1beta1.SpeechAdaptation
|
13662 | * @instance
|
13663 | * @returns {Object.<string,*>} JSON object
|
13664 | */
|
13665 | SpeechAdaptation.prototype.toJSON = function toJSON() {
|
13666 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
13667 | };
|
13668 |
|
13669 | return SpeechAdaptation;
|
13670 | })();
|
13671 |
|
13672 | v1p1beta1.TranscriptNormalization = (function() {
|
13673 |
|
13674 | /**
|
13675 | * Properties of a TranscriptNormalization.
|
13676 | * @memberof google.cloud.speech.v1p1beta1
|
13677 | * @interface ITranscriptNormalization
|
13678 | * @property {Array.<google.cloud.speech.v1p1beta1.TranscriptNormalization.IEntry>|null} [entries] TranscriptNormalization entries
|
13679 | */
|
13680 |
|
13681 | /**
|
13682 | * Constructs a new TranscriptNormalization.
|
13683 | * @memberof google.cloud.speech.v1p1beta1
|
13684 | * @classdesc Represents a TranscriptNormalization.
|
13685 | * @implements ITranscriptNormalization
|
13686 | * @constructor
|
13687 | * @param {google.cloud.speech.v1p1beta1.ITranscriptNormalization=} [properties] Properties to set
|
13688 | */
|
13689 | function TranscriptNormalization(properties) {
|
13690 | this.entries = [];
|
13691 | if (properties)
|
13692 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
13693 | if (properties[keys[i]] != null)
|
13694 | this[keys[i]] = properties[keys[i]];
|
13695 | }
|
13696 |
|
13697 | /**
|
13698 | * TranscriptNormalization entries.
|
13699 | * @member {Array.<google.cloud.speech.v1p1beta1.TranscriptNormalization.IEntry>} entries
|
13700 | * @memberof google.cloud.speech.v1p1beta1.TranscriptNormalization
|
13701 | * @instance
|
13702 | */
|
13703 | TranscriptNormalization.prototype.entries = $util.emptyArray;
|
13704 |
|
13705 | /**
|
13706 | * Creates a new TranscriptNormalization instance using the specified properties.
|
13707 | * @function create
|
13708 | * @memberof google.cloud.speech.v1p1beta1.TranscriptNormalization
|
13709 | * @static
|
13710 | * @param {google.cloud.speech.v1p1beta1.ITranscriptNormalization=} [properties] Properties to set
|
13711 | * @returns {google.cloud.speech.v1p1beta1.TranscriptNormalization} TranscriptNormalization instance
|
13712 | */
|
13713 | TranscriptNormalization.create = function create(properties) {
|
13714 | return new TranscriptNormalization(properties);
|
13715 | };
|
13716 |
|
13717 | /**
|
13718 | * Encodes the specified TranscriptNormalization message. Does not implicitly {@link google.cloud.speech.v1p1beta1.TranscriptNormalization.verify|verify} messages.
|
13719 | * @function encode
|
13720 | * @memberof google.cloud.speech.v1p1beta1.TranscriptNormalization
|
13721 | * @static
|
13722 | * @param {google.cloud.speech.v1p1beta1.ITranscriptNormalization} message TranscriptNormalization message or plain object to encode
|
13723 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
13724 | * @returns {$protobuf.Writer} Writer
|
13725 | */
|
13726 | TranscriptNormalization.encode = function encode(message, writer) {
|
13727 | if (!writer)
|
13728 | writer = $Writer.create();
|
13729 | if (message.entries != null && message.entries.length)
|
13730 | for (var i = 0; i < message.entries.length; ++i)
|
13731 | $root.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry.encode(message.entries[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
13732 | return writer;
|
13733 | };
|
13734 |
|
13735 | /**
|
13736 | * Encodes the specified TranscriptNormalization message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.TranscriptNormalization.verify|verify} messages.
|
13737 | * @function encodeDelimited
|
13738 | * @memberof google.cloud.speech.v1p1beta1.TranscriptNormalization
|
13739 | * @static
|
13740 | * @param {google.cloud.speech.v1p1beta1.ITranscriptNormalization} message TranscriptNormalization message or plain object to encode
|
13741 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
13742 | * @returns {$protobuf.Writer} Writer
|
13743 | */
|
13744 | TranscriptNormalization.encodeDelimited = function encodeDelimited(message, writer) {
|
13745 | return this.encode(message, writer).ldelim();
|
13746 | };
|
13747 |
|
13748 | /**
|
13749 | * Decodes a TranscriptNormalization message from the specified reader or buffer.
|
13750 | * @function decode
|
13751 | * @memberof google.cloud.speech.v1p1beta1.TranscriptNormalization
|
13752 | * @static
|
13753 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
13754 | * @param {number} [length] Message length if known beforehand
|
13755 | * @returns {google.cloud.speech.v1p1beta1.TranscriptNormalization} TranscriptNormalization
|
13756 | * @throws {Error} If the payload is not a reader or valid buffer
|
13757 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
13758 | */
|
13759 | TranscriptNormalization.decode = function decode(reader, length) {
|
13760 | if (!(reader instanceof $Reader))
|
13761 | reader = $Reader.create(reader);
|
13762 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.TranscriptNormalization();
|
13763 | while (reader.pos < end) {
|
13764 | var tag = reader.uint32();
|
13765 | switch (tag >>> 3) {
|
13766 | case 1:
|
13767 | if (!(message.entries && message.entries.length))
|
13768 | message.entries = [];
|
13769 | message.entries.push($root.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry.decode(reader, reader.uint32()));
|
13770 | break;
|
13771 | default:
|
13772 | reader.skipType(tag & 7);
|
13773 | break;
|
13774 | }
|
13775 | }
|
13776 | return message;
|
13777 | };
|
13778 |
|
13779 | /**
|
13780 | * Decodes a TranscriptNormalization message from the specified reader or buffer, length delimited.
|
13781 | * @function decodeDelimited
|
13782 | * @memberof google.cloud.speech.v1p1beta1.TranscriptNormalization
|
13783 | * @static
|
13784 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
13785 | * @returns {google.cloud.speech.v1p1beta1.TranscriptNormalization} TranscriptNormalization
|
13786 | * @throws {Error} If the payload is not a reader or valid buffer
|
13787 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
13788 | */
|
13789 | TranscriptNormalization.decodeDelimited = function decodeDelimited(reader) {
|
13790 | if (!(reader instanceof $Reader))
|
13791 | reader = new $Reader(reader);
|
13792 | return this.decode(reader, reader.uint32());
|
13793 | };
|
13794 |
|
13795 | /**
|
13796 | * Verifies a TranscriptNormalization message.
|
13797 | * @function verify
|
13798 | * @memberof google.cloud.speech.v1p1beta1.TranscriptNormalization
|
13799 | * @static
|
13800 | * @param {Object.<string,*>} message Plain object to verify
|
13801 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
13802 | */
|
13803 | TranscriptNormalization.verify = function verify(message) {
|
13804 | if (typeof message !== "object" || message === null)
|
13805 | return "object expected";
|
13806 | if (message.entries != null && message.hasOwnProperty("entries")) {
|
13807 | if (!Array.isArray(message.entries))
|
13808 | return "entries: array expected";
|
13809 | for (var i = 0; i < message.entries.length; ++i) {
|
13810 | var error = $root.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry.verify(message.entries[i]);
|
13811 | if (error)
|
13812 | return "entries." + error;
|
13813 | }
|
13814 | }
|
13815 | return null;
|
13816 | };
|
13817 |
|
13818 | /**
|
13819 | * Creates a TranscriptNormalization message from a plain object. Also converts values to their respective internal types.
|
13820 | * @function fromObject
|
13821 | * @memberof google.cloud.speech.v1p1beta1.TranscriptNormalization
|
13822 | * @static
|
13823 | * @param {Object.<string,*>} object Plain object
|
13824 | * @returns {google.cloud.speech.v1p1beta1.TranscriptNormalization} TranscriptNormalization
|
13825 | */
|
13826 | TranscriptNormalization.fromObject = function fromObject(object) {
|
13827 | if (object instanceof $root.google.cloud.speech.v1p1beta1.TranscriptNormalization)
|
13828 | return object;
|
13829 | var message = new $root.google.cloud.speech.v1p1beta1.TranscriptNormalization();
|
13830 | if (object.entries) {
|
13831 | if (!Array.isArray(object.entries))
|
13832 | throw TypeError(".google.cloud.speech.v1p1beta1.TranscriptNormalization.entries: array expected");
|
13833 | message.entries = [];
|
13834 | for (var i = 0; i < object.entries.length; ++i) {
|
13835 | if (typeof object.entries[i] !== "object")
|
13836 | throw TypeError(".google.cloud.speech.v1p1beta1.TranscriptNormalization.entries: object expected");
|
13837 | message.entries[i] = $root.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry.fromObject(object.entries[i]);
|
13838 | }
|
13839 | }
|
13840 | return message;
|
13841 | };
|
13842 |
|
13843 | /**
|
13844 | * Creates a plain object from a TranscriptNormalization message. Also converts values to other types if specified.
|
13845 | * @function toObject
|
13846 | * @memberof google.cloud.speech.v1p1beta1.TranscriptNormalization
|
13847 | * @static
|
13848 | * @param {google.cloud.speech.v1p1beta1.TranscriptNormalization} message TranscriptNormalization
|
13849 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
13850 | * @returns {Object.<string,*>} Plain object
|
13851 | */
|
13852 | TranscriptNormalization.toObject = function toObject(message, options) {
|
13853 | if (!options)
|
13854 | options = {};
|
13855 | var object = {};
|
13856 | if (options.arrays || options.defaults)
|
13857 | object.entries = [];
|
13858 | if (message.entries && message.entries.length) {
|
13859 | object.entries = [];
|
13860 | for (var j = 0; j < message.entries.length; ++j)
|
13861 | object.entries[j] = $root.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry.toObject(message.entries[j], options);
|
13862 | }
|
13863 | return object;
|
13864 | };
|
13865 |
|
13866 | /**
|
13867 | * Converts this TranscriptNormalization to JSON.
|
13868 | * @function toJSON
|
13869 | * @memberof google.cloud.speech.v1p1beta1.TranscriptNormalization
|
13870 | * @instance
|
13871 | * @returns {Object.<string,*>} JSON object
|
13872 | */
|
13873 | TranscriptNormalization.prototype.toJSON = function toJSON() {
|
13874 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
13875 | };
|
13876 |
|
13877 | TranscriptNormalization.Entry = (function() {
|
13878 |
|
13879 | /**
|
13880 | * Properties of an Entry.
|
13881 | * @memberof google.cloud.speech.v1p1beta1.TranscriptNormalization
|
13882 | * @interface IEntry
|
13883 | * @property {string|null} [search] Entry search
|
13884 | * @property {string|null} [replace] Entry replace
|
13885 | * @property {boolean|null} [caseSensitive] Entry caseSensitive
|
13886 | */
|
13887 |
|
13888 | /**
|
13889 | * Constructs a new Entry.
|
13890 | * @memberof google.cloud.speech.v1p1beta1.TranscriptNormalization
|
13891 | * @classdesc Represents an Entry.
|
13892 | * @implements IEntry
|
13893 | * @constructor
|
13894 | * @param {google.cloud.speech.v1p1beta1.TranscriptNormalization.IEntry=} [properties] Properties to set
|
13895 | */
|
13896 | function Entry(properties) {
|
13897 | if (properties)
|
13898 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
13899 | if (properties[keys[i]] != null)
|
13900 | this[keys[i]] = properties[keys[i]];
|
13901 | }
|
13902 |
|
13903 | /**
|
13904 | * Entry search.
|
13905 | * @member {string} search
|
13906 | * @memberof google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry
|
13907 | * @instance
|
13908 | */
|
13909 | Entry.prototype.search = "";
|
13910 |
|
13911 | /**
|
13912 | * Entry replace.
|
13913 | * @member {string} replace
|
13914 | * @memberof google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry
|
13915 | * @instance
|
13916 | */
|
13917 | Entry.prototype.replace = "";
|
13918 |
|
13919 | /**
|
13920 | * Entry caseSensitive.
|
13921 | * @member {boolean} caseSensitive
|
13922 | * @memberof google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry
|
13923 | * @instance
|
13924 | */
|
13925 | Entry.prototype.caseSensitive = false;
|
13926 |
|
13927 | /**
|
13928 | * Creates a new Entry instance using the specified properties.
|
13929 | * @function create
|
13930 | * @memberof google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry
|
13931 | * @static
|
13932 | * @param {google.cloud.speech.v1p1beta1.TranscriptNormalization.IEntry=} [properties] Properties to set
|
13933 | * @returns {google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry} Entry instance
|
13934 | */
|
13935 | Entry.create = function create(properties) {
|
13936 | return new Entry(properties);
|
13937 | };
|
13938 |
|
13939 | /**
|
13940 | * Encodes the specified Entry message. Does not implicitly {@link google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry.verify|verify} messages.
|
13941 | * @function encode
|
13942 | * @memberof google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry
|
13943 | * @static
|
13944 | * @param {google.cloud.speech.v1p1beta1.TranscriptNormalization.IEntry} message Entry message or plain object to encode
|
13945 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
13946 | * @returns {$protobuf.Writer} Writer
|
13947 | */
|
13948 | Entry.encode = function encode(message, writer) {
|
13949 | if (!writer)
|
13950 | writer = $Writer.create();
|
13951 | if (message.search != null && Object.hasOwnProperty.call(message, "search"))
|
13952 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.search);
|
13953 | if (message.replace != null && Object.hasOwnProperty.call(message, "replace"))
|
13954 | writer.uint32(/* id 2, wireType 2 =*/18).string(message.replace);
|
13955 | if (message.caseSensitive != null && Object.hasOwnProperty.call(message, "caseSensitive"))
|
13956 | writer.uint32(/* id 3, wireType 0 =*/24).bool(message.caseSensitive);
|
13957 | return writer;
|
13958 | };
|
13959 |
|
13960 | /**
|
13961 | * Encodes the specified Entry message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry.verify|verify} messages.
|
13962 | * @function encodeDelimited
|
13963 | * @memberof google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry
|
13964 | * @static
|
13965 | * @param {google.cloud.speech.v1p1beta1.TranscriptNormalization.IEntry} message Entry message or plain object to encode
|
13966 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
13967 | * @returns {$protobuf.Writer} Writer
|
13968 | */
|
13969 | Entry.encodeDelimited = function encodeDelimited(message, writer) {
|
13970 | return this.encode(message, writer).ldelim();
|
13971 | };
|
13972 |
|
13973 | /**
|
13974 | * Decodes an Entry message from the specified reader or buffer.
|
13975 | * @function decode
|
13976 | * @memberof google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry
|
13977 | * @static
|
13978 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
13979 | * @param {number} [length] Message length if known beforehand
|
13980 | * @returns {google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry} Entry
|
13981 | * @throws {Error} If the payload is not a reader or valid buffer
|
13982 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
13983 | */
|
13984 | Entry.decode = function decode(reader, length) {
|
13985 | if (!(reader instanceof $Reader))
|
13986 | reader = $Reader.create(reader);
|
13987 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry();
|
13988 | while (reader.pos < end) {
|
13989 | var tag = reader.uint32();
|
13990 | switch (tag >>> 3) {
|
13991 | case 1:
|
13992 | message.search = reader.string();
|
13993 | break;
|
13994 | case 2:
|
13995 | message.replace = reader.string();
|
13996 | break;
|
13997 | case 3:
|
13998 | message.caseSensitive = reader.bool();
|
13999 | break;
|
14000 | default:
|
14001 | reader.skipType(tag & 7);
|
14002 | break;
|
14003 | }
|
14004 | }
|
14005 | return message;
|
14006 | };
|
14007 |
|
14008 | /**
|
14009 | * Decodes an Entry message from the specified reader or buffer, length delimited.
|
14010 | * @function decodeDelimited
|
14011 | * @memberof google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry
|
14012 | * @static
|
14013 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
14014 | * @returns {google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry} Entry
|
14015 | * @throws {Error} If the payload is not a reader or valid buffer
|
14016 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
14017 | */
|
14018 | Entry.decodeDelimited = function decodeDelimited(reader) {
|
14019 | if (!(reader instanceof $Reader))
|
14020 | reader = new $Reader(reader);
|
14021 | return this.decode(reader, reader.uint32());
|
14022 | };
|
14023 |
|
14024 | /**
|
14025 | * Verifies an Entry message.
|
14026 | * @function verify
|
14027 | * @memberof google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry
|
14028 | * @static
|
14029 | * @param {Object.<string,*>} message Plain object to verify
|
14030 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
14031 | */
|
14032 | Entry.verify = function verify(message) {
|
14033 | if (typeof message !== "object" || message === null)
|
14034 | return "object expected";
|
14035 | if (message.search != null && message.hasOwnProperty("search"))
|
14036 | if (!$util.isString(message.search))
|
14037 | return "search: string expected";
|
14038 | if (message.replace != null && message.hasOwnProperty("replace"))
|
14039 | if (!$util.isString(message.replace))
|
14040 | return "replace: string expected";
|
14041 | if (message.caseSensitive != null && message.hasOwnProperty("caseSensitive"))
|
14042 | if (typeof message.caseSensitive !== "boolean")
|
14043 | return "caseSensitive: boolean expected";
|
14044 | return null;
|
14045 | };
|
14046 |
|
14047 | /**
|
14048 | * Creates an Entry message from a plain object. Also converts values to their respective internal types.
|
14049 | * @function fromObject
|
14050 | * @memberof google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry
|
14051 | * @static
|
14052 | * @param {Object.<string,*>} object Plain object
|
14053 | * @returns {google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry} Entry
|
14054 | */
|
14055 | Entry.fromObject = function fromObject(object) {
|
14056 | if (object instanceof $root.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry)
|
14057 | return object;
|
14058 | var message = new $root.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry();
|
14059 | if (object.search != null)
|
14060 | message.search = String(object.search);
|
14061 | if (object.replace != null)
|
14062 | message.replace = String(object.replace);
|
14063 | if (object.caseSensitive != null)
|
14064 | message.caseSensitive = Boolean(object.caseSensitive);
|
14065 | return message;
|
14066 | };
|
14067 |
|
14068 | /**
|
14069 | * Creates a plain object from an Entry message. Also converts values to other types if specified.
|
14070 | * @function toObject
|
14071 | * @memberof google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry
|
14072 | * @static
|
14073 | * @param {google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry} message Entry
|
14074 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
14075 | * @returns {Object.<string,*>} Plain object
|
14076 | */
|
14077 | Entry.toObject = function toObject(message, options) {
|
14078 | if (!options)
|
14079 | options = {};
|
14080 | var object = {};
|
14081 | if (options.defaults) {
|
14082 | object.search = "";
|
14083 | object.replace = "";
|
14084 | object.caseSensitive = false;
|
14085 | }
|
14086 | if (message.search != null && message.hasOwnProperty("search"))
|
14087 | object.search = message.search;
|
14088 | if (message.replace != null && message.hasOwnProperty("replace"))
|
14089 | object.replace = message.replace;
|
14090 | if (message.caseSensitive != null && message.hasOwnProperty("caseSensitive"))
|
14091 | object.caseSensitive = message.caseSensitive;
|
14092 | return object;
|
14093 | };
|
14094 |
|
14095 | /**
|
14096 | * Converts this Entry to JSON.
|
14097 | * @function toJSON
|
14098 | * @memberof google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry
|
14099 | * @instance
|
14100 | * @returns {Object.<string,*>} JSON object
|
14101 | */
|
14102 | Entry.prototype.toJSON = function toJSON() {
|
14103 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
14104 | };
|
14105 |
|
14106 | return Entry;
|
14107 | })();
|
14108 |
|
14109 | return TranscriptNormalization;
|
14110 | })();
|
14111 |
|
14112 | v1p1beta1.Adaptation = (function() {
|
14113 |
|
14114 | /**
|
14115 | * Constructs a new Adaptation service.
|
14116 | * @memberof google.cloud.speech.v1p1beta1
|
14117 | * @classdesc Represents an Adaptation
|
14118 | * @extends $protobuf.rpc.Service
|
14119 | * @constructor
|
14120 | * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
|
14121 | * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
|
14122 | * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
|
14123 | */
|
14124 | function Adaptation(rpcImpl, requestDelimited, responseDelimited) {
|
14125 | $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);
|
14126 | }
|
14127 |
|
14128 | (Adaptation.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Adaptation;
|
14129 |
|
14130 | /**
|
14131 | * Creates new Adaptation service using the specified rpc implementation.
|
14132 | * @function create
|
14133 | * @memberof google.cloud.speech.v1p1beta1.Adaptation
|
14134 | * @static
|
14135 | * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
|
14136 | * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
|
14137 | * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
|
14138 | * @returns {Adaptation} RPC service. Useful where requests and/or responses are streamed.
|
14139 | */
|
14140 | Adaptation.create = function create(rpcImpl, requestDelimited, responseDelimited) {
|
14141 | return new this(rpcImpl, requestDelimited, responseDelimited);
|
14142 | };
|
14143 |
|
14144 | /**
|
14145 | * Callback as used by {@link google.cloud.speech.v1p1beta1.Adaptation#createPhraseSet}.
|
14146 | * @memberof google.cloud.speech.v1p1beta1.Adaptation
|
14147 | * @typedef CreatePhraseSetCallback
|
14148 | * @type {function}
|
14149 | * @param {Error|null} error Error, if any
|
14150 | * @param {google.cloud.speech.v1p1beta1.PhraseSet} [response] PhraseSet
|
14151 | */
|
14152 |
|
14153 | /**
|
14154 | * Calls CreatePhraseSet.
|
14155 | * @function createPhraseSet
|
14156 | * @memberof google.cloud.speech.v1p1beta1.Adaptation
|
14157 | * @instance
|
14158 | * @param {google.cloud.speech.v1p1beta1.ICreatePhraseSetRequest} request CreatePhraseSetRequest message or plain object
|
14159 | * @param {google.cloud.speech.v1p1beta1.Adaptation.CreatePhraseSetCallback} callback Node-style callback called with the error, if any, and PhraseSet
|
14160 | * @returns {undefined}
|
14161 | * @variation 1
|
14162 | */
|
14163 | Object.defineProperty(Adaptation.prototype.createPhraseSet = function createPhraseSet(request, callback) {
|
14164 | return this.rpcCall(createPhraseSet, $root.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest, $root.google.cloud.speech.v1p1beta1.PhraseSet, request, callback);
|
14165 | }, "name", { value: "CreatePhraseSet" });
|
14166 |
|
14167 | /**
|
14168 | * Calls CreatePhraseSet.
|
14169 | * @function createPhraseSet
|
14170 | * @memberof google.cloud.speech.v1p1beta1.Adaptation
|
14171 | * @instance
|
14172 | * @param {google.cloud.speech.v1p1beta1.ICreatePhraseSetRequest} request CreatePhraseSetRequest message or plain object
|
14173 | * @returns {Promise<google.cloud.speech.v1p1beta1.PhraseSet>} Promise
|
14174 | * @variation 2
|
14175 | */
|
14176 |
|
14177 | /**
|
14178 | * Callback as used by {@link google.cloud.speech.v1p1beta1.Adaptation#getPhraseSet}.
|
14179 | * @memberof google.cloud.speech.v1p1beta1.Adaptation
|
14180 | * @typedef GetPhraseSetCallback
|
14181 | * @type {function}
|
14182 | * @param {Error|null} error Error, if any
|
14183 | * @param {google.cloud.speech.v1p1beta1.PhraseSet} [response] PhraseSet
|
14184 | */
|
14185 |
|
14186 | /**
|
14187 | * Calls GetPhraseSet.
|
14188 | * @function getPhraseSet
|
14189 | * @memberof google.cloud.speech.v1p1beta1.Adaptation
|
14190 | * @instance
|
14191 | * @param {google.cloud.speech.v1p1beta1.IGetPhraseSetRequest} request GetPhraseSetRequest message or plain object
|
14192 | * @param {google.cloud.speech.v1p1beta1.Adaptation.GetPhraseSetCallback} callback Node-style callback called with the error, if any, and PhraseSet
|
14193 | * @returns {undefined}
|
14194 | * @variation 1
|
14195 | */
|
14196 | Object.defineProperty(Adaptation.prototype.getPhraseSet = function getPhraseSet(request, callback) {
|
14197 | return this.rpcCall(getPhraseSet, $root.google.cloud.speech.v1p1beta1.GetPhraseSetRequest, $root.google.cloud.speech.v1p1beta1.PhraseSet, request, callback);
|
14198 | }, "name", { value: "GetPhraseSet" });
|
14199 |
|
14200 | /**
|
14201 | * Calls GetPhraseSet.
|
14202 | * @function getPhraseSet
|
14203 | * @memberof google.cloud.speech.v1p1beta1.Adaptation
|
14204 | * @instance
|
14205 | * @param {google.cloud.speech.v1p1beta1.IGetPhraseSetRequest} request GetPhraseSetRequest message or plain object
|
14206 | * @returns {Promise<google.cloud.speech.v1p1beta1.PhraseSet>} Promise
|
14207 | * @variation 2
|
14208 | */
|
14209 |
|
14210 | /**
|
14211 | * Callback as used by {@link google.cloud.speech.v1p1beta1.Adaptation#listPhraseSet}.
|
14212 | * @memberof google.cloud.speech.v1p1beta1.Adaptation
|
14213 | * @typedef ListPhraseSetCallback
|
14214 | * @type {function}
|
14215 | * @param {Error|null} error Error, if any
|
14216 | * @param {google.cloud.speech.v1p1beta1.ListPhraseSetResponse} [response] ListPhraseSetResponse
|
14217 | */
|
14218 |
|
14219 | /**
|
14220 | * Calls ListPhraseSet.
|
14221 | * @function listPhraseSet
|
14222 | * @memberof google.cloud.speech.v1p1beta1.Adaptation
|
14223 | * @instance
|
14224 | * @param {google.cloud.speech.v1p1beta1.IListPhraseSetRequest} request ListPhraseSetRequest message or plain object
|
14225 | * @param {google.cloud.speech.v1p1beta1.Adaptation.ListPhraseSetCallback} callback Node-style callback called with the error, if any, and ListPhraseSetResponse
|
14226 | * @returns {undefined}
|
14227 | * @variation 1
|
14228 | */
|
14229 | Object.defineProperty(Adaptation.prototype.listPhraseSet = function listPhraseSet(request, callback) {
|
14230 | return this.rpcCall(listPhraseSet, $root.google.cloud.speech.v1p1beta1.ListPhraseSetRequest, $root.google.cloud.speech.v1p1beta1.ListPhraseSetResponse, request, callback);
|
14231 | }, "name", { value: "ListPhraseSet" });
|
14232 |
|
14233 | /**
|
14234 | * Calls ListPhraseSet.
|
14235 | * @function listPhraseSet
|
14236 | * @memberof google.cloud.speech.v1p1beta1.Adaptation
|
14237 | * @instance
|
14238 | * @param {google.cloud.speech.v1p1beta1.IListPhraseSetRequest} request ListPhraseSetRequest message or plain object
|
14239 | * @returns {Promise<google.cloud.speech.v1p1beta1.ListPhraseSetResponse>} Promise
|
14240 | * @variation 2
|
14241 | */
|
14242 |
|
14243 | /**
|
14244 | * Callback as used by {@link google.cloud.speech.v1p1beta1.Adaptation#updatePhraseSet}.
|
14245 | * @memberof google.cloud.speech.v1p1beta1.Adaptation
|
14246 | * @typedef UpdatePhraseSetCallback
|
14247 | * @type {function}
|
14248 | * @param {Error|null} error Error, if any
|
14249 | * @param {google.cloud.speech.v1p1beta1.PhraseSet} [response] PhraseSet
|
14250 | */
|
14251 |
|
14252 | /**
|
14253 | * Calls UpdatePhraseSet.
|
14254 | * @function updatePhraseSet
|
14255 | * @memberof google.cloud.speech.v1p1beta1.Adaptation
|
14256 | * @instance
|
14257 | * @param {google.cloud.speech.v1p1beta1.IUpdatePhraseSetRequest} request UpdatePhraseSetRequest message or plain object
|
14258 | * @param {google.cloud.speech.v1p1beta1.Adaptation.UpdatePhraseSetCallback} callback Node-style callback called with the error, if any, and PhraseSet
|
14259 | * @returns {undefined}
|
14260 | * @variation 1
|
14261 | */
|
14262 | Object.defineProperty(Adaptation.prototype.updatePhraseSet = function updatePhraseSet(request, callback) {
|
14263 | return this.rpcCall(updatePhraseSet, $root.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest, $root.google.cloud.speech.v1p1beta1.PhraseSet, request, callback);
|
14264 | }, "name", { value: "UpdatePhraseSet" });
|
14265 |
|
14266 | /**
|
14267 | * Calls UpdatePhraseSet.
|
14268 | * @function updatePhraseSet
|
14269 | * @memberof google.cloud.speech.v1p1beta1.Adaptation
|
14270 | * @instance
|
14271 | * @param {google.cloud.speech.v1p1beta1.IUpdatePhraseSetRequest} request UpdatePhraseSetRequest message or plain object
|
14272 | * @returns {Promise<google.cloud.speech.v1p1beta1.PhraseSet>} Promise
|
14273 | * @variation 2
|
14274 | */
|
14275 |
|
14276 | /**
|
14277 | * Callback as used by {@link google.cloud.speech.v1p1beta1.Adaptation#deletePhraseSet}.
|
14278 | * @memberof google.cloud.speech.v1p1beta1.Adaptation
|
14279 | * @typedef DeletePhraseSetCallback
|
14280 | * @type {function}
|
14281 | * @param {Error|null} error Error, if any
|
14282 | * @param {google.protobuf.Empty} [response] Empty
|
14283 | */
|
14284 |
|
14285 | /**
|
14286 | * Calls DeletePhraseSet.
|
14287 | * @function deletePhraseSet
|
14288 | * @memberof google.cloud.speech.v1p1beta1.Adaptation
|
14289 | * @instance
|
14290 | * @param {google.cloud.speech.v1p1beta1.IDeletePhraseSetRequest} request DeletePhraseSetRequest message or plain object
|
14291 | * @param {google.cloud.speech.v1p1beta1.Adaptation.DeletePhraseSetCallback} callback Node-style callback called with the error, if any, and Empty
|
14292 | * @returns {undefined}
|
14293 | * @variation 1
|
14294 | */
|
14295 | Object.defineProperty(Adaptation.prototype.deletePhraseSet = function deletePhraseSet(request, callback) {
|
14296 | return this.rpcCall(deletePhraseSet, $root.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest, $root.google.protobuf.Empty, request, callback);
|
14297 | }, "name", { value: "DeletePhraseSet" });
|
14298 |
|
14299 | /**
|
14300 | * Calls DeletePhraseSet.
|
14301 | * @function deletePhraseSet
|
14302 | * @memberof google.cloud.speech.v1p1beta1.Adaptation
|
14303 | * @instance
|
14304 | * @param {google.cloud.speech.v1p1beta1.IDeletePhraseSetRequest} request DeletePhraseSetRequest message or plain object
|
14305 | * @returns {Promise<google.protobuf.Empty>} Promise
|
14306 | * @variation 2
|
14307 | */
|
14308 |
|
14309 | /**
|
14310 | * Callback as used by {@link google.cloud.speech.v1p1beta1.Adaptation#createCustomClass}.
|
14311 | * @memberof google.cloud.speech.v1p1beta1.Adaptation
|
14312 | * @typedef CreateCustomClassCallback
|
14313 | * @type {function}
|
14314 | * @param {Error|null} error Error, if any
|
14315 | * @param {google.cloud.speech.v1p1beta1.CustomClass} [response] CustomClass
|
14316 | */
|
14317 |
|
14318 | /**
|
14319 | * Calls CreateCustomClass.
|
14320 | * @function createCustomClass
|
14321 | * @memberof google.cloud.speech.v1p1beta1.Adaptation
|
14322 | * @instance
|
14323 | * @param {google.cloud.speech.v1p1beta1.ICreateCustomClassRequest} request CreateCustomClassRequest message or plain object
|
14324 | * @param {google.cloud.speech.v1p1beta1.Adaptation.CreateCustomClassCallback} callback Node-style callback called with the error, if any, and CustomClass
|
14325 | * @returns {undefined}
|
14326 | * @variation 1
|
14327 | */
|
14328 | Object.defineProperty(Adaptation.prototype.createCustomClass = function createCustomClass(request, callback) {
|
14329 | return this.rpcCall(createCustomClass, $root.google.cloud.speech.v1p1beta1.CreateCustomClassRequest, $root.google.cloud.speech.v1p1beta1.CustomClass, request, callback);
|
14330 | }, "name", { value: "CreateCustomClass" });
|
14331 |
|
14332 | /**
|
14333 | * Calls CreateCustomClass.
|
14334 | * @function createCustomClass
|
14335 | * @memberof google.cloud.speech.v1p1beta1.Adaptation
|
14336 | * @instance
|
14337 | * @param {google.cloud.speech.v1p1beta1.ICreateCustomClassRequest} request CreateCustomClassRequest message or plain object
|
14338 | * @returns {Promise<google.cloud.speech.v1p1beta1.CustomClass>} Promise
|
14339 | * @variation 2
|
14340 | */
|
14341 |
|
14342 | /**
|
14343 | * Callback as used by {@link google.cloud.speech.v1p1beta1.Adaptation#getCustomClass}.
|
14344 | * @memberof google.cloud.speech.v1p1beta1.Adaptation
|
14345 | * @typedef GetCustomClassCallback
|
14346 | * @type {function}
|
14347 | * @param {Error|null} error Error, if any
|
14348 | * @param {google.cloud.speech.v1p1beta1.CustomClass} [response] CustomClass
|
14349 | */
|
14350 |
|
14351 | /**
|
14352 | * Calls GetCustomClass.
|
14353 | * @function getCustomClass
|
14354 | * @memberof google.cloud.speech.v1p1beta1.Adaptation
|
14355 | * @instance
|
14356 | * @param {google.cloud.speech.v1p1beta1.IGetCustomClassRequest} request GetCustomClassRequest message or plain object
|
14357 | * @param {google.cloud.speech.v1p1beta1.Adaptation.GetCustomClassCallback} callback Node-style callback called with the error, if any, and CustomClass
|
14358 | * @returns {undefined}
|
14359 | * @variation 1
|
14360 | */
|
14361 | Object.defineProperty(Adaptation.prototype.getCustomClass = function getCustomClass(request, callback) {
|
14362 | return this.rpcCall(getCustomClass, $root.google.cloud.speech.v1p1beta1.GetCustomClassRequest, $root.google.cloud.speech.v1p1beta1.CustomClass, request, callback);
|
14363 | }, "name", { value: "GetCustomClass" });
|
14364 |
|
14365 | /**
|
14366 | * Calls GetCustomClass.
|
14367 | * @function getCustomClass
|
14368 | * @memberof google.cloud.speech.v1p1beta1.Adaptation
|
14369 | * @instance
|
14370 | * @param {google.cloud.speech.v1p1beta1.IGetCustomClassRequest} request GetCustomClassRequest message or plain object
|
14371 | * @returns {Promise<google.cloud.speech.v1p1beta1.CustomClass>} Promise
|
14372 | * @variation 2
|
14373 | */
|
14374 |
|
14375 | /**
|
14376 | * Callback as used by {@link google.cloud.speech.v1p1beta1.Adaptation#listCustomClasses}.
|
14377 | * @memberof google.cloud.speech.v1p1beta1.Adaptation
|
14378 | * @typedef ListCustomClassesCallback
|
14379 | * @type {function}
|
14380 | * @param {Error|null} error Error, if any
|
14381 | * @param {google.cloud.speech.v1p1beta1.ListCustomClassesResponse} [response] ListCustomClassesResponse
|
14382 | */
|
14383 |
|
14384 | /**
|
14385 | * Calls ListCustomClasses.
|
14386 | * @function listCustomClasses
|
14387 | * @memberof google.cloud.speech.v1p1beta1.Adaptation
|
14388 | * @instance
|
14389 | * @param {google.cloud.speech.v1p1beta1.IListCustomClassesRequest} request ListCustomClassesRequest message or plain object
|
14390 | * @param {google.cloud.speech.v1p1beta1.Adaptation.ListCustomClassesCallback} callback Node-style callback called with the error, if any, and ListCustomClassesResponse
|
14391 | * @returns {undefined}
|
14392 | * @variation 1
|
14393 | */
|
14394 | Object.defineProperty(Adaptation.prototype.listCustomClasses = function listCustomClasses(request, callback) {
|
14395 | return this.rpcCall(listCustomClasses, $root.google.cloud.speech.v1p1beta1.ListCustomClassesRequest, $root.google.cloud.speech.v1p1beta1.ListCustomClassesResponse, request, callback);
|
14396 | }, "name", { value: "ListCustomClasses" });
|
14397 |
|
14398 | /**
|
14399 | * Calls ListCustomClasses.
|
14400 | * @function listCustomClasses
|
14401 | * @memberof google.cloud.speech.v1p1beta1.Adaptation
|
14402 | * @instance
|
14403 | * @param {google.cloud.speech.v1p1beta1.IListCustomClassesRequest} request ListCustomClassesRequest message or plain object
|
14404 | * @returns {Promise<google.cloud.speech.v1p1beta1.ListCustomClassesResponse>} Promise
|
14405 | * @variation 2
|
14406 | */
|
14407 |
|
14408 | /**
|
14409 | * Callback as used by {@link google.cloud.speech.v1p1beta1.Adaptation#updateCustomClass}.
|
14410 | * @memberof google.cloud.speech.v1p1beta1.Adaptation
|
14411 | * @typedef UpdateCustomClassCallback
|
14412 | * @type {function}
|
14413 | * @param {Error|null} error Error, if any
|
14414 | * @param {google.cloud.speech.v1p1beta1.CustomClass} [response] CustomClass
|
14415 | */
|
14416 |
|
14417 | /**
|
14418 | * Calls UpdateCustomClass.
|
14419 | * @function updateCustomClass
|
14420 | * @memberof google.cloud.speech.v1p1beta1.Adaptation
|
14421 | * @instance
|
14422 | * @param {google.cloud.speech.v1p1beta1.IUpdateCustomClassRequest} request UpdateCustomClassRequest message or plain object
|
14423 | * @param {google.cloud.speech.v1p1beta1.Adaptation.UpdateCustomClassCallback} callback Node-style callback called with the error, if any, and CustomClass
|
14424 | * @returns {undefined}
|
14425 | * @variation 1
|
14426 | */
|
14427 | Object.defineProperty(Adaptation.prototype.updateCustomClass = function updateCustomClass(request, callback) {
|
14428 | return this.rpcCall(updateCustomClass, $root.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest, $root.google.cloud.speech.v1p1beta1.CustomClass, request, callback);
|
14429 | }, "name", { value: "UpdateCustomClass" });
|
14430 |
|
14431 | /**
|
14432 | * Calls UpdateCustomClass.
|
14433 | * @function updateCustomClass
|
14434 | * @memberof google.cloud.speech.v1p1beta1.Adaptation
|
14435 | * @instance
|
14436 | * @param {google.cloud.speech.v1p1beta1.IUpdateCustomClassRequest} request UpdateCustomClassRequest message or plain object
|
14437 | * @returns {Promise<google.cloud.speech.v1p1beta1.CustomClass>} Promise
|
14438 | * @variation 2
|
14439 | */
|
14440 |
|
14441 | /**
|
14442 | * Callback as used by {@link google.cloud.speech.v1p1beta1.Adaptation#deleteCustomClass}.
|
14443 | * @memberof google.cloud.speech.v1p1beta1.Adaptation
|
14444 | * @typedef DeleteCustomClassCallback
|
14445 | * @type {function}
|
14446 | * @param {Error|null} error Error, if any
|
14447 | * @param {google.protobuf.Empty} [response] Empty
|
14448 | */
|
14449 |
|
14450 | /**
|
14451 | * Calls DeleteCustomClass.
|
14452 | * @function deleteCustomClass
|
14453 | * @memberof google.cloud.speech.v1p1beta1.Adaptation
|
14454 | * @instance
|
14455 | * @param {google.cloud.speech.v1p1beta1.IDeleteCustomClassRequest} request DeleteCustomClassRequest message or plain object
|
14456 | * @param {google.cloud.speech.v1p1beta1.Adaptation.DeleteCustomClassCallback} callback Node-style callback called with the error, if any, and Empty
|
14457 | * @returns {undefined}
|
14458 | * @variation 1
|
14459 | */
|
14460 | Object.defineProperty(Adaptation.prototype.deleteCustomClass = function deleteCustomClass(request, callback) {
|
14461 | return this.rpcCall(deleteCustomClass, $root.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest, $root.google.protobuf.Empty, request, callback);
|
14462 | }, "name", { value: "DeleteCustomClass" });
|
14463 |
|
14464 | /**
|
14465 | * Calls DeleteCustomClass.
|
14466 | * @function deleteCustomClass
|
14467 | * @memberof google.cloud.speech.v1p1beta1.Adaptation
|
14468 | * @instance
|
14469 | * @param {google.cloud.speech.v1p1beta1.IDeleteCustomClassRequest} request DeleteCustomClassRequest message or plain object
|
14470 | * @returns {Promise<google.protobuf.Empty>} Promise
|
14471 | * @variation 2
|
14472 | */
|
14473 |
|
14474 | return Adaptation;
|
14475 | })();
|
14476 |
|
14477 | v1p1beta1.CreatePhraseSetRequest = (function() {
|
14478 |
|
14479 | /**
|
14480 | * Properties of a CreatePhraseSetRequest.
|
14481 | * @memberof google.cloud.speech.v1p1beta1
|
14482 | * @interface ICreatePhraseSetRequest
|
14483 | * @property {string|null} [parent] CreatePhraseSetRequest parent
|
14484 | * @property {string|null} [phraseSetId] CreatePhraseSetRequest phraseSetId
|
14485 | * @property {google.cloud.speech.v1p1beta1.IPhraseSet|null} [phraseSet] CreatePhraseSetRequest phraseSet
|
14486 | */
|
14487 |
|
14488 | /**
|
14489 | * Constructs a new CreatePhraseSetRequest.
|
14490 | * @memberof google.cloud.speech.v1p1beta1
|
14491 | * @classdesc Represents a CreatePhraseSetRequest.
|
14492 | * @implements ICreatePhraseSetRequest
|
14493 | * @constructor
|
14494 | * @param {google.cloud.speech.v1p1beta1.ICreatePhraseSetRequest=} [properties] Properties to set
|
14495 | */
|
14496 | function CreatePhraseSetRequest(properties) {
|
14497 | if (properties)
|
14498 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
14499 | if (properties[keys[i]] != null)
|
14500 | this[keys[i]] = properties[keys[i]];
|
14501 | }
|
14502 |
|
14503 | /**
|
14504 | * CreatePhraseSetRequest parent.
|
14505 | * @member {string} parent
|
14506 | * @memberof google.cloud.speech.v1p1beta1.CreatePhraseSetRequest
|
14507 | * @instance
|
14508 | */
|
14509 | CreatePhraseSetRequest.prototype.parent = "";
|
14510 |
|
14511 | /**
|
14512 | * CreatePhraseSetRequest phraseSetId.
|
14513 | * @member {string} phraseSetId
|
14514 | * @memberof google.cloud.speech.v1p1beta1.CreatePhraseSetRequest
|
14515 | * @instance
|
14516 | */
|
14517 | CreatePhraseSetRequest.prototype.phraseSetId = "";
|
14518 |
|
14519 | /**
|
14520 | * CreatePhraseSetRequest phraseSet.
|
14521 | * @member {google.cloud.speech.v1p1beta1.IPhraseSet|null|undefined} phraseSet
|
14522 | * @memberof google.cloud.speech.v1p1beta1.CreatePhraseSetRequest
|
14523 | * @instance
|
14524 | */
|
14525 | CreatePhraseSetRequest.prototype.phraseSet = null;
|
14526 |
|
14527 | /**
|
14528 | * Creates a new CreatePhraseSetRequest instance using the specified properties.
|
14529 | * @function create
|
14530 | * @memberof google.cloud.speech.v1p1beta1.CreatePhraseSetRequest
|
14531 | * @static
|
14532 | * @param {google.cloud.speech.v1p1beta1.ICreatePhraseSetRequest=} [properties] Properties to set
|
14533 | * @returns {google.cloud.speech.v1p1beta1.CreatePhraseSetRequest} CreatePhraseSetRequest instance
|
14534 | */
|
14535 | CreatePhraseSetRequest.create = function create(properties) {
|
14536 | return new CreatePhraseSetRequest(properties);
|
14537 | };
|
14538 |
|
14539 | /**
|
14540 | * Encodes the specified CreatePhraseSetRequest message. Does not implicitly {@link google.cloud.speech.v1p1beta1.CreatePhraseSetRequest.verify|verify} messages.
|
14541 | * @function encode
|
14542 | * @memberof google.cloud.speech.v1p1beta1.CreatePhraseSetRequest
|
14543 | * @static
|
14544 | * @param {google.cloud.speech.v1p1beta1.ICreatePhraseSetRequest} message CreatePhraseSetRequest message or plain object to encode
|
14545 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
14546 | * @returns {$protobuf.Writer} Writer
|
14547 | */
|
14548 | CreatePhraseSetRequest.encode = function encode(message, writer) {
|
14549 | if (!writer)
|
14550 | writer = $Writer.create();
|
14551 | if (message.parent != null && Object.hasOwnProperty.call(message, "parent"))
|
14552 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent);
|
14553 | if (message.phraseSetId != null && Object.hasOwnProperty.call(message, "phraseSetId"))
|
14554 | writer.uint32(/* id 2, wireType 2 =*/18).string(message.phraseSetId);
|
14555 | if (message.phraseSet != null && Object.hasOwnProperty.call(message, "phraseSet"))
|
14556 | $root.google.cloud.speech.v1p1beta1.PhraseSet.encode(message.phraseSet, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
|
14557 | return writer;
|
14558 | };
|
14559 |
|
14560 | /**
|
14561 | * Encodes the specified CreatePhraseSetRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.CreatePhraseSetRequest.verify|verify} messages.
|
14562 | * @function encodeDelimited
|
14563 | * @memberof google.cloud.speech.v1p1beta1.CreatePhraseSetRequest
|
14564 | * @static
|
14565 | * @param {google.cloud.speech.v1p1beta1.ICreatePhraseSetRequest} message CreatePhraseSetRequest message or plain object to encode
|
14566 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
14567 | * @returns {$protobuf.Writer} Writer
|
14568 | */
|
14569 | CreatePhraseSetRequest.encodeDelimited = function encodeDelimited(message, writer) {
|
14570 | return this.encode(message, writer).ldelim();
|
14571 | };
|
14572 |
|
14573 | /**
|
14574 | * Decodes a CreatePhraseSetRequest message from the specified reader or buffer.
|
14575 | * @function decode
|
14576 | * @memberof google.cloud.speech.v1p1beta1.CreatePhraseSetRequest
|
14577 | * @static
|
14578 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
14579 | * @param {number} [length] Message length if known beforehand
|
14580 | * @returns {google.cloud.speech.v1p1beta1.CreatePhraseSetRequest} CreatePhraseSetRequest
|
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 | CreatePhraseSetRequest.decode = function decode(reader, length) {
|
14585 | if (!(reader instanceof $Reader))
|
14586 | reader = $Reader.create(reader);
|
14587 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest();
|
14588 | while (reader.pos < end) {
|
14589 | var tag = reader.uint32();
|
14590 | switch (tag >>> 3) {
|
14591 | case 1:
|
14592 | message.parent = reader.string();
|
14593 | break;
|
14594 | case 2:
|
14595 | message.phraseSetId = reader.string();
|
14596 | break;
|
14597 | case 3:
|
14598 | message.phraseSet = $root.google.cloud.speech.v1p1beta1.PhraseSet.decode(reader, reader.uint32());
|
14599 | break;
|
14600 | default:
|
14601 | reader.skipType(tag & 7);
|
14602 | break;
|
14603 | }
|
14604 | }
|
14605 | return message;
|
14606 | };
|
14607 |
|
14608 | /**
|
14609 | * Decodes a CreatePhraseSetRequest message from the specified reader or buffer, length delimited.
|
14610 | * @function decodeDelimited
|
14611 | * @memberof google.cloud.speech.v1p1beta1.CreatePhraseSetRequest
|
14612 | * @static
|
14613 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
14614 | * @returns {google.cloud.speech.v1p1beta1.CreatePhraseSetRequest} CreatePhraseSetRequest
|
14615 | * @throws {Error} If the payload is not a reader or valid buffer
|
14616 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
14617 | */
|
14618 | CreatePhraseSetRequest.decodeDelimited = function decodeDelimited(reader) {
|
14619 | if (!(reader instanceof $Reader))
|
14620 | reader = new $Reader(reader);
|
14621 | return this.decode(reader, reader.uint32());
|
14622 | };
|
14623 |
|
14624 | /**
|
14625 | * Verifies a CreatePhraseSetRequest message.
|
14626 | * @function verify
|
14627 | * @memberof google.cloud.speech.v1p1beta1.CreatePhraseSetRequest
|
14628 | * @static
|
14629 | * @param {Object.<string,*>} message Plain object to verify
|
14630 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
14631 | */
|
14632 | CreatePhraseSetRequest.verify = function verify(message) {
|
14633 | if (typeof message !== "object" || message === null)
|
14634 | return "object expected";
|
14635 | if (message.parent != null && message.hasOwnProperty("parent"))
|
14636 | if (!$util.isString(message.parent))
|
14637 | return "parent: string expected";
|
14638 | if (message.phraseSetId != null && message.hasOwnProperty("phraseSetId"))
|
14639 | if (!$util.isString(message.phraseSetId))
|
14640 | return "phraseSetId: string expected";
|
14641 | if (message.phraseSet != null && message.hasOwnProperty("phraseSet")) {
|
14642 | var error = $root.google.cloud.speech.v1p1beta1.PhraseSet.verify(message.phraseSet);
|
14643 | if (error)
|
14644 | return "phraseSet." + error;
|
14645 | }
|
14646 | return null;
|
14647 | };
|
14648 |
|
14649 | /**
|
14650 | * Creates a CreatePhraseSetRequest message from a plain object. Also converts values to their respective internal types.
|
14651 | * @function fromObject
|
14652 | * @memberof google.cloud.speech.v1p1beta1.CreatePhraseSetRequest
|
14653 | * @static
|
14654 | * @param {Object.<string,*>} object Plain object
|
14655 | * @returns {google.cloud.speech.v1p1beta1.CreatePhraseSetRequest} CreatePhraseSetRequest
|
14656 | */
|
14657 | CreatePhraseSetRequest.fromObject = function fromObject(object) {
|
14658 | if (object instanceof $root.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest)
|
14659 | return object;
|
14660 | var message = new $root.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest();
|
14661 | if (object.parent != null)
|
14662 | message.parent = String(object.parent);
|
14663 | if (object.phraseSetId != null)
|
14664 | message.phraseSetId = String(object.phraseSetId);
|
14665 | if (object.phraseSet != null) {
|
14666 | if (typeof object.phraseSet !== "object")
|
14667 | throw TypeError(".google.cloud.speech.v1p1beta1.CreatePhraseSetRequest.phraseSet: object expected");
|
14668 | message.phraseSet = $root.google.cloud.speech.v1p1beta1.PhraseSet.fromObject(object.phraseSet);
|
14669 | }
|
14670 | return message;
|
14671 | };
|
14672 |
|
14673 | /**
|
14674 | * Creates a plain object from a CreatePhraseSetRequest message. Also converts values to other types if specified.
|
14675 | * @function toObject
|
14676 | * @memberof google.cloud.speech.v1p1beta1.CreatePhraseSetRequest
|
14677 | * @static
|
14678 | * @param {google.cloud.speech.v1p1beta1.CreatePhraseSetRequest} message CreatePhraseSetRequest
|
14679 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
14680 | * @returns {Object.<string,*>} Plain object
|
14681 | */
|
14682 | CreatePhraseSetRequest.toObject = function toObject(message, options) {
|
14683 | if (!options)
|
14684 | options = {};
|
14685 | var object = {};
|
14686 | if (options.defaults) {
|
14687 | object.parent = "";
|
14688 | object.phraseSetId = "";
|
14689 | object.phraseSet = null;
|
14690 | }
|
14691 | if (message.parent != null && message.hasOwnProperty("parent"))
|
14692 | object.parent = message.parent;
|
14693 | if (message.phraseSetId != null && message.hasOwnProperty("phraseSetId"))
|
14694 | object.phraseSetId = message.phraseSetId;
|
14695 | if (message.phraseSet != null && message.hasOwnProperty("phraseSet"))
|
14696 | object.phraseSet = $root.google.cloud.speech.v1p1beta1.PhraseSet.toObject(message.phraseSet, options);
|
14697 | return object;
|
14698 | };
|
14699 |
|
14700 | /**
|
14701 | * Converts this CreatePhraseSetRequest to JSON.
|
14702 | * @function toJSON
|
14703 | * @memberof google.cloud.speech.v1p1beta1.CreatePhraseSetRequest
|
14704 | * @instance
|
14705 | * @returns {Object.<string,*>} JSON object
|
14706 | */
|
14707 | CreatePhraseSetRequest.prototype.toJSON = function toJSON() {
|
14708 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
14709 | };
|
14710 |
|
14711 | return CreatePhraseSetRequest;
|
14712 | })();
|
14713 |
|
14714 | v1p1beta1.UpdatePhraseSetRequest = (function() {
|
14715 |
|
14716 | /**
|
14717 | * Properties of an UpdatePhraseSetRequest.
|
14718 | * @memberof google.cloud.speech.v1p1beta1
|
14719 | * @interface IUpdatePhraseSetRequest
|
14720 | * @property {google.cloud.speech.v1p1beta1.IPhraseSet|null} [phraseSet] UpdatePhraseSetRequest phraseSet
|
14721 | * @property {google.protobuf.IFieldMask|null} [updateMask] UpdatePhraseSetRequest updateMask
|
14722 | */
|
14723 |
|
14724 | /**
|
14725 | * Constructs a new UpdatePhraseSetRequest.
|
14726 | * @memberof google.cloud.speech.v1p1beta1
|
14727 | * @classdesc Represents an UpdatePhraseSetRequest.
|
14728 | * @implements IUpdatePhraseSetRequest
|
14729 | * @constructor
|
14730 | * @param {google.cloud.speech.v1p1beta1.IUpdatePhraseSetRequest=} [properties] Properties to set
|
14731 | */
|
14732 | function UpdatePhraseSetRequest(properties) {
|
14733 | if (properties)
|
14734 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
14735 | if (properties[keys[i]] != null)
|
14736 | this[keys[i]] = properties[keys[i]];
|
14737 | }
|
14738 |
|
14739 | /**
|
14740 | * UpdatePhraseSetRequest phraseSet.
|
14741 | * @member {google.cloud.speech.v1p1beta1.IPhraseSet|null|undefined} phraseSet
|
14742 | * @memberof google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest
|
14743 | * @instance
|
14744 | */
|
14745 | UpdatePhraseSetRequest.prototype.phraseSet = null;
|
14746 |
|
14747 | /**
|
14748 | * UpdatePhraseSetRequest updateMask.
|
14749 | * @member {google.protobuf.IFieldMask|null|undefined} updateMask
|
14750 | * @memberof google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest
|
14751 | * @instance
|
14752 | */
|
14753 | UpdatePhraseSetRequest.prototype.updateMask = null;
|
14754 |
|
14755 | /**
|
14756 | * Creates a new UpdatePhraseSetRequest instance using the specified properties.
|
14757 | * @function create
|
14758 | * @memberof google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest
|
14759 | * @static
|
14760 | * @param {google.cloud.speech.v1p1beta1.IUpdatePhraseSetRequest=} [properties] Properties to set
|
14761 | * @returns {google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest} UpdatePhraseSetRequest instance
|
14762 | */
|
14763 | UpdatePhraseSetRequest.create = function create(properties) {
|
14764 | return new UpdatePhraseSetRequest(properties);
|
14765 | };
|
14766 |
|
14767 | /**
|
14768 | * Encodes the specified UpdatePhraseSetRequest message. Does not implicitly {@link google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest.verify|verify} messages.
|
14769 | * @function encode
|
14770 | * @memberof google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest
|
14771 | * @static
|
14772 | * @param {google.cloud.speech.v1p1beta1.IUpdatePhraseSetRequest} message UpdatePhraseSetRequest message or plain object to encode
|
14773 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
14774 | * @returns {$protobuf.Writer} Writer
|
14775 | */
|
14776 | UpdatePhraseSetRequest.encode = function encode(message, writer) {
|
14777 | if (!writer)
|
14778 | writer = $Writer.create();
|
14779 | if (message.phraseSet != null && Object.hasOwnProperty.call(message, "phraseSet"))
|
14780 | $root.google.cloud.speech.v1p1beta1.PhraseSet.encode(message.phraseSet, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
14781 | if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask"))
|
14782 | $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
14783 | return writer;
|
14784 | };
|
14785 |
|
14786 | /**
|
14787 | * Encodes the specified UpdatePhraseSetRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest.verify|verify} messages.
|
14788 | * @function encodeDelimited
|
14789 | * @memberof google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest
|
14790 | * @static
|
14791 | * @param {google.cloud.speech.v1p1beta1.IUpdatePhraseSetRequest} message UpdatePhraseSetRequest message or plain object to encode
|
14792 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
14793 | * @returns {$protobuf.Writer} Writer
|
14794 | */
|
14795 | UpdatePhraseSetRequest.encodeDelimited = function encodeDelimited(message, writer) {
|
14796 | return this.encode(message, writer).ldelim();
|
14797 | };
|
14798 |
|
14799 | /**
|
14800 | * Decodes an UpdatePhraseSetRequest message from the specified reader or buffer.
|
14801 | * @function decode
|
14802 | * @memberof google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest
|
14803 | * @static
|
14804 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
14805 | * @param {number} [length] Message length if known beforehand
|
14806 | * @returns {google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest} UpdatePhraseSetRequest
|
14807 | * @throws {Error} If the payload is not a reader or valid buffer
|
14808 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
14809 | */
|
14810 | UpdatePhraseSetRequest.decode = function decode(reader, length) {
|
14811 | if (!(reader instanceof $Reader))
|
14812 | reader = $Reader.create(reader);
|
14813 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest();
|
14814 | while (reader.pos < end) {
|
14815 | var tag = reader.uint32();
|
14816 | switch (tag >>> 3) {
|
14817 | case 1:
|
14818 | message.phraseSet = $root.google.cloud.speech.v1p1beta1.PhraseSet.decode(reader, reader.uint32());
|
14819 | break;
|
14820 | case 2:
|
14821 | message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32());
|
14822 | break;
|
14823 | default:
|
14824 | reader.skipType(tag & 7);
|
14825 | break;
|
14826 | }
|
14827 | }
|
14828 | return message;
|
14829 | };
|
14830 |
|
14831 | /**
|
14832 | * Decodes an UpdatePhraseSetRequest message from the specified reader or buffer, length delimited.
|
14833 | * @function decodeDelimited
|
14834 | * @memberof google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest
|
14835 | * @static
|
14836 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
14837 | * @returns {google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest} UpdatePhraseSetRequest
|
14838 | * @throws {Error} If the payload is not a reader or valid buffer
|
14839 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
14840 | */
|
14841 | UpdatePhraseSetRequest.decodeDelimited = function decodeDelimited(reader) {
|
14842 | if (!(reader instanceof $Reader))
|
14843 | reader = new $Reader(reader);
|
14844 | return this.decode(reader, reader.uint32());
|
14845 | };
|
14846 |
|
14847 | /**
|
14848 | * Verifies an UpdatePhraseSetRequest message.
|
14849 | * @function verify
|
14850 | * @memberof google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest
|
14851 | * @static
|
14852 | * @param {Object.<string,*>} message Plain object to verify
|
14853 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
14854 | */
|
14855 | UpdatePhraseSetRequest.verify = function verify(message) {
|
14856 | if (typeof message !== "object" || message === null)
|
14857 | return "object expected";
|
14858 | if (message.phraseSet != null && message.hasOwnProperty("phraseSet")) {
|
14859 | var error = $root.google.cloud.speech.v1p1beta1.PhraseSet.verify(message.phraseSet);
|
14860 | if (error)
|
14861 | return "phraseSet." + error;
|
14862 | }
|
14863 | if (message.updateMask != null && message.hasOwnProperty("updateMask")) {
|
14864 | var error = $root.google.protobuf.FieldMask.verify(message.updateMask);
|
14865 | if (error)
|
14866 | return "updateMask." + error;
|
14867 | }
|
14868 | return null;
|
14869 | };
|
14870 |
|
14871 | /**
|
14872 | * Creates an UpdatePhraseSetRequest message from a plain object. Also converts values to their respective internal types.
|
14873 | * @function fromObject
|
14874 | * @memberof google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest
|
14875 | * @static
|
14876 | * @param {Object.<string,*>} object Plain object
|
14877 | * @returns {google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest} UpdatePhraseSetRequest
|
14878 | */
|
14879 | UpdatePhraseSetRequest.fromObject = function fromObject(object) {
|
14880 | if (object instanceof $root.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest)
|
14881 | return object;
|
14882 | var message = new $root.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest();
|
14883 | if (object.phraseSet != null) {
|
14884 | if (typeof object.phraseSet !== "object")
|
14885 | throw TypeError(".google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest.phraseSet: object expected");
|
14886 | message.phraseSet = $root.google.cloud.speech.v1p1beta1.PhraseSet.fromObject(object.phraseSet);
|
14887 | }
|
14888 | if (object.updateMask != null) {
|
14889 | if (typeof object.updateMask !== "object")
|
14890 | throw TypeError(".google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest.updateMask: object expected");
|
14891 | message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask);
|
14892 | }
|
14893 | return message;
|
14894 | };
|
14895 |
|
14896 | /**
|
14897 | * Creates a plain object from an UpdatePhraseSetRequest message. Also converts values to other types if specified.
|
14898 | * @function toObject
|
14899 | * @memberof google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest
|
14900 | * @static
|
14901 | * @param {google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest} message UpdatePhraseSetRequest
|
14902 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
14903 | * @returns {Object.<string,*>} Plain object
|
14904 | */
|
14905 | UpdatePhraseSetRequest.toObject = function toObject(message, options) {
|
14906 | if (!options)
|
14907 | options = {};
|
14908 | var object = {};
|
14909 | if (options.defaults) {
|
14910 | object.phraseSet = null;
|
14911 | object.updateMask = null;
|
14912 | }
|
14913 | if (message.phraseSet != null && message.hasOwnProperty("phraseSet"))
|
14914 | object.phraseSet = $root.google.cloud.speech.v1p1beta1.PhraseSet.toObject(message.phraseSet, options);
|
14915 | if (message.updateMask != null && message.hasOwnProperty("updateMask"))
|
14916 | object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options);
|
14917 | return object;
|
14918 | };
|
14919 |
|
14920 | /**
|
14921 | * Converts this UpdatePhraseSetRequest to JSON.
|
14922 | * @function toJSON
|
14923 | * @memberof google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest
|
14924 | * @instance
|
14925 | * @returns {Object.<string,*>} JSON object
|
14926 | */
|
14927 | UpdatePhraseSetRequest.prototype.toJSON = function toJSON() {
|
14928 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
14929 | };
|
14930 |
|
14931 | return UpdatePhraseSetRequest;
|
14932 | })();
|
14933 |
|
14934 | v1p1beta1.GetPhraseSetRequest = (function() {
|
14935 |
|
14936 | /**
|
14937 | * Properties of a GetPhraseSetRequest.
|
14938 | * @memberof google.cloud.speech.v1p1beta1
|
14939 | * @interface IGetPhraseSetRequest
|
14940 | * @property {string|null} [name] GetPhraseSetRequest name
|
14941 | */
|
14942 |
|
14943 | /**
|
14944 | * Constructs a new GetPhraseSetRequest.
|
14945 | * @memberof google.cloud.speech.v1p1beta1
|
14946 | * @classdesc Represents a GetPhraseSetRequest.
|
14947 | * @implements IGetPhraseSetRequest
|
14948 | * @constructor
|
14949 | * @param {google.cloud.speech.v1p1beta1.IGetPhraseSetRequest=} [properties] Properties to set
|
14950 | */
|
14951 | function GetPhraseSetRequest(properties) {
|
14952 | if (properties)
|
14953 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
14954 | if (properties[keys[i]] != null)
|
14955 | this[keys[i]] = properties[keys[i]];
|
14956 | }
|
14957 |
|
14958 | /**
|
14959 | * GetPhraseSetRequest name.
|
14960 | * @member {string} name
|
14961 | * @memberof google.cloud.speech.v1p1beta1.GetPhraseSetRequest
|
14962 | * @instance
|
14963 | */
|
14964 | GetPhraseSetRequest.prototype.name = "";
|
14965 |
|
14966 | /**
|
14967 | * Creates a new GetPhraseSetRequest instance using the specified properties.
|
14968 | * @function create
|
14969 | * @memberof google.cloud.speech.v1p1beta1.GetPhraseSetRequest
|
14970 | * @static
|
14971 | * @param {google.cloud.speech.v1p1beta1.IGetPhraseSetRequest=} [properties] Properties to set
|
14972 | * @returns {google.cloud.speech.v1p1beta1.GetPhraseSetRequest} GetPhraseSetRequest instance
|
14973 | */
|
14974 | GetPhraseSetRequest.create = function create(properties) {
|
14975 | return new GetPhraseSetRequest(properties);
|
14976 | };
|
14977 |
|
14978 | /**
|
14979 | * Encodes the specified GetPhraseSetRequest message. Does not implicitly {@link google.cloud.speech.v1p1beta1.GetPhraseSetRequest.verify|verify} messages.
|
14980 | * @function encode
|
14981 | * @memberof google.cloud.speech.v1p1beta1.GetPhraseSetRequest
|
14982 | * @static
|
14983 | * @param {google.cloud.speech.v1p1beta1.IGetPhraseSetRequest} message GetPhraseSetRequest message or plain object to encode
|
14984 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
14985 | * @returns {$protobuf.Writer} Writer
|
14986 | */
|
14987 | GetPhraseSetRequest.encode = function encode(message, writer) {
|
14988 | if (!writer)
|
14989 | writer = $Writer.create();
|
14990 | if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
14991 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
|
14992 | return writer;
|
14993 | };
|
14994 |
|
14995 | /**
|
14996 | * Encodes the specified GetPhraseSetRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.GetPhraseSetRequest.verify|verify} messages.
|
14997 | * @function encodeDelimited
|
14998 | * @memberof google.cloud.speech.v1p1beta1.GetPhraseSetRequest
|
14999 | * @static
|
15000 | * @param {google.cloud.speech.v1p1beta1.IGetPhraseSetRequest} message GetPhraseSetRequest message or plain object to encode
|
15001 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
15002 | * @returns {$protobuf.Writer} Writer
|
15003 | */
|
15004 | GetPhraseSetRequest.encodeDelimited = function encodeDelimited(message, writer) {
|
15005 | return this.encode(message, writer).ldelim();
|
15006 | };
|
15007 |
|
15008 | /**
|
15009 | * Decodes a GetPhraseSetRequest message from the specified reader or buffer.
|
15010 | * @function decode
|
15011 | * @memberof google.cloud.speech.v1p1beta1.GetPhraseSetRequest
|
15012 | * @static
|
15013 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
15014 | * @param {number} [length] Message length if known beforehand
|
15015 | * @returns {google.cloud.speech.v1p1beta1.GetPhraseSetRequest} GetPhraseSetRequest
|
15016 | * @throws {Error} If the payload is not a reader or valid buffer
|
15017 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
15018 | */
|
15019 | GetPhraseSetRequest.decode = function decode(reader, length) {
|
15020 | if (!(reader instanceof $Reader))
|
15021 | reader = $Reader.create(reader);
|
15022 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.GetPhraseSetRequest();
|
15023 | while (reader.pos < end) {
|
15024 | var tag = reader.uint32();
|
15025 | switch (tag >>> 3) {
|
15026 | case 1:
|
15027 | message.name = reader.string();
|
15028 | break;
|
15029 | default:
|
15030 | reader.skipType(tag & 7);
|
15031 | break;
|
15032 | }
|
15033 | }
|
15034 | return message;
|
15035 | };
|
15036 |
|
15037 | /**
|
15038 | * Decodes a GetPhraseSetRequest message from the specified reader or buffer, length delimited.
|
15039 | * @function decodeDelimited
|
15040 | * @memberof google.cloud.speech.v1p1beta1.GetPhraseSetRequest
|
15041 | * @static
|
15042 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
15043 | * @returns {google.cloud.speech.v1p1beta1.GetPhraseSetRequest} GetPhraseSetRequest
|
15044 | * @throws {Error} If the payload is not a reader or valid buffer
|
15045 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
15046 | */
|
15047 | GetPhraseSetRequest.decodeDelimited = function decodeDelimited(reader) {
|
15048 | if (!(reader instanceof $Reader))
|
15049 | reader = new $Reader(reader);
|
15050 | return this.decode(reader, reader.uint32());
|
15051 | };
|
15052 |
|
15053 | /**
|
15054 | * Verifies a GetPhraseSetRequest message.
|
15055 | * @function verify
|
15056 | * @memberof google.cloud.speech.v1p1beta1.GetPhraseSetRequest
|
15057 | * @static
|
15058 | * @param {Object.<string,*>} message Plain object to verify
|
15059 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
15060 | */
|
15061 | GetPhraseSetRequest.verify = function verify(message) {
|
15062 | if (typeof message !== "object" || message === null)
|
15063 | return "object expected";
|
15064 | if (message.name != null && message.hasOwnProperty("name"))
|
15065 | if (!$util.isString(message.name))
|
15066 | return "name: string expected";
|
15067 | return null;
|
15068 | };
|
15069 |
|
15070 | /**
|
15071 | * Creates a GetPhraseSetRequest message from a plain object. Also converts values to their respective internal types.
|
15072 | * @function fromObject
|
15073 | * @memberof google.cloud.speech.v1p1beta1.GetPhraseSetRequest
|
15074 | * @static
|
15075 | * @param {Object.<string,*>} object Plain object
|
15076 | * @returns {google.cloud.speech.v1p1beta1.GetPhraseSetRequest} GetPhraseSetRequest
|
15077 | */
|
15078 | GetPhraseSetRequest.fromObject = function fromObject(object) {
|
15079 | if (object instanceof $root.google.cloud.speech.v1p1beta1.GetPhraseSetRequest)
|
15080 | return object;
|
15081 | var message = new $root.google.cloud.speech.v1p1beta1.GetPhraseSetRequest();
|
15082 | if (object.name != null)
|
15083 | message.name = String(object.name);
|
15084 | return message;
|
15085 | };
|
15086 |
|
15087 | /**
|
15088 | * Creates a plain object from a GetPhraseSetRequest message. Also converts values to other types if specified.
|
15089 | * @function toObject
|
15090 | * @memberof google.cloud.speech.v1p1beta1.GetPhraseSetRequest
|
15091 | * @static
|
15092 | * @param {google.cloud.speech.v1p1beta1.GetPhraseSetRequest} message GetPhraseSetRequest
|
15093 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
15094 | * @returns {Object.<string,*>} Plain object
|
15095 | */
|
15096 | GetPhraseSetRequest.toObject = function toObject(message, options) {
|
15097 | if (!options)
|
15098 | options = {};
|
15099 | var object = {};
|
15100 | if (options.defaults)
|
15101 | object.name = "";
|
15102 | if (message.name != null && message.hasOwnProperty("name"))
|
15103 | object.name = message.name;
|
15104 | return object;
|
15105 | };
|
15106 |
|
15107 | /**
|
15108 | * Converts this GetPhraseSetRequest to JSON.
|
15109 | * @function toJSON
|
15110 | * @memberof google.cloud.speech.v1p1beta1.GetPhraseSetRequest
|
15111 | * @instance
|
15112 | * @returns {Object.<string,*>} JSON object
|
15113 | */
|
15114 | GetPhraseSetRequest.prototype.toJSON = function toJSON() {
|
15115 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
15116 | };
|
15117 |
|
15118 | return GetPhraseSetRequest;
|
15119 | })();
|
15120 |
|
15121 | v1p1beta1.ListPhraseSetRequest = (function() {
|
15122 |
|
15123 | /**
|
15124 | * Properties of a ListPhraseSetRequest.
|
15125 | * @memberof google.cloud.speech.v1p1beta1
|
15126 | * @interface IListPhraseSetRequest
|
15127 | * @property {string|null} [parent] ListPhraseSetRequest parent
|
15128 | * @property {number|null} [pageSize] ListPhraseSetRequest pageSize
|
15129 | * @property {string|null} [pageToken] ListPhraseSetRequest pageToken
|
15130 | */
|
15131 |
|
15132 | /**
|
15133 | * Constructs a new ListPhraseSetRequest.
|
15134 | * @memberof google.cloud.speech.v1p1beta1
|
15135 | * @classdesc Represents a ListPhraseSetRequest.
|
15136 | * @implements IListPhraseSetRequest
|
15137 | * @constructor
|
15138 | * @param {google.cloud.speech.v1p1beta1.IListPhraseSetRequest=} [properties] Properties to set
|
15139 | */
|
15140 | function ListPhraseSetRequest(properties) {
|
15141 | if (properties)
|
15142 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
15143 | if (properties[keys[i]] != null)
|
15144 | this[keys[i]] = properties[keys[i]];
|
15145 | }
|
15146 |
|
15147 | /**
|
15148 | * ListPhraseSetRequest parent.
|
15149 | * @member {string} parent
|
15150 | * @memberof google.cloud.speech.v1p1beta1.ListPhraseSetRequest
|
15151 | * @instance
|
15152 | */
|
15153 | ListPhraseSetRequest.prototype.parent = "";
|
15154 |
|
15155 | /**
|
15156 | * ListPhraseSetRequest pageSize.
|
15157 | * @member {number} pageSize
|
15158 | * @memberof google.cloud.speech.v1p1beta1.ListPhraseSetRequest
|
15159 | * @instance
|
15160 | */
|
15161 | ListPhraseSetRequest.prototype.pageSize = 0;
|
15162 |
|
15163 | /**
|
15164 | * ListPhraseSetRequest pageToken.
|
15165 | * @member {string} pageToken
|
15166 | * @memberof google.cloud.speech.v1p1beta1.ListPhraseSetRequest
|
15167 | * @instance
|
15168 | */
|
15169 | ListPhraseSetRequest.prototype.pageToken = "";
|
15170 |
|
15171 | /**
|
15172 | * Creates a new ListPhraseSetRequest instance using the specified properties.
|
15173 | * @function create
|
15174 | * @memberof google.cloud.speech.v1p1beta1.ListPhraseSetRequest
|
15175 | * @static
|
15176 | * @param {google.cloud.speech.v1p1beta1.IListPhraseSetRequest=} [properties] Properties to set
|
15177 | * @returns {google.cloud.speech.v1p1beta1.ListPhraseSetRequest} ListPhraseSetRequest instance
|
15178 | */
|
15179 | ListPhraseSetRequest.create = function create(properties) {
|
15180 | return new ListPhraseSetRequest(properties);
|
15181 | };
|
15182 |
|
15183 | /**
|
15184 | * Encodes the specified ListPhraseSetRequest message. Does not implicitly {@link google.cloud.speech.v1p1beta1.ListPhraseSetRequest.verify|verify} messages.
|
15185 | * @function encode
|
15186 | * @memberof google.cloud.speech.v1p1beta1.ListPhraseSetRequest
|
15187 | * @static
|
15188 | * @param {google.cloud.speech.v1p1beta1.IListPhraseSetRequest} message ListPhraseSetRequest message or plain object to encode
|
15189 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
15190 | * @returns {$protobuf.Writer} Writer
|
15191 | */
|
15192 | ListPhraseSetRequest.encode = function encode(message, writer) {
|
15193 | if (!writer)
|
15194 | writer = $Writer.create();
|
15195 | if (message.parent != null && Object.hasOwnProperty.call(message, "parent"))
|
15196 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent);
|
15197 | if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize"))
|
15198 | writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize);
|
15199 | if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken"))
|
15200 | writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken);
|
15201 | return writer;
|
15202 | };
|
15203 |
|
15204 | /**
|
15205 | * Encodes the specified ListPhraseSetRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.ListPhraseSetRequest.verify|verify} messages.
|
15206 | * @function encodeDelimited
|
15207 | * @memberof google.cloud.speech.v1p1beta1.ListPhraseSetRequest
|
15208 | * @static
|
15209 | * @param {google.cloud.speech.v1p1beta1.IListPhraseSetRequest} message ListPhraseSetRequest message or plain object to encode
|
15210 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
15211 | * @returns {$protobuf.Writer} Writer
|
15212 | */
|
15213 | ListPhraseSetRequest.encodeDelimited = function encodeDelimited(message, writer) {
|
15214 | return this.encode(message, writer).ldelim();
|
15215 | };
|
15216 |
|
15217 | /**
|
15218 | * Decodes a ListPhraseSetRequest message from the specified reader or buffer.
|
15219 | * @function decode
|
15220 | * @memberof google.cloud.speech.v1p1beta1.ListPhraseSetRequest
|
15221 | * @static
|
15222 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
15223 | * @param {number} [length] Message length if known beforehand
|
15224 | * @returns {google.cloud.speech.v1p1beta1.ListPhraseSetRequest} ListPhraseSetRequest
|
15225 | * @throws {Error} If the payload is not a reader or valid buffer
|
15226 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
15227 | */
|
15228 | ListPhraseSetRequest.decode = function decode(reader, length) {
|
15229 | if (!(reader instanceof $Reader))
|
15230 | reader = $Reader.create(reader);
|
15231 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.ListPhraseSetRequest();
|
15232 | while (reader.pos < end) {
|
15233 | var tag = reader.uint32();
|
15234 | switch (tag >>> 3) {
|
15235 | case 1:
|
15236 | message.parent = reader.string();
|
15237 | break;
|
15238 | case 2:
|
15239 | message.pageSize = reader.int32();
|
15240 | break;
|
15241 | case 3:
|
15242 | message.pageToken = reader.string();
|
15243 | break;
|
15244 | default:
|
15245 | reader.skipType(tag & 7);
|
15246 | break;
|
15247 | }
|
15248 | }
|
15249 | return message;
|
15250 | };
|
15251 |
|
15252 | /**
|
15253 | * Decodes a ListPhraseSetRequest message from the specified reader or buffer, length delimited.
|
15254 | * @function decodeDelimited
|
15255 | * @memberof google.cloud.speech.v1p1beta1.ListPhraseSetRequest
|
15256 | * @static
|
15257 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
15258 | * @returns {google.cloud.speech.v1p1beta1.ListPhraseSetRequest} ListPhraseSetRequest
|
15259 | * @throws {Error} If the payload is not a reader or valid buffer
|
15260 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
15261 | */
|
15262 | ListPhraseSetRequest.decodeDelimited = function decodeDelimited(reader) {
|
15263 | if (!(reader instanceof $Reader))
|
15264 | reader = new $Reader(reader);
|
15265 | return this.decode(reader, reader.uint32());
|
15266 | };
|
15267 |
|
15268 | /**
|
15269 | * Verifies a ListPhraseSetRequest message.
|
15270 | * @function verify
|
15271 | * @memberof google.cloud.speech.v1p1beta1.ListPhraseSetRequest
|
15272 | * @static
|
15273 | * @param {Object.<string,*>} message Plain object to verify
|
15274 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
15275 | */
|
15276 | ListPhraseSetRequest.verify = function verify(message) {
|
15277 | if (typeof message !== "object" || message === null)
|
15278 | return "object expected";
|
15279 | if (message.parent != null && message.hasOwnProperty("parent"))
|
15280 | if (!$util.isString(message.parent))
|
15281 | return "parent: string expected";
|
15282 | if (message.pageSize != null && message.hasOwnProperty("pageSize"))
|
15283 | if (!$util.isInteger(message.pageSize))
|
15284 | return "pageSize: integer expected";
|
15285 | if (message.pageToken != null && message.hasOwnProperty("pageToken"))
|
15286 | if (!$util.isString(message.pageToken))
|
15287 | return "pageToken: string expected";
|
15288 | return null;
|
15289 | };
|
15290 |
|
15291 | /**
|
15292 | * Creates a ListPhraseSetRequest message from a plain object. Also converts values to their respective internal types.
|
15293 | * @function fromObject
|
15294 | * @memberof google.cloud.speech.v1p1beta1.ListPhraseSetRequest
|
15295 | * @static
|
15296 | * @param {Object.<string,*>} object Plain object
|
15297 | * @returns {google.cloud.speech.v1p1beta1.ListPhraseSetRequest} ListPhraseSetRequest
|
15298 | */
|
15299 | ListPhraseSetRequest.fromObject = function fromObject(object) {
|
15300 | if (object instanceof $root.google.cloud.speech.v1p1beta1.ListPhraseSetRequest)
|
15301 | return object;
|
15302 | var message = new $root.google.cloud.speech.v1p1beta1.ListPhraseSetRequest();
|
15303 | if (object.parent != null)
|
15304 | message.parent = String(object.parent);
|
15305 | if (object.pageSize != null)
|
15306 | message.pageSize = object.pageSize | 0;
|
15307 | if (object.pageToken != null)
|
15308 | message.pageToken = String(object.pageToken);
|
15309 | return message;
|
15310 | };
|
15311 |
|
15312 | /**
|
15313 | * Creates a plain object from a ListPhraseSetRequest message. Also converts values to other types if specified.
|
15314 | * @function toObject
|
15315 | * @memberof google.cloud.speech.v1p1beta1.ListPhraseSetRequest
|
15316 | * @static
|
15317 | * @param {google.cloud.speech.v1p1beta1.ListPhraseSetRequest} message ListPhraseSetRequest
|
15318 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
15319 | * @returns {Object.<string,*>} Plain object
|
15320 | */
|
15321 | ListPhraseSetRequest.toObject = function toObject(message, options) {
|
15322 | if (!options)
|
15323 | options = {};
|
15324 | var object = {};
|
15325 | if (options.defaults) {
|
15326 | object.parent = "";
|
15327 | object.pageSize = 0;
|
15328 | object.pageToken = "";
|
15329 | }
|
15330 | if (message.parent != null && message.hasOwnProperty("parent"))
|
15331 | object.parent = message.parent;
|
15332 | if (message.pageSize != null && message.hasOwnProperty("pageSize"))
|
15333 | object.pageSize = message.pageSize;
|
15334 | if (message.pageToken != null && message.hasOwnProperty("pageToken"))
|
15335 | object.pageToken = message.pageToken;
|
15336 | return object;
|
15337 | };
|
15338 |
|
15339 | /**
|
15340 | * Converts this ListPhraseSetRequest to JSON.
|
15341 | * @function toJSON
|
15342 | * @memberof google.cloud.speech.v1p1beta1.ListPhraseSetRequest
|
15343 | * @instance
|
15344 | * @returns {Object.<string,*>} JSON object
|
15345 | */
|
15346 | ListPhraseSetRequest.prototype.toJSON = function toJSON() {
|
15347 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
15348 | };
|
15349 |
|
15350 | return ListPhraseSetRequest;
|
15351 | })();
|
15352 |
|
15353 | v1p1beta1.ListPhraseSetResponse = (function() {
|
15354 |
|
15355 | /**
|
15356 | * Properties of a ListPhraseSetResponse.
|
15357 | * @memberof google.cloud.speech.v1p1beta1
|
15358 | * @interface IListPhraseSetResponse
|
15359 | * @property {Array.<google.cloud.speech.v1p1beta1.IPhraseSet>|null} [phraseSets] ListPhraseSetResponse phraseSets
|
15360 | * @property {string|null} [nextPageToken] ListPhraseSetResponse nextPageToken
|
15361 | */
|
15362 |
|
15363 | /**
|
15364 | * Constructs a new ListPhraseSetResponse.
|
15365 | * @memberof google.cloud.speech.v1p1beta1
|
15366 | * @classdesc Represents a ListPhraseSetResponse.
|
15367 | * @implements IListPhraseSetResponse
|
15368 | * @constructor
|
15369 | * @param {google.cloud.speech.v1p1beta1.IListPhraseSetResponse=} [properties] Properties to set
|
15370 | */
|
15371 | function ListPhraseSetResponse(properties) {
|
15372 | this.phraseSets = [];
|
15373 | if (properties)
|
15374 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
15375 | if (properties[keys[i]] != null)
|
15376 | this[keys[i]] = properties[keys[i]];
|
15377 | }
|
15378 |
|
15379 | /**
|
15380 | * ListPhraseSetResponse phraseSets.
|
15381 | * @member {Array.<google.cloud.speech.v1p1beta1.IPhraseSet>} phraseSets
|
15382 | * @memberof google.cloud.speech.v1p1beta1.ListPhraseSetResponse
|
15383 | * @instance
|
15384 | */
|
15385 | ListPhraseSetResponse.prototype.phraseSets = $util.emptyArray;
|
15386 |
|
15387 | /**
|
15388 | * ListPhraseSetResponse nextPageToken.
|
15389 | * @member {string} nextPageToken
|
15390 | * @memberof google.cloud.speech.v1p1beta1.ListPhraseSetResponse
|
15391 | * @instance
|
15392 | */
|
15393 | ListPhraseSetResponse.prototype.nextPageToken = "";
|
15394 |
|
15395 | /**
|
15396 | * Creates a new ListPhraseSetResponse instance using the specified properties.
|
15397 | * @function create
|
15398 | * @memberof google.cloud.speech.v1p1beta1.ListPhraseSetResponse
|
15399 | * @static
|
15400 | * @param {google.cloud.speech.v1p1beta1.IListPhraseSetResponse=} [properties] Properties to set
|
15401 | * @returns {google.cloud.speech.v1p1beta1.ListPhraseSetResponse} ListPhraseSetResponse instance
|
15402 | */
|
15403 | ListPhraseSetResponse.create = function create(properties) {
|
15404 | return new ListPhraseSetResponse(properties);
|
15405 | };
|
15406 |
|
15407 | /**
|
15408 | * Encodes the specified ListPhraseSetResponse message. Does not implicitly {@link google.cloud.speech.v1p1beta1.ListPhraseSetResponse.verify|verify} messages.
|
15409 | * @function encode
|
15410 | * @memberof google.cloud.speech.v1p1beta1.ListPhraseSetResponse
|
15411 | * @static
|
15412 | * @param {google.cloud.speech.v1p1beta1.IListPhraseSetResponse} message ListPhraseSetResponse message or plain object to encode
|
15413 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
15414 | * @returns {$protobuf.Writer} Writer
|
15415 | */
|
15416 | ListPhraseSetResponse.encode = function encode(message, writer) {
|
15417 | if (!writer)
|
15418 | writer = $Writer.create();
|
15419 | if (message.phraseSets != null && message.phraseSets.length)
|
15420 | for (var i = 0; i < message.phraseSets.length; ++i)
|
15421 | $root.google.cloud.speech.v1p1beta1.PhraseSet.encode(message.phraseSets[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
15422 | if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken"))
|
15423 | writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken);
|
15424 | return writer;
|
15425 | };
|
15426 |
|
15427 | /**
|
15428 | * Encodes the specified ListPhraseSetResponse message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.ListPhraseSetResponse.verify|verify} messages.
|
15429 | * @function encodeDelimited
|
15430 | * @memberof google.cloud.speech.v1p1beta1.ListPhraseSetResponse
|
15431 | * @static
|
15432 | * @param {google.cloud.speech.v1p1beta1.IListPhraseSetResponse} message ListPhraseSetResponse message or plain object to encode
|
15433 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
15434 | * @returns {$protobuf.Writer} Writer
|
15435 | */
|
15436 | ListPhraseSetResponse.encodeDelimited = function encodeDelimited(message, writer) {
|
15437 | return this.encode(message, writer).ldelim();
|
15438 | };
|
15439 |
|
15440 | /**
|
15441 | * Decodes a ListPhraseSetResponse message from the specified reader or buffer.
|
15442 | * @function decode
|
15443 | * @memberof google.cloud.speech.v1p1beta1.ListPhraseSetResponse
|
15444 | * @static
|
15445 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
15446 | * @param {number} [length] Message length if known beforehand
|
15447 | * @returns {google.cloud.speech.v1p1beta1.ListPhraseSetResponse} ListPhraseSetResponse
|
15448 | * @throws {Error} If the payload is not a reader or valid buffer
|
15449 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
15450 | */
|
15451 | ListPhraseSetResponse.decode = function decode(reader, length) {
|
15452 | if (!(reader instanceof $Reader))
|
15453 | reader = $Reader.create(reader);
|
15454 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.ListPhraseSetResponse();
|
15455 | while (reader.pos < end) {
|
15456 | var tag = reader.uint32();
|
15457 | switch (tag >>> 3) {
|
15458 | case 1:
|
15459 | if (!(message.phraseSets && message.phraseSets.length))
|
15460 | message.phraseSets = [];
|
15461 | message.phraseSets.push($root.google.cloud.speech.v1p1beta1.PhraseSet.decode(reader, reader.uint32()));
|
15462 | break;
|
15463 | case 2:
|
15464 | message.nextPageToken = reader.string();
|
15465 | break;
|
15466 | default:
|
15467 | reader.skipType(tag & 7);
|
15468 | break;
|
15469 | }
|
15470 | }
|
15471 | return message;
|
15472 | };
|
15473 |
|
15474 | /**
|
15475 | * Decodes a ListPhraseSetResponse message from the specified reader or buffer, length delimited.
|
15476 | * @function decodeDelimited
|
15477 | * @memberof google.cloud.speech.v1p1beta1.ListPhraseSetResponse
|
15478 | * @static
|
15479 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
15480 | * @returns {google.cloud.speech.v1p1beta1.ListPhraseSetResponse} ListPhraseSetResponse
|
15481 | * @throws {Error} If the payload is not a reader or valid buffer
|
15482 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
15483 | */
|
15484 | ListPhraseSetResponse.decodeDelimited = function decodeDelimited(reader) {
|
15485 | if (!(reader instanceof $Reader))
|
15486 | reader = new $Reader(reader);
|
15487 | return this.decode(reader, reader.uint32());
|
15488 | };
|
15489 |
|
15490 | /**
|
15491 | * Verifies a ListPhraseSetResponse message.
|
15492 | * @function verify
|
15493 | * @memberof google.cloud.speech.v1p1beta1.ListPhraseSetResponse
|
15494 | * @static
|
15495 | * @param {Object.<string,*>} message Plain object to verify
|
15496 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
15497 | */
|
15498 | ListPhraseSetResponse.verify = function verify(message) {
|
15499 | if (typeof message !== "object" || message === null)
|
15500 | return "object expected";
|
15501 | if (message.phraseSets != null && message.hasOwnProperty("phraseSets")) {
|
15502 | if (!Array.isArray(message.phraseSets))
|
15503 | return "phraseSets: array expected";
|
15504 | for (var i = 0; i < message.phraseSets.length; ++i) {
|
15505 | var error = $root.google.cloud.speech.v1p1beta1.PhraseSet.verify(message.phraseSets[i]);
|
15506 | if (error)
|
15507 | return "phraseSets." + error;
|
15508 | }
|
15509 | }
|
15510 | if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken"))
|
15511 | if (!$util.isString(message.nextPageToken))
|
15512 | return "nextPageToken: string expected";
|
15513 | return null;
|
15514 | };
|
15515 |
|
15516 | /**
|
15517 | * Creates a ListPhraseSetResponse message from a plain object. Also converts values to their respective internal types.
|
15518 | * @function fromObject
|
15519 | * @memberof google.cloud.speech.v1p1beta1.ListPhraseSetResponse
|
15520 | * @static
|
15521 | * @param {Object.<string,*>} object Plain object
|
15522 | * @returns {google.cloud.speech.v1p1beta1.ListPhraseSetResponse} ListPhraseSetResponse
|
15523 | */
|
15524 | ListPhraseSetResponse.fromObject = function fromObject(object) {
|
15525 | if (object instanceof $root.google.cloud.speech.v1p1beta1.ListPhraseSetResponse)
|
15526 | return object;
|
15527 | var message = new $root.google.cloud.speech.v1p1beta1.ListPhraseSetResponse();
|
15528 | if (object.phraseSets) {
|
15529 | if (!Array.isArray(object.phraseSets))
|
15530 | throw TypeError(".google.cloud.speech.v1p1beta1.ListPhraseSetResponse.phraseSets: array expected");
|
15531 | message.phraseSets = [];
|
15532 | for (var i = 0; i < object.phraseSets.length; ++i) {
|
15533 | if (typeof object.phraseSets[i] !== "object")
|
15534 | throw TypeError(".google.cloud.speech.v1p1beta1.ListPhraseSetResponse.phraseSets: object expected");
|
15535 | message.phraseSets[i] = $root.google.cloud.speech.v1p1beta1.PhraseSet.fromObject(object.phraseSets[i]);
|
15536 | }
|
15537 | }
|
15538 | if (object.nextPageToken != null)
|
15539 | message.nextPageToken = String(object.nextPageToken);
|
15540 | return message;
|
15541 | };
|
15542 |
|
15543 | /**
|
15544 | * Creates a plain object from a ListPhraseSetResponse message. Also converts values to other types if specified.
|
15545 | * @function toObject
|
15546 | * @memberof google.cloud.speech.v1p1beta1.ListPhraseSetResponse
|
15547 | * @static
|
15548 | * @param {google.cloud.speech.v1p1beta1.ListPhraseSetResponse} message ListPhraseSetResponse
|
15549 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
15550 | * @returns {Object.<string,*>} Plain object
|
15551 | */
|
15552 | ListPhraseSetResponse.toObject = function toObject(message, options) {
|
15553 | if (!options)
|
15554 | options = {};
|
15555 | var object = {};
|
15556 | if (options.arrays || options.defaults)
|
15557 | object.phraseSets = [];
|
15558 | if (options.defaults)
|
15559 | object.nextPageToken = "";
|
15560 | if (message.phraseSets && message.phraseSets.length) {
|
15561 | object.phraseSets = [];
|
15562 | for (var j = 0; j < message.phraseSets.length; ++j)
|
15563 | object.phraseSets[j] = $root.google.cloud.speech.v1p1beta1.PhraseSet.toObject(message.phraseSets[j], options);
|
15564 | }
|
15565 | if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken"))
|
15566 | object.nextPageToken = message.nextPageToken;
|
15567 | return object;
|
15568 | };
|
15569 |
|
15570 | /**
|
15571 | * Converts this ListPhraseSetResponse to JSON.
|
15572 | * @function toJSON
|
15573 | * @memberof google.cloud.speech.v1p1beta1.ListPhraseSetResponse
|
15574 | * @instance
|
15575 | * @returns {Object.<string,*>} JSON object
|
15576 | */
|
15577 | ListPhraseSetResponse.prototype.toJSON = function toJSON() {
|
15578 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
15579 | };
|
15580 |
|
15581 | return ListPhraseSetResponse;
|
15582 | })();
|
15583 |
|
15584 | v1p1beta1.DeletePhraseSetRequest = (function() {
|
15585 |
|
15586 | /**
|
15587 | * Properties of a DeletePhraseSetRequest.
|
15588 | * @memberof google.cloud.speech.v1p1beta1
|
15589 | * @interface IDeletePhraseSetRequest
|
15590 | * @property {string|null} [name] DeletePhraseSetRequest name
|
15591 | */
|
15592 |
|
15593 | /**
|
15594 | * Constructs a new DeletePhraseSetRequest.
|
15595 | * @memberof google.cloud.speech.v1p1beta1
|
15596 | * @classdesc Represents a DeletePhraseSetRequest.
|
15597 | * @implements IDeletePhraseSetRequest
|
15598 | * @constructor
|
15599 | * @param {google.cloud.speech.v1p1beta1.IDeletePhraseSetRequest=} [properties] Properties to set
|
15600 | */
|
15601 | function DeletePhraseSetRequest(properties) {
|
15602 | if (properties)
|
15603 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
15604 | if (properties[keys[i]] != null)
|
15605 | this[keys[i]] = properties[keys[i]];
|
15606 | }
|
15607 |
|
15608 | /**
|
15609 | * DeletePhraseSetRequest name.
|
15610 | * @member {string} name
|
15611 | * @memberof google.cloud.speech.v1p1beta1.DeletePhraseSetRequest
|
15612 | * @instance
|
15613 | */
|
15614 | DeletePhraseSetRequest.prototype.name = "";
|
15615 |
|
15616 | /**
|
15617 | * Creates a new DeletePhraseSetRequest instance using the specified properties.
|
15618 | * @function create
|
15619 | * @memberof google.cloud.speech.v1p1beta1.DeletePhraseSetRequest
|
15620 | * @static
|
15621 | * @param {google.cloud.speech.v1p1beta1.IDeletePhraseSetRequest=} [properties] Properties to set
|
15622 | * @returns {google.cloud.speech.v1p1beta1.DeletePhraseSetRequest} DeletePhraseSetRequest instance
|
15623 | */
|
15624 | DeletePhraseSetRequest.create = function create(properties) {
|
15625 | return new DeletePhraseSetRequest(properties);
|
15626 | };
|
15627 |
|
15628 | /**
|
15629 | * Encodes the specified DeletePhraseSetRequest message. Does not implicitly {@link google.cloud.speech.v1p1beta1.DeletePhraseSetRequest.verify|verify} messages.
|
15630 | * @function encode
|
15631 | * @memberof google.cloud.speech.v1p1beta1.DeletePhraseSetRequest
|
15632 | * @static
|
15633 | * @param {google.cloud.speech.v1p1beta1.IDeletePhraseSetRequest} message DeletePhraseSetRequest message or plain object to encode
|
15634 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
15635 | * @returns {$protobuf.Writer} Writer
|
15636 | */
|
15637 | DeletePhraseSetRequest.encode = function encode(message, writer) {
|
15638 | if (!writer)
|
15639 | writer = $Writer.create();
|
15640 | if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
15641 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
|
15642 | return writer;
|
15643 | };
|
15644 |
|
15645 | /**
|
15646 | * Encodes the specified DeletePhraseSetRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.DeletePhraseSetRequest.verify|verify} messages.
|
15647 | * @function encodeDelimited
|
15648 | * @memberof google.cloud.speech.v1p1beta1.DeletePhraseSetRequest
|
15649 | * @static
|
15650 | * @param {google.cloud.speech.v1p1beta1.IDeletePhraseSetRequest} message DeletePhraseSetRequest message or plain object to encode
|
15651 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
15652 | * @returns {$protobuf.Writer} Writer
|
15653 | */
|
15654 | DeletePhraseSetRequest.encodeDelimited = function encodeDelimited(message, writer) {
|
15655 | return this.encode(message, writer).ldelim();
|
15656 | };
|
15657 |
|
15658 | /**
|
15659 | * Decodes a DeletePhraseSetRequest message from the specified reader or buffer.
|
15660 | * @function decode
|
15661 | * @memberof google.cloud.speech.v1p1beta1.DeletePhraseSetRequest
|
15662 | * @static
|
15663 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
15664 | * @param {number} [length] Message length if known beforehand
|
15665 | * @returns {google.cloud.speech.v1p1beta1.DeletePhraseSetRequest} DeletePhraseSetRequest
|
15666 | * @throws {Error} If the payload is not a reader or valid buffer
|
15667 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
15668 | */
|
15669 | DeletePhraseSetRequest.decode = function decode(reader, length) {
|
15670 | if (!(reader instanceof $Reader))
|
15671 | reader = $Reader.create(reader);
|
15672 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest();
|
15673 | while (reader.pos < end) {
|
15674 | var tag = reader.uint32();
|
15675 | switch (tag >>> 3) {
|
15676 | case 1:
|
15677 | message.name = reader.string();
|
15678 | break;
|
15679 | default:
|
15680 | reader.skipType(tag & 7);
|
15681 | break;
|
15682 | }
|
15683 | }
|
15684 | return message;
|
15685 | };
|
15686 |
|
15687 | /**
|
15688 | * Decodes a DeletePhraseSetRequest message from the specified reader or buffer, length delimited.
|
15689 | * @function decodeDelimited
|
15690 | * @memberof google.cloud.speech.v1p1beta1.DeletePhraseSetRequest
|
15691 | * @static
|
15692 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
15693 | * @returns {google.cloud.speech.v1p1beta1.DeletePhraseSetRequest} DeletePhraseSetRequest
|
15694 | * @throws {Error} If the payload is not a reader or valid buffer
|
15695 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
15696 | */
|
15697 | DeletePhraseSetRequest.decodeDelimited = function decodeDelimited(reader) {
|
15698 | if (!(reader instanceof $Reader))
|
15699 | reader = new $Reader(reader);
|
15700 | return this.decode(reader, reader.uint32());
|
15701 | };
|
15702 |
|
15703 | /**
|
15704 | * Verifies a DeletePhraseSetRequest message.
|
15705 | * @function verify
|
15706 | * @memberof google.cloud.speech.v1p1beta1.DeletePhraseSetRequest
|
15707 | * @static
|
15708 | * @param {Object.<string,*>} message Plain object to verify
|
15709 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
15710 | */
|
15711 | DeletePhraseSetRequest.verify = function verify(message) {
|
15712 | if (typeof message !== "object" || message === null)
|
15713 | return "object expected";
|
15714 | if (message.name != null && message.hasOwnProperty("name"))
|
15715 | if (!$util.isString(message.name))
|
15716 | return "name: string expected";
|
15717 | return null;
|
15718 | };
|
15719 |
|
15720 | /**
|
15721 | * Creates a DeletePhraseSetRequest message from a plain object. Also converts values to their respective internal types.
|
15722 | * @function fromObject
|
15723 | * @memberof google.cloud.speech.v1p1beta1.DeletePhraseSetRequest
|
15724 | * @static
|
15725 | * @param {Object.<string,*>} object Plain object
|
15726 | * @returns {google.cloud.speech.v1p1beta1.DeletePhraseSetRequest} DeletePhraseSetRequest
|
15727 | */
|
15728 | DeletePhraseSetRequest.fromObject = function fromObject(object) {
|
15729 | if (object instanceof $root.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest)
|
15730 | return object;
|
15731 | var message = new $root.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest();
|
15732 | if (object.name != null)
|
15733 | message.name = String(object.name);
|
15734 | return message;
|
15735 | };
|
15736 |
|
15737 | /**
|
15738 | * Creates a plain object from a DeletePhraseSetRequest message. Also converts values to other types if specified.
|
15739 | * @function toObject
|
15740 | * @memberof google.cloud.speech.v1p1beta1.DeletePhraseSetRequest
|
15741 | * @static
|
15742 | * @param {google.cloud.speech.v1p1beta1.DeletePhraseSetRequest} message DeletePhraseSetRequest
|
15743 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
15744 | * @returns {Object.<string,*>} Plain object
|
15745 | */
|
15746 | DeletePhraseSetRequest.toObject = function toObject(message, options) {
|
15747 | if (!options)
|
15748 | options = {};
|
15749 | var object = {};
|
15750 | if (options.defaults)
|
15751 | object.name = "";
|
15752 | if (message.name != null && message.hasOwnProperty("name"))
|
15753 | object.name = message.name;
|
15754 | return object;
|
15755 | };
|
15756 |
|
15757 | /**
|
15758 | * Converts this DeletePhraseSetRequest to JSON.
|
15759 | * @function toJSON
|
15760 | * @memberof google.cloud.speech.v1p1beta1.DeletePhraseSetRequest
|
15761 | * @instance
|
15762 | * @returns {Object.<string,*>} JSON object
|
15763 | */
|
15764 | DeletePhraseSetRequest.prototype.toJSON = function toJSON() {
|
15765 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
15766 | };
|
15767 |
|
15768 | return DeletePhraseSetRequest;
|
15769 | })();
|
15770 |
|
15771 | v1p1beta1.CreateCustomClassRequest = (function() {
|
15772 |
|
15773 | /**
|
15774 | * Properties of a CreateCustomClassRequest.
|
15775 | * @memberof google.cloud.speech.v1p1beta1
|
15776 | * @interface ICreateCustomClassRequest
|
15777 | * @property {string|null} [parent] CreateCustomClassRequest parent
|
15778 | * @property {string|null} [customClassId] CreateCustomClassRequest customClassId
|
15779 | * @property {google.cloud.speech.v1p1beta1.ICustomClass|null} [customClass] CreateCustomClassRequest customClass
|
15780 | */
|
15781 |
|
15782 | /**
|
15783 | * Constructs a new CreateCustomClassRequest.
|
15784 | * @memberof google.cloud.speech.v1p1beta1
|
15785 | * @classdesc Represents a CreateCustomClassRequest.
|
15786 | * @implements ICreateCustomClassRequest
|
15787 | * @constructor
|
15788 | * @param {google.cloud.speech.v1p1beta1.ICreateCustomClassRequest=} [properties] Properties to set
|
15789 | */
|
15790 | function CreateCustomClassRequest(properties) {
|
15791 | if (properties)
|
15792 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
15793 | if (properties[keys[i]] != null)
|
15794 | this[keys[i]] = properties[keys[i]];
|
15795 | }
|
15796 |
|
15797 | /**
|
15798 | * CreateCustomClassRequest parent.
|
15799 | * @member {string} parent
|
15800 | * @memberof google.cloud.speech.v1p1beta1.CreateCustomClassRequest
|
15801 | * @instance
|
15802 | */
|
15803 | CreateCustomClassRequest.prototype.parent = "";
|
15804 |
|
15805 | /**
|
15806 | * CreateCustomClassRequest customClassId.
|
15807 | * @member {string} customClassId
|
15808 | * @memberof google.cloud.speech.v1p1beta1.CreateCustomClassRequest
|
15809 | * @instance
|
15810 | */
|
15811 | CreateCustomClassRequest.prototype.customClassId = "";
|
15812 |
|
15813 | /**
|
15814 | * CreateCustomClassRequest customClass.
|
15815 | * @member {google.cloud.speech.v1p1beta1.ICustomClass|null|undefined} customClass
|
15816 | * @memberof google.cloud.speech.v1p1beta1.CreateCustomClassRequest
|
15817 | * @instance
|
15818 | */
|
15819 | CreateCustomClassRequest.prototype.customClass = null;
|
15820 |
|
15821 | /**
|
15822 | * Creates a new CreateCustomClassRequest instance using the specified properties.
|
15823 | * @function create
|
15824 | * @memberof google.cloud.speech.v1p1beta1.CreateCustomClassRequest
|
15825 | * @static
|
15826 | * @param {google.cloud.speech.v1p1beta1.ICreateCustomClassRequest=} [properties] Properties to set
|
15827 | * @returns {google.cloud.speech.v1p1beta1.CreateCustomClassRequest} CreateCustomClassRequest instance
|
15828 | */
|
15829 | CreateCustomClassRequest.create = function create(properties) {
|
15830 | return new CreateCustomClassRequest(properties);
|
15831 | };
|
15832 |
|
15833 | /**
|
15834 | * Encodes the specified CreateCustomClassRequest message. Does not implicitly {@link google.cloud.speech.v1p1beta1.CreateCustomClassRequest.verify|verify} messages.
|
15835 | * @function encode
|
15836 | * @memberof google.cloud.speech.v1p1beta1.CreateCustomClassRequest
|
15837 | * @static
|
15838 | * @param {google.cloud.speech.v1p1beta1.ICreateCustomClassRequest} message CreateCustomClassRequest message or plain object to encode
|
15839 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
15840 | * @returns {$protobuf.Writer} Writer
|
15841 | */
|
15842 | CreateCustomClassRequest.encode = function encode(message, writer) {
|
15843 | if (!writer)
|
15844 | writer = $Writer.create();
|
15845 | if (message.parent != null && Object.hasOwnProperty.call(message, "parent"))
|
15846 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent);
|
15847 | if (message.customClassId != null && Object.hasOwnProperty.call(message, "customClassId"))
|
15848 | writer.uint32(/* id 2, wireType 2 =*/18).string(message.customClassId);
|
15849 | if (message.customClass != null && Object.hasOwnProperty.call(message, "customClass"))
|
15850 | $root.google.cloud.speech.v1p1beta1.CustomClass.encode(message.customClass, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
|
15851 | return writer;
|
15852 | };
|
15853 |
|
15854 | /**
|
15855 | * Encodes the specified CreateCustomClassRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.CreateCustomClassRequest.verify|verify} messages.
|
15856 | * @function encodeDelimited
|
15857 | * @memberof google.cloud.speech.v1p1beta1.CreateCustomClassRequest
|
15858 | * @static
|
15859 | * @param {google.cloud.speech.v1p1beta1.ICreateCustomClassRequest} message CreateCustomClassRequest message or plain object to encode
|
15860 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
15861 | * @returns {$protobuf.Writer} Writer
|
15862 | */
|
15863 | CreateCustomClassRequest.encodeDelimited = function encodeDelimited(message, writer) {
|
15864 | return this.encode(message, writer).ldelim();
|
15865 | };
|
15866 |
|
15867 | /**
|
15868 | * Decodes a CreateCustomClassRequest message from the specified reader or buffer.
|
15869 | * @function decode
|
15870 | * @memberof google.cloud.speech.v1p1beta1.CreateCustomClassRequest
|
15871 | * @static
|
15872 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
15873 | * @param {number} [length] Message length if known beforehand
|
15874 | * @returns {google.cloud.speech.v1p1beta1.CreateCustomClassRequest} CreateCustomClassRequest
|
15875 | * @throws {Error} If the payload is not a reader or valid buffer
|
15876 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
15877 | */
|
15878 | CreateCustomClassRequest.decode = function decode(reader, length) {
|
15879 | if (!(reader instanceof $Reader))
|
15880 | reader = $Reader.create(reader);
|
15881 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.CreateCustomClassRequest();
|
15882 | while (reader.pos < end) {
|
15883 | var tag = reader.uint32();
|
15884 | switch (tag >>> 3) {
|
15885 | case 1:
|
15886 | message.parent = reader.string();
|
15887 | break;
|
15888 | case 2:
|
15889 | message.customClassId = reader.string();
|
15890 | break;
|
15891 | case 3:
|
15892 | message.customClass = $root.google.cloud.speech.v1p1beta1.CustomClass.decode(reader, reader.uint32());
|
15893 | break;
|
15894 | default:
|
15895 | reader.skipType(tag & 7);
|
15896 | break;
|
15897 | }
|
15898 | }
|
15899 | return message;
|
15900 | };
|
15901 |
|
15902 | /**
|
15903 | * Decodes a CreateCustomClassRequest message from the specified reader or buffer, length delimited.
|
15904 | * @function decodeDelimited
|
15905 | * @memberof google.cloud.speech.v1p1beta1.CreateCustomClassRequest
|
15906 | * @static
|
15907 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
15908 | * @returns {google.cloud.speech.v1p1beta1.CreateCustomClassRequest} CreateCustomClassRequest
|
15909 | * @throws {Error} If the payload is not a reader or valid buffer
|
15910 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
15911 | */
|
15912 | CreateCustomClassRequest.decodeDelimited = function decodeDelimited(reader) {
|
15913 | if (!(reader instanceof $Reader))
|
15914 | reader = new $Reader(reader);
|
15915 | return this.decode(reader, reader.uint32());
|
15916 | };
|
15917 |
|
15918 | /**
|
15919 | * Verifies a CreateCustomClassRequest message.
|
15920 | * @function verify
|
15921 | * @memberof google.cloud.speech.v1p1beta1.CreateCustomClassRequest
|
15922 | * @static
|
15923 | * @param {Object.<string,*>} message Plain object to verify
|
15924 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
15925 | */
|
15926 | CreateCustomClassRequest.verify = function verify(message) {
|
15927 | if (typeof message !== "object" || message === null)
|
15928 | return "object expected";
|
15929 | if (message.parent != null && message.hasOwnProperty("parent"))
|
15930 | if (!$util.isString(message.parent))
|
15931 | return "parent: string expected";
|
15932 | if (message.customClassId != null && message.hasOwnProperty("customClassId"))
|
15933 | if (!$util.isString(message.customClassId))
|
15934 | return "customClassId: string expected";
|
15935 | if (message.customClass != null && message.hasOwnProperty("customClass")) {
|
15936 | var error = $root.google.cloud.speech.v1p1beta1.CustomClass.verify(message.customClass);
|
15937 | if (error)
|
15938 | return "customClass." + error;
|
15939 | }
|
15940 | return null;
|
15941 | };
|
15942 |
|
15943 | /**
|
15944 | * Creates a CreateCustomClassRequest message from a plain object. Also converts values to their respective internal types.
|
15945 | * @function fromObject
|
15946 | * @memberof google.cloud.speech.v1p1beta1.CreateCustomClassRequest
|
15947 | * @static
|
15948 | * @param {Object.<string,*>} object Plain object
|
15949 | * @returns {google.cloud.speech.v1p1beta1.CreateCustomClassRequest} CreateCustomClassRequest
|
15950 | */
|
15951 | CreateCustomClassRequest.fromObject = function fromObject(object) {
|
15952 | if (object instanceof $root.google.cloud.speech.v1p1beta1.CreateCustomClassRequest)
|
15953 | return object;
|
15954 | var message = new $root.google.cloud.speech.v1p1beta1.CreateCustomClassRequest();
|
15955 | if (object.parent != null)
|
15956 | message.parent = String(object.parent);
|
15957 | if (object.customClassId != null)
|
15958 | message.customClassId = String(object.customClassId);
|
15959 | if (object.customClass != null) {
|
15960 | if (typeof object.customClass !== "object")
|
15961 | throw TypeError(".google.cloud.speech.v1p1beta1.CreateCustomClassRequest.customClass: object expected");
|
15962 | message.customClass = $root.google.cloud.speech.v1p1beta1.CustomClass.fromObject(object.customClass);
|
15963 | }
|
15964 | return message;
|
15965 | };
|
15966 |
|
15967 | /**
|
15968 | * Creates a plain object from a CreateCustomClassRequest message. Also converts values to other types if specified.
|
15969 | * @function toObject
|
15970 | * @memberof google.cloud.speech.v1p1beta1.CreateCustomClassRequest
|
15971 | * @static
|
15972 | * @param {google.cloud.speech.v1p1beta1.CreateCustomClassRequest} message CreateCustomClassRequest
|
15973 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
15974 | * @returns {Object.<string,*>} Plain object
|
15975 | */
|
15976 | CreateCustomClassRequest.toObject = function toObject(message, options) {
|
15977 | if (!options)
|
15978 | options = {};
|
15979 | var object = {};
|
15980 | if (options.defaults) {
|
15981 | object.parent = "";
|
15982 | object.customClassId = "";
|
15983 | object.customClass = null;
|
15984 | }
|
15985 | if (message.parent != null && message.hasOwnProperty("parent"))
|
15986 | object.parent = message.parent;
|
15987 | if (message.customClassId != null && message.hasOwnProperty("customClassId"))
|
15988 | object.customClassId = message.customClassId;
|
15989 | if (message.customClass != null && message.hasOwnProperty("customClass"))
|
15990 | object.customClass = $root.google.cloud.speech.v1p1beta1.CustomClass.toObject(message.customClass, options);
|
15991 | return object;
|
15992 | };
|
15993 |
|
15994 | /**
|
15995 | * Converts this CreateCustomClassRequest to JSON.
|
15996 | * @function toJSON
|
15997 | * @memberof google.cloud.speech.v1p1beta1.CreateCustomClassRequest
|
15998 | * @instance
|
15999 | * @returns {Object.<string,*>} JSON object
|
16000 | */
|
16001 | CreateCustomClassRequest.prototype.toJSON = function toJSON() {
|
16002 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
16003 | };
|
16004 |
|
16005 | return CreateCustomClassRequest;
|
16006 | })();
|
16007 |
|
16008 | v1p1beta1.UpdateCustomClassRequest = (function() {
|
16009 |
|
16010 | /**
|
16011 | * Properties of an UpdateCustomClassRequest.
|
16012 | * @memberof google.cloud.speech.v1p1beta1
|
16013 | * @interface IUpdateCustomClassRequest
|
16014 | * @property {google.cloud.speech.v1p1beta1.ICustomClass|null} [customClass] UpdateCustomClassRequest customClass
|
16015 | * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateCustomClassRequest updateMask
|
16016 | */
|
16017 |
|
16018 | /**
|
16019 | * Constructs a new UpdateCustomClassRequest.
|
16020 | * @memberof google.cloud.speech.v1p1beta1
|
16021 | * @classdesc Represents an UpdateCustomClassRequest.
|
16022 | * @implements IUpdateCustomClassRequest
|
16023 | * @constructor
|
16024 | * @param {google.cloud.speech.v1p1beta1.IUpdateCustomClassRequest=} [properties] Properties to set
|
16025 | */
|
16026 | function UpdateCustomClassRequest(properties) {
|
16027 | if (properties)
|
16028 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
16029 | if (properties[keys[i]] != null)
|
16030 | this[keys[i]] = properties[keys[i]];
|
16031 | }
|
16032 |
|
16033 | /**
|
16034 | * UpdateCustomClassRequest customClass.
|
16035 | * @member {google.cloud.speech.v1p1beta1.ICustomClass|null|undefined} customClass
|
16036 | * @memberof google.cloud.speech.v1p1beta1.UpdateCustomClassRequest
|
16037 | * @instance
|
16038 | */
|
16039 | UpdateCustomClassRequest.prototype.customClass = null;
|
16040 |
|
16041 | /**
|
16042 | * UpdateCustomClassRequest updateMask.
|
16043 | * @member {google.protobuf.IFieldMask|null|undefined} updateMask
|
16044 | * @memberof google.cloud.speech.v1p1beta1.UpdateCustomClassRequest
|
16045 | * @instance
|
16046 | */
|
16047 | UpdateCustomClassRequest.prototype.updateMask = null;
|
16048 |
|
16049 | /**
|
16050 | * Creates a new UpdateCustomClassRequest instance using the specified properties.
|
16051 | * @function create
|
16052 | * @memberof google.cloud.speech.v1p1beta1.UpdateCustomClassRequest
|
16053 | * @static
|
16054 | * @param {google.cloud.speech.v1p1beta1.IUpdateCustomClassRequest=} [properties] Properties to set
|
16055 | * @returns {google.cloud.speech.v1p1beta1.UpdateCustomClassRequest} UpdateCustomClassRequest instance
|
16056 | */
|
16057 | UpdateCustomClassRequest.create = function create(properties) {
|
16058 | return new UpdateCustomClassRequest(properties);
|
16059 | };
|
16060 |
|
16061 | /**
|
16062 | * Encodes the specified UpdateCustomClassRequest message. Does not implicitly {@link google.cloud.speech.v1p1beta1.UpdateCustomClassRequest.verify|verify} messages.
|
16063 | * @function encode
|
16064 | * @memberof google.cloud.speech.v1p1beta1.UpdateCustomClassRequest
|
16065 | * @static
|
16066 | * @param {google.cloud.speech.v1p1beta1.IUpdateCustomClassRequest} message UpdateCustomClassRequest message or plain object to encode
|
16067 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
16068 | * @returns {$protobuf.Writer} Writer
|
16069 | */
|
16070 | UpdateCustomClassRequest.encode = function encode(message, writer) {
|
16071 | if (!writer)
|
16072 | writer = $Writer.create();
|
16073 | if (message.customClass != null && Object.hasOwnProperty.call(message, "customClass"))
|
16074 | $root.google.cloud.speech.v1p1beta1.CustomClass.encode(message.customClass, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
16075 | if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask"))
|
16076 | $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
16077 | return writer;
|
16078 | };
|
16079 |
|
16080 | /**
|
16081 | * Encodes the specified UpdateCustomClassRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.UpdateCustomClassRequest.verify|verify} messages.
|
16082 | * @function encodeDelimited
|
16083 | * @memberof google.cloud.speech.v1p1beta1.UpdateCustomClassRequest
|
16084 | * @static
|
16085 | * @param {google.cloud.speech.v1p1beta1.IUpdateCustomClassRequest} message UpdateCustomClassRequest message or plain object to encode
|
16086 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
16087 | * @returns {$protobuf.Writer} Writer
|
16088 | */
|
16089 | UpdateCustomClassRequest.encodeDelimited = function encodeDelimited(message, writer) {
|
16090 | return this.encode(message, writer).ldelim();
|
16091 | };
|
16092 |
|
16093 | /**
|
16094 | * Decodes an UpdateCustomClassRequest message from the specified reader or buffer.
|
16095 | * @function decode
|
16096 | * @memberof google.cloud.speech.v1p1beta1.UpdateCustomClassRequest
|
16097 | * @static
|
16098 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
16099 | * @param {number} [length] Message length if known beforehand
|
16100 | * @returns {google.cloud.speech.v1p1beta1.UpdateCustomClassRequest} UpdateCustomClassRequest
|
16101 | * @throws {Error} If the payload is not a reader or valid buffer
|
16102 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
16103 | */
|
16104 | UpdateCustomClassRequest.decode = function decode(reader, length) {
|
16105 | if (!(reader instanceof $Reader))
|
16106 | reader = $Reader.create(reader);
|
16107 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest();
|
16108 | while (reader.pos < end) {
|
16109 | var tag = reader.uint32();
|
16110 | switch (tag >>> 3) {
|
16111 | case 1:
|
16112 | message.customClass = $root.google.cloud.speech.v1p1beta1.CustomClass.decode(reader, reader.uint32());
|
16113 | break;
|
16114 | case 2:
|
16115 | message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32());
|
16116 | break;
|
16117 | default:
|
16118 | reader.skipType(tag & 7);
|
16119 | break;
|
16120 | }
|
16121 | }
|
16122 | return message;
|
16123 | };
|
16124 |
|
16125 | /**
|
16126 | * Decodes an UpdateCustomClassRequest message from the specified reader or buffer, length delimited.
|
16127 | * @function decodeDelimited
|
16128 | * @memberof google.cloud.speech.v1p1beta1.UpdateCustomClassRequest
|
16129 | * @static
|
16130 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
16131 | * @returns {google.cloud.speech.v1p1beta1.UpdateCustomClassRequest} UpdateCustomClassRequest
|
16132 | * @throws {Error} If the payload is not a reader or valid buffer
|
16133 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
16134 | */
|
16135 | UpdateCustomClassRequest.decodeDelimited = function decodeDelimited(reader) {
|
16136 | if (!(reader instanceof $Reader))
|
16137 | reader = new $Reader(reader);
|
16138 | return this.decode(reader, reader.uint32());
|
16139 | };
|
16140 |
|
16141 | /**
|
16142 | * Verifies an UpdateCustomClassRequest message.
|
16143 | * @function verify
|
16144 | * @memberof google.cloud.speech.v1p1beta1.UpdateCustomClassRequest
|
16145 | * @static
|
16146 | * @param {Object.<string,*>} message Plain object to verify
|
16147 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
16148 | */
|
16149 | UpdateCustomClassRequest.verify = function verify(message) {
|
16150 | if (typeof message !== "object" || message === null)
|
16151 | return "object expected";
|
16152 | if (message.customClass != null && message.hasOwnProperty("customClass")) {
|
16153 | var error = $root.google.cloud.speech.v1p1beta1.CustomClass.verify(message.customClass);
|
16154 | if (error)
|
16155 | return "customClass." + error;
|
16156 | }
|
16157 | if (message.updateMask != null && message.hasOwnProperty("updateMask")) {
|
16158 | var error = $root.google.protobuf.FieldMask.verify(message.updateMask);
|
16159 | if (error)
|
16160 | return "updateMask." + error;
|
16161 | }
|
16162 | return null;
|
16163 | };
|
16164 |
|
16165 | /**
|
16166 | * Creates an UpdateCustomClassRequest message from a plain object. Also converts values to their respective internal types.
|
16167 | * @function fromObject
|
16168 | * @memberof google.cloud.speech.v1p1beta1.UpdateCustomClassRequest
|
16169 | * @static
|
16170 | * @param {Object.<string,*>} object Plain object
|
16171 | * @returns {google.cloud.speech.v1p1beta1.UpdateCustomClassRequest} UpdateCustomClassRequest
|
16172 | */
|
16173 | UpdateCustomClassRequest.fromObject = function fromObject(object) {
|
16174 | if (object instanceof $root.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest)
|
16175 | return object;
|
16176 | var message = new $root.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest();
|
16177 | if (object.customClass != null) {
|
16178 | if (typeof object.customClass !== "object")
|
16179 | throw TypeError(".google.cloud.speech.v1p1beta1.UpdateCustomClassRequest.customClass: object expected");
|
16180 | message.customClass = $root.google.cloud.speech.v1p1beta1.CustomClass.fromObject(object.customClass);
|
16181 | }
|
16182 | if (object.updateMask != null) {
|
16183 | if (typeof object.updateMask !== "object")
|
16184 | throw TypeError(".google.cloud.speech.v1p1beta1.UpdateCustomClassRequest.updateMask: object expected");
|
16185 | message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask);
|
16186 | }
|
16187 | return message;
|
16188 | };
|
16189 |
|
16190 | /**
|
16191 | * Creates a plain object from an UpdateCustomClassRequest message. Also converts values to other types if specified.
|
16192 | * @function toObject
|
16193 | * @memberof google.cloud.speech.v1p1beta1.UpdateCustomClassRequest
|
16194 | * @static
|
16195 | * @param {google.cloud.speech.v1p1beta1.UpdateCustomClassRequest} message UpdateCustomClassRequest
|
16196 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
16197 | * @returns {Object.<string,*>} Plain object
|
16198 | */
|
16199 | UpdateCustomClassRequest.toObject = function toObject(message, options) {
|
16200 | if (!options)
|
16201 | options = {};
|
16202 | var object = {};
|
16203 | if (options.defaults) {
|
16204 | object.customClass = null;
|
16205 | object.updateMask = null;
|
16206 | }
|
16207 | if (message.customClass != null && message.hasOwnProperty("customClass"))
|
16208 | object.customClass = $root.google.cloud.speech.v1p1beta1.CustomClass.toObject(message.customClass, options);
|
16209 | if (message.updateMask != null && message.hasOwnProperty("updateMask"))
|
16210 | object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options);
|
16211 | return object;
|
16212 | };
|
16213 |
|
16214 | /**
|
16215 | * Converts this UpdateCustomClassRequest to JSON.
|
16216 | * @function toJSON
|
16217 | * @memberof google.cloud.speech.v1p1beta1.UpdateCustomClassRequest
|
16218 | * @instance
|
16219 | * @returns {Object.<string,*>} JSON object
|
16220 | */
|
16221 | UpdateCustomClassRequest.prototype.toJSON = function toJSON() {
|
16222 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
16223 | };
|
16224 |
|
16225 | return UpdateCustomClassRequest;
|
16226 | })();
|
16227 |
|
16228 | v1p1beta1.GetCustomClassRequest = (function() {
|
16229 |
|
16230 | /**
|
16231 | * Properties of a GetCustomClassRequest.
|
16232 | * @memberof google.cloud.speech.v1p1beta1
|
16233 | * @interface IGetCustomClassRequest
|
16234 | * @property {string|null} [name] GetCustomClassRequest name
|
16235 | */
|
16236 |
|
16237 | /**
|
16238 | * Constructs a new GetCustomClassRequest.
|
16239 | * @memberof google.cloud.speech.v1p1beta1
|
16240 | * @classdesc Represents a GetCustomClassRequest.
|
16241 | * @implements IGetCustomClassRequest
|
16242 | * @constructor
|
16243 | * @param {google.cloud.speech.v1p1beta1.IGetCustomClassRequest=} [properties] Properties to set
|
16244 | */
|
16245 | function GetCustomClassRequest(properties) {
|
16246 | if (properties)
|
16247 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
16248 | if (properties[keys[i]] != null)
|
16249 | this[keys[i]] = properties[keys[i]];
|
16250 | }
|
16251 |
|
16252 | /**
|
16253 | * GetCustomClassRequest name.
|
16254 | * @member {string} name
|
16255 | * @memberof google.cloud.speech.v1p1beta1.GetCustomClassRequest
|
16256 | * @instance
|
16257 | */
|
16258 | GetCustomClassRequest.prototype.name = "";
|
16259 |
|
16260 | /**
|
16261 | * Creates a new GetCustomClassRequest instance using the specified properties.
|
16262 | * @function create
|
16263 | * @memberof google.cloud.speech.v1p1beta1.GetCustomClassRequest
|
16264 | * @static
|
16265 | * @param {google.cloud.speech.v1p1beta1.IGetCustomClassRequest=} [properties] Properties to set
|
16266 | * @returns {google.cloud.speech.v1p1beta1.GetCustomClassRequest} GetCustomClassRequest instance
|
16267 | */
|
16268 | GetCustomClassRequest.create = function create(properties) {
|
16269 | return new GetCustomClassRequest(properties);
|
16270 | };
|
16271 |
|
16272 | /**
|
16273 | * Encodes the specified GetCustomClassRequest message. Does not implicitly {@link google.cloud.speech.v1p1beta1.GetCustomClassRequest.verify|verify} messages.
|
16274 | * @function encode
|
16275 | * @memberof google.cloud.speech.v1p1beta1.GetCustomClassRequest
|
16276 | * @static
|
16277 | * @param {google.cloud.speech.v1p1beta1.IGetCustomClassRequest} message GetCustomClassRequest message or plain object to encode
|
16278 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
16279 | * @returns {$protobuf.Writer} Writer
|
16280 | */
|
16281 | GetCustomClassRequest.encode = function encode(message, writer) {
|
16282 | if (!writer)
|
16283 | writer = $Writer.create();
|
16284 | if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
16285 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
|
16286 | return writer;
|
16287 | };
|
16288 |
|
16289 | /**
|
16290 | * Encodes the specified GetCustomClassRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.GetCustomClassRequest.verify|verify} messages.
|
16291 | * @function encodeDelimited
|
16292 | * @memberof google.cloud.speech.v1p1beta1.GetCustomClassRequest
|
16293 | * @static
|
16294 | * @param {google.cloud.speech.v1p1beta1.IGetCustomClassRequest} message GetCustomClassRequest message or plain object to encode
|
16295 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
16296 | * @returns {$protobuf.Writer} Writer
|
16297 | */
|
16298 | GetCustomClassRequest.encodeDelimited = function encodeDelimited(message, writer) {
|
16299 | return this.encode(message, writer).ldelim();
|
16300 | };
|
16301 |
|
16302 | /**
|
16303 | * Decodes a GetCustomClassRequest message from the specified reader or buffer.
|
16304 | * @function decode
|
16305 | * @memberof google.cloud.speech.v1p1beta1.GetCustomClassRequest
|
16306 | * @static
|
16307 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
16308 | * @param {number} [length] Message length if known beforehand
|
16309 | * @returns {google.cloud.speech.v1p1beta1.GetCustomClassRequest} GetCustomClassRequest
|
16310 | * @throws {Error} If the payload is not a reader or valid buffer
|
16311 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
16312 | */
|
16313 | GetCustomClassRequest.decode = function decode(reader, length) {
|
16314 | if (!(reader instanceof $Reader))
|
16315 | reader = $Reader.create(reader);
|
16316 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.GetCustomClassRequest();
|
16317 | while (reader.pos < end) {
|
16318 | var tag = reader.uint32();
|
16319 | switch (tag >>> 3) {
|
16320 | case 1:
|
16321 | message.name = reader.string();
|
16322 | break;
|
16323 | default:
|
16324 | reader.skipType(tag & 7);
|
16325 | break;
|
16326 | }
|
16327 | }
|
16328 | return message;
|
16329 | };
|
16330 |
|
16331 | /**
|
16332 | * Decodes a GetCustomClassRequest message from the specified reader or buffer, length delimited.
|
16333 | * @function decodeDelimited
|
16334 | * @memberof google.cloud.speech.v1p1beta1.GetCustomClassRequest
|
16335 | * @static
|
16336 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
16337 | * @returns {google.cloud.speech.v1p1beta1.GetCustomClassRequest} GetCustomClassRequest
|
16338 | * @throws {Error} If the payload is not a reader or valid buffer
|
16339 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
16340 | */
|
16341 | GetCustomClassRequest.decodeDelimited = function decodeDelimited(reader) {
|
16342 | if (!(reader instanceof $Reader))
|
16343 | reader = new $Reader(reader);
|
16344 | return this.decode(reader, reader.uint32());
|
16345 | };
|
16346 |
|
16347 | /**
|
16348 | * Verifies a GetCustomClassRequest message.
|
16349 | * @function verify
|
16350 | * @memberof google.cloud.speech.v1p1beta1.GetCustomClassRequest
|
16351 | * @static
|
16352 | * @param {Object.<string,*>} message Plain object to verify
|
16353 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
16354 | */
|
16355 | GetCustomClassRequest.verify = function verify(message) {
|
16356 | if (typeof message !== "object" || message === null)
|
16357 | return "object expected";
|
16358 | if (message.name != null && message.hasOwnProperty("name"))
|
16359 | if (!$util.isString(message.name))
|
16360 | return "name: string expected";
|
16361 | return null;
|
16362 | };
|
16363 |
|
16364 | /**
|
16365 | * Creates a GetCustomClassRequest message from a plain object. Also converts values to their respective internal types.
|
16366 | * @function fromObject
|
16367 | * @memberof google.cloud.speech.v1p1beta1.GetCustomClassRequest
|
16368 | * @static
|
16369 | * @param {Object.<string,*>} object Plain object
|
16370 | * @returns {google.cloud.speech.v1p1beta1.GetCustomClassRequest} GetCustomClassRequest
|
16371 | */
|
16372 | GetCustomClassRequest.fromObject = function fromObject(object) {
|
16373 | if (object instanceof $root.google.cloud.speech.v1p1beta1.GetCustomClassRequest)
|
16374 | return object;
|
16375 | var message = new $root.google.cloud.speech.v1p1beta1.GetCustomClassRequest();
|
16376 | if (object.name != null)
|
16377 | message.name = String(object.name);
|
16378 | return message;
|
16379 | };
|
16380 |
|
16381 | /**
|
16382 | * Creates a plain object from a GetCustomClassRequest message. Also converts values to other types if specified.
|
16383 | * @function toObject
|
16384 | * @memberof google.cloud.speech.v1p1beta1.GetCustomClassRequest
|
16385 | * @static
|
16386 | * @param {google.cloud.speech.v1p1beta1.GetCustomClassRequest} message GetCustomClassRequest
|
16387 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
16388 | * @returns {Object.<string,*>} Plain object
|
16389 | */
|
16390 | GetCustomClassRequest.toObject = function toObject(message, options) {
|
16391 | if (!options)
|
16392 | options = {};
|
16393 | var object = {};
|
16394 | if (options.defaults)
|
16395 | object.name = "";
|
16396 | if (message.name != null && message.hasOwnProperty("name"))
|
16397 | object.name = message.name;
|
16398 | return object;
|
16399 | };
|
16400 |
|
16401 | /**
|
16402 | * Converts this GetCustomClassRequest to JSON.
|
16403 | * @function toJSON
|
16404 | * @memberof google.cloud.speech.v1p1beta1.GetCustomClassRequest
|
16405 | * @instance
|
16406 | * @returns {Object.<string,*>} JSON object
|
16407 | */
|
16408 | GetCustomClassRequest.prototype.toJSON = function toJSON() {
|
16409 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
16410 | };
|
16411 |
|
16412 | return GetCustomClassRequest;
|
16413 | })();
|
16414 |
|
16415 | v1p1beta1.ListCustomClassesRequest = (function() {
|
16416 |
|
16417 | /**
|
16418 | * Properties of a ListCustomClassesRequest.
|
16419 | * @memberof google.cloud.speech.v1p1beta1
|
16420 | * @interface IListCustomClassesRequest
|
16421 | * @property {string|null} [parent] ListCustomClassesRequest parent
|
16422 | * @property {number|null} [pageSize] ListCustomClassesRequest pageSize
|
16423 | * @property {string|null} [pageToken] ListCustomClassesRequest pageToken
|
16424 | */
|
16425 |
|
16426 | /**
|
16427 | * Constructs a new ListCustomClassesRequest.
|
16428 | * @memberof google.cloud.speech.v1p1beta1
|
16429 | * @classdesc Represents a ListCustomClassesRequest.
|
16430 | * @implements IListCustomClassesRequest
|
16431 | * @constructor
|
16432 | * @param {google.cloud.speech.v1p1beta1.IListCustomClassesRequest=} [properties] Properties to set
|
16433 | */
|
16434 | function ListCustomClassesRequest(properties) {
|
16435 | if (properties)
|
16436 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
16437 | if (properties[keys[i]] != null)
|
16438 | this[keys[i]] = properties[keys[i]];
|
16439 | }
|
16440 |
|
16441 | /**
|
16442 | * ListCustomClassesRequest parent.
|
16443 | * @member {string} parent
|
16444 | * @memberof google.cloud.speech.v1p1beta1.ListCustomClassesRequest
|
16445 | * @instance
|
16446 | */
|
16447 | ListCustomClassesRequest.prototype.parent = "";
|
16448 |
|
16449 | /**
|
16450 | * ListCustomClassesRequest pageSize.
|
16451 | * @member {number} pageSize
|
16452 | * @memberof google.cloud.speech.v1p1beta1.ListCustomClassesRequest
|
16453 | * @instance
|
16454 | */
|
16455 | ListCustomClassesRequest.prototype.pageSize = 0;
|
16456 |
|
16457 | /**
|
16458 | * ListCustomClassesRequest pageToken.
|
16459 | * @member {string} pageToken
|
16460 | * @memberof google.cloud.speech.v1p1beta1.ListCustomClassesRequest
|
16461 | * @instance
|
16462 | */
|
16463 | ListCustomClassesRequest.prototype.pageToken = "";
|
16464 |
|
16465 | /**
|
16466 | * Creates a new ListCustomClassesRequest instance using the specified properties.
|
16467 | * @function create
|
16468 | * @memberof google.cloud.speech.v1p1beta1.ListCustomClassesRequest
|
16469 | * @static
|
16470 | * @param {google.cloud.speech.v1p1beta1.IListCustomClassesRequest=} [properties] Properties to set
|
16471 | * @returns {google.cloud.speech.v1p1beta1.ListCustomClassesRequest} ListCustomClassesRequest instance
|
16472 | */
|
16473 | ListCustomClassesRequest.create = function create(properties) {
|
16474 | return new ListCustomClassesRequest(properties);
|
16475 | };
|
16476 |
|
16477 | /**
|
16478 | * Encodes the specified ListCustomClassesRequest message. Does not implicitly {@link google.cloud.speech.v1p1beta1.ListCustomClassesRequest.verify|verify} messages.
|
16479 | * @function encode
|
16480 | * @memberof google.cloud.speech.v1p1beta1.ListCustomClassesRequest
|
16481 | * @static
|
16482 | * @param {google.cloud.speech.v1p1beta1.IListCustomClassesRequest} message ListCustomClassesRequest message or plain object to encode
|
16483 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
16484 | * @returns {$protobuf.Writer} Writer
|
16485 | */
|
16486 | ListCustomClassesRequest.encode = function encode(message, writer) {
|
16487 | if (!writer)
|
16488 | writer = $Writer.create();
|
16489 | if (message.parent != null && Object.hasOwnProperty.call(message, "parent"))
|
16490 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent);
|
16491 | if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize"))
|
16492 | writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize);
|
16493 | if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken"))
|
16494 | writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken);
|
16495 | return writer;
|
16496 | };
|
16497 |
|
16498 | /**
|
16499 | * Encodes the specified ListCustomClassesRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.ListCustomClassesRequest.verify|verify} messages.
|
16500 | * @function encodeDelimited
|
16501 | * @memberof google.cloud.speech.v1p1beta1.ListCustomClassesRequest
|
16502 | * @static
|
16503 | * @param {google.cloud.speech.v1p1beta1.IListCustomClassesRequest} message ListCustomClassesRequest message or plain object to encode
|
16504 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
16505 | * @returns {$protobuf.Writer} Writer
|
16506 | */
|
16507 | ListCustomClassesRequest.encodeDelimited = function encodeDelimited(message, writer) {
|
16508 | return this.encode(message, writer).ldelim();
|
16509 | };
|
16510 |
|
16511 | /**
|
16512 | * Decodes a ListCustomClassesRequest message from the specified reader or buffer.
|
16513 | * @function decode
|
16514 | * @memberof google.cloud.speech.v1p1beta1.ListCustomClassesRequest
|
16515 | * @static
|
16516 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
16517 | * @param {number} [length] Message length if known beforehand
|
16518 | * @returns {google.cloud.speech.v1p1beta1.ListCustomClassesRequest} ListCustomClassesRequest
|
16519 | * @throws {Error} If the payload is not a reader or valid buffer
|
16520 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
16521 | */
|
16522 | ListCustomClassesRequest.decode = function decode(reader, length) {
|
16523 | if (!(reader instanceof $Reader))
|
16524 | reader = $Reader.create(reader);
|
16525 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.ListCustomClassesRequest();
|
16526 | while (reader.pos < end) {
|
16527 | var tag = reader.uint32();
|
16528 | switch (tag >>> 3) {
|
16529 | case 1:
|
16530 | message.parent = reader.string();
|
16531 | break;
|
16532 | case 2:
|
16533 | message.pageSize = reader.int32();
|
16534 | break;
|
16535 | case 3:
|
16536 | message.pageToken = reader.string();
|
16537 | break;
|
16538 | default:
|
16539 | reader.skipType(tag & 7);
|
16540 | break;
|
16541 | }
|
16542 | }
|
16543 | return message;
|
16544 | };
|
16545 |
|
16546 | /**
|
16547 | * Decodes a ListCustomClassesRequest message from the specified reader or buffer, length delimited.
|
16548 | * @function decodeDelimited
|
16549 | * @memberof google.cloud.speech.v1p1beta1.ListCustomClassesRequest
|
16550 | * @static
|
16551 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
16552 | * @returns {google.cloud.speech.v1p1beta1.ListCustomClassesRequest} ListCustomClassesRequest
|
16553 | * @throws {Error} If the payload is not a reader or valid buffer
|
16554 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
16555 | */
|
16556 | ListCustomClassesRequest.decodeDelimited = function decodeDelimited(reader) {
|
16557 | if (!(reader instanceof $Reader))
|
16558 | reader = new $Reader(reader);
|
16559 | return this.decode(reader, reader.uint32());
|
16560 | };
|
16561 |
|
16562 | /**
|
16563 | * Verifies a ListCustomClassesRequest message.
|
16564 | * @function verify
|
16565 | * @memberof google.cloud.speech.v1p1beta1.ListCustomClassesRequest
|
16566 | * @static
|
16567 | * @param {Object.<string,*>} message Plain object to verify
|
16568 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
16569 | */
|
16570 | ListCustomClassesRequest.verify = function verify(message) {
|
16571 | if (typeof message !== "object" || message === null)
|
16572 | return "object expected";
|
16573 | if (message.parent != null && message.hasOwnProperty("parent"))
|
16574 | if (!$util.isString(message.parent))
|
16575 | return "parent: string expected";
|
16576 | if (message.pageSize != null && message.hasOwnProperty("pageSize"))
|
16577 | if (!$util.isInteger(message.pageSize))
|
16578 | return "pageSize: integer expected";
|
16579 | if (message.pageToken != null && message.hasOwnProperty("pageToken"))
|
16580 | if (!$util.isString(message.pageToken))
|
16581 | return "pageToken: string expected";
|
16582 | return null;
|
16583 | };
|
16584 |
|
16585 | /**
|
16586 | * Creates a ListCustomClassesRequest message from a plain object. Also converts values to their respective internal types.
|
16587 | * @function fromObject
|
16588 | * @memberof google.cloud.speech.v1p1beta1.ListCustomClassesRequest
|
16589 | * @static
|
16590 | * @param {Object.<string,*>} object Plain object
|
16591 | * @returns {google.cloud.speech.v1p1beta1.ListCustomClassesRequest} ListCustomClassesRequest
|
16592 | */
|
16593 | ListCustomClassesRequest.fromObject = function fromObject(object) {
|
16594 | if (object instanceof $root.google.cloud.speech.v1p1beta1.ListCustomClassesRequest)
|
16595 | return object;
|
16596 | var message = new $root.google.cloud.speech.v1p1beta1.ListCustomClassesRequest();
|
16597 | if (object.parent != null)
|
16598 | message.parent = String(object.parent);
|
16599 | if (object.pageSize != null)
|
16600 | message.pageSize = object.pageSize | 0;
|
16601 | if (object.pageToken != null)
|
16602 | message.pageToken = String(object.pageToken);
|
16603 | return message;
|
16604 | };
|
16605 |
|
16606 | /**
|
16607 | * Creates a plain object from a ListCustomClassesRequest message. Also converts values to other types if specified.
|
16608 | * @function toObject
|
16609 | * @memberof google.cloud.speech.v1p1beta1.ListCustomClassesRequest
|
16610 | * @static
|
16611 | * @param {google.cloud.speech.v1p1beta1.ListCustomClassesRequest} message ListCustomClassesRequest
|
16612 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
16613 | * @returns {Object.<string,*>} Plain object
|
16614 | */
|
16615 | ListCustomClassesRequest.toObject = function toObject(message, options) {
|
16616 | if (!options)
|
16617 | options = {};
|
16618 | var object = {};
|
16619 | if (options.defaults) {
|
16620 | object.parent = "";
|
16621 | object.pageSize = 0;
|
16622 | object.pageToken = "";
|
16623 | }
|
16624 | if (message.parent != null && message.hasOwnProperty("parent"))
|
16625 | object.parent = message.parent;
|
16626 | if (message.pageSize != null && message.hasOwnProperty("pageSize"))
|
16627 | object.pageSize = message.pageSize;
|
16628 | if (message.pageToken != null && message.hasOwnProperty("pageToken"))
|
16629 | object.pageToken = message.pageToken;
|
16630 | return object;
|
16631 | };
|
16632 |
|
16633 | /**
|
16634 | * Converts this ListCustomClassesRequest to JSON.
|
16635 | * @function toJSON
|
16636 | * @memberof google.cloud.speech.v1p1beta1.ListCustomClassesRequest
|
16637 | * @instance
|
16638 | * @returns {Object.<string,*>} JSON object
|
16639 | */
|
16640 | ListCustomClassesRequest.prototype.toJSON = function toJSON() {
|
16641 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
16642 | };
|
16643 |
|
16644 | return ListCustomClassesRequest;
|
16645 | })();
|
16646 |
|
16647 | v1p1beta1.ListCustomClassesResponse = (function() {
|
16648 |
|
16649 | /**
|
16650 | * Properties of a ListCustomClassesResponse.
|
16651 | * @memberof google.cloud.speech.v1p1beta1
|
16652 | * @interface IListCustomClassesResponse
|
16653 | * @property {Array.<google.cloud.speech.v1p1beta1.ICustomClass>|null} [customClasses] ListCustomClassesResponse customClasses
|
16654 | * @property {string|null} [nextPageToken] ListCustomClassesResponse nextPageToken
|
16655 | */
|
16656 |
|
16657 | /**
|
16658 | * Constructs a new ListCustomClassesResponse.
|
16659 | * @memberof google.cloud.speech.v1p1beta1
|
16660 | * @classdesc Represents a ListCustomClassesResponse.
|
16661 | * @implements IListCustomClassesResponse
|
16662 | * @constructor
|
16663 | * @param {google.cloud.speech.v1p1beta1.IListCustomClassesResponse=} [properties] Properties to set
|
16664 | */
|
16665 | function ListCustomClassesResponse(properties) {
|
16666 | this.customClasses = [];
|
16667 | if (properties)
|
16668 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
16669 | if (properties[keys[i]] != null)
|
16670 | this[keys[i]] = properties[keys[i]];
|
16671 | }
|
16672 |
|
16673 | /**
|
16674 | * ListCustomClassesResponse customClasses.
|
16675 | * @member {Array.<google.cloud.speech.v1p1beta1.ICustomClass>} customClasses
|
16676 | * @memberof google.cloud.speech.v1p1beta1.ListCustomClassesResponse
|
16677 | * @instance
|
16678 | */
|
16679 | ListCustomClassesResponse.prototype.customClasses = $util.emptyArray;
|
16680 |
|
16681 | /**
|
16682 | * ListCustomClassesResponse nextPageToken.
|
16683 | * @member {string} nextPageToken
|
16684 | * @memberof google.cloud.speech.v1p1beta1.ListCustomClassesResponse
|
16685 | * @instance
|
16686 | */
|
16687 | ListCustomClassesResponse.prototype.nextPageToken = "";
|
16688 |
|
16689 | /**
|
16690 | * Creates a new ListCustomClassesResponse instance using the specified properties.
|
16691 | * @function create
|
16692 | * @memberof google.cloud.speech.v1p1beta1.ListCustomClassesResponse
|
16693 | * @static
|
16694 | * @param {google.cloud.speech.v1p1beta1.IListCustomClassesResponse=} [properties] Properties to set
|
16695 | * @returns {google.cloud.speech.v1p1beta1.ListCustomClassesResponse} ListCustomClassesResponse instance
|
16696 | */
|
16697 | ListCustomClassesResponse.create = function create(properties) {
|
16698 | return new ListCustomClassesResponse(properties);
|
16699 | };
|
16700 |
|
16701 | /**
|
16702 | * Encodes the specified ListCustomClassesResponse message. Does not implicitly {@link google.cloud.speech.v1p1beta1.ListCustomClassesResponse.verify|verify} messages.
|
16703 | * @function encode
|
16704 | * @memberof google.cloud.speech.v1p1beta1.ListCustomClassesResponse
|
16705 | * @static
|
16706 | * @param {google.cloud.speech.v1p1beta1.IListCustomClassesResponse} message ListCustomClassesResponse message or plain object to encode
|
16707 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
16708 | * @returns {$protobuf.Writer} Writer
|
16709 | */
|
16710 | ListCustomClassesResponse.encode = function encode(message, writer) {
|
16711 | if (!writer)
|
16712 | writer = $Writer.create();
|
16713 | if (message.customClasses != null && message.customClasses.length)
|
16714 | for (var i = 0; i < message.customClasses.length; ++i)
|
16715 | $root.google.cloud.speech.v1p1beta1.CustomClass.encode(message.customClasses[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
16716 | if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken"))
|
16717 | writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken);
|
16718 | return writer;
|
16719 | };
|
16720 |
|
16721 | /**
|
16722 | * Encodes the specified ListCustomClassesResponse message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.ListCustomClassesResponse.verify|verify} messages.
|
16723 | * @function encodeDelimited
|
16724 | * @memberof google.cloud.speech.v1p1beta1.ListCustomClassesResponse
|
16725 | * @static
|
16726 | * @param {google.cloud.speech.v1p1beta1.IListCustomClassesResponse} message ListCustomClassesResponse message or plain object to encode
|
16727 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
16728 | * @returns {$protobuf.Writer} Writer
|
16729 | */
|
16730 | ListCustomClassesResponse.encodeDelimited = function encodeDelimited(message, writer) {
|
16731 | return this.encode(message, writer).ldelim();
|
16732 | };
|
16733 |
|
16734 | /**
|
16735 | * Decodes a ListCustomClassesResponse message from the specified reader or buffer.
|
16736 | * @function decode
|
16737 | * @memberof google.cloud.speech.v1p1beta1.ListCustomClassesResponse
|
16738 | * @static
|
16739 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
16740 | * @param {number} [length] Message length if known beforehand
|
16741 | * @returns {google.cloud.speech.v1p1beta1.ListCustomClassesResponse} ListCustomClassesResponse
|
16742 | * @throws {Error} If the payload is not a reader or valid buffer
|
16743 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
16744 | */
|
16745 | ListCustomClassesResponse.decode = function decode(reader, length) {
|
16746 | if (!(reader instanceof $Reader))
|
16747 | reader = $Reader.create(reader);
|
16748 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.ListCustomClassesResponse();
|
16749 | while (reader.pos < end) {
|
16750 | var tag = reader.uint32();
|
16751 | switch (tag >>> 3) {
|
16752 | case 1:
|
16753 | if (!(message.customClasses && message.customClasses.length))
|
16754 | message.customClasses = [];
|
16755 | message.customClasses.push($root.google.cloud.speech.v1p1beta1.CustomClass.decode(reader, reader.uint32()));
|
16756 | break;
|
16757 | case 2:
|
16758 | message.nextPageToken = reader.string();
|
16759 | break;
|
16760 | default:
|
16761 | reader.skipType(tag & 7);
|
16762 | break;
|
16763 | }
|
16764 | }
|
16765 | return message;
|
16766 | };
|
16767 |
|
16768 | /**
|
16769 | * Decodes a ListCustomClassesResponse message from the specified reader or buffer, length delimited.
|
16770 | * @function decodeDelimited
|
16771 | * @memberof google.cloud.speech.v1p1beta1.ListCustomClassesResponse
|
16772 | * @static
|
16773 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
16774 | * @returns {google.cloud.speech.v1p1beta1.ListCustomClassesResponse} ListCustomClassesResponse
|
16775 | * @throws {Error} If the payload is not a reader or valid buffer
|
16776 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
16777 | */
|
16778 | ListCustomClassesResponse.decodeDelimited = function decodeDelimited(reader) {
|
16779 | if (!(reader instanceof $Reader))
|
16780 | reader = new $Reader(reader);
|
16781 | return this.decode(reader, reader.uint32());
|
16782 | };
|
16783 |
|
16784 | /**
|
16785 | * Verifies a ListCustomClassesResponse message.
|
16786 | * @function verify
|
16787 | * @memberof google.cloud.speech.v1p1beta1.ListCustomClassesResponse
|
16788 | * @static
|
16789 | * @param {Object.<string,*>} message Plain object to verify
|
16790 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
16791 | */
|
16792 | ListCustomClassesResponse.verify = function verify(message) {
|
16793 | if (typeof message !== "object" || message === null)
|
16794 | return "object expected";
|
16795 | if (message.customClasses != null && message.hasOwnProperty("customClasses")) {
|
16796 | if (!Array.isArray(message.customClasses))
|
16797 | return "customClasses: array expected";
|
16798 | for (var i = 0; i < message.customClasses.length; ++i) {
|
16799 | var error = $root.google.cloud.speech.v1p1beta1.CustomClass.verify(message.customClasses[i]);
|
16800 | if (error)
|
16801 | return "customClasses." + error;
|
16802 | }
|
16803 | }
|
16804 | if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken"))
|
16805 | if (!$util.isString(message.nextPageToken))
|
16806 | return "nextPageToken: string expected";
|
16807 | return null;
|
16808 | };
|
16809 |
|
16810 | /**
|
16811 | * Creates a ListCustomClassesResponse message from a plain object. Also converts values to their respective internal types.
|
16812 | * @function fromObject
|
16813 | * @memberof google.cloud.speech.v1p1beta1.ListCustomClassesResponse
|
16814 | * @static
|
16815 | * @param {Object.<string,*>} object Plain object
|
16816 | * @returns {google.cloud.speech.v1p1beta1.ListCustomClassesResponse} ListCustomClassesResponse
|
16817 | */
|
16818 | ListCustomClassesResponse.fromObject = function fromObject(object) {
|
16819 | if (object instanceof $root.google.cloud.speech.v1p1beta1.ListCustomClassesResponse)
|
16820 | return object;
|
16821 | var message = new $root.google.cloud.speech.v1p1beta1.ListCustomClassesResponse();
|
16822 | if (object.customClasses) {
|
16823 | if (!Array.isArray(object.customClasses))
|
16824 | throw TypeError(".google.cloud.speech.v1p1beta1.ListCustomClassesResponse.customClasses: array expected");
|
16825 | message.customClasses = [];
|
16826 | for (var i = 0; i < object.customClasses.length; ++i) {
|
16827 | if (typeof object.customClasses[i] !== "object")
|
16828 | throw TypeError(".google.cloud.speech.v1p1beta1.ListCustomClassesResponse.customClasses: object expected");
|
16829 | message.customClasses[i] = $root.google.cloud.speech.v1p1beta1.CustomClass.fromObject(object.customClasses[i]);
|
16830 | }
|
16831 | }
|
16832 | if (object.nextPageToken != null)
|
16833 | message.nextPageToken = String(object.nextPageToken);
|
16834 | return message;
|
16835 | };
|
16836 |
|
16837 | /**
|
16838 | * Creates a plain object from a ListCustomClassesResponse message. Also converts values to other types if specified.
|
16839 | * @function toObject
|
16840 | * @memberof google.cloud.speech.v1p1beta1.ListCustomClassesResponse
|
16841 | * @static
|
16842 | * @param {google.cloud.speech.v1p1beta1.ListCustomClassesResponse} message ListCustomClassesResponse
|
16843 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
16844 | * @returns {Object.<string,*>} Plain object
|
16845 | */
|
16846 | ListCustomClassesResponse.toObject = function toObject(message, options) {
|
16847 | if (!options)
|
16848 | options = {};
|
16849 | var object = {};
|
16850 | if (options.arrays || options.defaults)
|
16851 | object.customClasses = [];
|
16852 | if (options.defaults)
|
16853 | object.nextPageToken = "";
|
16854 | if (message.customClasses && message.customClasses.length) {
|
16855 | object.customClasses = [];
|
16856 | for (var j = 0; j < message.customClasses.length; ++j)
|
16857 | object.customClasses[j] = $root.google.cloud.speech.v1p1beta1.CustomClass.toObject(message.customClasses[j], options);
|
16858 | }
|
16859 | if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken"))
|
16860 | object.nextPageToken = message.nextPageToken;
|
16861 | return object;
|
16862 | };
|
16863 |
|
16864 | /**
|
16865 | * Converts this ListCustomClassesResponse to JSON.
|
16866 | * @function toJSON
|
16867 | * @memberof google.cloud.speech.v1p1beta1.ListCustomClassesResponse
|
16868 | * @instance
|
16869 | * @returns {Object.<string,*>} JSON object
|
16870 | */
|
16871 | ListCustomClassesResponse.prototype.toJSON = function toJSON() {
|
16872 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
16873 | };
|
16874 |
|
16875 | return ListCustomClassesResponse;
|
16876 | })();
|
16877 |
|
16878 | v1p1beta1.DeleteCustomClassRequest = (function() {
|
16879 |
|
16880 | /**
|
16881 | * Properties of a DeleteCustomClassRequest.
|
16882 | * @memberof google.cloud.speech.v1p1beta1
|
16883 | * @interface IDeleteCustomClassRequest
|
16884 | * @property {string|null} [name] DeleteCustomClassRequest name
|
16885 | */
|
16886 |
|
16887 | /**
|
16888 | * Constructs a new DeleteCustomClassRequest.
|
16889 | * @memberof google.cloud.speech.v1p1beta1
|
16890 | * @classdesc Represents a DeleteCustomClassRequest.
|
16891 | * @implements IDeleteCustomClassRequest
|
16892 | * @constructor
|
16893 | * @param {google.cloud.speech.v1p1beta1.IDeleteCustomClassRequest=} [properties] Properties to set
|
16894 | */
|
16895 | function DeleteCustomClassRequest(properties) {
|
16896 | if (properties)
|
16897 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
16898 | if (properties[keys[i]] != null)
|
16899 | this[keys[i]] = properties[keys[i]];
|
16900 | }
|
16901 |
|
16902 | /**
|
16903 | * DeleteCustomClassRequest name.
|
16904 | * @member {string} name
|
16905 | * @memberof google.cloud.speech.v1p1beta1.DeleteCustomClassRequest
|
16906 | * @instance
|
16907 | */
|
16908 | DeleteCustomClassRequest.prototype.name = "";
|
16909 |
|
16910 | /**
|
16911 | * Creates a new DeleteCustomClassRequest instance using the specified properties.
|
16912 | * @function create
|
16913 | * @memberof google.cloud.speech.v1p1beta1.DeleteCustomClassRequest
|
16914 | * @static
|
16915 | * @param {google.cloud.speech.v1p1beta1.IDeleteCustomClassRequest=} [properties] Properties to set
|
16916 | * @returns {google.cloud.speech.v1p1beta1.DeleteCustomClassRequest} DeleteCustomClassRequest instance
|
16917 | */
|
16918 | DeleteCustomClassRequest.create = function create(properties) {
|
16919 | return new DeleteCustomClassRequest(properties);
|
16920 | };
|
16921 |
|
16922 | /**
|
16923 | * Encodes the specified DeleteCustomClassRequest message. Does not implicitly {@link google.cloud.speech.v1p1beta1.DeleteCustomClassRequest.verify|verify} messages.
|
16924 | * @function encode
|
16925 | * @memberof google.cloud.speech.v1p1beta1.DeleteCustomClassRequest
|
16926 | * @static
|
16927 | * @param {google.cloud.speech.v1p1beta1.IDeleteCustomClassRequest} message DeleteCustomClassRequest message or plain object to encode
|
16928 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
16929 | * @returns {$protobuf.Writer} Writer
|
16930 | */
|
16931 | DeleteCustomClassRequest.encode = function encode(message, writer) {
|
16932 | if (!writer)
|
16933 | writer = $Writer.create();
|
16934 | if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
16935 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
|
16936 | return writer;
|
16937 | };
|
16938 |
|
16939 | /**
|
16940 | * Encodes the specified DeleteCustomClassRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1p1beta1.DeleteCustomClassRequest.verify|verify} messages.
|
16941 | * @function encodeDelimited
|
16942 | * @memberof google.cloud.speech.v1p1beta1.DeleteCustomClassRequest
|
16943 | * @static
|
16944 | * @param {google.cloud.speech.v1p1beta1.IDeleteCustomClassRequest} message DeleteCustomClassRequest message or plain object to encode
|
16945 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
16946 | * @returns {$protobuf.Writer} Writer
|
16947 | */
|
16948 | DeleteCustomClassRequest.encodeDelimited = function encodeDelimited(message, writer) {
|
16949 | return this.encode(message, writer).ldelim();
|
16950 | };
|
16951 |
|
16952 | /**
|
16953 | * Decodes a DeleteCustomClassRequest message from the specified reader or buffer.
|
16954 | * @function decode
|
16955 | * @memberof google.cloud.speech.v1p1beta1.DeleteCustomClassRequest
|
16956 | * @static
|
16957 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
16958 | * @param {number} [length] Message length if known beforehand
|
16959 | * @returns {google.cloud.speech.v1p1beta1.DeleteCustomClassRequest} DeleteCustomClassRequest
|
16960 | * @throws {Error} If the payload is not a reader or valid buffer
|
16961 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
16962 | */
|
16963 | DeleteCustomClassRequest.decode = function decode(reader, length) {
|
16964 | if (!(reader instanceof $Reader))
|
16965 | reader = $Reader.create(reader);
|
16966 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest();
|
16967 | while (reader.pos < end) {
|
16968 | var tag = reader.uint32();
|
16969 | switch (tag >>> 3) {
|
16970 | case 1:
|
16971 | message.name = reader.string();
|
16972 | break;
|
16973 | default:
|
16974 | reader.skipType(tag & 7);
|
16975 | break;
|
16976 | }
|
16977 | }
|
16978 | return message;
|
16979 | };
|
16980 |
|
16981 | /**
|
16982 | * Decodes a DeleteCustomClassRequest message from the specified reader or buffer, length delimited.
|
16983 | * @function decodeDelimited
|
16984 | * @memberof google.cloud.speech.v1p1beta1.DeleteCustomClassRequest
|
16985 | * @static
|
16986 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
16987 | * @returns {google.cloud.speech.v1p1beta1.DeleteCustomClassRequest} DeleteCustomClassRequest
|
16988 | * @throws {Error} If the payload is not a reader or valid buffer
|
16989 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
16990 | */
|
16991 | DeleteCustomClassRequest.decodeDelimited = function decodeDelimited(reader) {
|
16992 | if (!(reader instanceof $Reader))
|
16993 | reader = new $Reader(reader);
|
16994 | return this.decode(reader, reader.uint32());
|
16995 | };
|
16996 |
|
16997 | /**
|
16998 | * Verifies a DeleteCustomClassRequest message.
|
16999 | * @function verify
|
17000 | * @memberof google.cloud.speech.v1p1beta1.DeleteCustomClassRequest
|
17001 | * @static
|
17002 | * @param {Object.<string,*>} message Plain object to verify
|
17003 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
17004 | */
|
17005 | DeleteCustomClassRequest.verify = function verify(message) {
|
17006 | if (typeof message !== "object" || message === null)
|
17007 | return "object expected";
|
17008 | if (message.name != null && message.hasOwnProperty("name"))
|
17009 | if (!$util.isString(message.name))
|
17010 | return "name: string expected";
|
17011 | return null;
|
17012 | };
|
17013 |
|
17014 | /**
|
17015 | * Creates a DeleteCustomClassRequest message from a plain object. Also converts values to their respective internal types.
|
17016 | * @function fromObject
|
17017 | * @memberof google.cloud.speech.v1p1beta1.DeleteCustomClassRequest
|
17018 | * @static
|
17019 | * @param {Object.<string,*>} object Plain object
|
17020 | * @returns {google.cloud.speech.v1p1beta1.DeleteCustomClassRequest} DeleteCustomClassRequest
|
17021 | */
|
17022 | DeleteCustomClassRequest.fromObject = function fromObject(object) {
|
17023 | if (object instanceof $root.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest)
|
17024 | return object;
|
17025 | var message = new $root.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest();
|
17026 | if (object.name != null)
|
17027 | message.name = String(object.name);
|
17028 | return message;
|
17029 | };
|
17030 |
|
17031 | /**
|
17032 | * Creates a plain object from a DeleteCustomClassRequest message. Also converts values to other types if specified.
|
17033 | * @function toObject
|
17034 | * @memberof google.cloud.speech.v1p1beta1.DeleteCustomClassRequest
|
17035 | * @static
|
17036 | * @param {google.cloud.speech.v1p1beta1.DeleteCustomClassRequest} message DeleteCustomClassRequest
|
17037 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
17038 | * @returns {Object.<string,*>} Plain object
|
17039 | */
|
17040 | DeleteCustomClassRequest.toObject = function toObject(message, options) {
|
17041 | if (!options)
|
17042 | options = {};
|
17043 | var object = {};
|
17044 | if (options.defaults)
|
17045 | object.name = "";
|
17046 | if (message.name != null && message.hasOwnProperty("name"))
|
17047 | object.name = message.name;
|
17048 | return object;
|
17049 | };
|
17050 |
|
17051 | /**
|
17052 | * Converts this DeleteCustomClassRequest to JSON.
|
17053 | * @function toJSON
|
17054 | * @memberof google.cloud.speech.v1p1beta1.DeleteCustomClassRequest
|
17055 | * @instance
|
17056 | * @returns {Object.<string,*>} JSON object
|
17057 | */
|
17058 | DeleteCustomClassRequest.prototype.toJSON = function toJSON() {
|
17059 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
17060 | };
|
17061 |
|
17062 | return DeleteCustomClassRequest;
|
17063 | })();
|
17064 |
|
17065 | return v1p1beta1;
|
17066 | })();
|
17067 |
|
17068 | return speech;
|
17069 | })();
|
17070 |
|
17071 | return cloud;
|
17072 | })();
|
17073 |
|
17074 | google.api = (function() {
|
17075 |
|
17076 | /**
|
17077 | * Namespace api.
|
17078 | * @memberof google
|
17079 | * @namespace
|
17080 | */
|
17081 | var api = {};
|
17082 |
|
17083 | api.Http = (function() {
|
17084 |
|
17085 | /**
|
17086 | * Properties of a Http.
|
17087 | * @memberof google.api
|
17088 | * @interface IHttp
|
17089 | * @property {Array.<google.api.IHttpRule>|null} [rules] Http rules
|
17090 | * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion
|
17091 | */
|
17092 |
|
17093 | /**
|
17094 | * Constructs a new Http.
|
17095 | * @memberof google.api
|
17096 | * @classdesc Represents a Http.
|
17097 | * @implements IHttp
|
17098 | * @constructor
|
17099 | * @param {google.api.IHttp=} [properties] Properties to set
|
17100 | */
|
17101 | function Http(properties) {
|
17102 | this.rules = [];
|
17103 | if (properties)
|
17104 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
17105 | if (properties[keys[i]] != null)
|
17106 | this[keys[i]] = properties[keys[i]];
|
17107 | }
|
17108 |
|
17109 | /**
|
17110 | * Http rules.
|
17111 | * @member {Array.<google.api.IHttpRule>} rules
|
17112 | * @memberof google.api.Http
|
17113 | * @instance
|
17114 | */
|
17115 | Http.prototype.rules = $util.emptyArray;
|
17116 |
|
17117 | /**
|
17118 | * Http fullyDecodeReservedExpansion.
|
17119 | * @member {boolean} fullyDecodeReservedExpansion
|
17120 | * @memberof google.api.Http
|
17121 | * @instance
|
17122 | */
|
17123 | Http.prototype.fullyDecodeReservedExpansion = false;
|
17124 |
|
17125 | /**
|
17126 | * Creates a new Http instance using the specified properties.
|
17127 | * @function create
|
17128 | * @memberof google.api.Http
|
17129 | * @static
|
17130 | * @param {google.api.IHttp=} [properties] Properties to set
|
17131 | * @returns {google.api.Http} Http instance
|
17132 | */
|
17133 | Http.create = function create(properties) {
|
17134 | return new Http(properties);
|
17135 | };
|
17136 |
|
17137 | /**
|
17138 | * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages.
|
17139 | * @function encode
|
17140 | * @memberof google.api.Http
|
17141 | * @static
|
17142 | * @param {google.api.IHttp} message Http message or plain object to encode
|
17143 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
17144 | * @returns {$protobuf.Writer} Writer
|
17145 | */
|
17146 | Http.encode = function encode(message, writer) {
|
17147 | if (!writer)
|
17148 | writer = $Writer.create();
|
17149 | if (message.rules != null && message.rules.length)
|
17150 | for (var i = 0; i < message.rules.length; ++i)
|
17151 | $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
17152 | if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion"))
|
17153 | writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion);
|
17154 | return writer;
|
17155 | };
|
17156 |
|
17157 | /**
|
17158 | * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages.
|
17159 | * @function encodeDelimited
|
17160 | * @memberof google.api.Http
|
17161 | * @static
|
17162 | * @param {google.api.IHttp} message Http message or plain object to encode
|
17163 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
17164 | * @returns {$protobuf.Writer} Writer
|
17165 | */
|
17166 | Http.encodeDelimited = function encodeDelimited(message, writer) {
|
17167 | return this.encode(message, writer).ldelim();
|
17168 | };
|
17169 |
|
17170 | /**
|
17171 | * Decodes a Http message from the specified reader or buffer.
|
17172 | * @function decode
|
17173 | * @memberof google.api.Http
|
17174 | * @static
|
17175 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
17176 | * @param {number} [length] Message length if known beforehand
|
17177 | * @returns {google.api.Http} Http
|
17178 | * @throws {Error} If the payload is not a reader or valid buffer
|
17179 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
17180 | */
|
17181 | Http.decode = function decode(reader, length) {
|
17182 | if (!(reader instanceof $Reader))
|
17183 | reader = $Reader.create(reader);
|
17184 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http();
|
17185 | while (reader.pos < end) {
|
17186 | var tag = reader.uint32();
|
17187 | switch (tag >>> 3) {
|
17188 | case 1:
|
17189 | if (!(message.rules && message.rules.length))
|
17190 | message.rules = [];
|
17191 | message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32()));
|
17192 | break;
|
17193 | case 2:
|
17194 | message.fullyDecodeReservedExpansion = reader.bool();
|
17195 | break;
|
17196 | default:
|
17197 | reader.skipType(tag & 7);
|
17198 | break;
|
17199 | }
|
17200 | }
|
17201 | return message;
|
17202 | };
|
17203 |
|
17204 | /**
|
17205 | * Decodes a Http message from the specified reader or buffer, length delimited.
|
17206 | * @function decodeDelimited
|
17207 | * @memberof google.api.Http
|
17208 | * @static
|
17209 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
17210 | * @returns {google.api.Http} Http
|
17211 | * @throws {Error} If the payload is not a reader or valid buffer
|
17212 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
17213 | */
|
17214 | Http.decodeDelimited = function decodeDelimited(reader) {
|
17215 | if (!(reader instanceof $Reader))
|
17216 | reader = new $Reader(reader);
|
17217 | return this.decode(reader, reader.uint32());
|
17218 | };
|
17219 |
|
17220 | /**
|
17221 | * Verifies a Http message.
|
17222 | * @function verify
|
17223 | * @memberof google.api.Http
|
17224 | * @static
|
17225 | * @param {Object.<string,*>} message Plain object to verify
|
17226 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
17227 | */
|
17228 | Http.verify = function verify(message) {
|
17229 | if (typeof message !== "object" || message === null)
|
17230 | return "object expected";
|
17231 | if (message.rules != null && message.hasOwnProperty("rules")) {
|
17232 | if (!Array.isArray(message.rules))
|
17233 | return "rules: array expected";
|
17234 | for (var i = 0; i < message.rules.length; ++i) {
|
17235 | var error = $root.google.api.HttpRule.verify(message.rules[i]);
|
17236 | if (error)
|
17237 | return "rules." + error;
|
17238 | }
|
17239 | }
|
17240 | if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion"))
|
17241 | if (typeof message.fullyDecodeReservedExpansion !== "boolean")
|
17242 | return "fullyDecodeReservedExpansion: boolean expected";
|
17243 | return null;
|
17244 | };
|
17245 |
|
17246 | /**
|
17247 | * Creates a Http message from a plain object. Also converts values to their respective internal types.
|
17248 | * @function fromObject
|
17249 | * @memberof google.api.Http
|
17250 | * @static
|
17251 | * @param {Object.<string,*>} object Plain object
|
17252 | * @returns {google.api.Http} Http
|
17253 | */
|
17254 | Http.fromObject = function fromObject(object) {
|
17255 | if (object instanceof $root.google.api.Http)
|
17256 | return object;
|
17257 | var message = new $root.google.api.Http();
|
17258 | if (object.rules) {
|
17259 | if (!Array.isArray(object.rules))
|
17260 | throw TypeError(".google.api.Http.rules: array expected");
|
17261 | message.rules = [];
|
17262 | for (var i = 0; i < object.rules.length; ++i) {
|
17263 | if (typeof object.rules[i] !== "object")
|
17264 | throw TypeError(".google.api.Http.rules: object expected");
|
17265 | message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]);
|
17266 | }
|
17267 | }
|
17268 | if (object.fullyDecodeReservedExpansion != null)
|
17269 | message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion);
|
17270 | return message;
|
17271 | };
|
17272 |
|
17273 | /**
|
17274 | * Creates a plain object from a Http message. Also converts values to other types if specified.
|
17275 | * @function toObject
|
17276 | * @memberof google.api.Http
|
17277 | * @static
|
17278 | * @param {google.api.Http} message Http
|
17279 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
17280 | * @returns {Object.<string,*>} Plain object
|
17281 | */
|
17282 | Http.toObject = function toObject(message, options) {
|
17283 | if (!options)
|
17284 | options = {};
|
17285 | var object = {};
|
17286 | if (options.arrays || options.defaults)
|
17287 | object.rules = [];
|
17288 | if (options.defaults)
|
17289 | object.fullyDecodeReservedExpansion = false;
|
17290 | if (message.rules && message.rules.length) {
|
17291 | object.rules = [];
|
17292 | for (var j = 0; j < message.rules.length; ++j)
|
17293 | object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options);
|
17294 | }
|
17295 | if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion"))
|
17296 | object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion;
|
17297 | return object;
|
17298 | };
|
17299 |
|
17300 | /**
|
17301 | * Converts this Http to JSON.
|
17302 | * @function toJSON
|
17303 | * @memberof google.api.Http
|
17304 | * @instance
|
17305 | * @returns {Object.<string,*>} JSON object
|
17306 | */
|
17307 | Http.prototype.toJSON = function toJSON() {
|
17308 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
17309 | };
|
17310 |
|
17311 | return Http;
|
17312 | })();
|
17313 |
|
17314 | api.HttpRule = (function() {
|
17315 |
|
17316 | /**
|
17317 | * Properties of a HttpRule.
|
17318 | * @memberof google.api
|
17319 | * @interface IHttpRule
|
17320 | * @property {string|null} [selector] HttpRule selector
|
17321 | * @property {string|null} [get] HttpRule get
|
17322 | * @property {string|null} [put] HttpRule put
|
17323 | * @property {string|null} [post] HttpRule post
|
17324 | * @property {string|null} ["delete"] HttpRule delete
|
17325 | * @property {string|null} [patch] HttpRule patch
|
17326 | * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom
|
17327 | * @property {string|null} [body] HttpRule body
|
17328 | * @property {string|null} [responseBody] HttpRule responseBody
|
17329 | * @property {Array.<google.api.IHttpRule>|null} [additionalBindings] HttpRule additionalBindings
|
17330 | */
|
17331 |
|
17332 | /**
|
17333 | * Constructs a new HttpRule.
|
17334 | * @memberof google.api
|
17335 | * @classdesc Represents a HttpRule.
|
17336 | * @implements IHttpRule
|
17337 | * @constructor
|
17338 | * @param {google.api.IHttpRule=} [properties] Properties to set
|
17339 | */
|
17340 | function HttpRule(properties) {
|
17341 | this.additionalBindings = [];
|
17342 | if (properties)
|
17343 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
17344 | if (properties[keys[i]] != null)
|
17345 | this[keys[i]] = properties[keys[i]];
|
17346 | }
|
17347 |
|
17348 | /**
|
17349 | * HttpRule selector.
|
17350 | * @member {string} selector
|
17351 | * @memberof google.api.HttpRule
|
17352 | * @instance
|
17353 | */
|
17354 | HttpRule.prototype.selector = "";
|
17355 |
|
17356 | /**
|
17357 | * HttpRule get.
|
17358 | * @member {string|null|undefined} get
|
17359 | * @memberof google.api.HttpRule
|
17360 | * @instance
|
17361 | */
|
17362 | HttpRule.prototype.get = null;
|
17363 |
|
17364 | /**
|
17365 | * HttpRule put.
|
17366 | * @member {string|null|undefined} put
|
17367 | * @memberof google.api.HttpRule
|
17368 | * @instance
|
17369 | */
|
17370 | HttpRule.prototype.put = null;
|
17371 |
|
17372 | /**
|
17373 | * HttpRule post.
|
17374 | * @member {string|null|undefined} post
|
17375 | * @memberof google.api.HttpRule
|
17376 | * @instance
|
17377 | */
|
17378 | HttpRule.prototype.post = null;
|
17379 |
|
17380 | /**
|
17381 | * HttpRule delete.
|
17382 | * @member {string|null|undefined} delete
|
17383 | * @memberof google.api.HttpRule
|
17384 | * @instance
|
17385 | */
|
17386 | HttpRule.prototype["delete"] = null;
|
17387 |
|
17388 | /**
|
17389 | * HttpRule patch.
|
17390 | * @member {string|null|undefined} patch
|
17391 | * @memberof google.api.HttpRule
|
17392 | * @instance
|
17393 | */
|
17394 | HttpRule.prototype.patch = null;
|
17395 |
|
17396 | /**
|
17397 | * HttpRule custom.
|
17398 | * @member {google.api.ICustomHttpPattern|null|undefined} custom
|
17399 | * @memberof google.api.HttpRule
|
17400 | * @instance
|
17401 | */
|
17402 | HttpRule.prototype.custom = null;
|
17403 |
|
17404 | /**
|
17405 | * HttpRule body.
|
17406 | * @member {string} body
|
17407 | * @memberof google.api.HttpRule
|
17408 | * @instance
|
17409 | */
|
17410 | HttpRule.prototype.body = "";
|
17411 |
|
17412 | /**
|
17413 | * HttpRule responseBody.
|
17414 | * @member {string} responseBody
|
17415 | * @memberof google.api.HttpRule
|
17416 | * @instance
|
17417 | */
|
17418 | HttpRule.prototype.responseBody = "";
|
17419 |
|
17420 | /**
|
17421 | * HttpRule additionalBindings.
|
17422 | * @member {Array.<google.api.IHttpRule>} additionalBindings
|
17423 | * @memberof google.api.HttpRule
|
17424 | * @instance
|
17425 | */
|
17426 | HttpRule.prototype.additionalBindings = $util.emptyArray;
|
17427 |
|
17428 | // OneOf field names bound to virtual getters and setters
|
17429 | var $oneOfFields;
|
17430 |
|
17431 | /**
|
17432 | * HttpRule pattern.
|
17433 | * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern
|
17434 | * @memberof google.api.HttpRule
|
17435 | * @instance
|
17436 | */
|
17437 | Object.defineProperty(HttpRule.prototype, "pattern", {
|
17438 | get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]),
|
17439 | set: $util.oneOfSetter($oneOfFields)
|
17440 | });
|
17441 |
|
17442 | /**
|
17443 | * Creates a new HttpRule instance using the specified properties.
|
17444 | * @function create
|
17445 | * @memberof google.api.HttpRule
|
17446 | * @static
|
17447 | * @param {google.api.IHttpRule=} [properties] Properties to set
|
17448 | * @returns {google.api.HttpRule} HttpRule instance
|
17449 | */
|
17450 | HttpRule.create = function create(properties) {
|
17451 | return new HttpRule(properties);
|
17452 | };
|
17453 |
|
17454 | /**
|
17455 | * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages.
|
17456 | * @function encode
|
17457 | * @memberof google.api.HttpRule
|
17458 | * @static
|
17459 | * @param {google.api.IHttpRule} message HttpRule message or plain object to encode
|
17460 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
17461 | * @returns {$protobuf.Writer} Writer
|
17462 | */
|
17463 | HttpRule.encode = function encode(message, writer) {
|
17464 | if (!writer)
|
17465 | writer = $Writer.create();
|
17466 | if (message.selector != null && Object.hasOwnProperty.call(message, "selector"))
|
17467 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector);
|
17468 | if (message.get != null && Object.hasOwnProperty.call(message, "get"))
|
17469 | writer.uint32(/* id 2, wireType 2 =*/18).string(message.get);
|
17470 | if (message.put != null && Object.hasOwnProperty.call(message, "put"))
|
17471 | writer.uint32(/* id 3, wireType 2 =*/26).string(message.put);
|
17472 | if (message.post != null && Object.hasOwnProperty.call(message, "post"))
|
17473 | writer.uint32(/* id 4, wireType 2 =*/34).string(message.post);
|
17474 | if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete"))
|
17475 | writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]);
|
17476 | if (message.patch != null && Object.hasOwnProperty.call(message, "patch"))
|
17477 | writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch);
|
17478 | if (message.body != null && Object.hasOwnProperty.call(message, "body"))
|
17479 | writer.uint32(/* id 7, wireType 2 =*/58).string(message.body);
|
17480 | if (message.custom != null && Object.hasOwnProperty.call(message, "custom"))
|
17481 | $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();
|
17482 | if (message.additionalBindings != null && message.additionalBindings.length)
|
17483 | for (var i = 0; i < message.additionalBindings.length; ++i)
|
17484 | $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim();
|
17485 | if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody"))
|
17486 | writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody);
|
17487 | return writer;
|
17488 | };
|
17489 |
|
17490 | /**
|
17491 | * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages.
|
17492 | * @function encodeDelimited
|
17493 | * @memberof google.api.HttpRule
|
17494 | * @static
|
17495 | * @param {google.api.IHttpRule} message HttpRule message or plain object to encode
|
17496 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
17497 | * @returns {$protobuf.Writer} Writer
|
17498 | */
|
17499 | HttpRule.encodeDelimited = function encodeDelimited(message, writer) {
|
17500 | return this.encode(message, writer).ldelim();
|
17501 | };
|
17502 |
|
17503 | /**
|
17504 | * Decodes a HttpRule message from the specified reader or buffer.
|
17505 | * @function decode
|
17506 | * @memberof google.api.HttpRule
|
17507 | * @static
|
17508 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
17509 | * @param {number} [length] Message length if known beforehand
|
17510 | * @returns {google.api.HttpRule} HttpRule
|
17511 | * @throws {Error} If the payload is not a reader or valid buffer
|
17512 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
17513 | */
|
17514 | HttpRule.decode = function decode(reader, length) {
|
17515 | if (!(reader instanceof $Reader))
|
17516 | reader = $Reader.create(reader);
|
17517 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule();
|
17518 | while (reader.pos < end) {
|
17519 | var tag = reader.uint32();
|
17520 | switch (tag >>> 3) {
|
17521 | case 1:
|
17522 | message.selector = reader.string();
|
17523 | break;
|
17524 | case 2:
|
17525 | message.get = reader.string();
|
17526 | break;
|
17527 | case 3:
|
17528 | message.put = reader.string();
|
17529 | break;
|
17530 | case 4:
|
17531 | message.post = reader.string();
|
17532 | break;
|
17533 | case 5:
|
17534 | message["delete"] = reader.string();
|
17535 | break;
|
17536 | case 6:
|
17537 | message.patch = reader.string();
|
17538 | break;
|
17539 | case 8:
|
17540 | message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32());
|
17541 | break;
|
17542 | case 7:
|
17543 | message.body = reader.string();
|
17544 | break;
|
17545 | case 12:
|
17546 | message.responseBody = reader.string();
|
17547 | break;
|
17548 | case 11:
|
17549 | if (!(message.additionalBindings && message.additionalBindings.length))
|
17550 | message.additionalBindings = [];
|
17551 | message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32()));
|
17552 | break;
|
17553 | default:
|
17554 | reader.skipType(tag & 7);
|
17555 | break;
|
17556 | }
|
17557 | }
|
17558 | return message;
|
17559 | };
|
17560 |
|
17561 | /**
|
17562 | * Decodes a HttpRule message from the specified reader or buffer, length delimited.
|
17563 | * @function decodeDelimited
|
17564 | * @memberof google.api.HttpRule
|
17565 | * @static
|
17566 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
17567 | * @returns {google.api.HttpRule} HttpRule
|
17568 | * @throws {Error} If the payload is not a reader or valid buffer
|
17569 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
17570 | */
|
17571 | HttpRule.decodeDelimited = function decodeDelimited(reader) {
|
17572 | if (!(reader instanceof $Reader))
|
17573 | reader = new $Reader(reader);
|
17574 | return this.decode(reader, reader.uint32());
|
17575 | };
|
17576 |
|
17577 | /**
|
17578 | * Verifies a HttpRule message.
|
17579 | * @function verify
|
17580 | * @memberof google.api.HttpRule
|
17581 | * @static
|
17582 | * @param {Object.<string,*>} message Plain object to verify
|
17583 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
17584 | */
|
17585 | HttpRule.verify = function verify(message) {
|
17586 | if (typeof message !== "object" || message === null)
|
17587 | return "object expected";
|
17588 | var properties = {};
|
17589 | if (message.selector != null && message.hasOwnProperty("selector"))
|
17590 | if (!$util.isString(message.selector))
|
17591 | return "selector: string expected";
|
17592 | if (message.get != null && message.hasOwnProperty("get")) {
|
17593 | properties.pattern = 1;
|
17594 | if (!$util.isString(message.get))
|
17595 | return "get: string expected";
|
17596 | }
|
17597 | if (message.put != null && message.hasOwnProperty("put")) {
|
17598 | if (properties.pattern === 1)
|
17599 | return "pattern: multiple values";
|
17600 | properties.pattern = 1;
|
17601 | if (!$util.isString(message.put))
|
17602 | return "put: string expected";
|
17603 | }
|
17604 | if (message.post != null && message.hasOwnProperty("post")) {
|
17605 | if (properties.pattern === 1)
|
17606 | return "pattern: multiple values";
|
17607 | properties.pattern = 1;
|
17608 | if (!$util.isString(message.post))
|
17609 | return "post: string expected";
|
17610 | }
|
17611 | if (message["delete"] != null && message.hasOwnProperty("delete")) {
|
17612 | if (properties.pattern === 1)
|
17613 | return "pattern: multiple values";
|
17614 | properties.pattern = 1;
|
17615 | if (!$util.isString(message["delete"]))
|
17616 | return "delete: string expected";
|
17617 | }
|
17618 | if (message.patch != null && message.hasOwnProperty("patch")) {
|
17619 | if (properties.pattern === 1)
|
17620 | return "pattern: multiple values";
|
17621 | properties.pattern = 1;
|
17622 | if (!$util.isString(message.patch))
|
17623 | return "patch: string expected";
|
17624 | }
|
17625 | if (message.custom != null && message.hasOwnProperty("custom")) {
|
17626 | if (properties.pattern === 1)
|
17627 | return "pattern: multiple values";
|
17628 | properties.pattern = 1;
|
17629 | {
|
17630 | var error = $root.google.api.CustomHttpPattern.verify(message.custom);
|
17631 | if (error)
|
17632 | return "custom." + error;
|
17633 | }
|
17634 | }
|
17635 | if (message.body != null && message.hasOwnProperty("body"))
|
17636 | if (!$util.isString(message.body))
|
17637 | return "body: string expected";
|
17638 | if (message.responseBody != null && message.hasOwnProperty("responseBody"))
|
17639 | if (!$util.isString(message.responseBody))
|
17640 | return "responseBody: string expected";
|
17641 | if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) {
|
17642 | if (!Array.isArray(message.additionalBindings))
|
17643 | return "additionalBindings: array expected";
|
17644 | for (var i = 0; i < message.additionalBindings.length; ++i) {
|
17645 | var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]);
|
17646 | if (error)
|
17647 | return "additionalBindings." + error;
|
17648 | }
|
17649 | }
|
17650 | return null;
|
17651 | };
|
17652 |
|
17653 | /**
|
17654 | * Creates a HttpRule message from a plain object. Also converts values to their respective internal types.
|
17655 | * @function fromObject
|
17656 | * @memberof google.api.HttpRule
|
17657 | * @static
|
17658 | * @param {Object.<string,*>} object Plain object
|
17659 | * @returns {google.api.HttpRule} HttpRule
|
17660 | */
|
17661 | HttpRule.fromObject = function fromObject(object) {
|
17662 | if (object instanceof $root.google.api.HttpRule)
|
17663 | return object;
|
17664 | var message = new $root.google.api.HttpRule();
|
17665 | if (object.selector != null)
|
17666 | message.selector = String(object.selector);
|
17667 | if (object.get != null)
|
17668 | message.get = String(object.get);
|
17669 | if (object.put != null)
|
17670 | message.put = String(object.put);
|
17671 | if (object.post != null)
|
17672 | message.post = String(object.post);
|
17673 | if (object["delete"] != null)
|
17674 | message["delete"] = String(object["delete"]);
|
17675 | if (object.patch != null)
|
17676 | message.patch = String(object.patch);
|
17677 | if (object.custom != null) {
|
17678 | if (typeof object.custom !== "object")
|
17679 | throw TypeError(".google.api.HttpRule.custom: object expected");
|
17680 | message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom);
|
17681 | }
|
17682 | if (object.body != null)
|
17683 | message.body = String(object.body);
|
17684 | if (object.responseBody != null)
|
17685 | message.responseBody = String(object.responseBody);
|
17686 | if (object.additionalBindings) {
|
17687 | if (!Array.isArray(object.additionalBindings))
|
17688 | throw TypeError(".google.api.HttpRule.additionalBindings: array expected");
|
17689 | message.additionalBindings = [];
|
17690 | for (var i = 0; i < object.additionalBindings.length; ++i) {
|
17691 | if (typeof object.additionalBindings[i] !== "object")
|
17692 | throw TypeError(".google.api.HttpRule.additionalBindings: object expected");
|
17693 | message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]);
|
17694 | }
|
17695 | }
|
17696 | return message;
|
17697 | };
|
17698 |
|
17699 | /**
|
17700 | * Creates a plain object from a HttpRule message. Also converts values to other types if specified.
|
17701 | * @function toObject
|
17702 | * @memberof google.api.HttpRule
|
17703 | * @static
|
17704 | * @param {google.api.HttpRule} message HttpRule
|
17705 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
17706 | * @returns {Object.<string,*>} Plain object
|
17707 | */
|
17708 | HttpRule.toObject = function toObject(message, options) {
|
17709 | if (!options)
|
17710 | options = {};
|
17711 | var object = {};
|
17712 | if (options.arrays || options.defaults)
|
17713 | object.additionalBindings = [];
|
17714 | if (options.defaults) {
|
17715 | object.selector = "";
|
17716 | object.body = "";
|
17717 | object.responseBody = "";
|
17718 | }
|
17719 | if (message.selector != null && message.hasOwnProperty("selector"))
|
17720 | object.selector = message.selector;
|
17721 | if (message.get != null && message.hasOwnProperty("get")) {
|
17722 | object.get = message.get;
|
17723 | if (options.oneofs)
|
17724 | object.pattern = "get";
|
17725 | }
|
17726 | if (message.put != null && message.hasOwnProperty("put")) {
|
17727 | object.put = message.put;
|
17728 | if (options.oneofs)
|
17729 | object.pattern = "put";
|
17730 | }
|
17731 | if (message.post != null && message.hasOwnProperty("post")) {
|
17732 | object.post = message.post;
|
17733 | if (options.oneofs)
|
17734 | object.pattern = "post";
|
17735 | }
|
17736 | if (message["delete"] != null && message.hasOwnProperty("delete")) {
|
17737 | object["delete"] = message["delete"];
|
17738 | if (options.oneofs)
|
17739 | object.pattern = "delete";
|
17740 | }
|
17741 | if (message.patch != null && message.hasOwnProperty("patch")) {
|
17742 | object.patch = message.patch;
|
17743 | if (options.oneofs)
|
17744 | object.pattern = "patch";
|
17745 | }
|
17746 | if (message.body != null && message.hasOwnProperty("body"))
|
17747 | object.body = message.body;
|
17748 | if (message.custom != null && message.hasOwnProperty("custom")) {
|
17749 | object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options);
|
17750 | if (options.oneofs)
|
17751 | object.pattern = "custom";
|
17752 | }
|
17753 | if (message.additionalBindings && message.additionalBindings.length) {
|
17754 | object.additionalBindings = [];
|
17755 | for (var j = 0; j < message.additionalBindings.length; ++j)
|
17756 | object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options);
|
17757 | }
|
17758 | if (message.responseBody != null && message.hasOwnProperty("responseBody"))
|
17759 | object.responseBody = message.responseBody;
|
17760 | return object;
|
17761 | };
|
17762 |
|
17763 | /**
|
17764 | * Converts this HttpRule to JSON.
|
17765 | * @function toJSON
|
17766 | * @memberof google.api.HttpRule
|
17767 | * @instance
|
17768 | * @returns {Object.<string,*>} JSON object
|
17769 | */
|
17770 | HttpRule.prototype.toJSON = function toJSON() {
|
17771 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
17772 | };
|
17773 |
|
17774 | return HttpRule;
|
17775 | })();
|
17776 |
|
17777 | api.CustomHttpPattern = (function() {
|
17778 |
|
17779 | /**
|
17780 | * Properties of a CustomHttpPattern.
|
17781 | * @memberof google.api
|
17782 | * @interface ICustomHttpPattern
|
17783 | * @property {string|null} [kind] CustomHttpPattern kind
|
17784 | * @property {string|null} [path] CustomHttpPattern path
|
17785 | */
|
17786 |
|
17787 | /**
|
17788 | * Constructs a new CustomHttpPattern.
|
17789 | * @memberof google.api
|
17790 | * @classdesc Represents a CustomHttpPattern.
|
17791 | * @implements ICustomHttpPattern
|
17792 | * @constructor
|
17793 | * @param {google.api.ICustomHttpPattern=} [properties] Properties to set
|
17794 | */
|
17795 | function CustomHttpPattern(properties) {
|
17796 | if (properties)
|
17797 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
17798 | if (properties[keys[i]] != null)
|
17799 | this[keys[i]] = properties[keys[i]];
|
17800 | }
|
17801 |
|
17802 | /**
|
17803 | * CustomHttpPattern kind.
|
17804 | * @member {string} kind
|
17805 | * @memberof google.api.CustomHttpPattern
|
17806 | * @instance
|
17807 | */
|
17808 | CustomHttpPattern.prototype.kind = "";
|
17809 |
|
17810 | /**
|
17811 | * CustomHttpPattern path.
|
17812 | * @member {string} path
|
17813 | * @memberof google.api.CustomHttpPattern
|
17814 | * @instance
|
17815 | */
|
17816 | CustomHttpPattern.prototype.path = "";
|
17817 |
|
17818 | /**
|
17819 | * Creates a new CustomHttpPattern instance using the specified properties.
|
17820 | * @function create
|
17821 | * @memberof google.api.CustomHttpPattern
|
17822 | * @static
|
17823 | * @param {google.api.ICustomHttpPattern=} [properties] Properties to set
|
17824 | * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance
|
17825 | */
|
17826 | CustomHttpPattern.create = function create(properties) {
|
17827 | return new CustomHttpPattern(properties);
|
17828 | };
|
17829 |
|
17830 | /**
|
17831 | * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages.
|
17832 | * @function encode
|
17833 | * @memberof google.api.CustomHttpPattern
|
17834 | * @static
|
17835 | * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode
|
17836 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
17837 | * @returns {$protobuf.Writer} Writer
|
17838 | */
|
17839 | CustomHttpPattern.encode = function encode(message, writer) {
|
17840 | if (!writer)
|
17841 | writer = $Writer.create();
|
17842 | if (message.kind != null && Object.hasOwnProperty.call(message, "kind"))
|
17843 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind);
|
17844 | if (message.path != null && Object.hasOwnProperty.call(message, "path"))
|
17845 | writer.uint32(/* id 2, wireType 2 =*/18).string(message.path);
|
17846 | return writer;
|
17847 | };
|
17848 |
|
17849 | /**
|
17850 | * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages.
|
17851 | * @function encodeDelimited
|
17852 | * @memberof google.api.CustomHttpPattern
|
17853 | * @static
|
17854 | * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode
|
17855 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
17856 | * @returns {$protobuf.Writer} Writer
|
17857 | */
|
17858 | CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) {
|
17859 | return this.encode(message, writer).ldelim();
|
17860 | };
|
17861 |
|
17862 | /**
|
17863 | * Decodes a CustomHttpPattern message from the specified reader or buffer.
|
17864 | * @function decode
|
17865 | * @memberof google.api.CustomHttpPattern
|
17866 | * @static
|
17867 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
17868 | * @param {number} [length] Message length if known beforehand
|
17869 | * @returns {google.api.CustomHttpPattern} CustomHttpPattern
|
17870 | * @throws {Error} If the payload is not a reader or valid buffer
|
17871 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
17872 | */
|
17873 | CustomHttpPattern.decode = function decode(reader, length) {
|
17874 | if (!(reader instanceof $Reader))
|
17875 | reader = $Reader.create(reader);
|
17876 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern();
|
17877 | while (reader.pos < end) {
|
17878 | var tag = reader.uint32();
|
17879 | switch (tag >>> 3) {
|
17880 | case 1:
|
17881 | message.kind = reader.string();
|
17882 | break;
|
17883 | case 2:
|
17884 | message.path = reader.string();
|
17885 | break;
|
17886 | default:
|
17887 | reader.skipType(tag & 7);
|
17888 | break;
|
17889 | }
|
17890 | }
|
17891 | return message;
|
17892 | };
|
17893 |
|
17894 | /**
|
17895 | * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited.
|
17896 | * @function decodeDelimited
|
17897 | * @memberof google.api.CustomHttpPattern
|
17898 | * @static
|
17899 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
17900 | * @returns {google.api.CustomHttpPattern} CustomHttpPattern
|
17901 | * @throws {Error} If the payload is not a reader or valid buffer
|
17902 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
17903 | */
|
17904 | CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) {
|
17905 | if (!(reader instanceof $Reader))
|
17906 | reader = new $Reader(reader);
|
17907 | return this.decode(reader, reader.uint32());
|
17908 | };
|
17909 |
|
17910 | /**
|
17911 | * Verifies a CustomHttpPattern message.
|
17912 | * @function verify
|
17913 | * @memberof google.api.CustomHttpPattern
|
17914 | * @static
|
17915 | * @param {Object.<string,*>} message Plain object to verify
|
17916 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
17917 | */
|
17918 | CustomHttpPattern.verify = function verify(message) {
|
17919 | if (typeof message !== "object" || message === null)
|
17920 | return "object expected";
|
17921 | if (message.kind != null && message.hasOwnProperty("kind"))
|
17922 | if (!$util.isString(message.kind))
|
17923 | return "kind: string expected";
|
17924 | if (message.path != null && message.hasOwnProperty("path"))
|
17925 | if (!$util.isString(message.path))
|
17926 | return "path: string expected";
|
17927 | return null;
|
17928 | };
|
17929 |
|
17930 | /**
|
17931 | * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types.
|
17932 | * @function fromObject
|
17933 | * @memberof google.api.CustomHttpPattern
|
17934 | * @static
|
17935 | * @param {Object.<string,*>} object Plain object
|
17936 | * @returns {google.api.CustomHttpPattern} CustomHttpPattern
|
17937 | */
|
17938 | CustomHttpPattern.fromObject = function fromObject(object) {
|
17939 | if (object instanceof $root.google.api.CustomHttpPattern)
|
17940 | return object;
|
17941 | var message = new $root.google.api.CustomHttpPattern();
|
17942 | if (object.kind != null)
|
17943 | message.kind = String(object.kind);
|
17944 | if (object.path != null)
|
17945 | message.path = String(object.path);
|
17946 | return message;
|
17947 | };
|
17948 |
|
17949 | /**
|
17950 | * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified.
|
17951 | * @function toObject
|
17952 | * @memberof google.api.CustomHttpPattern
|
17953 | * @static
|
17954 | * @param {google.api.CustomHttpPattern} message CustomHttpPattern
|
17955 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
17956 | * @returns {Object.<string,*>} Plain object
|
17957 | */
|
17958 | CustomHttpPattern.toObject = function toObject(message, options) {
|
17959 | if (!options)
|
17960 | options = {};
|
17961 | var object = {};
|
17962 | if (options.defaults) {
|
17963 | object.kind = "";
|
17964 | object.path = "";
|
17965 | }
|
17966 | if (message.kind != null && message.hasOwnProperty("kind"))
|
17967 | object.kind = message.kind;
|
17968 | if (message.path != null && message.hasOwnProperty("path"))
|
17969 | object.path = message.path;
|
17970 | return object;
|
17971 | };
|
17972 |
|
17973 | /**
|
17974 | * Converts this CustomHttpPattern to JSON.
|
17975 | * @function toJSON
|
17976 | * @memberof google.api.CustomHttpPattern
|
17977 | * @instance
|
17978 | * @returns {Object.<string,*>} JSON object
|
17979 | */
|
17980 | CustomHttpPattern.prototype.toJSON = function toJSON() {
|
17981 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
17982 | };
|
17983 |
|
17984 | return CustomHttpPattern;
|
17985 | })();
|
17986 |
|
17987 | /**
|
17988 | * FieldBehavior enum.
|
17989 | * @name google.api.FieldBehavior
|
17990 | * @enum {number}
|
17991 | * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value
|
17992 | * @property {number} OPTIONAL=1 OPTIONAL value
|
17993 | * @property {number} REQUIRED=2 REQUIRED value
|
17994 | * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value
|
17995 | * @property {number} INPUT_ONLY=4 INPUT_ONLY value
|
17996 | * @property {number} IMMUTABLE=5 IMMUTABLE value
|
17997 | * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value
|
17998 | * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value
|
17999 | */
|
18000 | api.FieldBehavior = (function() {
|
18001 | var valuesById = {}, values = Object.create(valuesById);
|
18002 | values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0;
|
18003 | values[valuesById[1] = "OPTIONAL"] = 1;
|
18004 | values[valuesById[2] = "REQUIRED"] = 2;
|
18005 | values[valuesById[3] = "OUTPUT_ONLY"] = 3;
|
18006 | values[valuesById[4] = "INPUT_ONLY"] = 4;
|
18007 | values[valuesById[5] = "IMMUTABLE"] = 5;
|
18008 | values[valuesById[6] = "UNORDERED_LIST"] = 6;
|
18009 | values[valuesById[7] = "NON_EMPTY_DEFAULT"] = 7;
|
18010 | return values;
|
18011 | })();
|
18012 |
|
18013 | api.ResourceDescriptor = (function() {
|
18014 |
|
18015 | /**
|
18016 | * Properties of a ResourceDescriptor.
|
18017 | * @memberof google.api
|
18018 | * @interface IResourceDescriptor
|
18019 | * @property {string|null} [type] ResourceDescriptor type
|
18020 | * @property {Array.<string>|null} [pattern] ResourceDescriptor pattern
|
18021 | * @property {string|null} [nameField] ResourceDescriptor nameField
|
18022 | * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history
|
18023 | * @property {string|null} [plural] ResourceDescriptor plural
|
18024 | * @property {string|null} [singular] ResourceDescriptor singular
|
18025 | * @property {Array.<google.api.ResourceDescriptor.Style>|null} [style] ResourceDescriptor style
|
18026 | */
|
18027 |
|
18028 | /**
|
18029 | * Constructs a new ResourceDescriptor.
|
18030 | * @memberof google.api
|
18031 | * @classdesc Represents a ResourceDescriptor.
|
18032 | * @implements IResourceDescriptor
|
18033 | * @constructor
|
18034 | * @param {google.api.IResourceDescriptor=} [properties] Properties to set
|
18035 | */
|
18036 | function ResourceDescriptor(properties) {
|
18037 | this.pattern = [];
|
18038 | this.style = [];
|
18039 | if (properties)
|
18040 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
18041 | if (properties[keys[i]] != null)
|
18042 | this[keys[i]] = properties[keys[i]];
|
18043 | }
|
18044 |
|
18045 | /**
|
18046 | * ResourceDescriptor type.
|
18047 | * @member {string} type
|
18048 | * @memberof google.api.ResourceDescriptor
|
18049 | * @instance
|
18050 | */
|
18051 | ResourceDescriptor.prototype.type = "";
|
18052 |
|
18053 | /**
|
18054 | * ResourceDescriptor pattern.
|
18055 | * @member {Array.<string>} pattern
|
18056 | * @memberof google.api.ResourceDescriptor
|
18057 | * @instance
|
18058 | */
|
18059 | ResourceDescriptor.prototype.pattern = $util.emptyArray;
|
18060 |
|
18061 | /**
|
18062 | * ResourceDescriptor nameField.
|
18063 | * @member {string} nameField
|
18064 | * @memberof google.api.ResourceDescriptor
|
18065 | * @instance
|
18066 | */
|
18067 | ResourceDescriptor.prototype.nameField = "";
|
18068 |
|
18069 | /**
|
18070 | * ResourceDescriptor history.
|
18071 | * @member {google.api.ResourceDescriptor.History} history
|
18072 | * @memberof google.api.ResourceDescriptor
|
18073 | * @instance
|
18074 | */
|
18075 | ResourceDescriptor.prototype.history = 0;
|
18076 |
|
18077 | /**
|
18078 | * ResourceDescriptor plural.
|
18079 | * @member {string} plural
|
18080 | * @memberof google.api.ResourceDescriptor
|
18081 | * @instance
|
18082 | */
|
18083 | ResourceDescriptor.prototype.plural = "";
|
18084 |
|
18085 | /**
|
18086 | * ResourceDescriptor singular.
|
18087 | * @member {string} singular
|
18088 | * @memberof google.api.ResourceDescriptor
|
18089 | * @instance
|
18090 | */
|
18091 | ResourceDescriptor.prototype.singular = "";
|
18092 |
|
18093 | /**
|
18094 | * ResourceDescriptor style.
|
18095 | * @member {Array.<google.api.ResourceDescriptor.Style>} style
|
18096 | * @memberof google.api.ResourceDescriptor
|
18097 | * @instance
|
18098 | */
|
18099 | ResourceDescriptor.prototype.style = $util.emptyArray;
|
18100 |
|
18101 | /**
|
18102 | * Creates a new ResourceDescriptor instance using the specified properties.
|
18103 | * @function create
|
18104 | * @memberof google.api.ResourceDescriptor
|
18105 | * @static
|
18106 | * @param {google.api.IResourceDescriptor=} [properties] Properties to set
|
18107 | * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance
|
18108 | */
|
18109 | ResourceDescriptor.create = function create(properties) {
|
18110 | return new ResourceDescriptor(properties);
|
18111 | };
|
18112 |
|
18113 | /**
|
18114 | * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages.
|
18115 | * @function encode
|
18116 | * @memberof google.api.ResourceDescriptor
|
18117 | * @static
|
18118 | * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode
|
18119 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
18120 | * @returns {$protobuf.Writer} Writer
|
18121 | */
|
18122 | ResourceDescriptor.encode = function encode(message, writer) {
|
18123 | if (!writer)
|
18124 | writer = $Writer.create();
|
18125 | if (message.type != null && Object.hasOwnProperty.call(message, "type"))
|
18126 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.type);
|
18127 | if (message.pattern != null && message.pattern.length)
|
18128 | for (var i = 0; i < message.pattern.length; ++i)
|
18129 | writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]);
|
18130 | if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField"))
|
18131 | writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField);
|
18132 | if (message.history != null && Object.hasOwnProperty.call(message, "history"))
|
18133 | writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history);
|
18134 | if (message.plural != null && Object.hasOwnProperty.call(message, "plural"))
|
18135 | writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural);
|
18136 | if (message.singular != null && Object.hasOwnProperty.call(message, "singular"))
|
18137 | writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular);
|
18138 | if (message.style != null && message.style.length) {
|
18139 | writer.uint32(/* id 10, wireType 2 =*/82).fork();
|
18140 | for (var i = 0; i < message.style.length; ++i)
|
18141 | writer.int32(message.style[i]);
|
18142 | writer.ldelim();
|
18143 | }
|
18144 | return writer;
|
18145 | };
|
18146 |
|
18147 | /**
|
18148 | * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages.
|
18149 | * @function encodeDelimited
|
18150 | * @memberof google.api.ResourceDescriptor
|
18151 | * @static
|
18152 | * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode
|
18153 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
18154 | * @returns {$protobuf.Writer} Writer
|
18155 | */
|
18156 | ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) {
|
18157 | return this.encode(message, writer).ldelim();
|
18158 | };
|
18159 |
|
18160 | /**
|
18161 | * Decodes a ResourceDescriptor message from the specified reader or buffer.
|
18162 | * @function decode
|
18163 | * @memberof google.api.ResourceDescriptor
|
18164 | * @static
|
18165 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
18166 | * @param {number} [length] Message length if known beforehand
|
18167 | * @returns {google.api.ResourceDescriptor} ResourceDescriptor
|
18168 | * @throws {Error} If the payload is not a reader or valid buffer
|
18169 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
18170 | */
|
18171 | ResourceDescriptor.decode = function decode(reader, length) {
|
18172 | if (!(reader instanceof $Reader))
|
18173 | reader = $Reader.create(reader);
|
18174 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor();
|
18175 | while (reader.pos < end) {
|
18176 | var tag = reader.uint32();
|
18177 | switch (tag >>> 3) {
|
18178 | case 1:
|
18179 | message.type = reader.string();
|
18180 | break;
|
18181 | case 2:
|
18182 | if (!(message.pattern && message.pattern.length))
|
18183 | message.pattern = [];
|
18184 | message.pattern.push(reader.string());
|
18185 | break;
|
18186 | case 3:
|
18187 | message.nameField = reader.string();
|
18188 | break;
|
18189 | case 4:
|
18190 | message.history = reader.int32();
|
18191 | break;
|
18192 | case 5:
|
18193 | message.plural = reader.string();
|
18194 | break;
|
18195 | case 6:
|
18196 | message.singular = reader.string();
|
18197 | break;
|
18198 | case 10:
|
18199 | if (!(message.style && message.style.length))
|
18200 | message.style = [];
|
18201 | if ((tag & 7) === 2) {
|
18202 | var end2 = reader.uint32() + reader.pos;
|
18203 | while (reader.pos < end2)
|
18204 | message.style.push(reader.int32());
|
18205 | } else
|
18206 | message.style.push(reader.int32());
|
18207 | break;
|
18208 | default:
|
18209 | reader.skipType(tag & 7);
|
18210 | break;
|
18211 | }
|
18212 | }
|
18213 | return message;
|
18214 | };
|
18215 |
|
18216 | /**
|
18217 | * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited.
|
18218 | * @function decodeDelimited
|
18219 | * @memberof google.api.ResourceDescriptor
|
18220 | * @static
|
18221 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
18222 | * @returns {google.api.ResourceDescriptor} ResourceDescriptor
|
18223 | * @throws {Error} If the payload is not a reader or valid buffer
|
18224 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
18225 | */
|
18226 | ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) {
|
18227 | if (!(reader instanceof $Reader))
|
18228 | reader = new $Reader(reader);
|
18229 | return this.decode(reader, reader.uint32());
|
18230 | };
|
18231 |
|
18232 | /**
|
18233 | * Verifies a ResourceDescriptor message.
|
18234 | * @function verify
|
18235 | * @memberof google.api.ResourceDescriptor
|
18236 | * @static
|
18237 | * @param {Object.<string,*>} message Plain object to verify
|
18238 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
18239 | */
|
18240 | ResourceDescriptor.verify = function verify(message) {
|
18241 | if (typeof message !== "object" || message === null)
|
18242 | return "object expected";
|
18243 | if (message.type != null && message.hasOwnProperty("type"))
|
18244 | if (!$util.isString(message.type))
|
18245 | return "type: string expected";
|
18246 | if (message.pattern != null && message.hasOwnProperty("pattern")) {
|
18247 | if (!Array.isArray(message.pattern))
|
18248 | return "pattern: array expected";
|
18249 | for (var i = 0; i < message.pattern.length; ++i)
|
18250 | if (!$util.isString(message.pattern[i]))
|
18251 | return "pattern: string[] expected";
|
18252 | }
|
18253 | if (message.nameField != null && message.hasOwnProperty("nameField"))
|
18254 | if (!$util.isString(message.nameField))
|
18255 | return "nameField: string expected";
|
18256 | if (message.history != null && message.hasOwnProperty("history"))
|
18257 | switch (message.history) {
|
18258 | default:
|
18259 | return "history: enum value expected";
|
18260 | case 0:
|
18261 | case 1:
|
18262 | case 2:
|
18263 | break;
|
18264 | }
|
18265 | if (message.plural != null && message.hasOwnProperty("plural"))
|
18266 | if (!$util.isString(message.plural))
|
18267 | return "plural: string expected";
|
18268 | if (message.singular != null && message.hasOwnProperty("singular"))
|
18269 | if (!$util.isString(message.singular))
|
18270 | return "singular: string expected";
|
18271 | if (message.style != null && message.hasOwnProperty("style")) {
|
18272 | if (!Array.isArray(message.style))
|
18273 | return "style: array expected";
|
18274 | for (var i = 0; i < message.style.length; ++i)
|
18275 | switch (message.style[i]) {
|
18276 | default:
|
18277 | return "style: enum value[] expected";
|
18278 | case 0:
|
18279 | case 1:
|
18280 | break;
|
18281 | }
|
18282 | }
|
18283 | return null;
|
18284 | };
|
18285 |
|
18286 | /**
|
18287 | * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types.
|
18288 | * @function fromObject
|
18289 | * @memberof google.api.ResourceDescriptor
|
18290 | * @static
|
18291 | * @param {Object.<string,*>} object Plain object
|
18292 | * @returns {google.api.ResourceDescriptor} ResourceDescriptor
|
18293 | */
|
18294 | ResourceDescriptor.fromObject = function fromObject(object) {
|
18295 | if (object instanceof $root.google.api.ResourceDescriptor)
|
18296 | return object;
|
18297 | var message = new $root.google.api.ResourceDescriptor();
|
18298 | if (object.type != null)
|
18299 | message.type = String(object.type);
|
18300 | if (object.pattern) {
|
18301 | if (!Array.isArray(object.pattern))
|
18302 | throw TypeError(".google.api.ResourceDescriptor.pattern: array expected");
|
18303 | message.pattern = [];
|
18304 | for (var i = 0; i < object.pattern.length; ++i)
|
18305 | message.pattern[i] = String(object.pattern[i]);
|
18306 | }
|
18307 | if (object.nameField != null)
|
18308 | message.nameField = String(object.nameField);
|
18309 | switch (object.history) {
|
18310 | case "HISTORY_UNSPECIFIED":
|
18311 | case 0:
|
18312 | message.history = 0;
|
18313 | break;
|
18314 | case "ORIGINALLY_SINGLE_PATTERN":
|
18315 | case 1:
|
18316 | message.history = 1;
|
18317 | break;
|
18318 | case "FUTURE_MULTI_PATTERN":
|
18319 | case 2:
|
18320 | message.history = 2;
|
18321 | break;
|
18322 | }
|
18323 | if (object.plural != null)
|
18324 | message.plural = String(object.plural);
|
18325 | if (object.singular != null)
|
18326 | message.singular = String(object.singular);
|
18327 | if (object.style) {
|
18328 | if (!Array.isArray(object.style))
|
18329 | throw TypeError(".google.api.ResourceDescriptor.style: array expected");
|
18330 | message.style = [];
|
18331 | for (var i = 0; i < object.style.length; ++i)
|
18332 | switch (object.style[i]) {
|
18333 | default:
|
18334 | case "STYLE_UNSPECIFIED":
|
18335 | case 0:
|
18336 | message.style[i] = 0;
|
18337 | break;
|
18338 | case "DECLARATIVE_FRIENDLY":
|
18339 | case 1:
|
18340 | message.style[i] = 1;
|
18341 | break;
|
18342 | }
|
18343 | }
|
18344 | return message;
|
18345 | };
|
18346 |
|
18347 | /**
|
18348 | * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified.
|
18349 | * @function toObject
|
18350 | * @memberof google.api.ResourceDescriptor
|
18351 | * @static
|
18352 | * @param {google.api.ResourceDescriptor} message ResourceDescriptor
|
18353 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
18354 | * @returns {Object.<string,*>} Plain object
|
18355 | */
|
18356 | ResourceDescriptor.toObject = function toObject(message, options) {
|
18357 | if (!options)
|
18358 | options = {};
|
18359 | var object = {};
|
18360 | if (options.arrays || options.defaults) {
|
18361 | object.pattern = [];
|
18362 | object.style = [];
|
18363 | }
|
18364 | if (options.defaults) {
|
18365 | object.type = "";
|
18366 | object.nameField = "";
|
18367 | object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0;
|
18368 | object.plural = "";
|
18369 | object.singular = "";
|
18370 | }
|
18371 | if (message.type != null && message.hasOwnProperty("type"))
|
18372 | object.type = message.type;
|
18373 | if (message.pattern && message.pattern.length) {
|
18374 | object.pattern = [];
|
18375 | for (var j = 0; j < message.pattern.length; ++j)
|
18376 | object.pattern[j] = message.pattern[j];
|
18377 | }
|
18378 | if (message.nameField != null && message.hasOwnProperty("nameField"))
|
18379 | object.nameField = message.nameField;
|
18380 | if (message.history != null && message.hasOwnProperty("history"))
|
18381 | object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] : message.history;
|
18382 | if (message.plural != null && message.hasOwnProperty("plural"))
|
18383 | object.plural = message.plural;
|
18384 | if (message.singular != null && message.hasOwnProperty("singular"))
|
18385 | object.singular = message.singular;
|
18386 | if (message.style && message.style.length) {
|
18387 | object.style = [];
|
18388 | for (var j = 0; j < message.style.length; ++j)
|
18389 | object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j];
|
18390 | }
|
18391 | return object;
|
18392 | };
|
18393 |
|
18394 | /**
|
18395 | * Converts this ResourceDescriptor to JSON.
|
18396 | * @function toJSON
|
18397 | * @memberof google.api.ResourceDescriptor
|
18398 | * @instance
|
18399 | * @returns {Object.<string,*>} JSON object
|
18400 | */
|
18401 | ResourceDescriptor.prototype.toJSON = function toJSON() {
|
18402 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
18403 | };
|
18404 |
|
18405 | /**
|
18406 | * History enum.
|
18407 | * @name google.api.ResourceDescriptor.History
|
18408 | * @enum {number}
|
18409 | * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value
|
18410 | * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value
|
18411 | * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value
|
18412 | */
|
18413 | ResourceDescriptor.History = (function() {
|
18414 | var valuesById = {}, values = Object.create(valuesById);
|
18415 | values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0;
|
18416 | values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1;
|
18417 | values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2;
|
18418 | return values;
|
18419 | })();
|
18420 |
|
18421 | /**
|
18422 | * Style enum.
|
18423 | * @name google.api.ResourceDescriptor.Style
|
18424 | * @enum {number}
|
18425 | * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value
|
18426 | * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value
|
18427 | */
|
18428 | ResourceDescriptor.Style = (function() {
|
18429 | var valuesById = {}, values = Object.create(valuesById);
|
18430 | values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0;
|
18431 | values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1;
|
18432 | return values;
|
18433 | })();
|
18434 |
|
18435 | return ResourceDescriptor;
|
18436 | })();
|
18437 |
|
18438 | api.ResourceReference = (function() {
|
18439 |
|
18440 | /**
|
18441 | * Properties of a ResourceReference.
|
18442 | * @memberof google.api
|
18443 | * @interface IResourceReference
|
18444 | * @property {string|null} [type] ResourceReference type
|
18445 | * @property {string|null} [childType] ResourceReference childType
|
18446 | */
|
18447 |
|
18448 | /**
|
18449 | * Constructs a new ResourceReference.
|
18450 | * @memberof google.api
|
18451 | * @classdesc Represents a ResourceReference.
|
18452 | * @implements IResourceReference
|
18453 | * @constructor
|
18454 | * @param {google.api.IResourceReference=} [properties] Properties to set
|
18455 | */
|
18456 | function ResourceReference(properties) {
|
18457 | if (properties)
|
18458 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
18459 | if (properties[keys[i]] != null)
|
18460 | this[keys[i]] = properties[keys[i]];
|
18461 | }
|
18462 |
|
18463 | /**
|
18464 | * ResourceReference type.
|
18465 | * @member {string} type
|
18466 | * @memberof google.api.ResourceReference
|
18467 | * @instance
|
18468 | */
|
18469 | ResourceReference.prototype.type = "";
|
18470 |
|
18471 | /**
|
18472 | * ResourceReference childType.
|
18473 | * @member {string} childType
|
18474 | * @memberof google.api.ResourceReference
|
18475 | * @instance
|
18476 | */
|
18477 | ResourceReference.prototype.childType = "";
|
18478 |
|
18479 | /**
|
18480 | * Creates a new ResourceReference instance using the specified properties.
|
18481 | * @function create
|
18482 | * @memberof google.api.ResourceReference
|
18483 | * @static
|
18484 | * @param {google.api.IResourceReference=} [properties] Properties to set
|
18485 | * @returns {google.api.ResourceReference} ResourceReference instance
|
18486 | */
|
18487 | ResourceReference.create = function create(properties) {
|
18488 | return new ResourceReference(properties);
|
18489 | };
|
18490 |
|
18491 | /**
|
18492 | * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages.
|
18493 | * @function encode
|
18494 | * @memberof google.api.ResourceReference
|
18495 | * @static
|
18496 | * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode
|
18497 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
18498 | * @returns {$protobuf.Writer} Writer
|
18499 | */
|
18500 | ResourceReference.encode = function encode(message, writer) {
|
18501 | if (!writer)
|
18502 | writer = $Writer.create();
|
18503 | if (message.type != null && Object.hasOwnProperty.call(message, "type"))
|
18504 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.type);
|
18505 | if (message.childType != null && Object.hasOwnProperty.call(message, "childType"))
|
18506 | writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType);
|
18507 | return writer;
|
18508 | };
|
18509 |
|
18510 | /**
|
18511 | * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages.
|
18512 | * @function encodeDelimited
|
18513 | * @memberof google.api.ResourceReference
|
18514 | * @static
|
18515 | * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode
|
18516 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
18517 | * @returns {$protobuf.Writer} Writer
|
18518 | */
|
18519 | ResourceReference.encodeDelimited = function encodeDelimited(message, writer) {
|
18520 | return this.encode(message, writer).ldelim();
|
18521 | };
|
18522 |
|
18523 | /**
|
18524 | * Decodes a ResourceReference message from the specified reader or buffer.
|
18525 | * @function decode
|
18526 | * @memberof google.api.ResourceReference
|
18527 | * @static
|
18528 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
18529 | * @param {number} [length] Message length if known beforehand
|
18530 | * @returns {google.api.ResourceReference} ResourceReference
|
18531 | * @throws {Error} If the payload is not a reader or valid buffer
|
18532 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
18533 | */
|
18534 | ResourceReference.decode = function decode(reader, length) {
|
18535 | if (!(reader instanceof $Reader))
|
18536 | reader = $Reader.create(reader);
|
18537 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference();
|
18538 | while (reader.pos < end) {
|
18539 | var tag = reader.uint32();
|
18540 | switch (tag >>> 3) {
|
18541 | case 1:
|
18542 | message.type = reader.string();
|
18543 | break;
|
18544 | case 2:
|
18545 | message.childType = reader.string();
|
18546 | break;
|
18547 | default:
|
18548 | reader.skipType(tag & 7);
|
18549 | break;
|
18550 | }
|
18551 | }
|
18552 | return message;
|
18553 | };
|
18554 |
|
18555 | /**
|
18556 | * Decodes a ResourceReference message from the specified reader or buffer, length delimited.
|
18557 | * @function decodeDelimited
|
18558 | * @memberof google.api.ResourceReference
|
18559 | * @static
|
18560 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
18561 | * @returns {google.api.ResourceReference} ResourceReference
|
18562 | * @throws {Error} If the payload is not a reader or valid buffer
|
18563 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
18564 | */
|
18565 | ResourceReference.decodeDelimited = function decodeDelimited(reader) {
|
18566 | if (!(reader instanceof $Reader))
|
18567 | reader = new $Reader(reader);
|
18568 | return this.decode(reader, reader.uint32());
|
18569 | };
|
18570 |
|
18571 | /**
|
18572 | * Verifies a ResourceReference message.
|
18573 | * @function verify
|
18574 | * @memberof google.api.ResourceReference
|
18575 | * @static
|
18576 | * @param {Object.<string,*>} message Plain object to verify
|
18577 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
18578 | */
|
18579 | ResourceReference.verify = function verify(message) {
|
18580 | if (typeof message !== "object" || message === null)
|
18581 | return "object expected";
|
18582 | if (message.type != null && message.hasOwnProperty("type"))
|
18583 | if (!$util.isString(message.type))
|
18584 | return "type: string expected";
|
18585 | if (message.childType != null && message.hasOwnProperty("childType"))
|
18586 | if (!$util.isString(message.childType))
|
18587 | return "childType: string expected";
|
18588 | return null;
|
18589 | };
|
18590 |
|
18591 | /**
|
18592 | * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types.
|
18593 | * @function fromObject
|
18594 | * @memberof google.api.ResourceReference
|
18595 | * @static
|
18596 | * @param {Object.<string,*>} object Plain object
|
18597 | * @returns {google.api.ResourceReference} ResourceReference
|
18598 | */
|
18599 | ResourceReference.fromObject = function fromObject(object) {
|
18600 | if (object instanceof $root.google.api.ResourceReference)
|
18601 | return object;
|
18602 | var message = new $root.google.api.ResourceReference();
|
18603 | if (object.type != null)
|
18604 | message.type = String(object.type);
|
18605 | if (object.childType != null)
|
18606 | message.childType = String(object.childType);
|
18607 | return message;
|
18608 | };
|
18609 |
|
18610 | /**
|
18611 | * Creates a plain object from a ResourceReference message. Also converts values to other types if specified.
|
18612 | * @function toObject
|
18613 | * @memberof google.api.ResourceReference
|
18614 | * @static
|
18615 | * @param {google.api.ResourceReference} message ResourceReference
|
18616 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
18617 | * @returns {Object.<string,*>} Plain object
|
18618 | */
|
18619 | ResourceReference.toObject = function toObject(message, options) {
|
18620 | if (!options)
|
18621 | options = {};
|
18622 | var object = {};
|
18623 | if (options.defaults) {
|
18624 | object.type = "";
|
18625 | object.childType = "";
|
18626 | }
|
18627 | if (message.type != null && message.hasOwnProperty("type"))
|
18628 | object.type = message.type;
|
18629 | if (message.childType != null && message.hasOwnProperty("childType"))
|
18630 | object.childType = message.childType;
|
18631 | return object;
|
18632 | };
|
18633 |
|
18634 | /**
|
18635 | * Converts this ResourceReference to JSON.
|
18636 | * @function toJSON
|
18637 | * @memberof google.api.ResourceReference
|
18638 | * @instance
|
18639 | * @returns {Object.<string,*>} JSON object
|
18640 | */
|
18641 | ResourceReference.prototype.toJSON = function toJSON() {
|
18642 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
18643 | };
|
18644 |
|
18645 | return ResourceReference;
|
18646 | })();
|
18647 |
|
18648 | return api;
|
18649 | })();
|
18650 |
|
18651 | google.protobuf = (function() {
|
18652 |
|
18653 | /**
|
18654 | * Namespace protobuf.
|
18655 | * @memberof google
|
18656 | * @namespace
|
18657 | */
|
18658 | var protobuf = {};
|
18659 |
|
18660 | protobuf.FileDescriptorSet = (function() {
|
18661 |
|
18662 | /**
|
18663 | * Properties of a FileDescriptorSet.
|
18664 | * @memberof google.protobuf
|
18665 | * @interface IFileDescriptorSet
|
18666 | * @property {Array.<google.protobuf.IFileDescriptorProto>|null} [file] FileDescriptorSet file
|
18667 | */
|
18668 |
|
18669 | /**
|
18670 | * Constructs a new FileDescriptorSet.
|
18671 | * @memberof google.protobuf
|
18672 | * @classdesc Represents a FileDescriptorSet.
|
18673 | * @implements IFileDescriptorSet
|
18674 | * @constructor
|
18675 | * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set
|
18676 | */
|
18677 | function FileDescriptorSet(properties) {
|
18678 | this.file = [];
|
18679 | if (properties)
|
18680 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
18681 | if (properties[keys[i]] != null)
|
18682 | this[keys[i]] = properties[keys[i]];
|
18683 | }
|
18684 |
|
18685 | /**
|
18686 | * FileDescriptorSet file.
|
18687 | * @member {Array.<google.protobuf.IFileDescriptorProto>} file
|
18688 | * @memberof google.protobuf.FileDescriptorSet
|
18689 | * @instance
|
18690 | */
|
18691 | FileDescriptorSet.prototype.file = $util.emptyArray;
|
18692 |
|
18693 | /**
|
18694 | * Creates a new FileDescriptorSet instance using the specified properties.
|
18695 | * @function create
|
18696 | * @memberof google.protobuf.FileDescriptorSet
|
18697 | * @static
|
18698 | * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set
|
18699 | * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance
|
18700 | */
|
18701 | FileDescriptorSet.create = function create(properties) {
|
18702 | return new FileDescriptorSet(properties);
|
18703 | };
|
18704 |
|
18705 | /**
|
18706 | * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages.
|
18707 | * @function encode
|
18708 | * @memberof google.protobuf.FileDescriptorSet
|
18709 | * @static
|
18710 | * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode
|
18711 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
18712 | * @returns {$protobuf.Writer} Writer
|
18713 | */
|
18714 | FileDescriptorSet.encode = function encode(message, writer) {
|
18715 | if (!writer)
|
18716 | writer = $Writer.create();
|
18717 | if (message.file != null && message.file.length)
|
18718 | for (var i = 0; i < message.file.length; ++i)
|
18719 | $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
18720 | return writer;
|
18721 | };
|
18722 |
|
18723 | /**
|
18724 | * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages.
|
18725 | * @function encodeDelimited
|
18726 | * @memberof google.protobuf.FileDescriptorSet
|
18727 | * @static
|
18728 | * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode
|
18729 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
18730 | * @returns {$protobuf.Writer} Writer
|
18731 | */
|
18732 | FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) {
|
18733 | return this.encode(message, writer).ldelim();
|
18734 | };
|
18735 |
|
18736 | /**
|
18737 | * Decodes a FileDescriptorSet message from the specified reader or buffer.
|
18738 | * @function decode
|
18739 | * @memberof google.protobuf.FileDescriptorSet
|
18740 | * @static
|
18741 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
18742 | * @param {number} [length] Message length if known beforehand
|
18743 | * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet
|
18744 | * @throws {Error} If the payload is not a reader or valid buffer
|
18745 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
18746 | */
|
18747 | FileDescriptorSet.decode = function decode(reader, length) {
|
18748 | if (!(reader instanceof $Reader))
|
18749 | reader = $Reader.create(reader);
|
18750 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet();
|
18751 | while (reader.pos < end) {
|
18752 | var tag = reader.uint32();
|
18753 | switch (tag >>> 3) {
|
18754 | case 1:
|
18755 | if (!(message.file && message.file.length))
|
18756 | message.file = [];
|
18757 | message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32()));
|
18758 | break;
|
18759 | default:
|
18760 | reader.skipType(tag & 7);
|
18761 | break;
|
18762 | }
|
18763 | }
|
18764 | return message;
|
18765 | };
|
18766 |
|
18767 | /**
|
18768 | * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited.
|
18769 | * @function decodeDelimited
|
18770 | * @memberof google.protobuf.FileDescriptorSet
|
18771 | * @static
|
18772 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
18773 | * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet
|
18774 | * @throws {Error} If the payload is not a reader or valid buffer
|
18775 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
18776 | */
|
18777 | FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) {
|
18778 | if (!(reader instanceof $Reader))
|
18779 | reader = new $Reader(reader);
|
18780 | return this.decode(reader, reader.uint32());
|
18781 | };
|
18782 |
|
18783 | /**
|
18784 | * Verifies a FileDescriptorSet message.
|
18785 | * @function verify
|
18786 | * @memberof google.protobuf.FileDescriptorSet
|
18787 | * @static
|
18788 | * @param {Object.<string,*>} message Plain object to verify
|
18789 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
18790 | */
|
18791 | FileDescriptorSet.verify = function verify(message) {
|
18792 | if (typeof message !== "object" || message === null)
|
18793 | return "object expected";
|
18794 | if (message.file != null && message.hasOwnProperty("file")) {
|
18795 | if (!Array.isArray(message.file))
|
18796 | return "file: array expected";
|
18797 | for (var i = 0; i < message.file.length; ++i) {
|
18798 | var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]);
|
18799 | if (error)
|
18800 | return "file." + error;
|
18801 | }
|
18802 | }
|
18803 | return null;
|
18804 | };
|
18805 |
|
18806 | /**
|
18807 | * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types.
|
18808 | * @function fromObject
|
18809 | * @memberof google.protobuf.FileDescriptorSet
|
18810 | * @static
|
18811 | * @param {Object.<string,*>} object Plain object
|
18812 | * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet
|
18813 | */
|
18814 | FileDescriptorSet.fromObject = function fromObject(object) {
|
18815 | if (object instanceof $root.google.protobuf.FileDescriptorSet)
|
18816 | return object;
|
18817 | var message = new $root.google.protobuf.FileDescriptorSet();
|
18818 | if (object.file) {
|
18819 | if (!Array.isArray(object.file))
|
18820 | throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected");
|
18821 | message.file = [];
|
18822 | for (var i = 0; i < object.file.length; ++i) {
|
18823 | if (typeof object.file[i] !== "object")
|
18824 | throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected");
|
18825 | message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]);
|
18826 | }
|
18827 | }
|
18828 | return message;
|
18829 | };
|
18830 |
|
18831 | /**
|
18832 | * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified.
|
18833 | * @function toObject
|
18834 | * @memberof google.protobuf.FileDescriptorSet
|
18835 | * @static
|
18836 | * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet
|
18837 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
18838 | * @returns {Object.<string,*>} Plain object
|
18839 | */
|
18840 | FileDescriptorSet.toObject = function toObject(message, options) {
|
18841 | if (!options)
|
18842 | options = {};
|
18843 | var object = {};
|
18844 | if (options.arrays || options.defaults)
|
18845 | object.file = [];
|
18846 | if (message.file && message.file.length) {
|
18847 | object.file = [];
|
18848 | for (var j = 0; j < message.file.length; ++j)
|
18849 | object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options);
|
18850 | }
|
18851 | return object;
|
18852 | };
|
18853 |
|
18854 | /**
|
18855 | * Converts this FileDescriptorSet to JSON.
|
18856 | * @function toJSON
|
18857 | * @memberof google.protobuf.FileDescriptorSet
|
18858 | * @instance
|
18859 | * @returns {Object.<string,*>} JSON object
|
18860 | */
|
18861 | FileDescriptorSet.prototype.toJSON = function toJSON() {
|
18862 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
18863 | };
|
18864 |
|
18865 | return FileDescriptorSet;
|
18866 | })();
|
18867 |
|
18868 | protobuf.FileDescriptorProto = (function() {
|
18869 |
|
18870 | /**
|
18871 | * Properties of a FileDescriptorProto.
|
18872 | * @memberof google.protobuf
|
18873 | * @interface IFileDescriptorProto
|
18874 | * @property {string|null} [name] FileDescriptorProto name
|
18875 | * @property {string|null} ["package"] FileDescriptorProto package
|
18876 | * @property {Array.<string>|null} [dependency] FileDescriptorProto dependency
|
18877 | * @property {Array.<number>|null} [publicDependency] FileDescriptorProto publicDependency
|
18878 | * @property {Array.<number>|null} [weakDependency] FileDescriptorProto weakDependency
|
18879 | * @property {Array.<google.protobuf.IDescriptorProto>|null} [messageType] FileDescriptorProto messageType
|
18880 | * @property {Array.<google.protobuf.IEnumDescriptorProto>|null} [enumType] FileDescriptorProto enumType
|
18881 | * @property {Array.<google.protobuf.IServiceDescriptorProto>|null} [service] FileDescriptorProto service
|
18882 | * @property {Array.<google.protobuf.IFieldDescriptorProto>|null} [extension] FileDescriptorProto extension
|
18883 | * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options
|
18884 | * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo
|
18885 | * @property {string|null} [syntax] FileDescriptorProto syntax
|
18886 | */
|
18887 |
|
18888 | /**
|
18889 | * Constructs a new FileDescriptorProto.
|
18890 | * @memberof google.protobuf
|
18891 | * @classdesc Represents a FileDescriptorProto.
|
18892 | * @implements IFileDescriptorProto
|
18893 | * @constructor
|
18894 | * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set
|
18895 | */
|
18896 | function FileDescriptorProto(properties) {
|
18897 | this.dependency = [];
|
18898 | this.publicDependency = [];
|
18899 | this.weakDependency = [];
|
18900 | this.messageType = [];
|
18901 | this.enumType = [];
|
18902 | this.service = [];
|
18903 | this.extension = [];
|
18904 | if (properties)
|
18905 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
18906 | if (properties[keys[i]] != null)
|
18907 | this[keys[i]] = properties[keys[i]];
|
18908 | }
|
18909 |
|
18910 | /**
|
18911 | * FileDescriptorProto name.
|
18912 | * @member {string} name
|
18913 | * @memberof google.protobuf.FileDescriptorProto
|
18914 | * @instance
|
18915 | */
|
18916 | FileDescriptorProto.prototype.name = "";
|
18917 |
|
18918 | /**
|
18919 | * FileDescriptorProto package.
|
18920 | * @member {string} package
|
18921 | * @memberof google.protobuf.FileDescriptorProto
|
18922 | * @instance
|
18923 | */
|
18924 | FileDescriptorProto.prototype["package"] = "";
|
18925 |
|
18926 | /**
|
18927 | * FileDescriptorProto dependency.
|
18928 | * @member {Array.<string>} dependency
|
18929 | * @memberof google.protobuf.FileDescriptorProto
|
18930 | * @instance
|
18931 | */
|
18932 | FileDescriptorProto.prototype.dependency = $util.emptyArray;
|
18933 |
|
18934 | /**
|
18935 | * FileDescriptorProto publicDependency.
|
18936 | * @member {Array.<number>} publicDependency
|
18937 | * @memberof google.protobuf.FileDescriptorProto
|
18938 | * @instance
|
18939 | */
|
18940 | FileDescriptorProto.prototype.publicDependency = $util.emptyArray;
|
18941 |
|
18942 | /**
|
18943 | * FileDescriptorProto weakDependency.
|
18944 | * @member {Array.<number>} weakDependency
|
18945 | * @memberof google.protobuf.FileDescriptorProto
|
18946 | * @instance
|
18947 | */
|
18948 | FileDescriptorProto.prototype.weakDependency = $util.emptyArray;
|
18949 |
|
18950 | /**
|
18951 | * FileDescriptorProto messageType.
|
18952 | * @member {Array.<google.protobuf.IDescriptorProto>} messageType
|
18953 | * @memberof google.protobuf.FileDescriptorProto
|
18954 | * @instance
|
18955 | */
|
18956 | FileDescriptorProto.prototype.messageType = $util.emptyArray;
|
18957 |
|
18958 | /**
|
18959 | * FileDescriptorProto enumType.
|
18960 | * @member {Array.<google.protobuf.IEnumDescriptorProto>} enumType
|
18961 | * @memberof google.protobuf.FileDescriptorProto
|
18962 | * @instance
|
18963 | */
|
18964 | FileDescriptorProto.prototype.enumType = $util.emptyArray;
|
18965 |
|
18966 | /**
|
18967 | * FileDescriptorProto service.
|
18968 | * @member {Array.<google.protobuf.IServiceDescriptorProto>} service
|
18969 | * @memberof google.protobuf.FileDescriptorProto
|
18970 | * @instance
|
18971 | */
|
18972 | FileDescriptorProto.prototype.service = $util.emptyArray;
|
18973 |
|
18974 | /**
|
18975 | * FileDescriptorProto extension.
|
18976 | * @member {Array.<google.protobuf.IFieldDescriptorProto>} extension
|
18977 | * @memberof google.protobuf.FileDescriptorProto
|
18978 | * @instance
|
18979 | */
|
18980 | FileDescriptorProto.prototype.extension = $util.emptyArray;
|
18981 |
|
18982 | /**
|
18983 | * FileDescriptorProto options.
|
18984 | * @member {google.protobuf.IFileOptions|null|undefined} options
|
18985 | * @memberof google.protobuf.FileDescriptorProto
|
18986 | * @instance
|
18987 | */
|
18988 | FileDescriptorProto.prototype.options = null;
|
18989 |
|
18990 | /**
|
18991 | * FileDescriptorProto sourceCodeInfo.
|
18992 | * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo
|
18993 | * @memberof google.protobuf.FileDescriptorProto
|
18994 | * @instance
|
18995 | */
|
18996 | FileDescriptorProto.prototype.sourceCodeInfo = null;
|
18997 |
|
18998 | /**
|
18999 | * FileDescriptorProto syntax.
|
19000 | * @member {string} syntax
|
19001 | * @memberof google.protobuf.FileDescriptorProto
|
19002 | * @instance
|
19003 | */
|
19004 | FileDescriptorProto.prototype.syntax = "";
|
19005 |
|
19006 | /**
|
19007 | * Creates a new FileDescriptorProto instance using the specified properties.
|
19008 | * @function create
|
19009 | * @memberof google.protobuf.FileDescriptorProto
|
19010 | * @static
|
19011 | * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set
|
19012 | * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance
|
19013 | */
|
19014 | FileDescriptorProto.create = function create(properties) {
|
19015 | return new FileDescriptorProto(properties);
|
19016 | };
|
19017 |
|
19018 | /**
|
19019 | * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages.
|
19020 | * @function encode
|
19021 | * @memberof google.protobuf.FileDescriptorProto
|
19022 | * @static
|
19023 | * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode
|
19024 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
19025 | * @returns {$protobuf.Writer} Writer
|
19026 | */
|
19027 | FileDescriptorProto.encode = function encode(message, writer) {
|
19028 | if (!writer)
|
19029 | writer = $Writer.create();
|
19030 | if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
19031 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
|
19032 | if (message["package"] != null && Object.hasOwnProperty.call(message, "package"))
|
19033 | writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]);
|
19034 | if (message.dependency != null && message.dependency.length)
|
19035 | for (var i = 0; i < message.dependency.length; ++i)
|
19036 | writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]);
|
19037 | if (message.messageType != null && message.messageType.length)
|
19038 | for (var i = 0; i < message.messageType.length; ++i)
|
19039 | $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
|
19040 | if (message.enumType != null && message.enumType.length)
|
19041 | for (var i = 0; i < message.enumType.length; ++i)
|
19042 | $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
|
19043 | if (message.service != null && message.service.length)
|
19044 | for (var i = 0; i < message.service.length; ++i)
|
19045 | $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
|
19046 | if (message.extension != null && message.extension.length)
|
19047 | for (var i = 0; i < message.extension.length; ++i)
|
19048 | $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();
|
19049 | if (message.options != null && Object.hasOwnProperty.call(message, "options"))
|
19050 | $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();
|
19051 | if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo"))
|
19052 | $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim();
|
19053 | if (message.publicDependency != null && message.publicDependency.length)
|
19054 | for (var i = 0; i < message.publicDependency.length; ++i)
|
19055 | writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]);
|
19056 | if (message.weakDependency != null && message.weakDependency.length)
|
19057 | for (var i = 0; i < message.weakDependency.length; ++i)
|
19058 | writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]);
|
19059 | if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax"))
|
19060 | writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax);
|
19061 | return writer;
|
19062 | };
|
19063 |
|
19064 | /**
|
19065 | * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages.
|
19066 | * @function encodeDelimited
|
19067 | * @memberof google.protobuf.FileDescriptorProto
|
19068 | * @static
|
19069 | * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode
|
19070 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
19071 | * @returns {$protobuf.Writer} Writer
|
19072 | */
|
19073 | FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) {
|
19074 | return this.encode(message, writer).ldelim();
|
19075 | };
|
19076 |
|
19077 | /**
|
19078 | * Decodes a FileDescriptorProto message from the specified reader or buffer.
|
19079 | * @function decode
|
19080 | * @memberof google.protobuf.FileDescriptorProto
|
19081 | * @static
|
19082 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
19083 | * @param {number} [length] Message length if known beforehand
|
19084 | * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto
|
19085 | * @throws {Error} If the payload is not a reader or valid buffer
|
19086 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
19087 | */
|
19088 | FileDescriptorProto.decode = function decode(reader, length) {
|
19089 | if (!(reader instanceof $Reader))
|
19090 | reader = $Reader.create(reader);
|
19091 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto();
|
19092 | while (reader.pos < end) {
|
19093 | var tag = reader.uint32();
|
19094 | switch (tag >>> 3) {
|
19095 | case 1:
|
19096 | message.name = reader.string();
|
19097 | break;
|
19098 | case 2:
|
19099 | message["package"] = reader.string();
|
19100 | break;
|
19101 | case 3:
|
19102 | if (!(message.dependency && message.dependency.length))
|
19103 | message.dependency = [];
|
19104 | message.dependency.push(reader.string());
|
19105 | break;
|
19106 | case 10:
|
19107 | if (!(message.publicDependency && message.publicDependency.length))
|
19108 | message.publicDependency = [];
|
19109 | if ((tag & 7) === 2) {
|
19110 | var end2 = reader.uint32() + reader.pos;
|
19111 | while (reader.pos < end2)
|
19112 | message.publicDependency.push(reader.int32());
|
19113 | } else
|
19114 | message.publicDependency.push(reader.int32());
|
19115 | break;
|
19116 | case 11:
|
19117 | if (!(message.weakDependency && message.weakDependency.length))
|
19118 | message.weakDependency = [];
|
19119 | if ((tag & 7) === 2) {
|
19120 | var end2 = reader.uint32() + reader.pos;
|
19121 | while (reader.pos < end2)
|
19122 | message.weakDependency.push(reader.int32());
|
19123 | } else
|
19124 | message.weakDependency.push(reader.int32());
|
19125 | break;
|
19126 | case 4:
|
19127 | if (!(message.messageType && message.messageType.length))
|
19128 | message.messageType = [];
|
19129 | message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32()));
|
19130 | break;
|
19131 | case 5:
|
19132 | if (!(message.enumType && message.enumType.length))
|
19133 | message.enumType = [];
|
19134 | message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32()));
|
19135 | break;
|
19136 | case 6:
|
19137 | if (!(message.service && message.service.length))
|
19138 | message.service = [];
|
19139 | message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32()));
|
19140 | break;
|
19141 | case 7:
|
19142 | if (!(message.extension && message.extension.length))
|
19143 | message.extension = [];
|
19144 | message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32()));
|
19145 | break;
|
19146 | case 8:
|
19147 | message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32());
|
19148 | break;
|
19149 | case 9:
|
19150 | message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32());
|
19151 | break;
|
19152 | case 12:
|
19153 | message.syntax = reader.string();
|
19154 | break;
|
19155 | default:
|
19156 | reader.skipType(tag & 7);
|
19157 | break;
|
19158 | }
|
19159 | }
|
19160 | return message;
|
19161 | };
|
19162 |
|
19163 | /**
|
19164 | * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited.
|
19165 | * @function decodeDelimited
|
19166 | * @memberof google.protobuf.FileDescriptorProto
|
19167 | * @static
|
19168 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
19169 | * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto
|
19170 | * @throws {Error} If the payload is not a reader or valid buffer
|
19171 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
19172 | */
|
19173 | FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) {
|
19174 | if (!(reader instanceof $Reader))
|
19175 | reader = new $Reader(reader);
|
19176 | return this.decode(reader, reader.uint32());
|
19177 | };
|
19178 |
|
19179 | /**
|
19180 | * Verifies a FileDescriptorProto message.
|
19181 | * @function verify
|
19182 | * @memberof google.protobuf.FileDescriptorProto
|
19183 | * @static
|
19184 | * @param {Object.<string,*>} message Plain object to verify
|
19185 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
19186 | */
|
19187 | FileDescriptorProto.verify = function verify(message) {
|
19188 | if (typeof message !== "object" || message === null)
|
19189 | return "object expected";
|
19190 | if (message.name != null && message.hasOwnProperty("name"))
|
19191 | if (!$util.isString(message.name))
|
19192 | return "name: string expected";
|
19193 | if (message["package"] != null && message.hasOwnProperty("package"))
|
19194 | if (!$util.isString(message["package"]))
|
19195 | return "package: string expected";
|
19196 | if (message.dependency != null && message.hasOwnProperty("dependency")) {
|
19197 | if (!Array.isArray(message.dependency))
|
19198 | return "dependency: array expected";
|
19199 | for (var i = 0; i < message.dependency.length; ++i)
|
19200 | if (!$util.isString(message.dependency[i]))
|
19201 | return "dependency: string[] expected";
|
19202 | }
|
19203 | if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) {
|
19204 | if (!Array.isArray(message.publicDependency))
|
19205 | return "publicDependency: array expected";
|
19206 | for (var i = 0; i < message.publicDependency.length; ++i)
|
19207 | if (!$util.isInteger(message.publicDependency[i]))
|
19208 | return "publicDependency: integer[] expected";
|
19209 | }
|
19210 | if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) {
|
19211 | if (!Array.isArray(message.weakDependency))
|
19212 | return "weakDependency: array expected";
|
19213 | for (var i = 0; i < message.weakDependency.length; ++i)
|
19214 | if (!$util.isInteger(message.weakDependency[i]))
|
19215 | return "weakDependency: integer[] expected";
|
19216 | }
|
19217 | if (message.messageType != null && message.hasOwnProperty("messageType")) {
|
19218 | if (!Array.isArray(message.messageType))
|
19219 | return "messageType: array expected";
|
19220 | for (var i = 0; i < message.messageType.length; ++i) {
|
19221 | var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]);
|
19222 | if (error)
|
19223 | return "messageType." + error;
|
19224 | }
|
19225 | }
|
19226 | if (message.enumType != null && message.hasOwnProperty("enumType")) {
|
19227 | if (!Array.isArray(message.enumType))
|
19228 | return "enumType: array expected";
|
19229 | for (var i = 0; i < message.enumType.length; ++i) {
|
19230 | var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]);
|
19231 | if (error)
|
19232 | return "enumType." + error;
|
19233 | }
|
19234 | }
|
19235 | if (message.service != null && message.hasOwnProperty("service")) {
|
19236 | if (!Array.isArray(message.service))
|
19237 | return "service: array expected";
|
19238 | for (var i = 0; i < message.service.length; ++i) {
|
19239 | var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]);
|
19240 | if (error)
|
19241 | return "service." + error;
|
19242 | }
|
19243 | }
|
19244 | if (message.extension != null && message.hasOwnProperty("extension")) {
|
19245 | if (!Array.isArray(message.extension))
|
19246 | return "extension: array expected";
|
19247 | for (var i = 0; i < message.extension.length; ++i) {
|
19248 | var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]);
|
19249 | if (error)
|
19250 | return "extension." + error;
|
19251 | }
|
19252 | }
|
19253 | if (message.options != null && message.hasOwnProperty("options")) {
|
19254 | var error = $root.google.protobuf.FileOptions.verify(message.options);
|
19255 | if (error)
|
19256 | return "options." + error;
|
19257 | }
|
19258 | if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) {
|
19259 | var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo);
|
19260 | if (error)
|
19261 | return "sourceCodeInfo." + error;
|
19262 | }
|
19263 | if (message.syntax != null && message.hasOwnProperty("syntax"))
|
19264 | if (!$util.isString(message.syntax))
|
19265 | return "syntax: string expected";
|
19266 | return null;
|
19267 | };
|
19268 |
|
19269 | /**
|
19270 | * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types.
|
19271 | * @function fromObject
|
19272 | * @memberof google.protobuf.FileDescriptorProto
|
19273 | * @static
|
19274 | * @param {Object.<string,*>} object Plain object
|
19275 | * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto
|
19276 | */
|
19277 | FileDescriptorProto.fromObject = function fromObject(object) {
|
19278 | if (object instanceof $root.google.protobuf.FileDescriptorProto)
|
19279 | return object;
|
19280 | var message = new $root.google.protobuf.FileDescriptorProto();
|
19281 | if (object.name != null)
|
19282 | message.name = String(object.name);
|
19283 | if (object["package"] != null)
|
19284 | message["package"] = String(object["package"]);
|
19285 | if (object.dependency) {
|
19286 | if (!Array.isArray(object.dependency))
|
19287 | throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected");
|
19288 | message.dependency = [];
|
19289 | for (var i = 0; i < object.dependency.length; ++i)
|
19290 | message.dependency[i] = String(object.dependency[i]);
|
19291 | }
|
19292 | if (object.publicDependency) {
|
19293 | if (!Array.isArray(object.publicDependency))
|
19294 | throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected");
|
19295 | message.publicDependency = [];
|
19296 | for (var i = 0; i < object.publicDependency.length; ++i)
|
19297 | message.publicDependency[i] = object.publicDependency[i] | 0;
|
19298 | }
|
19299 | if (object.weakDependency) {
|
19300 | if (!Array.isArray(object.weakDependency))
|
19301 | throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected");
|
19302 | message.weakDependency = [];
|
19303 | for (var i = 0; i < object.weakDependency.length; ++i)
|
19304 | message.weakDependency[i] = object.weakDependency[i] | 0;
|
19305 | }
|
19306 | if (object.messageType) {
|
19307 | if (!Array.isArray(object.messageType))
|
19308 | throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected");
|
19309 | message.messageType = [];
|
19310 | for (var i = 0; i < object.messageType.length; ++i) {
|
19311 | if (typeof object.messageType[i] !== "object")
|
19312 | throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected");
|
19313 | message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]);
|
19314 | }
|
19315 | }
|
19316 | if (object.enumType) {
|
19317 | if (!Array.isArray(object.enumType))
|
19318 | throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected");
|
19319 | message.enumType = [];
|
19320 | for (var i = 0; i < object.enumType.length; ++i) {
|
19321 | if (typeof object.enumType[i] !== "object")
|
19322 | throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected");
|
19323 | message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]);
|
19324 | }
|
19325 | }
|
19326 | if (object.service) {
|
19327 | if (!Array.isArray(object.service))
|
19328 | throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected");
|
19329 | message.service = [];
|
19330 | for (var i = 0; i < object.service.length; ++i) {
|
19331 | if (typeof object.service[i] !== "object")
|
19332 | throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected");
|
19333 | message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]);
|
19334 | }
|
19335 | }
|
19336 | if (object.extension) {
|
19337 | if (!Array.isArray(object.extension))
|
19338 | throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected");
|
19339 | message.extension = [];
|
19340 | for (var i = 0; i < object.extension.length; ++i) {
|
19341 | if (typeof object.extension[i] !== "object")
|
19342 | throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected");
|
19343 | message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]);
|
19344 | }
|
19345 | }
|
19346 | if (object.options != null) {
|
19347 | if (typeof object.options !== "object")
|
19348 | throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected");
|
19349 | message.options = $root.google.protobuf.FileOptions.fromObject(object.options);
|
19350 | }
|
19351 | if (object.sourceCodeInfo != null) {
|
19352 | if (typeof object.sourceCodeInfo !== "object")
|
19353 | throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected");
|
19354 | message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo);
|
19355 | }
|
19356 | if (object.syntax != null)
|
19357 | message.syntax = String(object.syntax);
|
19358 | return message;
|
19359 | };
|
19360 |
|
19361 | /**
|
19362 | * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified.
|
19363 | * @function toObject
|
19364 | * @memberof google.protobuf.FileDescriptorProto
|
19365 | * @static
|
19366 | * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto
|
19367 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
19368 | * @returns {Object.<string,*>} Plain object
|
19369 | */
|
19370 | FileDescriptorProto.toObject = function toObject(message, options) {
|
19371 | if (!options)
|
19372 | options = {};
|
19373 | var object = {};
|
19374 | if (options.arrays || options.defaults) {
|
19375 | object.dependency = [];
|
19376 | object.messageType = [];
|
19377 | object.enumType = [];
|
19378 | object.service = [];
|
19379 | object.extension = [];
|
19380 | object.publicDependency = [];
|
19381 | object.weakDependency = [];
|
19382 | }
|
19383 | if (options.defaults) {
|
19384 | object.name = "";
|
19385 | object["package"] = "";
|
19386 | object.options = null;
|
19387 | object.sourceCodeInfo = null;
|
19388 | object.syntax = "";
|
19389 | }
|
19390 | if (message.name != null && message.hasOwnProperty("name"))
|
19391 | object.name = message.name;
|
19392 | if (message["package"] != null && message.hasOwnProperty("package"))
|
19393 | object["package"] = message["package"];
|
19394 | if (message.dependency && message.dependency.length) {
|
19395 | object.dependency = [];
|
19396 | for (var j = 0; j < message.dependency.length; ++j)
|
19397 | object.dependency[j] = message.dependency[j];
|
19398 | }
|
19399 | if (message.messageType && message.messageType.length) {
|
19400 | object.messageType = [];
|
19401 | for (var j = 0; j < message.messageType.length; ++j)
|
19402 | object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options);
|
19403 | }
|
19404 | if (message.enumType && message.enumType.length) {
|
19405 | object.enumType = [];
|
19406 | for (var j = 0; j < message.enumType.length; ++j)
|
19407 | object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options);
|
19408 | }
|
19409 | if (message.service && message.service.length) {
|
19410 | object.service = [];
|
19411 | for (var j = 0; j < message.service.length; ++j)
|
19412 | object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options);
|
19413 | }
|
19414 | if (message.extension && message.extension.length) {
|
19415 | object.extension = [];
|
19416 | for (var j = 0; j < message.extension.length; ++j)
|
19417 | object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options);
|
19418 | }
|
19419 | if (message.options != null && message.hasOwnProperty("options"))
|
19420 | object.options = $root.google.protobuf.FileOptions.toObject(message.options, options);
|
19421 | if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo"))
|
19422 | object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options);
|
19423 | if (message.publicDependency && message.publicDependency.length) {
|
19424 | object.publicDependency = [];
|
19425 | for (var j = 0; j < message.publicDependency.length; ++j)
|
19426 | object.publicDependency[j] = message.publicDependency[j];
|
19427 | }
|
19428 | if (message.weakDependency && message.weakDependency.length) {
|
19429 | object.weakDependency = [];
|
19430 | for (var j = 0; j < message.weakDependency.length; ++j)
|
19431 | object.weakDependency[j] = message.weakDependency[j];
|
19432 | }
|
19433 | if (message.syntax != null && message.hasOwnProperty("syntax"))
|
19434 | object.syntax = message.syntax;
|
19435 | return object;
|
19436 | };
|
19437 |
|
19438 | /**
|
19439 | * Converts this FileDescriptorProto to JSON.
|
19440 | * @function toJSON
|
19441 | * @memberof google.protobuf.FileDescriptorProto
|
19442 | * @instance
|
19443 | * @returns {Object.<string,*>} JSON object
|
19444 | */
|
19445 | FileDescriptorProto.prototype.toJSON = function toJSON() {
|
19446 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
19447 | };
|
19448 |
|
19449 | return FileDescriptorProto;
|
19450 | })();
|
19451 |
|
19452 | protobuf.DescriptorProto = (function() {
|
19453 |
|
19454 | /**
|
19455 | * Properties of a DescriptorProto.
|
19456 | * @memberof google.protobuf
|
19457 | * @interface IDescriptorProto
|
19458 | * @property {string|null} [name] DescriptorProto name
|
19459 | * @property {Array.<google.protobuf.IFieldDescriptorProto>|null} [field] DescriptorProto field
|
19460 | * @property {Array.<google.protobuf.IFieldDescriptorProto>|null} [extension] DescriptorProto extension
|
19461 | * @property {Array.<google.protobuf.IDescriptorProto>|null} [nestedType] DescriptorProto nestedType
|
19462 | * @property {Array.<google.protobuf.IEnumDescriptorProto>|null} [enumType] DescriptorProto enumType
|
19463 | * @property {Array.<google.protobuf.DescriptorProto.IExtensionRange>|null} [extensionRange] DescriptorProto extensionRange
|
19464 | * @property {Array.<google.protobuf.IOneofDescriptorProto>|null} [oneofDecl] DescriptorProto oneofDecl
|
19465 | * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options
|
19466 | * @property {Array.<google.protobuf.DescriptorProto.IReservedRange>|null} [reservedRange] DescriptorProto reservedRange
|
19467 | * @property {Array.<string>|null} [reservedName] DescriptorProto reservedName
|
19468 | */
|
19469 |
|
19470 | /**
|
19471 | * Constructs a new DescriptorProto.
|
19472 | * @memberof google.protobuf
|
19473 | * @classdesc Represents a DescriptorProto.
|
19474 | * @implements IDescriptorProto
|
19475 | * @constructor
|
19476 | * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set
|
19477 | */
|
19478 | function DescriptorProto(properties) {
|
19479 | this.field = [];
|
19480 | this.extension = [];
|
19481 | this.nestedType = [];
|
19482 | this.enumType = [];
|
19483 | this.extensionRange = [];
|
19484 | this.oneofDecl = [];
|
19485 | this.reservedRange = [];
|
19486 | this.reservedName = [];
|
19487 | if (properties)
|
19488 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
19489 | if (properties[keys[i]] != null)
|
19490 | this[keys[i]] = properties[keys[i]];
|
19491 | }
|
19492 |
|
19493 | /**
|
19494 | * DescriptorProto name.
|
19495 | * @member {string} name
|
19496 | * @memberof google.protobuf.DescriptorProto
|
19497 | * @instance
|
19498 | */
|
19499 | DescriptorProto.prototype.name = "";
|
19500 |
|
19501 | /**
|
19502 | * DescriptorProto field.
|
19503 | * @member {Array.<google.protobuf.IFieldDescriptorProto>} field
|
19504 | * @memberof google.protobuf.DescriptorProto
|
19505 | * @instance
|
19506 | */
|
19507 | DescriptorProto.prototype.field = $util.emptyArray;
|
19508 |
|
19509 | /**
|
19510 | * DescriptorProto extension.
|
19511 | * @member {Array.<google.protobuf.IFieldDescriptorProto>} extension
|
19512 | * @memberof google.protobuf.DescriptorProto
|
19513 | * @instance
|
19514 | */
|
19515 | DescriptorProto.prototype.extension = $util.emptyArray;
|
19516 |
|
19517 | /**
|
19518 | * DescriptorProto nestedType.
|
19519 | * @member {Array.<google.protobuf.IDescriptorProto>} nestedType
|
19520 | * @memberof google.protobuf.DescriptorProto
|
19521 | * @instance
|
19522 | */
|
19523 | DescriptorProto.prototype.nestedType = $util.emptyArray;
|
19524 |
|
19525 | /**
|
19526 | * DescriptorProto enumType.
|
19527 | * @member {Array.<google.protobuf.IEnumDescriptorProto>} enumType
|
19528 | * @memberof google.protobuf.DescriptorProto
|
19529 | * @instance
|
19530 | */
|
19531 | DescriptorProto.prototype.enumType = $util.emptyArray;
|
19532 |
|
19533 | /**
|
19534 | * DescriptorProto extensionRange.
|
19535 | * @member {Array.<google.protobuf.DescriptorProto.IExtensionRange>} extensionRange
|
19536 | * @memberof google.protobuf.DescriptorProto
|
19537 | * @instance
|
19538 | */
|
19539 | DescriptorProto.prototype.extensionRange = $util.emptyArray;
|
19540 |
|
19541 | /**
|
19542 | * DescriptorProto oneofDecl.
|
19543 | * @member {Array.<google.protobuf.IOneofDescriptorProto>} oneofDecl
|
19544 | * @memberof google.protobuf.DescriptorProto
|
19545 | * @instance
|
19546 | */
|
19547 | DescriptorProto.prototype.oneofDecl = $util.emptyArray;
|
19548 |
|
19549 | /**
|
19550 | * DescriptorProto options.
|
19551 | * @member {google.protobuf.IMessageOptions|null|undefined} options
|
19552 | * @memberof google.protobuf.DescriptorProto
|
19553 | * @instance
|
19554 | */
|
19555 | DescriptorProto.prototype.options = null;
|
19556 |
|
19557 | /**
|
19558 | * DescriptorProto reservedRange.
|
19559 | * @member {Array.<google.protobuf.DescriptorProto.IReservedRange>} reservedRange
|
19560 | * @memberof google.protobuf.DescriptorProto
|
19561 | * @instance
|
19562 | */
|
19563 | DescriptorProto.prototype.reservedRange = $util.emptyArray;
|
19564 |
|
19565 | /**
|
19566 | * DescriptorProto reservedName.
|
19567 | * @member {Array.<string>} reservedName
|
19568 | * @memberof google.protobuf.DescriptorProto
|
19569 | * @instance
|
19570 | */
|
19571 | DescriptorProto.prototype.reservedName = $util.emptyArray;
|
19572 |
|
19573 | /**
|
19574 | * Creates a new DescriptorProto instance using the specified properties.
|
19575 | * @function create
|
19576 | * @memberof google.protobuf.DescriptorProto
|
19577 | * @static
|
19578 | * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set
|
19579 | * @returns {google.protobuf.DescriptorProto} DescriptorProto instance
|
19580 | */
|
19581 | DescriptorProto.create = function create(properties) {
|
19582 | return new DescriptorProto(properties);
|
19583 | };
|
19584 |
|
19585 | /**
|
19586 | * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages.
|
19587 | * @function encode
|
19588 | * @memberof google.protobuf.DescriptorProto
|
19589 | * @static
|
19590 | * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode
|
19591 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
19592 | * @returns {$protobuf.Writer} Writer
|
19593 | */
|
19594 | DescriptorProto.encode = function encode(message, writer) {
|
19595 | if (!writer)
|
19596 | writer = $Writer.create();
|
19597 | if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
19598 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
|
19599 | if (message.field != null && message.field.length)
|
19600 | for (var i = 0; i < message.field.length; ++i)
|
19601 | $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
19602 | if (message.nestedType != null && message.nestedType.length)
|
19603 | for (var i = 0; i < message.nestedType.length; ++i)
|
19604 | $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
|
19605 | if (message.enumType != null && message.enumType.length)
|
19606 | for (var i = 0; i < message.enumType.length; ++i)
|
19607 | $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
|
19608 | if (message.extensionRange != null && message.extensionRange.length)
|
19609 | for (var i = 0; i < message.extensionRange.length; ++i)
|
19610 | $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
|
19611 | if (message.extension != null && message.extension.length)
|
19612 | for (var i = 0; i < message.extension.length; ++i)
|
19613 | $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
|
19614 | if (message.options != null && Object.hasOwnProperty.call(message, "options"))
|
19615 | $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();
|
19616 | if (message.oneofDecl != null && message.oneofDecl.length)
|
19617 | for (var i = 0; i < message.oneofDecl.length; ++i)
|
19618 | $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();
|
19619 | if (message.reservedRange != null && message.reservedRange.length)
|
19620 | for (var i = 0; i < message.reservedRange.length; ++i)
|
19621 | $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim();
|
19622 | if (message.reservedName != null && message.reservedName.length)
|
19623 | for (var i = 0; i < message.reservedName.length; ++i)
|
19624 | writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]);
|
19625 | return writer;
|
19626 | };
|
19627 |
|
19628 | /**
|
19629 | * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages.
|
19630 | * @function encodeDelimited
|
19631 | * @memberof google.protobuf.DescriptorProto
|
19632 | * @static
|
19633 | * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode
|
19634 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
19635 | * @returns {$protobuf.Writer} Writer
|
19636 | */
|
19637 | DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) {
|
19638 | return this.encode(message, writer).ldelim();
|
19639 | };
|
19640 |
|
19641 | /**
|
19642 | * Decodes a DescriptorProto message from the specified reader or buffer.
|
19643 | * @function decode
|
19644 | * @memberof google.protobuf.DescriptorProto
|
19645 | * @static
|
19646 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
19647 | * @param {number} [length] Message length if known beforehand
|
19648 | * @returns {google.protobuf.DescriptorProto} DescriptorProto
|
19649 | * @throws {Error} If the payload is not a reader or valid buffer
|
19650 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
19651 | */
|
19652 | DescriptorProto.decode = function decode(reader, length) {
|
19653 | if (!(reader instanceof $Reader))
|
19654 | reader = $Reader.create(reader);
|
19655 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto();
|
19656 | while (reader.pos < end) {
|
19657 | var tag = reader.uint32();
|
19658 | switch (tag >>> 3) {
|
19659 | case 1:
|
19660 | message.name = reader.string();
|
19661 | break;
|
19662 | case 2:
|
19663 | if (!(message.field && message.field.length))
|
19664 | message.field = [];
|
19665 | message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32()));
|
19666 | break;
|
19667 | case 6:
|
19668 | if (!(message.extension && message.extension.length))
|
19669 | message.extension = [];
|
19670 | message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32()));
|
19671 | break;
|
19672 | case 3:
|
19673 | if (!(message.nestedType && message.nestedType.length))
|
19674 | message.nestedType = [];
|
19675 | message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32()));
|
19676 | break;
|
19677 | case 4:
|
19678 | if (!(message.enumType && message.enumType.length))
|
19679 | message.enumType = [];
|
19680 | message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32()));
|
19681 | break;
|
19682 | case 5:
|
19683 | if (!(message.extensionRange && message.extensionRange.length))
|
19684 | message.extensionRange = [];
|
19685 | message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32()));
|
19686 | break;
|
19687 | case 8:
|
19688 | if (!(message.oneofDecl && message.oneofDecl.length))
|
19689 | message.oneofDecl = [];
|
19690 | message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32()));
|
19691 | break;
|
19692 | case 7:
|
19693 | message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32());
|
19694 | break;
|
19695 | case 9:
|
19696 | if (!(message.reservedRange && message.reservedRange.length))
|
19697 | message.reservedRange = [];
|
19698 | message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32()));
|
19699 | break;
|
19700 | case 10:
|
19701 | if (!(message.reservedName && message.reservedName.length))
|
19702 | message.reservedName = [];
|
19703 | message.reservedName.push(reader.string());
|
19704 | break;
|
19705 | default:
|
19706 | reader.skipType(tag & 7);
|
19707 | break;
|
19708 | }
|
19709 | }
|
19710 | return message;
|
19711 | };
|
19712 |
|
19713 | /**
|
19714 | * Decodes a DescriptorProto message from the specified reader or buffer, length delimited.
|
19715 | * @function decodeDelimited
|
19716 | * @memberof google.protobuf.DescriptorProto
|
19717 | * @static
|
19718 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
19719 | * @returns {google.protobuf.DescriptorProto} DescriptorProto
|
19720 | * @throws {Error} If the payload is not a reader or valid buffer
|
19721 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
19722 | */
|
19723 | DescriptorProto.decodeDelimited = function decodeDelimited(reader) {
|
19724 | if (!(reader instanceof $Reader))
|
19725 | reader = new $Reader(reader);
|
19726 | return this.decode(reader, reader.uint32());
|
19727 | };
|
19728 |
|
19729 | /**
|
19730 | * Verifies a DescriptorProto message.
|
19731 | * @function verify
|
19732 | * @memberof google.protobuf.DescriptorProto
|
19733 | * @static
|
19734 | * @param {Object.<string,*>} message Plain object to verify
|
19735 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
19736 | */
|
19737 | DescriptorProto.verify = function verify(message) {
|
19738 | if (typeof message !== "object" || message === null)
|
19739 | return "object expected";
|
19740 | if (message.name != null && message.hasOwnProperty("name"))
|
19741 | if (!$util.isString(message.name))
|
19742 | return "name: string expected";
|
19743 | if (message.field != null && message.hasOwnProperty("field")) {
|
19744 | if (!Array.isArray(message.field))
|
19745 | return "field: array expected";
|
19746 | for (var i = 0; i < message.field.length; ++i) {
|
19747 | var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]);
|
19748 | if (error)
|
19749 | return "field." + error;
|
19750 | }
|
19751 | }
|
19752 | if (message.extension != null && message.hasOwnProperty("extension")) {
|
19753 | if (!Array.isArray(message.extension))
|
19754 | return "extension: array expected";
|
19755 | for (var i = 0; i < message.extension.length; ++i) {
|
19756 | var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]);
|
19757 | if (error)
|
19758 | return "extension." + error;
|
19759 | }
|
19760 | }
|
19761 | if (message.nestedType != null && message.hasOwnProperty("nestedType")) {
|
19762 | if (!Array.isArray(message.nestedType))
|
19763 | return "nestedType: array expected";
|
19764 | for (var i = 0; i < message.nestedType.length; ++i) {
|
19765 | var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]);
|
19766 | if (error)
|
19767 | return "nestedType." + error;
|
19768 | }
|
19769 | }
|
19770 | if (message.enumType != null && message.hasOwnProperty("enumType")) {
|
19771 | if (!Array.isArray(message.enumType))
|
19772 | return "enumType: array expected";
|
19773 | for (var i = 0; i < message.enumType.length; ++i) {
|
19774 | var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]);
|
19775 | if (error)
|
19776 | return "enumType." + error;
|
19777 | }
|
19778 | }
|
19779 | if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) {
|
19780 | if (!Array.isArray(message.extensionRange))
|
19781 | return "extensionRange: array expected";
|
19782 | for (var i = 0; i < message.extensionRange.length; ++i) {
|
19783 | var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]);
|
19784 | if (error)
|
19785 | return "extensionRange." + error;
|
19786 | }
|
19787 | }
|
19788 | if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) {
|
19789 | if (!Array.isArray(message.oneofDecl))
|
19790 | return "oneofDecl: array expected";
|
19791 | for (var i = 0; i < message.oneofDecl.length; ++i) {
|
19792 | var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]);
|
19793 | if (error)
|
19794 | return "oneofDecl." + error;
|
19795 | }
|
19796 | }
|
19797 | if (message.options != null && message.hasOwnProperty("options")) {
|
19798 | var error = $root.google.protobuf.MessageOptions.verify(message.options);
|
19799 | if (error)
|
19800 | return "options." + error;
|
19801 | }
|
19802 | if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) {
|
19803 | if (!Array.isArray(message.reservedRange))
|
19804 | return "reservedRange: array expected";
|
19805 | for (var i = 0; i < message.reservedRange.length; ++i) {
|
19806 | var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]);
|
19807 | if (error)
|
19808 | return "reservedRange." + error;
|
19809 | }
|
19810 | }
|
19811 | if (message.reservedName != null && message.hasOwnProperty("reservedName")) {
|
19812 | if (!Array.isArray(message.reservedName))
|
19813 | return "reservedName: array expected";
|
19814 | for (var i = 0; i < message.reservedName.length; ++i)
|
19815 | if (!$util.isString(message.reservedName[i]))
|
19816 | return "reservedName: string[] expected";
|
19817 | }
|
19818 | return null;
|
19819 | };
|
19820 |
|
19821 | /**
|
19822 | * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types.
|
19823 | * @function fromObject
|
19824 | * @memberof google.protobuf.DescriptorProto
|
19825 | * @static
|
19826 | * @param {Object.<string,*>} object Plain object
|
19827 | * @returns {google.protobuf.DescriptorProto} DescriptorProto
|
19828 | */
|
19829 | DescriptorProto.fromObject = function fromObject(object) {
|
19830 | if (object instanceof $root.google.protobuf.DescriptorProto)
|
19831 | return object;
|
19832 | var message = new $root.google.protobuf.DescriptorProto();
|
19833 | if (object.name != null)
|
19834 | message.name = String(object.name);
|
19835 | if (object.field) {
|
19836 | if (!Array.isArray(object.field))
|
19837 | throw TypeError(".google.protobuf.DescriptorProto.field: array expected");
|
19838 | message.field = [];
|
19839 | for (var i = 0; i < object.field.length; ++i) {
|
19840 | if (typeof object.field[i] !== "object")
|
19841 | throw TypeError(".google.protobuf.DescriptorProto.field: object expected");
|
19842 | message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]);
|
19843 | }
|
19844 | }
|
19845 | if (object.extension) {
|
19846 | if (!Array.isArray(object.extension))
|
19847 | throw TypeError(".google.protobuf.DescriptorProto.extension: array expected");
|
19848 | message.extension = [];
|
19849 | for (var i = 0; i < object.extension.length; ++i) {
|
19850 | if (typeof object.extension[i] !== "object")
|
19851 | throw TypeError(".google.protobuf.DescriptorProto.extension: object expected");
|
19852 | message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]);
|
19853 | }
|
19854 | }
|
19855 | if (object.nestedType) {
|
19856 | if (!Array.isArray(object.nestedType))
|
19857 | throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected");
|
19858 | message.nestedType = [];
|
19859 | for (var i = 0; i < object.nestedType.length; ++i) {
|
19860 | if (typeof object.nestedType[i] !== "object")
|
19861 | throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected");
|
19862 | message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]);
|
19863 | }
|
19864 | }
|
19865 | if (object.enumType) {
|
19866 | if (!Array.isArray(object.enumType))
|
19867 | throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected");
|
19868 | message.enumType = [];
|
19869 | for (var i = 0; i < object.enumType.length; ++i) {
|
19870 | if (typeof object.enumType[i] !== "object")
|
19871 | throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected");
|
19872 | message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]);
|
19873 | }
|
19874 | }
|
19875 | if (object.extensionRange) {
|
19876 | if (!Array.isArray(object.extensionRange))
|
19877 | throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected");
|
19878 | message.extensionRange = [];
|
19879 | for (var i = 0; i < object.extensionRange.length; ++i) {
|
19880 | if (typeof object.extensionRange[i] !== "object")
|
19881 | throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected");
|
19882 | message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]);
|
19883 | }
|
19884 | }
|
19885 | if (object.oneofDecl) {
|
19886 | if (!Array.isArray(object.oneofDecl))
|
19887 | throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected");
|
19888 | message.oneofDecl = [];
|
19889 | for (var i = 0; i < object.oneofDecl.length; ++i) {
|
19890 | if (typeof object.oneofDecl[i] !== "object")
|
19891 | throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected");
|
19892 | message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]);
|
19893 | }
|
19894 | }
|
19895 | if (object.options != null) {
|
19896 | if (typeof object.options !== "object")
|
19897 | throw TypeError(".google.protobuf.DescriptorProto.options: object expected");
|
19898 | message.options = $root.google.protobuf.MessageOptions.fromObject(object.options);
|
19899 | }
|
19900 | if (object.reservedRange) {
|
19901 | if (!Array.isArray(object.reservedRange))
|
19902 | throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected");
|
19903 | message.reservedRange = [];
|
19904 | for (var i = 0; i < object.reservedRange.length; ++i) {
|
19905 | if (typeof object.reservedRange[i] !== "object")
|
19906 | throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected");
|
19907 | message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]);
|
19908 | }
|
19909 | }
|
19910 | if (object.reservedName) {
|
19911 | if (!Array.isArray(object.reservedName))
|
19912 | throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected");
|
19913 | message.reservedName = [];
|
19914 | for (var i = 0; i < object.reservedName.length; ++i)
|
19915 | message.reservedName[i] = String(object.reservedName[i]);
|
19916 | }
|
19917 | return message;
|
19918 | };
|
19919 |
|
19920 | /**
|
19921 | * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified.
|
19922 | * @function toObject
|
19923 | * @memberof google.protobuf.DescriptorProto
|
19924 | * @static
|
19925 | * @param {google.protobuf.DescriptorProto} message DescriptorProto
|
19926 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
19927 | * @returns {Object.<string,*>} Plain object
|
19928 | */
|
19929 | DescriptorProto.toObject = function toObject(message, options) {
|
19930 | if (!options)
|
19931 | options = {};
|
19932 | var object = {};
|
19933 | if (options.arrays || options.defaults) {
|
19934 | object.field = [];
|
19935 | object.nestedType = [];
|
19936 | object.enumType = [];
|
19937 | object.extensionRange = [];
|
19938 | object.extension = [];
|
19939 | object.oneofDecl = [];
|
19940 | object.reservedRange = [];
|
19941 | object.reservedName = [];
|
19942 | }
|
19943 | if (options.defaults) {
|
19944 | object.name = "";
|
19945 | object.options = null;
|
19946 | }
|
19947 | if (message.name != null && message.hasOwnProperty("name"))
|
19948 | object.name = message.name;
|
19949 | if (message.field && message.field.length) {
|
19950 | object.field = [];
|
19951 | for (var j = 0; j < message.field.length; ++j)
|
19952 | object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options);
|
19953 | }
|
19954 | if (message.nestedType && message.nestedType.length) {
|
19955 | object.nestedType = [];
|
19956 | for (var j = 0; j < message.nestedType.length; ++j)
|
19957 | object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options);
|
19958 | }
|
19959 | if (message.enumType && message.enumType.length) {
|
19960 | object.enumType = [];
|
19961 | for (var j = 0; j < message.enumType.length; ++j)
|
19962 | object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options);
|
19963 | }
|
19964 | if (message.extensionRange && message.extensionRange.length) {
|
19965 | object.extensionRange = [];
|
19966 | for (var j = 0; j < message.extensionRange.length; ++j)
|
19967 | object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options);
|
19968 | }
|
19969 | if (message.extension && message.extension.length) {
|
19970 | object.extension = [];
|
19971 | for (var j = 0; j < message.extension.length; ++j)
|
19972 | object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options);
|
19973 | }
|
19974 | if (message.options != null && message.hasOwnProperty("options"))
|
19975 | object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options);
|
19976 | if (message.oneofDecl && message.oneofDecl.length) {
|
19977 | object.oneofDecl = [];
|
19978 | for (var j = 0; j < message.oneofDecl.length; ++j)
|
19979 | object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options);
|
19980 | }
|
19981 | if (message.reservedRange && message.reservedRange.length) {
|
19982 | object.reservedRange = [];
|
19983 | for (var j = 0; j < message.reservedRange.length; ++j)
|
19984 | object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options);
|
19985 | }
|
19986 | if (message.reservedName && message.reservedName.length) {
|
19987 | object.reservedName = [];
|
19988 | for (var j = 0; j < message.reservedName.length; ++j)
|
19989 | object.reservedName[j] = message.reservedName[j];
|
19990 | }
|
19991 | return object;
|
19992 | };
|
19993 |
|
19994 | /**
|
19995 | * Converts this DescriptorProto to JSON.
|
19996 | * @function toJSON
|
19997 | * @memberof google.protobuf.DescriptorProto
|
19998 | * @instance
|
19999 | * @returns {Object.<string,*>} JSON object
|
20000 | */
|
20001 | DescriptorProto.prototype.toJSON = function toJSON() {
|
20002 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
20003 | };
|
20004 |
|
20005 | DescriptorProto.ExtensionRange = (function() {
|
20006 |
|
20007 | /**
|
20008 | * Properties of an ExtensionRange.
|
20009 | * @memberof google.protobuf.DescriptorProto
|
20010 | * @interface IExtensionRange
|
20011 | * @property {number|null} [start] ExtensionRange start
|
20012 | * @property {number|null} [end] ExtensionRange end
|
20013 | * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options
|
20014 | */
|
20015 |
|
20016 | /**
|
20017 | * Constructs a new ExtensionRange.
|
20018 | * @memberof google.protobuf.DescriptorProto
|
20019 | * @classdesc Represents an ExtensionRange.
|
20020 | * @implements IExtensionRange
|
20021 | * @constructor
|
20022 | * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set
|
20023 | */
|
20024 | function ExtensionRange(properties) {
|
20025 | if (properties)
|
20026 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
20027 | if (properties[keys[i]] != null)
|
20028 | this[keys[i]] = properties[keys[i]];
|
20029 | }
|
20030 |
|
20031 | /**
|
20032 | * ExtensionRange start.
|
20033 | * @member {number} start
|
20034 | * @memberof google.protobuf.DescriptorProto.ExtensionRange
|
20035 | * @instance
|
20036 | */
|
20037 | ExtensionRange.prototype.start = 0;
|
20038 |
|
20039 | /**
|
20040 | * ExtensionRange end.
|
20041 | * @member {number} end
|
20042 | * @memberof google.protobuf.DescriptorProto.ExtensionRange
|
20043 | * @instance
|
20044 | */
|
20045 | ExtensionRange.prototype.end = 0;
|
20046 |
|
20047 | /**
|
20048 | * ExtensionRange options.
|
20049 | * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options
|
20050 | * @memberof google.protobuf.DescriptorProto.ExtensionRange
|
20051 | * @instance
|
20052 | */
|
20053 | ExtensionRange.prototype.options = null;
|
20054 |
|
20055 | /**
|
20056 | * Creates a new ExtensionRange instance using the specified properties.
|
20057 | * @function create
|
20058 | * @memberof google.protobuf.DescriptorProto.ExtensionRange
|
20059 | * @static
|
20060 | * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set
|
20061 | * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance
|
20062 | */
|
20063 | ExtensionRange.create = function create(properties) {
|
20064 | return new ExtensionRange(properties);
|
20065 | };
|
20066 |
|
20067 | /**
|
20068 | * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages.
|
20069 | * @function encode
|
20070 | * @memberof google.protobuf.DescriptorProto.ExtensionRange
|
20071 | * @static
|
20072 | * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode
|
20073 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
20074 | * @returns {$protobuf.Writer} Writer
|
20075 | */
|
20076 | ExtensionRange.encode = function encode(message, writer) {
|
20077 | if (!writer)
|
20078 | writer = $Writer.create();
|
20079 | if (message.start != null && Object.hasOwnProperty.call(message, "start"))
|
20080 | writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start);
|
20081 | if (message.end != null && Object.hasOwnProperty.call(message, "end"))
|
20082 | writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end);
|
20083 | if (message.options != null && Object.hasOwnProperty.call(message, "options"))
|
20084 | $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
|
20085 | return writer;
|
20086 | };
|
20087 |
|
20088 | /**
|
20089 | * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages.
|
20090 | * @function encodeDelimited
|
20091 | * @memberof google.protobuf.DescriptorProto.ExtensionRange
|
20092 | * @static
|
20093 | * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode
|
20094 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
20095 | * @returns {$protobuf.Writer} Writer
|
20096 | */
|
20097 | ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) {
|
20098 | return this.encode(message, writer).ldelim();
|
20099 | };
|
20100 |
|
20101 | /**
|
20102 | * Decodes an ExtensionRange message from the specified reader or buffer.
|
20103 | * @function decode
|
20104 | * @memberof google.protobuf.DescriptorProto.ExtensionRange
|
20105 | * @static
|
20106 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
20107 | * @param {number} [length] Message length if known beforehand
|
20108 | * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange
|
20109 | * @throws {Error} If the payload is not a reader or valid buffer
|
20110 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
20111 | */
|
20112 | ExtensionRange.decode = function decode(reader, length) {
|
20113 | if (!(reader instanceof $Reader))
|
20114 | reader = $Reader.create(reader);
|
20115 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange();
|
20116 | while (reader.pos < end) {
|
20117 | var tag = reader.uint32();
|
20118 | switch (tag >>> 3) {
|
20119 | case 1:
|
20120 | message.start = reader.int32();
|
20121 | break;
|
20122 | case 2:
|
20123 | message.end = reader.int32();
|
20124 | break;
|
20125 | case 3:
|
20126 | message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32());
|
20127 | break;
|
20128 | default:
|
20129 | reader.skipType(tag & 7);
|
20130 | break;
|
20131 | }
|
20132 | }
|
20133 | return message;
|
20134 | };
|
20135 |
|
20136 | /**
|
20137 | * Decodes an ExtensionRange message from the specified reader or buffer, length delimited.
|
20138 | * @function decodeDelimited
|
20139 | * @memberof google.protobuf.DescriptorProto.ExtensionRange
|
20140 | * @static
|
20141 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
20142 | * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange
|
20143 | * @throws {Error} If the payload is not a reader or valid buffer
|
20144 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
20145 | */
|
20146 | ExtensionRange.decodeDelimited = function decodeDelimited(reader) {
|
20147 | if (!(reader instanceof $Reader))
|
20148 | reader = new $Reader(reader);
|
20149 | return this.decode(reader, reader.uint32());
|
20150 | };
|
20151 |
|
20152 | /**
|
20153 | * Verifies an ExtensionRange message.
|
20154 | * @function verify
|
20155 | * @memberof google.protobuf.DescriptorProto.ExtensionRange
|
20156 | * @static
|
20157 | * @param {Object.<string,*>} message Plain object to verify
|
20158 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
20159 | */
|
20160 | ExtensionRange.verify = function verify(message) {
|
20161 | if (typeof message !== "object" || message === null)
|
20162 | return "object expected";
|
20163 | if (message.start != null && message.hasOwnProperty("start"))
|
20164 | if (!$util.isInteger(message.start))
|
20165 | return "start: integer expected";
|
20166 | if (message.end != null && message.hasOwnProperty("end"))
|
20167 | if (!$util.isInteger(message.end))
|
20168 | return "end: integer expected";
|
20169 | if (message.options != null && message.hasOwnProperty("options")) {
|
20170 | var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options);
|
20171 | if (error)
|
20172 | return "options." + error;
|
20173 | }
|
20174 | return null;
|
20175 | };
|
20176 |
|
20177 | /**
|
20178 | * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types.
|
20179 | * @function fromObject
|
20180 | * @memberof google.protobuf.DescriptorProto.ExtensionRange
|
20181 | * @static
|
20182 | * @param {Object.<string,*>} object Plain object
|
20183 | * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange
|
20184 | */
|
20185 | ExtensionRange.fromObject = function fromObject(object) {
|
20186 | if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange)
|
20187 | return object;
|
20188 | var message = new $root.google.protobuf.DescriptorProto.ExtensionRange();
|
20189 | if (object.start != null)
|
20190 | message.start = object.start | 0;
|
20191 | if (object.end != null)
|
20192 | message.end = object.end | 0;
|
20193 | if (object.options != null) {
|
20194 | if (typeof object.options !== "object")
|
20195 | throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected");
|
20196 | message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options);
|
20197 | }
|
20198 | return message;
|
20199 | };
|
20200 |
|
20201 | /**
|
20202 | * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified.
|
20203 | * @function toObject
|
20204 | * @memberof google.protobuf.DescriptorProto.ExtensionRange
|
20205 | * @static
|
20206 | * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange
|
20207 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
20208 | * @returns {Object.<string,*>} Plain object
|
20209 | */
|
20210 | ExtensionRange.toObject = function toObject(message, options) {
|
20211 | if (!options)
|
20212 | options = {};
|
20213 | var object = {};
|
20214 | if (options.defaults) {
|
20215 | object.start = 0;
|
20216 | object.end = 0;
|
20217 | object.options = null;
|
20218 | }
|
20219 | if (message.start != null && message.hasOwnProperty("start"))
|
20220 | object.start = message.start;
|
20221 | if (message.end != null && message.hasOwnProperty("end"))
|
20222 | object.end = message.end;
|
20223 | if (message.options != null && message.hasOwnProperty("options"))
|
20224 | object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options);
|
20225 | return object;
|
20226 | };
|
20227 |
|
20228 | /**
|
20229 | * Converts this ExtensionRange to JSON.
|
20230 | * @function toJSON
|
20231 | * @memberof google.protobuf.DescriptorProto.ExtensionRange
|
20232 | * @instance
|
20233 | * @returns {Object.<string,*>} JSON object
|
20234 | */
|
20235 | ExtensionRange.prototype.toJSON = function toJSON() {
|
20236 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
20237 | };
|
20238 |
|
20239 | return ExtensionRange;
|
20240 | })();
|
20241 |
|
20242 | DescriptorProto.ReservedRange = (function() {
|
20243 |
|
20244 | /**
|
20245 | * Properties of a ReservedRange.
|
20246 | * @memberof google.protobuf.DescriptorProto
|
20247 | * @interface IReservedRange
|
20248 | * @property {number|null} [start] ReservedRange start
|
20249 | * @property {number|null} [end] ReservedRange end
|
20250 | */
|
20251 |
|
20252 | /**
|
20253 | * Constructs a new ReservedRange.
|
20254 | * @memberof google.protobuf.DescriptorProto
|
20255 | * @classdesc Represents a ReservedRange.
|
20256 | * @implements IReservedRange
|
20257 | * @constructor
|
20258 | * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set
|
20259 | */
|
20260 | function ReservedRange(properties) {
|
20261 | if (properties)
|
20262 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
20263 | if (properties[keys[i]] != null)
|
20264 | this[keys[i]] = properties[keys[i]];
|
20265 | }
|
20266 |
|
20267 | /**
|
20268 | * ReservedRange start.
|
20269 | * @member {number} start
|
20270 | * @memberof google.protobuf.DescriptorProto.ReservedRange
|
20271 | * @instance
|
20272 | */
|
20273 | ReservedRange.prototype.start = 0;
|
20274 |
|
20275 | /**
|
20276 | * ReservedRange end.
|
20277 | * @member {number} end
|
20278 | * @memberof google.protobuf.DescriptorProto.ReservedRange
|
20279 | * @instance
|
20280 | */
|
20281 | ReservedRange.prototype.end = 0;
|
20282 |
|
20283 | /**
|
20284 | * Creates a new ReservedRange instance using the specified properties.
|
20285 | * @function create
|
20286 | * @memberof google.protobuf.DescriptorProto.ReservedRange
|
20287 | * @static
|
20288 | * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set
|
20289 | * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance
|
20290 | */
|
20291 | ReservedRange.create = function create(properties) {
|
20292 | return new ReservedRange(properties);
|
20293 | };
|
20294 |
|
20295 | /**
|
20296 | * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages.
|
20297 | * @function encode
|
20298 | * @memberof google.protobuf.DescriptorProto.ReservedRange
|
20299 | * @static
|
20300 | * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode
|
20301 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
20302 | * @returns {$protobuf.Writer} Writer
|
20303 | */
|
20304 | ReservedRange.encode = function encode(message, writer) {
|
20305 | if (!writer)
|
20306 | writer = $Writer.create();
|
20307 | if (message.start != null && Object.hasOwnProperty.call(message, "start"))
|
20308 | writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start);
|
20309 | if (message.end != null && Object.hasOwnProperty.call(message, "end"))
|
20310 | writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end);
|
20311 | return writer;
|
20312 | };
|
20313 |
|
20314 | /**
|
20315 | * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages.
|
20316 | * @function encodeDelimited
|
20317 | * @memberof google.protobuf.DescriptorProto.ReservedRange
|
20318 | * @static
|
20319 | * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode
|
20320 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
20321 | * @returns {$protobuf.Writer} Writer
|
20322 | */
|
20323 | ReservedRange.encodeDelimited = function encodeDelimited(message, writer) {
|
20324 | return this.encode(message, writer).ldelim();
|
20325 | };
|
20326 |
|
20327 | /**
|
20328 | * Decodes a ReservedRange message from the specified reader or buffer.
|
20329 | * @function decode
|
20330 | * @memberof google.protobuf.DescriptorProto.ReservedRange
|
20331 | * @static
|
20332 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
20333 | * @param {number} [length] Message length if known beforehand
|
20334 | * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange
|
20335 | * @throws {Error} If the payload is not a reader or valid buffer
|
20336 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
20337 | */
|
20338 | ReservedRange.decode = function decode(reader, length) {
|
20339 | if (!(reader instanceof $Reader))
|
20340 | reader = $Reader.create(reader);
|
20341 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange();
|
20342 | while (reader.pos < end) {
|
20343 | var tag = reader.uint32();
|
20344 | switch (tag >>> 3) {
|
20345 | case 1:
|
20346 | message.start = reader.int32();
|
20347 | break;
|
20348 | case 2:
|
20349 | message.end = reader.int32();
|
20350 | break;
|
20351 | default:
|
20352 | reader.skipType(tag & 7);
|
20353 | break;
|
20354 | }
|
20355 | }
|
20356 | return message;
|
20357 | };
|
20358 |
|
20359 | /**
|
20360 | * Decodes a ReservedRange message from the specified reader or buffer, length delimited.
|
20361 | * @function decodeDelimited
|
20362 | * @memberof google.protobuf.DescriptorProto.ReservedRange
|
20363 | * @static
|
20364 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
20365 | * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange
|
20366 | * @throws {Error} If the payload is not a reader or valid buffer
|
20367 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
20368 | */
|
20369 | ReservedRange.decodeDelimited = function decodeDelimited(reader) {
|
20370 | if (!(reader instanceof $Reader))
|
20371 | reader = new $Reader(reader);
|
20372 | return this.decode(reader, reader.uint32());
|
20373 | };
|
20374 |
|
20375 | /**
|
20376 | * Verifies a ReservedRange message.
|
20377 | * @function verify
|
20378 | * @memberof google.protobuf.DescriptorProto.ReservedRange
|
20379 | * @static
|
20380 | * @param {Object.<string,*>} message Plain object to verify
|
20381 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
20382 | */
|
20383 | ReservedRange.verify = function verify(message) {
|
20384 | if (typeof message !== "object" || message === null)
|
20385 | return "object expected";
|
20386 | if (message.start != null && message.hasOwnProperty("start"))
|
20387 | if (!$util.isInteger(message.start))
|
20388 | return "start: integer expected";
|
20389 | if (message.end != null && message.hasOwnProperty("end"))
|
20390 | if (!$util.isInteger(message.end))
|
20391 | return "end: integer expected";
|
20392 | return null;
|
20393 | };
|
20394 |
|
20395 | /**
|
20396 | * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types.
|
20397 | * @function fromObject
|
20398 | * @memberof google.protobuf.DescriptorProto.ReservedRange
|
20399 | * @static
|
20400 | * @param {Object.<string,*>} object Plain object
|
20401 | * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange
|
20402 | */
|
20403 | ReservedRange.fromObject = function fromObject(object) {
|
20404 | if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange)
|
20405 | return object;
|
20406 | var message = new $root.google.protobuf.DescriptorProto.ReservedRange();
|
20407 | if (object.start != null)
|
20408 | message.start = object.start | 0;
|
20409 | if (object.end != null)
|
20410 | message.end = object.end | 0;
|
20411 | return message;
|
20412 | };
|
20413 |
|
20414 | /**
|
20415 | * Creates a plain object from a ReservedRange message. Also converts values to other types if specified.
|
20416 | * @function toObject
|
20417 | * @memberof google.protobuf.DescriptorProto.ReservedRange
|
20418 | * @static
|
20419 | * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange
|
20420 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
20421 | * @returns {Object.<string,*>} Plain object
|
20422 | */
|
20423 | ReservedRange.toObject = function toObject(message, options) {
|
20424 | if (!options)
|
20425 | options = {};
|
20426 | var object = {};
|
20427 | if (options.defaults) {
|
20428 | object.start = 0;
|
20429 | object.end = 0;
|
20430 | }
|
20431 | if (message.start != null && message.hasOwnProperty("start"))
|
20432 | object.start = message.start;
|
20433 | if (message.end != null && message.hasOwnProperty("end"))
|
20434 | object.end = message.end;
|
20435 | return object;
|
20436 | };
|
20437 |
|
20438 | /**
|
20439 | * Converts this ReservedRange to JSON.
|
20440 | * @function toJSON
|
20441 | * @memberof google.protobuf.DescriptorProto.ReservedRange
|
20442 | * @instance
|
20443 | * @returns {Object.<string,*>} JSON object
|
20444 | */
|
20445 | ReservedRange.prototype.toJSON = function toJSON() {
|
20446 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
20447 | };
|
20448 |
|
20449 | return ReservedRange;
|
20450 | })();
|
20451 |
|
20452 | return DescriptorProto;
|
20453 | })();
|
20454 |
|
20455 | protobuf.ExtensionRangeOptions = (function() {
|
20456 |
|
20457 | /**
|
20458 | * Properties of an ExtensionRangeOptions.
|
20459 | * @memberof google.protobuf
|
20460 | * @interface IExtensionRangeOptions
|
20461 | * @property {Array.<google.protobuf.IUninterpretedOption>|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption
|
20462 | */
|
20463 |
|
20464 | /**
|
20465 | * Constructs a new ExtensionRangeOptions.
|
20466 | * @memberof google.protobuf
|
20467 | * @classdesc Represents an ExtensionRangeOptions.
|
20468 | * @implements IExtensionRangeOptions
|
20469 | * @constructor
|
20470 | * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set
|
20471 | */
|
20472 | function ExtensionRangeOptions(properties) {
|
20473 | this.uninterpretedOption = [];
|
20474 | if (properties)
|
20475 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
20476 | if (properties[keys[i]] != null)
|
20477 | this[keys[i]] = properties[keys[i]];
|
20478 | }
|
20479 |
|
20480 | /**
|
20481 | * ExtensionRangeOptions uninterpretedOption.
|
20482 | * @member {Array.<google.protobuf.IUninterpretedOption>} uninterpretedOption
|
20483 | * @memberof google.protobuf.ExtensionRangeOptions
|
20484 | * @instance
|
20485 | */
|
20486 | ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray;
|
20487 |
|
20488 | /**
|
20489 | * Creates a new ExtensionRangeOptions instance using the specified properties.
|
20490 | * @function create
|
20491 | * @memberof google.protobuf.ExtensionRangeOptions
|
20492 | * @static
|
20493 | * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set
|
20494 | * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance
|
20495 | */
|
20496 | ExtensionRangeOptions.create = function create(properties) {
|
20497 | return new ExtensionRangeOptions(properties);
|
20498 | };
|
20499 |
|
20500 | /**
|
20501 | * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages.
|
20502 | * @function encode
|
20503 | * @memberof google.protobuf.ExtensionRangeOptions
|
20504 | * @static
|
20505 | * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode
|
20506 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
20507 | * @returns {$protobuf.Writer} Writer
|
20508 | */
|
20509 | ExtensionRangeOptions.encode = function encode(message, writer) {
|
20510 | if (!writer)
|
20511 | writer = $Writer.create();
|
20512 | if (message.uninterpretedOption != null && message.uninterpretedOption.length)
|
20513 | for (var i = 0; i < message.uninterpretedOption.length; ++i)
|
20514 | $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim();
|
20515 | return writer;
|
20516 | };
|
20517 |
|
20518 | /**
|
20519 | * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages.
|
20520 | * @function encodeDelimited
|
20521 | * @memberof google.protobuf.ExtensionRangeOptions
|
20522 | * @static
|
20523 | * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode
|
20524 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
20525 | * @returns {$protobuf.Writer} Writer
|
20526 | */
|
20527 | ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) {
|
20528 | return this.encode(message, writer).ldelim();
|
20529 | };
|
20530 |
|
20531 | /**
|
20532 | * Decodes an ExtensionRangeOptions message from the specified reader or buffer.
|
20533 | * @function decode
|
20534 | * @memberof google.protobuf.ExtensionRangeOptions
|
20535 | * @static
|
20536 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
20537 | * @param {number} [length] Message length if known beforehand
|
20538 | * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions
|
20539 | * @throws {Error} If the payload is not a reader or valid buffer
|
20540 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
20541 | */
|
20542 | ExtensionRangeOptions.decode = function decode(reader, length) {
|
20543 | if (!(reader instanceof $Reader))
|
20544 | reader = $Reader.create(reader);
|
20545 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions();
|
20546 | while (reader.pos < end) {
|
20547 | var tag = reader.uint32();
|
20548 | switch (tag >>> 3) {
|
20549 | case 999:
|
20550 | if (!(message.uninterpretedOption && message.uninterpretedOption.length))
|
20551 | message.uninterpretedOption = [];
|
20552 | message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32()));
|
20553 | break;
|
20554 | default:
|
20555 | reader.skipType(tag & 7);
|
20556 | break;
|
20557 | }
|
20558 | }
|
20559 | return message;
|
20560 | };
|
20561 |
|
20562 | /**
|
20563 | * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited.
|
20564 | * @function decodeDelimited
|
20565 | * @memberof google.protobuf.ExtensionRangeOptions
|
20566 | * @static
|
20567 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
20568 | * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions
|
20569 | * @throws {Error} If the payload is not a reader or valid buffer
|
20570 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
20571 | */
|
20572 | ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) {
|
20573 | if (!(reader instanceof $Reader))
|
20574 | reader = new $Reader(reader);
|
20575 | return this.decode(reader, reader.uint32());
|
20576 | };
|
20577 |
|
20578 | /**
|
20579 | * Verifies an ExtensionRangeOptions message.
|
20580 | * @function verify
|
20581 | * @memberof google.protobuf.ExtensionRangeOptions
|
20582 | * @static
|
20583 | * @param {Object.<string,*>} message Plain object to verify
|
20584 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
20585 | */
|
20586 | ExtensionRangeOptions.verify = function verify(message) {
|
20587 | if (typeof message !== "object" || message === null)
|
20588 | return "object expected";
|
20589 | if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) {
|
20590 | if (!Array.isArray(message.uninterpretedOption))
|
20591 | return "uninterpretedOption: array expected";
|
20592 | for (var i = 0; i < message.uninterpretedOption.length; ++i) {
|
20593 | var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]);
|
20594 | if (error)
|
20595 | return "uninterpretedOption." + error;
|
20596 | }
|
20597 | }
|
20598 | return null;
|
20599 | };
|
20600 |
|
20601 | /**
|
20602 | * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types.
|
20603 | * @function fromObject
|
20604 | * @memberof google.protobuf.ExtensionRangeOptions
|
20605 | * @static
|
20606 | * @param {Object.<string,*>} object Plain object
|
20607 | * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions
|
20608 | */
|
20609 | ExtensionRangeOptions.fromObject = function fromObject(object) {
|
20610 | if (object instanceof $root.google.protobuf.ExtensionRangeOptions)
|
20611 | return object;
|
20612 | var message = new $root.google.protobuf.ExtensionRangeOptions();
|
20613 | if (object.uninterpretedOption) {
|
20614 | if (!Array.isArray(object.uninterpretedOption))
|
20615 | throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected");
|
20616 | message.uninterpretedOption = [];
|
20617 | for (var i = 0; i < object.uninterpretedOption.length; ++i) {
|
20618 | if (typeof object.uninterpretedOption[i] !== "object")
|
20619 | throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected");
|
20620 | message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]);
|
20621 | }
|
20622 | }
|
20623 | return message;
|
20624 | };
|
20625 |
|
20626 | /**
|
20627 | * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified.
|
20628 | * @function toObject
|
20629 | * @memberof google.protobuf.ExtensionRangeOptions
|
20630 | * @static
|
20631 | * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions
|
20632 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
20633 | * @returns {Object.<string,*>} Plain object
|
20634 | */
|
20635 | ExtensionRangeOptions.toObject = function toObject(message, options) {
|
20636 | if (!options)
|
20637 | options = {};
|
20638 | var object = {};
|
20639 | if (options.arrays || options.defaults)
|
20640 | object.uninterpretedOption = [];
|
20641 | if (message.uninterpretedOption && message.uninterpretedOption.length) {
|
20642 | object.uninterpretedOption = [];
|
20643 | for (var j = 0; j < message.uninterpretedOption.length; ++j)
|
20644 | object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options);
|
20645 | }
|
20646 | return object;
|
20647 | };
|
20648 |
|
20649 | /**
|
20650 | * Converts this ExtensionRangeOptions to JSON.
|
20651 | * @function toJSON
|
20652 | * @memberof google.protobuf.ExtensionRangeOptions
|
20653 | * @instance
|
20654 | * @returns {Object.<string,*>} JSON object
|
20655 | */
|
20656 | ExtensionRangeOptions.prototype.toJSON = function toJSON() {
|
20657 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
20658 | };
|
20659 |
|
20660 | return ExtensionRangeOptions;
|
20661 | })();
|
20662 |
|
20663 | protobuf.FieldDescriptorProto = (function() {
|
20664 |
|
20665 | /**
|
20666 | * Properties of a FieldDescriptorProto.
|
20667 | * @memberof google.protobuf
|
20668 | * @interface IFieldDescriptorProto
|
20669 | * @property {string|null} [name] FieldDescriptorProto name
|
20670 | * @property {number|null} [number] FieldDescriptorProto number
|
20671 | * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label
|
20672 | * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type
|
20673 | * @property {string|null} [typeName] FieldDescriptorProto typeName
|
20674 | * @property {string|null} [extendee] FieldDescriptorProto extendee
|
20675 | * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue
|
20676 | * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex
|
20677 | * @property {string|null} [jsonName] FieldDescriptorProto jsonName
|
20678 | * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options
|
20679 | * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional
|
20680 | */
|
20681 |
|
20682 | /**
|
20683 | * Constructs a new FieldDescriptorProto.
|
20684 | * @memberof google.protobuf
|
20685 | * @classdesc Represents a FieldDescriptorProto.
|
20686 | * @implements IFieldDescriptorProto
|
20687 | * @constructor
|
20688 | * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set
|
20689 | */
|
20690 | function FieldDescriptorProto(properties) {
|
20691 | if (properties)
|
20692 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
20693 | if (properties[keys[i]] != null)
|
20694 | this[keys[i]] = properties[keys[i]];
|
20695 | }
|
20696 |
|
20697 | /**
|
20698 | * FieldDescriptorProto name.
|
20699 | * @member {string} name
|
20700 | * @memberof google.protobuf.FieldDescriptorProto
|
20701 | * @instance
|
20702 | */
|
20703 | FieldDescriptorProto.prototype.name = "";
|
20704 |
|
20705 | /**
|
20706 | * FieldDescriptorProto number.
|
20707 | * @member {number} number
|
20708 | * @memberof google.protobuf.FieldDescriptorProto
|
20709 | * @instance
|
20710 | */
|
20711 | FieldDescriptorProto.prototype.number = 0;
|
20712 |
|
20713 | /**
|
20714 | * FieldDescriptorProto label.
|
20715 | * @member {google.protobuf.FieldDescriptorProto.Label} label
|
20716 | * @memberof google.protobuf.FieldDescriptorProto
|
20717 | * @instance
|
20718 | */
|
20719 | FieldDescriptorProto.prototype.label = 1;
|
20720 |
|
20721 | /**
|
20722 | * FieldDescriptorProto type.
|
20723 | * @member {google.protobuf.FieldDescriptorProto.Type} type
|
20724 | * @memberof google.protobuf.FieldDescriptorProto
|
20725 | * @instance
|
20726 | */
|
20727 | FieldDescriptorProto.prototype.type = 1;
|
20728 |
|
20729 | /**
|
20730 | * FieldDescriptorProto typeName.
|
20731 | * @member {string} typeName
|
20732 | * @memberof google.protobuf.FieldDescriptorProto
|
20733 | * @instance
|
20734 | */
|
20735 | FieldDescriptorProto.prototype.typeName = "";
|
20736 |
|
20737 | /**
|
20738 | * FieldDescriptorProto extendee.
|
20739 | * @member {string} extendee
|
20740 | * @memberof google.protobuf.FieldDescriptorProto
|
20741 | * @instance
|
20742 | */
|
20743 | FieldDescriptorProto.prototype.extendee = "";
|
20744 |
|
20745 | /**
|
20746 | * FieldDescriptorProto defaultValue.
|
20747 | * @member {string} defaultValue
|
20748 | * @memberof google.protobuf.FieldDescriptorProto
|
20749 | * @instance
|
20750 | */
|
20751 | FieldDescriptorProto.prototype.defaultValue = "";
|
20752 |
|
20753 | /**
|
20754 | * FieldDescriptorProto oneofIndex.
|
20755 | * @member {number} oneofIndex
|
20756 | * @memberof google.protobuf.FieldDescriptorProto
|
20757 | * @instance
|
20758 | */
|
20759 | FieldDescriptorProto.prototype.oneofIndex = 0;
|
20760 |
|
20761 | /**
|
20762 | * FieldDescriptorProto jsonName.
|
20763 | * @member {string} jsonName
|
20764 | * @memberof google.protobuf.FieldDescriptorProto
|
20765 | * @instance
|
20766 | */
|
20767 | FieldDescriptorProto.prototype.jsonName = "";
|
20768 |
|
20769 | /**
|
20770 | * FieldDescriptorProto options.
|
20771 | * @member {google.protobuf.IFieldOptions|null|undefined} options
|
20772 | * @memberof google.protobuf.FieldDescriptorProto
|
20773 | * @instance
|
20774 | */
|
20775 | FieldDescriptorProto.prototype.options = null;
|
20776 |
|
20777 | /**
|
20778 | * FieldDescriptorProto proto3Optional.
|
20779 | * @member {boolean} proto3Optional
|
20780 | * @memberof google.protobuf.FieldDescriptorProto
|
20781 | * @instance
|
20782 | */
|
20783 | FieldDescriptorProto.prototype.proto3Optional = false;
|
20784 |
|
20785 | /**
|
20786 | * Creates a new FieldDescriptorProto instance using the specified properties.
|
20787 | * @function create
|
20788 | * @memberof google.protobuf.FieldDescriptorProto
|
20789 | * @static
|
20790 | * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set
|
20791 | * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance
|
20792 | */
|
20793 | FieldDescriptorProto.create = function create(properties) {
|
20794 | return new FieldDescriptorProto(properties);
|
20795 | };
|
20796 |
|
20797 | /**
|
20798 | * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages.
|
20799 | * @function encode
|
20800 | * @memberof google.protobuf.FieldDescriptorProto
|
20801 | * @static
|
20802 | * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode
|
20803 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
20804 | * @returns {$protobuf.Writer} Writer
|
20805 | */
|
20806 | FieldDescriptorProto.encode = function encode(message, writer) {
|
20807 | if (!writer)
|
20808 | writer = $Writer.create();
|
20809 | if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
20810 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
|
20811 | if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee"))
|
20812 | writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee);
|
20813 | if (message.number != null && Object.hasOwnProperty.call(message, "number"))
|
20814 | writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number);
|
20815 | if (message.label != null && Object.hasOwnProperty.call(message, "label"))
|
20816 | writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label);
|
20817 | if (message.type != null && Object.hasOwnProperty.call(message, "type"))
|
20818 | writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type);
|
20819 | if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName"))
|
20820 | writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName);
|
20821 | if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue"))
|
20822 | writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue);
|
20823 | if (message.options != null && Object.hasOwnProperty.call(message, "options"))
|
20824 | $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();
|
20825 | if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex"))
|
20826 | writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex);
|
20827 | if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName"))
|
20828 | writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName);
|
20829 | if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional"))
|
20830 | writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional);
|
20831 | return writer;
|
20832 | };
|
20833 |
|
20834 | /**
|
20835 | * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages.
|
20836 | * @function encodeDelimited
|
20837 | * @memberof google.protobuf.FieldDescriptorProto
|
20838 | * @static
|
20839 | * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode
|
20840 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
20841 | * @returns {$protobuf.Writer} Writer
|
20842 | */
|
20843 | FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) {
|
20844 | return this.encode(message, writer).ldelim();
|
20845 | };
|
20846 |
|
20847 | /**
|
20848 | * Decodes a FieldDescriptorProto message from the specified reader or buffer.
|
20849 | * @function decode
|
20850 | * @memberof google.protobuf.FieldDescriptorProto
|
20851 | * @static
|
20852 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
20853 | * @param {number} [length] Message length if known beforehand
|
20854 | * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto
|
20855 | * @throws {Error} If the payload is not a reader or valid buffer
|
20856 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
20857 | */
|
20858 | FieldDescriptorProto.decode = function decode(reader, length) {
|
20859 | if (!(reader instanceof $Reader))
|
20860 | reader = $Reader.create(reader);
|
20861 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto();
|
20862 | while (reader.pos < end) {
|
20863 | var tag = reader.uint32();
|
20864 | switch (tag >>> 3) {
|
20865 | case 1:
|
20866 | message.name = reader.string();
|
20867 | break;
|
20868 | case 3:
|
20869 | message.number = reader.int32();
|
20870 | break;
|
20871 | case 4:
|
20872 | message.label = reader.int32();
|
20873 | break;
|
20874 | case 5:
|
20875 | message.type = reader.int32();
|
20876 | break;
|
20877 | case 6:
|
20878 | message.typeName = reader.string();
|
20879 | break;
|
20880 | case 2:
|
20881 | message.extendee = reader.string();
|
20882 | break;
|
20883 | case 7:
|
20884 | message.defaultValue = reader.string();
|
20885 | break;
|
20886 | case 9:
|
20887 | message.oneofIndex = reader.int32();
|
20888 | break;
|
20889 | case 10:
|
20890 | message.jsonName = reader.string();
|
20891 | break;
|
20892 | case 8:
|
20893 | message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32());
|
20894 | break;
|
20895 | case 17:
|
20896 | message.proto3Optional = reader.bool();
|
20897 | break;
|
20898 | default:
|
20899 | reader.skipType(tag & 7);
|
20900 | break;
|
20901 | }
|
20902 | }
|
20903 | return message;
|
20904 | };
|
20905 |
|
20906 | /**
|
20907 | * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited.
|
20908 | * @function decodeDelimited
|
20909 | * @memberof google.protobuf.FieldDescriptorProto
|
20910 | * @static
|
20911 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
20912 | * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto
|
20913 | * @throws {Error} If the payload is not a reader or valid buffer
|
20914 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
20915 | */
|
20916 | FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) {
|
20917 | if (!(reader instanceof $Reader))
|
20918 | reader = new $Reader(reader);
|
20919 | return this.decode(reader, reader.uint32());
|
20920 | };
|
20921 |
|
20922 | /**
|
20923 | * Verifies a FieldDescriptorProto message.
|
20924 | * @function verify
|
20925 | * @memberof google.protobuf.FieldDescriptorProto
|
20926 | * @static
|
20927 | * @param {Object.<string,*>} message Plain object to verify
|
20928 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
20929 | */
|
20930 | FieldDescriptorProto.verify = function verify(message) {
|
20931 | if (typeof message !== "object" || message === null)
|
20932 | return "object expected";
|
20933 | if (message.name != null && message.hasOwnProperty("name"))
|
20934 | if (!$util.isString(message.name))
|
20935 | return "name: string expected";
|
20936 | if (message.number != null && message.hasOwnProperty("number"))
|
20937 | if (!$util.isInteger(message.number))
|
20938 | return "number: integer expected";
|
20939 | if (message.label != null && message.hasOwnProperty("label"))
|
20940 | switch (message.label) {
|
20941 | default:
|
20942 | return "label: enum value expected";
|
20943 | case 1:
|
20944 | case 2:
|
20945 | case 3:
|
20946 | break;
|
20947 | }
|
20948 | if (message.type != null && message.hasOwnProperty("type"))
|
20949 | switch (message.type) {
|
20950 | default:
|
20951 | return "type: enum value expected";
|
20952 | case 1:
|
20953 | case 2:
|
20954 | case 3:
|
20955 | case 4:
|
20956 | case 5:
|
20957 | case 6:
|
20958 | case 7:
|
20959 | case 8:
|
20960 | case 9:
|
20961 | case 10:
|
20962 | case 11:
|
20963 | case 12:
|
20964 | case 13:
|
20965 | case 14:
|
20966 | case 15:
|
20967 | case 16:
|
20968 | case 17:
|
20969 | case 18:
|
20970 | break;
|
20971 | }
|
20972 | if (message.typeName != null && message.hasOwnProperty("typeName"))
|
20973 | if (!$util.isString(message.typeName))
|
20974 | return "typeName: string expected";
|
20975 | if (message.extendee != null && message.hasOwnProperty("extendee"))
|
20976 | if (!$util.isString(message.extendee))
|
20977 | return "extendee: string expected";
|
20978 | if (message.defaultValue != null && message.hasOwnProperty("defaultValue"))
|
20979 | if (!$util.isString(message.defaultValue))
|
20980 | return "defaultValue: string expected";
|
20981 | if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex"))
|
20982 | if (!$util.isInteger(message.oneofIndex))
|
20983 | return "oneofIndex: integer expected";
|
20984 | if (message.jsonName != null && message.hasOwnProperty("jsonName"))
|
20985 | if (!$util.isString(message.jsonName))
|
20986 | return "jsonName: string expected";
|
20987 | if (message.options != null && message.hasOwnProperty("options")) {
|
20988 | var error = $root.google.protobuf.FieldOptions.verify(message.options);
|
20989 | if (error)
|
20990 | return "options." + error;
|
20991 | }
|
20992 | if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional"))
|
20993 | if (typeof message.proto3Optional !== "boolean")
|
20994 | return "proto3Optional: boolean expected";
|
20995 | return null;
|
20996 | };
|
20997 |
|
20998 | /**
|
20999 | * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types.
|
21000 | * @function fromObject
|
21001 | * @memberof google.protobuf.FieldDescriptorProto
|
21002 | * @static
|
21003 | * @param {Object.<string,*>} object Plain object
|
21004 | * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto
|
21005 | */
|
21006 | FieldDescriptorProto.fromObject = function fromObject(object) {
|
21007 | if (object instanceof $root.google.protobuf.FieldDescriptorProto)
|
21008 | return object;
|
21009 | var message = new $root.google.protobuf.FieldDescriptorProto();
|
21010 | if (object.name != null)
|
21011 | message.name = String(object.name);
|
21012 | if (object.number != null)
|
21013 | message.number = object.number | 0;
|
21014 | switch (object.label) {
|
21015 | case "LABEL_OPTIONAL":
|
21016 | case 1:
|
21017 | message.label = 1;
|
21018 | break;
|
21019 | case "LABEL_REQUIRED":
|
21020 | case 2:
|
21021 | message.label = 2;
|
21022 | break;
|
21023 | case "LABEL_REPEATED":
|
21024 | case 3:
|
21025 | message.label = 3;
|
21026 | break;
|
21027 | }
|
21028 | switch (object.type) {
|
21029 | case "TYPE_DOUBLE":
|
21030 | case 1:
|
21031 | message.type = 1;
|
21032 | break;
|
21033 | case "TYPE_FLOAT":
|
21034 | case 2:
|
21035 | message.type = 2;
|
21036 | break;
|
21037 | case "TYPE_INT64":
|
21038 | case 3:
|
21039 | message.type = 3;
|
21040 | break;
|
21041 | case "TYPE_UINT64":
|
21042 | case 4:
|
21043 | message.type = 4;
|
21044 | break;
|
21045 | case "TYPE_INT32":
|
21046 | case 5:
|
21047 | message.type = 5;
|
21048 | break;
|
21049 | case "TYPE_FIXED64":
|
21050 | case 6:
|
21051 | message.type = 6;
|
21052 | break;
|
21053 | case "TYPE_FIXED32":
|
21054 | case 7:
|
21055 | message.type = 7;
|
21056 | break;
|
21057 | case "TYPE_BOOL":
|
21058 | case 8:
|
21059 | message.type = 8;
|
21060 | break;
|
21061 | case "TYPE_STRING":
|
21062 | case 9:
|
21063 | message.type = 9;
|
21064 | break;
|
21065 | case "TYPE_GROUP":
|
21066 | case 10:
|
21067 | message.type = 10;
|
21068 | break;
|
21069 | case "TYPE_MESSAGE":
|
21070 | case 11:
|
21071 | message.type = 11;
|
21072 | break;
|
21073 | case "TYPE_BYTES":
|
21074 | case 12:
|
21075 | message.type = 12;
|
21076 | break;
|
21077 | case "TYPE_UINT32":
|
21078 | case 13:
|
21079 | message.type = 13;
|
21080 | break;
|
21081 | case "TYPE_ENUM":
|
21082 | case 14:
|
21083 | message.type = 14;
|
21084 | break;
|
21085 | case "TYPE_SFIXED32":
|
21086 | case 15:
|
21087 | message.type = 15;
|
21088 | break;
|
21089 | case "TYPE_SFIXED64":
|
21090 | case 16:
|
21091 | message.type = 16;
|
21092 | break;
|
21093 | case "TYPE_SINT32":
|
21094 | case 17:
|
21095 | message.type = 17;
|
21096 | break;
|
21097 | case "TYPE_SINT64":
|
21098 | case 18:
|
21099 | message.type = 18;
|
21100 | break;
|
21101 | }
|
21102 | if (object.typeName != null)
|
21103 | message.typeName = String(object.typeName);
|
21104 | if (object.extendee != null)
|
21105 | message.extendee = String(object.extendee);
|
21106 | if (object.defaultValue != null)
|
21107 | message.defaultValue = String(object.defaultValue);
|
21108 | if (object.oneofIndex != null)
|
21109 | message.oneofIndex = object.oneofIndex | 0;
|
21110 | if (object.jsonName != null)
|
21111 | message.jsonName = String(object.jsonName);
|
21112 | if (object.options != null) {
|
21113 | if (typeof object.options !== "object")
|
21114 | throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected");
|
21115 | message.options = $root.google.protobuf.FieldOptions.fromObject(object.options);
|
21116 | }
|
21117 | if (object.proto3Optional != null)
|
21118 | message.proto3Optional = Boolean(object.proto3Optional);
|
21119 | return message;
|
21120 | };
|
21121 |
|
21122 | /**
|
21123 | * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified.
|
21124 | * @function toObject
|
21125 | * @memberof google.protobuf.FieldDescriptorProto
|
21126 | * @static
|
21127 | * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto
|
21128 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
21129 | * @returns {Object.<string,*>} Plain object
|
21130 | */
|
21131 | FieldDescriptorProto.toObject = function toObject(message, options) {
|
21132 | if (!options)
|
21133 | options = {};
|
21134 | var object = {};
|
21135 | if (options.defaults) {
|
21136 | object.name = "";
|
21137 | object.extendee = "";
|
21138 | object.number = 0;
|
21139 | object.label = options.enums === String ? "LABEL_OPTIONAL" : 1;
|
21140 | object.type = options.enums === String ? "TYPE_DOUBLE" : 1;
|
21141 | object.typeName = "";
|
21142 | object.defaultValue = "";
|
21143 | object.options = null;
|
21144 | object.oneofIndex = 0;
|
21145 | object.jsonName = "";
|
21146 | object.proto3Optional = false;
|
21147 | }
|
21148 | if (message.name != null && message.hasOwnProperty("name"))
|
21149 | object.name = message.name;
|
21150 | if (message.extendee != null && message.hasOwnProperty("extendee"))
|
21151 | object.extendee = message.extendee;
|
21152 | if (message.number != null && message.hasOwnProperty("number"))
|
21153 | object.number = message.number;
|
21154 | if (message.label != null && message.hasOwnProperty("label"))
|
21155 | object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label;
|
21156 | if (message.type != null && message.hasOwnProperty("type"))
|
21157 | object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type;
|
21158 | if (message.typeName != null && message.hasOwnProperty("typeName"))
|
21159 | object.typeName = message.typeName;
|
21160 | if (message.defaultValue != null && message.hasOwnProperty("defaultValue"))
|
21161 | object.defaultValue = message.defaultValue;
|
21162 | if (message.options != null && message.hasOwnProperty("options"))
|
21163 | object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options);
|
21164 | if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex"))
|
21165 | object.oneofIndex = message.oneofIndex;
|
21166 | if (message.jsonName != null && message.hasOwnProperty("jsonName"))
|
21167 | object.jsonName = message.jsonName;
|
21168 | if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional"))
|
21169 | object.proto3Optional = message.proto3Optional;
|
21170 | return object;
|
21171 | };
|
21172 |
|
21173 | /**
|
21174 | * Converts this FieldDescriptorProto to JSON.
|
21175 | * @function toJSON
|
21176 | * @memberof google.protobuf.FieldDescriptorProto
|
21177 | * @instance
|
21178 | * @returns {Object.<string,*>} JSON object
|
21179 | */
|
21180 | FieldDescriptorProto.prototype.toJSON = function toJSON() {
|
21181 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
21182 | };
|
21183 |
|
21184 | /**
|
21185 | * Type enum.
|
21186 | * @name google.protobuf.FieldDescriptorProto.Type
|
21187 | * @enum {number}
|
21188 | * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value
|
21189 | * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value
|
21190 | * @property {number} TYPE_INT64=3 TYPE_INT64 value
|
21191 | * @property {number} TYPE_UINT64=4 TYPE_UINT64 value
|
21192 | * @property {number} TYPE_INT32=5 TYPE_INT32 value
|
21193 | * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value
|
21194 | * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value
|
21195 | * @property {number} TYPE_BOOL=8 TYPE_BOOL value
|
21196 | * @property {number} TYPE_STRING=9 TYPE_STRING value
|
21197 | * @property {number} TYPE_GROUP=10 TYPE_GROUP value
|
21198 | * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value
|
21199 | * @property {number} TYPE_BYTES=12 TYPE_BYTES value
|
21200 | * @property {number} TYPE_UINT32=13 TYPE_UINT32 value
|
21201 | * @property {number} TYPE_ENUM=14 TYPE_ENUM value
|
21202 | * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value
|
21203 | * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value
|
21204 | * @property {number} TYPE_SINT32=17 TYPE_SINT32 value
|
21205 | * @property {number} TYPE_SINT64=18 TYPE_SINT64 value
|
21206 | */
|
21207 | FieldDescriptorProto.Type = (function() {
|
21208 | var valuesById = {}, values = Object.create(valuesById);
|
21209 | values[valuesById[1] = "TYPE_DOUBLE"] = 1;
|
21210 | values[valuesById[2] = "TYPE_FLOAT"] = 2;
|
21211 | values[valuesById[3] = "TYPE_INT64"] = 3;
|
21212 | values[valuesById[4] = "TYPE_UINT64"] = 4;
|
21213 | values[valuesById[5] = "TYPE_INT32"] = 5;
|
21214 | values[valuesById[6] = "TYPE_FIXED64"] = 6;
|
21215 | values[valuesById[7] = "TYPE_FIXED32"] = 7;
|
21216 | values[valuesById[8] = "TYPE_BOOL"] = 8;
|
21217 | values[valuesById[9] = "TYPE_STRING"] = 9;
|
21218 | values[valuesById[10] = "TYPE_GROUP"] = 10;
|
21219 | values[valuesById[11] = "TYPE_MESSAGE"] = 11;
|
21220 | values[valuesById[12] = "TYPE_BYTES"] = 12;
|
21221 | values[valuesById[13] = "TYPE_UINT32"] = 13;
|
21222 | values[valuesById[14] = "TYPE_ENUM"] = 14;
|
21223 | values[valuesById[15] = "TYPE_SFIXED32"] = 15;
|
21224 | values[valuesById[16] = "TYPE_SFIXED64"] = 16;
|
21225 | values[valuesById[17] = "TYPE_SINT32"] = 17;
|
21226 | values[valuesById[18] = "TYPE_SINT64"] = 18;
|
21227 | return values;
|
21228 | })();
|
21229 |
|
21230 | /**
|
21231 | * Label enum.
|
21232 | * @name google.protobuf.FieldDescriptorProto.Label
|
21233 | * @enum {number}
|
21234 | * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value
|
21235 | * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value
|
21236 | * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value
|
21237 | */
|
21238 | FieldDescriptorProto.Label = (function() {
|
21239 | var valuesById = {}, values = Object.create(valuesById);
|
21240 | values[valuesById[1] = "LABEL_OPTIONAL"] = 1;
|
21241 | values[valuesById[2] = "LABEL_REQUIRED"] = 2;
|
21242 | values[valuesById[3] = "LABEL_REPEATED"] = 3;
|
21243 | return values;
|
21244 | })();
|
21245 |
|
21246 | return FieldDescriptorProto;
|
21247 | })();
|
21248 |
|
21249 | protobuf.OneofDescriptorProto = (function() {
|
21250 |
|
21251 | /**
|
21252 | * Properties of an OneofDescriptorProto.
|
21253 | * @memberof google.protobuf
|
21254 | * @interface IOneofDescriptorProto
|
21255 | * @property {string|null} [name] OneofDescriptorProto name
|
21256 | * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options
|
21257 | */
|
21258 |
|
21259 | /**
|
21260 | * Constructs a new OneofDescriptorProto.
|
21261 | * @memberof google.protobuf
|
21262 | * @classdesc Represents an OneofDescriptorProto.
|
21263 | * @implements IOneofDescriptorProto
|
21264 | * @constructor
|
21265 | * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set
|
21266 | */
|
21267 | function OneofDescriptorProto(properties) {
|
21268 | if (properties)
|
21269 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
21270 | if (properties[keys[i]] != null)
|
21271 | this[keys[i]] = properties[keys[i]];
|
21272 | }
|
21273 |
|
21274 | /**
|
21275 | * OneofDescriptorProto name.
|
21276 | * @member {string} name
|
21277 | * @memberof google.protobuf.OneofDescriptorProto
|
21278 | * @instance
|
21279 | */
|
21280 | OneofDescriptorProto.prototype.name = "";
|
21281 |
|
21282 | /**
|
21283 | * OneofDescriptorProto options.
|
21284 | * @member {google.protobuf.IOneofOptions|null|undefined} options
|
21285 | * @memberof google.protobuf.OneofDescriptorProto
|
21286 | * @instance
|
21287 | */
|
21288 | OneofDescriptorProto.prototype.options = null;
|
21289 |
|
21290 | /**
|
21291 | * Creates a new OneofDescriptorProto instance using the specified properties.
|
21292 | * @function create
|
21293 | * @memberof google.protobuf.OneofDescriptorProto
|
21294 | * @static
|
21295 | * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set
|
21296 | * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance
|
21297 | */
|
21298 | OneofDescriptorProto.create = function create(properties) {
|
21299 | return new OneofDescriptorProto(properties);
|
21300 | };
|
21301 |
|
21302 | /**
|
21303 | * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages.
|
21304 | * @function encode
|
21305 | * @memberof google.protobuf.OneofDescriptorProto
|
21306 | * @static
|
21307 | * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode
|
21308 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
21309 | * @returns {$protobuf.Writer} Writer
|
21310 | */
|
21311 | OneofDescriptorProto.encode = function encode(message, writer) {
|
21312 | if (!writer)
|
21313 | writer = $Writer.create();
|
21314 | if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
21315 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
|
21316 | if (message.options != null && Object.hasOwnProperty.call(message, "options"))
|
21317 | $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
21318 | return writer;
|
21319 | };
|
21320 |
|
21321 | /**
|
21322 | * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages.
|
21323 | * @function encodeDelimited
|
21324 | * @memberof google.protobuf.OneofDescriptorProto
|
21325 | * @static
|
21326 | * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode
|
21327 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
21328 | * @returns {$protobuf.Writer} Writer
|
21329 | */
|
21330 | OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) {
|
21331 | return this.encode(message, writer).ldelim();
|
21332 | };
|
21333 |
|
21334 | /**
|
21335 | * Decodes an OneofDescriptorProto message from the specified reader or buffer.
|
21336 | * @function decode
|
21337 | * @memberof google.protobuf.OneofDescriptorProto
|
21338 | * @static
|
21339 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
21340 | * @param {number} [length] Message length if known beforehand
|
21341 | * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto
|
21342 | * @throws {Error} If the payload is not a reader or valid buffer
|
21343 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
21344 | */
|
21345 | OneofDescriptorProto.decode = function decode(reader, length) {
|
21346 | if (!(reader instanceof $Reader))
|
21347 | reader = $Reader.create(reader);
|
21348 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto();
|
21349 | while (reader.pos < end) {
|
21350 | var tag = reader.uint32();
|
21351 | switch (tag >>> 3) {
|
21352 | case 1:
|
21353 | message.name = reader.string();
|
21354 | break;
|
21355 | case 2:
|
21356 | message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32());
|
21357 | break;
|
21358 | default:
|
21359 | reader.skipType(tag & 7);
|
21360 | break;
|
21361 | }
|
21362 | }
|
21363 | return message;
|
21364 | };
|
21365 |
|
21366 | /**
|
21367 | * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited.
|
21368 | * @function decodeDelimited
|
21369 | * @memberof google.protobuf.OneofDescriptorProto
|
21370 | * @static
|
21371 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
21372 | * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto
|
21373 | * @throws {Error} If the payload is not a reader or valid buffer
|
21374 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
21375 | */
|
21376 | OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) {
|
21377 | if (!(reader instanceof $Reader))
|
21378 | reader = new $Reader(reader);
|
21379 | return this.decode(reader, reader.uint32());
|
21380 | };
|
21381 |
|
21382 | /**
|
21383 | * Verifies an OneofDescriptorProto message.
|
21384 | * @function verify
|
21385 | * @memberof google.protobuf.OneofDescriptorProto
|
21386 | * @static
|
21387 | * @param {Object.<string,*>} message Plain object to verify
|
21388 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
21389 | */
|
21390 | OneofDescriptorProto.verify = function verify(message) {
|
21391 | if (typeof message !== "object" || message === null)
|
21392 | return "object expected";
|
21393 | if (message.name != null && message.hasOwnProperty("name"))
|
21394 | if (!$util.isString(message.name))
|
21395 | return "name: string expected";
|
21396 | if (message.options != null && message.hasOwnProperty("options")) {
|
21397 | var error = $root.google.protobuf.OneofOptions.verify(message.options);
|
21398 | if (error)
|
21399 | return "options." + error;
|
21400 | }
|
21401 | return null;
|
21402 | };
|
21403 |
|
21404 | /**
|
21405 | * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types.
|
21406 | * @function fromObject
|
21407 | * @memberof google.protobuf.OneofDescriptorProto
|
21408 | * @static
|
21409 | * @param {Object.<string,*>} object Plain object
|
21410 | * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto
|
21411 | */
|
21412 | OneofDescriptorProto.fromObject = function fromObject(object) {
|
21413 | if (object instanceof $root.google.protobuf.OneofDescriptorProto)
|
21414 | return object;
|
21415 | var message = new $root.google.protobuf.OneofDescriptorProto();
|
21416 | if (object.name != null)
|
21417 | message.name = String(object.name);
|
21418 | if (object.options != null) {
|
21419 | if (typeof object.options !== "object")
|
21420 | throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected");
|
21421 | message.options = $root.google.protobuf.OneofOptions.fromObject(object.options);
|
21422 | }
|
21423 | return message;
|
21424 | };
|
21425 |
|
21426 | /**
|
21427 | * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified.
|
21428 | * @function toObject
|
21429 | * @memberof google.protobuf.OneofDescriptorProto
|
21430 | * @static
|
21431 | * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto
|
21432 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
21433 | * @returns {Object.<string,*>} Plain object
|
21434 | */
|
21435 | OneofDescriptorProto.toObject = function toObject(message, options) {
|
21436 | if (!options)
|
21437 | options = {};
|
21438 | var object = {};
|
21439 | if (options.defaults) {
|
21440 | object.name = "";
|
21441 | object.options = null;
|
21442 | }
|
21443 | if (message.name != null && message.hasOwnProperty("name"))
|
21444 | object.name = message.name;
|
21445 | if (message.options != null && message.hasOwnProperty("options"))
|
21446 | object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options);
|
21447 | return object;
|
21448 | };
|
21449 |
|
21450 | /**
|
21451 | * Converts this OneofDescriptorProto to JSON.
|
21452 | * @function toJSON
|
21453 | * @memberof google.protobuf.OneofDescriptorProto
|
21454 | * @instance
|
21455 | * @returns {Object.<string,*>} JSON object
|
21456 | */
|
21457 | OneofDescriptorProto.prototype.toJSON = function toJSON() {
|
21458 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
21459 | };
|
21460 |
|
21461 | return OneofDescriptorProto;
|
21462 | })();
|
21463 |
|
21464 | protobuf.EnumDescriptorProto = (function() {
|
21465 |
|
21466 | /**
|
21467 | * Properties of an EnumDescriptorProto.
|
21468 | * @memberof google.protobuf
|
21469 | * @interface IEnumDescriptorProto
|
21470 | * @property {string|null} [name] EnumDescriptorProto name
|
21471 | * @property {Array.<google.protobuf.IEnumValueDescriptorProto>|null} [value] EnumDescriptorProto value
|
21472 | * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options
|
21473 | * @property {Array.<google.protobuf.EnumDescriptorProto.IEnumReservedRange>|null} [reservedRange] EnumDescriptorProto reservedRange
|
21474 | * @property {Array.<string>|null} [reservedName] EnumDescriptorProto reservedName
|
21475 | */
|
21476 |
|
21477 | /**
|
21478 | * Constructs a new EnumDescriptorProto.
|
21479 | * @memberof google.protobuf
|
21480 | * @classdesc Represents an EnumDescriptorProto.
|
21481 | * @implements IEnumDescriptorProto
|
21482 | * @constructor
|
21483 | * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set
|
21484 | */
|
21485 | function EnumDescriptorProto(properties) {
|
21486 | this.value = [];
|
21487 | this.reservedRange = [];
|
21488 | this.reservedName = [];
|
21489 | if (properties)
|
21490 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
21491 | if (properties[keys[i]] != null)
|
21492 | this[keys[i]] = properties[keys[i]];
|
21493 | }
|
21494 |
|
21495 | /**
|
21496 | * EnumDescriptorProto name.
|
21497 | * @member {string} name
|
21498 | * @memberof google.protobuf.EnumDescriptorProto
|
21499 | * @instance
|
21500 | */
|
21501 | EnumDescriptorProto.prototype.name = "";
|
21502 |
|
21503 | /**
|
21504 | * EnumDescriptorProto value.
|
21505 | * @member {Array.<google.protobuf.IEnumValueDescriptorProto>} value
|
21506 | * @memberof google.protobuf.EnumDescriptorProto
|
21507 | * @instance
|
21508 | */
|
21509 | EnumDescriptorProto.prototype.value = $util.emptyArray;
|
21510 |
|
21511 | /**
|
21512 | * EnumDescriptorProto options.
|
21513 | * @member {google.protobuf.IEnumOptions|null|undefined} options
|
21514 | * @memberof google.protobuf.EnumDescriptorProto
|
21515 | * @instance
|
21516 | */
|
21517 | EnumDescriptorProto.prototype.options = null;
|
21518 |
|
21519 | /**
|
21520 | * EnumDescriptorProto reservedRange.
|
21521 | * @member {Array.<google.protobuf.EnumDescriptorProto.IEnumReservedRange>} reservedRange
|
21522 | * @memberof google.protobuf.EnumDescriptorProto
|
21523 | * @instance
|
21524 | */
|
21525 | EnumDescriptorProto.prototype.reservedRange = $util.emptyArray;
|
21526 |
|
21527 | /**
|
21528 | * EnumDescriptorProto reservedName.
|
21529 | * @member {Array.<string>} reservedName
|
21530 | * @memberof google.protobuf.EnumDescriptorProto
|
21531 | * @instance
|
21532 | */
|
21533 | EnumDescriptorProto.prototype.reservedName = $util.emptyArray;
|
21534 |
|
21535 | /**
|
21536 | * Creates a new EnumDescriptorProto instance using the specified properties.
|
21537 | * @function create
|
21538 | * @memberof google.protobuf.EnumDescriptorProto
|
21539 | * @static
|
21540 | * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set
|
21541 | * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance
|
21542 | */
|
21543 | EnumDescriptorProto.create = function create(properties) {
|
21544 | return new EnumDescriptorProto(properties);
|
21545 | };
|
21546 |
|
21547 | /**
|
21548 | * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages.
|
21549 | * @function encode
|
21550 | * @memberof google.protobuf.EnumDescriptorProto
|
21551 | * @static
|
21552 | * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode
|
21553 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
21554 | * @returns {$protobuf.Writer} Writer
|
21555 | */
|
21556 | EnumDescriptorProto.encode = function encode(message, writer) {
|
21557 | if (!writer)
|
21558 | writer = $Writer.create();
|
21559 | if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
21560 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
|
21561 | if (message.value != null && message.value.length)
|
21562 | for (var i = 0; i < message.value.length; ++i)
|
21563 | $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
21564 | if (message.options != null && Object.hasOwnProperty.call(message, "options"))
|
21565 | $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
|
21566 | if (message.reservedRange != null && message.reservedRange.length)
|
21567 | for (var i = 0; i < message.reservedRange.length; ++i)
|
21568 | $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
|
21569 | if (message.reservedName != null && message.reservedName.length)
|
21570 | for (var i = 0; i < message.reservedName.length; ++i)
|
21571 | writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]);
|
21572 | return writer;
|
21573 | };
|
21574 |
|
21575 | /**
|
21576 | * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages.
|
21577 | * @function encodeDelimited
|
21578 | * @memberof google.protobuf.EnumDescriptorProto
|
21579 | * @static
|
21580 | * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode
|
21581 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
21582 | * @returns {$protobuf.Writer} Writer
|
21583 | */
|
21584 | EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) {
|
21585 | return this.encode(message, writer).ldelim();
|
21586 | };
|
21587 |
|
21588 | /**
|
21589 | * Decodes an EnumDescriptorProto message from the specified reader or buffer.
|
21590 | * @function decode
|
21591 | * @memberof google.protobuf.EnumDescriptorProto
|
21592 | * @static
|
21593 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
21594 | * @param {number} [length] Message length if known beforehand
|
21595 | * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto
|
21596 | * @throws {Error} If the payload is not a reader or valid buffer
|
21597 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
21598 | */
|
21599 | EnumDescriptorProto.decode = function decode(reader, length) {
|
21600 | if (!(reader instanceof $Reader))
|
21601 | reader = $Reader.create(reader);
|
21602 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto();
|
21603 | while (reader.pos < end) {
|
21604 | var tag = reader.uint32();
|
21605 | switch (tag >>> 3) {
|
21606 | case 1:
|
21607 | message.name = reader.string();
|
21608 | break;
|
21609 | case 2:
|
21610 | if (!(message.value && message.value.length))
|
21611 | message.value = [];
|
21612 | message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32()));
|
21613 | break;
|
21614 | case 3:
|
21615 | message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32());
|
21616 | break;
|
21617 | case 4:
|
21618 | if (!(message.reservedRange && message.reservedRange.length))
|
21619 | message.reservedRange = [];
|
21620 | message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32()));
|
21621 | break;
|
21622 | case 5:
|
21623 | if (!(message.reservedName && message.reservedName.length))
|
21624 | message.reservedName = [];
|
21625 | message.reservedName.push(reader.string());
|
21626 | break;
|
21627 | default:
|
21628 | reader.skipType(tag & 7);
|
21629 | break;
|
21630 | }
|
21631 | }
|
21632 | return message;
|
21633 | };
|
21634 |
|
21635 | /**
|
21636 | * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited.
|
21637 | * @function decodeDelimited
|
21638 | * @memberof google.protobuf.EnumDescriptorProto
|
21639 | * @static
|
21640 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
21641 | * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto
|
21642 | * @throws {Error} If the payload is not a reader or valid buffer
|
21643 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
21644 | */
|
21645 | EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) {
|
21646 | if (!(reader instanceof $Reader))
|
21647 | reader = new $Reader(reader);
|
21648 | return this.decode(reader, reader.uint32());
|
21649 | };
|
21650 |
|
21651 | /**
|
21652 | * Verifies an EnumDescriptorProto message.
|
21653 | * @function verify
|
21654 | * @memberof google.protobuf.EnumDescriptorProto
|
21655 | * @static
|
21656 | * @param {Object.<string,*>} message Plain object to verify
|
21657 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
21658 | */
|
21659 | EnumDescriptorProto.verify = function verify(message) {
|
21660 | if (typeof message !== "object" || message === null)
|
21661 | return "object expected";
|
21662 | if (message.name != null && message.hasOwnProperty("name"))
|
21663 | if (!$util.isString(message.name))
|
21664 | return "name: string expected";
|
21665 | if (message.value != null && message.hasOwnProperty("value")) {
|
21666 | if (!Array.isArray(message.value))
|
21667 | return "value: array expected";
|
21668 | for (var i = 0; i < message.value.length; ++i) {
|
21669 | var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]);
|
21670 | if (error)
|
21671 | return "value." + error;
|
21672 | }
|
21673 | }
|
21674 | if (message.options != null && message.hasOwnProperty("options")) {
|
21675 | var error = $root.google.protobuf.EnumOptions.verify(message.options);
|
21676 | if (error)
|
21677 | return "options." + error;
|
21678 | }
|
21679 | if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) {
|
21680 | if (!Array.isArray(message.reservedRange))
|
21681 | return "reservedRange: array expected";
|
21682 | for (var i = 0; i < message.reservedRange.length; ++i) {
|
21683 | var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]);
|
21684 | if (error)
|
21685 | return "reservedRange." + error;
|
21686 | }
|
21687 | }
|
21688 | if (message.reservedName != null && message.hasOwnProperty("reservedName")) {
|
21689 | if (!Array.isArray(message.reservedName))
|
21690 | return "reservedName: array expected";
|
21691 | for (var i = 0; i < message.reservedName.length; ++i)
|
21692 | if (!$util.isString(message.reservedName[i]))
|
21693 | return "reservedName: string[] expected";
|
21694 | }
|
21695 | return null;
|
21696 | };
|
21697 |
|
21698 | /**
|
21699 | * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types.
|
21700 | * @function fromObject
|
21701 | * @memberof google.protobuf.EnumDescriptorProto
|
21702 | * @static
|
21703 | * @param {Object.<string,*>} object Plain object
|
21704 | * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto
|
21705 | */
|
21706 | EnumDescriptorProto.fromObject = function fromObject(object) {
|
21707 | if (object instanceof $root.google.protobuf.EnumDescriptorProto)
|
21708 | return object;
|
21709 | var message = new $root.google.protobuf.EnumDescriptorProto();
|
21710 | if (object.name != null)
|
21711 | message.name = String(object.name);
|
21712 | if (object.value) {
|
21713 | if (!Array.isArray(object.value))
|
21714 | throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected");
|
21715 | message.value = [];
|
21716 | for (var i = 0; i < object.value.length; ++i) {
|
21717 | if (typeof object.value[i] !== "object")
|
21718 | throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected");
|
21719 | message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]);
|
21720 | }
|
21721 | }
|
21722 | if (object.options != null) {
|
21723 | if (typeof object.options !== "object")
|
21724 | throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected");
|
21725 | message.options = $root.google.protobuf.EnumOptions.fromObject(object.options);
|
21726 | }
|
21727 | if (object.reservedRange) {
|
21728 | if (!Array.isArray(object.reservedRange))
|
21729 | throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected");
|
21730 | message.reservedRange = [];
|
21731 | for (var i = 0; i < object.reservedRange.length; ++i) {
|
21732 | if (typeof object.reservedRange[i] !== "object")
|
21733 | throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected");
|
21734 | message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]);
|
21735 | }
|
21736 | }
|
21737 | if (object.reservedName) {
|
21738 | if (!Array.isArray(object.reservedName))
|
21739 | throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected");
|
21740 | message.reservedName = [];
|
21741 | for (var i = 0; i < object.reservedName.length; ++i)
|
21742 | message.reservedName[i] = String(object.reservedName[i]);
|
21743 | }
|
21744 | return message;
|
21745 | };
|
21746 |
|
21747 | /**
|
21748 | * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified.
|
21749 | * @function toObject
|
21750 | * @memberof google.protobuf.EnumDescriptorProto
|
21751 | * @static
|
21752 | * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto
|
21753 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
21754 | * @returns {Object.<string,*>} Plain object
|
21755 | */
|
21756 | EnumDescriptorProto.toObject = function toObject(message, options) {
|
21757 | if (!options)
|
21758 | options = {};
|
21759 | var object = {};
|
21760 | if (options.arrays || options.defaults) {
|
21761 | object.value = [];
|
21762 | object.reservedRange = [];
|
21763 | object.reservedName = [];
|
21764 | }
|
21765 | if (options.defaults) {
|
21766 | object.name = "";
|
21767 | object.options = null;
|
21768 | }
|
21769 | if (message.name != null && message.hasOwnProperty("name"))
|
21770 | object.name = message.name;
|
21771 | if (message.value && message.value.length) {
|
21772 | object.value = [];
|
21773 | for (var j = 0; j < message.value.length; ++j)
|
21774 | object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options);
|
21775 | }
|
21776 | if (message.options != null && message.hasOwnProperty("options"))
|
21777 | object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options);
|
21778 | if (message.reservedRange && message.reservedRange.length) {
|
21779 | object.reservedRange = [];
|
21780 | for (var j = 0; j < message.reservedRange.length; ++j)
|
21781 | object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options);
|
21782 | }
|
21783 | if (message.reservedName && message.reservedName.length) {
|
21784 | object.reservedName = [];
|
21785 | for (var j = 0; j < message.reservedName.length; ++j)
|
21786 | object.reservedName[j] = message.reservedName[j];
|
21787 | }
|
21788 | return object;
|
21789 | };
|
21790 |
|
21791 | /**
|
21792 | * Converts this EnumDescriptorProto to JSON.
|
21793 | * @function toJSON
|
21794 | * @memberof google.protobuf.EnumDescriptorProto
|
21795 | * @instance
|
21796 | * @returns {Object.<string,*>} JSON object
|
21797 | */
|
21798 | EnumDescriptorProto.prototype.toJSON = function toJSON() {
|
21799 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
21800 | };
|
21801 |
|
21802 | EnumDescriptorProto.EnumReservedRange = (function() {
|
21803 |
|
21804 | /**
|
21805 | * Properties of an EnumReservedRange.
|
21806 | * @memberof google.protobuf.EnumDescriptorProto
|
21807 | * @interface IEnumReservedRange
|
21808 | * @property {number|null} [start] EnumReservedRange start
|
21809 | * @property {number|null} [end] EnumReservedRange end
|
21810 | */
|
21811 |
|
21812 | /**
|
21813 | * Constructs a new EnumReservedRange.
|
21814 | * @memberof google.protobuf.EnumDescriptorProto
|
21815 | * @classdesc Represents an EnumReservedRange.
|
21816 | * @implements IEnumReservedRange
|
21817 | * @constructor
|
21818 | * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set
|
21819 | */
|
21820 | function EnumReservedRange(properties) {
|
21821 | if (properties)
|
21822 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
21823 | if (properties[keys[i]] != null)
|
21824 | this[keys[i]] = properties[keys[i]];
|
21825 | }
|
21826 |
|
21827 | /**
|
21828 | * EnumReservedRange start.
|
21829 | * @member {number} start
|
21830 | * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange
|
21831 | * @instance
|
21832 | */
|
21833 | EnumReservedRange.prototype.start = 0;
|
21834 |
|
21835 | /**
|
21836 | * EnumReservedRange end.
|
21837 | * @member {number} end
|
21838 | * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange
|
21839 | * @instance
|
21840 | */
|
21841 | EnumReservedRange.prototype.end = 0;
|
21842 |
|
21843 | /**
|
21844 | * Creates a new EnumReservedRange instance using the specified properties.
|
21845 | * @function create
|
21846 | * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange
|
21847 | * @static
|
21848 | * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set
|
21849 | * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance
|
21850 | */
|
21851 | EnumReservedRange.create = function create(properties) {
|
21852 | return new EnumReservedRange(properties);
|
21853 | };
|
21854 |
|
21855 | /**
|
21856 | * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages.
|
21857 | * @function encode
|
21858 | * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange
|
21859 | * @static
|
21860 | * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode
|
21861 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
21862 | * @returns {$protobuf.Writer} Writer
|
21863 | */
|
21864 | EnumReservedRange.encode = function encode(message, writer) {
|
21865 | if (!writer)
|
21866 | writer = $Writer.create();
|
21867 | if (message.start != null && Object.hasOwnProperty.call(message, "start"))
|
21868 | writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start);
|
21869 | if (message.end != null && Object.hasOwnProperty.call(message, "end"))
|
21870 | writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end);
|
21871 | return writer;
|
21872 | };
|
21873 |
|
21874 | /**
|
21875 | * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages.
|
21876 | * @function encodeDelimited
|
21877 | * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange
|
21878 | * @static
|
21879 | * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode
|
21880 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
21881 | * @returns {$protobuf.Writer} Writer
|
21882 | */
|
21883 | EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) {
|
21884 | return this.encode(message, writer).ldelim();
|
21885 | };
|
21886 |
|
21887 | /**
|
21888 | * Decodes an EnumReservedRange message from the specified reader or buffer.
|
21889 | * @function decode
|
21890 | * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange
|
21891 | * @static
|
21892 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
21893 | * @param {number} [length] Message length if known beforehand
|
21894 | * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange
|
21895 | * @throws {Error} If the payload is not a reader or valid buffer
|
21896 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
21897 | */
|
21898 | EnumReservedRange.decode = function decode(reader, length) {
|
21899 | if (!(reader instanceof $Reader))
|
21900 | reader = $Reader.create(reader);
|
21901 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange();
|
21902 | while (reader.pos < end) {
|
21903 | var tag = reader.uint32();
|
21904 | switch (tag >>> 3) {
|
21905 | case 1:
|
21906 | message.start = reader.int32();
|
21907 | break;
|
21908 | case 2:
|
21909 | message.end = reader.int32();
|
21910 | break;
|
21911 | default:
|
21912 | reader.skipType(tag & 7);
|
21913 | break;
|
21914 | }
|
21915 | }
|
21916 | return message;
|
21917 | };
|
21918 |
|
21919 | /**
|
21920 | * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited.
|
21921 | * @function decodeDelimited
|
21922 | * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange
|
21923 | * @static
|
21924 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
21925 | * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange
|
21926 | * @throws {Error} If the payload is not a reader or valid buffer
|
21927 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
21928 | */
|
21929 | EnumReservedRange.decodeDelimited = function decodeDelimited(reader) {
|
21930 | if (!(reader instanceof $Reader))
|
21931 | reader = new $Reader(reader);
|
21932 | return this.decode(reader, reader.uint32());
|
21933 | };
|
21934 |
|
21935 | /**
|
21936 | * Verifies an EnumReservedRange message.
|
21937 | * @function verify
|
21938 | * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange
|
21939 | * @static
|
21940 | * @param {Object.<string,*>} message Plain object to verify
|
21941 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
21942 | */
|
21943 | EnumReservedRange.verify = function verify(message) {
|
21944 | if (typeof message !== "object" || message === null)
|
21945 | return "object expected";
|
21946 | if (message.start != null && message.hasOwnProperty("start"))
|
21947 | if (!$util.isInteger(message.start))
|
21948 | return "start: integer expected";
|
21949 | if (message.end != null && message.hasOwnProperty("end"))
|
21950 | if (!$util.isInteger(message.end))
|
21951 | return "end: integer expected";
|
21952 | return null;
|
21953 | };
|
21954 |
|
21955 | /**
|
21956 | * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types.
|
21957 | * @function fromObject
|
21958 | * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange
|
21959 | * @static
|
21960 | * @param {Object.<string,*>} object Plain object
|
21961 | * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange
|
21962 | */
|
21963 | EnumReservedRange.fromObject = function fromObject(object) {
|
21964 | if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange)
|
21965 | return object;
|
21966 | var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange();
|
21967 | if (object.start != null)
|
21968 | message.start = object.start | 0;
|
21969 | if (object.end != null)
|
21970 | message.end = object.end | 0;
|
21971 | return message;
|
21972 | };
|
21973 |
|
21974 | /**
|
21975 | * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified.
|
21976 | * @function toObject
|
21977 | * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange
|
21978 | * @static
|
21979 | * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange
|
21980 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
21981 | * @returns {Object.<string,*>} Plain object
|
21982 | */
|
21983 | EnumReservedRange.toObject = function toObject(message, options) {
|
21984 | if (!options)
|
21985 | options = {};
|
21986 | var object = {};
|
21987 | if (options.defaults) {
|
21988 | object.start = 0;
|
21989 | object.end = 0;
|
21990 | }
|
21991 | if (message.start != null && message.hasOwnProperty("start"))
|
21992 | object.start = message.start;
|
21993 | if (message.end != null && message.hasOwnProperty("end"))
|
21994 | object.end = message.end;
|
21995 | return object;
|
21996 | };
|
21997 |
|
21998 | /**
|
21999 | * Converts this EnumReservedRange to JSON.
|
22000 | * @function toJSON
|
22001 | * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange
|
22002 | * @instance
|
22003 | * @returns {Object.<string,*>} JSON object
|
22004 | */
|
22005 | EnumReservedRange.prototype.toJSON = function toJSON() {
|
22006 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
22007 | };
|
22008 |
|
22009 | return EnumReservedRange;
|
22010 | })();
|
22011 |
|
22012 | return EnumDescriptorProto;
|
22013 | })();
|
22014 |
|
22015 | protobuf.EnumValueDescriptorProto = (function() {
|
22016 |
|
22017 | /**
|
22018 | * Properties of an EnumValueDescriptorProto.
|
22019 | * @memberof google.protobuf
|
22020 | * @interface IEnumValueDescriptorProto
|
22021 | * @property {string|null} [name] EnumValueDescriptorProto name
|
22022 | * @property {number|null} [number] EnumValueDescriptorProto number
|
22023 | * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options
|
22024 | */
|
22025 |
|
22026 | /**
|
22027 | * Constructs a new EnumValueDescriptorProto.
|
22028 | * @memberof google.protobuf
|
22029 | * @classdesc Represents an EnumValueDescriptorProto.
|
22030 | * @implements IEnumValueDescriptorProto
|
22031 | * @constructor
|
22032 | * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set
|
22033 | */
|
22034 | function EnumValueDescriptorProto(properties) {
|
22035 | if (properties)
|
22036 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
22037 | if (properties[keys[i]] != null)
|
22038 | this[keys[i]] = properties[keys[i]];
|
22039 | }
|
22040 |
|
22041 | /**
|
22042 | * EnumValueDescriptorProto name.
|
22043 | * @member {string} name
|
22044 | * @memberof google.protobuf.EnumValueDescriptorProto
|
22045 | * @instance
|
22046 | */
|
22047 | EnumValueDescriptorProto.prototype.name = "";
|
22048 |
|
22049 | /**
|
22050 | * EnumValueDescriptorProto number.
|
22051 | * @member {number} number
|
22052 | * @memberof google.protobuf.EnumValueDescriptorProto
|
22053 | * @instance
|
22054 | */
|
22055 | EnumValueDescriptorProto.prototype.number = 0;
|
22056 |
|
22057 | /**
|
22058 | * EnumValueDescriptorProto options.
|
22059 | * @member {google.protobuf.IEnumValueOptions|null|undefined} options
|
22060 | * @memberof google.protobuf.EnumValueDescriptorProto
|
22061 | * @instance
|
22062 | */
|
22063 | EnumValueDescriptorProto.prototype.options = null;
|
22064 |
|
22065 | /**
|
22066 | * Creates a new EnumValueDescriptorProto instance using the specified properties.
|
22067 | * @function create
|
22068 | * @memberof google.protobuf.EnumValueDescriptorProto
|
22069 | * @static
|
22070 | * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set
|
22071 | * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance
|
22072 | */
|
22073 | EnumValueDescriptorProto.create = function create(properties) {
|
22074 | return new EnumValueDescriptorProto(properties);
|
22075 | };
|
22076 |
|
22077 | /**
|
22078 | * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages.
|
22079 | * @function encode
|
22080 | * @memberof google.protobuf.EnumValueDescriptorProto
|
22081 | * @static
|
22082 | * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode
|
22083 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
22084 | * @returns {$protobuf.Writer} Writer
|
22085 | */
|
22086 | EnumValueDescriptorProto.encode = function encode(message, writer) {
|
22087 | if (!writer)
|
22088 | writer = $Writer.create();
|
22089 | if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
22090 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
|
22091 | if (message.number != null && Object.hasOwnProperty.call(message, "number"))
|
22092 | writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number);
|
22093 | if (message.options != null && Object.hasOwnProperty.call(message, "options"))
|
22094 | $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
|
22095 | return writer;
|
22096 | };
|
22097 |
|
22098 | /**
|
22099 | * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages.
|
22100 | * @function encodeDelimited
|
22101 | * @memberof google.protobuf.EnumValueDescriptorProto
|
22102 | * @static
|
22103 | * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode
|
22104 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
22105 | * @returns {$protobuf.Writer} Writer
|
22106 | */
|
22107 | EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) {
|
22108 | return this.encode(message, writer).ldelim();
|
22109 | };
|
22110 |
|
22111 | /**
|
22112 | * Decodes an EnumValueDescriptorProto message from the specified reader or buffer.
|
22113 | * @function decode
|
22114 | * @memberof google.protobuf.EnumValueDescriptorProto
|
22115 | * @static
|
22116 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
22117 | * @param {number} [length] Message length if known beforehand
|
22118 | * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto
|
22119 | * @throws {Error} If the payload is not a reader or valid buffer
|
22120 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
22121 | */
|
22122 | EnumValueDescriptorProto.decode = function decode(reader, length) {
|
22123 | if (!(reader instanceof $Reader))
|
22124 | reader = $Reader.create(reader);
|
22125 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto();
|
22126 | while (reader.pos < end) {
|
22127 | var tag = reader.uint32();
|
22128 | switch (tag >>> 3) {
|
22129 | case 1:
|
22130 | message.name = reader.string();
|
22131 | break;
|
22132 | case 2:
|
22133 | message.number = reader.int32();
|
22134 | break;
|
22135 | case 3:
|
22136 | message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32());
|
22137 | break;
|
22138 | default:
|
22139 | reader.skipType(tag & 7);
|
22140 | break;
|
22141 | }
|
22142 | }
|
22143 | return message;
|
22144 | };
|
22145 |
|
22146 | /**
|
22147 | * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited.
|
22148 | * @function decodeDelimited
|
22149 | * @memberof google.protobuf.EnumValueDescriptorProto
|
22150 | * @static
|
22151 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
22152 | * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto
|
22153 | * @throws {Error} If the payload is not a reader or valid buffer
|
22154 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
22155 | */
|
22156 | EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) {
|
22157 | if (!(reader instanceof $Reader))
|
22158 | reader = new $Reader(reader);
|
22159 | return this.decode(reader, reader.uint32());
|
22160 | };
|
22161 |
|
22162 | /**
|
22163 | * Verifies an EnumValueDescriptorProto message.
|
22164 | * @function verify
|
22165 | * @memberof google.protobuf.EnumValueDescriptorProto
|
22166 | * @static
|
22167 | * @param {Object.<string,*>} message Plain object to verify
|
22168 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
22169 | */
|
22170 | EnumValueDescriptorProto.verify = function verify(message) {
|
22171 | if (typeof message !== "object" || message === null)
|
22172 | return "object expected";
|
22173 | if (message.name != null && message.hasOwnProperty("name"))
|
22174 | if (!$util.isString(message.name))
|
22175 | return "name: string expected";
|
22176 | if (message.number != null && message.hasOwnProperty("number"))
|
22177 | if (!$util.isInteger(message.number))
|
22178 | return "number: integer expected";
|
22179 | if (message.options != null && message.hasOwnProperty("options")) {
|
22180 | var error = $root.google.protobuf.EnumValueOptions.verify(message.options);
|
22181 | if (error)
|
22182 | return "options." + error;
|
22183 | }
|
22184 | return null;
|
22185 | };
|
22186 |
|
22187 | /**
|
22188 | * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types.
|
22189 | * @function fromObject
|
22190 | * @memberof google.protobuf.EnumValueDescriptorProto
|
22191 | * @static
|
22192 | * @param {Object.<string,*>} object Plain object
|
22193 | * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto
|
22194 | */
|
22195 | EnumValueDescriptorProto.fromObject = function fromObject(object) {
|
22196 | if (object instanceof $root.google.protobuf.EnumValueDescriptorProto)
|
22197 | return object;
|
22198 | var message = new $root.google.protobuf.EnumValueDescriptorProto();
|
22199 | if (object.name != null)
|
22200 | message.name = String(object.name);
|
22201 | if (object.number != null)
|
22202 | message.number = object.number | 0;
|
22203 | if (object.options != null) {
|
22204 | if (typeof object.options !== "object")
|
22205 | throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected");
|
22206 | message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options);
|
22207 | }
|
22208 | return message;
|
22209 | };
|
22210 |
|
22211 | /**
|
22212 | * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified.
|
22213 | * @function toObject
|
22214 | * @memberof google.protobuf.EnumValueDescriptorProto
|
22215 | * @static
|
22216 | * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto
|
22217 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
22218 | * @returns {Object.<string,*>} Plain object
|
22219 | */
|
22220 | EnumValueDescriptorProto.toObject = function toObject(message, options) {
|
22221 | if (!options)
|
22222 | options = {};
|
22223 | var object = {};
|
22224 | if (options.defaults) {
|
22225 | object.name = "";
|
22226 | object.number = 0;
|
22227 | object.options = null;
|
22228 | }
|
22229 | if (message.name != null && message.hasOwnProperty("name"))
|
22230 | object.name = message.name;
|
22231 | if (message.number != null && message.hasOwnProperty("number"))
|
22232 | object.number = message.number;
|
22233 | if (message.options != null && message.hasOwnProperty("options"))
|
22234 | object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options);
|
22235 | return object;
|
22236 | };
|
22237 |
|
22238 | /**
|
22239 | * Converts this EnumValueDescriptorProto to JSON.
|
22240 | * @function toJSON
|
22241 | * @memberof google.protobuf.EnumValueDescriptorProto
|
22242 | * @instance
|
22243 | * @returns {Object.<string,*>} JSON object
|
22244 | */
|
22245 | EnumValueDescriptorProto.prototype.toJSON = function toJSON() {
|
22246 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
22247 | };
|
22248 |
|
22249 | return EnumValueDescriptorProto;
|
22250 | })();
|
22251 |
|
22252 | protobuf.ServiceDescriptorProto = (function() {
|
22253 |
|
22254 | /**
|
22255 | * Properties of a ServiceDescriptorProto.
|
22256 | * @memberof google.protobuf
|
22257 | * @interface IServiceDescriptorProto
|
22258 | * @property {string|null} [name] ServiceDescriptorProto name
|
22259 | * @property {Array.<google.protobuf.IMethodDescriptorProto>|null} [method] ServiceDescriptorProto method
|
22260 | * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options
|
22261 | */
|
22262 |
|
22263 | /**
|
22264 | * Constructs a new ServiceDescriptorProto.
|
22265 | * @memberof google.protobuf
|
22266 | * @classdesc Represents a ServiceDescriptorProto.
|
22267 | * @implements IServiceDescriptorProto
|
22268 | * @constructor
|
22269 | * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set
|
22270 | */
|
22271 | function ServiceDescriptorProto(properties) {
|
22272 | this.method = [];
|
22273 | if (properties)
|
22274 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
22275 | if (properties[keys[i]] != null)
|
22276 | this[keys[i]] = properties[keys[i]];
|
22277 | }
|
22278 |
|
22279 | /**
|
22280 | * ServiceDescriptorProto name.
|
22281 | * @member {string} name
|
22282 | * @memberof google.protobuf.ServiceDescriptorProto
|
22283 | * @instance
|
22284 | */
|
22285 | ServiceDescriptorProto.prototype.name = "";
|
22286 |
|
22287 | /**
|
22288 | * ServiceDescriptorProto method.
|
22289 | * @member {Array.<google.protobuf.IMethodDescriptorProto>} method
|
22290 | * @memberof google.protobuf.ServiceDescriptorProto
|
22291 | * @instance
|
22292 | */
|
22293 | ServiceDescriptorProto.prototype.method = $util.emptyArray;
|
22294 |
|
22295 | /**
|
22296 | * ServiceDescriptorProto options.
|
22297 | * @member {google.protobuf.IServiceOptions|null|undefined} options
|
22298 | * @memberof google.protobuf.ServiceDescriptorProto
|
22299 | * @instance
|
22300 | */
|
22301 | ServiceDescriptorProto.prototype.options = null;
|
22302 |
|
22303 | /**
|
22304 | * Creates a new ServiceDescriptorProto instance using the specified properties.
|
22305 | * @function create
|
22306 | * @memberof google.protobuf.ServiceDescriptorProto
|
22307 | * @static
|
22308 | * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set
|
22309 | * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance
|
22310 | */
|
22311 | ServiceDescriptorProto.create = function create(properties) {
|
22312 | return new ServiceDescriptorProto(properties);
|
22313 | };
|
22314 |
|
22315 | /**
|
22316 | * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages.
|
22317 | * @function encode
|
22318 | * @memberof google.protobuf.ServiceDescriptorProto
|
22319 | * @static
|
22320 | * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode
|
22321 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
22322 | * @returns {$protobuf.Writer} Writer
|
22323 | */
|
22324 | ServiceDescriptorProto.encode = function encode(message, writer) {
|
22325 | if (!writer)
|
22326 | writer = $Writer.create();
|
22327 | if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
22328 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
|
22329 | if (message.method != null && message.method.length)
|
22330 | for (var i = 0; i < message.method.length; ++i)
|
22331 | $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
22332 | if (message.options != null && Object.hasOwnProperty.call(message, "options"))
|
22333 | $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
|
22334 | return writer;
|
22335 | };
|
22336 |
|
22337 | /**
|
22338 | * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages.
|
22339 | * @function encodeDelimited
|
22340 | * @memberof google.protobuf.ServiceDescriptorProto
|
22341 | * @static
|
22342 | * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode
|
22343 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
22344 | * @returns {$protobuf.Writer} Writer
|
22345 | */
|
22346 | ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) {
|
22347 | return this.encode(message, writer).ldelim();
|
22348 | };
|
22349 |
|
22350 | /**
|
22351 | * Decodes a ServiceDescriptorProto message from the specified reader or buffer.
|
22352 | * @function decode
|
22353 | * @memberof google.protobuf.ServiceDescriptorProto
|
22354 | * @static
|
22355 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
22356 | * @param {number} [length] Message length if known beforehand
|
22357 | * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto
|
22358 | * @throws {Error} If the payload is not a reader or valid buffer
|
22359 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
22360 | */
|
22361 | ServiceDescriptorProto.decode = function decode(reader, length) {
|
22362 | if (!(reader instanceof $Reader))
|
22363 | reader = $Reader.create(reader);
|
22364 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto();
|
22365 | while (reader.pos < end) {
|
22366 | var tag = reader.uint32();
|
22367 | switch (tag >>> 3) {
|
22368 | case 1:
|
22369 | message.name = reader.string();
|
22370 | break;
|
22371 | case 2:
|
22372 | if (!(message.method && message.method.length))
|
22373 | message.method = [];
|
22374 | message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32()));
|
22375 | break;
|
22376 | case 3:
|
22377 | message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32());
|
22378 | break;
|
22379 | default:
|
22380 | reader.skipType(tag & 7);
|
22381 | break;
|
22382 | }
|
22383 | }
|
22384 | return message;
|
22385 | };
|
22386 |
|
22387 | /**
|
22388 | * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited.
|
22389 | * @function decodeDelimited
|
22390 | * @memberof google.protobuf.ServiceDescriptorProto
|
22391 | * @static
|
22392 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
22393 | * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto
|
22394 | * @throws {Error} If the payload is not a reader or valid buffer
|
22395 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
22396 | */
|
22397 | ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) {
|
22398 | if (!(reader instanceof $Reader))
|
22399 | reader = new $Reader(reader);
|
22400 | return this.decode(reader, reader.uint32());
|
22401 | };
|
22402 |
|
22403 | /**
|
22404 | * Verifies a ServiceDescriptorProto message.
|
22405 | * @function verify
|
22406 | * @memberof google.protobuf.ServiceDescriptorProto
|
22407 | * @static
|
22408 | * @param {Object.<string,*>} message Plain object to verify
|
22409 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
22410 | */
|
22411 | ServiceDescriptorProto.verify = function verify(message) {
|
22412 | if (typeof message !== "object" || message === null)
|
22413 | return "object expected";
|
22414 | if (message.name != null && message.hasOwnProperty("name"))
|
22415 | if (!$util.isString(message.name))
|
22416 | return "name: string expected";
|
22417 | if (message.method != null && message.hasOwnProperty("method")) {
|
22418 | if (!Array.isArray(message.method))
|
22419 | return "method: array expected";
|
22420 | for (var i = 0; i < message.method.length; ++i) {
|
22421 | var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]);
|
22422 | if (error)
|
22423 | return "method." + error;
|
22424 | }
|
22425 | }
|
22426 | if (message.options != null && message.hasOwnProperty("options")) {
|
22427 | var error = $root.google.protobuf.ServiceOptions.verify(message.options);
|
22428 | if (error)
|
22429 | return "options." + error;
|
22430 | }
|
22431 | return null;
|
22432 | };
|
22433 |
|
22434 | /**
|
22435 | * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types.
|
22436 | * @function fromObject
|
22437 | * @memberof google.protobuf.ServiceDescriptorProto
|
22438 | * @static
|
22439 | * @param {Object.<string,*>} object Plain object
|
22440 | * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto
|
22441 | */
|
22442 | ServiceDescriptorProto.fromObject = function fromObject(object) {
|
22443 | if (object instanceof $root.google.protobuf.ServiceDescriptorProto)
|
22444 | return object;
|
22445 | var message = new $root.google.protobuf.ServiceDescriptorProto();
|
22446 | if (object.name != null)
|
22447 | message.name = String(object.name);
|
22448 | if (object.method) {
|
22449 | if (!Array.isArray(object.method))
|
22450 | throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected");
|
22451 | message.method = [];
|
22452 | for (var i = 0; i < object.method.length; ++i) {
|
22453 | if (typeof object.method[i] !== "object")
|
22454 | throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected");
|
22455 | message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]);
|
22456 | }
|
22457 | }
|
22458 | if (object.options != null) {
|
22459 | if (typeof object.options !== "object")
|
22460 | throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected");
|
22461 | message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options);
|
22462 | }
|
22463 | return message;
|
22464 | };
|
22465 |
|
22466 | /**
|
22467 | * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified.
|
22468 | * @function toObject
|
22469 | * @memberof google.protobuf.ServiceDescriptorProto
|
22470 | * @static
|
22471 | * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto
|
22472 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
22473 | * @returns {Object.<string,*>} Plain object
|
22474 | */
|
22475 | ServiceDescriptorProto.toObject = function toObject(message, options) {
|
22476 | if (!options)
|
22477 | options = {};
|
22478 | var object = {};
|
22479 | if (options.arrays || options.defaults)
|
22480 | object.method = [];
|
22481 | if (options.defaults) {
|
22482 | object.name = "";
|
22483 | object.options = null;
|
22484 | }
|
22485 | if (message.name != null && message.hasOwnProperty("name"))
|
22486 | object.name = message.name;
|
22487 | if (message.method && message.method.length) {
|
22488 | object.method = [];
|
22489 | for (var j = 0; j < message.method.length; ++j)
|
22490 | object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options);
|
22491 | }
|
22492 | if (message.options != null && message.hasOwnProperty("options"))
|
22493 | object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options);
|
22494 | return object;
|
22495 | };
|
22496 |
|
22497 | /**
|
22498 | * Converts this ServiceDescriptorProto to JSON.
|
22499 | * @function toJSON
|
22500 | * @memberof google.protobuf.ServiceDescriptorProto
|
22501 | * @instance
|
22502 | * @returns {Object.<string,*>} JSON object
|
22503 | */
|
22504 | ServiceDescriptorProto.prototype.toJSON = function toJSON() {
|
22505 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
22506 | };
|
22507 |
|
22508 | return ServiceDescriptorProto;
|
22509 | })();
|
22510 |
|
22511 | protobuf.MethodDescriptorProto = (function() {
|
22512 |
|
22513 | /**
|
22514 | * Properties of a MethodDescriptorProto.
|
22515 | * @memberof google.protobuf
|
22516 | * @interface IMethodDescriptorProto
|
22517 | * @property {string|null} [name] MethodDescriptorProto name
|
22518 | * @property {string|null} [inputType] MethodDescriptorProto inputType
|
22519 | * @property {string|null} [outputType] MethodDescriptorProto outputType
|
22520 | * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options
|
22521 | * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming
|
22522 | * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming
|
22523 | */
|
22524 |
|
22525 | /**
|
22526 | * Constructs a new MethodDescriptorProto.
|
22527 | * @memberof google.protobuf
|
22528 | * @classdesc Represents a MethodDescriptorProto.
|
22529 | * @implements IMethodDescriptorProto
|
22530 | * @constructor
|
22531 | * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set
|
22532 | */
|
22533 | function MethodDescriptorProto(properties) {
|
22534 | if (properties)
|
22535 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
22536 | if (properties[keys[i]] != null)
|
22537 | this[keys[i]] = properties[keys[i]];
|
22538 | }
|
22539 |
|
22540 | /**
|
22541 | * MethodDescriptorProto name.
|
22542 | * @member {string} name
|
22543 | * @memberof google.protobuf.MethodDescriptorProto
|
22544 | * @instance
|
22545 | */
|
22546 | MethodDescriptorProto.prototype.name = "";
|
22547 |
|
22548 | /**
|
22549 | * MethodDescriptorProto inputType.
|
22550 | * @member {string} inputType
|
22551 | * @memberof google.protobuf.MethodDescriptorProto
|
22552 | * @instance
|
22553 | */
|
22554 | MethodDescriptorProto.prototype.inputType = "";
|
22555 |
|
22556 | /**
|
22557 | * MethodDescriptorProto outputType.
|
22558 | * @member {string} outputType
|
22559 | * @memberof google.protobuf.MethodDescriptorProto
|
22560 | * @instance
|
22561 | */
|
22562 | MethodDescriptorProto.prototype.outputType = "";
|
22563 |
|
22564 | /**
|
22565 | * MethodDescriptorProto options.
|
22566 | * @member {google.protobuf.IMethodOptions|null|undefined} options
|
22567 | * @memberof google.protobuf.MethodDescriptorProto
|
22568 | * @instance
|
22569 | */
|
22570 | MethodDescriptorProto.prototype.options = null;
|
22571 |
|
22572 | /**
|
22573 | * MethodDescriptorProto clientStreaming.
|
22574 | * @member {boolean} clientStreaming
|
22575 | * @memberof google.protobuf.MethodDescriptorProto
|
22576 | * @instance
|
22577 | */
|
22578 | MethodDescriptorProto.prototype.clientStreaming = false;
|
22579 |
|
22580 | /**
|
22581 | * MethodDescriptorProto serverStreaming.
|
22582 | * @member {boolean} serverStreaming
|
22583 | * @memberof google.protobuf.MethodDescriptorProto
|
22584 | * @instance
|
22585 | */
|
22586 | MethodDescriptorProto.prototype.serverStreaming = false;
|
22587 |
|
22588 | /**
|
22589 | * Creates a new MethodDescriptorProto instance using the specified properties.
|
22590 | * @function create
|
22591 | * @memberof google.protobuf.MethodDescriptorProto
|
22592 | * @static
|
22593 | * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set
|
22594 | * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance
|
22595 | */
|
22596 | MethodDescriptorProto.create = function create(properties) {
|
22597 | return new MethodDescriptorProto(properties);
|
22598 | };
|
22599 |
|
22600 | /**
|
22601 | * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages.
|
22602 | * @function encode
|
22603 | * @memberof google.protobuf.MethodDescriptorProto
|
22604 | * @static
|
22605 | * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode
|
22606 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
22607 | * @returns {$protobuf.Writer} Writer
|
22608 | */
|
22609 | MethodDescriptorProto.encode = function encode(message, writer) {
|
22610 | if (!writer)
|
22611 | writer = $Writer.create();
|
22612 | if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
22613 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
|
22614 | if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType"))
|
22615 | writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType);
|
22616 | if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType"))
|
22617 | writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType);
|
22618 | if (message.options != null && Object.hasOwnProperty.call(message, "options"))
|
22619 | $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
|
22620 | if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming"))
|
22621 | writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming);
|
22622 | if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming"))
|
22623 | writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming);
|
22624 | return writer;
|
22625 | };
|
22626 |
|
22627 | /**
|
22628 | * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages.
|
22629 | * @function encodeDelimited
|
22630 | * @memberof google.protobuf.MethodDescriptorProto
|
22631 | * @static
|
22632 | * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode
|
22633 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
22634 | * @returns {$protobuf.Writer} Writer
|
22635 | */
|
22636 | MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) {
|
22637 | return this.encode(message, writer).ldelim();
|
22638 | };
|
22639 |
|
22640 | /**
|
22641 | * Decodes a MethodDescriptorProto message from the specified reader or buffer.
|
22642 | * @function decode
|
22643 | * @memberof google.protobuf.MethodDescriptorProto
|
22644 | * @static
|
22645 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
22646 | * @param {number} [length] Message length if known beforehand
|
22647 | * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto
|
22648 | * @throws {Error} If the payload is not a reader or valid buffer
|
22649 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
22650 | */
|
22651 | MethodDescriptorProto.decode = function decode(reader, length) {
|
22652 | if (!(reader instanceof $Reader))
|
22653 | reader = $Reader.create(reader);
|
22654 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto();
|
22655 | while (reader.pos < end) {
|
22656 | var tag = reader.uint32();
|
22657 | switch (tag >>> 3) {
|
22658 | case 1:
|
22659 | message.name = reader.string();
|
22660 | break;
|
22661 | case 2:
|
22662 | message.inputType = reader.string();
|
22663 | break;
|
22664 | case 3:
|
22665 | message.outputType = reader.string();
|
22666 | break;
|
22667 | case 4:
|
22668 | message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32());
|
22669 | break;
|
22670 | case 5:
|
22671 | message.clientStreaming = reader.bool();
|
22672 | break;
|
22673 | case 6:
|
22674 | message.serverStreaming = reader.bool();
|
22675 | break;
|
22676 | default:
|
22677 | reader.skipType(tag & 7);
|
22678 | break;
|
22679 | }
|
22680 | }
|
22681 | return message;
|
22682 | };
|
22683 |
|
22684 | /**
|
22685 | * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited.
|
22686 | * @function decodeDelimited
|
22687 | * @memberof google.protobuf.MethodDescriptorProto
|
22688 | * @static
|
22689 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
22690 | * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto
|
22691 | * @throws {Error} If the payload is not a reader or valid buffer
|
22692 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
22693 | */
|
22694 | MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) {
|
22695 | if (!(reader instanceof $Reader))
|
22696 | reader = new $Reader(reader);
|
22697 | return this.decode(reader, reader.uint32());
|
22698 | };
|
22699 |
|
22700 | /**
|
22701 | * Verifies a MethodDescriptorProto message.
|
22702 | * @function verify
|
22703 | * @memberof google.protobuf.MethodDescriptorProto
|
22704 | * @static
|
22705 | * @param {Object.<string,*>} message Plain object to verify
|
22706 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
22707 | */
|
22708 | MethodDescriptorProto.verify = function verify(message) {
|
22709 | if (typeof message !== "object" || message === null)
|
22710 | return "object expected";
|
22711 | if (message.name != null && message.hasOwnProperty("name"))
|
22712 | if (!$util.isString(message.name))
|
22713 | return "name: string expected";
|
22714 | if (message.inputType != null && message.hasOwnProperty("inputType"))
|
22715 | if (!$util.isString(message.inputType))
|
22716 | return "inputType: string expected";
|
22717 | if (message.outputType != null && message.hasOwnProperty("outputType"))
|
22718 | if (!$util.isString(message.outputType))
|
22719 | return "outputType: string expected";
|
22720 | if (message.options != null && message.hasOwnProperty("options")) {
|
22721 | var error = $root.google.protobuf.MethodOptions.verify(message.options);
|
22722 | if (error)
|
22723 | return "options." + error;
|
22724 | }
|
22725 | if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming"))
|
22726 | if (typeof message.clientStreaming !== "boolean")
|
22727 | return "clientStreaming: boolean expected";
|
22728 | if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming"))
|
22729 | if (typeof message.serverStreaming !== "boolean")
|
22730 | return "serverStreaming: boolean expected";
|
22731 | return null;
|
22732 | };
|
22733 |
|
22734 | /**
|
22735 | * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types.
|
22736 | * @function fromObject
|
22737 | * @memberof google.protobuf.MethodDescriptorProto
|
22738 | * @static
|
22739 | * @param {Object.<string,*>} object Plain object
|
22740 | * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto
|
22741 | */
|
22742 | MethodDescriptorProto.fromObject = function fromObject(object) {
|
22743 | if (object instanceof $root.google.protobuf.MethodDescriptorProto)
|
22744 | return object;
|
22745 | var message = new $root.google.protobuf.MethodDescriptorProto();
|
22746 | if (object.name != null)
|
22747 | message.name = String(object.name);
|
22748 | if (object.inputType != null)
|
22749 | message.inputType = String(object.inputType);
|
22750 | if (object.outputType != null)
|
22751 | message.outputType = String(object.outputType);
|
22752 | if (object.options != null) {
|
22753 | if (typeof object.options !== "object")
|
22754 | throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected");
|
22755 | message.options = $root.google.protobuf.MethodOptions.fromObject(object.options);
|
22756 | }
|
22757 | if (object.clientStreaming != null)
|
22758 | message.clientStreaming = Boolean(object.clientStreaming);
|
22759 | if (object.serverStreaming != null)
|
22760 | message.serverStreaming = Boolean(object.serverStreaming);
|
22761 | return message;
|
22762 | };
|
22763 |
|
22764 | /**
|
22765 | * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified.
|
22766 | * @function toObject
|
22767 | * @memberof google.protobuf.MethodDescriptorProto
|
22768 | * @static
|
22769 | * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto
|
22770 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
22771 | * @returns {Object.<string,*>} Plain object
|
22772 | */
|
22773 | MethodDescriptorProto.toObject = function toObject(message, options) {
|
22774 | if (!options)
|
22775 | options = {};
|
22776 | var object = {};
|
22777 | if (options.defaults) {
|
22778 | object.name = "";
|
22779 | object.inputType = "";
|
22780 | object.outputType = "";
|
22781 | object.options = null;
|
22782 | object.clientStreaming = false;
|
22783 | object.serverStreaming = false;
|
22784 | }
|
22785 | if (message.name != null && message.hasOwnProperty("name"))
|
22786 | object.name = message.name;
|
22787 | if (message.inputType != null && message.hasOwnProperty("inputType"))
|
22788 | object.inputType = message.inputType;
|
22789 | if (message.outputType != null && message.hasOwnProperty("outputType"))
|
22790 | object.outputType = message.outputType;
|
22791 | if (message.options != null && message.hasOwnProperty("options"))
|
22792 | object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options);
|
22793 | if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming"))
|
22794 | object.clientStreaming = message.clientStreaming;
|
22795 | if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming"))
|
22796 | object.serverStreaming = message.serverStreaming;
|
22797 | return object;
|
22798 | };
|
22799 |
|
22800 | /**
|
22801 | * Converts this MethodDescriptorProto to JSON.
|
22802 | * @function toJSON
|
22803 | * @memberof google.protobuf.MethodDescriptorProto
|
22804 | * @instance
|
22805 | * @returns {Object.<string,*>} JSON object
|
22806 | */
|
22807 | MethodDescriptorProto.prototype.toJSON = function toJSON() {
|
22808 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
22809 | };
|
22810 |
|
22811 | return MethodDescriptorProto;
|
22812 | })();
|
22813 |
|
22814 | protobuf.FileOptions = (function() {
|
22815 |
|
22816 | /**
|
22817 | * Properties of a FileOptions.
|
22818 | * @memberof google.protobuf
|
22819 | * @interface IFileOptions
|
22820 | * @property {string|null} [javaPackage] FileOptions javaPackage
|
22821 | * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname
|
22822 | * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles
|
22823 | * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash
|
22824 | * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8
|
22825 | * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor
|
22826 | * @property {string|null} [goPackage] FileOptions goPackage
|
22827 | * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices
|
22828 | * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices
|
22829 | * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices
|
22830 | * @property {boolean|null} [phpGenericServices] FileOptions phpGenericServices
|
22831 | * @property {boolean|null} [deprecated] FileOptions deprecated
|
22832 | * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas
|
22833 | * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix
|
22834 | * @property {string|null} [csharpNamespace] FileOptions csharpNamespace
|
22835 | * @property {string|null} [swiftPrefix] FileOptions swiftPrefix
|
22836 | * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix
|
22837 | * @property {string|null} [phpNamespace] FileOptions phpNamespace
|
22838 | * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace
|
22839 | * @property {string|null} [rubyPackage] FileOptions rubyPackage
|
22840 | * @property {Array.<google.protobuf.IUninterpretedOption>|null} [uninterpretedOption] FileOptions uninterpretedOption
|
22841 | * @property {Array.<google.api.IResourceDescriptor>|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition
|
22842 | */
|
22843 |
|
22844 | /**
|
22845 | * Constructs a new FileOptions.
|
22846 | * @memberof google.protobuf
|
22847 | * @classdesc Represents a FileOptions.
|
22848 | * @implements IFileOptions
|
22849 | * @constructor
|
22850 | * @param {google.protobuf.IFileOptions=} [properties] Properties to set
|
22851 | */
|
22852 | function FileOptions(properties) {
|
22853 | this.uninterpretedOption = [];
|
22854 | this[".google.api.resourceDefinition"] = [];
|
22855 | if (properties)
|
22856 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
22857 | if (properties[keys[i]] != null)
|
22858 | this[keys[i]] = properties[keys[i]];
|
22859 | }
|
22860 |
|
22861 | /**
|
22862 | * FileOptions javaPackage.
|
22863 | * @member {string} javaPackage
|
22864 | * @memberof google.protobuf.FileOptions
|
22865 | * @instance
|
22866 | */
|
22867 | FileOptions.prototype.javaPackage = "";
|
22868 |
|
22869 | /**
|
22870 | * FileOptions javaOuterClassname.
|
22871 | * @member {string} javaOuterClassname
|
22872 | * @memberof google.protobuf.FileOptions
|
22873 | * @instance
|
22874 | */
|
22875 | FileOptions.prototype.javaOuterClassname = "";
|
22876 |
|
22877 | /**
|
22878 | * FileOptions javaMultipleFiles.
|
22879 | * @member {boolean} javaMultipleFiles
|
22880 | * @memberof google.protobuf.FileOptions
|
22881 | * @instance
|
22882 | */
|
22883 | FileOptions.prototype.javaMultipleFiles = false;
|
22884 |
|
22885 | /**
|
22886 | * FileOptions javaGenerateEqualsAndHash.
|
22887 | * @member {boolean} javaGenerateEqualsAndHash
|
22888 | * @memberof google.protobuf.FileOptions
|
22889 | * @instance
|
22890 | */
|
22891 | FileOptions.prototype.javaGenerateEqualsAndHash = false;
|
22892 |
|
22893 | /**
|
22894 | * FileOptions javaStringCheckUtf8.
|
22895 | * @member {boolean} javaStringCheckUtf8
|
22896 | * @memberof google.protobuf.FileOptions
|
22897 | * @instance
|
22898 | */
|
22899 | FileOptions.prototype.javaStringCheckUtf8 = false;
|
22900 |
|
22901 | /**
|
22902 | * FileOptions optimizeFor.
|
22903 | * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor
|
22904 | * @memberof google.protobuf.FileOptions
|
22905 | * @instance
|
22906 | */
|
22907 | FileOptions.prototype.optimizeFor = 1;
|
22908 |
|
22909 | /**
|
22910 | * FileOptions goPackage.
|
22911 | * @member {string} goPackage
|
22912 | * @memberof google.protobuf.FileOptions
|
22913 | * @instance
|
22914 | */
|
22915 | FileOptions.prototype.goPackage = "";
|
22916 |
|
22917 | /**
|
22918 | * FileOptions ccGenericServices.
|
22919 | * @member {boolean} ccGenericServices
|
22920 | * @memberof google.protobuf.FileOptions
|
22921 | * @instance
|
22922 | */
|
22923 | FileOptions.prototype.ccGenericServices = false;
|
22924 |
|
22925 | /**
|
22926 | * FileOptions javaGenericServices.
|
22927 | * @member {boolean} javaGenericServices
|
22928 | * @memberof google.protobuf.FileOptions
|
22929 | * @instance
|
22930 | */
|
22931 | FileOptions.prototype.javaGenericServices = false;
|
22932 |
|
22933 | /**
|
22934 | * FileOptions pyGenericServices.
|
22935 | * @member {boolean} pyGenericServices
|
22936 | * @memberof google.protobuf.FileOptions
|
22937 | * @instance
|
22938 | */
|
22939 | FileOptions.prototype.pyGenericServices = false;
|
22940 |
|
22941 | /**
|
22942 | * FileOptions phpGenericServices.
|
22943 | * @member {boolean} phpGenericServices
|
22944 | * @memberof google.protobuf.FileOptions
|
22945 | * @instance
|
22946 | */
|
22947 | FileOptions.prototype.phpGenericServices = false;
|
22948 |
|
22949 | /**
|
22950 | * FileOptions deprecated.
|
22951 | * @member {boolean} deprecated
|
22952 | * @memberof google.protobuf.FileOptions
|
22953 | * @instance
|
22954 | */
|
22955 | FileOptions.prototype.deprecated = false;
|
22956 |
|
22957 | /**
|
22958 | * FileOptions ccEnableArenas.
|
22959 | * @member {boolean} ccEnableArenas
|
22960 | * @memberof google.protobuf.FileOptions
|
22961 | * @instance
|
22962 | */
|
22963 | FileOptions.prototype.ccEnableArenas = true;
|
22964 |
|
22965 | /**
|
22966 | * FileOptions objcClassPrefix.
|
22967 | * @member {string} objcClassPrefix
|
22968 | * @memberof google.protobuf.FileOptions
|
22969 | * @instance
|
22970 | */
|
22971 | FileOptions.prototype.objcClassPrefix = "";
|
22972 |
|
22973 | /**
|
22974 | * FileOptions csharpNamespace.
|
22975 | * @member {string} csharpNamespace
|
22976 | * @memberof google.protobuf.FileOptions
|
22977 | * @instance
|
22978 | */
|
22979 | FileOptions.prototype.csharpNamespace = "";
|
22980 |
|
22981 | /**
|
22982 | * FileOptions swiftPrefix.
|
22983 | * @member {string} swiftPrefix
|
22984 | * @memberof google.protobuf.FileOptions
|
22985 | * @instance
|
22986 | */
|
22987 | FileOptions.prototype.swiftPrefix = "";
|
22988 |
|
22989 | /**
|
22990 | * FileOptions phpClassPrefix.
|
22991 | * @member {string} phpClassPrefix
|
22992 | * @memberof google.protobuf.FileOptions
|
22993 | * @instance
|
22994 | */
|
22995 | FileOptions.prototype.phpClassPrefix = "";
|
22996 |
|
22997 | /**
|
22998 | * FileOptions phpNamespace.
|
22999 | * @member {string} phpNamespace
|
23000 | * @memberof google.protobuf.FileOptions
|
23001 | * @instance
|
23002 | */
|
23003 | FileOptions.prototype.phpNamespace = "";
|
23004 |
|
23005 | /**
|
23006 | * FileOptions phpMetadataNamespace.
|
23007 | * @member {string} phpMetadataNamespace
|
23008 | * @memberof google.protobuf.FileOptions
|
23009 | * @instance
|
23010 | */
|
23011 | FileOptions.prototype.phpMetadataNamespace = "";
|
23012 |
|
23013 | /**
|
23014 | * FileOptions rubyPackage.
|
23015 | * @member {string} rubyPackage
|
23016 | * @memberof google.protobuf.FileOptions
|
23017 | * @instance
|
23018 | */
|
23019 | FileOptions.prototype.rubyPackage = "";
|
23020 |
|
23021 | /**
|
23022 | * FileOptions uninterpretedOption.
|
23023 | * @member {Array.<google.protobuf.IUninterpretedOption>} uninterpretedOption
|
23024 | * @memberof google.protobuf.FileOptions
|
23025 | * @instance
|
23026 | */
|
23027 | FileOptions.prototype.uninterpretedOption = $util.emptyArray;
|
23028 |
|
23029 | /**
|
23030 | * FileOptions .google.api.resourceDefinition.
|
23031 | * @member {Array.<google.api.IResourceDescriptor>} .google.api.resourceDefinition
|
23032 | * @memberof google.protobuf.FileOptions
|
23033 | * @instance
|
23034 | */
|
23035 | FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray;
|
23036 |
|
23037 | /**
|
23038 | * Creates a new FileOptions instance using the specified properties.
|
23039 | * @function create
|
23040 | * @memberof google.protobuf.FileOptions
|
23041 | * @static
|
23042 | * @param {google.protobuf.IFileOptions=} [properties] Properties to set
|
23043 | * @returns {google.protobuf.FileOptions} FileOptions instance
|
23044 | */
|
23045 | FileOptions.create = function create(properties) {
|
23046 | return new FileOptions(properties);
|
23047 | };
|
23048 |
|
23049 | /**
|
23050 | * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages.
|
23051 | * @function encode
|
23052 | * @memberof google.protobuf.FileOptions
|
23053 | * @static
|
23054 | * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode
|
23055 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
23056 | * @returns {$protobuf.Writer} Writer
|
23057 | */
|
23058 | FileOptions.encode = function encode(message, writer) {
|
23059 | if (!writer)
|
23060 | writer = $Writer.create();
|
23061 | if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage"))
|
23062 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage);
|
23063 | if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname"))
|
23064 | writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname);
|
23065 | if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor"))
|
23066 | writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor);
|
23067 | if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles"))
|
23068 | writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles);
|
23069 | if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage"))
|
23070 | writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage);
|
23071 | if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices"))
|
23072 | writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices);
|
23073 | if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices"))
|
23074 | writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices);
|
23075 | if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices"))
|
23076 | writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices);
|
23077 | if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash"))
|
23078 | writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash);
|
23079 | if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated"))
|
23080 | writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated);
|
23081 | if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8"))
|
23082 | writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8);
|
23083 | if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas"))
|
23084 | writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas);
|
23085 | if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix"))
|
23086 | writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix);
|
23087 | if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace"))
|
23088 | writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace);
|
23089 | if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix"))
|
23090 | writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix);
|
23091 | if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix"))
|
23092 | writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix);
|
23093 | if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace"))
|
23094 | writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace);
|
23095 | if (message.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices"))
|
23096 | writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices);
|
23097 | if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace"))
|
23098 | writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace);
|
23099 | if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage"))
|
23100 | writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage);
|
23101 | if (message.uninterpretedOption != null && message.uninterpretedOption.length)
|
23102 | for (var i = 0; i < message.uninterpretedOption.length; ++i)
|
23103 | $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim();
|
23104 | if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length)
|
23105 | for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i)
|
23106 | $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim();
|
23107 | return writer;
|
23108 | };
|
23109 |
|
23110 | /**
|
23111 | * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages.
|
23112 | * @function encodeDelimited
|
23113 | * @memberof google.protobuf.FileOptions
|
23114 | * @static
|
23115 | * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode
|
23116 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
23117 | * @returns {$protobuf.Writer} Writer
|
23118 | */
|
23119 | FileOptions.encodeDelimited = function encodeDelimited(message, writer) {
|
23120 | return this.encode(message, writer).ldelim();
|
23121 | };
|
23122 |
|
23123 | /**
|
23124 | * Decodes a FileOptions message from the specified reader or buffer.
|
23125 | * @function decode
|
23126 | * @memberof google.protobuf.FileOptions
|
23127 | * @static
|
23128 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
23129 | * @param {number} [length] Message length if known beforehand
|
23130 | * @returns {google.protobuf.FileOptions} FileOptions
|
23131 | * @throws {Error} If the payload is not a reader or valid buffer
|
23132 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
23133 | */
|
23134 | FileOptions.decode = function decode(reader, length) {
|
23135 | if (!(reader instanceof $Reader))
|
23136 | reader = $Reader.create(reader);
|
23137 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions();
|
23138 | while (reader.pos < end) {
|
23139 | var tag = reader.uint32();
|
23140 | switch (tag >>> 3) {
|
23141 | case 1:
|
23142 | message.javaPackage = reader.string();
|
23143 | break;
|
23144 | case 8:
|
23145 | message.javaOuterClassname = reader.string();
|
23146 | break;
|
23147 | case 10:
|
23148 | message.javaMultipleFiles = reader.bool();
|
23149 | break;
|
23150 | case 20:
|
23151 | message.javaGenerateEqualsAndHash = reader.bool();
|
23152 | break;
|
23153 | case 27:
|
23154 | message.javaStringCheckUtf8 = reader.bool();
|
23155 | break;
|
23156 | case 9:
|
23157 | message.optimizeFor = reader.int32();
|
23158 | break;
|
23159 | case 11:
|
23160 | message.goPackage = reader.string();
|
23161 | break;
|
23162 | case 16:
|
23163 | message.ccGenericServices = reader.bool();
|
23164 | break;
|
23165 | case 17:
|
23166 | message.javaGenericServices = reader.bool();
|
23167 | break;
|
23168 | case 18:
|
23169 | message.pyGenericServices = reader.bool();
|
23170 | break;
|
23171 | case 42:
|
23172 | message.phpGenericServices = reader.bool();
|
23173 | break;
|
23174 | case 23:
|
23175 | message.deprecated = reader.bool();
|
23176 | break;
|
23177 | case 31:
|
23178 | message.ccEnableArenas = reader.bool();
|
23179 | break;
|
23180 | case 36:
|
23181 | message.objcClassPrefix = reader.string();
|
23182 | break;
|
23183 | case 37:
|
23184 | message.csharpNamespace = reader.string();
|
23185 | break;
|
23186 | case 39:
|
23187 | message.swiftPrefix = reader.string();
|
23188 | break;
|
23189 | case 40:
|
23190 | message.phpClassPrefix = reader.string();
|
23191 | break;
|
23192 | case 41:
|
23193 | message.phpNamespace = reader.string();
|
23194 | break;
|
23195 | case 44:
|
23196 | message.phpMetadataNamespace = reader.string();
|
23197 | break;
|
23198 | case 45:
|
23199 | message.rubyPackage = reader.string();
|
23200 | break;
|
23201 | case 999:
|
23202 | if (!(message.uninterpretedOption && message.uninterpretedOption.length))
|
23203 | message.uninterpretedOption = [];
|
23204 | message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32()));
|
23205 | break;
|
23206 | case 1053:
|
23207 | if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length))
|
23208 | message[".google.api.resourceDefinition"] = [];
|
23209 | message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32()));
|
23210 | break;
|
23211 | default:
|
23212 | reader.skipType(tag & 7);
|
23213 | break;
|
23214 | }
|
23215 | }
|
23216 | return message;
|
23217 | };
|
23218 |
|
23219 | /**
|
23220 | * Decodes a FileOptions message from the specified reader or buffer, length delimited.
|
23221 | * @function decodeDelimited
|
23222 | * @memberof google.protobuf.FileOptions
|
23223 | * @static
|
23224 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
23225 | * @returns {google.protobuf.FileOptions} FileOptions
|
23226 | * @throws {Error} If the payload is not a reader or valid buffer
|
23227 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
23228 | */
|
23229 | FileOptions.decodeDelimited = function decodeDelimited(reader) {
|
23230 | if (!(reader instanceof $Reader))
|
23231 | reader = new $Reader(reader);
|
23232 | return this.decode(reader, reader.uint32());
|
23233 | };
|
23234 |
|
23235 | /**
|
23236 | * Verifies a FileOptions message.
|
23237 | * @function verify
|
23238 | * @memberof google.protobuf.FileOptions
|
23239 | * @static
|
23240 | * @param {Object.<string,*>} message Plain object to verify
|
23241 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
23242 | */
|
23243 | FileOptions.verify = function verify(message) {
|
23244 | if (typeof message !== "object" || message === null)
|
23245 | return "object expected";
|
23246 | if (message.javaPackage != null && message.hasOwnProperty("javaPackage"))
|
23247 | if (!$util.isString(message.javaPackage))
|
23248 | return "javaPackage: string expected";
|
23249 | if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname"))
|
23250 | if (!$util.isString(message.javaOuterClassname))
|
23251 | return "javaOuterClassname: string expected";
|
23252 | if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles"))
|
23253 | if (typeof message.javaMultipleFiles !== "boolean")
|
23254 | return "javaMultipleFiles: boolean expected";
|
23255 | if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash"))
|
23256 | if (typeof message.javaGenerateEqualsAndHash !== "boolean")
|
23257 | return "javaGenerateEqualsAndHash: boolean expected";
|
23258 | if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8"))
|
23259 | if (typeof message.javaStringCheckUtf8 !== "boolean")
|
23260 | return "javaStringCheckUtf8: boolean expected";
|
23261 | if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor"))
|
23262 | switch (message.optimizeFor) {
|
23263 | default:
|
23264 | return "optimizeFor: enum value expected";
|
23265 | case 1:
|
23266 | case 2:
|
23267 | case 3:
|
23268 | break;
|
23269 | }
|
23270 | if (message.goPackage != null && message.hasOwnProperty("goPackage"))
|
23271 | if (!$util.isString(message.goPackage))
|
23272 | return "goPackage: string expected";
|
23273 | if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices"))
|
23274 | if (typeof message.ccGenericServices !== "boolean")
|
23275 | return "ccGenericServices: boolean expected";
|
23276 | if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices"))
|
23277 | if (typeof message.javaGenericServices !== "boolean")
|
23278 | return "javaGenericServices: boolean expected";
|
23279 | if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices"))
|
23280 | if (typeof message.pyGenericServices !== "boolean")
|
23281 | return "pyGenericServices: boolean expected";
|
23282 | if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices"))
|
23283 | if (typeof message.phpGenericServices !== "boolean")
|
23284 | return "phpGenericServices: boolean expected";
|
23285 | if (message.deprecated != null && message.hasOwnProperty("deprecated"))
|
23286 | if (typeof message.deprecated !== "boolean")
|
23287 | return "deprecated: boolean expected";
|
23288 | if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas"))
|
23289 | if (typeof message.ccEnableArenas !== "boolean")
|
23290 | return "ccEnableArenas: boolean expected";
|
23291 | if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix"))
|
23292 | if (!$util.isString(message.objcClassPrefix))
|
23293 | return "objcClassPrefix: string expected";
|
23294 | if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace"))
|
23295 | if (!$util.isString(message.csharpNamespace))
|
23296 | return "csharpNamespace: string expected";
|
23297 | if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix"))
|
23298 | if (!$util.isString(message.swiftPrefix))
|
23299 | return "swiftPrefix: string expected";
|
23300 | if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix"))
|
23301 | if (!$util.isString(message.phpClassPrefix))
|
23302 | return "phpClassPrefix: string expected";
|
23303 | if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace"))
|
23304 | if (!$util.isString(message.phpNamespace))
|
23305 | return "phpNamespace: string expected";
|
23306 | if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace"))
|
23307 | if (!$util.isString(message.phpMetadataNamespace))
|
23308 | return "phpMetadataNamespace: string expected";
|
23309 | if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage"))
|
23310 | if (!$util.isString(message.rubyPackage))
|
23311 | return "rubyPackage: string expected";
|
23312 | if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) {
|
23313 | if (!Array.isArray(message.uninterpretedOption))
|
23314 | return "uninterpretedOption: array expected";
|
23315 | for (var i = 0; i < message.uninterpretedOption.length; ++i) {
|
23316 | var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]);
|
23317 | if (error)
|
23318 | return "uninterpretedOption." + error;
|
23319 | }
|
23320 | }
|
23321 | if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) {
|
23322 | if (!Array.isArray(message[".google.api.resourceDefinition"]))
|
23323 | return ".google.api.resourceDefinition: array expected";
|
23324 | for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) {
|
23325 | var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]);
|
23326 | if (error)
|
23327 | return ".google.api.resourceDefinition." + error;
|
23328 | }
|
23329 | }
|
23330 | return null;
|
23331 | };
|
23332 |
|
23333 | /**
|
23334 | * Creates a FileOptions message from a plain object. Also converts values to their respective internal types.
|
23335 | * @function fromObject
|
23336 | * @memberof google.protobuf.FileOptions
|
23337 | * @static
|
23338 | * @param {Object.<string,*>} object Plain object
|
23339 | * @returns {google.protobuf.FileOptions} FileOptions
|
23340 | */
|
23341 | FileOptions.fromObject = function fromObject(object) {
|
23342 | if (object instanceof $root.google.protobuf.FileOptions)
|
23343 | return object;
|
23344 | var message = new $root.google.protobuf.FileOptions();
|
23345 | if (object.javaPackage != null)
|
23346 | message.javaPackage = String(object.javaPackage);
|
23347 | if (object.javaOuterClassname != null)
|
23348 | message.javaOuterClassname = String(object.javaOuterClassname);
|
23349 | if (object.javaMultipleFiles != null)
|
23350 | message.javaMultipleFiles = Boolean(object.javaMultipleFiles);
|
23351 | if (object.javaGenerateEqualsAndHash != null)
|
23352 | message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash);
|
23353 | if (object.javaStringCheckUtf8 != null)
|
23354 | message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8);
|
23355 | switch (object.optimizeFor) {
|
23356 | case "SPEED":
|
23357 | case 1:
|
23358 | message.optimizeFor = 1;
|
23359 | break;
|
23360 | case "CODE_SIZE":
|
23361 | case 2:
|
23362 | message.optimizeFor = 2;
|
23363 | break;
|
23364 | case "LITE_RUNTIME":
|
23365 | case 3:
|
23366 | message.optimizeFor = 3;
|
23367 | break;
|
23368 | }
|
23369 | if (object.goPackage != null)
|
23370 | message.goPackage = String(object.goPackage);
|
23371 | if (object.ccGenericServices != null)
|
23372 | message.ccGenericServices = Boolean(object.ccGenericServices);
|
23373 | if (object.javaGenericServices != null)
|
23374 | message.javaGenericServices = Boolean(object.javaGenericServices);
|
23375 | if (object.pyGenericServices != null)
|
23376 | message.pyGenericServices = Boolean(object.pyGenericServices);
|
23377 | if (object.phpGenericServices != null)
|
23378 | message.phpGenericServices = Boolean(object.phpGenericServices);
|
23379 | if (object.deprecated != null)
|
23380 | message.deprecated = Boolean(object.deprecated);
|
23381 | if (object.ccEnableArenas != null)
|
23382 | message.ccEnableArenas = Boolean(object.ccEnableArenas);
|
23383 | if (object.objcClassPrefix != null)
|
23384 | message.objcClassPrefix = String(object.objcClassPrefix);
|
23385 | if (object.csharpNamespace != null)
|
23386 | message.csharpNamespace = String(object.csharpNamespace);
|
23387 | if (object.swiftPrefix != null)
|
23388 | message.swiftPrefix = String(object.swiftPrefix);
|
23389 | if (object.phpClassPrefix != null)
|
23390 | message.phpClassPrefix = String(object.phpClassPrefix);
|
23391 | if (object.phpNamespace != null)
|
23392 | message.phpNamespace = String(object.phpNamespace);
|
23393 | if (object.phpMetadataNamespace != null)
|
23394 | message.phpMetadataNamespace = String(object.phpMetadataNamespace);
|
23395 | if (object.rubyPackage != null)
|
23396 | message.rubyPackage = String(object.rubyPackage);
|
23397 | if (object.uninterpretedOption) {
|
23398 | if (!Array.isArray(object.uninterpretedOption))
|
23399 | throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected");
|
23400 | message.uninterpretedOption = [];
|
23401 | for (var i = 0; i < object.uninterpretedOption.length; ++i) {
|
23402 | if (typeof object.uninterpretedOption[i] !== "object")
|
23403 | throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected");
|
23404 | message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]);
|
23405 | }
|
23406 | }
|
23407 | if (object[".google.api.resourceDefinition"]) {
|
23408 | if (!Array.isArray(object[".google.api.resourceDefinition"]))
|
23409 | throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected");
|
23410 | message[".google.api.resourceDefinition"] = [];
|
23411 | for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) {
|
23412 | if (typeof object[".google.api.resourceDefinition"][i] !== "object")
|
23413 | throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected");
|
23414 | message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]);
|
23415 | }
|
23416 | }
|
23417 | return message;
|
23418 | };
|
23419 |
|
23420 | /**
|
23421 | * Creates a plain object from a FileOptions message. Also converts values to other types if specified.
|
23422 | * @function toObject
|
23423 | * @memberof google.protobuf.FileOptions
|
23424 | * @static
|
23425 | * @param {google.protobuf.FileOptions} message FileOptions
|
23426 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
23427 | * @returns {Object.<string,*>} Plain object
|
23428 | */
|
23429 | FileOptions.toObject = function toObject(message, options) {
|
23430 | if (!options)
|
23431 | options = {};
|
23432 | var object = {};
|
23433 | if (options.arrays || options.defaults) {
|
23434 | object.uninterpretedOption = [];
|
23435 | object[".google.api.resourceDefinition"] = [];
|
23436 | }
|
23437 | if (options.defaults) {
|
23438 | object.javaPackage = "";
|
23439 | object.javaOuterClassname = "";
|
23440 | object.optimizeFor = options.enums === String ? "SPEED" : 1;
|
23441 | object.javaMultipleFiles = false;
|
23442 | object.goPackage = "";
|
23443 | object.ccGenericServices = false;
|
23444 | object.javaGenericServices = false;
|
23445 | object.pyGenericServices = false;
|
23446 | object.javaGenerateEqualsAndHash = false;
|
23447 | object.deprecated = false;
|
23448 | object.javaStringCheckUtf8 = false;
|
23449 | object.ccEnableArenas = true;
|
23450 | object.objcClassPrefix = "";
|
23451 | object.csharpNamespace = "";
|
23452 | object.swiftPrefix = "";
|
23453 | object.phpClassPrefix = "";
|
23454 | object.phpNamespace = "";
|
23455 | object.phpGenericServices = false;
|
23456 | object.phpMetadataNamespace = "";
|
23457 | object.rubyPackage = "";
|
23458 | }
|
23459 | if (message.javaPackage != null && message.hasOwnProperty("javaPackage"))
|
23460 | object.javaPackage = message.javaPackage;
|
23461 | if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname"))
|
23462 | object.javaOuterClassname = message.javaOuterClassname;
|
23463 | if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor"))
|
23464 | object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor;
|
23465 | if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles"))
|
23466 | object.javaMultipleFiles = message.javaMultipleFiles;
|
23467 | if (message.goPackage != null && message.hasOwnProperty("goPackage"))
|
23468 | object.goPackage = message.goPackage;
|
23469 | if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices"))
|
23470 | object.ccGenericServices = message.ccGenericServices;
|
23471 | if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices"))
|
23472 | object.javaGenericServices = message.javaGenericServices;
|
23473 | if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices"))
|
23474 | object.pyGenericServices = message.pyGenericServices;
|
23475 | if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash"))
|
23476 | object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash;
|
23477 | if (message.deprecated != null && message.hasOwnProperty("deprecated"))
|
23478 | object.deprecated = message.deprecated;
|
23479 | if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8"))
|
23480 | object.javaStringCheckUtf8 = message.javaStringCheckUtf8;
|
23481 | if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas"))
|
23482 | object.ccEnableArenas = message.ccEnableArenas;
|
23483 | if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix"))
|
23484 | object.objcClassPrefix = message.objcClassPrefix;
|
23485 | if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace"))
|
23486 | object.csharpNamespace = message.csharpNamespace;
|
23487 | if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix"))
|
23488 | object.swiftPrefix = message.swiftPrefix;
|
23489 | if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix"))
|
23490 | object.phpClassPrefix = message.phpClassPrefix;
|
23491 | if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace"))
|
23492 | object.phpNamespace = message.phpNamespace;
|
23493 | if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices"))
|
23494 | object.phpGenericServices = message.phpGenericServices;
|
23495 | if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace"))
|
23496 | object.phpMetadataNamespace = message.phpMetadataNamespace;
|
23497 | if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage"))
|
23498 | object.rubyPackage = message.rubyPackage;
|
23499 | if (message.uninterpretedOption && message.uninterpretedOption.length) {
|
23500 | object.uninterpretedOption = [];
|
23501 | for (var j = 0; j < message.uninterpretedOption.length; ++j)
|
23502 | object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options);
|
23503 | }
|
23504 | if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) {
|
23505 | object[".google.api.resourceDefinition"] = [];
|
23506 | for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j)
|
23507 | object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options);
|
23508 | }
|
23509 | return object;
|
23510 | };
|
23511 |
|
23512 | /**
|
23513 | * Converts this FileOptions to JSON.
|
23514 | * @function toJSON
|
23515 | * @memberof google.protobuf.FileOptions
|
23516 | * @instance
|
23517 | * @returns {Object.<string,*>} JSON object
|
23518 | */
|
23519 | FileOptions.prototype.toJSON = function toJSON() {
|
23520 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
23521 | };
|
23522 |
|
23523 | /**
|
23524 | * OptimizeMode enum.
|
23525 | * @name google.protobuf.FileOptions.OptimizeMode
|
23526 | * @enum {number}
|
23527 | * @property {number} SPEED=1 SPEED value
|
23528 | * @property {number} CODE_SIZE=2 CODE_SIZE value
|
23529 | * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value
|
23530 | */
|
23531 | FileOptions.OptimizeMode = (function() {
|
23532 | var valuesById = {}, values = Object.create(valuesById);
|
23533 | values[valuesById[1] = "SPEED"] = 1;
|
23534 | values[valuesById[2] = "CODE_SIZE"] = 2;
|
23535 | values[valuesById[3] = "LITE_RUNTIME"] = 3;
|
23536 | return values;
|
23537 | })();
|
23538 |
|
23539 | return FileOptions;
|
23540 | })();
|
23541 |
|
23542 | protobuf.MessageOptions = (function() {
|
23543 |
|
23544 | /**
|
23545 | * Properties of a MessageOptions.
|
23546 | * @memberof google.protobuf
|
23547 | * @interface IMessageOptions
|
23548 | * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat
|
23549 | * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor
|
23550 | * @property {boolean|null} [deprecated] MessageOptions deprecated
|
23551 | * @property {boolean|null} [mapEntry] MessageOptions mapEntry
|
23552 | * @property {Array.<google.protobuf.IUninterpretedOption>|null} [uninterpretedOption] MessageOptions uninterpretedOption
|
23553 | * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource
|
23554 | */
|
23555 |
|
23556 | /**
|
23557 | * Constructs a new MessageOptions.
|
23558 | * @memberof google.protobuf
|
23559 | * @classdesc Represents a MessageOptions.
|
23560 | * @implements IMessageOptions
|
23561 | * @constructor
|
23562 | * @param {google.protobuf.IMessageOptions=} [properties] Properties to set
|
23563 | */
|
23564 | function MessageOptions(properties) {
|
23565 | this.uninterpretedOption = [];
|
23566 | if (properties)
|
23567 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
23568 | if (properties[keys[i]] != null)
|
23569 | this[keys[i]] = properties[keys[i]];
|
23570 | }
|
23571 |
|
23572 | /**
|
23573 | * MessageOptions messageSetWireFormat.
|
23574 | * @member {boolean} messageSetWireFormat
|
23575 | * @memberof google.protobuf.MessageOptions
|
23576 | * @instance
|
23577 | */
|
23578 | MessageOptions.prototype.messageSetWireFormat = false;
|
23579 |
|
23580 | /**
|
23581 | * MessageOptions noStandardDescriptorAccessor.
|
23582 | * @member {boolean} noStandardDescriptorAccessor
|
23583 | * @memberof google.protobuf.MessageOptions
|
23584 | * @instance
|
23585 | */
|
23586 | MessageOptions.prototype.noStandardDescriptorAccessor = false;
|
23587 |
|
23588 | /**
|
23589 | * MessageOptions deprecated.
|
23590 | * @member {boolean} deprecated
|
23591 | * @memberof google.protobuf.MessageOptions
|
23592 | * @instance
|
23593 | */
|
23594 | MessageOptions.prototype.deprecated = false;
|
23595 |
|
23596 | /**
|
23597 | * MessageOptions mapEntry.
|
23598 | * @member {boolean} mapEntry
|
23599 | * @memberof google.protobuf.MessageOptions
|
23600 | * @instance
|
23601 | */
|
23602 | MessageOptions.prototype.mapEntry = false;
|
23603 |
|
23604 | /**
|
23605 | * MessageOptions uninterpretedOption.
|
23606 | * @member {Array.<google.protobuf.IUninterpretedOption>} uninterpretedOption
|
23607 | * @memberof google.protobuf.MessageOptions
|
23608 | * @instance
|
23609 | */
|
23610 | MessageOptions.prototype.uninterpretedOption = $util.emptyArray;
|
23611 |
|
23612 | /**
|
23613 | * MessageOptions .google.api.resource.
|
23614 | * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource
|
23615 | * @memberof google.protobuf.MessageOptions
|
23616 | * @instance
|
23617 | */
|
23618 | MessageOptions.prototype[".google.api.resource"] = null;
|
23619 |
|
23620 | /**
|
23621 | * Creates a new MessageOptions instance using the specified properties.
|
23622 | * @function create
|
23623 | * @memberof google.protobuf.MessageOptions
|
23624 | * @static
|
23625 | * @param {google.protobuf.IMessageOptions=} [properties] Properties to set
|
23626 | * @returns {google.protobuf.MessageOptions} MessageOptions instance
|
23627 | */
|
23628 | MessageOptions.create = function create(properties) {
|
23629 | return new MessageOptions(properties);
|
23630 | };
|
23631 |
|
23632 | /**
|
23633 | * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages.
|
23634 | * @function encode
|
23635 | * @memberof google.protobuf.MessageOptions
|
23636 | * @static
|
23637 | * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode
|
23638 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
23639 | * @returns {$protobuf.Writer} Writer
|
23640 | */
|
23641 | MessageOptions.encode = function encode(message, writer) {
|
23642 | if (!writer)
|
23643 | writer = $Writer.create();
|
23644 | if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat"))
|
23645 | writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat);
|
23646 | if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor"))
|
23647 | writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor);
|
23648 | if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated"))
|
23649 | writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated);
|
23650 | if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry"))
|
23651 | writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry);
|
23652 | if (message.uninterpretedOption != null && message.uninterpretedOption.length)
|
23653 | for (var i = 0; i < message.uninterpretedOption.length; ++i)
|
23654 | $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim();
|
23655 | if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource"))
|
23656 | $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim();
|
23657 | return writer;
|
23658 | };
|
23659 |
|
23660 | /**
|
23661 | * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages.
|
23662 | * @function encodeDelimited
|
23663 | * @memberof google.protobuf.MessageOptions
|
23664 | * @static
|
23665 | * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode
|
23666 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
23667 | * @returns {$protobuf.Writer} Writer
|
23668 | */
|
23669 | MessageOptions.encodeDelimited = function encodeDelimited(message, writer) {
|
23670 | return this.encode(message, writer).ldelim();
|
23671 | };
|
23672 |
|
23673 | /**
|
23674 | * Decodes a MessageOptions message from the specified reader or buffer.
|
23675 | * @function decode
|
23676 | * @memberof google.protobuf.MessageOptions
|
23677 | * @static
|
23678 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
23679 | * @param {number} [length] Message length if known beforehand
|
23680 | * @returns {google.protobuf.MessageOptions} MessageOptions
|
23681 | * @throws {Error} If the payload is not a reader or valid buffer
|
23682 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
23683 | */
|
23684 | MessageOptions.decode = function decode(reader, length) {
|
23685 | if (!(reader instanceof $Reader))
|
23686 | reader = $Reader.create(reader);
|
23687 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions();
|
23688 | while (reader.pos < end) {
|
23689 | var tag = reader.uint32();
|
23690 | switch (tag >>> 3) {
|
23691 | case 1:
|
23692 | message.messageSetWireFormat = reader.bool();
|
23693 | break;
|
23694 | case 2:
|
23695 | message.noStandardDescriptorAccessor = reader.bool();
|
23696 | break;
|
23697 | case 3:
|
23698 | message.deprecated = reader.bool();
|
23699 | break;
|
23700 | case 7:
|
23701 | message.mapEntry = reader.bool();
|
23702 | break;
|
23703 | case 999:
|
23704 | if (!(message.uninterpretedOption && message.uninterpretedOption.length))
|
23705 | message.uninterpretedOption = [];
|
23706 | message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32()));
|
23707 | break;
|
23708 | case 1053:
|
23709 | message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32());
|
23710 | break;
|
23711 | default:
|
23712 | reader.skipType(tag & 7);
|
23713 | break;
|
23714 | }
|
23715 | }
|
23716 | return message;
|
23717 | };
|
23718 |
|
23719 | /**
|
23720 | * Decodes a MessageOptions message from the specified reader or buffer, length delimited.
|
23721 | * @function decodeDelimited
|
23722 | * @memberof google.protobuf.MessageOptions
|
23723 | * @static
|
23724 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
23725 | * @returns {google.protobuf.MessageOptions} MessageOptions
|
23726 | * @throws {Error} If the payload is not a reader or valid buffer
|
23727 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
23728 | */
|
23729 | MessageOptions.decodeDelimited = function decodeDelimited(reader) {
|
23730 | if (!(reader instanceof $Reader))
|
23731 | reader = new $Reader(reader);
|
23732 | return this.decode(reader, reader.uint32());
|
23733 | };
|
23734 |
|
23735 | /**
|
23736 | * Verifies a MessageOptions message.
|
23737 | * @function verify
|
23738 | * @memberof google.protobuf.MessageOptions
|
23739 | * @static
|
23740 | * @param {Object.<string,*>} message Plain object to verify
|
23741 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
23742 | */
|
23743 | MessageOptions.verify = function verify(message) {
|
23744 | if (typeof message !== "object" || message === null)
|
23745 | return "object expected";
|
23746 | if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat"))
|
23747 | if (typeof message.messageSetWireFormat !== "boolean")
|
23748 | return "messageSetWireFormat: boolean expected";
|
23749 | if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor"))
|
23750 | if (typeof message.noStandardDescriptorAccessor !== "boolean")
|
23751 | return "noStandardDescriptorAccessor: boolean expected";
|
23752 | if (message.deprecated != null && message.hasOwnProperty("deprecated"))
|
23753 | if (typeof message.deprecated !== "boolean")
|
23754 | return "deprecated: boolean expected";
|
23755 | if (message.mapEntry != null && message.hasOwnProperty("mapEntry"))
|
23756 | if (typeof message.mapEntry !== "boolean")
|
23757 | return "mapEntry: boolean expected";
|
23758 | if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) {
|
23759 | if (!Array.isArray(message.uninterpretedOption))
|
23760 | return "uninterpretedOption: array expected";
|
23761 | for (var i = 0; i < message.uninterpretedOption.length; ++i) {
|
23762 | var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]);
|
23763 | if (error)
|
23764 | return "uninterpretedOption." + error;
|
23765 | }
|
23766 | }
|
23767 | if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) {
|
23768 | var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]);
|
23769 | if (error)
|
23770 | return ".google.api.resource." + error;
|
23771 | }
|
23772 | return null;
|
23773 | };
|
23774 |
|
23775 | /**
|
23776 | * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types.
|
23777 | * @function fromObject
|
23778 | * @memberof google.protobuf.MessageOptions
|
23779 | * @static
|
23780 | * @param {Object.<string,*>} object Plain object
|
23781 | * @returns {google.protobuf.MessageOptions} MessageOptions
|
23782 | */
|
23783 | MessageOptions.fromObject = function fromObject(object) {
|
23784 | if (object instanceof $root.google.protobuf.MessageOptions)
|
23785 | return object;
|
23786 | var message = new $root.google.protobuf.MessageOptions();
|
23787 | if (object.messageSetWireFormat != null)
|
23788 | message.messageSetWireFormat = Boolean(object.messageSetWireFormat);
|
23789 | if (object.noStandardDescriptorAccessor != null)
|
23790 | message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor);
|
23791 | if (object.deprecated != null)
|
23792 | message.deprecated = Boolean(object.deprecated);
|
23793 | if (object.mapEntry != null)
|
23794 | message.mapEntry = Boolean(object.mapEntry);
|
23795 | if (object.uninterpretedOption) {
|
23796 | if (!Array.isArray(object.uninterpretedOption))
|
23797 | throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected");
|
23798 | message.uninterpretedOption = [];
|
23799 | for (var i = 0; i < object.uninterpretedOption.length; ++i) {
|
23800 | if (typeof object.uninterpretedOption[i] !== "object")
|
23801 | throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected");
|
23802 | message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]);
|
23803 | }
|
23804 | }
|
23805 | if (object[".google.api.resource"] != null) {
|
23806 | if (typeof object[".google.api.resource"] !== "object")
|
23807 | throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected");
|
23808 | message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]);
|
23809 | }
|
23810 | return message;
|
23811 | };
|
23812 |
|
23813 | /**
|
23814 | * Creates a plain object from a MessageOptions message. Also converts values to other types if specified.
|
23815 | * @function toObject
|
23816 | * @memberof google.protobuf.MessageOptions
|
23817 | * @static
|
23818 | * @param {google.protobuf.MessageOptions} message MessageOptions
|
23819 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
23820 | * @returns {Object.<string,*>} Plain object
|
23821 | */
|
23822 | MessageOptions.toObject = function toObject(message, options) {
|
23823 | if (!options)
|
23824 | options = {};
|
23825 | var object = {};
|
23826 | if (options.arrays || options.defaults)
|
23827 | object.uninterpretedOption = [];
|
23828 | if (options.defaults) {
|
23829 | object.messageSetWireFormat = false;
|
23830 | object.noStandardDescriptorAccessor = false;
|
23831 | object.deprecated = false;
|
23832 | object.mapEntry = false;
|
23833 | object[".google.api.resource"] = null;
|
23834 | }
|
23835 | if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat"))
|
23836 | object.messageSetWireFormat = message.messageSetWireFormat;
|
23837 | if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor"))
|
23838 | object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor;
|
23839 | if (message.deprecated != null && message.hasOwnProperty("deprecated"))
|
23840 | object.deprecated = message.deprecated;
|
23841 | if (message.mapEntry != null && message.hasOwnProperty("mapEntry"))
|
23842 | object.mapEntry = message.mapEntry;
|
23843 | if (message.uninterpretedOption && message.uninterpretedOption.length) {
|
23844 | object.uninterpretedOption = [];
|
23845 | for (var j = 0; j < message.uninterpretedOption.length; ++j)
|
23846 | object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options);
|
23847 | }
|
23848 | if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource"))
|
23849 | object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options);
|
23850 | return object;
|
23851 | };
|
23852 |
|
23853 | /**
|
23854 | * Converts this MessageOptions to JSON.
|
23855 | * @function toJSON
|
23856 | * @memberof google.protobuf.MessageOptions
|
23857 | * @instance
|
23858 | * @returns {Object.<string,*>} JSON object
|
23859 | */
|
23860 | MessageOptions.prototype.toJSON = function toJSON() {
|
23861 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
23862 | };
|
23863 |
|
23864 | return MessageOptions;
|
23865 | })();
|
23866 |
|
23867 | protobuf.FieldOptions = (function() {
|
23868 |
|
23869 | /**
|
23870 | * Properties of a FieldOptions.
|
23871 | * @memberof google.protobuf
|
23872 | * @interface IFieldOptions
|
23873 | * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype
|
23874 | * @property {boolean|null} [packed] FieldOptions packed
|
23875 | * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype
|
23876 | * @property {boolean|null} [lazy] FieldOptions lazy
|
23877 | * @property {boolean|null} [deprecated] FieldOptions deprecated
|
23878 | * @property {boolean|null} [weak] FieldOptions weak
|
23879 | * @property {Array.<google.protobuf.IUninterpretedOption>|null} [uninterpretedOption] FieldOptions uninterpretedOption
|
23880 | * @property {Array.<google.api.FieldBehavior>|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior
|
23881 | * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference
|
23882 | */
|
23883 |
|
23884 | /**
|
23885 | * Constructs a new FieldOptions.
|
23886 | * @memberof google.protobuf
|
23887 | * @classdesc Represents a FieldOptions.
|
23888 | * @implements IFieldOptions
|
23889 | * @constructor
|
23890 | * @param {google.protobuf.IFieldOptions=} [properties] Properties to set
|
23891 | */
|
23892 | function FieldOptions(properties) {
|
23893 | this.uninterpretedOption = [];
|
23894 | this[".google.api.fieldBehavior"] = [];
|
23895 | if (properties)
|
23896 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
23897 | if (properties[keys[i]] != null)
|
23898 | this[keys[i]] = properties[keys[i]];
|
23899 | }
|
23900 |
|
23901 | /**
|
23902 | * FieldOptions ctype.
|
23903 | * @member {google.protobuf.FieldOptions.CType} ctype
|
23904 | * @memberof google.protobuf.FieldOptions
|
23905 | * @instance
|
23906 | */
|
23907 | FieldOptions.prototype.ctype = 0;
|
23908 |
|
23909 | /**
|
23910 | * FieldOptions packed.
|
23911 | * @member {boolean} packed
|
23912 | * @memberof google.protobuf.FieldOptions
|
23913 | * @instance
|
23914 | */
|
23915 | FieldOptions.prototype.packed = false;
|
23916 |
|
23917 | /**
|
23918 | * FieldOptions jstype.
|
23919 | * @member {google.protobuf.FieldOptions.JSType} jstype
|
23920 | * @memberof google.protobuf.FieldOptions
|
23921 | * @instance
|
23922 | */
|
23923 | FieldOptions.prototype.jstype = 0;
|
23924 |
|
23925 | /**
|
23926 | * FieldOptions lazy.
|
23927 | * @member {boolean} lazy
|
23928 | * @memberof google.protobuf.FieldOptions
|
23929 | * @instance
|
23930 | */
|
23931 | FieldOptions.prototype.lazy = false;
|
23932 |
|
23933 | /**
|
23934 | * FieldOptions deprecated.
|
23935 | * @member {boolean} deprecated
|
23936 | * @memberof google.protobuf.FieldOptions
|
23937 | * @instance
|
23938 | */
|
23939 | FieldOptions.prototype.deprecated = false;
|
23940 |
|
23941 | /**
|
23942 | * FieldOptions weak.
|
23943 | * @member {boolean} weak
|
23944 | * @memberof google.protobuf.FieldOptions
|
23945 | * @instance
|
23946 | */
|
23947 | FieldOptions.prototype.weak = false;
|
23948 |
|
23949 | /**
|
23950 | * FieldOptions uninterpretedOption.
|
23951 | * @member {Array.<google.protobuf.IUninterpretedOption>} uninterpretedOption
|
23952 | * @memberof google.protobuf.FieldOptions
|
23953 | * @instance
|
23954 | */
|
23955 | FieldOptions.prototype.uninterpretedOption = $util.emptyArray;
|
23956 |
|
23957 | /**
|
23958 | * FieldOptions .google.api.fieldBehavior.
|
23959 | * @member {Array.<google.api.FieldBehavior>} .google.api.fieldBehavior
|
23960 | * @memberof google.protobuf.FieldOptions
|
23961 | * @instance
|
23962 | */
|
23963 | FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray;
|
23964 |
|
23965 | /**
|
23966 | * FieldOptions .google.api.resourceReference.
|
23967 | * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference
|
23968 | * @memberof google.protobuf.FieldOptions
|
23969 | * @instance
|
23970 | */
|
23971 | FieldOptions.prototype[".google.api.resourceReference"] = null;
|
23972 |
|
23973 | /**
|
23974 | * Creates a new FieldOptions instance using the specified properties.
|
23975 | * @function create
|
23976 | * @memberof google.protobuf.FieldOptions
|
23977 | * @static
|
23978 | * @param {google.protobuf.IFieldOptions=} [properties] Properties to set
|
23979 | * @returns {google.protobuf.FieldOptions} FieldOptions instance
|
23980 | */
|
23981 | FieldOptions.create = function create(properties) {
|
23982 | return new FieldOptions(properties);
|
23983 | };
|
23984 |
|
23985 | /**
|
23986 | * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages.
|
23987 | * @function encode
|
23988 | * @memberof google.protobuf.FieldOptions
|
23989 | * @static
|
23990 | * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode
|
23991 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
23992 | * @returns {$protobuf.Writer} Writer
|
23993 | */
|
23994 | FieldOptions.encode = function encode(message, writer) {
|
23995 | if (!writer)
|
23996 | writer = $Writer.create();
|
23997 | if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype"))
|
23998 | writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype);
|
23999 | if (message.packed != null && Object.hasOwnProperty.call(message, "packed"))
|
24000 | writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed);
|
24001 | if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated"))
|
24002 | writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated);
|
24003 | if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy"))
|
24004 | writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy);
|
24005 | if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype"))
|
24006 | writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype);
|
24007 | if (message.weak != null && Object.hasOwnProperty.call(message, "weak"))
|
24008 | writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak);
|
24009 | if (message.uninterpretedOption != null && message.uninterpretedOption.length)
|
24010 | for (var i = 0; i < message.uninterpretedOption.length; ++i)
|
24011 | $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim();
|
24012 | if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) {
|
24013 | writer.uint32(/* id 1052, wireType 2 =*/8418).fork();
|
24014 | for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i)
|
24015 | writer.int32(message[".google.api.fieldBehavior"][i]);
|
24016 | writer.ldelim();
|
24017 | }
|
24018 | if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference"))
|
24019 | $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim();
|
24020 | return writer;
|
24021 | };
|
24022 |
|
24023 | /**
|
24024 | * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages.
|
24025 | * @function encodeDelimited
|
24026 | * @memberof google.protobuf.FieldOptions
|
24027 | * @static
|
24028 | * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode
|
24029 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
24030 | * @returns {$protobuf.Writer} Writer
|
24031 | */
|
24032 | FieldOptions.encodeDelimited = function encodeDelimited(message, writer) {
|
24033 | return this.encode(message, writer).ldelim();
|
24034 | };
|
24035 |
|
24036 | /**
|
24037 | * Decodes a FieldOptions message from the specified reader or buffer.
|
24038 | * @function decode
|
24039 | * @memberof google.protobuf.FieldOptions
|
24040 | * @static
|
24041 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
24042 | * @param {number} [length] Message length if known beforehand
|
24043 | * @returns {google.protobuf.FieldOptions} FieldOptions
|
24044 | * @throws {Error} If the payload is not a reader or valid buffer
|
24045 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
24046 | */
|
24047 | FieldOptions.decode = function decode(reader, length) {
|
24048 | if (!(reader instanceof $Reader))
|
24049 | reader = $Reader.create(reader);
|
24050 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions();
|
24051 | while (reader.pos < end) {
|
24052 | var tag = reader.uint32();
|
24053 | switch (tag >>> 3) {
|
24054 | case 1:
|
24055 | message.ctype = reader.int32();
|
24056 | break;
|
24057 | case 2:
|
24058 | message.packed = reader.bool();
|
24059 | break;
|
24060 | case 6:
|
24061 | message.jstype = reader.int32();
|
24062 | break;
|
24063 | case 5:
|
24064 | message.lazy = reader.bool();
|
24065 | break;
|
24066 | case 3:
|
24067 | message.deprecated = reader.bool();
|
24068 | break;
|
24069 | case 10:
|
24070 | message.weak = reader.bool();
|
24071 | break;
|
24072 | case 999:
|
24073 | if (!(message.uninterpretedOption && message.uninterpretedOption.length))
|
24074 | message.uninterpretedOption = [];
|
24075 | message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32()));
|
24076 | break;
|
24077 | case 1052:
|
24078 | if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length))
|
24079 | message[".google.api.fieldBehavior"] = [];
|
24080 | if ((tag & 7) === 2) {
|
24081 | var end2 = reader.uint32() + reader.pos;
|
24082 | while (reader.pos < end2)
|
24083 | message[".google.api.fieldBehavior"].push(reader.int32());
|
24084 | } else
|
24085 | message[".google.api.fieldBehavior"].push(reader.int32());
|
24086 | break;
|
24087 | case 1055:
|
24088 | message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32());
|
24089 | break;
|
24090 | default:
|
24091 | reader.skipType(tag & 7);
|
24092 | break;
|
24093 | }
|
24094 | }
|
24095 | return message;
|
24096 | };
|
24097 |
|
24098 | /**
|
24099 | * Decodes a FieldOptions message from the specified reader or buffer, length delimited.
|
24100 | * @function decodeDelimited
|
24101 | * @memberof google.protobuf.FieldOptions
|
24102 | * @static
|
24103 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
24104 | * @returns {google.protobuf.FieldOptions} FieldOptions
|
24105 | * @throws {Error} If the payload is not a reader or valid buffer
|
24106 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
24107 | */
|
24108 | FieldOptions.decodeDelimited = function decodeDelimited(reader) {
|
24109 | if (!(reader instanceof $Reader))
|
24110 | reader = new $Reader(reader);
|
24111 | return this.decode(reader, reader.uint32());
|
24112 | };
|
24113 |
|
24114 | /**
|
24115 | * Verifies a FieldOptions message.
|
24116 | * @function verify
|
24117 | * @memberof google.protobuf.FieldOptions
|
24118 | * @static
|
24119 | * @param {Object.<string,*>} message Plain object to verify
|
24120 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
24121 | */
|
24122 | FieldOptions.verify = function verify(message) {
|
24123 | if (typeof message !== "object" || message === null)
|
24124 | return "object expected";
|
24125 | if (message.ctype != null && message.hasOwnProperty("ctype"))
|
24126 | switch (message.ctype) {
|
24127 | default:
|
24128 | return "ctype: enum value expected";
|
24129 | case 0:
|
24130 | case 1:
|
24131 | case 2:
|
24132 | break;
|
24133 | }
|
24134 | if (message.packed != null && message.hasOwnProperty("packed"))
|
24135 | if (typeof message.packed !== "boolean")
|
24136 | return "packed: boolean expected";
|
24137 | if (message.jstype != null && message.hasOwnProperty("jstype"))
|
24138 | switch (message.jstype) {
|
24139 | default:
|
24140 | return "jstype: enum value expected";
|
24141 | case 0:
|
24142 | case 1:
|
24143 | case 2:
|
24144 | break;
|
24145 | }
|
24146 | if (message.lazy != null && message.hasOwnProperty("lazy"))
|
24147 | if (typeof message.lazy !== "boolean")
|
24148 | return "lazy: boolean expected";
|
24149 | if (message.deprecated != null && message.hasOwnProperty("deprecated"))
|
24150 | if (typeof message.deprecated !== "boolean")
|
24151 | return "deprecated: boolean expected";
|
24152 | if (message.weak != null && message.hasOwnProperty("weak"))
|
24153 | if (typeof message.weak !== "boolean")
|
24154 | return "weak: boolean expected";
|
24155 | if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) {
|
24156 | if (!Array.isArray(message.uninterpretedOption))
|
24157 | return "uninterpretedOption: array expected";
|
24158 | for (var i = 0; i < message.uninterpretedOption.length; ++i) {
|
24159 | var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]);
|
24160 | if (error)
|
24161 | return "uninterpretedOption." + error;
|
24162 | }
|
24163 | }
|
24164 | if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) {
|
24165 | if (!Array.isArray(message[".google.api.fieldBehavior"]))
|
24166 | return ".google.api.fieldBehavior: array expected";
|
24167 | for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i)
|
24168 | switch (message[".google.api.fieldBehavior"][i]) {
|
24169 | default:
|
24170 | return ".google.api.fieldBehavior: enum value[] expected";
|
24171 | case 0:
|
24172 | case 1:
|
24173 | case 2:
|
24174 | case 3:
|
24175 | case 4:
|
24176 | case 5:
|
24177 | case 6:
|
24178 | case 7:
|
24179 | break;
|
24180 | }
|
24181 | }
|
24182 | if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) {
|
24183 | var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]);
|
24184 | if (error)
|
24185 | return ".google.api.resourceReference." + error;
|
24186 | }
|
24187 | return null;
|
24188 | };
|
24189 |
|
24190 | /**
|
24191 | * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types.
|
24192 | * @function fromObject
|
24193 | * @memberof google.protobuf.FieldOptions
|
24194 | * @static
|
24195 | * @param {Object.<string,*>} object Plain object
|
24196 | * @returns {google.protobuf.FieldOptions} FieldOptions
|
24197 | */
|
24198 | FieldOptions.fromObject = function fromObject(object) {
|
24199 | if (object instanceof $root.google.protobuf.FieldOptions)
|
24200 | return object;
|
24201 | var message = new $root.google.protobuf.FieldOptions();
|
24202 | switch (object.ctype) {
|
24203 | case "STRING":
|
24204 | case 0:
|
24205 | message.ctype = 0;
|
24206 | break;
|
24207 | case "CORD":
|
24208 | case 1:
|
24209 | message.ctype = 1;
|
24210 | break;
|
24211 | case "STRING_PIECE":
|
24212 | case 2:
|
24213 | message.ctype = 2;
|
24214 | break;
|
24215 | }
|
24216 | if (object.packed != null)
|
24217 | message.packed = Boolean(object.packed);
|
24218 | switch (object.jstype) {
|
24219 | case "JS_NORMAL":
|
24220 | case 0:
|
24221 | message.jstype = 0;
|
24222 | break;
|
24223 | case "JS_STRING":
|
24224 | case 1:
|
24225 | message.jstype = 1;
|
24226 | break;
|
24227 | case "JS_NUMBER":
|
24228 | case 2:
|
24229 | message.jstype = 2;
|
24230 | break;
|
24231 | }
|
24232 | if (object.lazy != null)
|
24233 | message.lazy = Boolean(object.lazy);
|
24234 | if (object.deprecated != null)
|
24235 | message.deprecated = Boolean(object.deprecated);
|
24236 | if (object.weak != null)
|
24237 | message.weak = Boolean(object.weak);
|
24238 | if (object.uninterpretedOption) {
|
24239 | if (!Array.isArray(object.uninterpretedOption))
|
24240 | throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected");
|
24241 | message.uninterpretedOption = [];
|
24242 | for (var i = 0; i < object.uninterpretedOption.length; ++i) {
|
24243 | if (typeof object.uninterpretedOption[i] !== "object")
|
24244 | throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected");
|
24245 | message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]);
|
24246 | }
|
24247 | }
|
24248 | if (object[".google.api.fieldBehavior"]) {
|
24249 | if (!Array.isArray(object[".google.api.fieldBehavior"]))
|
24250 | throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected");
|
24251 | message[".google.api.fieldBehavior"] = [];
|
24252 | for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i)
|
24253 | switch (object[".google.api.fieldBehavior"][i]) {
|
24254 | default:
|
24255 | case "FIELD_BEHAVIOR_UNSPECIFIED":
|
24256 | case 0:
|
24257 | message[".google.api.fieldBehavior"][i] = 0;
|
24258 | break;
|
24259 | case "OPTIONAL":
|
24260 | case 1:
|
24261 | message[".google.api.fieldBehavior"][i] = 1;
|
24262 | break;
|
24263 | case "REQUIRED":
|
24264 | case 2:
|
24265 | message[".google.api.fieldBehavior"][i] = 2;
|
24266 | break;
|
24267 | case "OUTPUT_ONLY":
|
24268 | case 3:
|
24269 | message[".google.api.fieldBehavior"][i] = 3;
|
24270 | break;
|
24271 | case "INPUT_ONLY":
|
24272 | case 4:
|
24273 | message[".google.api.fieldBehavior"][i] = 4;
|
24274 | break;
|
24275 | case "IMMUTABLE":
|
24276 | case 5:
|
24277 | message[".google.api.fieldBehavior"][i] = 5;
|
24278 | break;
|
24279 | case "UNORDERED_LIST":
|
24280 | case 6:
|
24281 | message[".google.api.fieldBehavior"][i] = 6;
|
24282 | break;
|
24283 | case "NON_EMPTY_DEFAULT":
|
24284 | case 7:
|
24285 | message[".google.api.fieldBehavior"][i] = 7;
|
24286 | break;
|
24287 | }
|
24288 | }
|
24289 | if (object[".google.api.resourceReference"] != null) {
|
24290 | if (typeof object[".google.api.resourceReference"] !== "object")
|
24291 | throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected");
|
24292 | message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]);
|
24293 | }
|
24294 | return message;
|
24295 | };
|
24296 |
|
24297 | /**
|
24298 | * Creates a plain object from a FieldOptions message. Also converts values to other types if specified.
|
24299 | * @function toObject
|
24300 | * @memberof google.protobuf.FieldOptions
|
24301 | * @static
|
24302 | * @param {google.protobuf.FieldOptions} message FieldOptions
|
24303 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
24304 | * @returns {Object.<string,*>} Plain object
|
24305 | */
|
24306 | FieldOptions.toObject = function toObject(message, options) {
|
24307 | if (!options)
|
24308 | options = {};
|
24309 | var object = {};
|
24310 | if (options.arrays || options.defaults) {
|
24311 | object.uninterpretedOption = [];
|
24312 | object[".google.api.fieldBehavior"] = [];
|
24313 | }
|
24314 | if (options.defaults) {
|
24315 | object.ctype = options.enums === String ? "STRING" : 0;
|
24316 | object.packed = false;
|
24317 | object.deprecated = false;
|
24318 | object.lazy = false;
|
24319 | object.jstype = options.enums === String ? "JS_NORMAL" : 0;
|
24320 | object.weak = false;
|
24321 | object[".google.api.resourceReference"] = null;
|
24322 | }
|
24323 | if (message.ctype != null && message.hasOwnProperty("ctype"))
|
24324 | object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype;
|
24325 | if (message.packed != null && message.hasOwnProperty("packed"))
|
24326 | object.packed = message.packed;
|
24327 | if (message.deprecated != null && message.hasOwnProperty("deprecated"))
|
24328 | object.deprecated = message.deprecated;
|
24329 | if (message.lazy != null && message.hasOwnProperty("lazy"))
|
24330 | object.lazy = message.lazy;
|
24331 | if (message.jstype != null && message.hasOwnProperty("jstype"))
|
24332 | object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype;
|
24333 | if (message.weak != null && message.hasOwnProperty("weak"))
|
24334 | object.weak = message.weak;
|
24335 | if (message.uninterpretedOption && message.uninterpretedOption.length) {
|
24336 | object.uninterpretedOption = [];
|
24337 | for (var j = 0; j < message.uninterpretedOption.length; ++j)
|
24338 | object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options);
|
24339 | }
|
24340 | if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) {
|
24341 | object[".google.api.fieldBehavior"] = [];
|
24342 | for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j)
|
24343 | object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j];
|
24344 | }
|
24345 | if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference"))
|
24346 | object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options);
|
24347 | return object;
|
24348 | };
|
24349 |
|
24350 | /**
|
24351 | * Converts this FieldOptions to JSON.
|
24352 | * @function toJSON
|
24353 | * @memberof google.protobuf.FieldOptions
|
24354 | * @instance
|
24355 | * @returns {Object.<string,*>} JSON object
|
24356 | */
|
24357 | FieldOptions.prototype.toJSON = function toJSON() {
|
24358 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
24359 | };
|
24360 |
|
24361 | /**
|
24362 | * CType enum.
|
24363 | * @name google.protobuf.FieldOptions.CType
|
24364 | * @enum {number}
|
24365 | * @property {number} STRING=0 STRING value
|
24366 | * @property {number} CORD=1 CORD value
|
24367 | * @property {number} STRING_PIECE=2 STRING_PIECE value
|
24368 | */
|
24369 | FieldOptions.CType = (function() {
|
24370 | var valuesById = {}, values = Object.create(valuesById);
|
24371 | values[valuesById[0] = "STRING"] = 0;
|
24372 | values[valuesById[1] = "CORD"] = 1;
|
24373 | values[valuesById[2] = "STRING_PIECE"] = 2;
|
24374 | return values;
|
24375 | })();
|
24376 |
|
24377 | /**
|
24378 | * JSType enum.
|
24379 | * @name google.protobuf.FieldOptions.JSType
|
24380 | * @enum {number}
|
24381 | * @property {number} JS_NORMAL=0 JS_NORMAL value
|
24382 | * @property {number} JS_STRING=1 JS_STRING value
|
24383 | * @property {number} JS_NUMBER=2 JS_NUMBER value
|
24384 | */
|
24385 | FieldOptions.JSType = (function() {
|
24386 | var valuesById = {}, values = Object.create(valuesById);
|
24387 | values[valuesById[0] = "JS_NORMAL"] = 0;
|
24388 | values[valuesById[1] = "JS_STRING"] = 1;
|
24389 | values[valuesById[2] = "JS_NUMBER"] = 2;
|
24390 | return values;
|
24391 | })();
|
24392 |
|
24393 | return FieldOptions;
|
24394 | })();
|
24395 |
|
24396 | protobuf.OneofOptions = (function() {
|
24397 |
|
24398 | /**
|
24399 | * Properties of an OneofOptions.
|
24400 | * @memberof google.protobuf
|
24401 | * @interface IOneofOptions
|
24402 | * @property {Array.<google.protobuf.IUninterpretedOption>|null} [uninterpretedOption] OneofOptions uninterpretedOption
|
24403 | */
|
24404 |
|
24405 | /**
|
24406 | * Constructs a new OneofOptions.
|
24407 | * @memberof google.protobuf
|
24408 | * @classdesc Represents an OneofOptions.
|
24409 | * @implements IOneofOptions
|
24410 | * @constructor
|
24411 | * @param {google.protobuf.IOneofOptions=} [properties] Properties to set
|
24412 | */
|
24413 | function OneofOptions(properties) {
|
24414 | this.uninterpretedOption = [];
|
24415 | if (properties)
|
24416 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
24417 | if (properties[keys[i]] != null)
|
24418 | this[keys[i]] = properties[keys[i]];
|
24419 | }
|
24420 |
|
24421 | /**
|
24422 | * OneofOptions uninterpretedOption.
|
24423 | * @member {Array.<google.protobuf.IUninterpretedOption>} uninterpretedOption
|
24424 | * @memberof google.protobuf.OneofOptions
|
24425 | * @instance
|
24426 | */
|
24427 | OneofOptions.prototype.uninterpretedOption = $util.emptyArray;
|
24428 |
|
24429 | /**
|
24430 | * Creates a new OneofOptions instance using the specified properties.
|
24431 | * @function create
|
24432 | * @memberof google.protobuf.OneofOptions
|
24433 | * @static
|
24434 | * @param {google.protobuf.IOneofOptions=} [properties] Properties to set
|
24435 | * @returns {google.protobuf.OneofOptions} OneofOptions instance
|
24436 | */
|
24437 | OneofOptions.create = function create(properties) {
|
24438 | return new OneofOptions(properties);
|
24439 | };
|
24440 |
|
24441 | /**
|
24442 | * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages.
|
24443 | * @function encode
|
24444 | * @memberof google.protobuf.OneofOptions
|
24445 | * @static
|
24446 | * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode
|
24447 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
24448 | * @returns {$protobuf.Writer} Writer
|
24449 | */
|
24450 | OneofOptions.encode = function encode(message, writer) {
|
24451 | if (!writer)
|
24452 | writer = $Writer.create();
|
24453 | if (message.uninterpretedOption != null && message.uninterpretedOption.length)
|
24454 | for (var i = 0; i < message.uninterpretedOption.length; ++i)
|
24455 | $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim();
|
24456 | return writer;
|
24457 | };
|
24458 |
|
24459 | /**
|
24460 | * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages.
|
24461 | * @function encodeDelimited
|
24462 | * @memberof google.protobuf.OneofOptions
|
24463 | * @static
|
24464 | * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode
|
24465 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
24466 | * @returns {$protobuf.Writer} Writer
|
24467 | */
|
24468 | OneofOptions.encodeDelimited = function encodeDelimited(message, writer) {
|
24469 | return this.encode(message, writer).ldelim();
|
24470 | };
|
24471 |
|
24472 | /**
|
24473 | * Decodes an OneofOptions message from the specified reader or buffer.
|
24474 | * @function decode
|
24475 | * @memberof google.protobuf.OneofOptions
|
24476 | * @static
|
24477 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
24478 | * @param {number} [length] Message length if known beforehand
|
24479 | * @returns {google.protobuf.OneofOptions} OneofOptions
|
24480 | * @throws {Error} If the payload is not a reader or valid buffer
|
24481 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
24482 | */
|
24483 | OneofOptions.decode = function decode(reader, length) {
|
24484 | if (!(reader instanceof $Reader))
|
24485 | reader = $Reader.create(reader);
|
24486 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions();
|
24487 | while (reader.pos < end) {
|
24488 | var tag = reader.uint32();
|
24489 | switch (tag >>> 3) {
|
24490 | case 999:
|
24491 | if (!(message.uninterpretedOption && message.uninterpretedOption.length))
|
24492 | message.uninterpretedOption = [];
|
24493 | message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32()));
|
24494 | break;
|
24495 | default:
|
24496 | reader.skipType(tag & 7);
|
24497 | break;
|
24498 | }
|
24499 | }
|
24500 | return message;
|
24501 | };
|
24502 |
|
24503 | /**
|
24504 | * Decodes an OneofOptions message from the specified reader or buffer, length delimited.
|
24505 | * @function decodeDelimited
|
24506 | * @memberof google.protobuf.OneofOptions
|
24507 | * @static
|
24508 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
24509 | * @returns {google.protobuf.OneofOptions} OneofOptions
|
24510 | * @throws {Error} If the payload is not a reader or valid buffer
|
24511 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
24512 | */
|
24513 | OneofOptions.decodeDelimited = function decodeDelimited(reader) {
|
24514 | if (!(reader instanceof $Reader))
|
24515 | reader = new $Reader(reader);
|
24516 | return this.decode(reader, reader.uint32());
|
24517 | };
|
24518 |
|
24519 | /**
|
24520 | * Verifies an OneofOptions message.
|
24521 | * @function verify
|
24522 | * @memberof google.protobuf.OneofOptions
|
24523 | * @static
|
24524 | * @param {Object.<string,*>} message Plain object to verify
|
24525 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
24526 | */
|
24527 | OneofOptions.verify = function verify(message) {
|
24528 | if (typeof message !== "object" || message === null)
|
24529 | return "object expected";
|
24530 | if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) {
|
24531 | if (!Array.isArray(message.uninterpretedOption))
|
24532 | return "uninterpretedOption: array expected";
|
24533 | for (var i = 0; i < message.uninterpretedOption.length; ++i) {
|
24534 | var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]);
|
24535 | if (error)
|
24536 | return "uninterpretedOption." + error;
|
24537 | }
|
24538 | }
|
24539 | return null;
|
24540 | };
|
24541 |
|
24542 | /**
|
24543 | * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types.
|
24544 | * @function fromObject
|
24545 | * @memberof google.protobuf.OneofOptions
|
24546 | * @static
|
24547 | * @param {Object.<string,*>} object Plain object
|
24548 | * @returns {google.protobuf.OneofOptions} OneofOptions
|
24549 | */
|
24550 | OneofOptions.fromObject = function fromObject(object) {
|
24551 | if (object instanceof $root.google.protobuf.OneofOptions)
|
24552 | return object;
|
24553 | var message = new $root.google.protobuf.OneofOptions();
|
24554 | if (object.uninterpretedOption) {
|
24555 | if (!Array.isArray(object.uninterpretedOption))
|
24556 | throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected");
|
24557 | message.uninterpretedOption = [];
|
24558 | for (var i = 0; i < object.uninterpretedOption.length; ++i) {
|
24559 | if (typeof object.uninterpretedOption[i] !== "object")
|
24560 | throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected");
|
24561 | message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]);
|
24562 | }
|
24563 | }
|
24564 | return message;
|
24565 | };
|
24566 |
|
24567 | /**
|
24568 | * Creates a plain object from an OneofOptions message. Also converts values to other types if specified.
|
24569 | * @function toObject
|
24570 | * @memberof google.protobuf.OneofOptions
|
24571 | * @static
|
24572 | * @param {google.protobuf.OneofOptions} message OneofOptions
|
24573 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
24574 | * @returns {Object.<string,*>} Plain object
|
24575 | */
|
24576 | OneofOptions.toObject = function toObject(message, options) {
|
24577 | if (!options)
|
24578 | options = {};
|
24579 | var object = {};
|
24580 | if (options.arrays || options.defaults)
|
24581 | object.uninterpretedOption = [];
|
24582 | if (message.uninterpretedOption && message.uninterpretedOption.length) {
|
24583 | object.uninterpretedOption = [];
|
24584 | for (var j = 0; j < message.uninterpretedOption.length; ++j)
|
24585 | object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options);
|
24586 | }
|
24587 | return object;
|
24588 | };
|
24589 |
|
24590 | /**
|
24591 | * Converts this OneofOptions to JSON.
|
24592 | * @function toJSON
|
24593 | * @memberof google.protobuf.OneofOptions
|
24594 | * @instance
|
24595 | * @returns {Object.<string,*>} JSON object
|
24596 | */
|
24597 | OneofOptions.prototype.toJSON = function toJSON() {
|
24598 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
24599 | };
|
24600 |
|
24601 | return OneofOptions;
|
24602 | })();
|
24603 |
|
24604 | protobuf.EnumOptions = (function() {
|
24605 |
|
24606 | /**
|
24607 | * Properties of an EnumOptions.
|
24608 | * @memberof google.protobuf
|
24609 | * @interface IEnumOptions
|
24610 | * @property {boolean|null} [allowAlias] EnumOptions allowAlias
|
24611 | * @property {boolean|null} [deprecated] EnumOptions deprecated
|
24612 | * @property {Array.<google.protobuf.IUninterpretedOption>|null} [uninterpretedOption] EnumOptions uninterpretedOption
|
24613 | */
|
24614 |
|
24615 | /**
|
24616 | * Constructs a new EnumOptions.
|
24617 | * @memberof google.protobuf
|
24618 | * @classdesc Represents an EnumOptions.
|
24619 | * @implements IEnumOptions
|
24620 | * @constructor
|
24621 | * @param {google.protobuf.IEnumOptions=} [properties] Properties to set
|
24622 | */
|
24623 | function EnumOptions(properties) {
|
24624 | this.uninterpretedOption = [];
|
24625 | if (properties)
|
24626 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
24627 | if (properties[keys[i]] != null)
|
24628 | this[keys[i]] = properties[keys[i]];
|
24629 | }
|
24630 |
|
24631 | /**
|
24632 | * EnumOptions allowAlias.
|
24633 | * @member {boolean} allowAlias
|
24634 | * @memberof google.protobuf.EnumOptions
|
24635 | * @instance
|
24636 | */
|
24637 | EnumOptions.prototype.allowAlias = false;
|
24638 |
|
24639 | /**
|
24640 | * EnumOptions deprecated.
|
24641 | * @member {boolean} deprecated
|
24642 | * @memberof google.protobuf.EnumOptions
|
24643 | * @instance
|
24644 | */
|
24645 | EnumOptions.prototype.deprecated = false;
|
24646 |
|
24647 | /**
|
24648 | * EnumOptions uninterpretedOption.
|
24649 | * @member {Array.<google.protobuf.IUninterpretedOption>} uninterpretedOption
|
24650 | * @memberof google.protobuf.EnumOptions
|
24651 | * @instance
|
24652 | */
|
24653 | EnumOptions.prototype.uninterpretedOption = $util.emptyArray;
|
24654 |
|
24655 | /**
|
24656 | * Creates a new EnumOptions instance using the specified properties.
|
24657 | * @function create
|
24658 | * @memberof google.protobuf.EnumOptions
|
24659 | * @static
|
24660 | * @param {google.protobuf.IEnumOptions=} [properties] Properties to set
|
24661 | * @returns {google.protobuf.EnumOptions} EnumOptions instance
|
24662 | */
|
24663 | EnumOptions.create = function create(properties) {
|
24664 | return new EnumOptions(properties);
|
24665 | };
|
24666 |
|
24667 | /**
|
24668 | * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages.
|
24669 | * @function encode
|
24670 | * @memberof google.protobuf.EnumOptions
|
24671 | * @static
|
24672 | * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode
|
24673 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
24674 | * @returns {$protobuf.Writer} Writer
|
24675 | */
|
24676 | EnumOptions.encode = function encode(message, writer) {
|
24677 | if (!writer)
|
24678 | writer = $Writer.create();
|
24679 | if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias"))
|
24680 | writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias);
|
24681 | if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated"))
|
24682 | writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated);
|
24683 | if (message.uninterpretedOption != null && message.uninterpretedOption.length)
|
24684 | for (var i = 0; i < message.uninterpretedOption.length; ++i)
|
24685 | $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim();
|
24686 | return writer;
|
24687 | };
|
24688 |
|
24689 | /**
|
24690 | * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages.
|
24691 | * @function encodeDelimited
|
24692 | * @memberof google.protobuf.EnumOptions
|
24693 | * @static
|
24694 | * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode
|
24695 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
24696 | * @returns {$protobuf.Writer} Writer
|
24697 | */
|
24698 | EnumOptions.encodeDelimited = function encodeDelimited(message, writer) {
|
24699 | return this.encode(message, writer).ldelim();
|
24700 | };
|
24701 |
|
24702 | /**
|
24703 | * Decodes an EnumOptions message from the specified reader or buffer.
|
24704 | * @function decode
|
24705 | * @memberof google.protobuf.EnumOptions
|
24706 | * @static
|
24707 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
24708 | * @param {number} [length] Message length if known beforehand
|
24709 | * @returns {google.protobuf.EnumOptions} EnumOptions
|
24710 | * @throws {Error} If the payload is not a reader or valid buffer
|
24711 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
24712 | */
|
24713 | EnumOptions.decode = function decode(reader, length) {
|
24714 | if (!(reader instanceof $Reader))
|
24715 | reader = $Reader.create(reader);
|
24716 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions();
|
24717 | while (reader.pos < end) {
|
24718 | var tag = reader.uint32();
|
24719 | switch (tag >>> 3) {
|
24720 | case 2:
|
24721 | message.allowAlias = reader.bool();
|
24722 | break;
|
24723 | case 3:
|
24724 | message.deprecated = reader.bool();
|
24725 | break;
|
24726 | case 999:
|
24727 | if (!(message.uninterpretedOption && message.uninterpretedOption.length))
|
24728 | message.uninterpretedOption = [];
|
24729 | message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32()));
|
24730 | break;
|
24731 | default:
|
24732 | reader.skipType(tag & 7);
|
24733 | break;
|
24734 | }
|
24735 | }
|
24736 | return message;
|
24737 | };
|
24738 |
|
24739 | /**
|
24740 | * Decodes an EnumOptions message from the specified reader or buffer, length delimited.
|
24741 | * @function decodeDelimited
|
24742 | * @memberof google.protobuf.EnumOptions
|
24743 | * @static
|
24744 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
24745 | * @returns {google.protobuf.EnumOptions} EnumOptions
|
24746 | * @throws {Error} If the payload is not a reader or valid buffer
|
24747 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
24748 | */
|
24749 | EnumOptions.decodeDelimited = function decodeDelimited(reader) {
|
24750 | if (!(reader instanceof $Reader))
|
24751 | reader = new $Reader(reader);
|
24752 | return this.decode(reader, reader.uint32());
|
24753 | };
|
24754 |
|
24755 | /**
|
24756 | * Verifies an EnumOptions message.
|
24757 | * @function verify
|
24758 | * @memberof google.protobuf.EnumOptions
|
24759 | * @static
|
24760 | * @param {Object.<string,*>} message Plain object to verify
|
24761 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
24762 | */
|
24763 | EnumOptions.verify = function verify(message) {
|
24764 | if (typeof message !== "object" || message === null)
|
24765 | return "object expected";
|
24766 | if (message.allowAlias != null && message.hasOwnProperty("allowAlias"))
|
24767 | if (typeof message.allowAlias !== "boolean")
|
24768 | return "allowAlias: boolean expected";
|
24769 | if (message.deprecated != null && message.hasOwnProperty("deprecated"))
|
24770 | if (typeof message.deprecated !== "boolean")
|
24771 | return "deprecated: boolean expected";
|
24772 | if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) {
|
24773 | if (!Array.isArray(message.uninterpretedOption))
|
24774 | return "uninterpretedOption: array expected";
|
24775 | for (var i = 0; i < message.uninterpretedOption.length; ++i) {
|
24776 | var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]);
|
24777 | if (error)
|
24778 | return "uninterpretedOption." + error;
|
24779 | }
|
24780 | }
|
24781 | return null;
|
24782 | };
|
24783 |
|
24784 | /**
|
24785 | * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types.
|
24786 | * @function fromObject
|
24787 | * @memberof google.protobuf.EnumOptions
|
24788 | * @static
|
24789 | * @param {Object.<string,*>} object Plain object
|
24790 | * @returns {google.protobuf.EnumOptions} EnumOptions
|
24791 | */
|
24792 | EnumOptions.fromObject = function fromObject(object) {
|
24793 | if (object instanceof $root.google.protobuf.EnumOptions)
|
24794 | return object;
|
24795 | var message = new $root.google.protobuf.EnumOptions();
|
24796 | if (object.allowAlias != null)
|
24797 | message.allowAlias = Boolean(object.allowAlias);
|
24798 | if (object.deprecated != null)
|
24799 | message.deprecated = Boolean(object.deprecated);
|
24800 | if (object.uninterpretedOption) {
|
24801 | if (!Array.isArray(object.uninterpretedOption))
|
24802 | throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected");
|
24803 | message.uninterpretedOption = [];
|
24804 | for (var i = 0; i < object.uninterpretedOption.length; ++i) {
|
24805 | if (typeof object.uninterpretedOption[i] !== "object")
|
24806 | throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected");
|
24807 | message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]);
|
24808 | }
|
24809 | }
|
24810 | return message;
|
24811 | };
|
24812 |
|
24813 | /**
|
24814 | * Creates a plain object from an EnumOptions message. Also converts values to other types if specified.
|
24815 | * @function toObject
|
24816 | * @memberof google.protobuf.EnumOptions
|
24817 | * @static
|
24818 | * @param {google.protobuf.EnumOptions} message EnumOptions
|
24819 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
24820 | * @returns {Object.<string,*>} Plain object
|
24821 | */
|
24822 | EnumOptions.toObject = function toObject(message, options) {
|
24823 | if (!options)
|
24824 | options = {};
|
24825 | var object = {};
|
24826 | if (options.arrays || options.defaults)
|
24827 | object.uninterpretedOption = [];
|
24828 | if (options.defaults) {
|
24829 | object.allowAlias = false;
|
24830 | object.deprecated = false;
|
24831 | }
|
24832 | if (message.allowAlias != null && message.hasOwnProperty("allowAlias"))
|
24833 | object.allowAlias = message.allowAlias;
|
24834 | if (message.deprecated != null && message.hasOwnProperty("deprecated"))
|
24835 | object.deprecated = message.deprecated;
|
24836 | if (message.uninterpretedOption && message.uninterpretedOption.length) {
|
24837 | object.uninterpretedOption = [];
|
24838 | for (var j = 0; j < message.uninterpretedOption.length; ++j)
|
24839 | object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options);
|
24840 | }
|
24841 | return object;
|
24842 | };
|
24843 |
|
24844 | /**
|
24845 | * Converts this EnumOptions to JSON.
|
24846 | * @function toJSON
|
24847 | * @memberof google.protobuf.EnumOptions
|
24848 | * @instance
|
24849 | * @returns {Object.<string,*>} JSON object
|
24850 | */
|
24851 | EnumOptions.prototype.toJSON = function toJSON() {
|
24852 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
24853 | };
|
24854 |
|
24855 | return EnumOptions;
|
24856 | })();
|
24857 |
|
24858 | protobuf.EnumValueOptions = (function() {
|
24859 |
|
24860 | /**
|
24861 | * Properties of an EnumValueOptions.
|
24862 | * @memberof google.protobuf
|
24863 | * @interface IEnumValueOptions
|
24864 | * @property {boolean|null} [deprecated] EnumValueOptions deprecated
|
24865 | * @property {Array.<google.protobuf.IUninterpretedOption>|null} [uninterpretedOption] EnumValueOptions uninterpretedOption
|
24866 | */
|
24867 |
|
24868 | /**
|
24869 | * Constructs a new EnumValueOptions.
|
24870 | * @memberof google.protobuf
|
24871 | * @classdesc Represents an EnumValueOptions.
|
24872 | * @implements IEnumValueOptions
|
24873 | * @constructor
|
24874 | * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set
|
24875 | */
|
24876 | function EnumValueOptions(properties) {
|
24877 | this.uninterpretedOption = [];
|
24878 | if (properties)
|
24879 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
24880 | if (properties[keys[i]] != null)
|
24881 | this[keys[i]] = properties[keys[i]];
|
24882 | }
|
24883 |
|
24884 | /**
|
24885 | * EnumValueOptions deprecated.
|
24886 | * @member {boolean} deprecated
|
24887 | * @memberof google.protobuf.EnumValueOptions
|
24888 | * @instance
|
24889 | */
|
24890 | EnumValueOptions.prototype.deprecated = false;
|
24891 |
|
24892 | /**
|
24893 | * EnumValueOptions uninterpretedOption.
|
24894 | * @member {Array.<google.protobuf.IUninterpretedOption>} uninterpretedOption
|
24895 | * @memberof google.protobuf.EnumValueOptions
|
24896 | * @instance
|
24897 | */
|
24898 | EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray;
|
24899 |
|
24900 | /**
|
24901 | * Creates a new EnumValueOptions instance using the specified properties.
|
24902 | * @function create
|
24903 | * @memberof google.protobuf.EnumValueOptions
|
24904 | * @static
|
24905 | * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set
|
24906 | * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance
|
24907 | */
|
24908 | EnumValueOptions.create = function create(properties) {
|
24909 | return new EnumValueOptions(properties);
|
24910 | };
|
24911 |
|
24912 | /**
|
24913 | * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages.
|
24914 | * @function encode
|
24915 | * @memberof google.protobuf.EnumValueOptions
|
24916 | * @static
|
24917 | * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode
|
24918 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
24919 | * @returns {$protobuf.Writer} Writer
|
24920 | */
|
24921 | EnumValueOptions.encode = function encode(message, writer) {
|
24922 | if (!writer)
|
24923 | writer = $Writer.create();
|
24924 | if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated"))
|
24925 | writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated);
|
24926 | if (message.uninterpretedOption != null && message.uninterpretedOption.length)
|
24927 | for (var i = 0; i < message.uninterpretedOption.length; ++i)
|
24928 | $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim();
|
24929 | return writer;
|
24930 | };
|
24931 |
|
24932 | /**
|
24933 | * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages.
|
24934 | * @function encodeDelimited
|
24935 | * @memberof google.protobuf.EnumValueOptions
|
24936 | * @static
|
24937 | * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode
|
24938 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
24939 | * @returns {$protobuf.Writer} Writer
|
24940 | */
|
24941 | EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) {
|
24942 | return this.encode(message, writer).ldelim();
|
24943 | };
|
24944 |
|
24945 | /**
|
24946 | * Decodes an EnumValueOptions message from the specified reader or buffer.
|
24947 | * @function decode
|
24948 | * @memberof google.protobuf.EnumValueOptions
|
24949 | * @static
|
24950 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
24951 | * @param {number} [length] Message length if known beforehand
|
24952 | * @returns {google.protobuf.EnumValueOptions} EnumValueOptions
|
24953 | * @throws {Error} If the payload is not a reader or valid buffer
|
24954 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
24955 | */
|
24956 | EnumValueOptions.decode = function decode(reader, length) {
|
24957 | if (!(reader instanceof $Reader))
|
24958 | reader = $Reader.create(reader);
|
24959 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions();
|
24960 | while (reader.pos < end) {
|
24961 | var tag = reader.uint32();
|
24962 | switch (tag >>> 3) {
|
24963 | case 1:
|
24964 | message.deprecated = reader.bool();
|
24965 | break;
|
24966 | case 999:
|
24967 | if (!(message.uninterpretedOption && message.uninterpretedOption.length))
|
24968 | message.uninterpretedOption = [];
|
24969 | message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32()));
|
24970 | break;
|
24971 | default:
|
24972 | reader.skipType(tag & 7);
|
24973 | break;
|
24974 | }
|
24975 | }
|
24976 | return message;
|
24977 | };
|
24978 |
|
24979 | /**
|
24980 | * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited.
|
24981 | * @function decodeDelimited
|
24982 | * @memberof google.protobuf.EnumValueOptions
|
24983 | * @static
|
24984 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
24985 | * @returns {google.protobuf.EnumValueOptions} EnumValueOptions
|
24986 | * @throws {Error} If the payload is not a reader or valid buffer
|
24987 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
24988 | */
|
24989 | EnumValueOptions.decodeDelimited = function decodeDelimited(reader) {
|
24990 | if (!(reader instanceof $Reader))
|
24991 | reader = new $Reader(reader);
|
24992 | return this.decode(reader, reader.uint32());
|
24993 | };
|
24994 |
|
24995 | /**
|
24996 | * Verifies an EnumValueOptions message.
|
24997 | * @function verify
|
24998 | * @memberof google.protobuf.EnumValueOptions
|
24999 | * @static
|
25000 | * @param {Object.<string,*>} message Plain object to verify
|
25001 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
25002 | */
|
25003 | EnumValueOptions.verify = function verify(message) {
|
25004 | if (typeof message !== "object" || message === null)
|
25005 | return "object expected";
|
25006 | if (message.deprecated != null && message.hasOwnProperty("deprecated"))
|
25007 | if (typeof message.deprecated !== "boolean")
|
25008 | return "deprecated: boolean expected";
|
25009 | if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) {
|
25010 | if (!Array.isArray(message.uninterpretedOption))
|
25011 | return "uninterpretedOption: array expected";
|
25012 | for (var i = 0; i < message.uninterpretedOption.length; ++i) {
|
25013 | var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]);
|
25014 | if (error)
|
25015 | return "uninterpretedOption." + error;
|
25016 | }
|
25017 | }
|
25018 | return null;
|
25019 | };
|
25020 |
|
25021 | /**
|
25022 | * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types.
|
25023 | * @function fromObject
|
25024 | * @memberof google.protobuf.EnumValueOptions
|
25025 | * @static
|
25026 | * @param {Object.<string,*>} object Plain object
|
25027 | * @returns {google.protobuf.EnumValueOptions} EnumValueOptions
|
25028 | */
|
25029 | EnumValueOptions.fromObject = function fromObject(object) {
|
25030 | if (object instanceof $root.google.protobuf.EnumValueOptions)
|
25031 | return object;
|
25032 | var message = new $root.google.protobuf.EnumValueOptions();
|
25033 | if (object.deprecated != null)
|
25034 | message.deprecated = Boolean(object.deprecated);
|
25035 | if (object.uninterpretedOption) {
|
25036 | if (!Array.isArray(object.uninterpretedOption))
|
25037 | throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected");
|
25038 | message.uninterpretedOption = [];
|
25039 | for (var i = 0; i < object.uninterpretedOption.length; ++i) {
|
25040 | if (typeof object.uninterpretedOption[i] !== "object")
|
25041 | throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected");
|
25042 | message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]);
|
25043 | }
|
25044 | }
|
25045 | return message;
|
25046 | };
|
25047 |
|
25048 | /**
|
25049 | * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified.
|
25050 | * @function toObject
|
25051 | * @memberof google.protobuf.EnumValueOptions
|
25052 | * @static
|
25053 | * @param {google.protobuf.EnumValueOptions} message EnumValueOptions
|
25054 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
25055 | * @returns {Object.<string,*>} Plain object
|
25056 | */
|
25057 | EnumValueOptions.toObject = function toObject(message, options) {
|
25058 | if (!options)
|
25059 | options = {};
|
25060 | var object = {};
|
25061 | if (options.arrays || options.defaults)
|
25062 | object.uninterpretedOption = [];
|
25063 | if (options.defaults)
|
25064 | object.deprecated = false;
|
25065 | if (message.deprecated != null && message.hasOwnProperty("deprecated"))
|
25066 | object.deprecated = message.deprecated;
|
25067 | if (message.uninterpretedOption && message.uninterpretedOption.length) {
|
25068 | object.uninterpretedOption = [];
|
25069 | for (var j = 0; j < message.uninterpretedOption.length; ++j)
|
25070 | object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options);
|
25071 | }
|
25072 | return object;
|
25073 | };
|
25074 |
|
25075 | /**
|
25076 | * Converts this EnumValueOptions to JSON.
|
25077 | * @function toJSON
|
25078 | * @memberof google.protobuf.EnumValueOptions
|
25079 | * @instance
|
25080 | * @returns {Object.<string,*>} JSON object
|
25081 | */
|
25082 | EnumValueOptions.prototype.toJSON = function toJSON() {
|
25083 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
25084 | };
|
25085 |
|
25086 | return EnumValueOptions;
|
25087 | })();
|
25088 |
|
25089 | protobuf.ServiceOptions = (function() {
|
25090 |
|
25091 | /**
|
25092 | * Properties of a ServiceOptions.
|
25093 | * @memberof google.protobuf
|
25094 | * @interface IServiceOptions
|
25095 | * @property {boolean|null} [deprecated] ServiceOptions deprecated
|
25096 | * @property {Array.<google.protobuf.IUninterpretedOption>|null} [uninterpretedOption] ServiceOptions uninterpretedOption
|
25097 | * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost
|
25098 | * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes
|
25099 | */
|
25100 |
|
25101 | /**
|
25102 | * Constructs a new ServiceOptions.
|
25103 | * @memberof google.protobuf
|
25104 | * @classdesc Represents a ServiceOptions.
|
25105 | * @implements IServiceOptions
|
25106 | * @constructor
|
25107 | * @param {google.protobuf.IServiceOptions=} [properties] Properties to set
|
25108 | */
|
25109 | function ServiceOptions(properties) {
|
25110 | this.uninterpretedOption = [];
|
25111 | if (properties)
|
25112 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
25113 | if (properties[keys[i]] != null)
|
25114 | this[keys[i]] = properties[keys[i]];
|
25115 | }
|
25116 |
|
25117 | /**
|
25118 | * ServiceOptions deprecated.
|
25119 | * @member {boolean} deprecated
|
25120 | * @memberof google.protobuf.ServiceOptions
|
25121 | * @instance
|
25122 | */
|
25123 | ServiceOptions.prototype.deprecated = false;
|
25124 |
|
25125 | /**
|
25126 | * ServiceOptions uninterpretedOption.
|
25127 | * @member {Array.<google.protobuf.IUninterpretedOption>} uninterpretedOption
|
25128 | * @memberof google.protobuf.ServiceOptions
|
25129 | * @instance
|
25130 | */
|
25131 | ServiceOptions.prototype.uninterpretedOption = $util.emptyArray;
|
25132 |
|
25133 | /**
|
25134 | * ServiceOptions .google.api.defaultHost.
|
25135 | * @member {string} .google.api.defaultHost
|
25136 | * @memberof google.protobuf.ServiceOptions
|
25137 | * @instance
|
25138 | */
|
25139 | ServiceOptions.prototype[".google.api.defaultHost"] = "";
|
25140 |
|
25141 | /**
|
25142 | * ServiceOptions .google.api.oauthScopes.
|
25143 | * @member {string} .google.api.oauthScopes
|
25144 | * @memberof google.protobuf.ServiceOptions
|
25145 | * @instance
|
25146 | */
|
25147 | ServiceOptions.prototype[".google.api.oauthScopes"] = "";
|
25148 |
|
25149 | /**
|
25150 | * Creates a new ServiceOptions instance using the specified properties.
|
25151 | * @function create
|
25152 | * @memberof google.protobuf.ServiceOptions
|
25153 | * @static
|
25154 | * @param {google.protobuf.IServiceOptions=} [properties] Properties to set
|
25155 | * @returns {google.protobuf.ServiceOptions} ServiceOptions instance
|
25156 | */
|
25157 | ServiceOptions.create = function create(properties) {
|
25158 | return new ServiceOptions(properties);
|
25159 | };
|
25160 |
|
25161 | /**
|
25162 | * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages.
|
25163 | * @function encode
|
25164 | * @memberof google.protobuf.ServiceOptions
|
25165 | * @static
|
25166 | * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode
|
25167 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
25168 | * @returns {$protobuf.Writer} Writer
|
25169 | */
|
25170 | ServiceOptions.encode = function encode(message, writer) {
|
25171 | if (!writer)
|
25172 | writer = $Writer.create();
|
25173 | if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated"))
|
25174 | writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated);
|
25175 | if (message.uninterpretedOption != null && message.uninterpretedOption.length)
|
25176 | for (var i = 0; i < message.uninterpretedOption.length; ++i)
|
25177 | $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim();
|
25178 | if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost"))
|
25179 | writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]);
|
25180 | if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes"))
|
25181 | writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]);
|
25182 | return writer;
|
25183 | };
|
25184 |
|
25185 | /**
|
25186 | * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages.
|
25187 | * @function encodeDelimited
|
25188 | * @memberof google.protobuf.ServiceOptions
|
25189 | * @static
|
25190 | * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode
|
25191 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
25192 | * @returns {$protobuf.Writer} Writer
|
25193 | */
|
25194 | ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) {
|
25195 | return this.encode(message, writer).ldelim();
|
25196 | };
|
25197 |
|
25198 | /**
|
25199 | * Decodes a ServiceOptions message from the specified reader or buffer.
|
25200 | * @function decode
|
25201 | * @memberof google.protobuf.ServiceOptions
|
25202 | * @static
|
25203 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
25204 | * @param {number} [length] Message length if known beforehand
|
25205 | * @returns {google.protobuf.ServiceOptions} ServiceOptions
|
25206 | * @throws {Error} If the payload is not a reader or valid buffer
|
25207 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
25208 | */
|
25209 | ServiceOptions.decode = function decode(reader, length) {
|
25210 | if (!(reader instanceof $Reader))
|
25211 | reader = $Reader.create(reader);
|
25212 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions();
|
25213 | while (reader.pos < end) {
|
25214 | var tag = reader.uint32();
|
25215 | switch (tag >>> 3) {
|
25216 | case 33:
|
25217 | message.deprecated = reader.bool();
|
25218 | break;
|
25219 | case 999:
|
25220 | if (!(message.uninterpretedOption && message.uninterpretedOption.length))
|
25221 | message.uninterpretedOption = [];
|
25222 | message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32()));
|
25223 | break;
|
25224 | case 1049:
|
25225 | message[".google.api.defaultHost"] = reader.string();
|
25226 | break;
|
25227 | case 1050:
|
25228 | message[".google.api.oauthScopes"] = reader.string();
|
25229 | break;
|
25230 | default:
|
25231 | reader.skipType(tag & 7);
|
25232 | break;
|
25233 | }
|
25234 | }
|
25235 | return message;
|
25236 | };
|
25237 |
|
25238 | /**
|
25239 | * Decodes a ServiceOptions message from the specified reader or buffer, length delimited.
|
25240 | * @function decodeDelimited
|
25241 | * @memberof google.protobuf.ServiceOptions
|
25242 | * @static
|
25243 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
25244 | * @returns {google.protobuf.ServiceOptions} ServiceOptions
|
25245 | * @throws {Error} If the payload is not a reader or valid buffer
|
25246 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
25247 | */
|
25248 | ServiceOptions.decodeDelimited = function decodeDelimited(reader) {
|
25249 | if (!(reader instanceof $Reader))
|
25250 | reader = new $Reader(reader);
|
25251 | return this.decode(reader, reader.uint32());
|
25252 | };
|
25253 |
|
25254 | /**
|
25255 | * Verifies a ServiceOptions message.
|
25256 | * @function verify
|
25257 | * @memberof google.protobuf.ServiceOptions
|
25258 | * @static
|
25259 | * @param {Object.<string,*>} message Plain object to verify
|
25260 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
25261 | */
|
25262 | ServiceOptions.verify = function verify(message) {
|
25263 | if (typeof message !== "object" || message === null)
|
25264 | return "object expected";
|
25265 | if (message.deprecated != null && message.hasOwnProperty("deprecated"))
|
25266 | if (typeof message.deprecated !== "boolean")
|
25267 | return "deprecated: boolean expected";
|
25268 | if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) {
|
25269 | if (!Array.isArray(message.uninterpretedOption))
|
25270 | return "uninterpretedOption: array expected";
|
25271 | for (var i = 0; i < message.uninterpretedOption.length; ++i) {
|
25272 | var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]);
|
25273 | if (error)
|
25274 | return "uninterpretedOption." + error;
|
25275 | }
|
25276 | }
|
25277 | if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost"))
|
25278 | if (!$util.isString(message[".google.api.defaultHost"]))
|
25279 | return ".google.api.defaultHost: string expected";
|
25280 | if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes"))
|
25281 | if (!$util.isString(message[".google.api.oauthScopes"]))
|
25282 | return ".google.api.oauthScopes: string expected";
|
25283 | return null;
|
25284 | };
|
25285 |
|
25286 | /**
|
25287 | * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types.
|
25288 | * @function fromObject
|
25289 | * @memberof google.protobuf.ServiceOptions
|
25290 | * @static
|
25291 | * @param {Object.<string,*>} object Plain object
|
25292 | * @returns {google.protobuf.ServiceOptions} ServiceOptions
|
25293 | */
|
25294 | ServiceOptions.fromObject = function fromObject(object) {
|
25295 | if (object instanceof $root.google.protobuf.ServiceOptions)
|
25296 | return object;
|
25297 | var message = new $root.google.protobuf.ServiceOptions();
|
25298 | if (object.deprecated != null)
|
25299 | message.deprecated = Boolean(object.deprecated);
|
25300 | if (object.uninterpretedOption) {
|
25301 | if (!Array.isArray(object.uninterpretedOption))
|
25302 | throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected");
|
25303 | message.uninterpretedOption = [];
|
25304 | for (var i = 0; i < object.uninterpretedOption.length; ++i) {
|
25305 | if (typeof object.uninterpretedOption[i] !== "object")
|
25306 | throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected");
|
25307 | message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]);
|
25308 | }
|
25309 | }
|
25310 | if (object[".google.api.defaultHost"] != null)
|
25311 | message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]);
|
25312 | if (object[".google.api.oauthScopes"] != null)
|
25313 | message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]);
|
25314 | return message;
|
25315 | };
|
25316 |
|
25317 | /**
|
25318 | * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified.
|
25319 | * @function toObject
|
25320 | * @memberof google.protobuf.ServiceOptions
|
25321 | * @static
|
25322 | * @param {google.protobuf.ServiceOptions} message ServiceOptions
|
25323 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
25324 | * @returns {Object.<string,*>} Plain object
|
25325 | */
|
25326 | ServiceOptions.toObject = function toObject(message, options) {
|
25327 | if (!options)
|
25328 | options = {};
|
25329 | var object = {};
|
25330 | if (options.arrays || options.defaults)
|
25331 | object.uninterpretedOption = [];
|
25332 | if (options.defaults) {
|
25333 | object.deprecated = false;
|
25334 | object[".google.api.defaultHost"] = "";
|
25335 | object[".google.api.oauthScopes"] = "";
|
25336 | }
|
25337 | if (message.deprecated != null && message.hasOwnProperty("deprecated"))
|
25338 | object.deprecated = message.deprecated;
|
25339 | if (message.uninterpretedOption && message.uninterpretedOption.length) {
|
25340 | object.uninterpretedOption = [];
|
25341 | for (var j = 0; j < message.uninterpretedOption.length; ++j)
|
25342 | object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options);
|
25343 | }
|
25344 | if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost"))
|
25345 | object[".google.api.defaultHost"] = message[".google.api.defaultHost"];
|
25346 | if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes"))
|
25347 | object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"];
|
25348 | return object;
|
25349 | };
|
25350 |
|
25351 | /**
|
25352 | * Converts this ServiceOptions to JSON.
|
25353 | * @function toJSON
|
25354 | * @memberof google.protobuf.ServiceOptions
|
25355 | * @instance
|
25356 | * @returns {Object.<string,*>} JSON object
|
25357 | */
|
25358 | ServiceOptions.prototype.toJSON = function toJSON() {
|
25359 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
25360 | };
|
25361 |
|
25362 | return ServiceOptions;
|
25363 | })();
|
25364 |
|
25365 | protobuf.MethodOptions = (function() {
|
25366 |
|
25367 | /**
|
25368 | * Properties of a MethodOptions.
|
25369 | * @memberof google.protobuf
|
25370 | * @interface IMethodOptions
|
25371 | * @property {boolean|null} [deprecated] MethodOptions deprecated
|
25372 | * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel
|
25373 | * @property {Array.<google.protobuf.IUninterpretedOption>|null} [uninterpretedOption] MethodOptions uninterpretedOption
|
25374 | * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http
|
25375 | * @property {Array.<string>|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature
|
25376 | * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo
|
25377 | */
|
25378 |
|
25379 | /**
|
25380 | * Constructs a new MethodOptions.
|
25381 | * @memberof google.protobuf
|
25382 | * @classdesc Represents a MethodOptions.
|
25383 | * @implements IMethodOptions
|
25384 | * @constructor
|
25385 | * @param {google.protobuf.IMethodOptions=} [properties] Properties to set
|
25386 | */
|
25387 | function MethodOptions(properties) {
|
25388 | this.uninterpretedOption = [];
|
25389 | this[".google.api.methodSignature"] = [];
|
25390 | if (properties)
|
25391 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
25392 | if (properties[keys[i]] != null)
|
25393 | this[keys[i]] = properties[keys[i]];
|
25394 | }
|
25395 |
|
25396 | /**
|
25397 | * MethodOptions deprecated.
|
25398 | * @member {boolean} deprecated
|
25399 | * @memberof google.protobuf.MethodOptions
|
25400 | * @instance
|
25401 | */
|
25402 | MethodOptions.prototype.deprecated = false;
|
25403 |
|
25404 | /**
|
25405 | * MethodOptions idempotencyLevel.
|
25406 | * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel
|
25407 | * @memberof google.protobuf.MethodOptions
|
25408 | * @instance
|
25409 | */
|
25410 | MethodOptions.prototype.idempotencyLevel = 0;
|
25411 |
|
25412 | /**
|
25413 | * MethodOptions uninterpretedOption.
|
25414 | * @member {Array.<google.protobuf.IUninterpretedOption>} uninterpretedOption
|
25415 | * @memberof google.protobuf.MethodOptions
|
25416 | * @instance
|
25417 | */
|
25418 | MethodOptions.prototype.uninterpretedOption = $util.emptyArray;
|
25419 |
|
25420 | /**
|
25421 | * MethodOptions .google.api.http.
|
25422 | * @member {google.api.IHttpRule|null|undefined} .google.api.http
|
25423 | * @memberof google.protobuf.MethodOptions
|
25424 | * @instance
|
25425 | */
|
25426 | MethodOptions.prototype[".google.api.http"] = null;
|
25427 |
|
25428 | /**
|
25429 | * MethodOptions .google.api.methodSignature.
|
25430 | * @member {Array.<string>} .google.api.methodSignature
|
25431 | * @memberof google.protobuf.MethodOptions
|
25432 | * @instance
|
25433 | */
|
25434 | MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray;
|
25435 |
|
25436 | /**
|
25437 | * MethodOptions .google.longrunning.operationInfo.
|
25438 | * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo
|
25439 | * @memberof google.protobuf.MethodOptions
|
25440 | * @instance
|
25441 | */
|
25442 | MethodOptions.prototype[".google.longrunning.operationInfo"] = null;
|
25443 |
|
25444 | /**
|
25445 | * Creates a new MethodOptions instance using the specified properties.
|
25446 | * @function create
|
25447 | * @memberof google.protobuf.MethodOptions
|
25448 | * @static
|
25449 | * @param {google.protobuf.IMethodOptions=} [properties] Properties to set
|
25450 | * @returns {google.protobuf.MethodOptions} MethodOptions instance
|
25451 | */
|
25452 | MethodOptions.create = function create(properties) {
|
25453 | return new MethodOptions(properties);
|
25454 | };
|
25455 |
|
25456 | /**
|
25457 | * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages.
|
25458 | * @function encode
|
25459 | * @memberof google.protobuf.MethodOptions
|
25460 | * @static
|
25461 | * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode
|
25462 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
25463 | * @returns {$protobuf.Writer} Writer
|
25464 | */
|
25465 | MethodOptions.encode = function encode(message, writer) {
|
25466 | if (!writer)
|
25467 | writer = $Writer.create();
|
25468 | if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated"))
|
25469 | writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated);
|
25470 | if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel"))
|
25471 | writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel);
|
25472 | if (message.uninterpretedOption != null && message.uninterpretedOption.length)
|
25473 | for (var i = 0; i < message.uninterpretedOption.length; ++i)
|
25474 | $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim();
|
25475 | if (message[".google.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo"))
|
25476 | $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).fork()).ldelim();
|
25477 | if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length)
|
25478 | for (var i = 0; i < message[".google.api.methodSignature"].length; ++i)
|
25479 | writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]);
|
25480 | if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http"))
|
25481 | $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim();
|
25482 | return writer;
|
25483 | };
|
25484 |
|
25485 | /**
|
25486 | * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages.
|
25487 | * @function encodeDelimited
|
25488 | * @memberof google.protobuf.MethodOptions
|
25489 | * @static
|
25490 | * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode
|
25491 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
25492 | * @returns {$protobuf.Writer} Writer
|
25493 | */
|
25494 | MethodOptions.encodeDelimited = function encodeDelimited(message, writer) {
|
25495 | return this.encode(message, writer).ldelim();
|
25496 | };
|
25497 |
|
25498 | /**
|
25499 | * Decodes a MethodOptions message from the specified reader or buffer.
|
25500 | * @function decode
|
25501 | * @memberof google.protobuf.MethodOptions
|
25502 | * @static
|
25503 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
25504 | * @param {number} [length] Message length if known beforehand
|
25505 | * @returns {google.protobuf.MethodOptions} MethodOptions
|
25506 | * @throws {Error} If the payload is not a reader or valid buffer
|
25507 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
25508 | */
|
25509 | MethodOptions.decode = function decode(reader, length) {
|
25510 | if (!(reader instanceof $Reader))
|
25511 | reader = $Reader.create(reader);
|
25512 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions();
|
25513 | while (reader.pos < end) {
|
25514 | var tag = reader.uint32();
|
25515 | switch (tag >>> 3) {
|
25516 | case 33:
|
25517 | message.deprecated = reader.bool();
|
25518 | break;
|
25519 | case 34:
|
25520 | message.idempotencyLevel = reader.int32();
|
25521 | break;
|
25522 | case 999:
|
25523 | if (!(message.uninterpretedOption && message.uninterpretedOption.length))
|
25524 | message.uninterpretedOption = [];
|
25525 | message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32()));
|
25526 | break;
|
25527 | case 72295728:
|
25528 | message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32());
|
25529 | break;
|
25530 | case 1051:
|
25531 | if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length))
|
25532 | message[".google.api.methodSignature"] = [];
|
25533 | message[".google.api.methodSignature"].push(reader.string());
|
25534 | break;
|
25535 | case 1049:
|
25536 | message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32());
|
25537 | break;
|
25538 | default:
|
25539 | reader.skipType(tag & 7);
|
25540 | break;
|
25541 | }
|
25542 | }
|
25543 | return message;
|
25544 | };
|
25545 |
|
25546 | /**
|
25547 | * Decodes a MethodOptions message from the specified reader or buffer, length delimited.
|
25548 | * @function decodeDelimited
|
25549 | * @memberof google.protobuf.MethodOptions
|
25550 | * @static
|
25551 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
25552 | * @returns {google.protobuf.MethodOptions} MethodOptions
|
25553 | * @throws {Error} If the payload is not a reader or valid buffer
|
25554 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
25555 | */
|
25556 | MethodOptions.decodeDelimited = function decodeDelimited(reader) {
|
25557 | if (!(reader instanceof $Reader))
|
25558 | reader = new $Reader(reader);
|
25559 | return this.decode(reader, reader.uint32());
|
25560 | };
|
25561 |
|
25562 | /**
|
25563 | * Verifies a MethodOptions message.
|
25564 | * @function verify
|
25565 | * @memberof google.protobuf.MethodOptions
|
25566 | * @static
|
25567 | * @param {Object.<string,*>} message Plain object to verify
|
25568 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
25569 | */
|
25570 | MethodOptions.verify = function verify(message) {
|
25571 | if (typeof message !== "object" || message === null)
|
25572 | return "object expected";
|
25573 | if (message.deprecated != null && message.hasOwnProperty("deprecated"))
|
25574 | if (typeof message.deprecated !== "boolean")
|
25575 | return "deprecated: boolean expected";
|
25576 | if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel"))
|
25577 | switch (message.idempotencyLevel) {
|
25578 | default:
|
25579 | return "idempotencyLevel: enum value expected";
|
25580 | case 0:
|
25581 | case 1:
|
25582 | case 2:
|
25583 | break;
|
25584 | }
|
25585 | if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) {
|
25586 | if (!Array.isArray(message.uninterpretedOption))
|
25587 | return "uninterpretedOption: array expected";
|
25588 | for (var i = 0; i < message.uninterpretedOption.length; ++i) {
|
25589 | var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]);
|
25590 | if (error)
|
25591 | return "uninterpretedOption." + error;
|
25592 | }
|
25593 | }
|
25594 | if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) {
|
25595 | var error = $root.google.api.HttpRule.verify(message[".google.api.http"]);
|
25596 | if (error)
|
25597 | return ".google.api.http." + error;
|
25598 | }
|
25599 | if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) {
|
25600 | if (!Array.isArray(message[".google.api.methodSignature"]))
|
25601 | return ".google.api.methodSignature: array expected";
|
25602 | for (var i = 0; i < message[".google.api.methodSignature"].length; ++i)
|
25603 | if (!$util.isString(message[".google.api.methodSignature"][i]))
|
25604 | return ".google.api.methodSignature: string[] expected";
|
25605 | }
|
25606 | if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) {
|
25607 | var error = $root.google.longrunning.OperationInfo.verify(message[".google.longrunning.operationInfo"]);
|
25608 | if (error)
|
25609 | return ".google.longrunning.operationInfo." + error;
|
25610 | }
|
25611 | return null;
|
25612 | };
|
25613 |
|
25614 | /**
|
25615 | * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types.
|
25616 | * @function fromObject
|
25617 | * @memberof google.protobuf.MethodOptions
|
25618 | * @static
|
25619 | * @param {Object.<string,*>} object Plain object
|
25620 | * @returns {google.protobuf.MethodOptions} MethodOptions
|
25621 | */
|
25622 | MethodOptions.fromObject = function fromObject(object) {
|
25623 | if (object instanceof $root.google.protobuf.MethodOptions)
|
25624 | return object;
|
25625 | var message = new $root.google.protobuf.MethodOptions();
|
25626 | if (object.deprecated != null)
|
25627 | message.deprecated = Boolean(object.deprecated);
|
25628 | switch (object.idempotencyLevel) {
|
25629 | case "IDEMPOTENCY_UNKNOWN":
|
25630 | case 0:
|
25631 | message.idempotencyLevel = 0;
|
25632 | break;
|
25633 | case "NO_SIDE_EFFECTS":
|
25634 | case 1:
|
25635 | message.idempotencyLevel = 1;
|
25636 | break;
|
25637 | case "IDEMPOTENT":
|
25638 | case 2:
|
25639 | message.idempotencyLevel = 2;
|
25640 | break;
|
25641 | }
|
25642 | if (object.uninterpretedOption) {
|
25643 | if (!Array.isArray(object.uninterpretedOption))
|
25644 | throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected");
|
25645 | message.uninterpretedOption = [];
|
25646 | for (var i = 0; i < object.uninterpretedOption.length; ++i) {
|
25647 | if (typeof object.uninterpretedOption[i] !== "object")
|
25648 | throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected");
|
25649 | message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]);
|
25650 | }
|
25651 | }
|
25652 | if (object[".google.api.http"] != null) {
|
25653 | if (typeof object[".google.api.http"] !== "object")
|
25654 | throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected");
|
25655 | message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]);
|
25656 | }
|
25657 | if (object[".google.api.methodSignature"]) {
|
25658 | if (!Array.isArray(object[".google.api.methodSignature"]))
|
25659 | throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected");
|
25660 | message[".google.api.methodSignature"] = [];
|
25661 | for (var i = 0; i < object[".google.api.methodSignature"].length; ++i)
|
25662 | message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]);
|
25663 | }
|
25664 | if (object[".google.longrunning.operationInfo"] != null) {
|
25665 | if (typeof object[".google.longrunning.operationInfo"] !== "object")
|
25666 | throw TypeError(".google.protobuf.MethodOptions..google.longrunning.operationInfo: object expected");
|
25667 | message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.fromObject(object[".google.longrunning.operationInfo"]);
|
25668 | }
|
25669 | return message;
|
25670 | };
|
25671 |
|
25672 | /**
|
25673 | * Creates a plain object from a MethodOptions message. Also converts values to other types if specified.
|
25674 | * @function toObject
|
25675 | * @memberof google.protobuf.MethodOptions
|
25676 | * @static
|
25677 | * @param {google.protobuf.MethodOptions} message MethodOptions
|
25678 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
25679 | * @returns {Object.<string,*>} Plain object
|
25680 | */
|
25681 | MethodOptions.toObject = function toObject(message, options) {
|
25682 | if (!options)
|
25683 | options = {};
|
25684 | var object = {};
|
25685 | if (options.arrays || options.defaults) {
|
25686 | object.uninterpretedOption = [];
|
25687 | object[".google.api.methodSignature"] = [];
|
25688 | }
|
25689 | if (options.defaults) {
|
25690 | object.deprecated = false;
|
25691 | object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0;
|
25692 | object[".google.longrunning.operationInfo"] = null;
|
25693 | object[".google.api.http"] = null;
|
25694 | }
|
25695 | if (message.deprecated != null && message.hasOwnProperty("deprecated"))
|
25696 | object.deprecated = message.deprecated;
|
25697 | if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel"))
|
25698 | object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel;
|
25699 | if (message.uninterpretedOption && message.uninterpretedOption.length) {
|
25700 | object.uninterpretedOption = [];
|
25701 | for (var j = 0; j < message.uninterpretedOption.length; ++j)
|
25702 | object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options);
|
25703 | }
|
25704 | if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo"))
|
25705 | object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], options);
|
25706 | if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) {
|
25707 | object[".google.api.methodSignature"] = [];
|
25708 | for (var j = 0; j < message[".google.api.methodSignature"].length; ++j)
|
25709 | object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j];
|
25710 | }
|
25711 | if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http"))
|
25712 | object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options);
|
25713 | return object;
|
25714 | };
|
25715 |
|
25716 | /**
|
25717 | * Converts this MethodOptions to JSON.
|
25718 | * @function toJSON
|
25719 | * @memberof google.protobuf.MethodOptions
|
25720 | * @instance
|
25721 | * @returns {Object.<string,*>} JSON object
|
25722 | */
|
25723 | MethodOptions.prototype.toJSON = function toJSON() {
|
25724 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
25725 | };
|
25726 |
|
25727 | /**
|
25728 | * IdempotencyLevel enum.
|
25729 | * @name google.protobuf.MethodOptions.IdempotencyLevel
|
25730 | * @enum {number}
|
25731 | * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value
|
25732 | * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value
|
25733 | * @property {number} IDEMPOTENT=2 IDEMPOTENT value
|
25734 | */
|
25735 | MethodOptions.IdempotencyLevel = (function() {
|
25736 | var valuesById = {}, values = Object.create(valuesById);
|
25737 | values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0;
|
25738 | values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1;
|
25739 | values[valuesById[2] = "IDEMPOTENT"] = 2;
|
25740 | return values;
|
25741 | })();
|
25742 |
|
25743 | return MethodOptions;
|
25744 | })();
|
25745 |
|
25746 | protobuf.UninterpretedOption = (function() {
|
25747 |
|
25748 | /**
|
25749 | * Properties of an UninterpretedOption.
|
25750 | * @memberof google.protobuf
|
25751 | * @interface IUninterpretedOption
|
25752 | * @property {Array.<google.protobuf.UninterpretedOption.INamePart>|null} [name] UninterpretedOption name
|
25753 | * @property {string|null} [identifierValue] UninterpretedOption identifierValue
|
25754 | * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue
|
25755 | * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue
|
25756 | * @property {number|null} [doubleValue] UninterpretedOption doubleValue
|
25757 | * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue
|
25758 | * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue
|
25759 | */
|
25760 |
|
25761 | /**
|
25762 | * Constructs a new UninterpretedOption.
|
25763 | * @memberof google.protobuf
|
25764 | * @classdesc Represents an UninterpretedOption.
|
25765 | * @implements IUninterpretedOption
|
25766 | * @constructor
|
25767 | * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set
|
25768 | */
|
25769 | function UninterpretedOption(properties) {
|
25770 | this.name = [];
|
25771 | if (properties)
|
25772 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
25773 | if (properties[keys[i]] != null)
|
25774 | this[keys[i]] = properties[keys[i]];
|
25775 | }
|
25776 |
|
25777 | /**
|
25778 | * UninterpretedOption name.
|
25779 | * @member {Array.<google.protobuf.UninterpretedOption.INamePart>} name
|
25780 | * @memberof google.protobuf.UninterpretedOption
|
25781 | * @instance
|
25782 | */
|
25783 | UninterpretedOption.prototype.name = $util.emptyArray;
|
25784 |
|
25785 | /**
|
25786 | * UninterpretedOption identifierValue.
|
25787 | * @member {string} identifierValue
|
25788 | * @memberof google.protobuf.UninterpretedOption
|
25789 | * @instance
|
25790 | */
|
25791 | UninterpretedOption.prototype.identifierValue = "";
|
25792 |
|
25793 | /**
|
25794 | * UninterpretedOption positiveIntValue.
|
25795 | * @member {number|Long} positiveIntValue
|
25796 | * @memberof google.protobuf.UninterpretedOption
|
25797 | * @instance
|
25798 | */
|
25799 | UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
|
25800 |
|
25801 | /**
|
25802 | * UninterpretedOption negativeIntValue.
|
25803 | * @member {number|Long} negativeIntValue
|
25804 | * @memberof google.protobuf.UninterpretedOption
|
25805 | * @instance
|
25806 | */
|
25807 | UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
25808 |
|
25809 | /**
|
25810 | * UninterpretedOption doubleValue.
|
25811 | * @member {number} doubleValue
|
25812 | * @memberof google.protobuf.UninterpretedOption
|
25813 | * @instance
|
25814 | */
|
25815 | UninterpretedOption.prototype.doubleValue = 0;
|
25816 |
|
25817 | /**
|
25818 | * UninterpretedOption stringValue.
|
25819 | * @member {Uint8Array} stringValue
|
25820 | * @memberof google.protobuf.UninterpretedOption
|
25821 | * @instance
|
25822 | */
|
25823 | UninterpretedOption.prototype.stringValue = $util.newBuffer([]);
|
25824 |
|
25825 | /**
|
25826 | * UninterpretedOption aggregateValue.
|
25827 | * @member {string} aggregateValue
|
25828 | * @memberof google.protobuf.UninterpretedOption
|
25829 | * @instance
|
25830 | */
|
25831 | UninterpretedOption.prototype.aggregateValue = "";
|
25832 |
|
25833 | /**
|
25834 | * Creates a new UninterpretedOption instance using the specified properties.
|
25835 | * @function create
|
25836 | * @memberof google.protobuf.UninterpretedOption
|
25837 | * @static
|
25838 | * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set
|
25839 | * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance
|
25840 | */
|
25841 | UninterpretedOption.create = function create(properties) {
|
25842 | return new UninterpretedOption(properties);
|
25843 | };
|
25844 |
|
25845 | /**
|
25846 | * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages.
|
25847 | * @function encode
|
25848 | * @memberof google.protobuf.UninterpretedOption
|
25849 | * @static
|
25850 | * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode
|
25851 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
25852 | * @returns {$protobuf.Writer} Writer
|
25853 | */
|
25854 | UninterpretedOption.encode = function encode(message, writer) {
|
25855 | if (!writer)
|
25856 | writer = $Writer.create();
|
25857 | if (message.name != null && message.name.length)
|
25858 | for (var i = 0; i < message.name.length; ++i)
|
25859 | $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
25860 | if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue"))
|
25861 | writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue);
|
25862 | if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue"))
|
25863 | writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue);
|
25864 | if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue"))
|
25865 | writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue);
|
25866 | if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue"))
|
25867 | writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue);
|
25868 | if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue"))
|
25869 | writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue);
|
25870 | if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue"))
|
25871 | writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue);
|
25872 | return writer;
|
25873 | };
|
25874 |
|
25875 | /**
|
25876 | * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages.
|
25877 | * @function encodeDelimited
|
25878 | * @memberof google.protobuf.UninterpretedOption
|
25879 | * @static
|
25880 | * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode
|
25881 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
25882 | * @returns {$protobuf.Writer} Writer
|
25883 | */
|
25884 | UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) {
|
25885 | return this.encode(message, writer).ldelim();
|
25886 | };
|
25887 |
|
25888 | /**
|
25889 | * Decodes an UninterpretedOption message from the specified reader or buffer.
|
25890 | * @function decode
|
25891 | * @memberof google.protobuf.UninterpretedOption
|
25892 | * @static
|
25893 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
25894 | * @param {number} [length] Message length if known beforehand
|
25895 | * @returns {google.protobuf.UninterpretedOption} UninterpretedOption
|
25896 | * @throws {Error} If the payload is not a reader or valid buffer
|
25897 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
25898 | */
|
25899 | UninterpretedOption.decode = function decode(reader, length) {
|
25900 | if (!(reader instanceof $Reader))
|
25901 | reader = $Reader.create(reader);
|
25902 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption();
|
25903 | while (reader.pos < end) {
|
25904 | var tag = reader.uint32();
|
25905 | switch (tag >>> 3) {
|
25906 | case 2:
|
25907 | if (!(message.name && message.name.length))
|
25908 | message.name = [];
|
25909 | message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32()));
|
25910 | break;
|
25911 | case 3:
|
25912 | message.identifierValue = reader.string();
|
25913 | break;
|
25914 | case 4:
|
25915 | message.positiveIntValue = reader.uint64();
|
25916 | break;
|
25917 | case 5:
|
25918 | message.negativeIntValue = reader.int64();
|
25919 | break;
|
25920 | case 6:
|
25921 | message.doubleValue = reader.double();
|
25922 | break;
|
25923 | case 7:
|
25924 | message.stringValue = reader.bytes();
|
25925 | break;
|
25926 | case 8:
|
25927 | message.aggregateValue = reader.string();
|
25928 | break;
|
25929 | default:
|
25930 | reader.skipType(tag & 7);
|
25931 | break;
|
25932 | }
|
25933 | }
|
25934 | return message;
|
25935 | };
|
25936 |
|
25937 | /**
|
25938 | * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited.
|
25939 | * @function decodeDelimited
|
25940 | * @memberof google.protobuf.UninterpretedOption
|
25941 | * @static
|
25942 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
25943 | * @returns {google.protobuf.UninterpretedOption} UninterpretedOption
|
25944 | * @throws {Error} If the payload is not a reader or valid buffer
|
25945 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
25946 | */
|
25947 | UninterpretedOption.decodeDelimited = function decodeDelimited(reader) {
|
25948 | if (!(reader instanceof $Reader))
|
25949 | reader = new $Reader(reader);
|
25950 | return this.decode(reader, reader.uint32());
|
25951 | };
|
25952 |
|
25953 | /**
|
25954 | * Verifies an UninterpretedOption message.
|
25955 | * @function verify
|
25956 | * @memberof google.protobuf.UninterpretedOption
|
25957 | * @static
|
25958 | * @param {Object.<string,*>} message Plain object to verify
|
25959 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
25960 | */
|
25961 | UninterpretedOption.verify = function verify(message) {
|
25962 | if (typeof message !== "object" || message === null)
|
25963 | return "object expected";
|
25964 | if (message.name != null && message.hasOwnProperty("name")) {
|
25965 | if (!Array.isArray(message.name))
|
25966 | return "name: array expected";
|
25967 | for (var i = 0; i < message.name.length; ++i) {
|
25968 | var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]);
|
25969 | if (error)
|
25970 | return "name." + error;
|
25971 | }
|
25972 | }
|
25973 | if (message.identifierValue != null && message.hasOwnProperty("identifierValue"))
|
25974 | if (!$util.isString(message.identifierValue))
|
25975 | return "identifierValue: string expected";
|
25976 | if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue"))
|
25977 | if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high)))
|
25978 | return "positiveIntValue: integer|Long expected";
|
25979 | if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue"))
|
25980 | if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high)))
|
25981 | return "negativeIntValue: integer|Long expected";
|
25982 | if (message.doubleValue != null && message.hasOwnProperty("doubleValue"))
|
25983 | if (typeof message.doubleValue !== "number")
|
25984 | return "doubleValue: number expected";
|
25985 | if (message.stringValue != null && message.hasOwnProperty("stringValue"))
|
25986 | if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue)))
|
25987 | return "stringValue: buffer expected";
|
25988 | if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue"))
|
25989 | if (!$util.isString(message.aggregateValue))
|
25990 | return "aggregateValue: string expected";
|
25991 | return null;
|
25992 | };
|
25993 |
|
25994 | /**
|
25995 | * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types.
|
25996 | * @function fromObject
|
25997 | * @memberof google.protobuf.UninterpretedOption
|
25998 | * @static
|
25999 | * @param {Object.<string,*>} object Plain object
|
26000 | * @returns {google.protobuf.UninterpretedOption} UninterpretedOption
|
26001 | */
|
26002 | UninterpretedOption.fromObject = function fromObject(object) {
|
26003 | if (object instanceof $root.google.protobuf.UninterpretedOption)
|
26004 | return object;
|
26005 | var message = new $root.google.protobuf.UninterpretedOption();
|
26006 | if (object.name) {
|
26007 | if (!Array.isArray(object.name))
|
26008 | throw TypeError(".google.protobuf.UninterpretedOption.name: array expected");
|
26009 | message.name = [];
|
26010 | for (var i = 0; i < object.name.length; ++i) {
|
26011 | if (typeof object.name[i] !== "object")
|
26012 | throw TypeError(".google.protobuf.UninterpretedOption.name: object expected");
|
26013 | message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]);
|
26014 | }
|
26015 | }
|
26016 | if (object.identifierValue != null)
|
26017 | message.identifierValue = String(object.identifierValue);
|
26018 | if (object.positiveIntValue != null)
|
26019 | if ($util.Long)
|
26020 | (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true;
|
26021 | else if (typeof object.positiveIntValue === "string")
|
26022 | message.positiveIntValue = parseInt(object.positiveIntValue, 10);
|
26023 | else if (typeof object.positiveIntValue === "number")
|
26024 | message.positiveIntValue = object.positiveIntValue;
|
26025 | else if (typeof object.positiveIntValue === "object")
|
26026 | message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true);
|
26027 | if (object.negativeIntValue != null)
|
26028 | if ($util.Long)
|
26029 | (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false;
|
26030 | else if (typeof object.negativeIntValue === "string")
|
26031 | message.negativeIntValue = parseInt(object.negativeIntValue, 10);
|
26032 | else if (typeof object.negativeIntValue === "number")
|
26033 | message.negativeIntValue = object.negativeIntValue;
|
26034 | else if (typeof object.negativeIntValue === "object")
|
26035 | message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber();
|
26036 | if (object.doubleValue != null)
|
26037 | message.doubleValue = Number(object.doubleValue);
|
26038 | if (object.stringValue != null)
|
26039 | if (typeof object.stringValue === "string")
|
26040 | $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0);
|
26041 | else if (object.stringValue.length)
|
26042 | message.stringValue = object.stringValue;
|
26043 | if (object.aggregateValue != null)
|
26044 | message.aggregateValue = String(object.aggregateValue);
|
26045 | return message;
|
26046 | };
|
26047 |
|
26048 | /**
|
26049 | * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified.
|
26050 | * @function toObject
|
26051 | * @memberof google.protobuf.UninterpretedOption
|
26052 | * @static
|
26053 | * @param {google.protobuf.UninterpretedOption} message UninterpretedOption
|
26054 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
26055 | * @returns {Object.<string,*>} Plain object
|
26056 | */
|
26057 | UninterpretedOption.toObject = function toObject(message, options) {
|
26058 | if (!options)
|
26059 | options = {};
|
26060 | var object = {};
|
26061 | if (options.arrays || options.defaults)
|
26062 | object.name = [];
|
26063 | if (options.defaults) {
|
26064 | object.identifierValue = "";
|
26065 | if ($util.Long) {
|
26066 | var long = new $util.Long(0, 0, true);
|
26067 | object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
26068 | } else
|
26069 | object.positiveIntValue = options.longs === String ? "0" : 0;
|
26070 | if ($util.Long) {
|
26071 | var long = new $util.Long(0, 0, false);
|
26072 | object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
26073 | } else
|
26074 | object.negativeIntValue = options.longs === String ? "0" : 0;
|
26075 | object.doubleValue = 0;
|
26076 | if (options.bytes === String)
|
26077 | object.stringValue = "";
|
26078 | else {
|
26079 | object.stringValue = [];
|
26080 | if (options.bytes !== Array)
|
26081 | object.stringValue = $util.newBuffer(object.stringValue);
|
26082 | }
|
26083 | object.aggregateValue = "";
|
26084 | }
|
26085 | if (message.name && message.name.length) {
|
26086 | object.name = [];
|
26087 | for (var j = 0; j < message.name.length; ++j)
|
26088 | object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options);
|
26089 | }
|
26090 | if (message.identifierValue != null && message.hasOwnProperty("identifierValue"))
|
26091 | object.identifierValue = message.identifierValue;
|
26092 | if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue"))
|
26093 | if (typeof message.positiveIntValue === "number")
|
26094 | object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue;
|
26095 | else
|
26096 | 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;
|
26097 | if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue"))
|
26098 | if (typeof message.negativeIntValue === "number")
|
26099 | object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue;
|
26100 | else
|
26101 | 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;
|
26102 | if (message.doubleValue != null && message.hasOwnProperty("doubleValue"))
|
26103 | object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue;
|
26104 | if (message.stringValue != null && message.hasOwnProperty("stringValue"))
|
26105 | 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;
|
26106 | if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue"))
|
26107 | object.aggregateValue = message.aggregateValue;
|
26108 | return object;
|
26109 | };
|
26110 |
|
26111 | /**
|
26112 | * Converts this UninterpretedOption to JSON.
|
26113 | * @function toJSON
|
26114 | * @memberof google.protobuf.UninterpretedOption
|
26115 | * @instance
|
26116 | * @returns {Object.<string,*>} JSON object
|
26117 | */
|
26118 | UninterpretedOption.prototype.toJSON = function toJSON() {
|
26119 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
26120 | };
|
26121 |
|
26122 | UninterpretedOption.NamePart = (function() {
|
26123 |
|
26124 | /**
|
26125 | * Properties of a NamePart.
|
26126 | * @memberof google.protobuf.UninterpretedOption
|
26127 | * @interface INamePart
|
26128 | * @property {string} namePart NamePart namePart
|
26129 | * @property {boolean} isExtension NamePart isExtension
|
26130 | */
|
26131 |
|
26132 | /**
|
26133 | * Constructs a new NamePart.
|
26134 | * @memberof google.protobuf.UninterpretedOption
|
26135 | * @classdesc Represents a NamePart.
|
26136 | * @implements INamePart
|
26137 | * @constructor
|
26138 | * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set
|
26139 | */
|
26140 | function NamePart(properties) {
|
26141 | if (properties)
|
26142 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
26143 | if (properties[keys[i]] != null)
|
26144 | this[keys[i]] = properties[keys[i]];
|
26145 | }
|
26146 |
|
26147 | /**
|
26148 | * NamePart namePart.
|
26149 | * @member {string} namePart
|
26150 | * @memberof google.protobuf.UninterpretedOption.NamePart
|
26151 | * @instance
|
26152 | */
|
26153 | NamePart.prototype.namePart = "";
|
26154 |
|
26155 | /**
|
26156 | * NamePart isExtension.
|
26157 | * @member {boolean} isExtension
|
26158 | * @memberof google.protobuf.UninterpretedOption.NamePart
|
26159 | * @instance
|
26160 | */
|
26161 | NamePart.prototype.isExtension = false;
|
26162 |
|
26163 | /**
|
26164 | * Creates a new NamePart instance using the specified properties.
|
26165 | * @function create
|
26166 | * @memberof google.protobuf.UninterpretedOption.NamePart
|
26167 | * @static
|
26168 | * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set
|
26169 | * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance
|
26170 | */
|
26171 | NamePart.create = function create(properties) {
|
26172 | return new NamePart(properties);
|
26173 | };
|
26174 |
|
26175 | /**
|
26176 | * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages.
|
26177 | * @function encode
|
26178 | * @memberof google.protobuf.UninterpretedOption.NamePart
|
26179 | * @static
|
26180 | * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode
|
26181 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
26182 | * @returns {$protobuf.Writer} Writer
|
26183 | */
|
26184 | NamePart.encode = function encode(message, writer) {
|
26185 | if (!writer)
|
26186 | writer = $Writer.create();
|
26187 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart);
|
26188 | writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension);
|
26189 | return writer;
|
26190 | };
|
26191 |
|
26192 | /**
|
26193 | * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages.
|
26194 | * @function encodeDelimited
|
26195 | * @memberof google.protobuf.UninterpretedOption.NamePart
|
26196 | * @static
|
26197 | * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode
|
26198 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
26199 | * @returns {$protobuf.Writer} Writer
|
26200 | */
|
26201 | NamePart.encodeDelimited = function encodeDelimited(message, writer) {
|
26202 | return this.encode(message, writer).ldelim();
|
26203 | };
|
26204 |
|
26205 | /**
|
26206 | * Decodes a NamePart message from the specified reader or buffer.
|
26207 | * @function decode
|
26208 | * @memberof google.protobuf.UninterpretedOption.NamePart
|
26209 | * @static
|
26210 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
26211 | * @param {number} [length] Message length if known beforehand
|
26212 | * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart
|
26213 | * @throws {Error} If the payload is not a reader or valid buffer
|
26214 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
26215 | */
|
26216 | NamePart.decode = function decode(reader, length) {
|
26217 | if (!(reader instanceof $Reader))
|
26218 | reader = $Reader.create(reader);
|
26219 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart();
|
26220 | while (reader.pos < end) {
|
26221 | var tag = reader.uint32();
|
26222 | switch (tag >>> 3) {
|
26223 | case 1:
|
26224 | message.namePart = reader.string();
|
26225 | break;
|
26226 | case 2:
|
26227 | message.isExtension = reader.bool();
|
26228 | break;
|
26229 | default:
|
26230 | reader.skipType(tag & 7);
|
26231 | break;
|
26232 | }
|
26233 | }
|
26234 | if (!message.hasOwnProperty("namePart"))
|
26235 | throw $util.ProtocolError("missing required 'namePart'", { instance: message });
|
26236 | if (!message.hasOwnProperty("isExtension"))
|
26237 | throw $util.ProtocolError("missing required 'isExtension'", { instance: message });
|
26238 | return message;
|
26239 | };
|
26240 |
|
26241 | /**
|
26242 | * Decodes a NamePart message from the specified reader or buffer, length delimited.
|
26243 | * @function decodeDelimited
|
26244 | * @memberof google.protobuf.UninterpretedOption.NamePart
|
26245 | * @static
|
26246 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
26247 | * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart
|
26248 | * @throws {Error} If the payload is not a reader or valid buffer
|
26249 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
26250 | */
|
26251 | NamePart.decodeDelimited = function decodeDelimited(reader) {
|
26252 | if (!(reader instanceof $Reader))
|
26253 | reader = new $Reader(reader);
|
26254 | return this.decode(reader, reader.uint32());
|
26255 | };
|
26256 |
|
26257 | /**
|
26258 | * Verifies a NamePart message.
|
26259 | * @function verify
|
26260 | * @memberof google.protobuf.UninterpretedOption.NamePart
|
26261 | * @static
|
26262 | * @param {Object.<string,*>} message Plain object to verify
|
26263 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
26264 | */
|
26265 | NamePart.verify = function verify(message) {
|
26266 | if (typeof message !== "object" || message === null)
|
26267 | return "object expected";
|
26268 | if (!$util.isString(message.namePart))
|
26269 | return "namePart: string expected";
|
26270 | if (typeof message.isExtension !== "boolean")
|
26271 | return "isExtension: boolean expected";
|
26272 | return null;
|
26273 | };
|
26274 |
|
26275 | /**
|
26276 | * Creates a NamePart message from a plain object. Also converts values to their respective internal types.
|
26277 | * @function fromObject
|
26278 | * @memberof google.protobuf.UninterpretedOption.NamePart
|
26279 | * @static
|
26280 | * @param {Object.<string,*>} object Plain object
|
26281 | * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart
|
26282 | */
|
26283 | NamePart.fromObject = function fromObject(object) {
|
26284 | if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart)
|
26285 | return object;
|
26286 | var message = new $root.google.protobuf.UninterpretedOption.NamePart();
|
26287 | if (object.namePart != null)
|
26288 | message.namePart = String(object.namePart);
|
26289 | if (object.isExtension != null)
|
26290 | message.isExtension = Boolean(object.isExtension);
|
26291 | return message;
|
26292 | };
|
26293 |
|
26294 | /**
|
26295 | * Creates a plain object from a NamePart message. Also converts values to other types if specified.
|
26296 | * @function toObject
|
26297 | * @memberof google.protobuf.UninterpretedOption.NamePart
|
26298 | * @static
|
26299 | * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart
|
26300 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
26301 | * @returns {Object.<string,*>} Plain object
|
26302 | */
|
26303 | NamePart.toObject = function toObject(message, options) {
|
26304 | if (!options)
|
26305 | options = {};
|
26306 | var object = {};
|
26307 | if (options.defaults) {
|
26308 | object.namePart = "";
|
26309 | object.isExtension = false;
|
26310 | }
|
26311 | if (message.namePart != null && message.hasOwnProperty("namePart"))
|
26312 | object.namePart = message.namePart;
|
26313 | if (message.isExtension != null && message.hasOwnProperty("isExtension"))
|
26314 | object.isExtension = message.isExtension;
|
26315 | return object;
|
26316 | };
|
26317 |
|
26318 | /**
|
26319 | * Converts this NamePart to JSON.
|
26320 | * @function toJSON
|
26321 | * @memberof google.protobuf.UninterpretedOption.NamePart
|
26322 | * @instance
|
26323 | * @returns {Object.<string,*>} JSON object
|
26324 | */
|
26325 | NamePart.prototype.toJSON = function toJSON() {
|
26326 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
26327 | };
|
26328 |
|
26329 | return NamePart;
|
26330 | })();
|
26331 |
|
26332 | return UninterpretedOption;
|
26333 | })();
|
26334 |
|
26335 | protobuf.SourceCodeInfo = (function() {
|
26336 |
|
26337 | /**
|
26338 | * Properties of a SourceCodeInfo.
|
26339 | * @memberof google.protobuf
|
26340 | * @interface ISourceCodeInfo
|
26341 | * @property {Array.<google.protobuf.SourceCodeInfo.ILocation>|null} [location] SourceCodeInfo location
|
26342 | */
|
26343 |
|
26344 | /**
|
26345 | * Constructs a new SourceCodeInfo.
|
26346 | * @memberof google.protobuf
|
26347 | * @classdesc Represents a SourceCodeInfo.
|
26348 | * @implements ISourceCodeInfo
|
26349 | * @constructor
|
26350 | * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set
|
26351 | */
|
26352 | function SourceCodeInfo(properties) {
|
26353 | this.location = [];
|
26354 | if (properties)
|
26355 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
26356 | if (properties[keys[i]] != null)
|
26357 | this[keys[i]] = properties[keys[i]];
|
26358 | }
|
26359 |
|
26360 | /**
|
26361 | * SourceCodeInfo location.
|
26362 | * @member {Array.<google.protobuf.SourceCodeInfo.ILocation>} location
|
26363 | * @memberof google.protobuf.SourceCodeInfo
|
26364 | * @instance
|
26365 | */
|
26366 | SourceCodeInfo.prototype.location = $util.emptyArray;
|
26367 |
|
26368 | /**
|
26369 | * Creates a new SourceCodeInfo instance using the specified properties.
|
26370 | * @function create
|
26371 | * @memberof google.protobuf.SourceCodeInfo
|
26372 | * @static
|
26373 | * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set
|
26374 | * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance
|
26375 | */
|
26376 | SourceCodeInfo.create = function create(properties) {
|
26377 | return new SourceCodeInfo(properties);
|
26378 | };
|
26379 |
|
26380 | /**
|
26381 | * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages.
|
26382 | * @function encode
|
26383 | * @memberof google.protobuf.SourceCodeInfo
|
26384 | * @static
|
26385 | * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode
|
26386 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
26387 | * @returns {$protobuf.Writer} Writer
|
26388 | */
|
26389 | SourceCodeInfo.encode = function encode(message, writer) {
|
26390 | if (!writer)
|
26391 | writer = $Writer.create();
|
26392 | if (message.location != null && message.location.length)
|
26393 | for (var i = 0; i < message.location.length; ++i)
|
26394 | $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
26395 | return writer;
|
26396 | };
|
26397 |
|
26398 | /**
|
26399 | * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages.
|
26400 | * @function encodeDelimited
|
26401 | * @memberof google.protobuf.SourceCodeInfo
|
26402 | * @static
|
26403 | * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode
|
26404 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
26405 | * @returns {$protobuf.Writer} Writer
|
26406 | */
|
26407 | SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) {
|
26408 | return this.encode(message, writer).ldelim();
|
26409 | };
|
26410 |
|
26411 | /**
|
26412 | * Decodes a SourceCodeInfo message from the specified reader or buffer.
|
26413 | * @function decode
|
26414 | * @memberof google.protobuf.SourceCodeInfo
|
26415 | * @static
|
26416 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
26417 | * @param {number} [length] Message length if known beforehand
|
26418 | * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo
|
26419 | * @throws {Error} If the payload is not a reader or valid buffer
|
26420 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
26421 | */
|
26422 | SourceCodeInfo.decode = function decode(reader, length) {
|
26423 | if (!(reader instanceof $Reader))
|
26424 | reader = $Reader.create(reader);
|
26425 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo();
|
26426 | while (reader.pos < end) {
|
26427 | var tag = reader.uint32();
|
26428 | switch (tag >>> 3) {
|
26429 | case 1:
|
26430 | if (!(message.location && message.location.length))
|
26431 | message.location = [];
|
26432 | message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32()));
|
26433 | break;
|
26434 | default:
|
26435 | reader.skipType(tag & 7);
|
26436 | break;
|
26437 | }
|
26438 | }
|
26439 | return message;
|
26440 | };
|
26441 |
|
26442 | /**
|
26443 | * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited.
|
26444 | * @function decodeDelimited
|
26445 | * @memberof google.protobuf.SourceCodeInfo
|
26446 | * @static
|
26447 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
26448 | * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo
|
26449 | * @throws {Error} If the payload is not a reader or valid buffer
|
26450 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
26451 | */
|
26452 | SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) {
|
26453 | if (!(reader instanceof $Reader))
|
26454 | reader = new $Reader(reader);
|
26455 | return this.decode(reader, reader.uint32());
|
26456 | };
|
26457 |
|
26458 | /**
|
26459 | * Verifies a SourceCodeInfo message.
|
26460 | * @function verify
|
26461 | * @memberof google.protobuf.SourceCodeInfo
|
26462 | * @static
|
26463 | * @param {Object.<string,*>} message Plain object to verify
|
26464 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
26465 | */
|
26466 | SourceCodeInfo.verify = function verify(message) {
|
26467 | if (typeof message !== "object" || message === null)
|
26468 | return "object expected";
|
26469 | if (message.location != null && message.hasOwnProperty("location")) {
|
26470 | if (!Array.isArray(message.location))
|
26471 | return "location: array expected";
|
26472 | for (var i = 0; i < message.location.length; ++i) {
|
26473 | var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]);
|
26474 | if (error)
|
26475 | return "location." + error;
|
26476 | }
|
26477 | }
|
26478 | return null;
|
26479 | };
|
26480 |
|
26481 | /**
|
26482 | * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types.
|
26483 | * @function fromObject
|
26484 | * @memberof google.protobuf.SourceCodeInfo
|
26485 | * @static
|
26486 | * @param {Object.<string,*>} object Plain object
|
26487 | * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo
|
26488 | */
|
26489 | SourceCodeInfo.fromObject = function fromObject(object) {
|
26490 | if (object instanceof $root.google.protobuf.SourceCodeInfo)
|
26491 | return object;
|
26492 | var message = new $root.google.protobuf.SourceCodeInfo();
|
26493 | if (object.location) {
|
26494 | if (!Array.isArray(object.location))
|
26495 | throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected");
|
26496 | message.location = [];
|
26497 | for (var i = 0; i < object.location.length; ++i) {
|
26498 | if (typeof object.location[i] !== "object")
|
26499 | throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected");
|
26500 | message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]);
|
26501 | }
|
26502 | }
|
26503 | return message;
|
26504 | };
|
26505 |
|
26506 | /**
|
26507 | * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified.
|
26508 | * @function toObject
|
26509 | * @memberof google.protobuf.SourceCodeInfo
|
26510 | * @static
|
26511 | * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo
|
26512 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
26513 | * @returns {Object.<string,*>} Plain object
|
26514 | */
|
26515 | SourceCodeInfo.toObject = function toObject(message, options) {
|
26516 | if (!options)
|
26517 | options = {};
|
26518 | var object = {};
|
26519 | if (options.arrays || options.defaults)
|
26520 | object.location = [];
|
26521 | if (message.location && message.location.length) {
|
26522 | object.location = [];
|
26523 | for (var j = 0; j < message.location.length; ++j)
|
26524 | object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options);
|
26525 | }
|
26526 | return object;
|
26527 | };
|
26528 |
|
26529 | /**
|
26530 | * Converts this SourceCodeInfo to JSON.
|
26531 | * @function toJSON
|
26532 | * @memberof google.protobuf.SourceCodeInfo
|
26533 | * @instance
|
26534 | * @returns {Object.<string,*>} JSON object
|
26535 | */
|
26536 | SourceCodeInfo.prototype.toJSON = function toJSON() {
|
26537 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
26538 | };
|
26539 |
|
26540 | SourceCodeInfo.Location = (function() {
|
26541 |
|
26542 | /**
|
26543 | * Properties of a Location.
|
26544 | * @memberof google.protobuf.SourceCodeInfo
|
26545 | * @interface ILocation
|
26546 | * @property {Array.<number>|null} [path] Location path
|
26547 | * @property {Array.<number>|null} [span] Location span
|
26548 | * @property {string|null} [leadingComments] Location leadingComments
|
26549 | * @property {string|null} [trailingComments] Location trailingComments
|
26550 | * @property {Array.<string>|null} [leadingDetachedComments] Location leadingDetachedComments
|
26551 | */
|
26552 |
|
26553 | /**
|
26554 | * Constructs a new Location.
|
26555 | * @memberof google.protobuf.SourceCodeInfo
|
26556 | * @classdesc Represents a Location.
|
26557 | * @implements ILocation
|
26558 | * @constructor
|
26559 | * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set
|
26560 | */
|
26561 | function Location(properties) {
|
26562 | this.path = [];
|
26563 | this.span = [];
|
26564 | this.leadingDetachedComments = [];
|
26565 | if (properties)
|
26566 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
26567 | if (properties[keys[i]] != null)
|
26568 | this[keys[i]] = properties[keys[i]];
|
26569 | }
|
26570 |
|
26571 | /**
|
26572 | * Location path.
|
26573 | * @member {Array.<number>} path
|
26574 | * @memberof google.protobuf.SourceCodeInfo.Location
|
26575 | * @instance
|
26576 | */
|
26577 | Location.prototype.path = $util.emptyArray;
|
26578 |
|
26579 | /**
|
26580 | * Location span.
|
26581 | * @member {Array.<number>} span
|
26582 | * @memberof google.protobuf.SourceCodeInfo.Location
|
26583 | * @instance
|
26584 | */
|
26585 | Location.prototype.span = $util.emptyArray;
|
26586 |
|
26587 | /**
|
26588 | * Location leadingComments.
|
26589 | * @member {string} leadingComments
|
26590 | * @memberof google.protobuf.SourceCodeInfo.Location
|
26591 | * @instance
|
26592 | */
|
26593 | Location.prototype.leadingComments = "";
|
26594 |
|
26595 | /**
|
26596 | * Location trailingComments.
|
26597 | * @member {string} trailingComments
|
26598 | * @memberof google.protobuf.SourceCodeInfo.Location
|
26599 | * @instance
|
26600 | */
|
26601 | Location.prototype.trailingComments = "";
|
26602 |
|
26603 | /**
|
26604 | * Location leadingDetachedComments.
|
26605 | * @member {Array.<string>} leadingDetachedComments
|
26606 | * @memberof google.protobuf.SourceCodeInfo.Location
|
26607 | * @instance
|
26608 | */
|
26609 | Location.prototype.leadingDetachedComments = $util.emptyArray;
|
26610 |
|
26611 | /**
|
26612 | * Creates a new Location instance using the specified properties.
|
26613 | * @function create
|
26614 | * @memberof google.protobuf.SourceCodeInfo.Location
|
26615 | * @static
|
26616 | * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set
|
26617 | * @returns {google.protobuf.SourceCodeInfo.Location} Location instance
|
26618 | */
|
26619 | Location.create = function create(properties) {
|
26620 | return new Location(properties);
|
26621 | };
|
26622 |
|
26623 | /**
|
26624 | * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages.
|
26625 | * @function encode
|
26626 | * @memberof google.protobuf.SourceCodeInfo.Location
|
26627 | * @static
|
26628 | * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode
|
26629 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
26630 | * @returns {$protobuf.Writer} Writer
|
26631 | */
|
26632 | Location.encode = function encode(message, writer) {
|
26633 | if (!writer)
|
26634 | writer = $Writer.create();
|
26635 | if (message.path != null && message.path.length) {
|
26636 | writer.uint32(/* id 1, wireType 2 =*/10).fork();
|
26637 | for (var i = 0; i < message.path.length; ++i)
|
26638 | writer.int32(message.path[i]);
|
26639 | writer.ldelim();
|
26640 | }
|
26641 | if (message.span != null && message.span.length) {
|
26642 | writer.uint32(/* id 2, wireType 2 =*/18).fork();
|
26643 | for (var i = 0; i < message.span.length; ++i)
|
26644 | writer.int32(message.span[i]);
|
26645 | writer.ldelim();
|
26646 | }
|
26647 | if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments"))
|
26648 | writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments);
|
26649 | if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments"))
|
26650 | writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments);
|
26651 | if (message.leadingDetachedComments != null && message.leadingDetachedComments.length)
|
26652 | for (var i = 0; i < message.leadingDetachedComments.length; ++i)
|
26653 | writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]);
|
26654 | return writer;
|
26655 | };
|
26656 |
|
26657 | /**
|
26658 | * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages.
|
26659 | * @function encodeDelimited
|
26660 | * @memberof google.protobuf.SourceCodeInfo.Location
|
26661 | * @static
|
26662 | * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode
|
26663 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
26664 | * @returns {$protobuf.Writer} Writer
|
26665 | */
|
26666 | Location.encodeDelimited = function encodeDelimited(message, writer) {
|
26667 | return this.encode(message, writer).ldelim();
|
26668 | };
|
26669 |
|
26670 | /**
|
26671 | * Decodes a Location message from the specified reader or buffer.
|
26672 | * @function decode
|
26673 | * @memberof google.protobuf.SourceCodeInfo.Location
|
26674 | * @static
|
26675 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
26676 | * @param {number} [length] Message length if known beforehand
|
26677 | * @returns {google.protobuf.SourceCodeInfo.Location} Location
|
26678 | * @throws {Error} If the payload is not a reader or valid buffer
|
26679 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
26680 | */
|
26681 | Location.decode = function decode(reader, length) {
|
26682 | if (!(reader instanceof $Reader))
|
26683 | reader = $Reader.create(reader);
|
26684 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location();
|
26685 | while (reader.pos < end) {
|
26686 | var tag = reader.uint32();
|
26687 | switch (tag >>> 3) {
|
26688 | case 1:
|
26689 | if (!(message.path && message.path.length))
|
26690 | message.path = [];
|
26691 | if ((tag & 7) === 2) {
|
26692 | var end2 = reader.uint32() + reader.pos;
|
26693 | while (reader.pos < end2)
|
26694 | message.path.push(reader.int32());
|
26695 | } else
|
26696 | message.path.push(reader.int32());
|
26697 | break;
|
26698 | case 2:
|
26699 | if (!(message.span && message.span.length))
|
26700 | message.span = [];
|
26701 | if ((tag & 7) === 2) {
|
26702 | var end2 = reader.uint32() + reader.pos;
|
26703 | while (reader.pos < end2)
|
26704 | message.span.push(reader.int32());
|
26705 | } else
|
26706 | message.span.push(reader.int32());
|
26707 | break;
|
26708 | case 3:
|
26709 | message.leadingComments = reader.string();
|
26710 | break;
|
26711 | case 4:
|
26712 | message.trailingComments = reader.string();
|
26713 | break;
|
26714 | case 6:
|
26715 | if (!(message.leadingDetachedComments && message.leadingDetachedComments.length))
|
26716 | message.leadingDetachedComments = [];
|
26717 | message.leadingDetachedComments.push(reader.string());
|
26718 | break;
|
26719 | default:
|
26720 | reader.skipType(tag & 7);
|
26721 | break;
|
26722 | }
|
26723 | }
|
26724 | return message;
|
26725 | };
|
26726 |
|
26727 | /**
|
26728 | * Decodes a Location message from the specified reader or buffer, length delimited.
|
26729 | * @function decodeDelimited
|
26730 | * @memberof google.protobuf.SourceCodeInfo.Location
|
26731 | * @static
|
26732 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
26733 | * @returns {google.protobuf.SourceCodeInfo.Location} Location
|
26734 | * @throws {Error} If the payload is not a reader or valid buffer
|
26735 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
26736 | */
|
26737 | Location.decodeDelimited = function decodeDelimited(reader) {
|
26738 | if (!(reader instanceof $Reader))
|
26739 | reader = new $Reader(reader);
|
26740 | return this.decode(reader, reader.uint32());
|
26741 | };
|
26742 |
|
26743 | /**
|
26744 | * Verifies a Location message.
|
26745 | * @function verify
|
26746 | * @memberof google.protobuf.SourceCodeInfo.Location
|
26747 | * @static
|
26748 | * @param {Object.<string,*>} message Plain object to verify
|
26749 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
26750 | */
|
26751 | Location.verify = function verify(message) {
|
26752 | if (typeof message !== "object" || message === null)
|
26753 | return "object expected";
|
26754 | if (message.path != null && message.hasOwnProperty("path")) {
|
26755 | if (!Array.isArray(message.path))
|
26756 | return "path: array expected";
|
26757 | for (var i = 0; i < message.path.length; ++i)
|
26758 | if (!$util.isInteger(message.path[i]))
|
26759 | return "path: integer[] expected";
|
26760 | }
|
26761 | if (message.span != null && message.hasOwnProperty("span")) {
|
26762 | if (!Array.isArray(message.span))
|
26763 | return "span: array expected";
|
26764 | for (var i = 0; i < message.span.length; ++i)
|
26765 | if (!$util.isInteger(message.span[i]))
|
26766 | return "span: integer[] expected";
|
26767 | }
|
26768 | if (message.leadingComments != null && message.hasOwnProperty("leadingComments"))
|
26769 | if (!$util.isString(message.leadingComments))
|
26770 | return "leadingComments: string expected";
|
26771 | if (message.trailingComments != null && message.hasOwnProperty("trailingComments"))
|
26772 | if (!$util.isString(message.trailingComments))
|
26773 | return "trailingComments: string expected";
|
26774 | if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) {
|
26775 | if (!Array.isArray(message.leadingDetachedComments))
|
26776 | return "leadingDetachedComments: array expected";
|
26777 | for (var i = 0; i < message.leadingDetachedComments.length; ++i)
|
26778 | if (!$util.isString(message.leadingDetachedComments[i]))
|
26779 | return "leadingDetachedComments: string[] expected";
|
26780 | }
|
26781 | return null;
|
26782 | };
|
26783 |
|
26784 | /**
|
26785 | * Creates a Location message from a plain object. Also converts values to their respective internal types.
|
26786 | * @function fromObject
|
26787 | * @memberof google.protobuf.SourceCodeInfo.Location
|
26788 | * @static
|
26789 | * @param {Object.<string,*>} object Plain object
|
26790 | * @returns {google.protobuf.SourceCodeInfo.Location} Location
|
26791 | */
|
26792 | Location.fromObject = function fromObject(object) {
|
26793 | if (object instanceof $root.google.protobuf.SourceCodeInfo.Location)
|
26794 | return object;
|
26795 | var message = new $root.google.protobuf.SourceCodeInfo.Location();
|
26796 | if (object.path) {
|
26797 | if (!Array.isArray(object.path))
|
26798 | throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected");
|
26799 | message.path = [];
|
26800 | for (var i = 0; i < object.path.length; ++i)
|
26801 | message.path[i] = object.path[i] | 0;
|
26802 | }
|
26803 | if (object.span) {
|
26804 | if (!Array.isArray(object.span))
|
26805 | throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected");
|
26806 | message.span = [];
|
26807 | for (var i = 0; i < object.span.length; ++i)
|
26808 | message.span[i] = object.span[i] | 0;
|
26809 | }
|
26810 | if (object.leadingComments != null)
|
26811 | message.leadingComments = String(object.leadingComments);
|
26812 | if (object.trailingComments != null)
|
26813 | message.trailingComments = String(object.trailingComments);
|
26814 | if (object.leadingDetachedComments) {
|
26815 | if (!Array.isArray(object.leadingDetachedComments))
|
26816 | throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected");
|
26817 | message.leadingDetachedComments = [];
|
26818 | for (var i = 0; i < object.leadingDetachedComments.length; ++i)
|
26819 | message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]);
|
26820 | }
|
26821 | return message;
|
26822 | };
|
26823 |
|
26824 | /**
|
26825 | * Creates a plain object from a Location message. Also converts values to other types if specified.
|
26826 | * @function toObject
|
26827 | * @memberof google.protobuf.SourceCodeInfo.Location
|
26828 | * @static
|
26829 | * @param {google.protobuf.SourceCodeInfo.Location} message Location
|
26830 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
26831 | * @returns {Object.<string,*>} Plain object
|
26832 | */
|
26833 | Location.toObject = function toObject(message, options) {
|
26834 | if (!options)
|
26835 | options = {};
|
26836 | var object = {};
|
26837 | if (options.arrays || options.defaults) {
|
26838 | object.path = [];
|
26839 | object.span = [];
|
26840 | object.leadingDetachedComments = [];
|
26841 | }
|
26842 | if (options.defaults) {
|
26843 | object.leadingComments = "";
|
26844 | object.trailingComments = "";
|
26845 | }
|
26846 | if (message.path && message.path.length) {
|
26847 | object.path = [];
|
26848 | for (var j = 0; j < message.path.length; ++j)
|
26849 | object.path[j] = message.path[j];
|
26850 | }
|
26851 | if (message.span && message.span.length) {
|
26852 | object.span = [];
|
26853 | for (var j = 0; j < message.span.length; ++j)
|
26854 | object.span[j] = message.span[j];
|
26855 | }
|
26856 | if (message.leadingComments != null && message.hasOwnProperty("leadingComments"))
|
26857 | object.leadingComments = message.leadingComments;
|
26858 | if (message.trailingComments != null && message.hasOwnProperty("trailingComments"))
|
26859 | object.trailingComments = message.trailingComments;
|
26860 | if (message.leadingDetachedComments && message.leadingDetachedComments.length) {
|
26861 | object.leadingDetachedComments = [];
|
26862 | for (var j = 0; j < message.leadingDetachedComments.length; ++j)
|
26863 | object.leadingDetachedComments[j] = message.leadingDetachedComments[j];
|
26864 | }
|
26865 | return object;
|
26866 | };
|
26867 |
|
26868 | /**
|
26869 | * Converts this Location to JSON.
|
26870 | * @function toJSON
|
26871 | * @memberof google.protobuf.SourceCodeInfo.Location
|
26872 | * @instance
|
26873 | * @returns {Object.<string,*>} JSON object
|
26874 | */
|
26875 | Location.prototype.toJSON = function toJSON() {
|
26876 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
26877 | };
|
26878 |
|
26879 | return Location;
|
26880 | })();
|
26881 |
|
26882 | return SourceCodeInfo;
|
26883 | })();
|
26884 |
|
26885 | protobuf.GeneratedCodeInfo = (function() {
|
26886 |
|
26887 | /**
|
26888 | * Properties of a GeneratedCodeInfo.
|
26889 | * @memberof google.protobuf
|
26890 | * @interface IGeneratedCodeInfo
|
26891 | * @property {Array.<google.protobuf.GeneratedCodeInfo.IAnnotation>|null} [annotation] GeneratedCodeInfo annotation
|
26892 | */
|
26893 |
|
26894 | /**
|
26895 | * Constructs a new GeneratedCodeInfo.
|
26896 | * @memberof google.protobuf
|
26897 | * @classdesc Represents a GeneratedCodeInfo.
|
26898 | * @implements IGeneratedCodeInfo
|
26899 | * @constructor
|
26900 | * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set
|
26901 | */
|
26902 | function GeneratedCodeInfo(properties) {
|
26903 | this.annotation = [];
|
26904 | if (properties)
|
26905 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
26906 | if (properties[keys[i]] != null)
|
26907 | this[keys[i]] = properties[keys[i]];
|
26908 | }
|
26909 |
|
26910 | /**
|
26911 | * GeneratedCodeInfo annotation.
|
26912 | * @member {Array.<google.protobuf.GeneratedCodeInfo.IAnnotation>} annotation
|
26913 | * @memberof google.protobuf.GeneratedCodeInfo
|
26914 | * @instance
|
26915 | */
|
26916 | GeneratedCodeInfo.prototype.annotation = $util.emptyArray;
|
26917 |
|
26918 | /**
|
26919 | * Creates a new GeneratedCodeInfo instance using the specified properties.
|
26920 | * @function create
|
26921 | * @memberof google.protobuf.GeneratedCodeInfo
|
26922 | * @static
|
26923 | * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set
|
26924 | * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance
|
26925 | */
|
26926 | GeneratedCodeInfo.create = function create(properties) {
|
26927 | return new GeneratedCodeInfo(properties);
|
26928 | };
|
26929 |
|
26930 | /**
|
26931 | * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages.
|
26932 | * @function encode
|
26933 | * @memberof google.protobuf.GeneratedCodeInfo
|
26934 | * @static
|
26935 | * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode
|
26936 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
26937 | * @returns {$protobuf.Writer} Writer
|
26938 | */
|
26939 | GeneratedCodeInfo.encode = function encode(message, writer) {
|
26940 | if (!writer)
|
26941 | writer = $Writer.create();
|
26942 | if (message.annotation != null && message.annotation.length)
|
26943 | for (var i = 0; i < message.annotation.length; ++i)
|
26944 | $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
26945 | return writer;
|
26946 | };
|
26947 |
|
26948 | /**
|
26949 | * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages.
|
26950 | * @function encodeDelimited
|
26951 | * @memberof google.protobuf.GeneratedCodeInfo
|
26952 | * @static
|
26953 | * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode
|
26954 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
26955 | * @returns {$protobuf.Writer} Writer
|
26956 | */
|
26957 | GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) {
|
26958 | return this.encode(message, writer).ldelim();
|
26959 | };
|
26960 |
|
26961 | /**
|
26962 | * Decodes a GeneratedCodeInfo message from the specified reader or buffer.
|
26963 | * @function decode
|
26964 | * @memberof google.protobuf.GeneratedCodeInfo
|
26965 | * @static
|
26966 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
26967 | * @param {number} [length] Message length if known beforehand
|
26968 | * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo
|
26969 | * @throws {Error} If the payload is not a reader or valid buffer
|
26970 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
26971 | */
|
26972 | GeneratedCodeInfo.decode = function decode(reader, length) {
|
26973 | if (!(reader instanceof $Reader))
|
26974 | reader = $Reader.create(reader);
|
26975 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo();
|
26976 | while (reader.pos < end) {
|
26977 | var tag = reader.uint32();
|
26978 | switch (tag >>> 3) {
|
26979 | case 1:
|
26980 | if (!(message.annotation && message.annotation.length))
|
26981 | message.annotation = [];
|
26982 | message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32()));
|
26983 | break;
|
26984 | default:
|
26985 | reader.skipType(tag & 7);
|
26986 | break;
|
26987 | }
|
26988 | }
|
26989 | return message;
|
26990 | };
|
26991 |
|
26992 | /**
|
26993 | * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited.
|
26994 | * @function decodeDelimited
|
26995 | * @memberof google.protobuf.GeneratedCodeInfo
|
26996 | * @static
|
26997 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
26998 | * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo
|
26999 | * @throws {Error} If the payload is not a reader or valid buffer
|
27000 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
27001 | */
|
27002 | GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) {
|
27003 | if (!(reader instanceof $Reader))
|
27004 | reader = new $Reader(reader);
|
27005 | return this.decode(reader, reader.uint32());
|
27006 | };
|
27007 |
|
27008 | /**
|
27009 | * Verifies a GeneratedCodeInfo message.
|
27010 | * @function verify
|
27011 | * @memberof google.protobuf.GeneratedCodeInfo
|
27012 | * @static
|
27013 | * @param {Object.<string,*>} message Plain object to verify
|
27014 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
27015 | */
|
27016 | GeneratedCodeInfo.verify = function verify(message) {
|
27017 | if (typeof message !== "object" || message === null)
|
27018 | return "object expected";
|
27019 | if (message.annotation != null && message.hasOwnProperty("annotation")) {
|
27020 | if (!Array.isArray(message.annotation))
|
27021 | return "annotation: array expected";
|
27022 | for (var i = 0; i < message.annotation.length; ++i) {
|
27023 | var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]);
|
27024 | if (error)
|
27025 | return "annotation." + error;
|
27026 | }
|
27027 | }
|
27028 | return null;
|
27029 | };
|
27030 |
|
27031 | /**
|
27032 | * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types.
|
27033 | * @function fromObject
|
27034 | * @memberof google.protobuf.GeneratedCodeInfo
|
27035 | * @static
|
27036 | * @param {Object.<string,*>} object Plain object
|
27037 | * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo
|
27038 | */
|
27039 | GeneratedCodeInfo.fromObject = function fromObject(object) {
|
27040 | if (object instanceof $root.google.protobuf.GeneratedCodeInfo)
|
27041 | return object;
|
27042 | var message = new $root.google.protobuf.GeneratedCodeInfo();
|
27043 | if (object.annotation) {
|
27044 | if (!Array.isArray(object.annotation))
|
27045 | throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected");
|
27046 | message.annotation = [];
|
27047 | for (var i = 0; i < object.annotation.length; ++i) {
|
27048 | if (typeof object.annotation[i] !== "object")
|
27049 | throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected");
|
27050 | message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]);
|
27051 | }
|
27052 | }
|
27053 | return message;
|
27054 | };
|
27055 |
|
27056 | /**
|
27057 | * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified.
|
27058 | * @function toObject
|
27059 | * @memberof google.protobuf.GeneratedCodeInfo
|
27060 | * @static
|
27061 | * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo
|
27062 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
27063 | * @returns {Object.<string,*>} Plain object
|
27064 | */
|
27065 | GeneratedCodeInfo.toObject = function toObject(message, options) {
|
27066 | if (!options)
|
27067 | options = {};
|
27068 | var object = {};
|
27069 | if (options.arrays || options.defaults)
|
27070 | object.annotation = [];
|
27071 | if (message.annotation && message.annotation.length) {
|
27072 | object.annotation = [];
|
27073 | for (var j = 0; j < message.annotation.length; ++j)
|
27074 | object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options);
|
27075 | }
|
27076 | return object;
|
27077 | };
|
27078 |
|
27079 | /**
|
27080 | * Converts this GeneratedCodeInfo to JSON.
|
27081 | * @function toJSON
|
27082 | * @memberof google.protobuf.GeneratedCodeInfo
|
27083 | * @instance
|
27084 | * @returns {Object.<string,*>} JSON object
|
27085 | */
|
27086 | GeneratedCodeInfo.prototype.toJSON = function toJSON() {
|
27087 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
27088 | };
|
27089 |
|
27090 | GeneratedCodeInfo.Annotation = (function() {
|
27091 |
|
27092 | /**
|
27093 | * Properties of an Annotation.
|
27094 | * @memberof google.protobuf.GeneratedCodeInfo
|
27095 | * @interface IAnnotation
|
27096 | * @property {Array.<number>|null} [path] Annotation path
|
27097 | * @property {string|null} [sourceFile] Annotation sourceFile
|
27098 | * @property {number|null} [begin] Annotation begin
|
27099 | * @property {number|null} [end] Annotation end
|
27100 | */
|
27101 |
|
27102 | /**
|
27103 | * Constructs a new Annotation.
|
27104 | * @memberof google.protobuf.GeneratedCodeInfo
|
27105 | * @classdesc Represents an Annotation.
|
27106 | * @implements IAnnotation
|
27107 | * @constructor
|
27108 | * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set
|
27109 | */
|
27110 | function Annotation(properties) {
|
27111 | this.path = [];
|
27112 | if (properties)
|
27113 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
27114 | if (properties[keys[i]] != null)
|
27115 | this[keys[i]] = properties[keys[i]];
|
27116 | }
|
27117 |
|
27118 | /**
|
27119 | * Annotation path.
|
27120 | * @member {Array.<number>} path
|
27121 | * @memberof google.protobuf.GeneratedCodeInfo.Annotation
|
27122 | * @instance
|
27123 | */
|
27124 | Annotation.prototype.path = $util.emptyArray;
|
27125 |
|
27126 | /**
|
27127 | * Annotation sourceFile.
|
27128 | * @member {string} sourceFile
|
27129 | * @memberof google.protobuf.GeneratedCodeInfo.Annotation
|
27130 | * @instance
|
27131 | */
|
27132 | Annotation.prototype.sourceFile = "";
|
27133 |
|
27134 | /**
|
27135 | * Annotation begin.
|
27136 | * @member {number} begin
|
27137 | * @memberof google.protobuf.GeneratedCodeInfo.Annotation
|
27138 | * @instance
|
27139 | */
|
27140 | Annotation.prototype.begin = 0;
|
27141 |
|
27142 | /**
|
27143 | * Annotation end.
|
27144 | * @member {number} end
|
27145 | * @memberof google.protobuf.GeneratedCodeInfo.Annotation
|
27146 | * @instance
|
27147 | */
|
27148 | Annotation.prototype.end = 0;
|
27149 |
|
27150 | /**
|
27151 | * Creates a new Annotation instance using the specified properties.
|
27152 | * @function create
|
27153 | * @memberof google.protobuf.GeneratedCodeInfo.Annotation
|
27154 | * @static
|
27155 | * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set
|
27156 | * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance
|
27157 | */
|
27158 | Annotation.create = function create(properties) {
|
27159 | return new Annotation(properties);
|
27160 | };
|
27161 |
|
27162 | /**
|
27163 | * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages.
|
27164 | * @function encode
|
27165 | * @memberof google.protobuf.GeneratedCodeInfo.Annotation
|
27166 | * @static
|
27167 | * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode
|
27168 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
27169 | * @returns {$protobuf.Writer} Writer
|
27170 | */
|
27171 | Annotation.encode = function encode(message, writer) {
|
27172 | if (!writer)
|
27173 | writer = $Writer.create();
|
27174 | if (message.path != null && message.path.length) {
|
27175 | writer.uint32(/* id 1, wireType 2 =*/10).fork();
|
27176 | for (var i = 0; i < message.path.length; ++i)
|
27177 | writer.int32(message.path[i]);
|
27178 | writer.ldelim();
|
27179 | }
|
27180 | if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile"))
|
27181 | writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile);
|
27182 | if (message.begin != null && Object.hasOwnProperty.call(message, "begin"))
|
27183 | writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin);
|
27184 | if (message.end != null && Object.hasOwnProperty.call(message, "end"))
|
27185 | writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end);
|
27186 | return writer;
|
27187 | };
|
27188 |
|
27189 | /**
|
27190 | * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages.
|
27191 | * @function encodeDelimited
|
27192 | * @memberof google.protobuf.GeneratedCodeInfo.Annotation
|
27193 | * @static
|
27194 | * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode
|
27195 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
27196 | * @returns {$protobuf.Writer} Writer
|
27197 | */
|
27198 | Annotation.encodeDelimited = function encodeDelimited(message, writer) {
|
27199 | return this.encode(message, writer).ldelim();
|
27200 | };
|
27201 |
|
27202 | /**
|
27203 | * Decodes an Annotation message from the specified reader or buffer.
|
27204 | * @function decode
|
27205 | * @memberof google.protobuf.GeneratedCodeInfo.Annotation
|
27206 | * @static
|
27207 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
27208 | * @param {number} [length] Message length if known beforehand
|
27209 | * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation
|
27210 | * @throws {Error} If the payload is not a reader or valid buffer
|
27211 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
27212 | */
|
27213 | Annotation.decode = function decode(reader, length) {
|
27214 | if (!(reader instanceof $Reader))
|
27215 | reader = $Reader.create(reader);
|
27216 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation();
|
27217 | while (reader.pos < end) {
|
27218 | var tag = reader.uint32();
|
27219 | switch (tag >>> 3) {
|
27220 | case 1:
|
27221 | if (!(message.path && message.path.length))
|
27222 | message.path = [];
|
27223 | if ((tag & 7) === 2) {
|
27224 | var end2 = reader.uint32() + reader.pos;
|
27225 | while (reader.pos < end2)
|
27226 | message.path.push(reader.int32());
|
27227 | } else
|
27228 | message.path.push(reader.int32());
|
27229 | break;
|
27230 | case 2:
|
27231 | message.sourceFile = reader.string();
|
27232 | break;
|
27233 | case 3:
|
27234 | message.begin = reader.int32();
|
27235 | break;
|
27236 | case 4:
|
27237 | message.end = reader.int32();
|
27238 | break;
|
27239 | default:
|
27240 | reader.skipType(tag & 7);
|
27241 | break;
|
27242 | }
|
27243 | }
|
27244 | return message;
|
27245 | };
|
27246 |
|
27247 | /**
|
27248 | * Decodes an Annotation message from the specified reader or buffer, length delimited.
|
27249 | * @function decodeDelimited
|
27250 | * @memberof google.protobuf.GeneratedCodeInfo.Annotation
|
27251 | * @static
|
27252 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
27253 | * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation
|
27254 | * @throws {Error} If the payload is not a reader or valid buffer
|
27255 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
27256 | */
|
27257 | Annotation.decodeDelimited = function decodeDelimited(reader) {
|
27258 | if (!(reader instanceof $Reader))
|
27259 | reader = new $Reader(reader);
|
27260 | return this.decode(reader, reader.uint32());
|
27261 | };
|
27262 |
|
27263 | /**
|
27264 | * Verifies an Annotation message.
|
27265 | * @function verify
|
27266 | * @memberof google.protobuf.GeneratedCodeInfo.Annotation
|
27267 | * @static
|
27268 | * @param {Object.<string,*>} message Plain object to verify
|
27269 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
27270 | */
|
27271 | Annotation.verify = function verify(message) {
|
27272 | if (typeof message !== "object" || message === null)
|
27273 | return "object expected";
|
27274 | if (message.path != null && message.hasOwnProperty("path")) {
|
27275 | if (!Array.isArray(message.path))
|
27276 | return "path: array expected";
|
27277 | for (var i = 0; i < message.path.length; ++i)
|
27278 | if (!$util.isInteger(message.path[i]))
|
27279 | return "path: integer[] expected";
|
27280 | }
|
27281 | if (message.sourceFile != null && message.hasOwnProperty("sourceFile"))
|
27282 | if (!$util.isString(message.sourceFile))
|
27283 | return "sourceFile: string expected";
|
27284 | if (message.begin != null && message.hasOwnProperty("begin"))
|
27285 | if (!$util.isInteger(message.begin))
|
27286 | return "begin: integer expected";
|
27287 | if (message.end != null && message.hasOwnProperty("end"))
|
27288 | if (!$util.isInteger(message.end))
|
27289 | return "end: integer expected";
|
27290 | return null;
|
27291 | };
|
27292 |
|
27293 | /**
|
27294 | * Creates an Annotation message from a plain object. Also converts values to their respective internal types.
|
27295 | * @function fromObject
|
27296 | * @memberof google.protobuf.GeneratedCodeInfo.Annotation
|
27297 | * @static
|
27298 | * @param {Object.<string,*>} object Plain object
|
27299 | * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation
|
27300 | */
|
27301 | Annotation.fromObject = function fromObject(object) {
|
27302 | if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation)
|
27303 | return object;
|
27304 | var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation();
|
27305 | if (object.path) {
|
27306 | if (!Array.isArray(object.path))
|
27307 | throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected");
|
27308 | message.path = [];
|
27309 | for (var i = 0; i < object.path.length; ++i)
|
27310 | message.path[i] = object.path[i] | 0;
|
27311 | }
|
27312 | if (object.sourceFile != null)
|
27313 | message.sourceFile = String(object.sourceFile);
|
27314 | if (object.begin != null)
|
27315 | message.begin = object.begin | 0;
|
27316 | if (object.end != null)
|
27317 | message.end = object.end | 0;
|
27318 | return message;
|
27319 | };
|
27320 |
|
27321 | /**
|
27322 | * Creates a plain object from an Annotation message. Also converts values to other types if specified.
|
27323 | * @function toObject
|
27324 | * @memberof google.protobuf.GeneratedCodeInfo.Annotation
|
27325 | * @static
|
27326 | * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation
|
27327 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
27328 | * @returns {Object.<string,*>} Plain object
|
27329 | */
|
27330 | Annotation.toObject = function toObject(message, options) {
|
27331 | if (!options)
|
27332 | options = {};
|
27333 | var object = {};
|
27334 | if (options.arrays || options.defaults)
|
27335 | object.path = [];
|
27336 | if (options.defaults) {
|
27337 | object.sourceFile = "";
|
27338 | object.begin = 0;
|
27339 | object.end = 0;
|
27340 | }
|
27341 | if (message.path && message.path.length) {
|
27342 | object.path = [];
|
27343 | for (var j = 0; j < message.path.length; ++j)
|
27344 | object.path[j] = message.path[j];
|
27345 | }
|
27346 | if (message.sourceFile != null && message.hasOwnProperty("sourceFile"))
|
27347 | object.sourceFile = message.sourceFile;
|
27348 | if (message.begin != null && message.hasOwnProperty("begin"))
|
27349 | object.begin = message.begin;
|
27350 | if (message.end != null && message.hasOwnProperty("end"))
|
27351 | object.end = message.end;
|
27352 | return object;
|
27353 | };
|
27354 |
|
27355 | /**
|
27356 | * Converts this Annotation to JSON.
|
27357 | * @function toJSON
|
27358 | * @memberof google.protobuf.GeneratedCodeInfo.Annotation
|
27359 | * @instance
|
27360 | * @returns {Object.<string,*>} JSON object
|
27361 | */
|
27362 | Annotation.prototype.toJSON = function toJSON() {
|
27363 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
27364 | };
|
27365 |
|
27366 | return Annotation;
|
27367 | })();
|
27368 |
|
27369 | return GeneratedCodeInfo;
|
27370 | })();
|
27371 |
|
27372 | protobuf.Timestamp = (function() {
|
27373 |
|
27374 | /**
|
27375 | * Properties of a Timestamp.
|
27376 | * @memberof google.protobuf
|
27377 | * @interface ITimestamp
|
27378 | * @property {number|Long|null} [seconds] Timestamp seconds
|
27379 | * @property {number|null} [nanos] Timestamp nanos
|
27380 | */
|
27381 |
|
27382 | /**
|
27383 | * Constructs a new Timestamp.
|
27384 | * @memberof google.protobuf
|
27385 | * @classdesc Represents a Timestamp.
|
27386 | * @implements ITimestamp
|
27387 | * @constructor
|
27388 | * @param {google.protobuf.ITimestamp=} [properties] Properties to set
|
27389 | */
|
27390 | function Timestamp(properties) {
|
27391 | if (properties)
|
27392 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
27393 | if (properties[keys[i]] != null)
|
27394 | this[keys[i]] = properties[keys[i]];
|
27395 | }
|
27396 |
|
27397 | /**
|
27398 | * Timestamp seconds.
|
27399 | * @member {number|Long} seconds
|
27400 | * @memberof google.protobuf.Timestamp
|
27401 | * @instance
|
27402 | */
|
27403 | Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
27404 |
|
27405 | /**
|
27406 | * Timestamp nanos.
|
27407 | * @member {number} nanos
|
27408 | * @memberof google.protobuf.Timestamp
|
27409 | * @instance
|
27410 | */
|
27411 | Timestamp.prototype.nanos = 0;
|
27412 |
|
27413 | /**
|
27414 | * Creates a new Timestamp instance using the specified properties.
|
27415 | * @function create
|
27416 | * @memberof google.protobuf.Timestamp
|
27417 | * @static
|
27418 | * @param {google.protobuf.ITimestamp=} [properties] Properties to set
|
27419 | * @returns {google.protobuf.Timestamp} Timestamp instance
|
27420 | */
|
27421 | Timestamp.create = function create(properties) {
|
27422 | return new Timestamp(properties);
|
27423 | };
|
27424 |
|
27425 | /**
|
27426 | * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages.
|
27427 | * @function encode
|
27428 | * @memberof google.protobuf.Timestamp
|
27429 | * @static
|
27430 | * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode
|
27431 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
27432 | * @returns {$protobuf.Writer} Writer
|
27433 | */
|
27434 | Timestamp.encode = function encode(message, writer) {
|
27435 | if (!writer)
|
27436 | writer = $Writer.create();
|
27437 | if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds"))
|
27438 | writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds);
|
27439 | if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos"))
|
27440 | writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos);
|
27441 | return writer;
|
27442 | };
|
27443 |
|
27444 | /**
|
27445 | * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages.
|
27446 | * @function encodeDelimited
|
27447 | * @memberof google.protobuf.Timestamp
|
27448 | * @static
|
27449 | * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode
|
27450 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
27451 | * @returns {$protobuf.Writer} Writer
|
27452 | */
|
27453 | Timestamp.encodeDelimited = function encodeDelimited(message, writer) {
|
27454 | return this.encode(message, writer).ldelim();
|
27455 | };
|
27456 |
|
27457 | /**
|
27458 | * Decodes a Timestamp message from the specified reader or buffer.
|
27459 | * @function decode
|
27460 | * @memberof google.protobuf.Timestamp
|
27461 | * @static
|
27462 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
27463 | * @param {number} [length] Message length if known beforehand
|
27464 | * @returns {google.protobuf.Timestamp} Timestamp
|
27465 | * @throws {Error} If the payload is not a reader or valid buffer
|
27466 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
27467 | */
|
27468 | Timestamp.decode = function decode(reader, length) {
|
27469 | if (!(reader instanceof $Reader))
|
27470 | reader = $Reader.create(reader);
|
27471 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp();
|
27472 | while (reader.pos < end) {
|
27473 | var tag = reader.uint32();
|
27474 | switch (tag >>> 3) {
|
27475 | case 1:
|
27476 | message.seconds = reader.int64();
|
27477 | break;
|
27478 | case 2:
|
27479 | message.nanos = reader.int32();
|
27480 | break;
|
27481 | default:
|
27482 | reader.skipType(tag & 7);
|
27483 | break;
|
27484 | }
|
27485 | }
|
27486 | return message;
|
27487 | };
|
27488 |
|
27489 | /**
|
27490 | * Decodes a Timestamp message from the specified reader or buffer, length delimited.
|
27491 | * @function decodeDelimited
|
27492 | * @memberof google.protobuf.Timestamp
|
27493 | * @static
|
27494 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
27495 | * @returns {google.protobuf.Timestamp} Timestamp
|
27496 | * @throws {Error} If the payload is not a reader or valid buffer
|
27497 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
27498 | */
|
27499 | Timestamp.decodeDelimited = function decodeDelimited(reader) {
|
27500 | if (!(reader instanceof $Reader))
|
27501 | reader = new $Reader(reader);
|
27502 | return this.decode(reader, reader.uint32());
|
27503 | };
|
27504 |
|
27505 | /**
|
27506 | * Verifies a Timestamp message.
|
27507 | * @function verify
|
27508 | * @memberof google.protobuf.Timestamp
|
27509 | * @static
|
27510 | * @param {Object.<string,*>} message Plain object to verify
|
27511 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
27512 | */
|
27513 | Timestamp.verify = function verify(message) {
|
27514 | if (typeof message !== "object" || message === null)
|
27515 | return "object expected";
|
27516 | if (message.seconds != null && message.hasOwnProperty("seconds"))
|
27517 | if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high)))
|
27518 | return "seconds: integer|Long expected";
|
27519 | if (message.nanos != null && message.hasOwnProperty("nanos"))
|
27520 | if (!$util.isInteger(message.nanos))
|
27521 | return "nanos: integer expected";
|
27522 | return null;
|
27523 | };
|
27524 |
|
27525 | /**
|
27526 | * Creates a Timestamp message from a plain object. Also converts values to their respective internal types.
|
27527 | * @function fromObject
|
27528 | * @memberof google.protobuf.Timestamp
|
27529 | * @static
|
27530 | * @param {Object.<string,*>} object Plain object
|
27531 | * @returns {google.protobuf.Timestamp} Timestamp
|
27532 | */
|
27533 | Timestamp.fromObject = function fromObject(object) {
|
27534 | if (object instanceof $root.google.protobuf.Timestamp)
|
27535 | return object;
|
27536 | var message = new $root.google.protobuf.Timestamp();
|
27537 | if (object.seconds != null)
|
27538 | if ($util.Long)
|
27539 | (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false;
|
27540 | else if (typeof object.seconds === "string")
|
27541 | message.seconds = parseInt(object.seconds, 10);
|
27542 | else if (typeof object.seconds === "number")
|
27543 | message.seconds = object.seconds;
|
27544 | else if (typeof object.seconds === "object")
|
27545 | message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber();
|
27546 | if (object.nanos != null)
|
27547 | message.nanos = object.nanos | 0;
|
27548 | return message;
|
27549 | };
|
27550 |
|
27551 | /**
|
27552 | * Creates a plain object from a Timestamp message. Also converts values to other types if specified.
|
27553 | * @function toObject
|
27554 | * @memberof google.protobuf.Timestamp
|
27555 | * @static
|
27556 | * @param {google.protobuf.Timestamp} message Timestamp
|
27557 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
27558 | * @returns {Object.<string,*>} Plain object
|
27559 | */
|
27560 | Timestamp.toObject = function toObject(message, options) {
|
27561 | if (!options)
|
27562 | options = {};
|
27563 | var object = {};
|
27564 | if (options.defaults) {
|
27565 | if ($util.Long) {
|
27566 | var long = new $util.Long(0, 0, false);
|
27567 | object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
27568 | } else
|
27569 | object.seconds = options.longs === String ? "0" : 0;
|
27570 | object.nanos = 0;
|
27571 | }
|
27572 | if (message.seconds != null && message.hasOwnProperty("seconds"))
|
27573 | if (typeof message.seconds === "number")
|
27574 | object.seconds = options.longs === String ? String(message.seconds) : message.seconds;
|
27575 | else
|
27576 | 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;
|
27577 | if (message.nanos != null && message.hasOwnProperty("nanos"))
|
27578 | object.nanos = message.nanos;
|
27579 | return object;
|
27580 | };
|
27581 |
|
27582 | /**
|
27583 | * Converts this Timestamp to JSON.
|
27584 | * @function toJSON
|
27585 | * @memberof google.protobuf.Timestamp
|
27586 | * @instance
|
27587 | * @returns {Object.<string,*>} JSON object
|
27588 | */
|
27589 | Timestamp.prototype.toJSON = function toJSON() {
|
27590 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
27591 | };
|
27592 |
|
27593 | return Timestamp;
|
27594 | })();
|
27595 |
|
27596 | protobuf.Any = (function() {
|
27597 |
|
27598 | /**
|
27599 | * Properties of an Any.
|
27600 | * @memberof google.protobuf
|
27601 | * @interface IAny
|
27602 | * @property {string|null} [type_url] Any type_url
|
27603 | * @property {Uint8Array|null} [value] Any value
|
27604 | */
|
27605 |
|
27606 | /**
|
27607 | * Constructs a new Any.
|
27608 | * @memberof google.protobuf
|
27609 | * @classdesc Represents an Any.
|
27610 | * @implements IAny
|
27611 | * @constructor
|
27612 | * @param {google.protobuf.IAny=} [properties] Properties to set
|
27613 | */
|
27614 | function Any(properties) {
|
27615 | if (properties)
|
27616 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
27617 | if (properties[keys[i]] != null)
|
27618 | this[keys[i]] = properties[keys[i]];
|
27619 | }
|
27620 |
|
27621 | /**
|
27622 | * Any type_url.
|
27623 | * @member {string} type_url
|
27624 | * @memberof google.protobuf.Any
|
27625 | * @instance
|
27626 | */
|
27627 | Any.prototype.type_url = "";
|
27628 |
|
27629 | /**
|
27630 | * Any value.
|
27631 | * @member {Uint8Array} value
|
27632 | * @memberof google.protobuf.Any
|
27633 | * @instance
|
27634 | */
|
27635 | Any.prototype.value = $util.newBuffer([]);
|
27636 |
|
27637 | /**
|
27638 | * Creates a new Any instance using the specified properties.
|
27639 | * @function create
|
27640 | * @memberof google.protobuf.Any
|
27641 | * @static
|
27642 | * @param {google.protobuf.IAny=} [properties] Properties to set
|
27643 | * @returns {google.protobuf.Any} Any instance
|
27644 | */
|
27645 | Any.create = function create(properties) {
|
27646 | return new Any(properties);
|
27647 | };
|
27648 |
|
27649 | /**
|
27650 | * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages.
|
27651 | * @function encode
|
27652 | * @memberof google.protobuf.Any
|
27653 | * @static
|
27654 | * @param {google.protobuf.IAny} message Any message or plain object to encode
|
27655 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
27656 | * @returns {$protobuf.Writer} Writer
|
27657 | */
|
27658 | Any.encode = function encode(message, writer) {
|
27659 | if (!writer)
|
27660 | writer = $Writer.create();
|
27661 | if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url"))
|
27662 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url);
|
27663 | if (message.value != null && Object.hasOwnProperty.call(message, "value"))
|
27664 | writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value);
|
27665 | return writer;
|
27666 | };
|
27667 |
|
27668 | /**
|
27669 | * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages.
|
27670 | * @function encodeDelimited
|
27671 | * @memberof google.protobuf.Any
|
27672 | * @static
|
27673 | * @param {google.protobuf.IAny} message Any message or plain object to encode
|
27674 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
27675 | * @returns {$protobuf.Writer} Writer
|
27676 | */
|
27677 | Any.encodeDelimited = function encodeDelimited(message, writer) {
|
27678 | return this.encode(message, writer).ldelim();
|
27679 | };
|
27680 |
|
27681 | /**
|
27682 | * Decodes an Any message from the specified reader or buffer.
|
27683 | * @function decode
|
27684 | * @memberof google.protobuf.Any
|
27685 | * @static
|
27686 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
27687 | * @param {number} [length] Message length if known beforehand
|
27688 | * @returns {google.protobuf.Any} Any
|
27689 | * @throws {Error} If the payload is not a reader or valid buffer
|
27690 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
27691 | */
|
27692 | Any.decode = function decode(reader, length) {
|
27693 | if (!(reader instanceof $Reader))
|
27694 | reader = $Reader.create(reader);
|
27695 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any();
|
27696 | while (reader.pos < end) {
|
27697 | var tag = reader.uint32();
|
27698 | switch (tag >>> 3) {
|
27699 | case 1:
|
27700 | message.type_url = reader.string();
|
27701 | break;
|
27702 | case 2:
|
27703 | message.value = reader.bytes();
|
27704 | break;
|
27705 | default:
|
27706 | reader.skipType(tag & 7);
|
27707 | break;
|
27708 | }
|
27709 | }
|
27710 | return message;
|
27711 | };
|
27712 |
|
27713 | /**
|
27714 | * Decodes an Any message from the specified reader or buffer, length delimited.
|
27715 | * @function decodeDelimited
|
27716 | * @memberof google.protobuf.Any
|
27717 | * @static
|
27718 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
27719 | * @returns {google.protobuf.Any} Any
|
27720 | * @throws {Error} If the payload is not a reader or valid buffer
|
27721 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
27722 | */
|
27723 | Any.decodeDelimited = function decodeDelimited(reader) {
|
27724 | if (!(reader instanceof $Reader))
|
27725 | reader = new $Reader(reader);
|
27726 | return this.decode(reader, reader.uint32());
|
27727 | };
|
27728 |
|
27729 | /**
|
27730 | * Verifies an Any message.
|
27731 | * @function verify
|
27732 | * @memberof google.protobuf.Any
|
27733 | * @static
|
27734 | * @param {Object.<string,*>} message Plain object to verify
|
27735 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
27736 | */
|
27737 | Any.verify = function verify(message) {
|
27738 | if (typeof message !== "object" || message === null)
|
27739 | return "object expected";
|
27740 | if (message.type_url != null && message.hasOwnProperty("type_url"))
|
27741 | if (!$util.isString(message.type_url))
|
27742 | return "type_url: string expected";
|
27743 | if (message.value != null && message.hasOwnProperty("value"))
|
27744 | if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value)))
|
27745 | return "value: buffer expected";
|
27746 | return null;
|
27747 | };
|
27748 |
|
27749 | /**
|
27750 | * Creates an Any message from a plain object. Also converts values to their respective internal types.
|
27751 | * @function fromObject
|
27752 | * @memberof google.protobuf.Any
|
27753 | * @static
|
27754 | * @param {Object.<string,*>} object Plain object
|
27755 | * @returns {google.protobuf.Any} Any
|
27756 | */
|
27757 | Any.fromObject = function fromObject(object) {
|
27758 | if (object instanceof $root.google.protobuf.Any)
|
27759 | return object;
|
27760 | var message = new $root.google.protobuf.Any();
|
27761 | if (object.type_url != null)
|
27762 | message.type_url = String(object.type_url);
|
27763 | if (object.value != null)
|
27764 | if (typeof object.value === "string")
|
27765 | $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0);
|
27766 | else if (object.value.length)
|
27767 | message.value = object.value;
|
27768 | return message;
|
27769 | };
|
27770 |
|
27771 | /**
|
27772 | * Creates a plain object from an Any message. Also converts values to other types if specified.
|
27773 | * @function toObject
|
27774 | * @memberof google.protobuf.Any
|
27775 | * @static
|
27776 | * @param {google.protobuf.Any} message Any
|
27777 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
27778 | * @returns {Object.<string,*>} Plain object
|
27779 | */
|
27780 | Any.toObject = function toObject(message, options) {
|
27781 | if (!options)
|
27782 | options = {};
|
27783 | var object = {};
|
27784 | if (options.defaults) {
|
27785 | object.type_url = "";
|
27786 | if (options.bytes === String)
|
27787 | object.value = "";
|
27788 | else {
|
27789 | object.value = [];
|
27790 | if (options.bytes !== Array)
|
27791 | object.value = $util.newBuffer(object.value);
|
27792 | }
|
27793 | }
|
27794 | if (message.type_url != null && message.hasOwnProperty("type_url"))
|
27795 | object.type_url = message.type_url;
|
27796 | if (message.value != null && message.hasOwnProperty("value"))
|
27797 | 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;
|
27798 | return object;
|
27799 | };
|
27800 |
|
27801 | /**
|
27802 | * Converts this Any to JSON.
|
27803 | * @function toJSON
|
27804 | * @memberof google.protobuf.Any
|
27805 | * @instance
|
27806 | * @returns {Object.<string,*>} JSON object
|
27807 | */
|
27808 | Any.prototype.toJSON = function toJSON() {
|
27809 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
27810 | };
|
27811 |
|
27812 | return Any;
|
27813 | })();
|
27814 |
|
27815 | protobuf.Duration = (function() {
|
27816 |
|
27817 | /**
|
27818 | * Properties of a Duration.
|
27819 | * @memberof google.protobuf
|
27820 | * @interface IDuration
|
27821 | * @property {number|Long|null} [seconds] Duration seconds
|
27822 | * @property {number|null} [nanos] Duration nanos
|
27823 | */
|
27824 |
|
27825 | /**
|
27826 | * Constructs a new Duration.
|
27827 | * @memberof google.protobuf
|
27828 | * @classdesc Represents a Duration.
|
27829 | * @implements IDuration
|
27830 | * @constructor
|
27831 | * @param {google.protobuf.IDuration=} [properties] Properties to set
|
27832 | */
|
27833 | function Duration(properties) {
|
27834 | if (properties)
|
27835 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
27836 | if (properties[keys[i]] != null)
|
27837 | this[keys[i]] = properties[keys[i]];
|
27838 | }
|
27839 |
|
27840 | /**
|
27841 | * Duration seconds.
|
27842 | * @member {number|Long} seconds
|
27843 | * @memberof google.protobuf.Duration
|
27844 | * @instance
|
27845 | */
|
27846 | Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
27847 |
|
27848 | /**
|
27849 | * Duration nanos.
|
27850 | * @member {number} nanos
|
27851 | * @memberof google.protobuf.Duration
|
27852 | * @instance
|
27853 | */
|
27854 | Duration.prototype.nanos = 0;
|
27855 |
|
27856 | /**
|
27857 | * Creates a new Duration instance using the specified properties.
|
27858 | * @function create
|
27859 | * @memberof google.protobuf.Duration
|
27860 | * @static
|
27861 | * @param {google.protobuf.IDuration=} [properties] Properties to set
|
27862 | * @returns {google.protobuf.Duration} Duration instance
|
27863 | */
|
27864 | Duration.create = function create(properties) {
|
27865 | return new Duration(properties);
|
27866 | };
|
27867 |
|
27868 | /**
|
27869 | * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages.
|
27870 | * @function encode
|
27871 | * @memberof google.protobuf.Duration
|
27872 | * @static
|
27873 | * @param {google.protobuf.IDuration} message Duration message or plain object to encode
|
27874 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
27875 | * @returns {$protobuf.Writer} Writer
|
27876 | */
|
27877 | Duration.encode = function encode(message, writer) {
|
27878 | if (!writer)
|
27879 | writer = $Writer.create();
|
27880 | if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds"))
|
27881 | writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds);
|
27882 | if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos"))
|
27883 | writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos);
|
27884 | return writer;
|
27885 | };
|
27886 |
|
27887 | /**
|
27888 | * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages.
|
27889 | * @function encodeDelimited
|
27890 | * @memberof google.protobuf.Duration
|
27891 | * @static
|
27892 | * @param {google.protobuf.IDuration} message Duration message or plain object to encode
|
27893 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
27894 | * @returns {$protobuf.Writer} Writer
|
27895 | */
|
27896 | Duration.encodeDelimited = function encodeDelimited(message, writer) {
|
27897 | return this.encode(message, writer).ldelim();
|
27898 | };
|
27899 |
|
27900 | /**
|
27901 | * Decodes a Duration message from the specified reader or buffer.
|
27902 | * @function decode
|
27903 | * @memberof google.protobuf.Duration
|
27904 | * @static
|
27905 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
27906 | * @param {number} [length] Message length if known beforehand
|
27907 | * @returns {google.protobuf.Duration} Duration
|
27908 | * @throws {Error} If the payload is not a reader or valid buffer
|
27909 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
27910 | */
|
27911 | Duration.decode = function decode(reader, length) {
|
27912 | if (!(reader instanceof $Reader))
|
27913 | reader = $Reader.create(reader);
|
27914 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration();
|
27915 | while (reader.pos < end) {
|
27916 | var tag = reader.uint32();
|
27917 | switch (tag >>> 3) {
|
27918 | case 1:
|
27919 | message.seconds = reader.int64();
|
27920 | break;
|
27921 | case 2:
|
27922 | message.nanos = reader.int32();
|
27923 | break;
|
27924 | default:
|
27925 | reader.skipType(tag & 7);
|
27926 | break;
|
27927 | }
|
27928 | }
|
27929 | return message;
|
27930 | };
|
27931 |
|
27932 | /**
|
27933 | * Decodes a Duration message from the specified reader or buffer, length delimited.
|
27934 | * @function decodeDelimited
|
27935 | * @memberof google.protobuf.Duration
|
27936 | * @static
|
27937 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
27938 | * @returns {google.protobuf.Duration} Duration
|
27939 | * @throws {Error} If the payload is not a reader or valid buffer
|
27940 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
27941 | */
|
27942 | Duration.decodeDelimited = function decodeDelimited(reader) {
|
27943 | if (!(reader instanceof $Reader))
|
27944 | reader = new $Reader(reader);
|
27945 | return this.decode(reader, reader.uint32());
|
27946 | };
|
27947 |
|
27948 | /**
|
27949 | * Verifies a Duration message.
|
27950 | * @function verify
|
27951 | * @memberof google.protobuf.Duration
|
27952 | * @static
|
27953 | * @param {Object.<string,*>} message Plain object to verify
|
27954 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
27955 | */
|
27956 | Duration.verify = function verify(message) {
|
27957 | if (typeof message !== "object" || message === null)
|
27958 | return "object expected";
|
27959 | if (message.seconds != null && message.hasOwnProperty("seconds"))
|
27960 | if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high)))
|
27961 | return "seconds: integer|Long expected";
|
27962 | if (message.nanos != null && message.hasOwnProperty("nanos"))
|
27963 | if (!$util.isInteger(message.nanos))
|
27964 | return "nanos: integer expected";
|
27965 | return null;
|
27966 | };
|
27967 |
|
27968 | /**
|
27969 | * Creates a Duration message from a plain object. Also converts values to their respective internal types.
|
27970 | * @function fromObject
|
27971 | * @memberof google.protobuf.Duration
|
27972 | * @static
|
27973 | * @param {Object.<string,*>} object Plain object
|
27974 | * @returns {google.protobuf.Duration} Duration
|
27975 | */
|
27976 | Duration.fromObject = function fromObject(object) {
|
27977 | if (object instanceof $root.google.protobuf.Duration)
|
27978 | return object;
|
27979 | var message = new $root.google.protobuf.Duration();
|
27980 | if (object.seconds != null)
|
27981 | if ($util.Long)
|
27982 | (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false;
|
27983 | else if (typeof object.seconds === "string")
|
27984 | message.seconds = parseInt(object.seconds, 10);
|
27985 | else if (typeof object.seconds === "number")
|
27986 | message.seconds = object.seconds;
|
27987 | else if (typeof object.seconds === "object")
|
27988 | message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber();
|
27989 | if (object.nanos != null)
|
27990 | message.nanos = object.nanos | 0;
|
27991 | return message;
|
27992 | };
|
27993 |
|
27994 | /**
|
27995 | * Creates a plain object from a Duration message. Also converts values to other types if specified.
|
27996 | * @function toObject
|
27997 | * @memberof google.protobuf.Duration
|
27998 | * @static
|
27999 | * @param {google.protobuf.Duration} message Duration
|
28000 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
28001 | * @returns {Object.<string,*>} Plain object
|
28002 | */
|
28003 | Duration.toObject = function toObject(message, options) {
|
28004 | if (!options)
|
28005 | options = {};
|
28006 | var object = {};
|
28007 | if (options.defaults) {
|
28008 | if ($util.Long) {
|
28009 | var long = new $util.Long(0, 0, false);
|
28010 | object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
28011 | } else
|
28012 | object.seconds = options.longs === String ? "0" : 0;
|
28013 | object.nanos = 0;
|
28014 | }
|
28015 | if (message.seconds != null && message.hasOwnProperty("seconds"))
|
28016 | if (typeof message.seconds === "number")
|
28017 | object.seconds = options.longs === String ? String(message.seconds) : message.seconds;
|
28018 | else
|
28019 | 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;
|
28020 | if (message.nanos != null && message.hasOwnProperty("nanos"))
|
28021 | object.nanos = message.nanos;
|
28022 | return object;
|
28023 | };
|
28024 |
|
28025 | /**
|
28026 | * Converts this Duration to JSON.
|
28027 | * @function toJSON
|
28028 | * @memberof google.protobuf.Duration
|
28029 | * @instance
|
28030 | * @returns {Object.<string,*>} JSON object
|
28031 | */
|
28032 | Duration.prototype.toJSON = function toJSON() {
|
28033 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
28034 | };
|
28035 |
|
28036 | return Duration;
|
28037 | })();
|
28038 |
|
28039 | protobuf.Empty = (function() {
|
28040 |
|
28041 | /**
|
28042 | * Properties of an Empty.
|
28043 | * @memberof google.protobuf
|
28044 | * @interface IEmpty
|
28045 | */
|
28046 |
|
28047 | /**
|
28048 | * Constructs a new Empty.
|
28049 | * @memberof google.protobuf
|
28050 | * @classdesc Represents an Empty.
|
28051 | * @implements IEmpty
|
28052 | * @constructor
|
28053 | * @param {google.protobuf.IEmpty=} [properties] Properties to set
|
28054 | */
|
28055 | function Empty(properties) {
|
28056 | if (properties)
|
28057 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
28058 | if (properties[keys[i]] != null)
|
28059 | this[keys[i]] = properties[keys[i]];
|
28060 | }
|
28061 |
|
28062 | /**
|
28063 | * Creates a new Empty instance using the specified properties.
|
28064 | * @function create
|
28065 | * @memberof google.protobuf.Empty
|
28066 | * @static
|
28067 | * @param {google.protobuf.IEmpty=} [properties] Properties to set
|
28068 | * @returns {google.protobuf.Empty} Empty instance
|
28069 | */
|
28070 | Empty.create = function create(properties) {
|
28071 | return new Empty(properties);
|
28072 | };
|
28073 |
|
28074 | /**
|
28075 | * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages.
|
28076 | * @function encode
|
28077 | * @memberof google.protobuf.Empty
|
28078 | * @static
|
28079 | * @param {google.protobuf.IEmpty} message Empty message or plain object to encode
|
28080 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
28081 | * @returns {$protobuf.Writer} Writer
|
28082 | */
|
28083 | Empty.encode = function encode(message, writer) {
|
28084 | if (!writer)
|
28085 | writer = $Writer.create();
|
28086 | return writer;
|
28087 | };
|
28088 |
|
28089 | /**
|
28090 | * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages.
|
28091 | * @function encodeDelimited
|
28092 | * @memberof google.protobuf.Empty
|
28093 | * @static
|
28094 | * @param {google.protobuf.IEmpty} message Empty message or plain object to encode
|
28095 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
28096 | * @returns {$protobuf.Writer} Writer
|
28097 | */
|
28098 | Empty.encodeDelimited = function encodeDelimited(message, writer) {
|
28099 | return this.encode(message, writer).ldelim();
|
28100 | };
|
28101 |
|
28102 | /**
|
28103 | * Decodes an Empty message from the specified reader or buffer.
|
28104 | * @function decode
|
28105 | * @memberof google.protobuf.Empty
|
28106 | * @static
|
28107 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
28108 | * @param {number} [length] Message length if known beforehand
|
28109 | * @returns {google.protobuf.Empty} Empty
|
28110 | * @throws {Error} If the payload is not a reader or valid buffer
|
28111 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
28112 | */
|
28113 | Empty.decode = function decode(reader, length) {
|
28114 | if (!(reader instanceof $Reader))
|
28115 | reader = $Reader.create(reader);
|
28116 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty();
|
28117 | while (reader.pos < end) {
|
28118 | var tag = reader.uint32();
|
28119 | switch (tag >>> 3) {
|
28120 | default:
|
28121 | reader.skipType(tag & 7);
|
28122 | break;
|
28123 | }
|
28124 | }
|
28125 | return message;
|
28126 | };
|
28127 |
|
28128 | /**
|
28129 | * Decodes an Empty message from the specified reader or buffer, length delimited.
|
28130 | * @function decodeDelimited
|
28131 | * @memberof google.protobuf.Empty
|
28132 | * @static
|
28133 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
28134 | * @returns {google.protobuf.Empty} Empty
|
28135 | * @throws {Error} If the payload is not a reader or valid buffer
|
28136 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
28137 | */
|
28138 | Empty.decodeDelimited = function decodeDelimited(reader) {
|
28139 | if (!(reader instanceof $Reader))
|
28140 | reader = new $Reader(reader);
|
28141 | return this.decode(reader, reader.uint32());
|
28142 | };
|
28143 |
|
28144 | /**
|
28145 | * Verifies an Empty message.
|
28146 | * @function verify
|
28147 | * @memberof google.protobuf.Empty
|
28148 | * @static
|
28149 | * @param {Object.<string,*>} message Plain object to verify
|
28150 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
28151 | */
|
28152 | Empty.verify = function verify(message) {
|
28153 | if (typeof message !== "object" || message === null)
|
28154 | return "object expected";
|
28155 | return null;
|
28156 | };
|
28157 |
|
28158 | /**
|
28159 | * Creates an Empty message from a plain object. Also converts values to their respective internal types.
|
28160 | * @function fromObject
|
28161 | * @memberof google.protobuf.Empty
|
28162 | * @static
|
28163 | * @param {Object.<string,*>} object Plain object
|
28164 | * @returns {google.protobuf.Empty} Empty
|
28165 | */
|
28166 | Empty.fromObject = function fromObject(object) {
|
28167 | if (object instanceof $root.google.protobuf.Empty)
|
28168 | return object;
|
28169 | return new $root.google.protobuf.Empty();
|
28170 | };
|
28171 |
|
28172 | /**
|
28173 | * Creates a plain object from an Empty message. Also converts values to other types if specified.
|
28174 | * @function toObject
|
28175 | * @memberof google.protobuf.Empty
|
28176 | * @static
|
28177 | * @param {google.protobuf.Empty} message Empty
|
28178 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
28179 | * @returns {Object.<string,*>} Plain object
|
28180 | */
|
28181 | Empty.toObject = function toObject() {
|
28182 | return {};
|
28183 | };
|
28184 |
|
28185 | /**
|
28186 | * Converts this Empty to JSON.
|
28187 | * @function toJSON
|
28188 | * @memberof google.protobuf.Empty
|
28189 | * @instance
|
28190 | * @returns {Object.<string,*>} JSON object
|
28191 | */
|
28192 | Empty.prototype.toJSON = function toJSON() {
|
28193 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
28194 | };
|
28195 |
|
28196 | return Empty;
|
28197 | })();
|
28198 |
|
28199 | protobuf.DoubleValue = (function() {
|
28200 |
|
28201 | /**
|
28202 | * Properties of a DoubleValue.
|
28203 | * @memberof google.protobuf
|
28204 | * @interface IDoubleValue
|
28205 | * @property {number|null} [value] DoubleValue value
|
28206 | */
|
28207 |
|
28208 | /**
|
28209 | * Constructs a new DoubleValue.
|
28210 | * @memberof google.protobuf
|
28211 | * @classdesc Represents a DoubleValue.
|
28212 | * @implements IDoubleValue
|
28213 | * @constructor
|
28214 | * @param {google.protobuf.IDoubleValue=} [properties] Properties to set
|
28215 | */
|
28216 | function DoubleValue(properties) {
|
28217 | if (properties)
|
28218 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
28219 | if (properties[keys[i]] != null)
|
28220 | this[keys[i]] = properties[keys[i]];
|
28221 | }
|
28222 |
|
28223 | /**
|
28224 | * DoubleValue value.
|
28225 | * @member {number} value
|
28226 | * @memberof google.protobuf.DoubleValue
|
28227 | * @instance
|
28228 | */
|
28229 | DoubleValue.prototype.value = 0;
|
28230 |
|
28231 | /**
|
28232 | * Creates a new DoubleValue instance using the specified properties.
|
28233 | * @function create
|
28234 | * @memberof google.protobuf.DoubleValue
|
28235 | * @static
|
28236 | * @param {google.protobuf.IDoubleValue=} [properties] Properties to set
|
28237 | * @returns {google.protobuf.DoubleValue} DoubleValue instance
|
28238 | */
|
28239 | DoubleValue.create = function create(properties) {
|
28240 | return new DoubleValue(properties);
|
28241 | };
|
28242 |
|
28243 | /**
|
28244 | * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages.
|
28245 | * @function encode
|
28246 | * @memberof google.protobuf.DoubleValue
|
28247 | * @static
|
28248 | * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode
|
28249 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
28250 | * @returns {$protobuf.Writer} Writer
|
28251 | */
|
28252 | DoubleValue.encode = function encode(message, writer) {
|
28253 | if (!writer)
|
28254 | writer = $Writer.create();
|
28255 | if (message.value != null && Object.hasOwnProperty.call(message, "value"))
|
28256 | writer.uint32(/* id 1, wireType 1 =*/9).double(message.value);
|
28257 | return writer;
|
28258 | };
|
28259 |
|
28260 | /**
|
28261 | * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages.
|
28262 | * @function encodeDelimited
|
28263 | * @memberof google.protobuf.DoubleValue
|
28264 | * @static
|
28265 | * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode
|
28266 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
28267 | * @returns {$protobuf.Writer} Writer
|
28268 | */
|
28269 | DoubleValue.encodeDelimited = function encodeDelimited(message, writer) {
|
28270 | return this.encode(message, writer).ldelim();
|
28271 | };
|
28272 |
|
28273 | /**
|
28274 | * Decodes a DoubleValue message from the specified reader or buffer.
|
28275 | * @function decode
|
28276 | * @memberof google.protobuf.DoubleValue
|
28277 | * @static
|
28278 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
28279 | * @param {number} [length] Message length if known beforehand
|
28280 | * @returns {google.protobuf.DoubleValue} DoubleValue
|
28281 | * @throws {Error} If the payload is not a reader or valid buffer
|
28282 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
28283 | */
|
28284 | DoubleValue.decode = function decode(reader, length) {
|
28285 | if (!(reader instanceof $Reader))
|
28286 | reader = $Reader.create(reader);
|
28287 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DoubleValue();
|
28288 | while (reader.pos < end) {
|
28289 | var tag = reader.uint32();
|
28290 | switch (tag >>> 3) {
|
28291 | case 1:
|
28292 | message.value = reader.double();
|
28293 | break;
|
28294 | default:
|
28295 | reader.skipType(tag & 7);
|
28296 | break;
|
28297 | }
|
28298 | }
|
28299 | return message;
|
28300 | };
|
28301 |
|
28302 | /**
|
28303 | * Decodes a DoubleValue message from the specified reader or buffer, length delimited.
|
28304 | * @function decodeDelimited
|
28305 | * @memberof google.protobuf.DoubleValue
|
28306 | * @static
|
28307 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
28308 | * @returns {google.protobuf.DoubleValue} DoubleValue
|
28309 | * @throws {Error} If the payload is not a reader or valid buffer
|
28310 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
28311 | */
|
28312 | DoubleValue.decodeDelimited = function decodeDelimited(reader) {
|
28313 | if (!(reader instanceof $Reader))
|
28314 | reader = new $Reader(reader);
|
28315 | return this.decode(reader, reader.uint32());
|
28316 | };
|
28317 |
|
28318 | /**
|
28319 | * Verifies a DoubleValue message.
|
28320 | * @function verify
|
28321 | * @memberof google.protobuf.DoubleValue
|
28322 | * @static
|
28323 | * @param {Object.<string,*>} message Plain object to verify
|
28324 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
28325 | */
|
28326 | DoubleValue.verify = function verify(message) {
|
28327 | if (typeof message !== "object" || message === null)
|
28328 | return "object expected";
|
28329 | if (message.value != null && message.hasOwnProperty("value"))
|
28330 | if (typeof message.value !== "number")
|
28331 | return "value: number expected";
|
28332 | return null;
|
28333 | };
|
28334 |
|
28335 | /**
|
28336 | * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types.
|
28337 | * @function fromObject
|
28338 | * @memberof google.protobuf.DoubleValue
|
28339 | * @static
|
28340 | * @param {Object.<string,*>} object Plain object
|
28341 | * @returns {google.protobuf.DoubleValue} DoubleValue
|
28342 | */
|
28343 | DoubleValue.fromObject = function fromObject(object) {
|
28344 | if (object instanceof $root.google.protobuf.DoubleValue)
|
28345 | return object;
|
28346 | var message = new $root.google.protobuf.DoubleValue();
|
28347 | if (object.value != null)
|
28348 | message.value = Number(object.value);
|
28349 | return message;
|
28350 | };
|
28351 |
|
28352 | /**
|
28353 | * Creates a plain object from a DoubleValue message. Also converts values to other types if specified.
|
28354 | * @function toObject
|
28355 | * @memberof google.protobuf.DoubleValue
|
28356 | * @static
|
28357 | * @param {google.protobuf.DoubleValue} message DoubleValue
|
28358 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
28359 | * @returns {Object.<string,*>} Plain object
|
28360 | */
|
28361 | DoubleValue.toObject = function toObject(message, options) {
|
28362 | if (!options)
|
28363 | options = {};
|
28364 | var object = {};
|
28365 | if (options.defaults)
|
28366 | object.value = 0;
|
28367 | if (message.value != null && message.hasOwnProperty("value"))
|
28368 | object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value;
|
28369 | return object;
|
28370 | };
|
28371 |
|
28372 | /**
|
28373 | * Converts this DoubleValue to JSON.
|
28374 | * @function toJSON
|
28375 | * @memberof google.protobuf.DoubleValue
|
28376 | * @instance
|
28377 | * @returns {Object.<string,*>} JSON object
|
28378 | */
|
28379 | DoubleValue.prototype.toJSON = function toJSON() {
|
28380 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
28381 | };
|
28382 |
|
28383 | return DoubleValue;
|
28384 | })();
|
28385 |
|
28386 | protobuf.FloatValue = (function() {
|
28387 |
|
28388 | /**
|
28389 | * Properties of a FloatValue.
|
28390 | * @memberof google.protobuf
|
28391 | * @interface IFloatValue
|
28392 | * @property {number|null} [value] FloatValue value
|
28393 | */
|
28394 |
|
28395 | /**
|
28396 | * Constructs a new FloatValue.
|
28397 | * @memberof google.protobuf
|
28398 | * @classdesc Represents a FloatValue.
|
28399 | * @implements IFloatValue
|
28400 | * @constructor
|
28401 | * @param {google.protobuf.IFloatValue=} [properties] Properties to set
|
28402 | */
|
28403 | function FloatValue(properties) {
|
28404 | if (properties)
|
28405 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
28406 | if (properties[keys[i]] != null)
|
28407 | this[keys[i]] = properties[keys[i]];
|
28408 | }
|
28409 |
|
28410 | /**
|
28411 | * FloatValue value.
|
28412 | * @member {number} value
|
28413 | * @memberof google.protobuf.FloatValue
|
28414 | * @instance
|
28415 | */
|
28416 | FloatValue.prototype.value = 0;
|
28417 |
|
28418 | /**
|
28419 | * Creates a new FloatValue instance using the specified properties.
|
28420 | * @function create
|
28421 | * @memberof google.protobuf.FloatValue
|
28422 | * @static
|
28423 | * @param {google.protobuf.IFloatValue=} [properties] Properties to set
|
28424 | * @returns {google.protobuf.FloatValue} FloatValue instance
|
28425 | */
|
28426 | FloatValue.create = function create(properties) {
|
28427 | return new FloatValue(properties);
|
28428 | };
|
28429 |
|
28430 | /**
|
28431 | * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages.
|
28432 | * @function encode
|
28433 | * @memberof google.protobuf.FloatValue
|
28434 | * @static
|
28435 | * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode
|
28436 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
28437 | * @returns {$protobuf.Writer} Writer
|
28438 | */
|
28439 | FloatValue.encode = function encode(message, writer) {
|
28440 | if (!writer)
|
28441 | writer = $Writer.create();
|
28442 | if (message.value != null && Object.hasOwnProperty.call(message, "value"))
|
28443 | writer.uint32(/* id 1, wireType 5 =*/13).float(message.value);
|
28444 | return writer;
|
28445 | };
|
28446 |
|
28447 | /**
|
28448 | * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages.
|
28449 | * @function encodeDelimited
|
28450 | * @memberof google.protobuf.FloatValue
|
28451 | * @static
|
28452 | * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode
|
28453 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
28454 | * @returns {$protobuf.Writer} Writer
|
28455 | */
|
28456 | FloatValue.encodeDelimited = function encodeDelimited(message, writer) {
|
28457 | return this.encode(message, writer).ldelim();
|
28458 | };
|
28459 |
|
28460 | /**
|
28461 | * Decodes a FloatValue message from the specified reader or buffer.
|
28462 | * @function decode
|
28463 | * @memberof google.protobuf.FloatValue
|
28464 | * @static
|
28465 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
28466 | * @param {number} [length] Message length if known beforehand
|
28467 | * @returns {google.protobuf.FloatValue} FloatValue
|
28468 | * @throws {Error} If the payload is not a reader or valid buffer
|
28469 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
28470 | */
|
28471 | FloatValue.decode = function decode(reader, length) {
|
28472 | if (!(reader instanceof $Reader))
|
28473 | reader = $Reader.create(reader);
|
28474 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FloatValue();
|
28475 | while (reader.pos < end) {
|
28476 | var tag = reader.uint32();
|
28477 | switch (tag >>> 3) {
|
28478 | case 1:
|
28479 | message.value = reader.float();
|
28480 | break;
|
28481 | default:
|
28482 | reader.skipType(tag & 7);
|
28483 | break;
|
28484 | }
|
28485 | }
|
28486 | return message;
|
28487 | };
|
28488 |
|
28489 | /**
|
28490 | * Decodes a FloatValue message from the specified reader or buffer, length delimited.
|
28491 | * @function decodeDelimited
|
28492 | * @memberof google.protobuf.FloatValue
|
28493 | * @static
|
28494 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
28495 | * @returns {google.protobuf.FloatValue} FloatValue
|
28496 | * @throws {Error} If the payload is not a reader or valid buffer
|
28497 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
28498 | */
|
28499 | FloatValue.decodeDelimited = function decodeDelimited(reader) {
|
28500 | if (!(reader instanceof $Reader))
|
28501 | reader = new $Reader(reader);
|
28502 | return this.decode(reader, reader.uint32());
|
28503 | };
|
28504 |
|
28505 | /**
|
28506 | * Verifies a FloatValue message.
|
28507 | * @function verify
|
28508 | * @memberof google.protobuf.FloatValue
|
28509 | * @static
|
28510 | * @param {Object.<string,*>} message Plain object to verify
|
28511 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
28512 | */
|
28513 | FloatValue.verify = function verify(message) {
|
28514 | if (typeof message !== "object" || message === null)
|
28515 | return "object expected";
|
28516 | if (message.value != null && message.hasOwnProperty("value"))
|
28517 | if (typeof message.value !== "number")
|
28518 | return "value: number expected";
|
28519 | return null;
|
28520 | };
|
28521 |
|
28522 | /**
|
28523 | * Creates a FloatValue message from a plain object. Also converts values to their respective internal types.
|
28524 | * @function fromObject
|
28525 | * @memberof google.protobuf.FloatValue
|
28526 | * @static
|
28527 | * @param {Object.<string,*>} object Plain object
|
28528 | * @returns {google.protobuf.FloatValue} FloatValue
|
28529 | */
|
28530 | FloatValue.fromObject = function fromObject(object) {
|
28531 | if (object instanceof $root.google.protobuf.FloatValue)
|
28532 | return object;
|
28533 | var message = new $root.google.protobuf.FloatValue();
|
28534 | if (object.value != null)
|
28535 | message.value = Number(object.value);
|
28536 | return message;
|
28537 | };
|
28538 |
|
28539 | /**
|
28540 | * Creates a plain object from a FloatValue message. Also converts values to other types if specified.
|
28541 | * @function toObject
|
28542 | * @memberof google.protobuf.FloatValue
|
28543 | * @static
|
28544 | * @param {google.protobuf.FloatValue} message FloatValue
|
28545 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
28546 | * @returns {Object.<string,*>} Plain object
|
28547 | */
|
28548 | FloatValue.toObject = function toObject(message, options) {
|
28549 | if (!options)
|
28550 | options = {};
|
28551 | var object = {};
|
28552 | if (options.defaults)
|
28553 | object.value = 0;
|
28554 | if (message.value != null && message.hasOwnProperty("value"))
|
28555 | object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value;
|
28556 | return object;
|
28557 | };
|
28558 |
|
28559 | /**
|
28560 | * Converts this FloatValue to JSON.
|
28561 | * @function toJSON
|
28562 | * @memberof google.protobuf.FloatValue
|
28563 | * @instance
|
28564 | * @returns {Object.<string,*>} JSON object
|
28565 | */
|
28566 | FloatValue.prototype.toJSON = function toJSON() {
|
28567 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
28568 | };
|
28569 |
|
28570 | return FloatValue;
|
28571 | })();
|
28572 |
|
28573 | protobuf.Int64Value = (function() {
|
28574 |
|
28575 | /**
|
28576 | * Properties of an Int64Value.
|
28577 | * @memberof google.protobuf
|
28578 | * @interface IInt64Value
|
28579 | * @property {number|Long|null} [value] Int64Value value
|
28580 | */
|
28581 |
|
28582 | /**
|
28583 | * Constructs a new Int64Value.
|
28584 | * @memberof google.protobuf
|
28585 | * @classdesc Represents an Int64Value.
|
28586 | * @implements IInt64Value
|
28587 | * @constructor
|
28588 | * @param {google.protobuf.IInt64Value=} [properties] Properties to set
|
28589 | */
|
28590 | function Int64Value(properties) {
|
28591 | if (properties)
|
28592 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
28593 | if (properties[keys[i]] != null)
|
28594 | this[keys[i]] = properties[keys[i]];
|
28595 | }
|
28596 |
|
28597 | /**
|
28598 | * Int64Value value.
|
28599 | * @member {number|Long} value
|
28600 | * @memberof google.protobuf.Int64Value
|
28601 | * @instance
|
28602 | */
|
28603 | Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
28604 |
|
28605 | /**
|
28606 | * Creates a new Int64Value instance using the specified properties.
|
28607 | * @function create
|
28608 | * @memberof google.protobuf.Int64Value
|
28609 | * @static
|
28610 | * @param {google.protobuf.IInt64Value=} [properties] Properties to set
|
28611 | * @returns {google.protobuf.Int64Value} Int64Value instance
|
28612 | */
|
28613 | Int64Value.create = function create(properties) {
|
28614 | return new Int64Value(properties);
|
28615 | };
|
28616 |
|
28617 | /**
|
28618 | * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages.
|
28619 | * @function encode
|
28620 | * @memberof google.protobuf.Int64Value
|
28621 | * @static
|
28622 | * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode
|
28623 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
28624 | * @returns {$protobuf.Writer} Writer
|
28625 | */
|
28626 | Int64Value.encode = function encode(message, writer) {
|
28627 | if (!writer)
|
28628 | writer = $Writer.create();
|
28629 | if (message.value != null && Object.hasOwnProperty.call(message, "value"))
|
28630 | writer.uint32(/* id 1, wireType 0 =*/8).int64(message.value);
|
28631 | return writer;
|
28632 | };
|
28633 |
|
28634 | /**
|
28635 | * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages.
|
28636 | * @function encodeDelimited
|
28637 | * @memberof google.protobuf.Int64Value
|
28638 | * @static
|
28639 | * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode
|
28640 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
28641 | * @returns {$protobuf.Writer} Writer
|
28642 | */
|
28643 | Int64Value.encodeDelimited = function encodeDelimited(message, writer) {
|
28644 | return this.encode(message, writer).ldelim();
|
28645 | };
|
28646 |
|
28647 | /**
|
28648 | * Decodes an Int64Value message from the specified reader or buffer.
|
28649 | * @function decode
|
28650 | * @memberof google.protobuf.Int64Value
|
28651 | * @static
|
28652 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
28653 | * @param {number} [length] Message length if known beforehand
|
28654 | * @returns {google.protobuf.Int64Value} Int64Value
|
28655 | * @throws {Error} If the payload is not a reader or valid buffer
|
28656 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
28657 | */
|
28658 | Int64Value.decode = function decode(reader, length) {
|
28659 | if (!(reader instanceof $Reader))
|
28660 | reader = $Reader.create(reader);
|
28661 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int64Value();
|
28662 | while (reader.pos < end) {
|
28663 | var tag = reader.uint32();
|
28664 | switch (tag >>> 3) {
|
28665 | case 1:
|
28666 | message.value = reader.int64();
|
28667 | break;
|
28668 | default:
|
28669 | reader.skipType(tag & 7);
|
28670 | break;
|
28671 | }
|
28672 | }
|
28673 | return message;
|
28674 | };
|
28675 |
|
28676 | /**
|
28677 | * Decodes an Int64Value message from the specified reader or buffer, length delimited.
|
28678 | * @function decodeDelimited
|
28679 | * @memberof google.protobuf.Int64Value
|
28680 | * @static
|
28681 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
28682 | * @returns {google.protobuf.Int64Value} Int64Value
|
28683 | * @throws {Error} If the payload is not a reader or valid buffer
|
28684 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
28685 | */
|
28686 | Int64Value.decodeDelimited = function decodeDelimited(reader) {
|
28687 | if (!(reader instanceof $Reader))
|
28688 | reader = new $Reader(reader);
|
28689 | return this.decode(reader, reader.uint32());
|
28690 | };
|
28691 |
|
28692 | /**
|
28693 | * Verifies an Int64Value message.
|
28694 | * @function verify
|
28695 | * @memberof google.protobuf.Int64Value
|
28696 | * @static
|
28697 | * @param {Object.<string,*>} message Plain object to verify
|
28698 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
28699 | */
|
28700 | Int64Value.verify = function verify(message) {
|
28701 | if (typeof message !== "object" || message === null)
|
28702 | return "object expected";
|
28703 | if (message.value != null && message.hasOwnProperty("value"))
|
28704 | if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high)))
|
28705 | return "value: integer|Long expected";
|
28706 | return null;
|
28707 | };
|
28708 |
|
28709 | /**
|
28710 | * Creates an Int64Value message from a plain object. Also converts values to their respective internal types.
|
28711 | * @function fromObject
|
28712 | * @memberof google.protobuf.Int64Value
|
28713 | * @static
|
28714 | * @param {Object.<string,*>} object Plain object
|
28715 | * @returns {google.protobuf.Int64Value} Int64Value
|
28716 | */
|
28717 | Int64Value.fromObject = function fromObject(object) {
|
28718 | if (object instanceof $root.google.protobuf.Int64Value)
|
28719 | return object;
|
28720 | var message = new $root.google.protobuf.Int64Value();
|
28721 | if (object.value != null)
|
28722 | if ($util.Long)
|
28723 | (message.value = $util.Long.fromValue(object.value)).unsigned = false;
|
28724 | else if (typeof object.value === "string")
|
28725 | message.value = parseInt(object.value, 10);
|
28726 | else if (typeof object.value === "number")
|
28727 | message.value = object.value;
|
28728 | else if (typeof object.value === "object")
|
28729 | message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber();
|
28730 | return message;
|
28731 | };
|
28732 |
|
28733 | /**
|
28734 | * Creates a plain object from an Int64Value message. Also converts values to other types if specified.
|
28735 | * @function toObject
|
28736 | * @memberof google.protobuf.Int64Value
|
28737 | * @static
|
28738 | * @param {google.protobuf.Int64Value} message Int64Value
|
28739 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
28740 | * @returns {Object.<string,*>} Plain object
|
28741 | */
|
28742 | Int64Value.toObject = function toObject(message, options) {
|
28743 | if (!options)
|
28744 | options = {};
|
28745 | var object = {};
|
28746 | if (options.defaults)
|
28747 | if ($util.Long) {
|
28748 | var long = new $util.Long(0, 0, false);
|
28749 | object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
28750 | } else
|
28751 | object.value = options.longs === String ? "0" : 0;
|
28752 | if (message.value != null && message.hasOwnProperty("value"))
|
28753 | if (typeof message.value === "number")
|
28754 | object.value = options.longs === String ? String(message.value) : message.value;
|
28755 | else
|
28756 | 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;
|
28757 | return object;
|
28758 | };
|
28759 |
|
28760 | /**
|
28761 | * Converts this Int64Value to JSON.
|
28762 | * @function toJSON
|
28763 | * @memberof google.protobuf.Int64Value
|
28764 | * @instance
|
28765 | * @returns {Object.<string,*>} JSON object
|
28766 | */
|
28767 | Int64Value.prototype.toJSON = function toJSON() {
|
28768 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
28769 | };
|
28770 |
|
28771 | return Int64Value;
|
28772 | })();
|
28773 |
|
28774 | protobuf.UInt64Value = (function() {
|
28775 |
|
28776 | /**
|
28777 | * Properties of a UInt64Value.
|
28778 | * @memberof google.protobuf
|
28779 | * @interface IUInt64Value
|
28780 | * @property {number|Long|null} [value] UInt64Value value
|
28781 | */
|
28782 |
|
28783 | /**
|
28784 | * Constructs a new UInt64Value.
|
28785 | * @memberof google.protobuf
|
28786 | * @classdesc Represents a UInt64Value.
|
28787 | * @implements IUInt64Value
|
28788 | * @constructor
|
28789 | * @param {google.protobuf.IUInt64Value=} [properties] Properties to set
|
28790 | */
|
28791 | function UInt64Value(properties) {
|
28792 | if (properties)
|
28793 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
28794 | if (properties[keys[i]] != null)
|
28795 | this[keys[i]] = properties[keys[i]];
|
28796 | }
|
28797 |
|
28798 | /**
|
28799 | * UInt64Value value.
|
28800 | * @member {number|Long} value
|
28801 | * @memberof google.protobuf.UInt64Value
|
28802 | * @instance
|
28803 | */
|
28804 | UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
|
28805 |
|
28806 | /**
|
28807 | * Creates a new UInt64Value instance using the specified properties.
|
28808 | * @function create
|
28809 | * @memberof google.protobuf.UInt64Value
|
28810 | * @static
|
28811 | * @param {google.protobuf.IUInt64Value=} [properties] Properties to set
|
28812 | * @returns {google.protobuf.UInt64Value} UInt64Value instance
|
28813 | */
|
28814 | UInt64Value.create = function create(properties) {
|
28815 | return new UInt64Value(properties);
|
28816 | };
|
28817 |
|
28818 | /**
|
28819 | * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages.
|
28820 | * @function encode
|
28821 | * @memberof google.protobuf.UInt64Value
|
28822 | * @static
|
28823 | * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode
|
28824 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
28825 | * @returns {$protobuf.Writer} Writer
|
28826 | */
|
28827 | UInt64Value.encode = function encode(message, writer) {
|
28828 | if (!writer)
|
28829 | writer = $Writer.create();
|
28830 | if (message.value != null && Object.hasOwnProperty.call(message, "value"))
|
28831 | writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.value);
|
28832 | return writer;
|
28833 | };
|
28834 |
|
28835 | /**
|
28836 | * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages.
|
28837 | * @function encodeDelimited
|
28838 | * @memberof google.protobuf.UInt64Value
|
28839 | * @static
|
28840 | * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode
|
28841 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
28842 | * @returns {$protobuf.Writer} Writer
|
28843 | */
|
28844 | UInt64Value.encodeDelimited = function encodeDelimited(message, writer) {
|
28845 | return this.encode(message, writer).ldelim();
|
28846 | };
|
28847 |
|
28848 | /**
|
28849 | * Decodes a UInt64Value message from the specified reader or buffer.
|
28850 | * @function decode
|
28851 | * @memberof google.protobuf.UInt64Value
|
28852 | * @static
|
28853 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
28854 | * @param {number} [length] Message length if known beforehand
|
28855 | * @returns {google.protobuf.UInt64Value} UInt64Value
|
28856 | * @throws {Error} If the payload is not a reader or valid buffer
|
28857 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
28858 | */
|
28859 | UInt64Value.decode = function decode(reader, length) {
|
28860 | if (!(reader instanceof $Reader))
|
28861 | reader = $Reader.create(reader);
|
28862 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt64Value();
|
28863 | while (reader.pos < end) {
|
28864 | var tag = reader.uint32();
|
28865 | switch (tag >>> 3) {
|
28866 | case 1:
|
28867 | message.value = reader.uint64();
|
28868 | break;
|
28869 | default:
|
28870 | reader.skipType(tag & 7);
|
28871 | break;
|
28872 | }
|
28873 | }
|
28874 | return message;
|
28875 | };
|
28876 |
|
28877 | /**
|
28878 | * Decodes a UInt64Value message from the specified reader or buffer, length delimited.
|
28879 | * @function decodeDelimited
|
28880 | * @memberof google.protobuf.UInt64Value
|
28881 | * @static
|
28882 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
28883 | * @returns {google.protobuf.UInt64Value} UInt64Value
|
28884 | * @throws {Error} If the payload is not a reader or valid buffer
|
28885 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
28886 | */
|
28887 | UInt64Value.decodeDelimited = function decodeDelimited(reader) {
|
28888 | if (!(reader instanceof $Reader))
|
28889 | reader = new $Reader(reader);
|
28890 | return this.decode(reader, reader.uint32());
|
28891 | };
|
28892 |
|
28893 | /**
|
28894 | * Verifies a UInt64Value message.
|
28895 | * @function verify
|
28896 | * @memberof google.protobuf.UInt64Value
|
28897 | * @static
|
28898 | * @param {Object.<string,*>} message Plain object to verify
|
28899 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
28900 | */
|
28901 | UInt64Value.verify = function verify(message) {
|
28902 | if (typeof message !== "object" || message === null)
|
28903 | return "object expected";
|
28904 | if (message.value != null && message.hasOwnProperty("value"))
|
28905 | if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high)))
|
28906 | return "value: integer|Long expected";
|
28907 | return null;
|
28908 | };
|
28909 |
|
28910 | /**
|
28911 | * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types.
|
28912 | * @function fromObject
|
28913 | * @memberof google.protobuf.UInt64Value
|
28914 | * @static
|
28915 | * @param {Object.<string,*>} object Plain object
|
28916 | * @returns {google.protobuf.UInt64Value} UInt64Value
|
28917 | */
|
28918 | UInt64Value.fromObject = function fromObject(object) {
|
28919 | if (object instanceof $root.google.protobuf.UInt64Value)
|
28920 | return object;
|
28921 | var message = new $root.google.protobuf.UInt64Value();
|
28922 | if (object.value != null)
|
28923 | if ($util.Long)
|
28924 | (message.value = $util.Long.fromValue(object.value)).unsigned = true;
|
28925 | else if (typeof object.value === "string")
|
28926 | message.value = parseInt(object.value, 10);
|
28927 | else if (typeof object.value === "number")
|
28928 | message.value = object.value;
|
28929 | else if (typeof object.value === "object")
|
28930 | message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(true);
|
28931 | return message;
|
28932 | };
|
28933 |
|
28934 | /**
|
28935 | * Creates a plain object from a UInt64Value message. Also converts values to other types if specified.
|
28936 | * @function toObject
|
28937 | * @memberof google.protobuf.UInt64Value
|
28938 | * @static
|
28939 | * @param {google.protobuf.UInt64Value} message UInt64Value
|
28940 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
28941 | * @returns {Object.<string,*>} Plain object
|
28942 | */
|
28943 | UInt64Value.toObject = function toObject(message, options) {
|
28944 | if (!options)
|
28945 | options = {};
|
28946 | var object = {};
|
28947 | if (options.defaults)
|
28948 | if ($util.Long) {
|
28949 | var long = new $util.Long(0, 0, true);
|
28950 | object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
28951 | } else
|
28952 | object.value = options.longs === String ? "0" : 0;
|
28953 | if (message.value != null && message.hasOwnProperty("value"))
|
28954 | if (typeof message.value === "number")
|
28955 | object.value = options.longs === String ? String(message.value) : message.value;
|
28956 | else
|
28957 | 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;
|
28958 | return object;
|
28959 | };
|
28960 |
|
28961 | /**
|
28962 | * Converts this UInt64Value to JSON.
|
28963 | * @function toJSON
|
28964 | * @memberof google.protobuf.UInt64Value
|
28965 | * @instance
|
28966 | * @returns {Object.<string,*>} JSON object
|
28967 | */
|
28968 | UInt64Value.prototype.toJSON = function toJSON() {
|
28969 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
28970 | };
|
28971 |
|
28972 | return UInt64Value;
|
28973 | })();
|
28974 |
|
28975 | protobuf.Int32Value = (function() {
|
28976 |
|
28977 | /**
|
28978 | * Properties of an Int32Value.
|
28979 | * @memberof google.protobuf
|
28980 | * @interface IInt32Value
|
28981 | * @property {number|null} [value] Int32Value value
|
28982 | */
|
28983 |
|
28984 | /**
|
28985 | * Constructs a new Int32Value.
|
28986 | * @memberof google.protobuf
|
28987 | * @classdesc Represents an Int32Value.
|
28988 | * @implements IInt32Value
|
28989 | * @constructor
|
28990 | * @param {google.protobuf.IInt32Value=} [properties] Properties to set
|
28991 | */
|
28992 | function Int32Value(properties) {
|
28993 | if (properties)
|
28994 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
28995 | if (properties[keys[i]] != null)
|
28996 | this[keys[i]] = properties[keys[i]];
|
28997 | }
|
28998 |
|
28999 | /**
|
29000 | * Int32Value value.
|
29001 | * @member {number} value
|
29002 | * @memberof google.protobuf.Int32Value
|
29003 | * @instance
|
29004 | */
|
29005 | Int32Value.prototype.value = 0;
|
29006 |
|
29007 | /**
|
29008 | * Creates a new Int32Value instance using the specified properties.
|
29009 | * @function create
|
29010 | * @memberof google.protobuf.Int32Value
|
29011 | * @static
|
29012 | * @param {google.protobuf.IInt32Value=} [properties] Properties to set
|
29013 | * @returns {google.protobuf.Int32Value} Int32Value instance
|
29014 | */
|
29015 | Int32Value.create = function create(properties) {
|
29016 | return new Int32Value(properties);
|
29017 | };
|
29018 |
|
29019 | /**
|
29020 | * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages.
|
29021 | * @function encode
|
29022 | * @memberof google.protobuf.Int32Value
|
29023 | * @static
|
29024 | * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode
|
29025 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
29026 | * @returns {$protobuf.Writer} Writer
|
29027 | */
|
29028 | Int32Value.encode = function encode(message, writer) {
|
29029 | if (!writer)
|
29030 | writer = $Writer.create();
|
29031 | if (message.value != null && Object.hasOwnProperty.call(message, "value"))
|
29032 | writer.uint32(/* id 1, wireType 0 =*/8).int32(message.value);
|
29033 | return writer;
|
29034 | };
|
29035 |
|
29036 | /**
|
29037 | * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages.
|
29038 | * @function encodeDelimited
|
29039 | * @memberof google.protobuf.Int32Value
|
29040 | * @static
|
29041 | * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode
|
29042 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
29043 | * @returns {$protobuf.Writer} Writer
|
29044 | */
|
29045 | Int32Value.encodeDelimited = function encodeDelimited(message, writer) {
|
29046 | return this.encode(message, writer).ldelim();
|
29047 | };
|
29048 |
|
29049 | /**
|
29050 | * Decodes an Int32Value message from the specified reader or buffer.
|
29051 | * @function decode
|
29052 | * @memberof google.protobuf.Int32Value
|
29053 | * @static
|
29054 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
29055 | * @param {number} [length] Message length if known beforehand
|
29056 | * @returns {google.protobuf.Int32Value} Int32Value
|
29057 | * @throws {Error} If the payload is not a reader or valid buffer
|
29058 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
29059 | */
|
29060 | Int32Value.decode = function decode(reader, length) {
|
29061 | if (!(reader instanceof $Reader))
|
29062 | reader = $Reader.create(reader);
|
29063 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int32Value();
|
29064 | while (reader.pos < end) {
|
29065 | var tag = reader.uint32();
|
29066 | switch (tag >>> 3) {
|
29067 | case 1:
|
29068 | message.value = reader.int32();
|
29069 | break;
|
29070 | default:
|
29071 | reader.skipType(tag & 7);
|
29072 | break;
|
29073 | }
|
29074 | }
|
29075 | return message;
|
29076 | };
|
29077 |
|
29078 | /**
|
29079 | * Decodes an Int32Value message from the specified reader or buffer, length delimited.
|
29080 | * @function decodeDelimited
|
29081 | * @memberof google.protobuf.Int32Value
|
29082 | * @static
|
29083 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
29084 | * @returns {google.protobuf.Int32Value} Int32Value
|
29085 | * @throws {Error} If the payload is not a reader or valid buffer
|
29086 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
29087 | */
|
29088 | Int32Value.decodeDelimited = function decodeDelimited(reader) {
|
29089 | if (!(reader instanceof $Reader))
|
29090 | reader = new $Reader(reader);
|
29091 | return this.decode(reader, reader.uint32());
|
29092 | };
|
29093 |
|
29094 | /**
|
29095 | * Verifies an Int32Value message.
|
29096 | * @function verify
|
29097 | * @memberof google.protobuf.Int32Value
|
29098 | * @static
|
29099 | * @param {Object.<string,*>} message Plain object to verify
|
29100 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
29101 | */
|
29102 | Int32Value.verify = function verify(message) {
|
29103 | if (typeof message !== "object" || message === null)
|
29104 | return "object expected";
|
29105 | if (message.value != null && message.hasOwnProperty("value"))
|
29106 | if (!$util.isInteger(message.value))
|
29107 | return "value: integer expected";
|
29108 | return null;
|
29109 | };
|
29110 |
|
29111 | /**
|
29112 | * Creates an Int32Value message from a plain object. Also converts values to their respective internal types.
|
29113 | * @function fromObject
|
29114 | * @memberof google.protobuf.Int32Value
|
29115 | * @static
|
29116 | * @param {Object.<string,*>} object Plain object
|
29117 | * @returns {google.protobuf.Int32Value} Int32Value
|
29118 | */
|
29119 | Int32Value.fromObject = function fromObject(object) {
|
29120 | if (object instanceof $root.google.protobuf.Int32Value)
|
29121 | return object;
|
29122 | var message = new $root.google.protobuf.Int32Value();
|
29123 | if (object.value != null)
|
29124 | message.value = object.value | 0;
|
29125 | return message;
|
29126 | };
|
29127 |
|
29128 | /**
|
29129 | * Creates a plain object from an Int32Value message. Also converts values to other types if specified.
|
29130 | * @function toObject
|
29131 | * @memberof google.protobuf.Int32Value
|
29132 | * @static
|
29133 | * @param {google.protobuf.Int32Value} message Int32Value
|
29134 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
29135 | * @returns {Object.<string,*>} Plain object
|
29136 | */
|
29137 | Int32Value.toObject = function toObject(message, options) {
|
29138 | if (!options)
|
29139 | options = {};
|
29140 | var object = {};
|
29141 | if (options.defaults)
|
29142 | object.value = 0;
|
29143 | if (message.value != null && message.hasOwnProperty("value"))
|
29144 | object.value = message.value;
|
29145 | return object;
|
29146 | };
|
29147 |
|
29148 | /**
|
29149 | * Converts this Int32Value to JSON.
|
29150 | * @function toJSON
|
29151 | * @memberof google.protobuf.Int32Value
|
29152 | * @instance
|
29153 | * @returns {Object.<string,*>} JSON object
|
29154 | */
|
29155 | Int32Value.prototype.toJSON = function toJSON() {
|
29156 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
29157 | };
|
29158 |
|
29159 | return Int32Value;
|
29160 | })();
|
29161 |
|
29162 | protobuf.UInt32Value = (function() {
|
29163 |
|
29164 | /**
|
29165 | * Properties of a UInt32Value.
|
29166 | * @memberof google.protobuf
|
29167 | * @interface IUInt32Value
|
29168 | * @property {number|null} [value] UInt32Value value
|
29169 | */
|
29170 |
|
29171 | /**
|
29172 | * Constructs a new UInt32Value.
|
29173 | * @memberof google.protobuf
|
29174 | * @classdesc Represents a UInt32Value.
|
29175 | * @implements IUInt32Value
|
29176 | * @constructor
|
29177 | * @param {google.protobuf.IUInt32Value=} [properties] Properties to set
|
29178 | */
|
29179 | function UInt32Value(properties) {
|
29180 | if (properties)
|
29181 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
29182 | if (properties[keys[i]] != null)
|
29183 | this[keys[i]] = properties[keys[i]];
|
29184 | }
|
29185 |
|
29186 | /**
|
29187 | * UInt32Value value.
|
29188 | * @member {number} value
|
29189 | * @memberof google.protobuf.UInt32Value
|
29190 | * @instance
|
29191 | */
|
29192 | UInt32Value.prototype.value = 0;
|
29193 |
|
29194 | /**
|
29195 | * Creates a new UInt32Value instance using the specified properties.
|
29196 | * @function create
|
29197 | * @memberof google.protobuf.UInt32Value
|
29198 | * @static
|
29199 | * @param {google.protobuf.IUInt32Value=} [properties] Properties to set
|
29200 | * @returns {google.protobuf.UInt32Value} UInt32Value instance
|
29201 | */
|
29202 | UInt32Value.create = function create(properties) {
|
29203 | return new UInt32Value(properties);
|
29204 | };
|
29205 |
|
29206 | /**
|
29207 | * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages.
|
29208 | * @function encode
|
29209 | * @memberof google.protobuf.UInt32Value
|
29210 | * @static
|
29211 | * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode
|
29212 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
29213 | * @returns {$protobuf.Writer} Writer
|
29214 | */
|
29215 | UInt32Value.encode = function encode(message, writer) {
|
29216 | if (!writer)
|
29217 | writer = $Writer.create();
|
29218 | if (message.value != null && Object.hasOwnProperty.call(message, "value"))
|
29219 | writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.value);
|
29220 | return writer;
|
29221 | };
|
29222 |
|
29223 | /**
|
29224 | * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages.
|
29225 | * @function encodeDelimited
|
29226 | * @memberof google.protobuf.UInt32Value
|
29227 | * @static
|
29228 | * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode
|
29229 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
29230 | * @returns {$protobuf.Writer} Writer
|
29231 | */
|
29232 | UInt32Value.encodeDelimited = function encodeDelimited(message, writer) {
|
29233 | return this.encode(message, writer).ldelim();
|
29234 | };
|
29235 |
|
29236 | /**
|
29237 | * Decodes a UInt32Value message from the specified reader or buffer.
|
29238 | * @function decode
|
29239 | * @memberof google.protobuf.UInt32Value
|
29240 | * @static
|
29241 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
29242 | * @param {number} [length] Message length if known beforehand
|
29243 | * @returns {google.protobuf.UInt32Value} UInt32Value
|
29244 | * @throws {Error} If the payload is not a reader or valid buffer
|
29245 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
29246 | */
|
29247 | UInt32Value.decode = function decode(reader, length) {
|
29248 | if (!(reader instanceof $Reader))
|
29249 | reader = $Reader.create(reader);
|
29250 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt32Value();
|
29251 | while (reader.pos < end) {
|
29252 | var tag = reader.uint32();
|
29253 | switch (tag >>> 3) {
|
29254 | case 1:
|
29255 | message.value = reader.uint32();
|
29256 | break;
|
29257 | default:
|
29258 | reader.skipType(tag & 7);
|
29259 | break;
|
29260 | }
|
29261 | }
|
29262 | return message;
|
29263 | };
|
29264 |
|
29265 | /**
|
29266 | * Decodes a UInt32Value message from the specified reader or buffer, length delimited.
|
29267 | * @function decodeDelimited
|
29268 | * @memberof google.protobuf.UInt32Value
|
29269 | * @static
|
29270 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
29271 | * @returns {google.protobuf.UInt32Value} UInt32Value
|
29272 | * @throws {Error} If the payload is not a reader or valid buffer
|
29273 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
29274 | */
|
29275 | UInt32Value.decodeDelimited = function decodeDelimited(reader) {
|
29276 | if (!(reader instanceof $Reader))
|
29277 | reader = new $Reader(reader);
|
29278 | return this.decode(reader, reader.uint32());
|
29279 | };
|
29280 |
|
29281 | /**
|
29282 | * Verifies a UInt32Value message.
|
29283 | * @function verify
|
29284 | * @memberof google.protobuf.UInt32Value
|
29285 | * @static
|
29286 | * @param {Object.<string,*>} message Plain object to verify
|
29287 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
29288 | */
|
29289 | UInt32Value.verify = function verify(message) {
|
29290 | if (typeof message !== "object" || message === null)
|
29291 | return "object expected";
|
29292 | if (message.value != null && message.hasOwnProperty("value"))
|
29293 | if (!$util.isInteger(message.value))
|
29294 | return "value: integer expected";
|
29295 | return null;
|
29296 | };
|
29297 |
|
29298 | /**
|
29299 | * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types.
|
29300 | * @function fromObject
|
29301 | * @memberof google.protobuf.UInt32Value
|
29302 | * @static
|
29303 | * @param {Object.<string,*>} object Plain object
|
29304 | * @returns {google.protobuf.UInt32Value} UInt32Value
|
29305 | */
|
29306 | UInt32Value.fromObject = function fromObject(object) {
|
29307 | if (object instanceof $root.google.protobuf.UInt32Value)
|
29308 | return object;
|
29309 | var message = new $root.google.protobuf.UInt32Value();
|
29310 | if (object.value != null)
|
29311 | message.value = object.value >>> 0;
|
29312 | return message;
|
29313 | };
|
29314 |
|
29315 | /**
|
29316 | * Creates a plain object from a UInt32Value message. Also converts values to other types if specified.
|
29317 | * @function toObject
|
29318 | * @memberof google.protobuf.UInt32Value
|
29319 | * @static
|
29320 | * @param {google.protobuf.UInt32Value} message UInt32Value
|
29321 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
29322 | * @returns {Object.<string,*>} Plain object
|
29323 | */
|
29324 | UInt32Value.toObject = function toObject(message, options) {
|
29325 | if (!options)
|
29326 | options = {};
|
29327 | var object = {};
|
29328 | if (options.defaults)
|
29329 | object.value = 0;
|
29330 | if (message.value != null && message.hasOwnProperty("value"))
|
29331 | object.value = message.value;
|
29332 | return object;
|
29333 | };
|
29334 |
|
29335 | /**
|
29336 | * Converts this UInt32Value to JSON.
|
29337 | * @function toJSON
|
29338 | * @memberof google.protobuf.UInt32Value
|
29339 | * @instance
|
29340 | * @returns {Object.<string,*>} JSON object
|
29341 | */
|
29342 | UInt32Value.prototype.toJSON = function toJSON() {
|
29343 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
29344 | };
|
29345 |
|
29346 | return UInt32Value;
|
29347 | })();
|
29348 |
|
29349 | protobuf.BoolValue = (function() {
|
29350 |
|
29351 | /**
|
29352 | * Properties of a BoolValue.
|
29353 | * @memberof google.protobuf
|
29354 | * @interface IBoolValue
|
29355 | * @property {boolean|null} [value] BoolValue value
|
29356 | */
|
29357 |
|
29358 | /**
|
29359 | * Constructs a new BoolValue.
|
29360 | * @memberof google.protobuf
|
29361 | * @classdesc Represents a BoolValue.
|
29362 | * @implements IBoolValue
|
29363 | * @constructor
|
29364 | * @param {google.protobuf.IBoolValue=} [properties] Properties to set
|
29365 | */
|
29366 | function BoolValue(properties) {
|
29367 | if (properties)
|
29368 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
29369 | if (properties[keys[i]] != null)
|
29370 | this[keys[i]] = properties[keys[i]];
|
29371 | }
|
29372 |
|
29373 | /**
|
29374 | * BoolValue value.
|
29375 | * @member {boolean} value
|
29376 | * @memberof google.protobuf.BoolValue
|
29377 | * @instance
|
29378 | */
|
29379 | BoolValue.prototype.value = false;
|
29380 |
|
29381 | /**
|
29382 | * Creates a new BoolValue instance using the specified properties.
|
29383 | * @function create
|
29384 | * @memberof google.protobuf.BoolValue
|
29385 | * @static
|
29386 | * @param {google.protobuf.IBoolValue=} [properties] Properties to set
|
29387 | * @returns {google.protobuf.BoolValue} BoolValue instance
|
29388 | */
|
29389 | BoolValue.create = function create(properties) {
|
29390 | return new BoolValue(properties);
|
29391 | };
|
29392 |
|
29393 | /**
|
29394 | * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages.
|
29395 | * @function encode
|
29396 | * @memberof google.protobuf.BoolValue
|
29397 | * @static
|
29398 | * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode
|
29399 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
29400 | * @returns {$protobuf.Writer} Writer
|
29401 | */
|
29402 | BoolValue.encode = function encode(message, writer) {
|
29403 | if (!writer)
|
29404 | writer = $Writer.create();
|
29405 | if (message.value != null && Object.hasOwnProperty.call(message, "value"))
|
29406 | writer.uint32(/* id 1, wireType 0 =*/8).bool(message.value);
|
29407 | return writer;
|
29408 | };
|
29409 |
|
29410 | /**
|
29411 | * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages.
|
29412 | * @function encodeDelimited
|
29413 | * @memberof google.protobuf.BoolValue
|
29414 | * @static
|
29415 | * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode
|
29416 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
29417 | * @returns {$protobuf.Writer} Writer
|
29418 | */
|
29419 | BoolValue.encodeDelimited = function encodeDelimited(message, writer) {
|
29420 | return this.encode(message, writer).ldelim();
|
29421 | };
|
29422 |
|
29423 | /**
|
29424 | * Decodes a BoolValue message from the specified reader or buffer.
|
29425 | * @function decode
|
29426 | * @memberof google.protobuf.BoolValue
|
29427 | * @static
|
29428 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
29429 | * @param {number} [length] Message length if known beforehand
|
29430 | * @returns {google.protobuf.BoolValue} BoolValue
|
29431 | * @throws {Error} If the payload is not a reader or valid buffer
|
29432 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
29433 | */
|
29434 | BoolValue.decode = function decode(reader, length) {
|
29435 | if (!(reader instanceof $Reader))
|
29436 | reader = $Reader.create(reader);
|
29437 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BoolValue();
|
29438 | while (reader.pos < end) {
|
29439 | var tag = reader.uint32();
|
29440 | switch (tag >>> 3) {
|
29441 | case 1:
|
29442 | message.value = reader.bool();
|
29443 | break;
|
29444 | default:
|
29445 | reader.skipType(tag & 7);
|
29446 | break;
|
29447 | }
|
29448 | }
|
29449 | return message;
|
29450 | };
|
29451 |
|
29452 | /**
|
29453 | * Decodes a BoolValue message from the specified reader or buffer, length delimited.
|
29454 | * @function decodeDelimited
|
29455 | * @memberof google.protobuf.BoolValue
|
29456 | * @static
|
29457 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
29458 | * @returns {google.protobuf.BoolValue} BoolValue
|
29459 | * @throws {Error} If the payload is not a reader or valid buffer
|
29460 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
29461 | */
|
29462 | BoolValue.decodeDelimited = function decodeDelimited(reader) {
|
29463 | if (!(reader instanceof $Reader))
|
29464 | reader = new $Reader(reader);
|
29465 | return this.decode(reader, reader.uint32());
|
29466 | };
|
29467 |
|
29468 | /**
|
29469 | * Verifies a BoolValue message.
|
29470 | * @function verify
|
29471 | * @memberof google.protobuf.BoolValue
|
29472 | * @static
|
29473 | * @param {Object.<string,*>} message Plain object to verify
|
29474 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
29475 | */
|
29476 | BoolValue.verify = function verify(message) {
|
29477 | if (typeof message !== "object" || message === null)
|
29478 | return "object expected";
|
29479 | if (message.value != null && message.hasOwnProperty("value"))
|
29480 | if (typeof message.value !== "boolean")
|
29481 | return "value: boolean expected";
|
29482 | return null;
|
29483 | };
|
29484 |
|
29485 | /**
|
29486 | * Creates a BoolValue message from a plain object. Also converts values to their respective internal types.
|
29487 | * @function fromObject
|
29488 | * @memberof google.protobuf.BoolValue
|
29489 | * @static
|
29490 | * @param {Object.<string,*>} object Plain object
|
29491 | * @returns {google.protobuf.BoolValue} BoolValue
|
29492 | */
|
29493 | BoolValue.fromObject = function fromObject(object) {
|
29494 | if (object instanceof $root.google.protobuf.BoolValue)
|
29495 | return object;
|
29496 | var message = new $root.google.protobuf.BoolValue();
|
29497 | if (object.value != null)
|
29498 | message.value = Boolean(object.value);
|
29499 | return message;
|
29500 | };
|
29501 |
|
29502 | /**
|
29503 | * Creates a plain object from a BoolValue message. Also converts values to other types if specified.
|
29504 | * @function toObject
|
29505 | * @memberof google.protobuf.BoolValue
|
29506 | * @static
|
29507 | * @param {google.protobuf.BoolValue} message BoolValue
|
29508 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
29509 | * @returns {Object.<string,*>} Plain object
|
29510 | */
|
29511 | BoolValue.toObject = function toObject(message, options) {
|
29512 | if (!options)
|
29513 | options = {};
|
29514 | var object = {};
|
29515 | if (options.defaults)
|
29516 | object.value = false;
|
29517 | if (message.value != null && message.hasOwnProperty("value"))
|
29518 | object.value = message.value;
|
29519 | return object;
|
29520 | };
|
29521 |
|
29522 | /**
|
29523 | * Converts this BoolValue to JSON.
|
29524 | * @function toJSON
|
29525 | * @memberof google.protobuf.BoolValue
|
29526 | * @instance
|
29527 | * @returns {Object.<string,*>} JSON object
|
29528 | */
|
29529 | BoolValue.prototype.toJSON = function toJSON() {
|
29530 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
29531 | };
|
29532 |
|
29533 | return BoolValue;
|
29534 | })();
|
29535 |
|
29536 | protobuf.StringValue = (function() {
|
29537 |
|
29538 | /**
|
29539 | * Properties of a StringValue.
|
29540 | * @memberof google.protobuf
|
29541 | * @interface IStringValue
|
29542 | * @property {string|null} [value] StringValue value
|
29543 | */
|
29544 |
|
29545 | /**
|
29546 | * Constructs a new StringValue.
|
29547 | * @memberof google.protobuf
|
29548 | * @classdesc Represents a StringValue.
|
29549 | * @implements IStringValue
|
29550 | * @constructor
|
29551 | * @param {google.protobuf.IStringValue=} [properties] Properties to set
|
29552 | */
|
29553 | function StringValue(properties) {
|
29554 | if (properties)
|
29555 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
29556 | if (properties[keys[i]] != null)
|
29557 | this[keys[i]] = properties[keys[i]];
|
29558 | }
|
29559 |
|
29560 | /**
|
29561 | * StringValue value.
|
29562 | * @member {string} value
|
29563 | * @memberof google.protobuf.StringValue
|
29564 | * @instance
|
29565 | */
|
29566 | StringValue.prototype.value = "";
|
29567 |
|
29568 | /**
|
29569 | * Creates a new StringValue instance using the specified properties.
|
29570 | * @function create
|
29571 | * @memberof google.protobuf.StringValue
|
29572 | * @static
|
29573 | * @param {google.protobuf.IStringValue=} [properties] Properties to set
|
29574 | * @returns {google.protobuf.StringValue} StringValue instance
|
29575 | */
|
29576 | StringValue.create = function create(properties) {
|
29577 | return new StringValue(properties);
|
29578 | };
|
29579 |
|
29580 | /**
|
29581 | * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages.
|
29582 | * @function encode
|
29583 | * @memberof google.protobuf.StringValue
|
29584 | * @static
|
29585 | * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode
|
29586 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
29587 | * @returns {$protobuf.Writer} Writer
|
29588 | */
|
29589 | StringValue.encode = function encode(message, writer) {
|
29590 | if (!writer)
|
29591 | writer = $Writer.create();
|
29592 | if (message.value != null && Object.hasOwnProperty.call(message, "value"))
|
29593 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.value);
|
29594 | return writer;
|
29595 | };
|
29596 |
|
29597 | /**
|
29598 | * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages.
|
29599 | * @function encodeDelimited
|
29600 | * @memberof google.protobuf.StringValue
|
29601 | * @static
|
29602 | * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode
|
29603 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
29604 | * @returns {$protobuf.Writer} Writer
|
29605 | */
|
29606 | StringValue.encodeDelimited = function encodeDelimited(message, writer) {
|
29607 | return this.encode(message, writer).ldelim();
|
29608 | };
|
29609 |
|
29610 | /**
|
29611 | * Decodes a StringValue message from the specified reader or buffer.
|
29612 | * @function decode
|
29613 | * @memberof google.protobuf.StringValue
|
29614 | * @static
|
29615 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
29616 | * @param {number} [length] Message length if known beforehand
|
29617 | * @returns {google.protobuf.StringValue} StringValue
|
29618 | * @throws {Error} If the payload is not a reader or valid buffer
|
29619 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
29620 | */
|
29621 | StringValue.decode = function decode(reader, length) {
|
29622 | if (!(reader instanceof $Reader))
|
29623 | reader = $Reader.create(reader);
|
29624 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.StringValue();
|
29625 | while (reader.pos < end) {
|
29626 | var tag = reader.uint32();
|
29627 | switch (tag >>> 3) {
|
29628 | case 1:
|
29629 | message.value = reader.string();
|
29630 | break;
|
29631 | default:
|
29632 | reader.skipType(tag & 7);
|
29633 | break;
|
29634 | }
|
29635 | }
|
29636 | return message;
|
29637 | };
|
29638 |
|
29639 | /**
|
29640 | * Decodes a StringValue message from the specified reader or buffer, length delimited.
|
29641 | * @function decodeDelimited
|
29642 | * @memberof google.protobuf.StringValue
|
29643 | * @static
|
29644 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
29645 | * @returns {google.protobuf.StringValue} StringValue
|
29646 | * @throws {Error} If the payload is not a reader or valid buffer
|
29647 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
29648 | */
|
29649 | StringValue.decodeDelimited = function decodeDelimited(reader) {
|
29650 | if (!(reader instanceof $Reader))
|
29651 | reader = new $Reader(reader);
|
29652 | return this.decode(reader, reader.uint32());
|
29653 | };
|
29654 |
|
29655 | /**
|
29656 | * Verifies a StringValue message.
|
29657 | * @function verify
|
29658 | * @memberof google.protobuf.StringValue
|
29659 | * @static
|
29660 | * @param {Object.<string,*>} message Plain object to verify
|
29661 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
29662 | */
|
29663 | StringValue.verify = function verify(message) {
|
29664 | if (typeof message !== "object" || message === null)
|
29665 | return "object expected";
|
29666 | if (message.value != null && message.hasOwnProperty("value"))
|
29667 | if (!$util.isString(message.value))
|
29668 | return "value: string expected";
|
29669 | return null;
|
29670 | };
|
29671 |
|
29672 | /**
|
29673 | * Creates a StringValue message from a plain object. Also converts values to their respective internal types.
|
29674 | * @function fromObject
|
29675 | * @memberof google.protobuf.StringValue
|
29676 | * @static
|
29677 | * @param {Object.<string,*>} object Plain object
|
29678 | * @returns {google.protobuf.StringValue} StringValue
|
29679 | */
|
29680 | StringValue.fromObject = function fromObject(object) {
|
29681 | if (object instanceof $root.google.protobuf.StringValue)
|
29682 | return object;
|
29683 | var message = new $root.google.protobuf.StringValue();
|
29684 | if (object.value != null)
|
29685 | message.value = String(object.value);
|
29686 | return message;
|
29687 | };
|
29688 |
|
29689 | /**
|
29690 | * Creates a plain object from a StringValue message. Also converts values to other types if specified.
|
29691 | * @function toObject
|
29692 | * @memberof google.protobuf.StringValue
|
29693 | * @static
|
29694 | * @param {google.protobuf.StringValue} message StringValue
|
29695 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
29696 | * @returns {Object.<string,*>} Plain object
|
29697 | */
|
29698 | StringValue.toObject = function toObject(message, options) {
|
29699 | if (!options)
|
29700 | options = {};
|
29701 | var object = {};
|
29702 | if (options.defaults)
|
29703 | object.value = "";
|
29704 | if (message.value != null && message.hasOwnProperty("value"))
|
29705 | object.value = message.value;
|
29706 | return object;
|
29707 | };
|
29708 |
|
29709 | /**
|
29710 | * Converts this StringValue to JSON.
|
29711 | * @function toJSON
|
29712 | * @memberof google.protobuf.StringValue
|
29713 | * @instance
|
29714 | * @returns {Object.<string,*>} JSON object
|
29715 | */
|
29716 | StringValue.prototype.toJSON = function toJSON() {
|
29717 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
29718 | };
|
29719 |
|
29720 | return StringValue;
|
29721 | })();
|
29722 |
|
29723 | protobuf.BytesValue = (function() {
|
29724 |
|
29725 | /**
|
29726 | * Properties of a BytesValue.
|
29727 | * @memberof google.protobuf
|
29728 | * @interface IBytesValue
|
29729 | * @property {Uint8Array|null} [value] BytesValue value
|
29730 | */
|
29731 |
|
29732 | /**
|
29733 | * Constructs a new BytesValue.
|
29734 | * @memberof google.protobuf
|
29735 | * @classdesc Represents a BytesValue.
|
29736 | * @implements IBytesValue
|
29737 | * @constructor
|
29738 | * @param {google.protobuf.IBytesValue=} [properties] Properties to set
|
29739 | */
|
29740 | function BytesValue(properties) {
|
29741 | if (properties)
|
29742 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
29743 | if (properties[keys[i]] != null)
|
29744 | this[keys[i]] = properties[keys[i]];
|
29745 | }
|
29746 |
|
29747 | /**
|
29748 | * BytesValue value.
|
29749 | * @member {Uint8Array} value
|
29750 | * @memberof google.protobuf.BytesValue
|
29751 | * @instance
|
29752 | */
|
29753 | BytesValue.prototype.value = $util.newBuffer([]);
|
29754 |
|
29755 | /**
|
29756 | * Creates a new BytesValue instance using the specified properties.
|
29757 | * @function create
|
29758 | * @memberof google.protobuf.BytesValue
|
29759 | * @static
|
29760 | * @param {google.protobuf.IBytesValue=} [properties] Properties to set
|
29761 | * @returns {google.protobuf.BytesValue} BytesValue instance
|
29762 | */
|
29763 | BytesValue.create = function create(properties) {
|
29764 | return new BytesValue(properties);
|
29765 | };
|
29766 |
|
29767 | /**
|
29768 | * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages.
|
29769 | * @function encode
|
29770 | * @memberof google.protobuf.BytesValue
|
29771 | * @static
|
29772 | * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode
|
29773 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
29774 | * @returns {$protobuf.Writer} Writer
|
29775 | */
|
29776 | BytesValue.encode = function encode(message, writer) {
|
29777 | if (!writer)
|
29778 | writer = $Writer.create();
|
29779 | if (message.value != null && Object.hasOwnProperty.call(message, "value"))
|
29780 | writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.value);
|
29781 | return writer;
|
29782 | };
|
29783 |
|
29784 | /**
|
29785 | * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages.
|
29786 | * @function encodeDelimited
|
29787 | * @memberof google.protobuf.BytesValue
|
29788 | * @static
|
29789 | * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode
|
29790 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
29791 | * @returns {$protobuf.Writer} Writer
|
29792 | */
|
29793 | BytesValue.encodeDelimited = function encodeDelimited(message, writer) {
|
29794 | return this.encode(message, writer).ldelim();
|
29795 | };
|
29796 |
|
29797 | /**
|
29798 | * Decodes a BytesValue message from the specified reader or buffer.
|
29799 | * @function decode
|
29800 | * @memberof google.protobuf.BytesValue
|
29801 | * @static
|
29802 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
29803 | * @param {number} [length] Message length if known beforehand
|
29804 | * @returns {google.protobuf.BytesValue} BytesValue
|
29805 | * @throws {Error} If the payload is not a reader or valid buffer
|
29806 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
29807 | */
|
29808 | BytesValue.decode = function decode(reader, length) {
|
29809 | if (!(reader instanceof $Reader))
|
29810 | reader = $Reader.create(reader);
|
29811 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BytesValue();
|
29812 | while (reader.pos < end) {
|
29813 | var tag = reader.uint32();
|
29814 | switch (tag >>> 3) {
|
29815 | case 1:
|
29816 | message.value = reader.bytes();
|
29817 | break;
|
29818 | default:
|
29819 | reader.skipType(tag & 7);
|
29820 | break;
|
29821 | }
|
29822 | }
|
29823 | return message;
|
29824 | };
|
29825 |
|
29826 | /**
|
29827 | * Decodes a BytesValue message from the specified reader or buffer, length delimited.
|
29828 | * @function decodeDelimited
|
29829 | * @memberof google.protobuf.BytesValue
|
29830 | * @static
|
29831 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
29832 | * @returns {google.protobuf.BytesValue} BytesValue
|
29833 | * @throws {Error} If the payload is not a reader or valid buffer
|
29834 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
29835 | */
|
29836 | BytesValue.decodeDelimited = function decodeDelimited(reader) {
|
29837 | if (!(reader instanceof $Reader))
|
29838 | reader = new $Reader(reader);
|
29839 | return this.decode(reader, reader.uint32());
|
29840 | };
|
29841 |
|
29842 | /**
|
29843 | * Verifies a BytesValue message.
|
29844 | * @function verify
|
29845 | * @memberof google.protobuf.BytesValue
|
29846 | * @static
|
29847 | * @param {Object.<string,*>} message Plain object to verify
|
29848 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
29849 | */
|
29850 | BytesValue.verify = function verify(message) {
|
29851 | if (typeof message !== "object" || message === null)
|
29852 | return "object expected";
|
29853 | if (message.value != null && message.hasOwnProperty("value"))
|
29854 | if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value)))
|
29855 | return "value: buffer expected";
|
29856 | return null;
|
29857 | };
|
29858 |
|
29859 | /**
|
29860 | * Creates a BytesValue message from a plain object. Also converts values to their respective internal types.
|
29861 | * @function fromObject
|
29862 | * @memberof google.protobuf.BytesValue
|
29863 | * @static
|
29864 | * @param {Object.<string,*>} object Plain object
|
29865 | * @returns {google.protobuf.BytesValue} BytesValue
|
29866 | */
|
29867 | BytesValue.fromObject = function fromObject(object) {
|
29868 | if (object instanceof $root.google.protobuf.BytesValue)
|
29869 | return object;
|
29870 | var message = new $root.google.protobuf.BytesValue();
|
29871 | if (object.value != null)
|
29872 | if (typeof object.value === "string")
|
29873 | $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0);
|
29874 | else if (object.value.length)
|
29875 | message.value = object.value;
|
29876 | return message;
|
29877 | };
|
29878 |
|
29879 | /**
|
29880 | * Creates a plain object from a BytesValue message. Also converts values to other types if specified.
|
29881 | * @function toObject
|
29882 | * @memberof google.protobuf.BytesValue
|
29883 | * @static
|
29884 | * @param {google.protobuf.BytesValue} message BytesValue
|
29885 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
29886 | * @returns {Object.<string,*>} Plain object
|
29887 | */
|
29888 | BytesValue.toObject = function toObject(message, options) {
|
29889 | if (!options)
|
29890 | options = {};
|
29891 | var object = {};
|
29892 | if (options.defaults)
|
29893 | if (options.bytes === String)
|
29894 | object.value = "";
|
29895 | else {
|
29896 | object.value = [];
|
29897 | if (options.bytes !== Array)
|
29898 | object.value = $util.newBuffer(object.value);
|
29899 | }
|
29900 | if (message.value != null && message.hasOwnProperty("value"))
|
29901 | 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;
|
29902 | return object;
|
29903 | };
|
29904 |
|
29905 | /**
|
29906 | * Converts this BytesValue to JSON.
|
29907 | * @function toJSON
|
29908 | * @memberof google.protobuf.BytesValue
|
29909 | * @instance
|
29910 | * @returns {Object.<string,*>} JSON object
|
29911 | */
|
29912 | BytesValue.prototype.toJSON = function toJSON() {
|
29913 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
29914 | };
|
29915 |
|
29916 | return BytesValue;
|
29917 | })();
|
29918 |
|
29919 | protobuf.FieldMask = (function() {
|
29920 |
|
29921 | /**
|
29922 | * Properties of a FieldMask.
|
29923 | * @memberof google.protobuf
|
29924 | * @interface IFieldMask
|
29925 | * @property {Array.<string>|null} [paths] FieldMask paths
|
29926 | */
|
29927 |
|
29928 | /**
|
29929 | * Constructs a new FieldMask.
|
29930 | * @memberof google.protobuf
|
29931 | * @classdesc Represents a FieldMask.
|
29932 | * @implements IFieldMask
|
29933 | * @constructor
|
29934 | * @param {google.protobuf.IFieldMask=} [properties] Properties to set
|
29935 | */
|
29936 | function FieldMask(properties) {
|
29937 | this.paths = [];
|
29938 | if (properties)
|
29939 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
29940 | if (properties[keys[i]] != null)
|
29941 | this[keys[i]] = properties[keys[i]];
|
29942 | }
|
29943 |
|
29944 | /**
|
29945 | * FieldMask paths.
|
29946 | * @member {Array.<string>} paths
|
29947 | * @memberof google.protobuf.FieldMask
|
29948 | * @instance
|
29949 | */
|
29950 | FieldMask.prototype.paths = $util.emptyArray;
|
29951 |
|
29952 | /**
|
29953 | * Creates a new FieldMask instance using the specified properties.
|
29954 | * @function create
|
29955 | * @memberof google.protobuf.FieldMask
|
29956 | * @static
|
29957 | * @param {google.protobuf.IFieldMask=} [properties] Properties to set
|
29958 | * @returns {google.protobuf.FieldMask} FieldMask instance
|
29959 | */
|
29960 | FieldMask.create = function create(properties) {
|
29961 | return new FieldMask(properties);
|
29962 | };
|
29963 |
|
29964 | /**
|
29965 | * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages.
|
29966 | * @function encode
|
29967 | * @memberof google.protobuf.FieldMask
|
29968 | * @static
|
29969 | * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode
|
29970 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
29971 | * @returns {$protobuf.Writer} Writer
|
29972 | */
|
29973 | FieldMask.encode = function encode(message, writer) {
|
29974 | if (!writer)
|
29975 | writer = $Writer.create();
|
29976 | if (message.paths != null && message.paths.length)
|
29977 | for (var i = 0; i < message.paths.length; ++i)
|
29978 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]);
|
29979 | return writer;
|
29980 | };
|
29981 |
|
29982 | /**
|
29983 | * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages.
|
29984 | * @function encodeDelimited
|
29985 | * @memberof google.protobuf.FieldMask
|
29986 | * @static
|
29987 | * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode
|
29988 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
29989 | * @returns {$protobuf.Writer} Writer
|
29990 | */
|
29991 | FieldMask.encodeDelimited = function encodeDelimited(message, writer) {
|
29992 | return this.encode(message, writer).ldelim();
|
29993 | };
|
29994 |
|
29995 | /**
|
29996 | * Decodes a FieldMask message from the specified reader or buffer.
|
29997 | * @function decode
|
29998 | * @memberof google.protobuf.FieldMask
|
29999 | * @static
|
30000 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
30001 | * @param {number} [length] Message length if known beforehand
|
30002 | * @returns {google.protobuf.FieldMask} FieldMask
|
30003 | * @throws {Error} If the payload is not a reader or valid buffer
|
30004 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
30005 | */
|
30006 | FieldMask.decode = function decode(reader, length) {
|
30007 | if (!(reader instanceof $Reader))
|
30008 | reader = $Reader.create(reader);
|
30009 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask();
|
30010 | while (reader.pos < end) {
|
30011 | var tag = reader.uint32();
|
30012 | switch (tag >>> 3) {
|
30013 | case 1:
|
30014 | if (!(message.paths && message.paths.length))
|
30015 | message.paths = [];
|
30016 | message.paths.push(reader.string());
|
30017 | break;
|
30018 | default:
|
30019 | reader.skipType(tag & 7);
|
30020 | break;
|
30021 | }
|
30022 | }
|
30023 | return message;
|
30024 | };
|
30025 |
|
30026 | /**
|
30027 | * Decodes a FieldMask message from the specified reader or buffer, length delimited.
|
30028 | * @function decodeDelimited
|
30029 | * @memberof google.protobuf.FieldMask
|
30030 | * @static
|
30031 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
30032 | * @returns {google.protobuf.FieldMask} FieldMask
|
30033 | * @throws {Error} If the payload is not a reader or valid buffer
|
30034 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
30035 | */
|
30036 | FieldMask.decodeDelimited = function decodeDelimited(reader) {
|
30037 | if (!(reader instanceof $Reader))
|
30038 | reader = new $Reader(reader);
|
30039 | return this.decode(reader, reader.uint32());
|
30040 | };
|
30041 |
|
30042 | /**
|
30043 | * Verifies a FieldMask message.
|
30044 | * @function verify
|
30045 | * @memberof google.protobuf.FieldMask
|
30046 | * @static
|
30047 | * @param {Object.<string,*>} message Plain object to verify
|
30048 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
30049 | */
|
30050 | FieldMask.verify = function verify(message) {
|
30051 | if (typeof message !== "object" || message === null)
|
30052 | return "object expected";
|
30053 | if (message.paths != null && message.hasOwnProperty("paths")) {
|
30054 | if (!Array.isArray(message.paths))
|
30055 | return "paths: array expected";
|
30056 | for (var i = 0; i < message.paths.length; ++i)
|
30057 | if (!$util.isString(message.paths[i]))
|
30058 | return "paths: string[] expected";
|
30059 | }
|
30060 | return null;
|
30061 | };
|
30062 |
|
30063 | /**
|
30064 | * Creates a FieldMask message from a plain object. Also converts values to their respective internal types.
|
30065 | * @function fromObject
|
30066 | * @memberof google.protobuf.FieldMask
|
30067 | * @static
|
30068 | * @param {Object.<string,*>} object Plain object
|
30069 | * @returns {google.protobuf.FieldMask} FieldMask
|
30070 | */
|
30071 | FieldMask.fromObject = function fromObject(object) {
|
30072 | if (object instanceof $root.google.protobuf.FieldMask)
|
30073 | return object;
|
30074 | var message = new $root.google.protobuf.FieldMask();
|
30075 | if (object.paths) {
|
30076 | if (!Array.isArray(object.paths))
|
30077 | throw TypeError(".google.protobuf.FieldMask.paths: array expected");
|
30078 | message.paths = [];
|
30079 | for (var i = 0; i < object.paths.length; ++i)
|
30080 | message.paths[i] = String(object.paths[i]);
|
30081 | }
|
30082 | return message;
|
30083 | };
|
30084 |
|
30085 | /**
|
30086 | * Creates a plain object from a FieldMask message. Also converts values to other types if specified.
|
30087 | * @function toObject
|
30088 | * @memberof google.protobuf.FieldMask
|
30089 | * @static
|
30090 | * @param {google.protobuf.FieldMask} message FieldMask
|
30091 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
30092 | * @returns {Object.<string,*>} Plain object
|
30093 | */
|
30094 | FieldMask.toObject = function toObject(message, options) {
|
30095 | if (!options)
|
30096 | options = {};
|
30097 | var object = {};
|
30098 | if (options.arrays || options.defaults)
|
30099 | object.paths = [];
|
30100 | if (message.paths && message.paths.length) {
|
30101 | object.paths = [];
|
30102 | for (var j = 0; j < message.paths.length; ++j)
|
30103 | object.paths[j] = message.paths[j];
|
30104 | }
|
30105 | return object;
|
30106 | };
|
30107 |
|
30108 | /**
|
30109 | * Converts this FieldMask to JSON.
|
30110 | * @function toJSON
|
30111 | * @memberof google.protobuf.FieldMask
|
30112 | * @instance
|
30113 | * @returns {Object.<string,*>} JSON object
|
30114 | */
|
30115 | FieldMask.prototype.toJSON = function toJSON() {
|
30116 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
30117 | };
|
30118 |
|
30119 | return FieldMask;
|
30120 | })();
|
30121 |
|
30122 | return protobuf;
|
30123 | })();
|
30124 |
|
30125 | google.longrunning = (function() {
|
30126 |
|
30127 | /**
|
30128 | * Namespace longrunning.
|
30129 | * @memberof google
|
30130 | * @namespace
|
30131 | */
|
30132 | var longrunning = {};
|
30133 |
|
30134 | longrunning.Operations = (function() {
|
30135 |
|
30136 | /**
|
30137 | * Constructs a new Operations service.
|
30138 | * @memberof google.longrunning
|
30139 | * @classdesc Represents an Operations
|
30140 | * @extends $protobuf.rpc.Service
|
30141 | * @constructor
|
30142 | * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
|
30143 | * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
|
30144 | * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
|
30145 | */
|
30146 | function Operations(rpcImpl, requestDelimited, responseDelimited) {
|
30147 | $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);
|
30148 | }
|
30149 |
|
30150 | (Operations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Operations;
|
30151 |
|
30152 | /**
|
30153 | * Creates new Operations service using the specified rpc implementation.
|
30154 | * @function create
|
30155 | * @memberof google.longrunning.Operations
|
30156 | * @static
|
30157 | * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
|
30158 | * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
|
30159 | * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
|
30160 | * @returns {Operations} RPC service. Useful where requests and/or responses are streamed.
|
30161 | */
|
30162 | Operations.create = function create(rpcImpl, requestDelimited, responseDelimited) {
|
30163 | return new this(rpcImpl, requestDelimited, responseDelimited);
|
30164 | };
|
30165 |
|
30166 | /**
|
30167 | * Callback as used by {@link google.longrunning.Operations#listOperations}.
|
30168 | * @memberof google.longrunning.Operations
|
30169 | * @typedef ListOperationsCallback
|
30170 | * @type {function}
|
30171 | * @param {Error|null} error Error, if any
|
30172 | * @param {google.longrunning.ListOperationsResponse} [response] ListOperationsResponse
|
30173 | */
|
30174 |
|
30175 | /**
|
30176 | * Calls ListOperations.
|
30177 | * @function listOperations
|
30178 | * @memberof google.longrunning.Operations
|
30179 | * @instance
|
30180 | * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object
|
30181 | * @param {google.longrunning.Operations.ListOperationsCallback} callback Node-style callback called with the error, if any, and ListOperationsResponse
|
30182 | * @returns {undefined}
|
30183 | * @variation 1
|
30184 | */
|
30185 | Object.defineProperty(Operations.prototype.listOperations = function listOperations(request, callback) {
|
30186 | return this.rpcCall(listOperations, $root.google.longrunning.ListOperationsRequest, $root.google.longrunning.ListOperationsResponse, request, callback);
|
30187 | }, "name", { value: "ListOperations" });
|
30188 |
|
30189 | /**
|
30190 | * Calls ListOperations.
|
30191 | * @function listOperations
|
30192 | * @memberof google.longrunning.Operations
|
30193 | * @instance
|
30194 | * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object
|
30195 | * @returns {Promise<google.longrunning.ListOperationsResponse>} Promise
|
30196 | * @variation 2
|
30197 | */
|
30198 |
|
30199 | /**
|
30200 | * Callback as used by {@link google.longrunning.Operations#getOperation}.
|
30201 | * @memberof google.longrunning.Operations
|
30202 | * @typedef GetOperationCallback
|
30203 | * @type {function}
|
30204 | * @param {Error|null} error Error, if any
|
30205 | * @param {google.longrunning.Operation} [response] Operation
|
30206 | */
|
30207 |
|
30208 | /**
|
30209 | * Calls GetOperation.
|
30210 | * @function getOperation
|
30211 | * @memberof google.longrunning.Operations
|
30212 | * @instance
|
30213 | * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object
|
30214 | * @param {google.longrunning.Operations.GetOperationCallback} callback Node-style callback called with the error, if any, and Operation
|
30215 | * @returns {undefined}
|
30216 | * @variation 1
|
30217 | */
|
30218 | Object.defineProperty(Operations.prototype.getOperation = function getOperation(request, callback) {
|
30219 | return this.rpcCall(getOperation, $root.google.longrunning.GetOperationRequest, $root.google.longrunning.Operation, request, callback);
|
30220 | }, "name", { value: "GetOperation" });
|
30221 |
|
30222 | /**
|
30223 | * Calls GetOperation.
|
30224 | * @function getOperation
|
30225 | * @memberof google.longrunning.Operations
|
30226 | * @instance
|
30227 | * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object
|
30228 | * @returns {Promise<google.longrunning.Operation>} Promise
|
30229 | * @variation 2
|
30230 | */
|
30231 |
|
30232 | /**
|
30233 | * Callback as used by {@link google.longrunning.Operations#deleteOperation}.
|
30234 | * @memberof google.longrunning.Operations
|
30235 | * @typedef DeleteOperationCallback
|
30236 | * @type {function}
|
30237 | * @param {Error|null} error Error, if any
|
30238 | * @param {google.protobuf.Empty} [response] Empty
|
30239 | */
|
30240 |
|
30241 | /**
|
30242 | * Calls DeleteOperation.
|
30243 | * @function deleteOperation
|
30244 | * @memberof google.longrunning.Operations
|
30245 | * @instance
|
30246 | * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object
|
30247 | * @param {google.longrunning.Operations.DeleteOperationCallback} callback Node-style callback called with the error, if any, and Empty
|
30248 | * @returns {undefined}
|
30249 | * @variation 1
|
30250 | */
|
30251 | Object.defineProperty(Operations.prototype.deleteOperation = function deleteOperation(request, callback) {
|
30252 | return this.rpcCall(deleteOperation, $root.google.longrunning.DeleteOperationRequest, $root.google.protobuf.Empty, request, callback);
|
30253 | }, "name", { value: "DeleteOperation" });
|
30254 |
|
30255 | /**
|
30256 | * Calls DeleteOperation.
|
30257 | * @function deleteOperation
|
30258 | * @memberof google.longrunning.Operations
|
30259 | * @instance
|
30260 | * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object
|
30261 | * @returns {Promise<google.protobuf.Empty>} Promise
|
30262 | * @variation 2
|
30263 | */
|
30264 |
|
30265 | /**
|
30266 | * Callback as used by {@link google.longrunning.Operations#cancelOperation}.
|
30267 | * @memberof google.longrunning.Operations
|
30268 | * @typedef CancelOperationCallback
|
30269 | * @type {function}
|
30270 | * @param {Error|null} error Error, if any
|
30271 | * @param {google.protobuf.Empty} [response] Empty
|
30272 | */
|
30273 |
|
30274 | /**
|
30275 | * Calls CancelOperation.
|
30276 | * @function cancelOperation
|
30277 | * @memberof google.longrunning.Operations
|
30278 | * @instance
|
30279 | * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object
|
30280 | * @param {google.longrunning.Operations.CancelOperationCallback} callback Node-style callback called with the error, if any, and Empty
|
30281 | * @returns {undefined}
|
30282 | * @variation 1
|
30283 | */
|
30284 | Object.defineProperty(Operations.prototype.cancelOperation = function cancelOperation(request, callback) {
|
30285 | return this.rpcCall(cancelOperation, $root.google.longrunning.CancelOperationRequest, $root.google.protobuf.Empty, request, callback);
|
30286 | }, "name", { value: "CancelOperation" });
|
30287 |
|
30288 | /**
|
30289 | * Calls CancelOperation.
|
30290 | * @function cancelOperation
|
30291 | * @memberof google.longrunning.Operations
|
30292 | * @instance
|
30293 | * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object
|
30294 | * @returns {Promise<google.protobuf.Empty>} Promise
|
30295 | * @variation 2
|
30296 | */
|
30297 |
|
30298 | /**
|
30299 | * Callback as used by {@link google.longrunning.Operations#waitOperation}.
|
30300 | * @memberof google.longrunning.Operations
|
30301 | * @typedef WaitOperationCallback
|
30302 | * @type {function}
|
30303 | * @param {Error|null} error Error, if any
|
30304 | * @param {google.longrunning.Operation} [response] Operation
|
30305 | */
|
30306 |
|
30307 | /**
|
30308 | * Calls WaitOperation.
|
30309 | * @function waitOperation
|
30310 | * @memberof google.longrunning.Operations
|
30311 | * @instance
|
30312 | * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object
|
30313 | * @param {google.longrunning.Operations.WaitOperationCallback} callback Node-style callback called with the error, if any, and Operation
|
30314 | * @returns {undefined}
|
30315 | * @variation 1
|
30316 | */
|
30317 | Object.defineProperty(Operations.prototype.waitOperation = function waitOperation(request, callback) {
|
30318 | return this.rpcCall(waitOperation, $root.google.longrunning.WaitOperationRequest, $root.google.longrunning.Operation, request, callback);
|
30319 | }, "name", { value: "WaitOperation" });
|
30320 |
|
30321 | /**
|
30322 | * Calls WaitOperation.
|
30323 | * @function waitOperation
|
30324 | * @memberof google.longrunning.Operations
|
30325 | * @instance
|
30326 | * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object
|
30327 | * @returns {Promise<google.longrunning.Operation>} Promise
|
30328 | * @variation 2
|
30329 | */
|
30330 |
|
30331 | return Operations;
|
30332 | })();
|
30333 |
|
30334 | longrunning.Operation = (function() {
|
30335 |
|
30336 | /**
|
30337 | * Properties of an Operation.
|
30338 | * @memberof google.longrunning
|
30339 | * @interface IOperation
|
30340 | * @property {string|null} [name] Operation name
|
30341 | * @property {google.protobuf.IAny|null} [metadata] Operation metadata
|
30342 | * @property {boolean|null} [done] Operation done
|
30343 | * @property {google.rpc.IStatus|null} [error] Operation error
|
30344 | * @property {google.protobuf.IAny|null} [response] Operation response
|
30345 | */
|
30346 |
|
30347 | /**
|
30348 | * Constructs a new Operation.
|
30349 | * @memberof google.longrunning
|
30350 | * @classdesc Represents an Operation.
|
30351 | * @implements IOperation
|
30352 | * @constructor
|
30353 | * @param {google.longrunning.IOperation=} [properties] Properties to set
|
30354 | */
|
30355 | function Operation(properties) {
|
30356 | if (properties)
|
30357 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
30358 | if (properties[keys[i]] != null)
|
30359 | this[keys[i]] = properties[keys[i]];
|
30360 | }
|
30361 |
|
30362 | /**
|
30363 | * Operation name.
|
30364 | * @member {string} name
|
30365 | * @memberof google.longrunning.Operation
|
30366 | * @instance
|
30367 | */
|
30368 | Operation.prototype.name = "";
|
30369 |
|
30370 | /**
|
30371 | * Operation metadata.
|
30372 | * @member {google.protobuf.IAny|null|undefined} metadata
|
30373 | * @memberof google.longrunning.Operation
|
30374 | * @instance
|
30375 | */
|
30376 | Operation.prototype.metadata = null;
|
30377 |
|
30378 | /**
|
30379 | * Operation done.
|
30380 | * @member {boolean} done
|
30381 | * @memberof google.longrunning.Operation
|
30382 | * @instance
|
30383 | */
|
30384 | Operation.prototype.done = false;
|
30385 |
|
30386 | /**
|
30387 | * Operation error.
|
30388 | * @member {google.rpc.IStatus|null|undefined} error
|
30389 | * @memberof google.longrunning.Operation
|
30390 | * @instance
|
30391 | */
|
30392 | Operation.prototype.error = null;
|
30393 |
|
30394 | /**
|
30395 | * Operation response.
|
30396 | * @member {google.protobuf.IAny|null|undefined} response
|
30397 | * @memberof google.longrunning.Operation
|
30398 | * @instance
|
30399 | */
|
30400 | Operation.prototype.response = null;
|
30401 |
|
30402 | // OneOf field names bound to virtual getters and setters
|
30403 | var $oneOfFields;
|
30404 |
|
30405 | /**
|
30406 | * Operation result.
|
30407 | * @member {"error"|"response"|undefined} result
|
30408 | * @memberof google.longrunning.Operation
|
30409 | * @instance
|
30410 | */
|
30411 | Object.defineProperty(Operation.prototype, "result", {
|
30412 | get: $util.oneOfGetter($oneOfFields = ["error", "response"]),
|
30413 | set: $util.oneOfSetter($oneOfFields)
|
30414 | });
|
30415 |
|
30416 | /**
|
30417 | * Creates a new Operation instance using the specified properties.
|
30418 | * @function create
|
30419 | * @memberof google.longrunning.Operation
|
30420 | * @static
|
30421 | * @param {google.longrunning.IOperation=} [properties] Properties to set
|
30422 | * @returns {google.longrunning.Operation} Operation instance
|
30423 | */
|
30424 | Operation.create = function create(properties) {
|
30425 | return new Operation(properties);
|
30426 | };
|
30427 |
|
30428 | /**
|
30429 | * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages.
|
30430 | * @function encode
|
30431 | * @memberof google.longrunning.Operation
|
30432 | * @static
|
30433 | * @param {google.longrunning.IOperation} message Operation message or plain object to encode
|
30434 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
30435 | * @returns {$protobuf.Writer} Writer
|
30436 | */
|
30437 | Operation.encode = function encode(message, writer) {
|
30438 | if (!writer)
|
30439 | writer = $Writer.create();
|
30440 | if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
30441 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
|
30442 | if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata"))
|
30443 | $root.google.protobuf.Any.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
30444 | if (message.done != null && Object.hasOwnProperty.call(message, "done"))
|
30445 | writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done);
|
30446 | if (message.error != null && Object.hasOwnProperty.call(message, "error"))
|
30447 | $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
|
30448 | if (message.response != null && Object.hasOwnProperty.call(message, "response"))
|
30449 | $root.google.protobuf.Any.encode(message.response, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
|
30450 | return writer;
|
30451 | };
|
30452 |
|
30453 | /**
|
30454 | * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages.
|
30455 | * @function encodeDelimited
|
30456 | * @memberof google.longrunning.Operation
|
30457 | * @static
|
30458 | * @param {google.longrunning.IOperation} message Operation message or plain object to encode
|
30459 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
30460 | * @returns {$protobuf.Writer} Writer
|
30461 | */
|
30462 | Operation.encodeDelimited = function encodeDelimited(message, writer) {
|
30463 | return this.encode(message, writer).ldelim();
|
30464 | };
|
30465 |
|
30466 | /**
|
30467 | * Decodes an Operation message from the specified reader or buffer.
|
30468 | * @function decode
|
30469 | * @memberof google.longrunning.Operation
|
30470 | * @static
|
30471 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
30472 | * @param {number} [length] Message length if known beforehand
|
30473 | * @returns {google.longrunning.Operation} Operation
|
30474 | * @throws {Error} If the payload is not a reader or valid buffer
|
30475 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
30476 | */
|
30477 | Operation.decode = function decode(reader, length) {
|
30478 | if (!(reader instanceof $Reader))
|
30479 | reader = $Reader.create(reader);
|
30480 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.Operation();
|
30481 | while (reader.pos < end) {
|
30482 | var tag = reader.uint32();
|
30483 | switch (tag >>> 3) {
|
30484 | case 1:
|
30485 | message.name = reader.string();
|
30486 | break;
|
30487 | case 2:
|
30488 | message.metadata = $root.google.protobuf.Any.decode(reader, reader.uint32());
|
30489 | break;
|
30490 | case 3:
|
30491 | message.done = reader.bool();
|
30492 | break;
|
30493 | case 4:
|
30494 | message.error = $root.google.rpc.Status.decode(reader, reader.uint32());
|
30495 | break;
|
30496 | case 5:
|
30497 | message.response = $root.google.protobuf.Any.decode(reader, reader.uint32());
|
30498 | break;
|
30499 | default:
|
30500 | reader.skipType(tag & 7);
|
30501 | break;
|
30502 | }
|
30503 | }
|
30504 | return message;
|
30505 | };
|
30506 |
|
30507 | /**
|
30508 | * Decodes an Operation message from the specified reader or buffer, length delimited.
|
30509 | * @function decodeDelimited
|
30510 | * @memberof google.longrunning.Operation
|
30511 | * @static
|
30512 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
30513 | * @returns {google.longrunning.Operation} Operation
|
30514 | * @throws {Error} If the payload is not a reader or valid buffer
|
30515 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
30516 | */
|
30517 | Operation.decodeDelimited = function decodeDelimited(reader) {
|
30518 | if (!(reader instanceof $Reader))
|
30519 | reader = new $Reader(reader);
|
30520 | return this.decode(reader, reader.uint32());
|
30521 | };
|
30522 |
|
30523 | /**
|
30524 | * Verifies an Operation message.
|
30525 | * @function verify
|
30526 | * @memberof google.longrunning.Operation
|
30527 | * @static
|
30528 | * @param {Object.<string,*>} message Plain object to verify
|
30529 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
30530 | */
|
30531 | Operation.verify = function verify(message) {
|
30532 | if (typeof message !== "object" || message === null)
|
30533 | return "object expected";
|
30534 | var properties = {};
|
30535 | if (message.name != null && message.hasOwnProperty("name"))
|
30536 | if (!$util.isString(message.name))
|
30537 | return "name: string expected";
|
30538 | if (message.metadata != null && message.hasOwnProperty("metadata")) {
|
30539 | var error = $root.google.protobuf.Any.verify(message.metadata);
|
30540 | if (error)
|
30541 | return "metadata." + error;
|
30542 | }
|
30543 | if (message.done != null && message.hasOwnProperty("done"))
|
30544 | if (typeof message.done !== "boolean")
|
30545 | return "done: boolean expected";
|
30546 | if (message.error != null && message.hasOwnProperty("error")) {
|
30547 | properties.result = 1;
|
30548 | {
|
30549 | var error = $root.google.rpc.Status.verify(message.error);
|
30550 | if (error)
|
30551 | return "error." + error;
|
30552 | }
|
30553 | }
|
30554 | if (message.response != null && message.hasOwnProperty("response")) {
|
30555 | if (properties.result === 1)
|
30556 | return "result: multiple values";
|
30557 | properties.result = 1;
|
30558 | {
|
30559 | var error = $root.google.protobuf.Any.verify(message.response);
|
30560 | if (error)
|
30561 | return "response." + error;
|
30562 | }
|
30563 | }
|
30564 | return null;
|
30565 | };
|
30566 |
|
30567 | /**
|
30568 | * Creates an Operation message from a plain object. Also converts values to their respective internal types.
|
30569 | * @function fromObject
|
30570 | * @memberof google.longrunning.Operation
|
30571 | * @static
|
30572 | * @param {Object.<string,*>} object Plain object
|
30573 | * @returns {google.longrunning.Operation} Operation
|
30574 | */
|
30575 | Operation.fromObject = function fromObject(object) {
|
30576 | if (object instanceof $root.google.longrunning.Operation)
|
30577 | return object;
|
30578 | var message = new $root.google.longrunning.Operation();
|
30579 | if (object.name != null)
|
30580 | message.name = String(object.name);
|
30581 | if (object.metadata != null) {
|
30582 | if (typeof object.metadata !== "object")
|
30583 | throw TypeError(".google.longrunning.Operation.metadata: object expected");
|
30584 | message.metadata = $root.google.protobuf.Any.fromObject(object.metadata);
|
30585 | }
|
30586 | if (object.done != null)
|
30587 | message.done = Boolean(object.done);
|
30588 | if (object.error != null) {
|
30589 | if (typeof object.error !== "object")
|
30590 | throw TypeError(".google.longrunning.Operation.error: object expected");
|
30591 | message.error = $root.google.rpc.Status.fromObject(object.error);
|
30592 | }
|
30593 | if (object.response != null) {
|
30594 | if (typeof object.response !== "object")
|
30595 | throw TypeError(".google.longrunning.Operation.response: object expected");
|
30596 | message.response = $root.google.protobuf.Any.fromObject(object.response);
|
30597 | }
|
30598 | return message;
|
30599 | };
|
30600 |
|
30601 | /**
|
30602 | * Creates a plain object from an Operation message. Also converts values to other types if specified.
|
30603 | * @function toObject
|
30604 | * @memberof google.longrunning.Operation
|
30605 | * @static
|
30606 | * @param {google.longrunning.Operation} message Operation
|
30607 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
30608 | * @returns {Object.<string,*>} Plain object
|
30609 | */
|
30610 | Operation.toObject = function toObject(message, options) {
|
30611 | if (!options)
|
30612 | options = {};
|
30613 | var object = {};
|
30614 | if (options.defaults) {
|
30615 | object.name = "";
|
30616 | object.metadata = null;
|
30617 | object.done = false;
|
30618 | }
|
30619 | if (message.name != null && message.hasOwnProperty("name"))
|
30620 | object.name = message.name;
|
30621 | if (message.metadata != null && message.hasOwnProperty("metadata"))
|
30622 | object.metadata = $root.google.protobuf.Any.toObject(message.metadata, options);
|
30623 | if (message.done != null && message.hasOwnProperty("done"))
|
30624 | object.done = message.done;
|
30625 | if (message.error != null && message.hasOwnProperty("error")) {
|
30626 | object.error = $root.google.rpc.Status.toObject(message.error, options);
|
30627 | if (options.oneofs)
|
30628 | object.result = "error";
|
30629 | }
|
30630 | if (message.response != null && message.hasOwnProperty("response")) {
|
30631 | object.response = $root.google.protobuf.Any.toObject(message.response, options);
|
30632 | if (options.oneofs)
|
30633 | object.result = "response";
|
30634 | }
|
30635 | return object;
|
30636 | };
|
30637 |
|
30638 | /**
|
30639 | * Converts this Operation to JSON.
|
30640 | * @function toJSON
|
30641 | * @memberof google.longrunning.Operation
|
30642 | * @instance
|
30643 | * @returns {Object.<string,*>} JSON object
|
30644 | */
|
30645 | Operation.prototype.toJSON = function toJSON() {
|
30646 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
30647 | };
|
30648 |
|
30649 | return Operation;
|
30650 | })();
|
30651 |
|
30652 | longrunning.GetOperationRequest = (function() {
|
30653 |
|
30654 | /**
|
30655 | * Properties of a GetOperationRequest.
|
30656 | * @memberof google.longrunning
|
30657 | * @interface IGetOperationRequest
|
30658 | * @property {string|null} [name] GetOperationRequest name
|
30659 | */
|
30660 |
|
30661 | /**
|
30662 | * Constructs a new GetOperationRequest.
|
30663 | * @memberof google.longrunning
|
30664 | * @classdesc Represents a GetOperationRequest.
|
30665 | * @implements IGetOperationRequest
|
30666 | * @constructor
|
30667 | * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set
|
30668 | */
|
30669 | function GetOperationRequest(properties) {
|
30670 | if (properties)
|
30671 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
30672 | if (properties[keys[i]] != null)
|
30673 | this[keys[i]] = properties[keys[i]];
|
30674 | }
|
30675 |
|
30676 | /**
|
30677 | * GetOperationRequest name.
|
30678 | * @member {string} name
|
30679 | * @memberof google.longrunning.GetOperationRequest
|
30680 | * @instance
|
30681 | */
|
30682 | GetOperationRequest.prototype.name = "";
|
30683 |
|
30684 | /**
|
30685 | * Creates a new GetOperationRequest instance using the specified properties.
|
30686 | * @function create
|
30687 | * @memberof google.longrunning.GetOperationRequest
|
30688 | * @static
|
30689 | * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set
|
30690 | * @returns {google.longrunning.GetOperationRequest} GetOperationRequest instance
|
30691 | */
|
30692 | GetOperationRequest.create = function create(properties) {
|
30693 | return new GetOperationRequest(properties);
|
30694 | };
|
30695 |
|
30696 | /**
|
30697 | * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages.
|
30698 | * @function encode
|
30699 | * @memberof google.longrunning.GetOperationRequest
|
30700 | * @static
|
30701 | * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode
|
30702 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
30703 | * @returns {$protobuf.Writer} Writer
|
30704 | */
|
30705 | GetOperationRequest.encode = function encode(message, writer) {
|
30706 | if (!writer)
|
30707 | writer = $Writer.create();
|
30708 | if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
30709 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
|
30710 | return writer;
|
30711 | };
|
30712 |
|
30713 | /**
|
30714 | * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages.
|
30715 | * @function encodeDelimited
|
30716 | * @memberof google.longrunning.GetOperationRequest
|
30717 | * @static
|
30718 | * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode
|
30719 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
30720 | * @returns {$protobuf.Writer} Writer
|
30721 | */
|
30722 | GetOperationRequest.encodeDelimited = function encodeDelimited(message, writer) {
|
30723 | return this.encode(message, writer).ldelim();
|
30724 | };
|
30725 |
|
30726 | /**
|
30727 | * Decodes a GetOperationRequest message from the specified reader or buffer.
|
30728 | * @function decode
|
30729 | * @memberof google.longrunning.GetOperationRequest
|
30730 | * @static
|
30731 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
30732 | * @param {number} [length] Message length if known beforehand
|
30733 | * @returns {google.longrunning.GetOperationRequest} GetOperationRequest
|
30734 | * @throws {Error} If the payload is not a reader or valid buffer
|
30735 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
30736 | */
|
30737 | GetOperationRequest.decode = function decode(reader, length) {
|
30738 | if (!(reader instanceof $Reader))
|
30739 | reader = $Reader.create(reader);
|
30740 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.GetOperationRequest();
|
30741 | while (reader.pos < end) {
|
30742 | var tag = reader.uint32();
|
30743 | switch (tag >>> 3) {
|
30744 | case 1:
|
30745 | message.name = reader.string();
|
30746 | break;
|
30747 | default:
|
30748 | reader.skipType(tag & 7);
|
30749 | break;
|
30750 | }
|
30751 | }
|
30752 | return message;
|
30753 | };
|
30754 |
|
30755 | /**
|
30756 | * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited.
|
30757 | * @function decodeDelimited
|
30758 | * @memberof google.longrunning.GetOperationRequest
|
30759 | * @static
|
30760 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
30761 | * @returns {google.longrunning.GetOperationRequest} GetOperationRequest
|
30762 | * @throws {Error} If the payload is not a reader or valid buffer
|
30763 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
30764 | */
|
30765 | GetOperationRequest.decodeDelimited = function decodeDelimited(reader) {
|
30766 | if (!(reader instanceof $Reader))
|
30767 | reader = new $Reader(reader);
|
30768 | return this.decode(reader, reader.uint32());
|
30769 | };
|
30770 |
|
30771 | /**
|
30772 | * Verifies a GetOperationRequest message.
|
30773 | * @function verify
|
30774 | * @memberof google.longrunning.GetOperationRequest
|
30775 | * @static
|
30776 | * @param {Object.<string,*>} message Plain object to verify
|
30777 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
30778 | */
|
30779 | GetOperationRequest.verify = function verify(message) {
|
30780 | if (typeof message !== "object" || message === null)
|
30781 | return "object expected";
|
30782 | if (message.name != null && message.hasOwnProperty("name"))
|
30783 | if (!$util.isString(message.name))
|
30784 | return "name: string expected";
|
30785 | return null;
|
30786 | };
|
30787 |
|
30788 | /**
|
30789 | * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types.
|
30790 | * @function fromObject
|
30791 | * @memberof google.longrunning.GetOperationRequest
|
30792 | * @static
|
30793 | * @param {Object.<string,*>} object Plain object
|
30794 | * @returns {google.longrunning.GetOperationRequest} GetOperationRequest
|
30795 | */
|
30796 | GetOperationRequest.fromObject = function fromObject(object) {
|
30797 | if (object instanceof $root.google.longrunning.GetOperationRequest)
|
30798 | return object;
|
30799 | var message = new $root.google.longrunning.GetOperationRequest();
|
30800 | if (object.name != null)
|
30801 | message.name = String(object.name);
|
30802 | return message;
|
30803 | };
|
30804 |
|
30805 | /**
|
30806 | * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified.
|
30807 | * @function toObject
|
30808 | * @memberof google.longrunning.GetOperationRequest
|
30809 | * @static
|
30810 | * @param {google.longrunning.GetOperationRequest} message GetOperationRequest
|
30811 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
30812 | * @returns {Object.<string,*>} Plain object
|
30813 | */
|
30814 | GetOperationRequest.toObject = function toObject(message, options) {
|
30815 | if (!options)
|
30816 | options = {};
|
30817 | var object = {};
|
30818 | if (options.defaults)
|
30819 | object.name = "";
|
30820 | if (message.name != null && message.hasOwnProperty("name"))
|
30821 | object.name = message.name;
|
30822 | return object;
|
30823 | };
|
30824 |
|
30825 | /**
|
30826 | * Converts this GetOperationRequest to JSON.
|
30827 | * @function toJSON
|
30828 | * @memberof google.longrunning.GetOperationRequest
|
30829 | * @instance
|
30830 | * @returns {Object.<string,*>} JSON object
|
30831 | */
|
30832 | GetOperationRequest.prototype.toJSON = function toJSON() {
|
30833 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
30834 | };
|
30835 |
|
30836 | return GetOperationRequest;
|
30837 | })();
|
30838 |
|
30839 | longrunning.ListOperationsRequest = (function() {
|
30840 |
|
30841 | /**
|
30842 | * Properties of a ListOperationsRequest.
|
30843 | * @memberof google.longrunning
|
30844 | * @interface IListOperationsRequest
|
30845 | * @property {string|null} [name] ListOperationsRequest name
|
30846 | * @property {string|null} [filter] ListOperationsRequest filter
|
30847 | * @property {number|null} [pageSize] ListOperationsRequest pageSize
|
30848 | * @property {string|null} [pageToken] ListOperationsRequest pageToken
|
30849 | */
|
30850 |
|
30851 | /**
|
30852 | * Constructs a new ListOperationsRequest.
|
30853 | * @memberof google.longrunning
|
30854 | * @classdesc Represents a ListOperationsRequest.
|
30855 | * @implements IListOperationsRequest
|
30856 | * @constructor
|
30857 | * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set
|
30858 | */
|
30859 | function ListOperationsRequest(properties) {
|
30860 | if (properties)
|
30861 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
30862 | if (properties[keys[i]] != null)
|
30863 | this[keys[i]] = properties[keys[i]];
|
30864 | }
|
30865 |
|
30866 | /**
|
30867 | * ListOperationsRequest name.
|
30868 | * @member {string} name
|
30869 | * @memberof google.longrunning.ListOperationsRequest
|
30870 | * @instance
|
30871 | */
|
30872 | ListOperationsRequest.prototype.name = "";
|
30873 |
|
30874 | /**
|
30875 | * ListOperationsRequest filter.
|
30876 | * @member {string} filter
|
30877 | * @memberof google.longrunning.ListOperationsRequest
|
30878 | * @instance
|
30879 | */
|
30880 | ListOperationsRequest.prototype.filter = "";
|
30881 |
|
30882 | /**
|
30883 | * ListOperationsRequest pageSize.
|
30884 | * @member {number} pageSize
|
30885 | * @memberof google.longrunning.ListOperationsRequest
|
30886 | * @instance
|
30887 | */
|
30888 | ListOperationsRequest.prototype.pageSize = 0;
|
30889 |
|
30890 | /**
|
30891 | * ListOperationsRequest pageToken.
|
30892 | * @member {string} pageToken
|
30893 | * @memberof google.longrunning.ListOperationsRequest
|
30894 | * @instance
|
30895 | */
|
30896 | ListOperationsRequest.prototype.pageToken = "";
|
30897 |
|
30898 | /**
|
30899 | * Creates a new ListOperationsRequest instance using the specified properties.
|
30900 | * @function create
|
30901 | * @memberof google.longrunning.ListOperationsRequest
|
30902 | * @static
|
30903 | * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set
|
30904 | * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest instance
|
30905 | */
|
30906 | ListOperationsRequest.create = function create(properties) {
|
30907 | return new ListOperationsRequest(properties);
|
30908 | };
|
30909 |
|
30910 | /**
|
30911 | * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages.
|
30912 | * @function encode
|
30913 | * @memberof google.longrunning.ListOperationsRequest
|
30914 | * @static
|
30915 | * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode
|
30916 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
30917 | * @returns {$protobuf.Writer} Writer
|
30918 | */
|
30919 | ListOperationsRequest.encode = function encode(message, writer) {
|
30920 | if (!writer)
|
30921 | writer = $Writer.create();
|
30922 | if (message.filter != null && Object.hasOwnProperty.call(message, "filter"))
|
30923 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter);
|
30924 | if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize"))
|
30925 | writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize);
|
30926 | if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken"))
|
30927 | writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken);
|
30928 | if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
30929 | writer.uint32(/* id 4, wireType 2 =*/34).string(message.name);
|
30930 | return writer;
|
30931 | };
|
30932 |
|
30933 | /**
|
30934 | * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages.
|
30935 | * @function encodeDelimited
|
30936 | * @memberof google.longrunning.ListOperationsRequest
|
30937 | * @static
|
30938 | * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode
|
30939 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
30940 | * @returns {$protobuf.Writer} Writer
|
30941 | */
|
30942 | ListOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) {
|
30943 | return this.encode(message, writer).ldelim();
|
30944 | };
|
30945 |
|
30946 | /**
|
30947 | * Decodes a ListOperationsRequest message from the specified reader or buffer.
|
30948 | * @function decode
|
30949 | * @memberof google.longrunning.ListOperationsRequest
|
30950 | * @static
|
30951 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
30952 | * @param {number} [length] Message length if known beforehand
|
30953 | * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest
|
30954 | * @throws {Error} If the payload is not a reader or valid buffer
|
30955 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
30956 | */
|
30957 | ListOperationsRequest.decode = function decode(reader, length) {
|
30958 | if (!(reader instanceof $Reader))
|
30959 | reader = $Reader.create(reader);
|
30960 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsRequest();
|
30961 | while (reader.pos < end) {
|
30962 | var tag = reader.uint32();
|
30963 | switch (tag >>> 3) {
|
30964 | case 4:
|
30965 | message.name = reader.string();
|
30966 | break;
|
30967 | case 1:
|
30968 | message.filter = reader.string();
|
30969 | break;
|
30970 | case 2:
|
30971 | message.pageSize = reader.int32();
|
30972 | break;
|
30973 | case 3:
|
30974 | message.pageToken = reader.string();
|
30975 | break;
|
30976 | default:
|
30977 | reader.skipType(tag & 7);
|
30978 | break;
|
30979 | }
|
30980 | }
|
30981 | return message;
|
30982 | };
|
30983 |
|
30984 | /**
|
30985 | * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited.
|
30986 | * @function decodeDelimited
|
30987 | * @memberof google.longrunning.ListOperationsRequest
|
30988 | * @static
|
30989 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
30990 | * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest
|
30991 | * @throws {Error} If the payload is not a reader or valid buffer
|
30992 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
30993 | */
|
30994 | ListOperationsRequest.decodeDelimited = function decodeDelimited(reader) {
|
30995 | if (!(reader instanceof $Reader))
|
30996 | reader = new $Reader(reader);
|
30997 | return this.decode(reader, reader.uint32());
|
30998 | };
|
30999 |
|
31000 | /**
|
31001 | * Verifies a ListOperationsRequest message.
|
31002 | * @function verify
|
31003 | * @memberof google.longrunning.ListOperationsRequest
|
31004 | * @static
|
31005 | * @param {Object.<string,*>} message Plain object to verify
|
31006 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
31007 | */
|
31008 | ListOperationsRequest.verify = function verify(message) {
|
31009 | if (typeof message !== "object" || message === null)
|
31010 | return "object expected";
|
31011 | if (message.name != null && message.hasOwnProperty("name"))
|
31012 | if (!$util.isString(message.name))
|
31013 | return "name: string expected";
|
31014 | if (message.filter != null && message.hasOwnProperty("filter"))
|
31015 | if (!$util.isString(message.filter))
|
31016 | return "filter: string expected";
|
31017 | if (message.pageSize != null && message.hasOwnProperty("pageSize"))
|
31018 | if (!$util.isInteger(message.pageSize))
|
31019 | return "pageSize: integer expected";
|
31020 | if (message.pageToken != null && message.hasOwnProperty("pageToken"))
|
31021 | if (!$util.isString(message.pageToken))
|
31022 | return "pageToken: string expected";
|
31023 | return null;
|
31024 | };
|
31025 |
|
31026 | /**
|
31027 | * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types.
|
31028 | * @function fromObject
|
31029 | * @memberof google.longrunning.ListOperationsRequest
|
31030 | * @static
|
31031 | * @param {Object.<string,*>} object Plain object
|
31032 | * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest
|
31033 | */
|
31034 | ListOperationsRequest.fromObject = function fromObject(object) {
|
31035 | if (object instanceof $root.google.longrunning.ListOperationsRequest)
|
31036 | return object;
|
31037 | var message = new $root.google.longrunning.ListOperationsRequest();
|
31038 | if (object.name != null)
|
31039 | message.name = String(object.name);
|
31040 | if (object.filter != null)
|
31041 | message.filter = String(object.filter);
|
31042 | if (object.pageSize != null)
|
31043 | message.pageSize = object.pageSize | 0;
|
31044 | if (object.pageToken != null)
|
31045 | message.pageToken = String(object.pageToken);
|
31046 | return message;
|
31047 | };
|
31048 |
|
31049 | /**
|
31050 | * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified.
|
31051 | * @function toObject
|
31052 | * @memberof google.longrunning.ListOperationsRequest
|
31053 | * @static
|
31054 | * @param {google.longrunning.ListOperationsRequest} message ListOperationsRequest
|
31055 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
31056 | * @returns {Object.<string,*>} Plain object
|
31057 | */
|
31058 | ListOperationsRequest.toObject = function toObject(message, options) {
|
31059 | if (!options)
|
31060 | options = {};
|
31061 | var object = {};
|
31062 | if (options.defaults) {
|
31063 | object.filter = "";
|
31064 | object.pageSize = 0;
|
31065 | object.pageToken = "";
|
31066 | object.name = "";
|
31067 | }
|
31068 | if (message.filter != null && message.hasOwnProperty("filter"))
|
31069 | object.filter = message.filter;
|
31070 | if (message.pageSize != null && message.hasOwnProperty("pageSize"))
|
31071 | object.pageSize = message.pageSize;
|
31072 | if (message.pageToken != null && message.hasOwnProperty("pageToken"))
|
31073 | object.pageToken = message.pageToken;
|
31074 | if (message.name != null && message.hasOwnProperty("name"))
|
31075 | object.name = message.name;
|
31076 | return object;
|
31077 | };
|
31078 |
|
31079 | /**
|
31080 | * Converts this ListOperationsRequest to JSON.
|
31081 | * @function toJSON
|
31082 | * @memberof google.longrunning.ListOperationsRequest
|
31083 | * @instance
|
31084 | * @returns {Object.<string,*>} JSON object
|
31085 | */
|
31086 | ListOperationsRequest.prototype.toJSON = function toJSON() {
|
31087 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
31088 | };
|
31089 |
|
31090 | return ListOperationsRequest;
|
31091 | })();
|
31092 |
|
31093 | longrunning.ListOperationsResponse = (function() {
|
31094 |
|
31095 | /**
|
31096 | * Properties of a ListOperationsResponse.
|
31097 | * @memberof google.longrunning
|
31098 | * @interface IListOperationsResponse
|
31099 | * @property {Array.<google.longrunning.IOperation>|null} [operations] ListOperationsResponse operations
|
31100 | * @property {string|null} [nextPageToken] ListOperationsResponse nextPageToken
|
31101 | */
|
31102 |
|
31103 | /**
|
31104 | * Constructs a new ListOperationsResponse.
|
31105 | * @memberof google.longrunning
|
31106 | * @classdesc Represents a ListOperationsResponse.
|
31107 | * @implements IListOperationsResponse
|
31108 | * @constructor
|
31109 | * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set
|
31110 | */
|
31111 | function ListOperationsResponse(properties) {
|
31112 | this.operations = [];
|
31113 | if (properties)
|
31114 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
31115 | if (properties[keys[i]] != null)
|
31116 | this[keys[i]] = properties[keys[i]];
|
31117 | }
|
31118 |
|
31119 | /**
|
31120 | * ListOperationsResponse operations.
|
31121 | * @member {Array.<google.longrunning.IOperation>} operations
|
31122 | * @memberof google.longrunning.ListOperationsResponse
|
31123 | * @instance
|
31124 | */
|
31125 | ListOperationsResponse.prototype.operations = $util.emptyArray;
|
31126 |
|
31127 | /**
|
31128 | * ListOperationsResponse nextPageToken.
|
31129 | * @member {string} nextPageToken
|
31130 | * @memberof google.longrunning.ListOperationsResponse
|
31131 | * @instance
|
31132 | */
|
31133 | ListOperationsResponse.prototype.nextPageToken = "";
|
31134 |
|
31135 | /**
|
31136 | * Creates a new ListOperationsResponse instance using the specified properties.
|
31137 | * @function create
|
31138 | * @memberof google.longrunning.ListOperationsResponse
|
31139 | * @static
|
31140 | * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set
|
31141 | * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse instance
|
31142 | */
|
31143 | ListOperationsResponse.create = function create(properties) {
|
31144 | return new ListOperationsResponse(properties);
|
31145 | };
|
31146 |
|
31147 | /**
|
31148 | * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages.
|
31149 | * @function encode
|
31150 | * @memberof google.longrunning.ListOperationsResponse
|
31151 | * @static
|
31152 | * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode
|
31153 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
31154 | * @returns {$protobuf.Writer} Writer
|
31155 | */
|
31156 | ListOperationsResponse.encode = function encode(message, writer) {
|
31157 | if (!writer)
|
31158 | writer = $Writer.create();
|
31159 | if (message.operations != null && message.operations.length)
|
31160 | for (var i = 0; i < message.operations.length; ++i)
|
31161 | $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
31162 | if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken"))
|
31163 | writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken);
|
31164 | return writer;
|
31165 | };
|
31166 |
|
31167 | /**
|
31168 | * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages.
|
31169 | * @function encodeDelimited
|
31170 | * @memberof google.longrunning.ListOperationsResponse
|
31171 | * @static
|
31172 | * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode
|
31173 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
31174 | * @returns {$protobuf.Writer} Writer
|
31175 | */
|
31176 | ListOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) {
|
31177 | return this.encode(message, writer).ldelim();
|
31178 | };
|
31179 |
|
31180 | /**
|
31181 | * Decodes a ListOperationsResponse message from the specified reader or buffer.
|
31182 | * @function decode
|
31183 | * @memberof google.longrunning.ListOperationsResponse
|
31184 | * @static
|
31185 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
31186 | * @param {number} [length] Message length if known beforehand
|
31187 | * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse
|
31188 | * @throws {Error} If the payload is not a reader or valid buffer
|
31189 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
31190 | */
|
31191 | ListOperationsResponse.decode = function decode(reader, length) {
|
31192 | if (!(reader instanceof $Reader))
|
31193 | reader = $Reader.create(reader);
|
31194 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsResponse();
|
31195 | while (reader.pos < end) {
|
31196 | var tag = reader.uint32();
|
31197 | switch (tag >>> 3) {
|
31198 | case 1:
|
31199 | if (!(message.operations && message.operations.length))
|
31200 | message.operations = [];
|
31201 | message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32()));
|
31202 | break;
|
31203 | case 2:
|
31204 | message.nextPageToken = reader.string();
|
31205 | break;
|
31206 | default:
|
31207 | reader.skipType(tag & 7);
|
31208 | break;
|
31209 | }
|
31210 | }
|
31211 | return message;
|
31212 | };
|
31213 |
|
31214 | /**
|
31215 | * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited.
|
31216 | * @function decodeDelimited
|
31217 | * @memberof google.longrunning.ListOperationsResponse
|
31218 | * @static
|
31219 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
31220 | * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse
|
31221 | * @throws {Error} If the payload is not a reader or valid buffer
|
31222 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
31223 | */
|
31224 | ListOperationsResponse.decodeDelimited = function decodeDelimited(reader) {
|
31225 | if (!(reader instanceof $Reader))
|
31226 | reader = new $Reader(reader);
|
31227 | return this.decode(reader, reader.uint32());
|
31228 | };
|
31229 |
|
31230 | /**
|
31231 | * Verifies a ListOperationsResponse message.
|
31232 | * @function verify
|
31233 | * @memberof google.longrunning.ListOperationsResponse
|
31234 | * @static
|
31235 | * @param {Object.<string,*>} message Plain object to verify
|
31236 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
31237 | */
|
31238 | ListOperationsResponse.verify = function verify(message) {
|
31239 | if (typeof message !== "object" || message === null)
|
31240 | return "object expected";
|
31241 | if (message.operations != null && message.hasOwnProperty("operations")) {
|
31242 | if (!Array.isArray(message.operations))
|
31243 | return "operations: array expected";
|
31244 | for (var i = 0; i < message.operations.length; ++i) {
|
31245 | var error = $root.google.longrunning.Operation.verify(message.operations[i]);
|
31246 | if (error)
|
31247 | return "operations." + error;
|
31248 | }
|
31249 | }
|
31250 | if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken"))
|
31251 | if (!$util.isString(message.nextPageToken))
|
31252 | return "nextPageToken: string expected";
|
31253 | return null;
|
31254 | };
|
31255 |
|
31256 | /**
|
31257 | * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types.
|
31258 | * @function fromObject
|
31259 | * @memberof google.longrunning.ListOperationsResponse
|
31260 | * @static
|
31261 | * @param {Object.<string,*>} object Plain object
|
31262 | * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse
|
31263 | */
|
31264 | ListOperationsResponse.fromObject = function fromObject(object) {
|
31265 | if (object instanceof $root.google.longrunning.ListOperationsResponse)
|
31266 | return object;
|
31267 | var message = new $root.google.longrunning.ListOperationsResponse();
|
31268 | if (object.operations) {
|
31269 | if (!Array.isArray(object.operations))
|
31270 | throw TypeError(".google.longrunning.ListOperationsResponse.operations: array expected");
|
31271 | message.operations = [];
|
31272 | for (var i = 0; i < object.operations.length; ++i) {
|
31273 | if (typeof object.operations[i] !== "object")
|
31274 | throw TypeError(".google.longrunning.ListOperationsResponse.operations: object expected");
|
31275 | message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]);
|
31276 | }
|
31277 | }
|
31278 | if (object.nextPageToken != null)
|
31279 | message.nextPageToken = String(object.nextPageToken);
|
31280 | return message;
|
31281 | };
|
31282 |
|
31283 | /**
|
31284 | * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified.
|
31285 | * @function toObject
|
31286 | * @memberof google.longrunning.ListOperationsResponse
|
31287 | * @static
|
31288 | * @param {google.longrunning.ListOperationsResponse} message ListOperationsResponse
|
31289 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
31290 | * @returns {Object.<string,*>} Plain object
|
31291 | */
|
31292 | ListOperationsResponse.toObject = function toObject(message, options) {
|
31293 | if (!options)
|
31294 | options = {};
|
31295 | var object = {};
|
31296 | if (options.arrays || options.defaults)
|
31297 | object.operations = [];
|
31298 | if (options.defaults)
|
31299 | object.nextPageToken = "";
|
31300 | if (message.operations && message.operations.length) {
|
31301 | object.operations = [];
|
31302 | for (var j = 0; j < message.operations.length; ++j)
|
31303 | object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options);
|
31304 | }
|
31305 | if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken"))
|
31306 | object.nextPageToken = message.nextPageToken;
|
31307 | return object;
|
31308 | };
|
31309 |
|
31310 | /**
|
31311 | * Converts this ListOperationsResponse to JSON.
|
31312 | * @function toJSON
|
31313 | * @memberof google.longrunning.ListOperationsResponse
|
31314 | * @instance
|
31315 | * @returns {Object.<string,*>} JSON object
|
31316 | */
|
31317 | ListOperationsResponse.prototype.toJSON = function toJSON() {
|
31318 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
31319 | };
|
31320 |
|
31321 | return ListOperationsResponse;
|
31322 | })();
|
31323 |
|
31324 | longrunning.CancelOperationRequest = (function() {
|
31325 |
|
31326 | /**
|
31327 | * Properties of a CancelOperationRequest.
|
31328 | * @memberof google.longrunning
|
31329 | * @interface ICancelOperationRequest
|
31330 | * @property {string|null} [name] CancelOperationRequest name
|
31331 | */
|
31332 |
|
31333 | /**
|
31334 | * Constructs a new CancelOperationRequest.
|
31335 | * @memberof google.longrunning
|
31336 | * @classdesc Represents a CancelOperationRequest.
|
31337 | * @implements ICancelOperationRequest
|
31338 | * @constructor
|
31339 | * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set
|
31340 | */
|
31341 | function CancelOperationRequest(properties) {
|
31342 | if (properties)
|
31343 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
31344 | if (properties[keys[i]] != null)
|
31345 | this[keys[i]] = properties[keys[i]];
|
31346 | }
|
31347 |
|
31348 | /**
|
31349 | * CancelOperationRequest name.
|
31350 | * @member {string} name
|
31351 | * @memberof google.longrunning.CancelOperationRequest
|
31352 | * @instance
|
31353 | */
|
31354 | CancelOperationRequest.prototype.name = "";
|
31355 |
|
31356 | /**
|
31357 | * Creates a new CancelOperationRequest instance using the specified properties.
|
31358 | * @function create
|
31359 | * @memberof google.longrunning.CancelOperationRequest
|
31360 | * @static
|
31361 | * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set
|
31362 | * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest instance
|
31363 | */
|
31364 | CancelOperationRequest.create = function create(properties) {
|
31365 | return new CancelOperationRequest(properties);
|
31366 | };
|
31367 |
|
31368 | /**
|
31369 | * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages.
|
31370 | * @function encode
|
31371 | * @memberof google.longrunning.CancelOperationRequest
|
31372 | * @static
|
31373 | * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode
|
31374 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
31375 | * @returns {$protobuf.Writer} Writer
|
31376 | */
|
31377 | CancelOperationRequest.encode = function encode(message, writer) {
|
31378 | if (!writer)
|
31379 | writer = $Writer.create();
|
31380 | if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
31381 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
|
31382 | return writer;
|
31383 | };
|
31384 |
|
31385 | /**
|
31386 | * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages.
|
31387 | * @function encodeDelimited
|
31388 | * @memberof google.longrunning.CancelOperationRequest
|
31389 | * @static
|
31390 | * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode
|
31391 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
31392 | * @returns {$protobuf.Writer} Writer
|
31393 | */
|
31394 | CancelOperationRequest.encodeDelimited = function encodeDelimited(message, writer) {
|
31395 | return this.encode(message, writer).ldelim();
|
31396 | };
|
31397 |
|
31398 | /**
|
31399 | * Decodes a CancelOperationRequest message from the specified reader or buffer.
|
31400 | * @function decode
|
31401 | * @memberof google.longrunning.CancelOperationRequest
|
31402 | * @static
|
31403 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
31404 | * @param {number} [length] Message length if known beforehand
|
31405 | * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest
|
31406 | * @throws {Error} If the payload is not a reader or valid buffer
|
31407 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
31408 | */
|
31409 | CancelOperationRequest.decode = function decode(reader, length) {
|
31410 | if (!(reader instanceof $Reader))
|
31411 | reader = $Reader.create(reader);
|
31412 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.CancelOperationRequest();
|
31413 | while (reader.pos < end) {
|
31414 | var tag = reader.uint32();
|
31415 | switch (tag >>> 3) {
|
31416 | case 1:
|
31417 | message.name = reader.string();
|
31418 | break;
|
31419 | default:
|
31420 | reader.skipType(tag & 7);
|
31421 | break;
|
31422 | }
|
31423 | }
|
31424 | return message;
|
31425 | };
|
31426 |
|
31427 | /**
|
31428 | * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited.
|
31429 | * @function decodeDelimited
|
31430 | * @memberof google.longrunning.CancelOperationRequest
|
31431 | * @static
|
31432 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
31433 | * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest
|
31434 | * @throws {Error} If the payload is not a reader or valid buffer
|
31435 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
31436 | */
|
31437 | CancelOperationRequest.decodeDelimited = function decodeDelimited(reader) {
|
31438 | if (!(reader instanceof $Reader))
|
31439 | reader = new $Reader(reader);
|
31440 | return this.decode(reader, reader.uint32());
|
31441 | };
|
31442 |
|
31443 | /**
|
31444 | * Verifies a CancelOperationRequest message.
|
31445 | * @function verify
|
31446 | * @memberof google.longrunning.CancelOperationRequest
|
31447 | * @static
|
31448 | * @param {Object.<string,*>} message Plain object to verify
|
31449 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
31450 | */
|
31451 | CancelOperationRequest.verify = function verify(message) {
|
31452 | if (typeof message !== "object" || message === null)
|
31453 | return "object expected";
|
31454 | if (message.name != null && message.hasOwnProperty("name"))
|
31455 | if (!$util.isString(message.name))
|
31456 | return "name: string expected";
|
31457 | return null;
|
31458 | };
|
31459 |
|
31460 | /**
|
31461 | * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types.
|
31462 | * @function fromObject
|
31463 | * @memberof google.longrunning.CancelOperationRequest
|
31464 | * @static
|
31465 | * @param {Object.<string,*>} object Plain object
|
31466 | * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest
|
31467 | */
|
31468 | CancelOperationRequest.fromObject = function fromObject(object) {
|
31469 | if (object instanceof $root.google.longrunning.CancelOperationRequest)
|
31470 | return object;
|
31471 | var message = new $root.google.longrunning.CancelOperationRequest();
|
31472 | if (object.name != null)
|
31473 | message.name = String(object.name);
|
31474 | return message;
|
31475 | };
|
31476 |
|
31477 | /**
|
31478 | * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified.
|
31479 | * @function toObject
|
31480 | * @memberof google.longrunning.CancelOperationRequest
|
31481 | * @static
|
31482 | * @param {google.longrunning.CancelOperationRequest} message CancelOperationRequest
|
31483 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
31484 | * @returns {Object.<string,*>} Plain object
|
31485 | */
|
31486 | CancelOperationRequest.toObject = function toObject(message, options) {
|
31487 | if (!options)
|
31488 | options = {};
|
31489 | var object = {};
|
31490 | if (options.defaults)
|
31491 | object.name = "";
|
31492 | if (message.name != null && message.hasOwnProperty("name"))
|
31493 | object.name = message.name;
|
31494 | return object;
|
31495 | };
|
31496 |
|
31497 | /**
|
31498 | * Converts this CancelOperationRequest to JSON.
|
31499 | * @function toJSON
|
31500 | * @memberof google.longrunning.CancelOperationRequest
|
31501 | * @instance
|
31502 | * @returns {Object.<string,*>} JSON object
|
31503 | */
|
31504 | CancelOperationRequest.prototype.toJSON = function toJSON() {
|
31505 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
31506 | };
|
31507 |
|
31508 | return CancelOperationRequest;
|
31509 | })();
|
31510 |
|
31511 | longrunning.DeleteOperationRequest = (function() {
|
31512 |
|
31513 | /**
|
31514 | * Properties of a DeleteOperationRequest.
|
31515 | * @memberof google.longrunning
|
31516 | * @interface IDeleteOperationRequest
|
31517 | * @property {string|null} [name] DeleteOperationRequest name
|
31518 | */
|
31519 |
|
31520 | /**
|
31521 | * Constructs a new DeleteOperationRequest.
|
31522 | * @memberof google.longrunning
|
31523 | * @classdesc Represents a DeleteOperationRequest.
|
31524 | * @implements IDeleteOperationRequest
|
31525 | * @constructor
|
31526 | * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set
|
31527 | */
|
31528 | function DeleteOperationRequest(properties) {
|
31529 | if (properties)
|
31530 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
31531 | if (properties[keys[i]] != null)
|
31532 | this[keys[i]] = properties[keys[i]];
|
31533 | }
|
31534 |
|
31535 | /**
|
31536 | * DeleteOperationRequest name.
|
31537 | * @member {string} name
|
31538 | * @memberof google.longrunning.DeleteOperationRequest
|
31539 | * @instance
|
31540 | */
|
31541 | DeleteOperationRequest.prototype.name = "";
|
31542 |
|
31543 | /**
|
31544 | * Creates a new DeleteOperationRequest instance using the specified properties.
|
31545 | * @function create
|
31546 | * @memberof google.longrunning.DeleteOperationRequest
|
31547 | * @static
|
31548 | * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set
|
31549 | * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest instance
|
31550 | */
|
31551 | DeleteOperationRequest.create = function create(properties) {
|
31552 | return new DeleteOperationRequest(properties);
|
31553 | };
|
31554 |
|
31555 | /**
|
31556 | * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages.
|
31557 | * @function encode
|
31558 | * @memberof google.longrunning.DeleteOperationRequest
|
31559 | * @static
|
31560 | * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode
|
31561 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
31562 | * @returns {$protobuf.Writer} Writer
|
31563 | */
|
31564 | DeleteOperationRequest.encode = function encode(message, writer) {
|
31565 | if (!writer)
|
31566 | writer = $Writer.create();
|
31567 | if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
31568 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
|
31569 | return writer;
|
31570 | };
|
31571 |
|
31572 | /**
|
31573 | * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages.
|
31574 | * @function encodeDelimited
|
31575 | * @memberof google.longrunning.DeleteOperationRequest
|
31576 | * @static
|
31577 | * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode
|
31578 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
31579 | * @returns {$protobuf.Writer} Writer
|
31580 | */
|
31581 | DeleteOperationRequest.encodeDelimited = function encodeDelimited(message, writer) {
|
31582 | return this.encode(message, writer).ldelim();
|
31583 | };
|
31584 |
|
31585 | /**
|
31586 | * Decodes a DeleteOperationRequest message from the specified reader or buffer.
|
31587 | * @function decode
|
31588 | * @memberof google.longrunning.DeleteOperationRequest
|
31589 | * @static
|
31590 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
31591 | * @param {number} [length] Message length if known beforehand
|
31592 | * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest
|
31593 | * @throws {Error} If the payload is not a reader or valid buffer
|
31594 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
31595 | */
|
31596 | DeleteOperationRequest.decode = function decode(reader, length) {
|
31597 | if (!(reader instanceof $Reader))
|
31598 | reader = $Reader.create(reader);
|
31599 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.DeleteOperationRequest();
|
31600 | while (reader.pos < end) {
|
31601 | var tag = reader.uint32();
|
31602 | switch (tag >>> 3) {
|
31603 | case 1:
|
31604 | message.name = reader.string();
|
31605 | break;
|
31606 | default:
|
31607 | reader.skipType(tag & 7);
|
31608 | break;
|
31609 | }
|
31610 | }
|
31611 | return message;
|
31612 | };
|
31613 |
|
31614 | /**
|
31615 | * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited.
|
31616 | * @function decodeDelimited
|
31617 | * @memberof google.longrunning.DeleteOperationRequest
|
31618 | * @static
|
31619 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
31620 | * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest
|
31621 | * @throws {Error} If the payload is not a reader or valid buffer
|
31622 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
31623 | */
|
31624 | DeleteOperationRequest.decodeDelimited = function decodeDelimited(reader) {
|
31625 | if (!(reader instanceof $Reader))
|
31626 | reader = new $Reader(reader);
|
31627 | return this.decode(reader, reader.uint32());
|
31628 | };
|
31629 |
|
31630 | /**
|
31631 | * Verifies a DeleteOperationRequest message.
|
31632 | * @function verify
|
31633 | * @memberof google.longrunning.DeleteOperationRequest
|
31634 | * @static
|
31635 | * @param {Object.<string,*>} message Plain object to verify
|
31636 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
31637 | */
|
31638 | DeleteOperationRequest.verify = function verify(message) {
|
31639 | if (typeof message !== "object" || message === null)
|
31640 | return "object expected";
|
31641 | if (message.name != null && message.hasOwnProperty("name"))
|
31642 | if (!$util.isString(message.name))
|
31643 | return "name: string expected";
|
31644 | return null;
|
31645 | };
|
31646 |
|
31647 | /**
|
31648 | * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types.
|
31649 | * @function fromObject
|
31650 | * @memberof google.longrunning.DeleteOperationRequest
|
31651 | * @static
|
31652 | * @param {Object.<string,*>} object Plain object
|
31653 | * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest
|
31654 | */
|
31655 | DeleteOperationRequest.fromObject = function fromObject(object) {
|
31656 | if (object instanceof $root.google.longrunning.DeleteOperationRequest)
|
31657 | return object;
|
31658 | var message = new $root.google.longrunning.DeleteOperationRequest();
|
31659 | if (object.name != null)
|
31660 | message.name = String(object.name);
|
31661 | return message;
|
31662 | };
|
31663 |
|
31664 | /**
|
31665 | * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified.
|
31666 | * @function toObject
|
31667 | * @memberof google.longrunning.DeleteOperationRequest
|
31668 | * @static
|
31669 | * @param {google.longrunning.DeleteOperationRequest} message DeleteOperationRequest
|
31670 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
31671 | * @returns {Object.<string,*>} Plain object
|
31672 | */
|
31673 | DeleteOperationRequest.toObject = function toObject(message, options) {
|
31674 | if (!options)
|
31675 | options = {};
|
31676 | var object = {};
|
31677 | if (options.defaults)
|
31678 | object.name = "";
|
31679 | if (message.name != null && message.hasOwnProperty("name"))
|
31680 | object.name = message.name;
|
31681 | return object;
|
31682 | };
|
31683 |
|
31684 | /**
|
31685 | * Converts this DeleteOperationRequest to JSON.
|
31686 | * @function toJSON
|
31687 | * @memberof google.longrunning.DeleteOperationRequest
|
31688 | * @instance
|
31689 | * @returns {Object.<string,*>} JSON object
|
31690 | */
|
31691 | DeleteOperationRequest.prototype.toJSON = function toJSON() {
|
31692 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
31693 | };
|
31694 |
|
31695 | return DeleteOperationRequest;
|
31696 | })();
|
31697 |
|
31698 | longrunning.WaitOperationRequest = (function() {
|
31699 |
|
31700 | /**
|
31701 | * Properties of a WaitOperationRequest.
|
31702 | * @memberof google.longrunning
|
31703 | * @interface IWaitOperationRequest
|
31704 | * @property {string|null} [name] WaitOperationRequest name
|
31705 | * @property {google.protobuf.IDuration|null} [timeout] WaitOperationRequest timeout
|
31706 | */
|
31707 |
|
31708 | /**
|
31709 | * Constructs a new WaitOperationRequest.
|
31710 | * @memberof google.longrunning
|
31711 | * @classdesc Represents a WaitOperationRequest.
|
31712 | * @implements IWaitOperationRequest
|
31713 | * @constructor
|
31714 | * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set
|
31715 | */
|
31716 | function WaitOperationRequest(properties) {
|
31717 | if (properties)
|
31718 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
31719 | if (properties[keys[i]] != null)
|
31720 | this[keys[i]] = properties[keys[i]];
|
31721 | }
|
31722 |
|
31723 | /**
|
31724 | * WaitOperationRequest name.
|
31725 | * @member {string} name
|
31726 | * @memberof google.longrunning.WaitOperationRequest
|
31727 | * @instance
|
31728 | */
|
31729 | WaitOperationRequest.prototype.name = "";
|
31730 |
|
31731 | /**
|
31732 | * WaitOperationRequest timeout.
|
31733 | * @member {google.protobuf.IDuration|null|undefined} timeout
|
31734 | * @memberof google.longrunning.WaitOperationRequest
|
31735 | * @instance
|
31736 | */
|
31737 | WaitOperationRequest.prototype.timeout = null;
|
31738 |
|
31739 | /**
|
31740 | * Creates a new WaitOperationRequest instance using the specified properties.
|
31741 | * @function create
|
31742 | * @memberof google.longrunning.WaitOperationRequest
|
31743 | * @static
|
31744 | * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set
|
31745 | * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest instance
|
31746 | */
|
31747 | WaitOperationRequest.create = function create(properties) {
|
31748 | return new WaitOperationRequest(properties);
|
31749 | };
|
31750 |
|
31751 | /**
|
31752 | * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages.
|
31753 | * @function encode
|
31754 | * @memberof google.longrunning.WaitOperationRequest
|
31755 | * @static
|
31756 | * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode
|
31757 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
31758 | * @returns {$protobuf.Writer} Writer
|
31759 | */
|
31760 | WaitOperationRequest.encode = function encode(message, writer) {
|
31761 | if (!writer)
|
31762 | writer = $Writer.create();
|
31763 | if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
31764 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
|
31765 | if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout"))
|
31766 | $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
31767 | return writer;
|
31768 | };
|
31769 |
|
31770 | /**
|
31771 | * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages.
|
31772 | * @function encodeDelimited
|
31773 | * @memberof google.longrunning.WaitOperationRequest
|
31774 | * @static
|
31775 | * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode
|
31776 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
31777 | * @returns {$protobuf.Writer} Writer
|
31778 | */
|
31779 | WaitOperationRequest.encodeDelimited = function encodeDelimited(message, writer) {
|
31780 | return this.encode(message, writer).ldelim();
|
31781 | };
|
31782 |
|
31783 | /**
|
31784 | * Decodes a WaitOperationRequest message from the specified reader or buffer.
|
31785 | * @function decode
|
31786 | * @memberof google.longrunning.WaitOperationRequest
|
31787 | * @static
|
31788 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
31789 | * @param {number} [length] Message length if known beforehand
|
31790 | * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest
|
31791 | * @throws {Error} If the payload is not a reader or valid buffer
|
31792 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
31793 | */
|
31794 | WaitOperationRequest.decode = function decode(reader, length) {
|
31795 | if (!(reader instanceof $Reader))
|
31796 | reader = $Reader.create(reader);
|
31797 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.WaitOperationRequest();
|
31798 | while (reader.pos < end) {
|
31799 | var tag = reader.uint32();
|
31800 | switch (tag >>> 3) {
|
31801 | case 1:
|
31802 | message.name = reader.string();
|
31803 | break;
|
31804 | case 2:
|
31805 | message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32());
|
31806 | break;
|
31807 | default:
|
31808 | reader.skipType(tag & 7);
|
31809 | break;
|
31810 | }
|
31811 | }
|
31812 | return message;
|
31813 | };
|
31814 |
|
31815 | /**
|
31816 | * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited.
|
31817 | * @function decodeDelimited
|
31818 | * @memberof google.longrunning.WaitOperationRequest
|
31819 | * @static
|
31820 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
31821 | * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest
|
31822 | * @throws {Error} If the payload is not a reader or valid buffer
|
31823 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
31824 | */
|
31825 | WaitOperationRequest.decodeDelimited = function decodeDelimited(reader) {
|
31826 | if (!(reader instanceof $Reader))
|
31827 | reader = new $Reader(reader);
|
31828 | return this.decode(reader, reader.uint32());
|
31829 | };
|
31830 |
|
31831 | /**
|
31832 | * Verifies a WaitOperationRequest message.
|
31833 | * @function verify
|
31834 | * @memberof google.longrunning.WaitOperationRequest
|
31835 | * @static
|
31836 | * @param {Object.<string,*>} message Plain object to verify
|
31837 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
31838 | */
|
31839 | WaitOperationRequest.verify = function verify(message) {
|
31840 | if (typeof message !== "object" || message === null)
|
31841 | return "object expected";
|
31842 | if (message.name != null && message.hasOwnProperty("name"))
|
31843 | if (!$util.isString(message.name))
|
31844 | return "name: string expected";
|
31845 | if (message.timeout != null && message.hasOwnProperty("timeout")) {
|
31846 | var error = $root.google.protobuf.Duration.verify(message.timeout);
|
31847 | if (error)
|
31848 | return "timeout." + error;
|
31849 | }
|
31850 | return null;
|
31851 | };
|
31852 |
|
31853 | /**
|
31854 | * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types.
|
31855 | * @function fromObject
|
31856 | * @memberof google.longrunning.WaitOperationRequest
|
31857 | * @static
|
31858 | * @param {Object.<string,*>} object Plain object
|
31859 | * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest
|
31860 | */
|
31861 | WaitOperationRequest.fromObject = function fromObject(object) {
|
31862 | if (object instanceof $root.google.longrunning.WaitOperationRequest)
|
31863 | return object;
|
31864 | var message = new $root.google.longrunning.WaitOperationRequest();
|
31865 | if (object.name != null)
|
31866 | message.name = String(object.name);
|
31867 | if (object.timeout != null) {
|
31868 | if (typeof object.timeout !== "object")
|
31869 | throw TypeError(".google.longrunning.WaitOperationRequest.timeout: object expected");
|
31870 | message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout);
|
31871 | }
|
31872 | return message;
|
31873 | };
|
31874 |
|
31875 | /**
|
31876 | * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified.
|
31877 | * @function toObject
|
31878 | * @memberof google.longrunning.WaitOperationRequest
|
31879 | * @static
|
31880 | * @param {google.longrunning.WaitOperationRequest} message WaitOperationRequest
|
31881 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
31882 | * @returns {Object.<string,*>} Plain object
|
31883 | */
|
31884 | WaitOperationRequest.toObject = function toObject(message, options) {
|
31885 | if (!options)
|
31886 | options = {};
|
31887 | var object = {};
|
31888 | if (options.defaults) {
|
31889 | object.name = "";
|
31890 | object.timeout = null;
|
31891 | }
|
31892 | if (message.name != null && message.hasOwnProperty("name"))
|
31893 | object.name = message.name;
|
31894 | if (message.timeout != null && message.hasOwnProperty("timeout"))
|
31895 | object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options);
|
31896 | return object;
|
31897 | };
|
31898 |
|
31899 | /**
|
31900 | * Converts this WaitOperationRequest to JSON.
|
31901 | * @function toJSON
|
31902 | * @memberof google.longrunning.WaitOperationRequest
|
31903 | * @instance
|
31904 | * @returns {Object.<string,*>} JSON object
|
31905 | */
|
31906 | WaitOperationRequest.prototype.toJSON = function toJSON() {
|
31907 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
31908 | };
|
31909 |
|
31910 | return WaitOperationRequest;
|
31911 | })();
|
31912 |
|
31913 | longrunning.OperationInfo = (function() {
|
31914 |
|
31915 | /**
|
31916 | * Properties of an OperationInfo.
|
31917 | * @memberof google.longrunning
|
31918 | * @interface IOperationInfo
|
31919 | * @property {string|null} [responseType] OperationInfo responseType
|
31920 | * @property {string|null} [metadataType] OperationInfo metadataType
|
31921 | */
|
31922 |
|
31923 | /**
|
31924 | * Constructs a new OperationInfo.
|
31925 | * @memberof google.longrunning
|
31926 | * @classdesc Represents an OperationInfo.
|
31927 | * @implements IOperationInfo
|
31928 | * @constructor
|
31929 | * @param {google.longrunning.IOperationInfo=} [properties] Properties to set
|
31930 | */
|
31931 | function OperationInfo(properties) {
|
31932 | if (properties)
|
31933 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
31934 | if (properties[keys[i]] != null)
|
31935 | this[keys[i]] = properties[keys[i]];
|
31936 | }
|
31937 |
|
31938 | /**
|
31939 | * OperationInfo responseType.
|
31940 | * @member {string} responseType
|
31941 | * @memberof google.longrunning.OperationInfo
|
31942 | * @instance
|
31943 | */
|
31944 | OperationInfo.prototype.responseType = "";
|
31945 |
|
31946 | /**
|
31947 | * OperationInfo metadataType.
|
31948 | * @member {string} metadataType
|
31949 | * @memberof google.longrunning.OperationInfo
|
31950 | * @instance
|
31951 | */
|
31952 | OperationInfo.prototype.metadataType = "";
|
31953 |
|
31954 | /**
|
31955 | * Creates a new OperationInfo instance using the specified properties.
|
31956 | * @function create
|
31957 | * @memberof google.longrunning.OperationInfo
|
31958 | * @static
|
31959 | * @param {google.longrunning.IOperationInfo=} [properties] Properties to set
|
31960 | * @returns {google.longrunning.OperationInfo} OperationInfo instance
|
31961 | */
|
31962 | OperationInfo.create = function create(properties) {
|
31963 | return new OperationInfo(properties);
|
31964 | };
|
31965 |
|
31966 | /**
|
31967 | * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages.
|
31968 | * @function encode
|
31969 | * @memberof google.longrunning.OperationInfo
|
31970 | * @static
|
31971 | * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode
|
31972 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
31973 | * @returns {$protobuf.Writer} Writer
|
31974 | */
|
31975 | OperationInfo.encode = function encode(message, writer) {
|
31976 | if (!writer)
|
31977 | writer = $Writer.create();
|
31978 | if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType"))
|
31979 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType);
|
31980 | if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType"))
|
31981 | writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataType);
|
31982 | return writer;
|
31983 | };
|
31984 |
|
31985 | /**
|
31986 | * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages.
|
31987 | * @function encodeDelimited
|
31988 | * @memberof google.longrunning.OperationInfo
|
31989 | * @static
|
31990 | * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode
|
31991 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
31992 | * @returns {$protobuf.Writer} Writer
|
31993 | */
|
31994 | OperationInfo.encodeDelimited = function encodeDelimited(message, writer) {
|
31995 | return this.encode(message, writer).ldelim();
|
31996 | };
|
31997 |
|
31998 | /**
|
31999 | * Decodes an OperationInfo message from the specified reader or buffer.
|
32000 | * @function decode
|
32001 | * @memberof google.longrunning.OperationInfo
|
32002 | * @static
|
32003 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
32004 | * @param {number} [length] Message length if known beforehand
|
32005 | * @returns {google.longrunning.OperationInfo} OperationInfo
|
32006 | * @throws {Error} If the payload is not a reader or valid buffer
|
32007 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
32008 | */
|
32009 | OperationInfo.decode = function decode(reader, length) {
|
32010 | if (!(reader instanceof $Reader))
|
32011 | reader = $Reader.create(reader);
|
32012 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.OperationInfo();
|
32013 | while (reader.pos < end) {
|
32014 | var tag = reader.uint32();
|
32015 | switch (tag >>> 3) {
|
32016 | case 1:
|
32017 | message.responseType = reader.string();
|
32018 | break;
|
32019 | case 2:
|
32020 | message.metadataType = reader.string();
|
32021 | break;
|
32022 | default:
|
32023 | reader.skipType(tag & 7);
|
32024 | break;
|
32025 | }
|
32026 | }
|
32027 | return message;
|
32028 | };
|
32029 |
|
32030 | /**
|
32031 | * Decodes an OperationInfo message from the specified reader or buffer, length delimited.
|
32032 | * @function decodeDelimited
|
32033 | * @memberof google.longrunning.OperationInfo
|
32034 | * @static
|
32035 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
32036 | * @returns {google.longrunning.OperationInfo} OperationInfo
|
32037 | * @throws {Error} If the payload is not a reader or valid buffer
|
32038 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
32039 | */
|
32040 | OperationInfo.decodeDelimited = function decodeDelimited(reader) {
|
32041 | if (!(reader instanceof $Reader))
|
32042 | reader = new $Reader(reader);
|
32043 | return this.decode(reader, reader.uint32());
|
32044 | };
|
32045 |
|
32046 | /**
|
32047 | * Verifies an OperationInfo message.
|
32048 | * @function verify
|
32049 | * @memberof google.longrunning.OperationInfo
|
32050 | * @static
|
32051 | * @param {Object.<string,*>} message Plain object to verify
|
32052 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
32053 | */
|
32054 | OperationInfo.verify = function verify(message) {
|
32055 | if (typeof message !== "object" || message === null)
|
32056 | return "object expected";
|
32057 | if (message.responseType != null && message.hasOwnProperty("responseType"))
|
32058 | if (!$util.isString(message.responseType))
|
32059 | return "responseType: string expected";
|
32060 | if (message.metadataType != null && message.hasOwnProperty("metadataType"))
|
32061 | if (!$util.isString(message.metadataType))
|
32062 | return "metadataType: string expected";
|
32063 | return null;
|
32064 | };
|
32065 |
|
32066 | /**
|
32067 | * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types.
|
32068 | * @function fromObject
|
32069 | * @memberof google.longrunning.OperationInfo
|
32070 | * @static
|
32071 | * @param {Object.<string,*>} object Plain object
|
32072 | * @returns {google.longrunning.OperationInfo} OperationInfo
|
32073 | */
|
32074 | OperationInfo.fromObject = function fromObject(object) {
|
32075 | if (object instanceof $root.google.longrunning.OperationInfo)
|
32076 | return object;
|
32077 | var message = new $root.google.longrunning.OperationInfo();
|
32078 | if (object.responseType != null)
|
32079 | message.responseType = String(object.responseType);
|
32080 | if (object.metadataType != null)
|
32081 | message.metadataType = String(object.metadataType);
|
32082 | return message;
|
32083 | };
|
32084 |
|
32085 | /**
|
32086 | * Creates a plain object from an OperationInfo message. Also converts values to other types if specified.
|
32087 | * @function toObject
|
32088 | * @memberof google.longrunning.OperationInfo
|
32089 | * @static
|
32090 | * @param {google.longrunning.OperationInfo} message OperationInfo
|
32091 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
32092 | * @returns {Object.<string,*>} Plain object
|
32093 | */
|
32094 | OperationInfo.toObject = function toObject(message, options) {
|
32095 | if (!options)
|
32096 | options = {};
|
32097 | var object = {};
|
32098 | if (options.defaults) {
|
32099 | object.responseType = "";
|
32100 | object.metadataType = "";
|
32101 | }
|
32102 | if (message.responseType != null && message.hasOwnProperty("responseType"))
|
32103 | object.responseType = message.responseType;
|
32104 | if (message.metadataType != null && message.hasOwnProperty("metadataType"))
|
32105 | object.metadataType = message.metadataType;
|
32106 | return object;
|
32107 | };
|
32108 |
|
32109 | /**
|
32110 | * Converts this OperationInfo to JSON.
|
32111 | * @function toJSON
|
32112 | * @memberof google.longrunning.OperationInfo
|
32113 | * @instance
|
32114 | * @returns {Object.<string,*>} JSON object
|
32115 | */
|
32116 | OperationInfo.prototype.toJSON = function toJSON() {
|
32117 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
32118 | };
|
32119 |
|
32120 | return OperationInfo;
|
32121 | })();
|
32122 |
|
32123 | return longrunning;
|
32124 | })();
|
32125 |
|
32126 | google.rpc = (function() {
|
32127 |
|
32128 | /**
|
32129 | * Namespace rpc.
|
32130 | * @memberof google
|
32131 | * @namespace
|
32132 | */
|
32133 | var rpc = {};
|
32134 |
|
32135 | rpc.Status = (function() {
|
32136 |
|
32137 | /**
|
32138 | * Properties of a Status.
|
32139 | * @memberof google.rpc
|
32140 | * @interface IStatus
|
32141 | * @property {number|null} [code] Status code
|
32142 | * @property {string|null} [message] Status message
|
32143 | * @property {Array.<google.protobuf.IAny>|null} [details] Status details
|
32144 | */
|
32145 |
|
32146 | /**
|
32147 | * Constructs a new Status.
|
32148 | * @memberof google.rpc
|
32149 | * @classdesc Represents a Status.
|
32150 | * @implements IStatus
|
32151 | * @constructor
|
32152 | * @param {google.rpc.IStatus=} [properties] Properties to set
|
32153 | */
|
32154 | function Status(properties) {
|
32155 | this.details = [];
|
32156 | if (properties)
|
32157 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
32158 | if (properties[keys[i]] != null)
|
32159 | this[keys[i]] = properties[keys[i]];
|
32160 | }
|
32161 |
|
32162 | /**
|
32163 | * Status code.
|
32164 | * @member {number} code
|
32165 | * @memberof google.rpc.Status
|
32166 | * @instance
|
32167 | */
|
32168 | Status.prototype.code = 0;
|
32169 |
|
32170 | /**
|
32171 | * Status message.
|
32172 | * @member {string} message
|
32173 | * @memberof google.rpc.Status
|
32174 | * @instance
|
32175 | */
|
32176 | Status.prototype.message = "";
|
32177 |
|
32178 | /**
|
32179 | * Status details.
|
32180 | * @member {Array.<google.protobuf.IAny>} details
|
32181 | * @memberof google.rpc.Status
|
32182 | * @instance
|
32183 | */
|
32184 | Status.prototype.details = $util.emptyArray;
|
32185 |
|
32186 | /**
|
32187 | * Creates a new Status instance using the specified properties.
|
32188 | * @function create
|
32189 | * @memberof google.rpc.Status
|
32190 | * @static
|
32191 | * @param {google.rpc.IStatus=} [properties] Properties to set
|
32192 | * @returns {google.rpc.Status} Status instance
|
32193 | */
|
32194 | Status.create = function create(properties) {
|
32195 | return new Status(properties);
|
32196 | };
|
32197 |
|
32198 | /**
|
32199 | * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages.
|
32200 | * @function encode
|
32201 | * @memberof google.rpc.Status
|
32202 | * @static
|
32203 | * @param {google.rpc.IStatus} message Status message or plain object to encode
|
32204 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
32205 | * @returns {$protobuf.Writer} Writer
|
32206 | */
|
32207 | Status.encode = function encode(message, writer) {
|
32208 | if (!writer)
|
32209 | writer = $Writer.create();
|
32210 | if (message.code != null && Object.hasOwnProperty.call(message, "code"))
|
32211 | writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code);
|
32212 | if (message.message != null && Object.hasOwnProperty.call(message, "message"))
|
32213 | writer.uint32(/* id 2, wireType 2 =*/18).string(message.message);
|
32214 | if (message.details != null && message.details.length)
|
32215 | for (var i = 0; i < message.details.length; ++i)
|
32216 | $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
|
32217 | return writer;
|
32218 | };
|
32219 |
|
32220 | /**
|
32221 | * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages.
|
32222 | * @function encodeDelimited
|
32223 | * @memberof google.rpc.Status
|
32224 | * @static
|
32225 | * @param {google.rpc.IStatus} message Status message or plain object to encode
|
32226 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
32227 | * @returns {$protobuf.Writer} Writer
|
32228 | */
|
32229 | Status.encodeDelimited = function encodeDelimited(message, writer) {
|
32230 | return this.encode(message, writer).ldelim();
|
32231 | };
|
32232 |
|
32233 | /**
|
32234 | * Decodes a Status message from the specified reader or buffer.
|
32235 | * @function decode
|
32236 | * @memberof google.rpc.Status
|
32237 | * @static
|
32238 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
32239 | * @param {number} [length] Message length if known beforehand
|
32240 | * @returns {google.rpc.Status} Status
|
32241 | * @throws {Error} If the payload is not a reader or valid buffer
|
32242 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
32243 | */
|
32244 | Status.decode = function decode(reader, length) {
|
32245 | if (!(reader instanceof $Reader))
|
32246 | reader = $Reader.create(reader);
|
32247 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status();
|
32248 | while (reader.pos < end) {
|
32249 | var tag = reader.uint32();
|
32250 | switch (tag >>> 3) {
|
32251 | case 1:
|
32252 | message.code = reader.int32();
|
32253 | break;
|
32254 | case 2:
|
32255 | message.message = reader.string();
|
32256 | break;
|
32257 | case 3:
|
32258 | if (!(message.details && message.details.length))
|
32259 | message.details = [];
|
32260 | message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32()));
|
32261 | break;
|
32262 | default:
|
32263 | reader.skipType(tag & 7);
|
32264 | break;
|
32265 | }
|
32266 | }
|
32267 | return message;
|
32268 | };
|
32269 |
|
32270 | /**
|
32271 | * Decodes a Status message from the specified reader or buffer, length delimited.
|
32272 | * @function decodeDelimited
|
32273 | * @memberof google.rpc.Status
|
32274 | * @static
|
32275 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
32276 | * @returns {google.rpc.Status} Status
|
32277 | * @throws {Error} If the payload is not a reader or valid buffer
|
32278 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
32279 | */
|
32280 | Status.decodeDelimited = function decodeDelimited(reader) {
|
32281 | if (!(reader instanceof $Reader))
|
32282 | reader = new $Reader(reader);
|
32283 | return this.decode(reader, reader.uint32());
|
32284 | };
|
32285 |
|
32286 | /**
|
32287 | * Verifies a Status message.
|
32288 | * @function verify
|
32289 | * @memberof google.rpc.Status
|
32290 | * @static
|
32291 | * @param {Object.<string,*>} message Plain object to verify
|
32292 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
32293 | */
|
32294 | Status.verify = function verify(message) {
|
32295 | if (typeof message !== "object" || message === null)
|
32296 | return "object expected";
|
32297 | if (message.code != null && message.hasOwnProperty("code"))
|
32298 | if (!$util.isInteger(message.code))
|
32299 | return "code: integer expected";
|
32300 | if (message.message != null && message.hasOwnProperty("message"))
|
32301 | if (!$util.isString(message.message))
|
32302 | return "message: string expected";
|
32303 | if (message.details != null && message.hasOwnProperty("details")) {
|
32304 | if (!Array.isArray(message.details))
|
32305 | return "details: array expected";
|
32306 | for (var i = 0; i < message.details.length; ++i) {
|
32307 | var error = $root.google.protobuf.Any.verify(message.details[i]);
|
32308 | if (error)
|
32309 | return "details." + error;
|
32310 | }
|
32311 | }
|
32312 | return null;
|
32313 | };
|
32314 |
|
32315 | /**
|
32316 | * Creates a Status message from a plain object. Also converts values to their respective internal types.
|
32317 | * @function fromObject
|
32318 | * @memberof google.rpc.Status
|
32319 | * @static
|
32320 | * @param {Object.<string,*>} object Plain object
|
32321 | * @returns {google.rpc.Status} Status
|
32322 | */
|
32323 | Status.fromObject = function fromObject(object) {
|
32324 | if (object instanceof $root.google.rpc.Status)
|
32325 | return object;
|
32326 | var message = new $root.google.rpc.Status();
|
32327 | if (object.code != null)
|
32328 | message.code = object.code | 0;
|
32329 | if (object.message != null)
|
32330 | message.message = String(object.message);
|
32331 | if (object.details) {
|
32332 | if (!Array.isArray(object.details))
|
32333 | throw TypeError(".google.rpc.Status.details: array expected");
|
32334 | message.details = [];
|
32335 | for (var i = 0; i < object.details.length; ++i) {
|
32336 | if (typeof object.details[i] !== "object")
|
32337 | throw TypeError(".google.rpc.Status.details: object expected");
|
32338 | message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]);
|
32339 | }
|
32340 | }
|
32341 | return message;
|
32342 | };
|
32343 |
|
32344 | /**
|
32345 | * Creates a plain object from a Status message. Also converts values to other types if specified.
|
32346 | * @function toObject
|
32347 | * @memberof google.rpc.Status
|
32348 | * @static
|
32349 | * @param {google.rpc.Status} message Status
|
32350 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
32351 | * @returns {Object.<string,*>} Plain object
|
32352 | */
|
32353 | Status.toObject = function toObject(message, options) {
|
32354 | if (!options)
|
32355 | options = {};
|
32356 | var object = {};
|
32357 | if (options.arrays || options.defaults)
|
32358 | object.details = [];
|
32359 | if (options.defaults) {
|
32360 | object.code = 0;
|
32361 | object.message = "";
|
32362 | }
|
32363 | if (message.code != null && message.hasOwnProperty("code"))
|
32364 | object.code = message.code;
|
32365 | if (message.message != null && message.hasOwnProperty("message"))
|
32366 | object.message = message.message;
|
32367 | if (message.details && message.details.length) {
|
32368 | object.details = [];
|
32369 | for (var j = 0; j < message.details.length; ++j)
|
32370 | object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options);
|
32371 | }
|
32372 | return object;
|
32373 | };
|
32374 |
|
32375 | /**
|
32376 | * Converts this Status to JSON.
|
32377 | * @function toJSON
|
32378 | * @memberof google.rpc.Status
|
32379 | * @instance
|
32380 | * @returns {Object.<string,*>} JSON object
|
32381 | */
|
32382 | Status.prototype.toJSON = function toJSON() {
|
32383 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
32384 | };
|
32385 |
|
32386 | return Status;
|
32387 | })();
|
32388 |
|
32389 | return rpc;
|
32390 | })();
|
32391 |
|
32392 | return google;
|
32393 | })();
|
32394 |
|
32395 | return $root;
|
32396 | });
|