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_pubsub_protos || ($protobuf.roots._google_cloud_pubsub_protos = {});
|
32 |
|
33 | $root.google = (function() {
|
34 |
|
35 | /**
|
36 | * Namespace google.
|
37 | * @exports google
|
38 | * @namespace
|
39 | */
|
40 | var google = {};
|
41 |
|
42 | google.pubsub = (function() {
|
43 |
|
44 | /**
|
45 | * Namespace pubsub.
|
46 | * @memberof google
|
47 | * @namespace
|
48 | */
|
49 | var pubsub = {};
|
50 |
|
51 | pubsub.v1 = (function() {
|
52 |
|
53 | /**
|
54 | * Namespace v1.
|
55 | * @memberof google.pubsub
|
56 | * @namespace
|
57 | */
|
58 | var v1 = {};
|
59 |
|
60 | v1.Publisher = (function() {
|
61 |
|
62 | /**
|
63 | * Constructs a new Publisher service.
|
64 | * @memberof google.pubsub.v1
|
65 | * @classdesc Represents a Publisher
|
66 | * @extends $protobuf.rpc.Service
|
67 | * @constructor
|
68 | * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
|
69 | * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
|
70 | * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
|
71 | */
|
72 | function Publisher(rpcImpl, requestDelimited, responseDelimited) {
|
73 | $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);
|
74 | }
|
75 |
|
76 | (Publisher.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Publisher;
|
77 |
|
78 | /**
|
79 | * Creates new Publisher service using the specified rpc implementation.
|
80 | * @function create
|
81 | * @memberof google.pubsub.v1.Publisher
|
82 | * @static
|
83 | * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
|
84 | * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
|
85 | * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
|
86 | * @returns {Publisher} RPC service. Useful where requests and/or responses are streamed.
|
87 | */
|
88 | Publisher.create = function create(rpcImpl, requestDelimited, responseDelimited) {
|
89 | return new this(rpcImpl, requestDelimited, responseDelimited);
|
90 | };
|
91 |
|
92 | /**
|
93 | * Callback as used by {@link google.pubsub.v1.Publisher|createTopic}.
|
94 | * @memberof google.pubsub.v1.Publisher
|
95 | * @typedef CreateTopicCallback
|
96 | * @type {function}
|
97 | * @param {Error|null} error Error, if any
|
98 | * @param {google.pubsub.v1.Topic} [response] Topic
|
99 | */
|
100 |
|
101 | /**
|
102 | * Calls CreateTopic.
|
103 | * @function createTopic
|
104 | * @memberof google.pubsub.v1.Publisher
|
105 | * @instance
|
106 | * @param {google.pubsub.v1.ITopic} request Topic message or plain object
|
107 | * @param {google.pubsub.v1.Publisher.CreateTopicCallback} callback Node-style callback called with the error, if any, and Topic
|
108 | * @returns {undefined}
|
109 | * @variation 1
|
110 | */
|
111 | Object.defineProperty(Publisher.prototype.createTopic = function createTopic(request, callback) {
|
112 | return this.rpcCall(createTopic, $root.google.pubsub.v1.Topic, $root.google.pubsub.v1.Topic, request, callback);
|
113 | }, "name", { value: "CreateTopic" });
|
114 |
|
115 | /**
|
116 | * Calls CreateTopic.
|
117 | * @function createTopic
|
118 | * @memberof google.pubsub.v1.Publisher
|
119 | * @instance
|
120 | * @param {google.pubsub.v1.ITopic} request Topic message or plain object
|
121 | * @returns {Promise<google.pubsub.v1.Topic>} Promise
|
122 | * @variation 2
|
123 | */
|
124 |
|
125 | /**
|
126 | * Callback as used by {@link google.pubsub.v1.Publisher|updateTopic}.
|
127 | * @memberof google.pubsub.v1.Publisher
|
128 | * @typedef UpdateTopicCallback
|
129 | * @type {function}
|
130 | * @param {Error|null} error Error, if any
|
131 | * @param {google.pubsub.v1.Topic} [response] Topic
|
132 | */
|
133 |
|
134 | /**
|
135 | * Calls UpdateTopic.
|
136 | * @function updateTopic
|
137 | * @memberof google.pubsub.v1.Publisher
|
138 | * @instance
|
139 | * @param {google.pubsub.v1.IUpdateTopicRequest} request UpdateTopicRequest message or plain object
|
140 | * @param {google.pubsub.v1.Publisher.UpdateTopicCallback} callback Node-style callback called with the error, if any, and Topic
|
141 | * @returns {undefined}
|
142 | * @variation 1
|
143 | */
|
144 | Object.defineProperty(Publisher.prototype.updateTopic = function updateTopic(request, callback) {
|
145 | return this.rpcCall(updateTopic, $root.google.pubsub.v1.UpdateTopicRequest, $root.google.pubsub.v1.Topic, request, callback);
|
146 | }, "name", { value: "UpdateTopic" });
|
147 |
|
148 | /**
|
149 | * Calls UpdateTopic.
|
150 | * @function updateTopic
|
151 | * @memberof google.pubsub.v1.Publisher
|
152 | * @instance
|
153 | * @param {google.pubsub.v1.IUpdateTopicRequest} request UpdateTopicRequest message or plain object
|
154 | * @returns {Promise<google.pubsub.v1.Topic>} Promise
|
155 | * @variation 2
|
156 | */
|
157 |
|
158 | /**
|
159 | * Callback as used by {@link google.pubsub.v1.Publisher|publish}.
|
160 | * @memberof google.pubsub.v1.Publisher
|
161 | * @typedef PublishCallback
|
162 | * @type {function}
|
163 | * @param {Error|null} error Error, if any
|
164 | * @param {google.pubsub.v1.PublishResponse} [response] PublishResponse
|
165 | */
|
166 |
|
167 | /**
|
168 | * Calls Publish.
|
169 | * @function publish
|
170 | * @memberof google.pubsub.v1.Publisher
|
171 | * @instance
|
172 | * @param {google.pubsub.v1.IPublishRequest} request PublishRequest message or plain object
|
173 | * @param {google.pubsub.v1.Publisher.PublishCallback} callback Node-style callback called with the error, if any, and PublishResponse
|
174 | * @returns {undefined}
|
175 | * @variation 1
|
176 | */
|
177 | Object.defineProperty(Publisher.prototype.publish = function publish(request, callback) {
|
178 | return this.rpcCall(publish, $root.google.pubsub.v1.PublishRequest, $root.google.pubsub.v1.PublishResponse, request, callback);
|
179 | }, "name", { value: "Publish" });
|
180 |
|
181 | /**
|
182 | * Calls Publish.
|
183 | * @function publish
|
184 | * @memberof google.pubsub.v1.Publisher
|
185 | * @instance
|
186 | * @param {google.pubsub.v1.IPublishRequest} request PublishRequest message or plain object
|
187 | * @returns {Promise<google.pubsub.v1.PublishResponse>} Promise
|
188 | * @variation 2
|
189 | */
|
190 |
|
191 | /**
|
192 | * Callback as used by {@link google.pubsub.v1.Publisher|getTopic}.
|
193 | * @memberof google.pubsub.v1.Publisher
|
194 | * @typedef GetTopicCallback
|
195 | * @type {function}
|
196 | * @param {Error|null} error Error, if any
|
197 | * @param {google.pubsub.v1.Topic} [response] Topic
|
198 | */
|
199 |
|
200 | /**
|
201 | * Calls GetTopic.
|
202 | * @function getTopic
|
203 | * @memberof google.pubsub.v1.Publisher
|
204 | * @instance
|
205 | * @param {google.pubsub.v1.IGetTopicRequest} request GetTopicRequest message or plain object
|
206 | * @param {google.pubsub.v1.Publisher.GetTopicCallback} callback Node-style callback called with the error, if any, and Topic
|
207 | * @returns {undefined}
|
208 | * @variation 1
|
209 | */
|
210 | Object.defineProperty(Publisher.prototype.getTopic = function getTopic(request, callback) {
|
211 | return this.rpcCall(getTopic, $root.google.pubsub.v1.GetTopicRequest, $root.google.pubsub.v1.Topic, request, callback);
|
212 | }, "name", { value: "GetTopic" });
|
213 |
|
214 | /**
|
215 | * Calls GetTopic.
|
216 | * @function getTopic
|
217 | * @memberof google.pubsub.v1.Publisher
|
218 | * @instance
|
219 | * @param {google.pubsub.v1.IGetTopicRequest} request GetTopicRequest message or plain object
|
220 | * @returns {Promise<google.pubsub.v1.Topic>} Promise
|
221 | * @variation 2
|
222 | */
|
223 |
|
224 | /**
|
225 | * Callback as used by {@link google.pubsub.v1.Publisher|listTopics}.
|
226 | * @memberof google.pubsub.v1.Publisher
|
227 | * @typedef ListTopicsCallback
|
228 | * @type {function}
|
229 | * @param {Error|null} error Error, if any
|
230 | * @param {google.pubsub.v1.ListTopicsResponse} [response] ListTopicsResponse
|
231 | */
|
232 |
|
233 | /**
|
234 | * Calls ListTopics.
|
235 | * @function listTopics
|
236 | * @memberof google.pubsub.v1.Publisher
|
237 | * @instance
|
238 | * @param {google.pubsub.v1.IListTopicsRequest} request ListTopicsRequest message or plain object
|
239 | * @param {google.pubsub.v1.Publisher.ListTopicsCallback} callback Node-style callback called with the error, if any, and ListTopicsResponse
|
240 | * @returns {undefined}
|
241 | * @variation 1
|
242 | */
|
243 | Object.defineProperty(Publisher.prototype.listTopics = function listTopics(request, callback) {
|
244 | return this.rpcCall(listTopics, $root.google.pubsub.v1.ListTopicsRequest, $root.google.pubsub.v1.ListTopicsResponse, request, callback);
|
245 | }, "name", { value: "ListTopics" });
|
246 |
|
247 | /**
|
248 | * Calls ListTopics.
|
249 | * @function listTopics
|
250 | * @memberof google.pubsub.v1.Publisher
|
251 | * @instance
|
252 | * @param {google.pubsub.v1.IListTopicsRequest} request ListTopicsRequest message or plain object
|
253 | * @returns {Promise<google.pubsub.v1.ListTopicsResponse>} Promise
|
254 | * @variation 2
|
255 | */
|
256 |
|
257 | /**
|
258 | * Callback as used by {@link google.pubsub.v1.Publisher|listTopicSubscriptions}.
|
259 | * @memberof google.pubsub.v1.Publisher
|
260 | * @typedef ListTopicSubscriptionsCallback
|
261 | * @type {function}
|
262 | * @param {Error|null} error Error, if any
|
263 | * @param {google.pubsub.v1.ListTopicSubscriptionsResponse} [response] ListTopicSubscriptionsResponse
|
264 | */
|
265 |
|
266 | /**
|
267 | * Calls ListTopicSubscriptions.
|
268 | * @function listTopicSubscriptions
|
269 | * @memberof google.pubsub.v1.Publisher
|
270 | * @instance
|
271 | * @param {google.pubsub.v1.IListTopicSubscriptionsRequest} request ListTopicSubscriptionsRequest message or plain object
|
272 | * @param {google.pubsub.v1.Publisher.ListTopicSubscriptionsCallback} callback Node-style callback called with the error, if any, and ListTopicSubscriptionsResponse
|
273 | * @returns {undefined}
|
274 | * @variation 1
|
275 | */
|
276 | Object.defineProperty(Publisher.prototype.listTopicSubscriptions = function listTopicSubscriptions(request, callback) {
|
277 | return this.rpcCall(listTopicSubscriptions, $root.google.pubsub.v1.ListTopicSubscriptionsRequest, $root.google.pubsub.v1.ListTopicSubscriptionsResponse, request, callback);
|
278 | }, "name", { value: "ListTopicSubscriptions" });
|
279 |
|
280 | /**
|
281 | * Calls ListTopicSubscriptions.
|
282 | * @function listTopicSubscriptions
|
283 | * @memberof google.pubsub.v1.Publisher
|
284 | * @instance
|
285 | * @param {google.pubsub.v1.IListTopicSubscriptionsRequest} request ListTopicSubscriptionsRequest message or plain object
|
286 | * @returns {Promise<google.pubsub.v1.ListTopicSubscriptionsResponse>} Promise
|
287 | * @variation 2
|
288 | */
|
289 |
|
290 | /**
|
291 | * Callback as used by {@link google.pubsub.v1.Publisher|listTopicSnapshots}.
|
292 | * @memberof google.pubsub.v1.Publisher
|
293 | * @typedef ListTopicSnapshotsCallback
|
294 | * @type {function}
|
295 | * @param {Error|null} error Error, if any
|
296 | * @param {google.pubsub.v1.ListTopicSnapshotsResponse} [response] ListTopicSnapshotsResponse
|
297 | */
|
298 |
|
299 | /**
|
300 | * Calls ListTopicSnapshots.
|
301 | * @function listTopicSnapshots
|
302 | * @memberof google.pubsub.v1.Publisher
|
303 | * @instance
|
304 | * @param {google.pubsub.v1.IListTopicSnapshotsRequest} request ListTopicSnapshotsRequest message or plain object
|
305 | * @param {google.pubsub.v1.Publisher.ListTopicSnapshotsCallback} callback Node-style callback called with the error, if any, and ListTopicSnapshotsResponse
|
306 | * @returns {undefined}
|
307 | * @variation 1
|
308 | */
|
309 | Object.defineProperty(Publisher.prototype.listTopicSnapshots = function listTopicSnapshots(request, callback) {
|
310 | return this.rpcCall(listTopicSnapshots, $root.google.pubsub.v1.ListTopicSnapshotsRequest, $root.google.pubsub.v1.ListTopicSnapshotsResponse, request, callback);
|
311 | }, "name", { value: "ListTopicSnapshots" });
|
312 |
|
313 | /**
|
314 | * Calls ListTopicSnapshots.
|
315 | * @function listTopicSnapshots
|
316 | * @memberof google.pubsub.v1.Publisher
|
317 | * @instance
|
318 | * @param {google.pubsub.v1.IListTopicSnapshotsRequest} request ListTopicSnapshotsRequest message or plain object
|
319 | * @returns {Promise<google.pubsub.v1.ListTopicSnapshotsResponse>} Promise
|
320 | * @variation 2
|
321 | */
|
322 |
|
323 | /**
|
324 | * Callback as used by {@link google.pubsub.v1.Publisher|deleteTopic}.
|
325 | * @memberof google.pubsub.v1.Publisher
|
326 | * @typedef DeleteTopicCallback
|
327 | * @type {function}
|
328 | * @param {Error|null} error Error, if any
|
329 | * @param {google.protobuf.Empty} [response] Empty
|
330 | */
|
331 |
|
332 | /**
|
333 | * Calls DeleteTopic.
|
334 | * @function deleteTopic
|
335 | * @memberof google.pubsub.v1.Publisher
|
336 | * @instance
|
337 | * @param {google.pubsub.v1.IDeleteTopicRequest} request DeleteTopicRequest message or plain object
|
338 | * @param {google.pubsub.v1.Publisher.DeleteTopicCallback} callback Node-style callback called with the error, if any, and Empty
|
339 | * @returns {undefined}
|
340 | * @variation 1
|
341 | */
|
342 | Object.defineProperty(Publisher.prototype.deleteTopic = function deleteTopic(request, callback) {
|
343 | return this.rpcCall(deleteTopic, $root.google.pubsub.v1.DeleteTopicRequest, $root.google.protobuf.Empty, request, callback);
|
344 | }, "name", { value: "DeleteTopic" });
|
345 |
|
346 | /**
|
347 | * Calls DeleteTopic.
|
348 | * @function deleteTopic
|
349 | * @memberof google.pubsub.v1.Publisher
|
350 | * @instance
|
351 | * @param {google.pubsub.v1.IDeleteTopicRequest} request DeleteTopicRequest message or plain object
|
352 | * @returns {Promise<google.protobuf.Empty>} Promise
|
353 | * @variation 2
|
354 | */
|
355 |
|
356 | /**
|
357 | * Callback as used by {@link google.pubsub.v1.Publisher|detachSubscription}.
|
358 | * @memberof google.pubsub.v1.Publisher
|
359 | * @typedef DetachSubscriptionCallback
|
360 | * @type {function}
|
361 | * @param {Error|null} error Error, if any
|
362 | * @param {google.pubsub.v1.DetachSubscriptionResponse} [response] DetachSubscriptionResponse
|
363 | */
|
364 |
|
365 | /**
|
366 | * Calls DetachSubscription.
|
367 | * @function detachSubscription
|
368 | * @memberof google.pubsub.v1.Publisher
|
369 | * @instance
|
370 | * @param {google.pubsub.v1.IDetachSubscriptionRequest} request DetachSubscriptionRequest message or plain object
|
371 | * @param {google.pubsub.v1.Publisher.DetachSubscriptionCallback} callback Node-style callback called with the error, if any, and DetachSubscriptionResponse
|
372 | * @returns {undefined}
|
373 | * @variation 1
|
374 | */
|
375 | Object.defineProperty(Publisher.prototype.detachSubscription = function detachSubscription(request, callback) {
|
376 | return this.rpcCall(detachSubscription, $root.google.pubsub.v1.DetachSubscriptionRequest, $root.google.pubsub.v1.DetachSubscriptionResponse, request, callback);
|
377 | }, "name", { value: "DetachSubscription" });
|
378 |
|
379 | /**
|
380 | * Calls DetachSubscription.
|
381 | * @function detachSubscription
|
382 | * @memberof google.pubsub.v1.Publisher
|
383 | * @instance
|
384 | * @param {google.pubsub.v1.IDetachSubscriptionRequest} request DetachSubscriptionRequest message or plain object
|
385 | * @returns {Promise<google.pubsub.v1.DetachSubscriptionResponse>} Promise
|
386 | * @variation 2
|
387 | */
|
388 |
|
389 | return Publisher;
|
390 | })();
|
391 |
|
392 | v1.MessageStoragePolicy = (function() {
|
393 |
|
394 | /**
|
395 | * Properties of a MessageStoragePolicy.
|
396 | * @memberof google.pubsub.v1
|
397 | * @interface IMessageStoragePolicy
|
398 | * @property {Array.<string>|null} [allowedPersistenceRegions] MessageStoragePolicy allowedPersistenceRegions
|
399 | */
|
400 |
|
401 | /**
|
402 | * Constructs a new MessageStoragePolicy.
|
403 | * @memberof google.pubsub.v1
|
404 | * @classdesc Represents a MessageStoragePolicy.
|
405 | * @implements IMessageStoragePolicy
|
406 | * @constructor
|
407 | * @param {google.pubsub.v1.IMessageStoragePolicy=} [properties] Properties to set
|
408 | */
|
409 | function MessageStoragePolicy(properties) {
|
410 | this.allowedPersistenceRegions = [];
|
411 | if (properties)
|
412 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
413 | if (properties[keys[i]] != null)
|
414 | this[keys[i]] = properties[keys[i]];
|
415 | }
|
416 |
|
417 | /**
|
418 | * MessageStoragePolicy allowedPersistenceRegions.
|
419 | * @member {Array.<string>} allowedPersistenceRegions
|
420 | * @memberof google.pubsub.v1.MessageStoragePolicy
|
421 | * @instance
|
422 | */
|
423 | MessageStoragePolicy.prototype.allowedPersistenceRegions = $util.emptyArray;
|
424 |
|
425 | /**
|
426 | * Creates a new MessageStoragePolicy instance using the specified properties.
|
427 | * @function create
|
428 | * @memberof google.pubsub.v1.MessageStoragePolicy
|
429 | * @static
|
430 | * @param {google.pubsub.v1.IMessageStoragePolicy=} [properties] Properties to set
|
431 | * @returns {google.pubsub.v1.MessageStoragePolicy} MessageStoragePolicy instance
|
432 | */
|
433 | MessageStoragePolicy.create = function create(properties) {
|
434 | return new MessageStoragePolicy(properties);
|
435 | };
|
436 |
|
437 | /**
|
438 | * Encodes the specified MessageStoragePolicy message. Does not implicitly {@link google.pubsub.v1.MessageStoragePolicy.verify|verify} messages.
|
439 | * @function encode
|
440 | * @memberof google.pubsub.v1.MessageStoragePolicy
|
441 | * @static
|
442 | * @param {google.pubsub.v1.IMessageStoragePolicy} message MessageStoragePolicy message or plain object to encode
|
443 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
444 | * @returns {$protobuf.Writer} Writer
|
445 | */
|
446 | MessageStoragePolicy.encode = function encode(message, writer) {
|
447 | if (!writer)
|
448 | writer = $Writer.create();
|
449 | if (message.allowedPersistenceRegions != null && message.allowedPersistenceRegions.length)
|
450 | for (var i = 0; i < message.allowedPersistenceRegions.length; ++i)
|
451 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.allowedPersistenceRegions[i]);
|
452 | return writer;
|
453 | };
|
454 |
|
455 | /**
|
456 | * Encodes the specified MessageStoragePolicy message, length delimited. Does not implicitly {@link google.pubsub.v1.MessageStoragePolicy.verify|verify} messages.
|
457 | * @function encodeDelimited
|
458 | * @memberof google.pubsub.v1.MessageStoragePolicy
|
459 | * @static
|
460 | * @param {google.pubsub.v1.IMessageStoragePolicy} message MessageStoragePolicy message or plain object to encode
|
461 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
462 | * @returns {$protobuf.Writer} Writer
|
463 | */
|
464 | MessageStoragePolicy.encodeDelimited = function encodeDelimited(message, writer) {
|
465 | return this.encode(message, writer).ldelim();
|
466 | };
|
467 |
|
468 | /**
|
469 | * Decodes a MessageStoragePolicy message from the specified reader or buffer.
|
470 | * @function decode
|
471 | * @memberof google.pubsub.v1.MessageStoragePolicy
|
472 | * @static
|
473 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
474 | * @param {number} [length] Message length if known beforehand
|
475 | * @returns {google.pubsub.v1.MessageStoragePolicy} MessageStoragePolicy
|
476 | * @throws {Error} If the payload is not a reader or valid buffer
|
477 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
478 | */
|
479 | MessageStoragePolicy.decode = function decode(reader, length) {
|
480 | if (!(reader instanceof $Reader))
|
481 | reader = $Reader.create(reader);
|
482 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.MessageStoragePolicy();
|
483 | while (reader.pos < end) {
|
484 | var tag = reader.uint32();
|
485 | switch (tag >>> 3) {
|
486 | case 1:
|
487 | if (!(message.allowedPersistenceRegions && message.allowedPersistenceRegions.length))
|
488 | message.allowedPersistenceRegions = [];
|
489 | message.allowedPersistenceRegions.push(reader.string());
|
490 | break;
|
491 | default:
|
492 | reader.skipType(tag & 7);
|
493 | break;
|
494 | }
|
495 | }
|
496 | return message;
|
497 | };
|
498 |
|
499 | /**
|
500 | * Decodes a MessageStoragePolicy message from the specified reader or buffer, length delimited.
|
501 | * @function decodeDelimited
|
502 | * @memberof google.pubsub.v1.MessageStoragePolicy
|
503 | * @static
|
504 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
505 | * @returns {google.pubsub.v1.MessageStoragePolicy} MessageStoragePolicy
|
506 | * @throws {Error} If the payload is not a reader or valid buffer
|
507 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
508 | */
|
509 | MessageStoragePolicy.decodeDelimited = function decodeDelimited(reader) {
|
510 | if (!(reader instanceof $Reader))
|
511 | reader = new $Reader(reader);
|
512 | return this.decode(reader, reader.uint32());
|
513 | };
|
514 |
|
515 | /**
|
516 | * Verifies a MessageStoragePolicy message.
|
517 | * @function verify
|
518 | * @memberof google.pubsub.v1.MessageStoragePolicy
|
519 | * @static
|
520 | * @param {Object.<string,*>} message Plain object to verify
|
521 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
522 | */
|
523 | MessageStoragePolicy.verify = function verify(message) {
|
524 | if (typeof message !== "object" || message === null)
|
525 | return "object expected";
|
526 | if (message.allowedPersistenceRegions != null && message.hasOwnProperty("allowedPersistenceRegions")) {
|
527 | if (!Array.isArray(message.allowedPersistenceRegions))
|
528 | return "allowedPersistenceRegions: array expected";
|
529 | for (var i = 0; i < message.allowedPersistenceRegions.length; ++i)
|
530 | if (!$util.isString(message.allowedPersistenceRegions[i]))
|
531 | return "allowedPersistenceRegions: string[] expected";
|
532 | }
|
533 | return null;
|
534 | };
|
535 |
|
536 | /**
|
537 | * Creates a MessageStoragePolicy message from a plain object. Also converts values to their respective internal types.
|
538 | * @function fromObject
|
539 | * @memberof google.pubsub.v1.MessageStoragePolicy
|
540 | * @static
|
541 | * @param {Object.<string,*>} object Plain object
|
542 | * @returns {google.pubsub.v1.MessageStoragePolicy} MessageStoragePolicy
|
543 | */
|
544 | MessageStoragePolicy.fromObject = function fromObject(object) {
|
545 | if (object instanceof $root.google.pubsub.v1.MessageStoragePolicy)
|
546 | return object;
|
547 | var message = new $root.google.pubsub.v1.MessageStoragePolicy();
|
548 | if (object.allowedPersistenceRegions) {
|
549 | if (!Array.isArray(object.allowedPersistenceRegions))
|
550 | throw TypeError(".google.pubsub.v1.MessageStoragePolicy.allowedPersistenceRegions: array expected");
|
551 | message.allowedPersistenceRegions = [];
|
552 | for (var i = 0; i < object.allowedPersistenceRegions.length; ++i)
|
553 | message.allowedPersistenceRegions[i] = String(object.allowedPersistenceRegions[i]);
|
554 | }
|
555 | return message;
|
556 | };
|
557 |
|
558 | /**
|
559 | * Creates a plain object from a MessageStoragePolicy message. Also converts values to other types if specified.
|
560 | * @function toObject
|
561 | * @memberof google.pubsub.v1.MessageStoragePolicy
|
562 | * @static
|
563 | * @param {google.pubsub.v1.MessageStoragePolicy} message MessageStoragePolicy
|
564 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
565 | * @returns {Object.<string,*>} Plain object
|
566 | */
|
567 | MessageStoragePolicy.toObject = function toObject(message, options) {
|
568 | if (!options)
|
569 | options = {};
|
570 | var object = {};
|
571 | if (options.arrays || options.defaults)
|
572 | object.allowedPersistenceRegions = [];
|
573 | if (message.allowedPersistenceRegions && message.allowedPersistenceRegions.length) {
|
574 | object.allowedPersistenceRegions = [];
|
575 | for (var j = 0; j < message.allowedPersistenceRegions.length; ++j)
|
576 | object.allowedPersistenceRegions[j] = message.allowedPersistenceRegions[j];
|
577 | }
|
578 | return object;
|
579 | };
|
580 |
|
581 | /**
|
582 | * Converts this MessageStoragePolicy to JSON.
|
583 | * @function toJSON
|
584 | * @memberof google.pubsub.v1.MessageStoragePolicy
|
585 | * @instance
|
586 | * @returns {Object.<string,*>} JSON object
|
587 | */
|
588 | MessageStoragePolicy.prototype.toJSON = function toJSON() {
|
589 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
590 | };
|
591 |
|
592 | return MessageStoragePolicy;
|
593 | })();
|
594 |
|
595 | v1.SchemaSettings = (function() {
|
596 |
|
597 | /**
|
598 | * Properties of a SchemaSettings.
|
599 | * @memberof google.pubsub.v1
|
600 | * @interface ISchemaSettings
|
601 | * @property {string|null} [schema] SchemaSettings schema
|
602 | * @property {google.pubsub.v1.Encoding|null} [encoding] SchemaSettings encoding
|
603 | */
|
604 |
|
605 | /**
|
606 | * Constructs a new SchemaSettings.
|
607 | * @memberof google.pubsub.v1
|
608 | * @classdesc Represents a SchemaSettings.
|
609 | * @implements ISchemaSettings
|
610 | * @constructor
|
611 | * @param {google.pubsub.v1.ISchemaSettings=} [properties] Properties to set
|
612 | */
|
613 | function SchemaSettings(properties) {
|
614 | if (properties)
|
615 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
616 | if (properties[keys[i]] != null)
|
617 | this[keys[i]] = properties[keys[i]];
|
618 | }
|
619 |
|
620 | /**
|
621 | * SchemaSettings schema.
|
622 | * @member {string} schema
|
623 | * @memberof google.pubsub.v1.SchemaSettings
|
624 | * @instance
|
625 | */
|
626 | SchemaSettings.prototype.schema = "";
|
627 |
|
628 | /**
|
629 | * SchemaSettings encoding.
|
630 | * @member {google.pubsub.v1.Encoding} encoding
|
631 | * @memberof google.pubsub.v1.SchemaSettings
|
632 | * @instance
|
633 | */
|
634 | SchemaSettings.prototype.encoding = 0;
|
635 |
|
636 | /**
|
637 | * Creates a new SchemaSettings instance using the specified properties.
|
638 | * @function create
|
639 | * @memberof google.pubsub.v1.SchemaSettings
|
640 | * @static
|
641 | * @param {google.pubsub.v1.ISchemaSettings=} [properties] Properties to set
|
642 | * @returns {google.pubsub.v1.SchemaSettings} SchemaSettings instance
|
643 | */
|
644 | SchemaSettings.create = function create(properties) {
|
645 | return new SchemaSettings(properties);
|
646 | };
|
647 |
|
648 | /**
|
649 | * Encodes the specified SchemaSettings message. Does not implicitly {@link google.pubsub.v1.SchemaSettings.verify|verify} messages.
|
650 | * @function encode
|
651 | * @memberof google.pubsub.v1.SchemaSettings
|
652 | * @static
|
653 | * @param {google.pubsub.v1.ISchemaSettings} message SchemaSettings message or plain object to encode
|
654 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
655 | * @returns {$protobuf.Writer} Writer
|
656 | */
|
657 | SchemaSettings.encode = function encode(message, writer) {
|
658 | if (!writer)
|
659 | writer = $Writer.create();
|
660 | if (message.schema != null && Object.hasOwnProperty.call(message, "schema"))
|
661 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.schema);
|
662 | if (message.encoding != null && Object.hasOwnProperty.call(message, "encoding"))
|
663 | writer.uint32(/* id 2, wireType 0 =*/16).int32(message.encoding);
|
664 | return writer;
|
665 | };
|
666 |
|
667 | /**
|
668 | * Encodes the specified SchemaSettings message, length delimited. Does not implicitly {@link google.pubsub.v1.SchemaSettings.verify|verify} messages.
|
669 | * @function encodeDelimited
|
670 | * @memberof google.pubsub.v1.SchemaSettings
|
671 | * @static
|
672 | * @param {google.pubsub.v1.ISchemaSettings} message SchemaSettings message or plain object to encode
|
673 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
674 | * @returns {$protobuf.Writer} Writer
|
675 | */
|
676 | SchemaSettings.encodeDelimited = function encodeDelimited(message, writer) {
|
677 | return this.encode(message, writer).ldelim();
|
678 | };
|
679 |
|
680 | /**
|
681 | * Decodes a SchemaSettings message from the specified reader or buffer.
|
682 | * @function decode
|
683 | * @memberof google.pubsub.v1.SchemaSettings
|
684 | * @static
|
685 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
686 | * @param {number} [length] Message length if known beforehand
|
687 | * @returns {google.pubsub.v1.SchemaSettings} SchemaSettings
|
688 | * @throws {Error} If the payload is not a reader or valid buffer
|
689 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
690 | */
|
691 | SchemaSettings.decode = function decode(reader, length) {
|
692 | if (!(reader instanceof $Reader))
|
693 | reader = $Reader.create(reader);
|
694 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.SchemaSettings();
|
695 | while (reader.pos < end) {
|
696 | var tag = reader.uint32();
|
697 | switch (tag >>> 3) {
|
698 | case 1:
|
699 | message.schema = reader.string();
|
700 | break;
|
701 | case 2:
|
702 | message.encoding = reader.int32();
|
703 | break;
|
704 | default:
|
705 | reader.skipType(tag & 7);
|
706 | break;
|
707 | }
|
708 | }
|
709 | return message;
|
710 | };
|
711 |
|
712 | /**
|
713 | * Decodes a SchemaSettings message from the specified reader or buffer, length delimited.
|
714 | * @function decodeDelimited
|
715 | * @memberof google.pubsub.v1.SchemaSettings
|
716 | * @static
|
717 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
718 | * @returns {google.pubsub.v1.SchemaSettings} SchemaSettings
|
719 | * @throws {Error} If the payload is not a reader or valid buffer
|
720 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
721 | */
|
722 | SchemaSettings.decodeDelimited = function decodeDelimited(reader) {
|
723 | if (!(reader instanceof $Reader))
|
724 | reader = new $Reader(reader);
|
725 | return this.decode(reader, reader.uint32());
|
726 | };
|
727 |
|
728 | /**
|
729 | * Verifies a SchemaSettings message.
|
730 | * @function verify
|
731 | * @memberof google.pubsub.v1.SchemaSettings
|
732 | * @static
|
733 | * @param {Object.<string,*>} message Plain object to verify
|
734 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
735 | */
|
736 | SchemaSettings.verify = function verify(message) {
|
737 | if (typeof message !== "object" || message === null)
|
738 | return "object expected";
|
739 | if (message.schema != null && message.hasOwnProperty("schema"))
|
740 | if (!$util.isString(message.schema))
|
741 | return "schema: string expected";
|
742 | if (message.encoding != null && message.hasOwnProperty("encoding"))
|
743 | switch (message.encoding) {
|
744 | default:
|
745 | return "encoding: enum value expected";
|
746 | case 0:
|
747 | case 1:
|
748 | case 2:
|
749 | break;
|
750 | }
|
751 | return null;
|
752 | };
|
753 |
|
754 | /**
|
755 | * Creates a SchemaSettings message from a plain object. Also converts values to their respective internal types.
|
756 | * @function fromObject
|
757 | * @memberof google.pubsub.v1.SchemaSettings
|
758 | * @static
|
759 | * @param {Object.<string,*>} object Plain object
|
760 | * @returns {google.pubsub.v1.SchemaSettings} SchemaSettings
|
761 | */
|
762 | SchemaSettings.fromObject = function fromObject(object) {
|
763 | if (object instanceof $root.google.pubsub.v1.SchemaSettings)
|
764 | return object;
|
765 | var message = new $root.google.pubsub.v1.SchemaSettings();
|
766 | if (object.schema != null)
|
767 | message.schema = String(object.schema);
|
768 | switch (object.encoding) {
|
769 | case "ENCODING_UNSPECIFIED":
|
770 | case 0:
|
771 | message.encoding = 0;
|
772 | break;
|
773 | case "JSON":
|
774 | case 1:
|
775 | message.encoding = 1;
|
776 | break;
|
777 | case "BINARY":
|
778 | case 2:
|
779 | message.encoding = 2;
|
780 | break;
|
781 | }
|
782 | return message;
|
783 | };
|
784 |
|
785 | /**
|
786 | * Creates a plain object from a SchemaSettings message. Also converts values to other types if specified.
|
787 | * @function toObject
|
788 | * @memberof google.pubsub.v1.SchemaSettings
|
789 | * @static
|
790 | * @param {google.pubsub.v1.SchemaSettings} message SchemaSettings
|
791 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
792 | * @returns {Object.<string,*>} Plain object
|
793 | */
|
794 | SchemaSettings.toObject = function toObject(message, options) {
|
795 | if (!options)
|
796 | options = {};
|
797 | var object = {};
|
798 | if (options.defaults) {
|
799 | object.schema = "";
|
800 | object.encoding = options.enums === String ? "ENCODING_UNSPECIFIED" : 0;
|
801 | }
|
802 | if (message.schema != null && message.hasOwnProperty("schema"))
|
803 | object.schema = message.schema;
|
804 | if (message.encoding != null && message.hasOwnProperty("encoding"))
|
805 | object.encoding = options.enums === String ? $root.google.pubsub.v1.Encoding[message.encoding] : message.encoding;
|
806 | return object;
|
807 | };
|
808 |
|
809 | /**
|
810 | * Converts this SchemaSettings to JSON.
|
811 | * @function toJSON
|
812 | * @memberof google.pubsub.v1.SchemaSettings
|
813 | * @instance
|
814 | * @returns {Object.<string,*>} JSON object
|
815 | */
|
816 | SchemaSettings.prototype.toJSON = function toJSON() {
|
817 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
818 | };
|
819 |
|
820 | return SchemaSettings;
|
821 | })();
|
822 |
|
823 | v1.Topic = (function() {
|
824 |
|
825 | /**
|
826 | * Properties of a Topic.
|
827 | * @memberof google.pubsub.v1
|
828 | * @interface ITopic
|
829 | * @property {string|null} [name] Topic name
|
830 | * @property {Object.<string,string>|null} [labels] Topic labels
|
831 | * @property {google.pubsub.v1.IMessageStoragePolicy|null} [messageStoragePolicy] Topic messageStoragePolicy
|
832 | * @property {string|null} [kmsKeyName] Topic kmsKeyName
|
833 | * @property {google.pubsub.v1.ISchemaSettings|null} [schemaSettings] Topic schemaSettings
|
834 | * @property {boolean|null} [satisfiesPzs] Topic satisfiesPzs
|
835 | * @property {google.protobuf.IDuration|null} [messageRetentionDuration] Topic messageRetentionDuration
|
836 | */
|
837 |
|
838 | /**
|
839 | * Constructs a new Topic.
|
840 | * @memberof google.pubsub.v1
|
841 | * @classdesc Represents a Topic.
|
842 | * @implements ITopic
|
843 | * @constructor
|
844 | * @param {google.pubsub.v1.ITopic=} [properties] Properties to set
|
845 | */
|
846 | function Topic(properties) {
|
847 | this.labels = {};
|
848 | if (properties)
|
849 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
850 | if (properties[keys[i]] != null)
|
851 | this[keys[i]] = properties[keys[i]];
|
852 | }
|
853 |
|
854 | /**
|
855 | * Topic name.
|
856 | * @member {string} name
|
857 | * @memberof google.pubsub.v1.Topic
|
858 | * @instance
|
859 | */
|
860 | Topic.prototype.name = "";
|
861 |
|
862 | /**
|
863 | * Topic labels.
|
864 | * @member {Object.<string,string>} labels
|
865 | * @memberof google.pubsub.v1.Topic
|
866 | * @instance
|
867 | */
|
868 | Topic.prototype.labels = $util.emptyObject;
|
869 |
|
870 | /**
|
871 | * Topic messageStoragePolicy.
|
872 | * @member {google.pubsub.v1.IMessageStoragePolicy|null|undefined} messageStoragePolicy
|
873 | * @memberof google.pubsub.v1.Topic
|
874 | * @instance
|
875 | */
|
876 | Topic.prototype.messageStoragePolicy = null;
|
877 |
|
878 | /**
|
879 | * Topic kmsKeyName.
|
880 | * @member {string} kmsKeyName
|
881 | * @memberof google.pubsub.v1.Topic
|
882 | * @instance
|
883 | */
|
884 | Topic.prototype.kmsKeyName = "";
|
885 |
|
886 | /**
|
887 | * Topic schemaSettings.
|
888 | * @member {google.pubsub.v1.ISchemaSettings|null|undefined} schemaSettings
|
889 | * @memberof google.pubsub.v1.Topic
|
890 | * @instance
|
891 | */
|
892 | Topic.prototype.schemaSettings = null;
|
893 |
|
894 | /**
|
895 | * Topic satisfiesPzs.
|
896 | * @member {boolean} satisfiesPzs
|
897 | * @memberof google.pubsub.v1.Topic
|
898 | * @instance
|
899 | */
|
900 | Topic.prototype.satisfiesPzs = false;
|
901 |
|
902 | /**
|
903 | * Topic messageRetentionDuration.
|
904 | * @member {google.protobuf.IDuration|null|undefined} messageRetentionDuration
|
905 | * @memberof google.pubsub.v1.Topic
|
906 | * @instance
|
907 | */
|
908 | Topic.prototype.messageRetentionDuration = null;
|
909 |
|
910 | /**
|
911 | * Creates a new Topic instance using the specified properties.
|
912 | * @function create
|
913 | * @memberof google.pubsub.v1.Topic
|
914 | * @static
|
915 | * @param {google.pubsub.v1.ITopic=} [properties] Properties to set
|
916 | * @returns {google.pubsub.v1.Topic} Topic instance
|
917 | */
|
918 | Topic.create = function create(properties) {
|
919 | return new Topic(properties);
|
920 | };
|
921 |
|
922 | /**
|
923 | * Encodes the specified Topic message. Does not implicitly {@link google.pubsub.v1.Topic.verify|verify} messages.
|
924 | * @function encode
|
925 | * @memberof google.pubsub.v1.Topic
|
926 | * @static
|
927 | * @param {google.pubsub.v1.ITopic} message Topic message or plain object to encode
|
928 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
929 | * @returns {$protobuf.Writer} Writer
|
930 | */
|
931 | Topic.encode = function encode(message, writer) {
|
932 | if (!writer)
|
933 | writer = $Writer.create();
|
934 | if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
935 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
|
936 | if (message.labels != null && Object.hasOwnProperty.call(message, "labels"))
|
937 | for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i)
|
938 | writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim();
|
939 | if (message.messageStoragePolicy != null && Object.hasOwnProperty.call(message, "messageStoragePolicy"))
|
940 | $root.google.pubsub.v1.MessageStoragePolicy.encode(message.messageStoragePolicy, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
|
941 | if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName"))
|
942 | writer.uint32(/* id 5, wireType 2 =*/42).string(message.kmsKeyName);
|
943 | if (message.schemaSettings != null && Object.hasOwnProperty.call(message, "schemaSettings"))
|
944 | $root.google.pubsub.v1.SchemaSettings.encode(message.schemaSettings, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
|
945 | if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs"))
|
946 | writer.uint32(/* id 7, wireType 0 =*/56).bool(message.satisfiesPzs);
|
947 | if (message.messageRetentionDuration != null && Object.hasOwnProperty.call(message, "messageRetentionDuration"))
|
948 | $root.google.protobuf.Duration.encode(message.messageRetentionDuration, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();
|
949 | return writer;
|
950 | };
|
951 |
|
952 | /**
|
953 | * Encodes the specified Topic message, length delimited. Does not implicitly {@link google.pubsub.v1.Topic.verify|verify} messages.
|
954 | * @function encodeDelimited
|
955 | * @memberof google.pubsub.v1.Topic
|
956 | * @static
|
957 | * @param {google.pubsub.v1.ITopic} message Topic message or plain object to encode
|
958 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
959 | * @returns {$protobuf.Writer} Writer
|
960 | */
|
961 | Topic.encodeDelimited = function encodeDelimited(message, writer) {
|
962 | return this.encode(message, writer).ldelim();
|
963 | };
|
964 |
|
965 | /**
|
966 | * Decodes a Topic message from the specified reader or buffer.
|
967 | * @function decode
|
968 | * @memberof google.pubsub.v1.Topic
|
969 | * @static
|
970 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
971 | * @param {number} [length] Message length if known beforehand
|
972 | * @returns {google.pubsub.v1.Topic} Topic
|
973 | * @throws {Error} If the payload is not a reader or valid buffer
|
974 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
975 | */
|
976 | Topic.decode = function decode(reader, length) {
|
977 | if (!(reader instanceof $Reader))
|
978 | reader = $Reader.create(reader);
|
979 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.Topic(), key, value;
|
980 | while (reader.pos < end) {
|
981 | var tag = reader.uint32();
|
982 | switch (tag >>> 3) {
|
983 | case 1:
|
984 | message.name = reader.string();
|
985 | break;
|
986 | case 2:
|
987 | if (message.labels === $util.emptyObject)
|
988 | message.labels = {};
|
989 | var end2 = reader.uint32() + reader.pos;
|
990 | key = "";
|
991 | value = "";
|
992 | while (reader.pos < end2) {
|
993 | var tag2 = reader.uint32();
|
994 | switch (tag2 >>> 3) {
|
995 | case 1:
|
996 | key = reader.string();
|
997 | break;
|
998 | case 2:
|
999 | value = reader.string();
|
1000 | break;
|
1001 | default:
|
1002 | reader.skipType(tag2 & 7);
|
1003 | break;
|
1004 | }
|
1005 | }
|
1006 | message.labels[key] = value;
|
1007 | break;
|
1008 | case 3:
|
1009 | message.messageStoragePolicy = $root.google.pubsub.v1.MessageStoragePolicy.decode(reader, reader.uint32());
|
1010 | break;
|
1011 | case 5:
|
1012 | message.kmsKeyName = reader.string();
|
1013 | break;
|
1014 | case 6:
|
1015 | message.schemaSettings = $root.google.pubsub.v1.SchemaSettings.decode(reader, reader.uint32());
|
1016 | break;
|
1017 | case 7:
|
1018 | message.satisfiesPzs = reader.bool();
|
1019 | break;
|
1020 | case 8:
|
1021 | message.messageRetentionDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32());
|
1022 | break;
|
1023 | default:
|
1024 | reader.skipType(tag & 7);
|
1025 | break;
|
1026 | }
|
1027 | }
|
1028 | return message;
|
1029 | };
|
1030 |
|
1031 | /**
|
1032 | * Decodes a Topic message from the specified reader or buffer, length delimited.
|
1033 | * @function decodeDelimited
|
1034 | * @memberof google.pubsub.v1.Topic
|
1035 | * @static
|
1036 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
1037 | * @returns {google.pubsub.v1.Topic} Topic
|
1038 | * @throws {Error} If the payload is not a reader or valid buffer
|
1039 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
1040 | */
|
1041 | Topic.decodeDelimited = function decodeDelimited(reader) {
|
1042 | if (!(reader instanceof $Reader))
|
1043 | reader = new $Reader(reader);
|
1044 | return this.decode(reader, reader.uint32());
|
1045 | };
|
1046 |
|
1047 | /**
|
1048 | * Verifies a Topic message.
|
1049 | * @function verify
|
1050 | * @memberof google.pubsub.v1.Topic
|
1051 | * @static
|
1052 | * @param {Object.<string,*>} message Plain object to verify
|
1053 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
1054 | */
|
1055 | Topic.verify = function verify(message) {
|
1056 | if (typeof message !== "object" || message === null)
|
1057 | return "object expected";
|
1058 | if (message.name != null && message.hasOwnProperty("name"))
|
1059 | if (!$util.isString(message.name))
|
1060 | return "name: string expected";
|
1061 | if (message.labels != null && message.hasOwnProperty("labels")) {
|
1062 | if (!$util.isObject(message.labels))
|
1063 | return "labels: object expected";
|
1064 | var key = Object.keys(message.labels);
|
1065 | for (var i = 0; i < key.length; ++i)
|
1066 | if (!$util.isString(message.labels[key[i]]))
|
1067 | return "labels: string{k:string} expected";
|
1068 | }
|
1069 | if (message.messageStoragePolicy != null && message.hasOwnProperty("messageStoragePolicy")) {
|
1070 | var error = $root.google.pubsub.v1.MessageStoragePolicy.verify(message.messageStoragePolicy);
|
1071 | if (error)
|
1072 | return "messageStoragePolicy." + error;
|
1073 | }
|
1074 | if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName"))
|
1075 | if (!$util.isString(message.kmsKeyName))
|
1076 | return "kmsKeyName: string expected";
|
1077 | if (message.schemaSettings != null && message.hasOwnProperty("schemaSettings")) {
|
1078 | var error = $root.google.pubsub.v1.SchemaSettings.verify(message.schemaSettings);
|
1079 | if (error)
|
1080 | return "schemaSettings." + error;
|
1081 | }
|
1082 | if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs"))
|
1083 | if (typeof message.satisfiesPzs !== "boolean")
|
1084 | return "satisfiesPzs: boolean expected";
|
1085 | if (message.messageRetentionDuration != null && message.hasOwnProperty("messageRetentionDuration")) {
|
1086 | var error = $root.google.protobuf.Duration.verify(message.messageRetentionDuration);
|
1087 | if (error)
|
1088 | return "messageRetentionDuration." + error;
|
1089 | }
|
1090 | return null;
|
1091 | };
|
1092 |
|
1093 | /**
|
1094 | * Creates a Topic message from a plain object. Also converts values to their respective internal types.
|
1095 | * @function fromObject
|
1096 | * @memberof google.pubsub.v1.Topic
|
1097 | * @static
|
1098 | * @param {Object.<string,*>} object Plain object
|
1099 | * @returns {google.pubsub.v1.Topic} Topic
|
1100 | */
|
1101 | Topic.fromObject = function fromObject(object) {
|
1102 | if (object instanceof $root.google.pubsub.v1.Topic)
|
1103 | return object;
|
1104 | var message = new $root.google.pubsub.v1.Topic();
|
1105 | if (object.name != null)
|
1106 | message.name = String(object.name);
|
1107 | if (object.labels) {
|
1108 | if (typeof object.labels !== "object")
|
1109 | throw TypeError(".google.pubsub.v1.Topic.labels: object expected");
|
1110 | message.labels = {};
|
1111 | for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i)
|
1112 | message.labels[keys[i]] = String(object.labels[keys[i]]);
|
1113 | }
|
1114 | if (object.messageStoragePolicy != null) {
|
1115 | if (typeof object.messageStoragePolicy !== "object")
|
1116 | throw TypeError(".google.pubsub.v1.Topic.messageStoragePolicy: object expected");
|
1117 | message.messageStoragePolicy = $root.google.pubsub.v1.MessageStoragePolicy.fromObject(object.messageStoragePolicy);
|
1118 | }
|
1119 | if (object.kmsKeyName != null)
|
1120 | message.kmsKeyName = String(object.kmsKeyName);
|
1121 | if (object.schemaSettings != null) {
|
1122 | if (typeof object.schemaSettings !== "object")
|
1123 | throw TypeError(".google.pubsub.v1.Topic.schemaSettings: object expected");
|
1124 | message.schemaSettings = $root.google.pubsub.v1.SchemaSettings.fromObject(object.schemaSettings);
|
1125 | }
|
1126 | if (object.satisfiesPzs != null)
|
1127 | message.satisfiesPzs = Boolean(object.satisfiesPzs);
|
1128 | if (object.messageRetentionDuration != null) {
|
1129 | if (typeof object.messageRetentionDuration !== "object")
|
1130 | throw TypeError(".google.pubsub.v1.Topic.messageRetentionDuration: object expected");
|
1131 | message.messageRetentionDuration = $root.google.protobuf.Duration.fromObject(object.messageRetentionDuration);
|
1132 | }
|
1133 | return message;
|
1134 | };
|
1135 |
|
1136 | /**
|
1137 | * Creates a plain object from a Topic message. Also converts values to other types if specified.
|
1138 | * @function toObject
|
1139 | * @memberof google.pubsub.v1.Topic
|
1140 | * @static
|
1141 | * @param {google.pubsub.v1.Topic} message Topic
|
1142 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
1143 | * @returns {Object.<string,*>} Plain object
|
1144 | */
|
1145 | Topic.toObject = function toObject(message, options) {
|
1146 | if (!options)
|
1147 | options = {};
|
1148 | var object = {};
|
1149 | if (options.objects || options.defaults)
|
1150 | object.labels = {};
|
1151 | if (options.defaults) {
|
1152 | object.name = "";
|
1153 | object.messageStoragePolicy = null;
|
1154 | object.kmsKeyName = "";
|
1155 | object.schemaSettings = null;
|
1156 | object.satisfiesPzs = false;
|
1157 | object.messageRetentionDuration = null;
|
1158 | }
|
1159 | if (message.name != null && message.hasOwnProperty("name"))
|
1160 | object.name = message.name;
|
1161 | var keys2;
|
1162 | if (message.labels && (keys2 = Object.keys(message.labels)).length) {
|
1163 | object.labels = {};
|
1164 | for (var j = 0; j < keys2.length; ++j)
|
1165 | object.labels[keys2[j]] = message.labels[keys2[j]];
|
1166 | }
|
1167 | if (message.messageStoragePolicy != null && message.hasOwnProperty("messageStoragePolicy"))
|
1168 | object.messageStoragePolicy = $root.google.pubsub.v1.MessageStoragePolicy.toObject(message.messageStoragePolicy, options);
|
1169 | if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName"))
|
1170 | object.kmsKeyName = message.kmsKeyName;
|
1171 | if (message.schemaSettings != null && message.hasOwnProperty("schemaSettings"))
|
1172 | object.schemaSettings = $root.google.pubsub.v1.SchemaSettings.toObject(message.schemaSettings, options);
|
1173 | if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs"))
|
1174 | object.satisfiesPzs = message.satisfiesPzs;
|
1175 | if (message.messageRetentionDuration != null && message.hasOwnProperty("messageRetentionDuration"))
|
1176 | object.messageRetentionDuration = $root.google.protobuf.Duration.toObject(message.messageRetentionDuration, options);
|
1177 | return object;
|
1178 | };
|
1179 |
|
1180 | /**
|
1181 | * Converts this Topic to JSON.
|
1182 | * @function toJSON
|
1183 | * @memberof google.pubsub.v1.Topic
|
1184 | * @instance
|
1185 | * @returns {Object.<string,*>} JSON object
|
1186 | */
|
1187 | Topic.prototype.toJSON = function toJSON() {
|
1188 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
1189 | };
|
1190 |
|
1191 | return Topic;
|
1192 | })();
|
1193 |
|
1194 | v1.PubsubMessage = (function() {
|
1195 |
|
1196 | /**
|
1197 | * Properties of a PubsubMessage.
|
1198 | * @memberof google.pubsub.v1
|
1199 | * @interface IPubsubMessage
|
1200 | * @property {Uint8Array|null} [data] PubsubMessage data
|
1201 | * @property {Object.<string,string>|null} [attributes] PubsubMessage attributes
|
1202 | * @property {string|null} [messageId] PubsubMessage messageId
|
1203 | * @property {google.protobuf.ITimestamp|null} [publishTime] PubsubMessage publishTime
|
1204 | * @property {string|null} [orderingKey] PubsubMessage orderingKey
|
1205 | */
|
1206 |
|
1207 | /**
|
1208 | * Constructs a new PubsubMessage.
|
1209 | * @memberof google.pubsub.v1
|
1210 | * @classdesc Represents a PubsubMessage.
|
1211 | * @implements IPubsubMessage
|
1212 | * @constructor
|
1213 | * @param {google.pubsub.v1.IPubsubMessage=} [properties] Properties to set
|
1214 | */
|
1215 | function PubsubMessage(properties) {
|
1216 | this.attributes = {};
|
1217 | if (properties)
|
1218 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
1219 | if (properties[keys[i]] != null)
|
1220 | this[keys[i]] = properties[keys[i]];
|
1221 | }
|
1222 |
|
1223 | /**
|
1224 | * PubsubMessage data.
|
1225 | * @member {Uint8Array} data
|
1226 | * @memberof google.pubsub.v1.PubsubMessage
|
1227 | * @instance
|
1228 | */
|
1229 | PubsubMessage.prototype.data = $util.newBuffer([]);
|
1230 |
|
1231 | /**
|
1232 | * PubsubMessage attributes.
|
1233 | * @member {Object.<string,string>} attributes
|
1234 | * @memberof google.pubsub.v1.PubsubMessage
|
1235 | * @instance
|
1236 | */
|
1237 | PubsubMessage.prototype.attributes = $util.emptyObject;
|
1238 |
|
1239 | /**
|
1240 | * PubsubMessage messageId.
|
1241 | * @member {string} messageId
|
1242 | * @memberof google.pubsub.v1.PubsubMessage
|
1243 | * @instance
|
1244 | */
|
1245 | PubsubMessage.prototype.messageId = "";
|
1246 |
|
1247 | /**
|
1248 | * PubsubMessage publishTime.
|
1249 | * @member {google.protobuf.ITimestamp|null|undefined} publishTime
|
1250 | * @memberof google.pubsub.v1.PubsubMessage
|
1251 | * @instance
|
1252 | */
|
1253 | PubsubMessage.prototype.publishTime = null;
|
1254 |
|
1255 | /**
|
1256 | * PubsubMessage orderingKey.
|
1257 | * @member {string} orderingKey
|
1258 | * @memberof google.pubsub.v1.PubsubMessage
|
1259 | * @instance
|
1260 | */
|
1261 | PubsubMessage.prototype.orderingKey = "";
|
1262 |
|
1263 | /**
|
1264 | * Creates a new PubsubMessage instance using the specified properties.
|
1265 | * @function create
|
1266 | * @memberof google.pubsub.v1.PubsubMessage
|
1267 | * @static
|
1268 | * @param {google.pubsub.v1.IPubsubMessage=} [properties] Properties to set
|
1269 | * @returns {google.pubsub.v1.PubsubMessage} PubsubMessage instance
|
1270 | */
|
1271 | PubsubMessage.create = function create(properties) {
|
1272 | return new PubsubMessage(properties);
|
1273 | };
|
1274 |
|
1275 | /**
|
1276 | * Encodes the specified PubsubMessage message. Does not implicitly {@link google.pubsub.v1.PubsubMessage.verify|verify} messages.
|
1277 | * @function encode
|
1278 | * @memberof google.pubsub.v1.PubsubMessage
|
1279 | * @static
|
1280 | * @param {google.pubsub.v1.IPubsubMessage} message PubsubMessage message or plain object to encode
|
1281 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
1282 | * @returns {$protobuf.Writer} Writer
|
1283 | */
|
1284 | PubsubMessage.encode = function encode(message, writer) {
|
1285 | if (!writer)
|
1286 | writer = $Writer.create();
|
1287 | if (message.data != null && Object.hasOwnProperty.call(message, "data"))
|
1288 | writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.data);
|
1289 | if (message.attributes != null && Object.hasOwnProperty.call(message, "attributes"))
|
1290 | for (var keys = Object.keys(message.attributes), i = 0; i < keys.length; ++i)
|
1291 | writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.attributes[keys[i]]).ldelim();
|
1292 | if (message.messageId != null && Object.hasOwnProperty.call(message, "messageId"))
|
1293 | writer.uint32(/* id 3, wireType 2 =*/26).string(message.messageId);
|
1294 | if (message.publishTime != null && Object.hasOwnProperty.call(message, "publishTime"))
|
1295 | $root.google.protobuf.Timestamp.encode(message.publishTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
|
1296 | if (message.orderingKey != null && Object.hasOwnProperty.call(message, "orderingKey"))
|
1297 | writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderingKey);
|
1298 | return writer;
|
1299 | };
|
1300 |
|
1301 | /**
|
1302 | * Encodes the specified PubsubMessage message, length delimited. Does not implicitly {@link google.pubsub.v1.PubsubMessage.verify|verify} messages.
|
1303 | * @function encodeDelimited
|
1304 | * @memberof google.pubsub.v1.PubsubMessage
|
1305 | * @static
|
1306 | * @param {google.pubsub.v1.IPubsubMessage} message PubsubMessage message or plain object to encode
|
1307 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
1308 | * @returns {$protobuf.Writer} Writer
|
1309 | */
|
1310 | PubsubMessage.encodeDelimited = function encodeDelimited(message, writer) {
|
1311 | return this.encode(message, writer).ldelim();
|
1312 | };
|
1313 |
|
1314 | /**
|
1315 | * Decodes a PubsubMessage message from the specified reader or buffer.
|
1316 | * @function decode
|
1317 | * @memberof google.pubsub.v1.PubsubMessage
|
1318 | * @static
|
1319 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
1320 | * @param {number} [length] Message length if known beforehand
|
1321 | * @returns {google.pubsub.v1.PubsubMessage} PubsubMessage
|
1322 | * @throws {Error} If the payload is not a reader or valid buffer
|
1323 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
1324 | */
|
1325 | PubsubMessage.decode = function decode(reader, length) {
|
1326 | if (!(reader instanceof $Reader))
|
1327 | reader = $Reader.create(reader);
|
1328 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.PubsubMessage(), key, value;
|
1329 | while (reader.pos < end) {
|
1330 | var tag = reader.uint32();
|
1331 | switch (tag >>> 3) {
|
1332 | case 1:
|
1333 | message.data = reader.bytes();
|
1334 | break;
|
1335 | case 2:
|
1336 | if (message.attributes === $util.emptyObject)
|
1337 | message.attributes = {};
|
1338 | var end2 = reader.uint32() + reader.pos;
|
1339 | key = "";
|
1340 | value = "";
|
1341 | while (reader.pos < end2) {
|
1342 | var tag2 = reader.uint32();
|
1343 | switch (tag2 >>> 3) {
|
1344 | case 1:
|
1345 | key = reader.string();
|
1346 | break;
|
1347 | case 2:
|
1348 | value = reader.string();
|
1349 | break;
|
1350 | default:
|
1351 | reader.skipType(tag2 & 7);
|
1352 | break;
|
1353 | }
|
1354 | }
|
1355 | message.attributes[key] = value;
|
1356 | break;
|
1357 | case 3:
|
1358 | message.messageId = reader.string();
|
1359 | break;
|
1360 | case 4:
|
1361 | message.publishTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
|
1362 | break;
|
1363 | case 5:
|
1364 | message.orderingKey = reader.string();
|
1365 | break;
|
1366 | default:
|
1367 | reader.skipType(tag & 7);
|
1368 | break;
|
1369 | }
|
1370 | }
|
1371 | return message;
|
1372 | };
|
1373 |
|
1374 | /**
|
1375 | * Decodes a PubsubMessage message from the specified reader or buffer, length delimited.
|
1376 | * @function decodeDelimited
|
1377 | * @memberof google.pubsub.v1.PubsubMessage
|
1378 | * @static
|
1379 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
1380 | * @returns {google.pubsub.v1.PubsubMessage} PubsubMessage
|
1381 | * @throws {Error} If the payload is not a reader or valid buffer
|
1382 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
1383 | */
|
1384 | PubsubMessage.decodeDelimited = function decodeDelimited(reader) {
|
1385 | if (!(reader instanceof $Reader))
|
1386 | reader = new $Reader(reader);
|
1387 | return this.decode(reader, reader.uint32());
|
1388 | };
|
1389 |
|
1390 | /**
|
1391 | * Verifies a PubsubMessage message.
|
1392 | * @function verify
|
1393 | * @memberof google.pubsub.v1.PubsubMessage
|
1394 | * @static
|
1395 | * @param {Object.<string,*>} message Plain object to verify
|
1396 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
1397 | */
|
1398 | PubsubMessage.verify = function verify(message) {
|
1399 | if (typeof message !== "object" || message === null)
|
1400 | return "object expected";
|
1401 | if (message.data != null && message.hasOwnProperty("data"))
|
1402 | if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data)))
|
1403 | return "data: buffer expected";
|
1404 | if (message.attributes != null && message.hasOwnProperty("attributes")) {
|
1405 | if (!$util.isObject(message.attributes))
|
1406 | return "attributes: object expected";
|
1407 | var key = Object.keys(message.attributes);
|
1408 | for (var i = 0; i < key.length; ++i)
|
1409 | if (!$util.isString(message.attributes[key[i]]))
|
1410 | return "attributes: string{k:string} expected";
|
1411 | }
|
1412 | if (message.messageId != null && message.hasOwnProperty("messageId"))
|
1413 | if (!$util.isString(message.messageId))
|
1414 | return "messageId: string expected";
|
1415 | if (message.publishTime != null && message.hasOwnProperty("publishTime")) {
|
1416 | var error = $root.google.protobuf.Timestamp.verify(message.publishTime);
|
1417 | if (error)
|
1418 | return "publishTime." + error;
|
1419 | }
|
1420 | if (message.orderingKey != null && message.hasOwnProperty("orderingKey"))
|
1421 | if (!$util.isString(message.orderingKey))
|
1422 | return "orderingKey: string expected";
|
1423 | return null;
|
1424 | };
|
1425 |
|
1426 | /**
|
1427 | * Creates a PubsubMessage message from a plain object. Also converts values to their respective internal types.
|
1428 | * @function fromObject
|
1429 | * @memberof google.pubsub.v1.PubsubMessage
|
1430 | * @static
|
1431 | * @param {Object.<string,*>} object Plain object
|
1432 | * @returns {google.pubsub.v1.PubsubMessage} PubsubMessage
|
1433 | */
|
1434 | PubsubMessage.fromObject = function fromObject(object) {
|
1435 | if (object instanceof $root.google.pubsub.v1.PubsubMessage)
|
1436 | return object;
|
1437 | var message = new $root.google.pubsub.v1.PubsubMessage();
|
1438 | if (object.data != null)
|
1439 | if (typeof object.data === "string")
|
1440 | $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0);
|
1441 | else if (object.data.length)
|
1442 | message.data = object.data;
|
1443 | if (object.attributes) {
|
1444 | if (typeof object.attributes !== "object")
|
1445 | throw TypeError(".google.pubsub.v1.PubsubMessage.attributes: object expected");
|
1446 | message.attributes = {};
|
1447 | for (var keys = Object.keys(object.attributes), i = 0; i < keys.length; ++i)
|
1448 | message.attributes[keys[i]] = String(object.attributes[keys[i]]);
|
1449 | }
|
1450 | if (object.messageId != null)
|
1451 | message.messageId = String(object.messageId);
|
1452 | if (object.publishTime != null) {
|
1453 | if (typeof object.publishTime !== "object")
|
1454 | throw TypeError(".google.pubsub.v1.PubsubMessage.publishTime: object expected");
|
1455 | message.publishTime = $root.google.protobuf.Timestamp.fromObject(object.publishTime);
|
1456 | }
|
1457 | if (object.orderingKey != null)
|
1458 | message.orderingKey = String(object.orderingKey);
|
1459 | return message;
|
1460 | };
|
1461 |
|
1462 | /**
|
1463 | * Creates a plain object from a PubsubMessage message. Also converts values to other types if specified.
|
1464 | * @function toObject
|
1465 | * @memberof google.pubsub.v1.PubsubMessage
|
1466 | * @static
|
1467 | * @param {google.pubsub.v1.PubsubMessage} message PubsubMessage
|
1468 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
1469 | * @returns {Object.<string,*>} Plain object
|
1470 | */
|
1471 | PubsubMessage.toObject = function toObject(message, options) {
|
1472 | if (!options)
|
1473 | options = {};
|
1474 | var object = {};
|
1475 | if (options.objects || options.defaults)
|
1476 | object.attributes = {};
|
1477 | if (options.defaults) {
|
1478 | if (options.bytes === String)
|
1479 | object.data = "";
|
1480 | else {
|
1481 | object.data = [];
|
1482 | if (options.bytes !== Array)
|
1483 | object.data = $util.newBuffer(object.data);
|
1484 | }
|
1485 | object.messageId = "";
|
1486 | object.publishTime = null;
|
1487 | object.orderingKey = "";
|
1488 | }
|
1489 | if (message.data != null && message.hasOwnProperty("data"))
|
1490 | object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data;
|
1491 | var keys2;
|
1492 | if (message.attributes && (keys2 = Object.keys(message.attributes)).length) {
|
1493 | object.attributes = {};
|
1494 | for (var j = 0; j < keys2.length; ++j)
|
1495 | object.attributes[keys2[j]] = message.attributes[keys2[j]];
|
1496 | }
|
1497 | if (message.messageId != null && message.hasOwnProperty("messageId"))
|
1498 | object.messageId = message.messageId;
|
1499 | if (message.publishTime != null && message.hasOwnProperty("publishTime"))
|
1500 | object.publishTime = $root.google.protobuf.Timestamp.toObject(message.publishTime, options);
|
1501 | if (message.orderingKey != null && message.hasOwnProperty("orderingKey"))
|
1502 | object.orderingKey = message.orderingKey;
|
1503 | return object;
|
1504 | };
|
1505 |
|
1506 | /**
|
1507 | * Converts this PubsubMessage to JSON.
|
1508 | * @function toJSON
|
1509 | * @memberof google.pubsub.v1.PubsubMessage
|
1510 | * @instance
|
1511 | * @returns {Object.<string,*>} JSON object
|
1512 | */
|
1513 | PubsubMessage.prototype.toJSON = function toJSON() {
|
1514 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
1515 | };
|
1516 |
|
1517 | return PubsubMessage;
|
1518 | })();
|
1519 |
|
1520 | v1.GetTopicRequest = (function() {
|
1521 |
|
1522 | /**
|
1523 | * Properties of a GetTopicRequest.
|
1524 | * @memberof google.pubsub.v1
|
1525 | * @interface IGetTopicRequest
|
1526 | * @property {string|null} [topic] GetTopicRequest topic
|
1527 | */
|
1528 |
|
1529 | /**
|
1530 | * Constructs a new GetTopicRequest.
|
1531 | * @memberof google.pubsub.v1
|
1532 | * @classdesc Represents a GetTopicRequest.
|
1533 | * @implements IGetTopicRequest
|
1534 | * @constructor
|
1535 | * @param {google.pubsub.v1.IGetTopicRequest=} [properties] Properties to set
|
1536 | */
|
1537 | function GetTopicRequest(properties) {
|
1538 | if (properties)
|
1539 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
1540 | if (properties[keys[i]] != null)
|
1541 | this[keys[i]] = properties[keys[i]];
|
1542 | }
|
1543 |
|
1544 | /**
|
1545 | * GetTopicRequest topic.
|
1546 | * @member {string} topic
|
1547 | * @memberof google.pubsub.v1.GetTopicRequest
|
1548 | * @instance
|
1549 | */
|
1550 | GetTopicRequest.prototype.topic = "";
|
1551 |
|
1552 | /**
|
1553 | * Creates a new GetTopicRequest instance using the specified properties.
|
1554 | * @function create
|
1555 | * @memberof google.pubsub.v1.GetTopicRequest
|
1556 | * @static
|
1557 | * @param {google.pubsub.v1.IGetTopicRequest=} [properties] Properties to set
|
1558 | * @returns {google.pubsub.v1.GetTopicRequest} GetTopicRequest instance
|
1559 | */
|
1560 | GetTopicRequest.create = function create(properties) {
|
1561 | return new GetTopicRequest(properties);
|
1562 | };
|
1563 |
|
1564 | /**
|
1565 | * Encodes the specified GetTopicRequest message. Does not implicitly {@link google.pubsub.v1.GetTopicRequest.verify|verify} messages.
|
1566 | * @function encode
|
1567 | * @memberof google.pubsub.v1.GetTopicRequest
|
1568 | * @static
|
1569 | * @param {google.pubsub.v1.IGetTopicRequest} message GetTopicRequest message or plain object to encode
|
1570 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
1571 | * @returns {$protobuf.Writer} Writer
|
1572 | */
|
1573 | GetTopicRequest.encode = function encode(message, writer) {
|
1574 | if (!writer)
|
1575 | writer = $Writer.create();
|
1576 | if (message.topic != null && Object.hasOwnProperty.call(message, "topic"))
|
1577 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.topic);
|
1578 | return writer;
|
1579 | };
|
1580 |
|
1581 | /**
|
1582 | * Encodes the specified GetTopicRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.GetTopicRequest.verify|verify} messages.
|
1583 | * @function encodeDelimited
|
1584 | * @memberof google.pubsub.v1.GetTopicRequest
|
1585 | * @static
|
1586 | * @param {google.pubsub.v1.IGetTopicRequest} message GetTopicRequest message or plain object to encode
|
1587 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
1588 | * @returns {$protobuf.Writer} Writer
|
1589 | */
|
1590 | GetTopicRequest.encodeDelimited = function encodeDelimited(message, writer) {
|
1591 | return this.encode(message, writer).ldelim();
|
1592 | };
|
1593 |
|
1594 | /**
|
1595 | * Decodes a GetTopicRequest message from the specified reader or buffer.
|
1596 | * @function decode
|
1597 | * @memberof google.pubsub.v1.GetTopicRequest
|
1598 | * @static
|
1599 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
1600 | * @param {number} [length] Message length if known beforehand
|
1601 | * @returns {google.pubsub.v1.GetTopicRequest} GetTopicRequest
|
1602 | * @throws {Error} If the payload is not a reader or valid buffer
|
1603 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
1604 | */
|
1605 | GetTopicRequest.decode = function decode(reader, length) {
|
1606 | if (!(reader instanceof $Reader))
|
1607 | reader = $Reader.create(reader);
|
1608 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.GetTopicRequest();
|
1609 | while (reader.pos < end) {
|
1610 | var tag = reader.uint32();
|
1611 | switch (tag >>> 3) {
|
1612 | case 1:
|
1613 | message.topic = reader.string();
|
1614 | break;
|
1615 | default:
|
1616 | reader.skipType(tag & 7);
|
1617 | break;
|
1618 | }
|
1619 | }
|
1620 | return message;
|
1621 | };
|
1622 |
|
1623 | /**
|
1624 | * Decodes a GetTopicRequest message from the specified reader or buffer, length delimited.
|
1625 | * @function decodeDelimited
|
1626 | * @memberof google.pubsub.v1.GetTopicRequest
|
1627 | * @static
|
1628 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
1629 | * @returns {google.pubsub.v1.GetTopicRequest} GetTopicRequest
|
1630 | * @throws {Error} If the payload is not a reader or valid buffer
|
1631 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
1632 | */
|
1633 | GetTopicRequest.decodeDelimited = function decodeDelimited(reader) {
|
1634 | if (!(reader instanceof $Reader))
|
1635 | reader = new $Reader(reader);
|
1636 | return this.decode(reader, reader.uint32());
|
1637 | };
|
1638 |
|
1639 | /**
|
1640 | * Verifies a GetTopicRequest message.
|
1641 | * @function verify
|
1642 | * @memberof google.pubsub.v1.GetTopicRequest
|
1643 | * @static
|
1644 | * @param {Object.<string,*>} message Plain object to verify
|
1645 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
1646 | */
|
1647 | GetTopicRequest.verify = function verify(message) {
|
1648 | if (typeof message !== "object" || message === null)
|
1649 | return "object expected";
|
1650 | if (message.topic != null && message.hasOwnProperty("topic"))
|
1651 | if (!$util.isString(message.topic))
|
1652 | return "topic: string expected";
|
1653 | return null;
|
1654 | };
|
1655 |
|
1656 | /**
|
1657 | * Creates a GetTopicRequest message from a plain object. Also converts values to their respective internal types.
|
1658 | * @function fromObject
|
1659 | * @memberof google.pubsub.v1.GetTopicRequest
|
1660 | * @static
|
1661 | * @param {Object.<string,*>} object Plain object
|
1662 | * @returns {google.pubsub.v1.GetTopicRequest} GetTopicRequest
|
1663 | */
|
1664 | GetTopicRequest.fromObject = function fromObject(object) {
|
1665 | if (object instanceof $root.google.pubsub.v1.GetTopicRequest)
|
1666 | return object;
|
1667 | var message = new $root.google.pubsub.v1.GetTopicRequest();
|
1668 | if (object.topic != null)
|
1669 | message.topic = String(object.topic);
|
1670 | return message;
|
1671 | };
|
1672 |
|
1673 | /**
|
1674 | * Creates a plain object from a GetTopicRequest message. Also converts values to other types if specified.
|
1675 | * @function toObject
|
1676 | * @memberof google.pubsub.v1.GetTopicRequest
|
1677 | * @static
|
1678 | * @param {google.pubsub.v1.GetTopicRequest} message GetTopicRequest
|
1679 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
1680 | * @returns {Object.<string,*>} Plain object
|
1681 | */
|
1682 | GetTopicRequest.toObject = function toObject(message, options) {
|
1683 | if (!options)
|
1684 | options = {};
|
1685 | var object = {};
|
1686 | if (options.defaults)
|
1687 | object.topic = "";
|
1688 | if (message.topic != null && message.hasOwnProperty("topic"))
|
1689 | object.topic = message.topic;
|
1690 | return object;
|
1691 | };
|
1692 |
|
1693 | /**
|
1694 | * Converts this GetTopicRequest to JSON.
|
1695 | * @function toJSON
|
1696 | * @memberof google.pubsub.v1.GetTopicRequest
|
1697 | * @instance
|
1698 | * @returns {Object.<string,*>} JSON object
|
1699 | */
|
1700 | GetTopicRequest.prototype.toJSON = function toJSON() {
|
1701 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
1702 | };
|
1703 |
|
1704 | return GetTopicRequest;
|
1705 | })();
|
1706 |
|
1707 | v1.UpdateTopicRequest = (function() {
|
1708 |
|
1709 | /**
|
1710 | * Properties of an UpdateTopicRequest.
|
1711 | * @memberof google.pubsub.v1
|
1712 | * @interface IUpdateTopicRequest
|
1713 | * @property {google.pubsub.v1.ITopic|null} [topic] UpdateTopicRequest topic
|
1714 | * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateTopicRequest updateMask
|
1715 | */
|
1716 |
|
1717 | /**
|
1718 | * Constructs a new UpdateTopicRequest.
|
1719 | * @memberof google.pubsub.v1
|
1720 | * @classdesc Represents an UpdateTopicRequest.
|
1721 | * @implements IUpdateTopicRequest
|
1722 | * @constructor
|
1723 | * @param {google.pubsub.v1.IUpdateTopicRequest=} [properties] Properties to set
|
1724 | */
|
1725 | function UpdateTopicRequest(properties) {
|
1726 | if (properties)
|
1727 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
1728 | if (properties[keys[i]] != null)
|
1729 | this[keys[i]] = properties[keys[i]];
|
1730 | }
|
1731 |
|
1732 | /**
|
1733 | * UpdateTopicRequest topic.
|
1734 | * @member {google.pubsub.v1.ITopic|null|undefined} topic
|
1735 | * @memberof google.pubsub.v1.UpdateTopicRequest
|
1736 | * @instance
|
1737 | */
|
1738 | UpdateTopicRequest.prototype.topic = null;
|
1739 |
|
1740 | /**
|
1741 | * UpdateTopicRequest updateMask.
|
1742 | * @member {google.protobuf.IFieldMask|null|undefined} updateMask
|
1743 | * @memberof google.pubsub.v1.UpdateTopicRequest
|
1744 | * @instance
|
1745 | */
|
1746 | UpdateTopicRequest.prototype.updateMask = null;
|
1747 |
|
1748 | /**
|
1749 | * Creates a new UpdateTopicRequest instance using the specified properties.
|
1750 | * @function create
|
1751 | * @memberof google.pubsub.v1.UpdateTopicRequest
|
1752 | * @static
|
1753 | * @param {google.pubsub.v1.IUpdateTopicRequest=} [properties] Properties to set
|
1754 | * @returns {google.pubsub.v1.UpdateTopicRequest} UpdateTopicRequest instance
|
1755 | */
|
1756 | UpdateTopicRequest.create = function create(properties) {
|
1757 | return new UpdateTopicRequest(properties);
|
1758 | };
|
1759 |
|
1760 | /**
|
1761 | * Encodes the specified UpdateTopicRequest message. Does not implicitly {@link google.pubsub.v1.UpdateTopicRequest.verify|verify} messages.
|
1762 | * @function encode
|
1763 | * @memberof google.pubsub.v1.UpdateTopicRequest
|
1764 | * @static
|
1765 | * @param {google.pubsub.v1.IUpdateTopicRequest} message UpdateTopicRequest message or plain object to encode
|
1766 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
1767 | * @returns {$protobuf.Writer} Writer
|
1768 | */
|
1769 | UpdateTopicRequest.encode = function encode(message, writer) {
|
1770 | if (!writer)
|
1771 | writer = $Writer.create();
|
1772 | if (message.topic != null && Object.hasOwnProperty.call(message, "topic"))
|
1773 | $root.google.pubsub.v1.Topic.encode(message.topic, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
1774 | if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask"))
|
1775 | $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
1776 | return writer;
|
1777 | };
|
1778 |
|
1779 | /**
|
1780 | * Encodes the specified UpdateTopicRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.UpdateTopicRequest.verify|verify} messages.
|
1781 | * @function encodeDelimited
|
1782 | * @memberof google.pubsub.v1.UpdateTopicRequest
|
1783 | * @static
|
1784 | * @param {google.pubsub.v1.IUpdateTopicRequest} message UpdateTopicRequest message or plain object to encode
|
1785 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
1786 | * @returns {$protobuf.Writer} Writer
|
1787 | */
|
1788 | UpdateTopicRequest.encodeDelimited = function encodeDelimited(message, writer) {
|
1789 | return this.encode(message, writer).ldelim();
|
1790 | };
|
1791 |
|
1792 | /**
|
1793 | * Decodes an UpdateTopicRequest message from the specified reader or buffer.
|
1794 | * @function decode
|
1795 | * @memberof google.pubsub.v1.UpdateTopicRequest
|
1796 | * @static
|
1797 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
1798 | * @param {number} [length] Message length if known beforehand
|
1799 | * @returns {google.pubsub.v1.UpdateTopicRequest} UpdateTopicRequest
|
1800 | * @throws {Error} If the payload is not a reader or valid buffer
|
1801 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
1802 | */
|
1803 | UpdateTopicRequest.decode = function decode(reader, length) {
|
1804 | if (!(reader instanceof $Reader))
|
1805 | reader = $Reader.create(reader);
|
1806 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.UpdateTopicRequest();
|
1807 | while (reader.pos < end) {
|
1808 | var tag = reader.uint32();
|
1809 | switch (tag >>> 3) {
|
1810 | case 1:
|
1811 | message.topic = $root.google.pubsub.v1.Topic.decode(reader, reader.uint32());
|
1812 | break;
|
1813 | case 2:
|
1814 | message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32());
|
1815 | break;
|
1816 | default:
|
1817 | reader.skipType(tag & 7);
|
1818 | break;
|
1819 | }
|
1820 | }
|
1821 | return message;
|
1822 | };
|
1823 |
|
1824 | /**
|
1825 | * Decodes an UpdateTopicRequest message from the specified reader or buffer, length delimited.
|
1826 | * @function decodeDelimited
|
1827 | * @memberof google.pubsub.v1.UpdateTopicRequest
|
1828 | * @static
|
1829 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
1830 | * @returns {google.pubsub.v1.UpdateTopicRequest} UpdateTopicRequest
|
1831 | * @throws {Error} If the payload is not a reader or valid buffer
|
1832 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
1833 | */
|
1834 | UpdateTopicRequest.decodeDelimited = function decodeDelimited(reader) {
|
1835 | if (!(reader instanceof $Reader))
|
1836 | reader = new $Reader(reader);
|
1837 | return this.decode(reader, reader.uint32());
|
1838 | };
|
1839 |
|
1840 | /**
|
1841 | * Verifies an UpdateTopicRequest message.
|
1842 | * @function verify
|
1843 | * @memberof google.pubsub.v1.UpdateTopicRequest
|
1844 | * @static
|
1845 | * @param {Object.<string,*>} message Plain object to verify
|
1846 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
1847 | */
|
1848 | UpdateTopicRequest.verify = function verify(message) {
|
1849 | if (typeof message !== "object" || message === null)
|
1850 | return "object expected";
|
1851 | if (message.topic != null && message.hasOwnProperty("topic")) {
|
1852 | var error = $root.google.pubsub.v1.Topic.verify(message.topic);
|
1853 | if (error)
|
1854 | return "topic." + error;
|
1855 | }
|
1856 | if (message.updateMask != null && message.hasOwnProperty("updateMask")) {
|
1857 | var error = $root.google.protobuf.FieldMask.verify(message.updateMask);
|
1858 | if (error)
|
1859 | return "updateMask." + error;
|
1860 | }
|
1861 | return null;
|
1862 | };
|
1863 |
|
1864 | /**
|
1865 | * Creates an UpdateTopicRequest message from a plain object. Also converts values to their respective internal types.
|
1866 | * @function fromObject
|
1867 | * @memberof google.pubsub.v1.UpdateTopicRequest
|
1868 | * @static
|
1869 | * @param {Object.<string,*>} object Plain object
|
1870 | * @returns {google.pubsub.v1.UpdateTopicRequest} UpdateTopicRequest
|
1871 | */
|
1872 | UpdateTopicRequest.fromObject = function fromObject(object) {
|
1873 | if (object instanceof $root.google.pubsub.v1.UpdateTopicRequest)
|
1874 | return object;
|
1875 | var message = new $root.google.pubsub.v1.UpdateTopicRequest();
|
1876 | if (object.topic != null) {
|
1877 | if (typeof object.topic !== "object")
|
1878 | throw TypeError(".google.pubsub.v1.UpdateTopicRequest.topic: object expected");
|
1879 | message.topic = $root.google.pubsub.v1.Topic.fromObject(object.topic);
|
1880 | }
|
1881 | if (object.updateMask != null) {
|
1882 | if (typeof object.updateMask !== "object")
|
1883 | throw TypeError(".google.pubsub.v1.UpdateTopicRequest.updateMask: object expected");
|
1884 | message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask);
|
1885 | }
|
1886 | return message;
|
1887 | };
|
1888 |
|
1889 | /**
|
1890 | * Creates a plain object from an UpdateTopicRequest message. Also converts values to other types if specified.
|
1891 | * @function toObject
|
1892 | * @memberof google.pubsub.v1.UpdateTopicRequest
|
1893 | * @static
|
1894 | * @param {google.pubsub.v1.UpdateTopicRequest} message UpdateTopicRequest
|
1895 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
1896 | * @returns {Object.<string,*>} Plain object
|
1897 | */
|
1898 | UpdateTopicRequest.toObject = function toObject(message, options) {
|
1899 | if (!options)
|
1900 | options = {};
|
1901 | var object = {};
|
1902 | if (options.defaults) {
|
1903 | object.topic = null;
|
1904 | object.updateMask = null;
|
1905 | }
|
1906 | if (message.topic != null && message.hasOwnProperty("topic"))
|
1907 | object.topic = $root.google.pubsub.v1.Topic.toObject(message.topic, options);
|
1908 | if (message.updateMask != null && message.hasOwnProperty("updateMask"))
|
1909 | object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options);
|
1910 | return object;
|
1911 | };
|
1912 |
|
1913 | /**
|
1914 | * Converts this UpdateTopicRequest to JSON.
|
1915 | * @function toJSON
|
1916 | * @memberof google.pubsub.v1.UpdateTopicRequest
|
1917 | * @instance
|
1918 | * @returns {Object.<string,*>} JSON object
|
1919 | */
|
1920 | UpdateTopicRequest.prototype.toJSON = function toJSON() {
|
1921 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
1922 | };
|
1923 |
|
1924 | return UpdateTopicRequest;
|
1925 | })();
|
1926 |
|
1927 | v1.PublishRequest = (function() {
|
1928 |
|
1929 | /**
|
1930 | * Properties of a PublishRequest.
|
1931 | * @memberof google.pubsub.v1
|
1932 | * @interface IPublishRequest
|
1933 | * @property {string|null} [topic] PublishRequest topic
|
1934 | * @property {Array.<google.pubsub.v1.IPubsubMessage>|null} [messages] PublishRequest messages
|
1935 | */
|
1936 |
|
1937 | /**
|
1938 | * Constructs a new PublishRequest.
|
1939 | * @memberof google.pubsub.v1
|
1940 | * @classdesc Represents a PublishRequest.
|
1941 | * @implements IPublishRequest
|
1942 | * @constructor
|
1943 | * @param {google.pubsub.v1.IPublishRequest=} [properties] Properties to set
|
1944 | */
|
1945 | function PublishRequest(properties) {
|
1946 | this.messages = [];
|
1947 | if (properties)
|
1948 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
1949 | if (properties[keys[i]] != null)
|
1950 | this[keys[i]] = properties[keys[i]];
|
1951 | }
|
1952 |
|
1953 | /**
|
1954 | * PublishRequest topic.
|
1955 | * @member {string} topic
|
1956 | * @memberof google.pubsub.v1.PublishRequest
|
1957 | * @instance
|
1958 | */
|
1959 | PublishRequest.prototype.topic = "";
|
1960 |
|
1961 | /**
|
1962 | * PublishRequest messages.
|
1963 | * @member {Array.<google.pubsub.v1.IPubsubMessage>} messages
|
1964 | * @memberof google.pubsub.v1.PublishRequest
|
1965 | * @instance
|
1966 | */
|
1967 | PublishRequest.prototype.messages = $util.emptyArray;
|
1968 |
|
1969 | /**
|
1970 | * Creates a new PublishRequest instance using the specified properties.
|
1971 | * @function create
|
1972 | * @memberof google.pubsub.v1.PublishRequest
|
1973 | * @static
|
1974 | * @param {google.pubsub.v1.IPublishRequest=} [properties] Properties to set
|
1975 | * @returns {google.pubsub.v1.PublishRequest} PublishRequest instance
|
1976 | */
|
1977 | PublishRequest.create = function create(properties) {
|
1978 | return new PublishRequest(properties);
|
1979 | };
|
1980 |
|
1981 | /**
|
1982 | * Encodes the specified PublishRequest message. Does not implicitly {@link google.pubsub.v1.PublishRequest.verify|verify} messages.
|
1983 | * @function encode
|
1984 | * @memberof google.pubsub.v1.PublishRequest
|
1985 | * @static
|
1986 | * @param {google.pubsub.v1.IPublishRequest} message PublishRequest message or plain object to encode
|
1987 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
1988 | * @returns {$protobuf.Writer} Writer
|
1989 | */
|
1990 | PublishRequest.encode = function encode(message, writer) {
|
1991 | if (!writer)
|
1992 | writer = $Writer.create();
|
1993 | if (message.topic != null && Object.hasOwnProperty.call(message, "topic"))
|
1994 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.topic);
|
1995 | if (message.messages != null && message.messages.length)
|
1996 | for (var i = 0; i < message.messages.length; ++i)
|
1997 | $root.google.pubsub.v1.PubsubMessage.encode(message.messages[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
1998 | return writer;
|
1999 | };
|
2000 |
|
2001 | /**
|
2002 | * Encodes the specified PublishRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.PublishRequest.verify|verify} messages.
|
2003 | * @function encodeDelimited
|
2004 | * @memberof google.pubsub.v1.PublishRequest
|
2005 | * @static
|
2006 | * @param {google.pubsub.v1.IPublishRequest} message PublishRequest message or plain object to encode
|
2007 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
2008 | * @returns {$protobuf.Writer} Writer
|
2009 | */
|
2010 | PublishRequest.encodeDelimited = function encodeDelimited(message, writer) {
|
2011 | return this.encode(message, writer).ldelim();
|
2012 | };
|
2013 |
|
2014 | /**
|
2015 | * Decodes a PublishRequest message from the specified reader or buffer.
|
2016 | * @function decode
|
2017 | * @memberof google.pubsub.v1.PublishRequest
|
2018 | * @static
|
2019 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
2020 | * @param {number} [length] Message length if known beforehand
|
2021 | * @returns {google.pubsub.v1.PublishRequest} PublishRequest
|
2022 | * @throws {Error} If the payload is not a reader or valid buffer
|
2023 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
2024 | */
|
2025 | PublishRequest.decode = function decode(reader, length) {
|
2026 | if (!(reader instanceof $Reader))
|
2027 | reader = $Reader.create(reader);
|
2028 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.PublishRequest();
|
2029 | while (reader.pos < end) {
|
2030 | var tag = reader.uint32();
|
2031 | switch (tag >>> 3) {
|
2032 | case 1:
|
2033 | message.topic = reader.string();
|
2034 | break;
|
2035 | case 2:
|
2036 | if (!(message.messages && message.messages.length))
|
2037 | message.messages = [];
|
2038 | message.messages.push($root.google.pubsub.v1.PubsubMessage.decode(reader, reader.uint32()));
|
2039 | break;
|
2040 | default:
|
2041 | reader.skipType(tag & 7);
|
2042 | break;
|
2043 | }
|
2044 | }
|
2045 | return message;
|
2046 | };
|
2047 |
|
2048 | /**
|
2049 | * Decodes a PublishRequest message from the specified reader or buffer, length delimited.
|
2050 | * @function decodeDelimited
|
2051 | * @memberof google.pubsub.v1.PublishRequest
|
2052 | * @static
|
2053 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
2054 | * @returns {google.pubsub.v1.PublishRequest} PublishRequest
|
2055 | * @throws {Error} If the payload is not a reader or valid buffer
|
2056 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
2057 | */
|
2058 | PublishRequest.decodeDelimited = function decodeDelimited(reader) {
|
2059 | if (!(reader instanceof $Reader))
|
2060 | reader = new $Reader(reader);
|
2061 | return this.decode(reader, reader.uint32());
|
2062 | };
|
2063 |
|
2064 | /**
|
2065 | * Verifies a PublishRequest message.
|
2066 | * @function verify
|
2067 | * @memberof google.pubsub.v1.PublishRequest
|
2068 | * @static
|
2069 | * @param {Object.<string,*>} message Plain object to verify
|
2070 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
2071 | */
|
2072 | PublishRequest.verify = function verify(message) {
|
2073 | if (typeof message !== "object" || message === null)
|
2074 | return "object expected";
|
2075 | if (message.topic != null && message.hasOwnProperty("topic"))
|
2076 | if (!$util.isString(message.topic))
|
2077 | return "topic: string expected";
|
2078 | if (message.messages != null && message.hasOwnProperty("messages")) {
|
2079 | if (!Array.isArray(message.messages))
|
2080 | return "messages: array expected";
|
2081 | for (var i = 0; i < message.messages.length; ++i) {
|
2082 | var error = $root.google.pubsub.v1.PubsubMessage.verify(message.messages[i]);
|
2083 | if (error)
|
2084 | return "messages." + error;
|
2085 | }
|
2086 | }
|
2087 | return null;
|
2088 | };
|
2089 |
|
2090 | /**
|
2091 | * Creates a PublishRequest message from a plain object. Also converts values to their respective internal types.
|
2092 | * @function fromObject
|
2093 | * @memberof google.pubsub.v1.PublishRequest
|
2094 | * @static
|
2095 | * @param {Object.<string,*>} object Plain object
|
2096 | * @returns {google.pubsub.v1.PublishRequest} PublishRequest
|
2097 | */
|
2098 | PublishRequest.fromObject = function fromObject(object) {
|
2099 | if (object instanceof $root.google.pubsub.v1.PublishRequest)
|
2100 | return object;
|
2101 | var message = new $root.google.pubsub.v1.PublishRequest();
|
2102 | if (object.topic != null)
|
2103 | message.topic = String(object.topic);
|
2104 | if (object.messages) {
|
2105 | if (!Array.isArray(object.messages))
|
2106 | throw TypeError(".google.pubsub.v1.PublishRequest.messages: array expected");
|
2107 | message.messages = [];
|
2108 | for (var i = 0; i < object.messages.length; ++i) {
|
2109 | if (typeof object.messages[i] !== "object")
|
2110 | throw TypeError(".google.pubsub.v1.PublishRequest.messages: object expected");
|
2111 | message.messages[i] = $root.google.pubsub.v1.PubsubMessage.fromObject(object.messages[i]);
|
2112 | }
|
2113 | }
|
2114 | return message;
|
2115 | };
|
2116 |
|
2117 | /**
|
2118 | * Creates a plain object from a PublishRequest message. Also converts values to other types if specified.
|
2119 | * @function toObject
|
2120 | * @memberof google.pubsub.v1.PublishRequest
|
2121 | * @static
|
2122 | * @param {google.pubsub.v1.PublishRequest} message PublishRequest
|
2123 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
2124 | * @returns {Object.<string,*>} Plain object
|
2125 | */
|
2126 | PublishRequest.toObject = function toObject(message, options) {
|
2127 | if (!options)
|
2128 | options = {};
|
2129 | var object = {};
|
2130 | if (options.arrays || options.defaults)
|
2131 | object.messages = [];
|
2132 | if (options.defaults)
|
2133 | object.topic = "";
|
2134 | if (message.topic != null && message.hasOwnProperty("topic"))
|
2135 | object.topic = message.topic;
|
2136 | if (message.messages && message.messages.length) {
|
2137 | object.messages = [];
|
2138 | for (var j = 0; j < message.messages.length; ++j)
|
2139 | object.messages[j] = $root.google.pubsub.v1.PubsubMessage.toObject(message.messages[j], options);
|
2140 | }
|
2141 | return object;
|
2142 | };
|
2143 |
|
2144 | /**
|
2145 | * Converts this PublishRequest to JSON.
|
2146 | * @function toJSON
|
2147 | * @memberof google.pubsub.v1.PublishRequest
|
2148 | * @instance
|
2149 | * @returns {Object.<string,*>} JSON object
|
2150 | */
|
2151 | PublishRequest.prototype.toJSON = function toJSON() {
|
2152 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
2153 | };
|
2154 |
|
2155 | return PublishRequest;
|
2156 | })();
|
2157 |
|
2158 | v1.PublishResponse = (function() {
|
2159 |
|
2160 | /**
|
2161 | * Properties of a PublishResponse.
|
2162 | * @memberof google.pubsub.v1
|
2163 | * @interface IPublishResponse
|
2164 | * @property {Array.<string>|null} [messageIds] PublishResponse messageIds
|
2165 | */
|
2166 |
|
2167 | /**
|
2168 | * Constructs a new PublishResponse.
|
2169 | * @memberof google.pubsub.v1
|
2170 | * @classdesc Represents a PublishResponse.
|
2171 | * @implements IPublishResponse
|
2172 | * @constructor
|
2173 | * @param {google.pubsub.v1.IPublishResponse=} [properties] Properties to set
|
2174 | */
|
2175 | function PublishResponse(properties) {
|
2176 | this.messageIds = [];
|
2177 | if (properties)
|
2178 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
2179 | if (properties[keys[i]] != null)
|
2180 | this[keys[i]] = properties[keys[i]];
|
2181 | }
|
2182 |
|
2183 | /**
|
2184 | * PublishResponse messageIds.
|
2185 | * @member {Array.<string>} messageIds
|
2186 | * @memberof google.pubsub.v1.PublishResponse
|
2187 | * @instance
|
2188 | */
|
2189 | PublishResponse.prototype.messageIds = $util.emptyArray;
|
2190 |
|
2191 | /**
|
2192 | * Creates a new PublishResponse instance using the specified properties.
|
2193 | * @function create
|
2194 | * @memberof google.pubsub.v1.PublishResponse
|
2195 | * @static
|
2196 | * @param {google.pubsub.v1.IPublishResponse=} [properties] Properties to set
|
2197 | * @returns {google.pubsub.v1.PublishResponse} PublishResponse instance
|
2198 | */
|
2199 | PublishResponse.create = function create(properties) {
|
2200 | return new PublishResponse(properties);
|
2201 | };
|
2202 |
|
2203 | /**
|
2204 | * Encodes the specified PublishResponse message. Does not implicitly {@link google.pubsub.v1.PublishResponse.verify|verify} messages.
|
2205 | * @function encode
|
2206 | * @memberof google.pubsub.v1.PublishResponse
|
2207 | * @static
|
2208 | * @param {google.pubsub.v1.IPublishResponse} message PublishResponse message or plain object to encode
|
2209 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
2210 | * @returns {$protobuf.Writer} Writer
|
2211 | */
|
2212 | PublishResponse.encode = function encode(message, writer) {
|
2213 | if (!writer)
|
2214 | writer = $Writer.create();
|
2215 | if (message.messageIds != null && message.messageIds.length)
|
2216 | for (var i = 0; i < message.messageIds.length; ++i)
|
2217 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.messageIds[i]);
|
2218 | return writer;
|
2219 | };
|
2220 |
|
2221 | /**
|
2222 | * Encodes the specified PublishResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.PublishResponse.verify|verify} messages.
|
2223 | * @function encodeDelimited
|
2224 | * @memberof google.pubsub.v1.PublishResponse
|
2225 | * @static
|
2226 | * @param {google.pubsub.v1.IPublishResponse} message PublishResponse message or plain object to encode
|
2227 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
2228 | * @returns {$protobuf.Writer} Writer
|
2229 | */
|
2230 | PublishResponse.encodeDelimited = function encodeDelimited(message, writer) {
|
2231 | return this.encode(message, writer).ldelim();
|
2232 | };
|
2233 |
|
2234 | /**
|
2235 | * Decodes a PublishResponse message from the specified reader or buffer.
|
2236 | * @function decode
|
2237 | * @memberof google.pubsub.v1.PublishResponse
|
2238 | * @static
|
2239 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
2240 | * @param {number} [length] Message length if known beforehand
|
2241 | * @returns {google.pubsub.v1.PublishResponse} PublishResponse
|
2242 | * @throws {Error} If the payload is not a reader or valid buffer
|
2243 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
2244 | */
|
2245 | PublishResponse.decode = function decode(reader, length) {
|
2246 | if (!(reader instanceof $Reader))
|
2247 | reader = $Reader.create(reader);
|
2248 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.PublishResponse();
|
2249 | while (reader.pos < end) {
|
2250 | var tag = reader.uint32();
|
2251 | switch (tag >>> 3) {
|
2252 | case 1:
|
2253 | if (!(message.messageIds && message.messageIds.length))
|
2254 | message.messageIds = [];
|
2255 | message.messageIds.push(reader.string());
|
2256 | break;
|
2257 | default:
|
2258 | reader.skipType(tag & 7);
|
2259 | break;
|
2260 | }
|
2261 | }
|
2262 | return message;
|
2263 | };
|
2264 |
|
2265 | /**
|
2266 | * Decodes a PublishResponse message from the specified reader or buffer, length delimited.
|
2267 | * @function decodeDelimited
|
2268 | * @memberof google.pubsub.v1.PublishResponse
|
2269 | * @static
|
2270 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
2271 | * @returns {google.pubsub.v1.PublishResponse} PublishResponse
|
2272 | * @throws {Error} If the payload is not a reader or valid buffer
|
2273 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
2274 | */
|
2275 | PublishResponse.decodeDelimited = function decodeDelimited(reader) {
|
2276 | if (!(reader instanceof $Reader))
|
2277 | reader = new $Reader(reader);
|
2278 | return this.decode(reader, reader.uint32());
|
2279 | };
|
2280 |
|
2281 | /**
|
2282 | * Verifies a PublishResponse message.
|
2283 | * @function verify
|
2284 | * @memberof google.pubsub.v1.PublishResponse
|
2285 | * @static
|
2286 | * @param {Object.<string,*>} message Plain object to verify
|
2287 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
2288 | */
|
2289 | PublishResponse.verify = function verify(message) {
|
2290 | if (typeof message !== "object" || message === null)
|
2291 | return "object expected";
|
2292 | if (message.messageIds != null && message.hasOwnProperty("messageIds")) {
|
2293 | if (!Array.isArray(message.messageIds))
|
2294 | return "messageIds: array expected";
|
2295 | for (var i = 0; i < message.messageIds.length; ++i)
|
2296 | if (!$util.isString(message.messageIds[i]))
|
2297 | return "messageIds: string[] expected";
|
2298 | }
|
2299 | return null;
|
2300 | };
|
2301 |
|
2302 | /**
|
2303 | * Creates a PublishResponse message from a plain object. Also converts values to their respective internal types.
|
2304 | * @function fromObject
|
2305 | * @memberof google.pubsub.v1.PublishResponse
|
2306 | * @static
|
2307 | * @param {Object.<string,*>} object Plain object
|
2308 | * @returns {google.pubsub.v1.PublishResponse} PublishResponse
|
2309 | */
|
2310 | PublishResponse.fromObject = function fromObject(object) {
|
2311 | if (object instanceof $root.google.pubsub.v1.PublishResponse)
|
2312 | return object;
|
2313 | var message = new $root.google.pubsub.v1.PublishResponse();
|
2314 | if (object.messageIds) {
|
2315 | if (!Array.isArray(object.messageIds))
|
2316 | throw TypeError(".google.pubsub.v1.PublishResponse.messageIds: array expected");
|
2317 | message.messageIds = [];
|
2318 | for (var i = 0; i < object.messageIds.length; ++i)
|
2319 | message.messageIds[i] = String(object.messageIds[i]);
|
2320 | }
|
2321 | return message;
|
2322 | };
|
2323 |
|
2324 | /**
|
2325 | * Creates a plain object from a PublishResponse message. Also converts values to other types if specified.
|
2326 | * @function toObject
|
2327 | * @memberof google.pubsub.v1.PublishResponse
|
2328 | * @static
|
2329 | * @param {google.pubsub.v1.PublishResponse} message PublishResponse
|
2330 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
2331 | * @returns {Object.<string,*>} Plain object
|
2332 | */
|
2333 | PublishResponse.toObject = function toObject(message, options) {
|
2334 | if (!options)
|
2335 | options = {};
|
2336 | var object = {};
|
2337 | if (options.arrays || options.defaults)
|
2338 | object.messageIds = [];
|
2339 | if (message.messageIds && message.messageIds.length) {
|
2340 | object.messageIds = [];
|
2341 | for (var j = 0; j < message.messageIds.length; ++j)
|
2342 | object.messageIds[j] = message.messageIds[j];
|
2343 | }
|
2344 | return object;
|
2345 | };
|
2346 |
|
2347 | /**
|
2348 | * Converts this PublishResponse to JSON.
|
2349 | * @function toJSON
|
2350 | * @memberof google.pubsub.v1.PublishResponse
|
2351 | * @instance
|
2352 | * @returns {Object.<string,*>} JSON object
|
2353 | */
|
2354 | PublishResponse.prototype.toJSON = function toJSON() {
|
2355 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
2356 | };
|
2357 |
|
2358 | return PublishResponse;
|
2359 | })();
|
2360 |
|
2361 | v1.ListTopicsRequest = (function() {
|
2362 |
|
2363 | /**
|
2364 | * Properties of a ListTopicsRequest.
|
2365 | * @memberof google.pubsub.v1
|
2366 | * @interface IListTopicsRequest
|
2367 | * @property {string|null} [project] ListTopicsRequest project
|
2368 | * @property {number|null} [pageSize] ListTopicsRequest pageSize
|
2369 | * @property {string|null} [pageToken] ListTopicsRequest pageToken
|
2370 | */
|
2371 |
|
2372 | /**
|
2373 | * Constructs a new ListTopicsRequest.
|
2374 | * @memberof google.pubsub.v1
|
2375 | * @classdesc Represents a ListTopicsRequest.
|
2376 | * @implements IListTopicsRequest
|
2377 | * @constructor
|
2378 | * @param {google.pubsub.v1.IListTopicsRequest=} [properties] Properties to set
|
2379 | */
|
2380 | function ListTopicsRequest(properties) {
|
2381 | if (properties)
|
2382 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
2383 | if (properties[keys[i]] != null)
|
2384 | this[keys[i]] = properties[keys[i]];
|
2385 | }
|
2386 |
|
2387 | /**
|
2388 | * ListTopicsRequest project.
|
2389 | * @member {string} project
|
2390 | * @memberof google.pubsub.v1.ListTopicsRequest
|
2391 | * @instance
|
2392 | */
|
2393 | ListTopicsRequest.prototype.project = "";
|
2394 |
|
2395 | /**
|
2396 | * ListTopicsRequest pageSize.
|
2397 | * @member {number} pageSize
|
2398 | * @memberof google.pubsub.v1.ListTopicsRequest
|
2399 | * @instance
|
2400 | */
|
2401 | ListTopicsRequest.prototype.pageSize = 0;
|
2402 |
|
2403 | /**
|
2404 | * ListTopicsRequest pageToken.
|
2405 | * @member {string} pageToken
|
2406 | * @memberof google.pubsub.v1.ListTopicsRequest
|
2407 | * @instance
|
2408 | */
|
2409 | ListTopicsRequest.prototype.pageToken = "";
|
2410 |
|
2411 | /**
|
2412 | * Creates a new ListTopicsRequest instance using the specified properties.
|
2413 | * @function create
|
2414 | * @memberof google.pubsub.v1.ListTopicsRequest
|
2415 | * @static
|
2416 | * @param {google.pubsub.v1.IListTopicsRequest=} [properties] Properties to set
|
2417 | * @returns {google.pubsub.v1.ListTopicsRequest} ListTopicsRequest instance
|
2418 | */
|
2419 | ListTopicsRequest.create = function create(properties) {
|
2420 | return new ListTopicsRequest(properties);
|
2421 | };
|
2422 |
|
2423 | /**
|
2424 | * Encodes the specified ListTopicsRequest message. Does not implicitly {@link google.pubsub.v1.ListTopicsRequest.verify|verify} messages.
|
2425 | * @function encode
|
2426 | * @memberof google.pubsub.v1.ListTopicsRequest
|
2427 | * @static
|
2428 | * @param {google.pubsub.v1.IListTopicsRequest} message ListTopicsRequest message or plain object to encode
|
2429 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
2430 | * @returns {$protobuf.Writer} Writer
|
2431 | */
|
2432 | ListTopicsRequest.encode = function encode(message, writer) {
|
2433 | if (!writer)
|
2434 | writer = $Writer.create();
|
2435 | if (message.project != null && Object.hasOwnProperty.call(message, "project"))
|
2436 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.project);
|
2437 | if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize"))
|
2438 | writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize);
|
2439 | if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken"))
|
2440 | writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken);
|
2441 | return writer;
|
2442 | };
|
2443 |
|
2444 | /**
|
2445 | * Encodes the specified ListTopicsRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ListTopicsRequest.verify|verify} messages.
|
2446 | * @function encodeDelimited
|
2447 | * @memberof google.pubsub.v1.ListTopicsRequest
|
2448 | * @static
|
2449 | * @param {google.pubsub.v1.IListTopicsRequest} message ListTopicsRequest message or plain object to encode
|
2450 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
2451 | * @returns {$protobuf.Writer} Writer
|
2452 | */
|
2453 | ListTopicsRequest.encodeDelimited = function encodeDelimited(message, writer) {
|
2454 | return this.encode(message, writer).ldelim();
|
2455 | };
|
2456 |
|
2457 | /**
|
2458 | * Decodes a ListTopicsRequest message from the specified reader or buffer.
|
2459 | * @function decode
|
2460 | * @memberof google.pubsub.v1.ListTopicsRequest
|
2461 | * @static
|
2462 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
2463 | * @param {number} [length] Message length if known beforehand
|
2464 | * @returns {google.pubsub.v1.ListTopicsRequest} ListTopicsRequest
|
2465 | * @throws {Error} If the payload is not a reader or valid buffer
|
2466 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
2467 | */
|
2468 | ListTopicsRequest.decode = function decode(reader, length) {
|
2469 | if (!(reader instanceof $Reader))
|
2470 | reader = $Reader.create(reader);
|
2471 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.ListTopicsRequest();
|
2472 | while (reader.pos < end) {
|
2473 | var tag = reader.uint32();
|
2474 | switch (tag >>> 3) {
|
2475 | case 1:
|
2476 | message.project = reader.string();
|
2477 | break;
|
2478 | case 2:
|
2479 | message.pageSize = reader.int32();
|
2480 | break;
|
2481 | case 3:
|
2482 | message.pageToken = reader.string();
|
2483 | break;
|
2484 | default:
|
2485 | reader.skipType(tag & 7);
|
2486 | break;
|
2487 | }
|
2488 | }
|
2489 | return message;
|
2490 | };
|
2491 |
|
2492 | /**
|
2493 | * Decodes a ListTopicsRequest message from the specified reader or buffer, length delimited.
|
2494 | * @function decodeDelimited
|
2495 | * @memberof google.pubsub.v1.ListTopicsRequest
|
2496 | * @static
|
2497 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
2498 | * @returns {google.pubsub.v1.ListTopicsRequest} ListTopicsRequest
|
2499 | * @throws {Error} If the payload is not a reader or valid buffer
|
2500 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
2501 | */
|
2502 | ListTopicsRequest.decodeDelimited = function decodeDelimited(reader) {
|
2503 | if (!(reader instanceof $Reader))
|
2504 | reader = new $Reader(reader);
|
2505 | return this.decode(reader, reader.uint32());
|
2506 | };
|
2507 |
|
2508 | /**
|
2509 | * Verifies a ListTopicsRequest message.
|
2510 | * @function verify
|
2511 | * @memberof google.pubsub.v1.ListTopicsRequest
|
2512 | * @static
|
2513 | * @param {Object.<string,*>} message Plain object to verify
|
2514 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
2515 | */
|
2516 | ListTopicsRequest.verify = function verify(message) {
|
2517 | if (typeof message !== "object" || message === null)
|
2518 | return "object expected";
|
2519 | if (message.project != null && message.hasOwnProperty("project"))
|
2520 | if (!$util.isString(message.project))
|
2521 | return "project: string expected";
|
2522 | if (message.pageSize != null && message.hasOwnProperty("pageSize"))
|
2523 | if (!$util.isInteger(message.pageSize))
|
2524 | return "pageSize: integer expected";
|
2525 | if (message.pageToken != null && message.hasOwnProperty("pageToken"))
|
2526 | if (!$util.isString(message.pageToken))
|
2527 | return "pageToken: string expected";
|
2528 | return null;
|
2529 | };
|
2530 |
|
2531 | /**
|
2532 | * Creates a ListTopicsRequest message from a plain object. Also converts values to their respective internal types.
|
2533 | * @function fromObject
|
2534 | * @memberof google.pubsub.v1.ListTopicsRequest
|
2535 | * @static
|
2536 | * @param {Object.<string,*>} object Plain object
|
2537 | * @returns {google.pubsub.v1.ListTopicsRequest} ListTopicsRequest
|
2538 | */
|
2539 | ListTopicsRequest.fromObject = function fromObject(object) {
|
2540 | if (object instanceof $root.google.pubsub.v1.ListTopicsRequest)
|
2541 | return object;
|
2542 | var message = new $root.google.pubsub.v1.ListTopicsRequest();
|
2543 | if (object.project != null)
|
2544 | message.project = String(object.project);
|
2545 | if (object.pageSize != null)
|
2546 | message.pageSize = object.pageSize | 0;
|
2547 | if (object.pageToken != null)
|
2548 | message.pageToken = String(object.pageToken);
|
2549 | return message;
|
2550 | };
|
2551 |
|
2552 | /**
|
2553 | * Creates a plain object from a ListTopicsRequest message. Also converts values to other types if specified.
|
2554 | * @function toObject
|
2555 | * @memberof google.pubsub.v1.ListTopicsRequest
|
2556 | * @static
|
2557 | * @param {google.pubsub.v1.ListTopicsRequest} message ListTopicsRequest
|
2558 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
2559 | * @returns {Object.<string,*>} Plain object
|
2560 | */
|
2561 | ListTopicsRequest.toObject = function toObject(message, options) {
|
2562 | if (!options)
|
2563 | options = {};
|
2564 | var object = {};
|
2565 | if (options.defaults) {
|
2566 | object.project = "";
|
2567 | object.pageSize = 0;
|
2568 | object.pageToken = "";
|
2569 | }
|
2570 | if (message.project != null && message.hasOwnProperty("project"))
|
2571 | object.project = message.project;
|
2572 | if (message.pageSize != null && message.hasOwnProperty("pageSize"))
|
2573 | object.pageSize = message.pageSize;
|
2574 | if (message.pageToken != null && message.hasOwnProperty("pageToken"))
|
2575 | object.pageToken = message.pageToken;
|
2576 | return object;
|
2577 | };
|
2578 |
|
2579 | /**
|
2580 | * Converts this ListTopicsRequest to JSON.
|
2581 | * @function toJSON
|
2582 | * @memberof google.pubsub.v1.ListTopicsRequest
|
2583 | * @instance
|
2584 | * @returns {Object.<string,*>} JSON object
|
2585 | */
|
2586 | ListTopicsRequest.prototype.toJSON = function toJSON() {
|
2587 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
2588 | };
|
2589 |
|
2590 | return ListTopicsRequest;
|
2591 | })();
|
2592 |
|
2593 | v1.ListTopicsResponse = (function() {
|
2594 |
|
2595 | /**
|
2596 | * Properties of a ListTopicsResponse.
|
2597 | * @memberof google.pubsub.v1
|
2598 | * @interface IListTopicsResponse
|
2599 | * @property {Array.<google.pubsub.v1.ITopic>|null} [topics] ListTopicsResponse topics
|
2600 | * @property {string|null} [nextPageToken] ListTopicsResponse nextPageToken
|
2601 | */
|
2602 |
|
2603 | /**
|
2604 | * Constructs a new ListTopicsResponse.
|
2605 | * @memberof google.pubsub.v1
|
2606 | * @classdesc Represents a ListTopicsResponse.
|
2607 | * @implements IListTopicsResponse
|
2608 | * @constructor
|
2609 | * @param {google.pubsub.v1.IListTopicsResponse=} [properties] Properties to set
|
2610 | */
|
2611 | function ListTopicsResponse(properties) {
|
2612 | this.topics = [];
|
2613 | if (properties)
|
2614 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
2615 | if (properties[keys[i]] != null)
|
2616 | this[keys[i]] = properties[keys[i]];
|
2617 | }
|
2618 |
|
2619 | /**
|
2620 | * ListTopicsResponse topics.
|
2621 | * @member {Array.<google.pubsub.v1.ITopic>} topics
|
2622 | * @memberof google.pubsub.v1.ListTopicsResponse
|
2623 | * @instance
|
2624 | */
|
2625 | ListTopicsResponse.prototype.topics = $util.emptyArray;
|
2626 |
|
2627 | /**
|
2628 | * ListTopicsResponse nextPageToken.
|
2629 | * @member {string} nextPageToken
|
2630 | * @memberof google.pubsub.v1.ListTopicsResponse
|
2631 | * @instance
|
2632 | */
|
2633 | ListTopicsResponse.prototype.nextPageToken = "";
|
2634 |
|
2635 | /**
|
2636 | * Creates a new ListTopicsResponse instance using the specified properties.
|
2637 | * @function create
|
2638 | * @memberof google.pubsub.v1.ListTopicsResponse
|
2639 | * @static
|
2640 | * @param {google.pubsub.v1.IListTopicsResponse=} [properties] Properties to set
|
2641 | * @returns {google.pubsub.v1.ListTopicsResponse} ListTopicsResponse instance
|
2642 | */
|
2643 | ListTopicsResponse.create = function create(properties) {
|
2644 | return new ListTopicsResponse(properties);
|
2645 | };
|
2646 |
|
2647 | /**
|
2648 | * Encodes the specified ListTopicsResponse message. Does not implicitly {@link google.pubsub.v1.ListTopicsResponse.verify|verify} messages.
|
2649 | * @function encode
|
2650 | * @memberof google.pubsub.v1.ListTopicsResponse
|
2651 | * @static
|
2652 | * @param {google.pubsub.v1.IListTopicsResponse} message ListTopicsResponse message or plain object to encode
|
2653 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
2654 | * @returns {$protobuf.Writer} Writer
|
2655 | */
|
2656 | ListTopicsResponse.encode = function encode(message, writer) {
|
2657 | if (!writer)
|
2658 | writer = $Writer.create();
|
2659 | if (message.topics != null && message.topics.length)
|
2660 | for (var i = 0; i < message.topics.length; ++i)
|
2661 | $root.google.pubsub.v1.Topic.encode(message.topics[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
2662 | if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken"))
|
2663 | writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken);
|
2664 | return writer;
|
2665 | };
|
2666 |
|
2667 | /**
|
2668 | * Encodes the specified ListTopicsResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ListTopicsResponse.verify|verify} messages.
|
2669 | * @function encodeDelimited
|
2670 | * @memberof google.pubsub.v1.ListTopicsResponse
|
2671 | * @static
|
2672 | * @param {google.pubsub.v1.IListTopicsResponse} message ListTopicsResponse message or plain object to encode
|
2673 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
2674 | * @returns {$protobuf.Writer} Writer
|
2675 | */
|
2676 | ListTopicsResponse.encodeDelimited = function encodeDelimited(message, writer) {
|
2677 | return this.encode(message, writer).ldelim();
|
2678 | };
|
2679 |
|
2680 | /**
|
2681 | * Decodes a ListTopicsResponse message from the specified reader or buffer.
|
2682 | * @function decode
|
2683 | * @memberof google.pubsub.v1.ListTopicsResponse
|
2684 | * @static
|
2685 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
2686 | * @param {number} [length] Message length if known beforehand
|
2687 | * @returns {google.pubsub.v1.ListTopicsResponse} ListTopicsResponse
|
2688 | * @throws {Error} If the payload is not a reader or valid buffer
|
2689 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
2690 | */
|
2691 | ListTopicsResponse.decode = function decode(reader, length) {
|
2692 | if (!(reader instanceof $Reader))
|
2693 | reader = $Reader.create(reader);
|
2694 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.ListTopicsResponse();
|
2695 | while (reader.pos < end) {
|
2696 | var tag = reader.uint32();
|
2697 | switch (tag >>> 3) {
|
2698 | case 1:
|
2699 | if (!(message.topics && message.topics.length))
|
2700 | message.topics = [];
|
2701 | message.topics.push($root.google.pubsub.v1.Topic.decode(reader, reader.uint32()));
|
2702 | break;
|
2703 | case 2:
|
2704 | message.nextPageToken = reader.string();
|
2705 | break;
|
2706 | default:
|
2707 | reader.skipType(tag & 7);
|
2708 | break;
|
2709 | }
|
2710 | }
|
2711 | return message;
|
2712 | };
|
2713 |
|
2714 | /**
|
2715 | * Decodes a ListTopicsResponse message from the specified reader or buffer, length delimited.
|
2716 | * @function decodeDelimited
|
2717 | * @memberof google.pubsub.v1.ListTopicsResponse
|
2718 | * @static
|
2719 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
2720 | * @returns {google.pubsub.v1.ListTopicsResponse} ListTopicsResponse
|
2721 | * @throws {Error} If the payload is not a reader or valid buffer
|
2722 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
2723 | */
|
2724 | ListTopicsResponse.decodeDelimited = function decodeDelimited(reader) {
|
2725 | if (!(reader instanceof $Reader))
|
2726 | reader = new $Reader(reader);
|
2727 | return this.decode(reader, reader.uint32());
|
2728 | };
|
2729 |
|
2730 | /**
|
2731 | * Verifies a ListTopicsResponse message.
|
2732 | * @function verify
|
2733 | * @memberof google.pubsub.v1.ListTopicsResponse
|
2734 | * @static
|
2735 | * @param {Object.<string,*>} message Plain object to verify
|
2736 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
2737 | */
|
2738 | ListTopicsResponse.verify = function verify(message) {
|
2739 | if (typeof message !== "object" || message === null)
|
2740 | return "object expected";
|
2741 | if (message.topics != null && message.hasOwnProperty("topics")) {
|
2742 | if (!Array.isArray(message.topics))
|
2743 | return "topics: array expected";
|
2744 | for (var i = 0; i < message.topics.length; ++i) {
|
2745 | var error = $root.google.pubsub.v1.Topic.verify(message.topics[i]);
|
2746 | if (error)
|
2747 | return "topics." + error;
|
2748 | }
|
2749 | }
|
2750 | if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken"))
|
2751 | if (!$util.isString(message.nextPageToken))
|
2752 | return "nextPageToken: string expected";
|
2753 | return null;
|
2754 | };
|
2755 |
|
2756 | /**
|
2757 | * Creates a ListTopicsResponse message from a plain object. Also converts values to their respective internal types.
|
2758 | * @function fromObject
|
2759 | * @memberof google.pubsub.v1.ListTopicsResponse
|
2760 | * @static
|
2761 | * @param {Object.<string,*>} object Plain object
|
2762 | * @returns {google.pubsub.v1.ListTopicsResponse} ListTopicsResponse
|
2763 | */
|
2764 | ListTopicsResponse.fromObject = function fromObject(object) {
|
2765 | if (object instanceof $root.google.pubsub.v1.ListTopicsResponse)
|
2766 | return object;
|
2767 | var message = new $root.google.pubsub.v1.ListTopicsResponse();
|
2768 | if (object.topics) {
|
2769 | if (!Array.isArray(object.topics))
|
2770 | throw TypeError(".google.pubsub.v1.ListTopicsResponse.topics: array expected");
|
2771 | message.topics = [];
|
2772 | for (var i = 0; i < object.topics.length; ++i) {
|
2773 | if (typeof object.topics[i] !== "object")
|
2774 | throw TypeError(".google.pubsub.v1.ListTopicsResponse.topics: object expected");
|
2775 | message.topics[i] = $root.google.pubsub.v1.Topic.fromObject(object.topics[i]);
|
2776 | }
|
2777 | }
|
2778 | if (object.nextPageToken != null)
|
2779 | message.nextPageToken = String(object.nextPageToken);
|
2780 | return message;
|
2781 | };
|
2782 |
|
2783 | /**
|
2784 | * Creates a plain object from a ListTopicsResponse message. Also converts values to other types if specified.
|
2785 | * @function toObject
|
2786 | * @memberof google.pubsub.v1.ListTopicsResponse
|
2787 | * @static
|
2788 | * @param {google.pubsub.v1.ListTopicsResponse} message ListTopicsResponse
|
2789 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
2790 | * @returns {Object.<string,*>} Plain object
|
2791 | */
|
2792 | ListTopicsResponse.toObject = function toObject(message, options) {
|
2793 | if (!options)
|
2794 | options = {};
|
2795 | var object = {};
|
2796 | if (options.arrays || options.defaults)
|
2797 | object.topics = [];
|
2798 | if (options.defaults)
|
2799 | object.nextPageToken = "";
|
2800 | if (message.topics && message.topics.length) {
|
2801 | object.topics = [];
|
2802 | for (var j = 0; j < message.topics.length; ++j)
|
2803 | object.topics[j] = $root.google.pubsub.v1.Topic.toObject(message.topics[j], options);
|
2804 | }
|
2805 | if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken"))
|
2806 | object.nextPageToken = message.nextPageToken;
|
2807 | return object;
|
2808 | };
|
2809 |
|
2810 | /**
|
2811 | * Converts this ListTopicsResponse to JSON.
|
2812 | * @function toJSON
|
2813 | * @memberof google.pubsub.v1.ListTopicsResponse
|
2814 | * @instance
|
2815 | * @returns {Object.<string,*>} JSON object
|
2816 | */
|
2817 | ListTopicsResponse.prototype.toJSON = function toJSON() {
|
2818 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
2819 | };
|
2820 |
|
2821 | return ListTopicsResponse;
|
2822 | })();
|
2823 |
|
2824 | v1.ListTopicSubscriptionsRequest = (function() {
|
2825 |
|
2826 | /**
|
2827 | * Properties of a ListTopicSubscriptionsRequest.
|
2828 | * @memberof google.pubsub.v1
|
2829 | * @interface IListTopicSubscriptionsRequest
|
2830 | * @property {string|null} [topic] ListTopicSubscriptionsRequest topic
|
2831 | * @property {number|null} [pageSize] ListTopicSubscriptionsRequest pageSize
|
2832 | * @property {string|null} [pageToken] ListTopicSubscriptionsRequest pageToken
|
2833 | */
|
2834 |
|
2835 | /**
|
2836 | * Constructs a new ListTopicSubscriptionsRequest.
|
2837 | * @memberof google.pubsub.v1
|
2838 | * @classdesc Represents a ListTopicSubscriptionsRequest.
|
2839 | * @implements IListTopicSubscriptionsRequest
|
2840 | * @constructor
|
2841 | * @param {google.pubsub.v1.IListTopicSubscriptionsRequest=} [properties] Properties to set
|
2842 | */
|
2843 | function ListTopicSubscriptionsRequest(properties) {
|
2844 | if (properties)
|
2845 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
2846 | if (properties[keys[i]] != null)
|
2847 | this[keys[i]] = properties[keys[i]];
|
2848 | }
|
2849 |
|
2850 | /**
|
2851 | * ListTopicSubscriptionsRequest topic.
|
2852 | * @member {string} topic
|
2853 | * @memberof google.pubsub.v1.ListTopicSubscriptionsRequest
|
2854 | * @instance
|
2855 | */
|
2856 | ListTopicSubscriptionsRequest.prototype.topic = "";
|
2857 |
|
2858 | /**
|
2859 | * ListTopicSubscriptionsRequest pageSize.
|
2860 | * @member {number} pageSize
|
2861 | * @memberof google.pubsub.v1.ListTopicSubscriptionsRequest
|
2862 | * @instance
|
2863 | */
|
2864 | ListTopicSubscriptionsRequest.prototype.pageSize = 0;
|
2865 |
|
2866 | /**
|
2867 | * ListTopicSubscriptionsRequest pageToken.
|
2868 | * @member {string} pageToken
|
2869 | * @memberof google.pubsub.v1.ListTopicSubscriptionsRequest
|
2870 | * @instance
|
2871 | */
|
2872 | ListTopicSubscriptionsRequest.prototype.pageToken = "";
|
2873 |
|
2874 | /**
|
2875 | * Creates a new ListTopicSubscriptionsRequest instance using the specified properties.
|
2876 | * @function create
|
2877 | * @memberof google.pubsub.v1.ListTopicSubscriptionsRequest
|
2878 | * @static
|
2879 | * @param {google.pubsub.v1.IListTopicSubscriptionsRequest=} [properties] Properties to set
|
2880 | * @returns {google.pubsub.v1.ListTopicSubscriptionsRequest} ListTopicSubscriptionsRequest instance
|
2881 | */
|
2882 | ListTopicSubscriptionsRequest.create = function create(properties) {
|
2883 | return new ListTopicSubscriptionsRequest(properties);
|
2884 | };
|
2885 |
|
2886 | /**
|
2887 | * Encodes the specified ListTopicSubscriptionsRequest message. Does not implicitly {@link google.pubsub.v1.ListTopicSubscriptionsRequest.verify|verify} messages.
|
2888 | * @function encode
|
2889 | * @memberof google.pubsub.v1.ListTopicSubscriptionsRequest
|
2890 | * @static
|
2891 | * @param {google.pubsub.v1.IListTopicSubscriptionsRequest} message ListTopicSubscriptionsRequest message or plain object to encode
|
2892 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
2893 | * @returns {$protobuf.Writer} Writer
|
2894 | */
|
2895 | ListTopicSubscriptionsRequest.encode = function encode(message, writer) {
|
2896 | if (!writer)
|
2897 | writer = $Writer.create();
|
2898 | if (message.topic != null && Object.hasOwnProperty.call(message, "topic"))
|
2899 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.topic);
|
2900 | if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize"))
|
2901 | writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize);
|
2902 | if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken"))
|
2903 | writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken);
|
2904 | return writer;
|
2905 | };
|
2906 |
|
2907 | /**
|
2908 | * Encodes the specified ListTopicSubscriptionsRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ListTopicSubscriptionsRequest.verify|verify} messages.
|
2909 | * @function encodeDelimited
|
2910 | * @memberof google.pubsub.v1.ListTopicSubscriptionsRequest
|
2911 | * @static
|
2912 | * @param {google.pubsub.v1.IListTopicSubscriptionsRequest} message ListTopicSubscriptionsRequest message or plain object to encode
|
2913 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
2914 | * @returns {$protobuf.Writer} Writer
|
2915 | */
|
2916 | ListTopicSubscriptionsRequest.encodeDelimited = function encodeDelimited(message, writer) {
|
2917 | return this.encode(message, writer).ldelim();
|
2918 | };
|
2919 |
|
2920 | /**
|
2921 | * Decodes a ListTopicSubscriptionsRequest message from the specified reader or buffer.
|
2922 | * @function decode
|
2923 | * @memberof google.pubsub.v1.ListTopicSubscriptionsRequest
|
2924 | * @static
|
2925 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
2926 | * @param {number} [length] Message length if known beforehand
|
2927 | * @returns {google.pubsub.v1.ListTopicSubscriptionsRequest} ListTopicSubscriptionsRequest
|
2928 | * @throws {Error} If the payload is not a reader or valid buffer
|
2929 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
2930 | */
|
2931 | ListTopicSubscriptionsRequest.decode = function decode(reader, length) {
|
2932 | if (!(reader instanceof $Reader))
|
2933 | reader = $Reader.create(reader);
|
2934 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.ListTopicSubscriptionsRequest();
|
2935 | while (reader.pos < end) {
|
2936 | var tag = reader.uint32();
|
2937 | switch (tag >>> 3) {
|
2938 | case 1:
|
2939 | message.topic = reader.string();
|
2940 | break;
|
2941 | case 2:
|
2942 | message.pageSize = reader.int32();
|
2943 | break;
|
2944 | case 3:
|
2945 | message.pageToken = reader.string();
|
2946 | break;
|
2947 | default:
|
2948 | reader.skipType(tag & 7);
|
2949 | break;
|
2950 | }
|
2951 | }
|
2952 | return message;
|
2953 | };
|
2954 |
|
2955 | /**
|
2956 | * Decodes a ListTopicSubscriptionsRequest message from the specified reader or buffer, length delimited.
|
2957 | * @function decodeDelimited
|
2958 | * @memberof google.pubsub.v1.ListTopicSubscriptionsRequest
|
2959 | * @static
|
2960 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
2961 | * @returns {google.pubsub.v1.ListTopicSubscriptionsRequest} ListTopicSubscriptionsRequest
|
2962 | * @throws {Error} If the payload is not a reader or valid buffer
|
2963 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
2964 | */
|
2965 | ListTopicSubscriptionsRequest.decodeDelimited = function decodeDelimited(reader) {
|
2966 | if (!(reader instanceof $Reader))
|
2967 | reader = new $Reader(reader);
|
2968 | return this.decode(reader, reader.uint32());
|
2969 | };
|
2970 |
|
2971 | /**
|
2972 | * Verifies a ListTopicSubscriptionsRequest message.
|
2973 | * @function verify
|
2974 | * @memberof google.pubsub.v1.ListTopicSubscriptionsRequest
|
2975 | * @static
|
2976 | * @param {Object.<string,*>} message Plain object to verify
|
2977 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
2978 | */
|
2979 | ListTopicSubscriptionsRequest.verify = function verify(message) {
|
2980 | if (typeof message !== "object" || message === null)
|
2981 | return "object expected";
|
2982 | if (message.topic != null && message.hasOwnProperty("topic"))
|
2983 | if (!$util.isString(message.topic))
|
2984 | return "topic: string expected";
|
2985 | if (message.pageSize != null && message.hasOwnProperty("pageSize"))
|
2986 | if (!$util.isInteger(message.pageSize))
|
2987 | return "pageSize: integer expected";
|
2988 | if (message.pageToken != null && message.hasOwnProperty("pageToken"))
|
2989 | if (!$util.isString(message.pageToken))
|
2990 | return "pageToken: string expected";
|
2991 | return null;
|
2992 | };
|
2993 |
|
2994 | /**
|
2995 | * Creates a ListTopicSubscriptionsRequest message from a plain object. Also converts values to their respective internal types.
|
2996 | * @function fromObject
|
2997 | * @memberof google.pubsub.v1.ListTopicSubscriptionsRequest
|
2998 | * @static
|
2999 | * @param {Object.<string,*>} object Plain object
|
3000 | * @returns {google.pubsub.v1.ListTopicSubscriptionsRequest} ListTopicSubscriptionsRequest
|
3001 | */
|
3002 | ListTopicSubscriptionsRequest.fromObject = function fromObject(object) {
|
3003 | if (object instanceof $root.google.pubsub.v1.ListTopicSubscriptionsRequest)
|
3004 | return object;
|
3005 | var message = new $root.google.pubsub.v1.ListTopicSubscriptionsRequest();
|
3006 | if (object.topic != null)
|
3007 | message.topic = String(object.topic);
|
3008 | if (object.pageSize != null)
|
3009 | message.pageSize = object.pageSize | 0;
|
3010 | if (object.pageToken != null)
|
3011 | message.pageToken = String(object.pageToken);
|
3012 | return message;
|
3013 | };
|
3014 |
|
3015 | /**
|
3016 | * Creates a plain object from a ListTopicSubscriptionsRequest message. Also converts values to other types if specified.
|
3017 | * @function toObject
|
3018 | * @memberof google.pubsub.v1.ListTopicSubscriptionsRequest
|
3019 | * @static
|
3020 | * @param {google.pubsub.v1.ListTopicSubscriptionsRequest} message ListTopicSubscriptionsRequest
|
3021 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
3022 | * @returns {Object.<string,*>} Plain object
|
3023 | */
|
3024 | ListTopicSubscriptionsRequest.toObject = function toObject(message, options) {
|
3025 | if (!options)
|
3026 | options = {};
|
3027 | var object = {};
|
3028 | if (options.defaults) {
|
3029 | object.topic = "";
|
3030 | object.pageSize = 0;
|
3031 | object.pageToken = "";
|
3032 | }
|
3033 | if (message.topic != null && message.hasOwnProperty("topic"))
|
3034 | object.topic = message.topic;
|
3035 | if (message.pageSize != null && message.hasOwnProperty("pageSize"))
|
3036 | object.pageSize = message.pageSize;
|
3037 | if (message.pageToken != null && message.hasOwnProperty("pageToken"))
|
3038 | object.pageToken = message.pageToken;
|
3039 | return object;
|
3040 | };
|
3041 |
|
3042 | /**
|
3043 | * Converts this ListTopicSubscriptionsRequest to JSON.
|
3044 | * @function toJSON
|
3045 | * @memberof google.pubsub.v1.ListTopicSubscriptionsRequest
|
3046 | * @instance
|
3047 | * @returns {Object.<string,*>} JSON object
|
3048 | */
|
3049 | ListTopicSubscriptionsRequest.prototype.toJSON = function toJSON() {
|
3050 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
3051 | };
|
3052 |
|
3053 | return ListTopicSubscriptionsRequest;
|
3054 | })();
|
3055 |
|
3056 | v1.ListTopicSubscriptionsResponse = (function() {
|
3057 |
|
3058 | /**
|
3059 | * Properties of a ListTopicSubscriptionsResponse.
|
3060 | * @memberof google.pubsub.v1
|
3061 | * @interface IListTopicSubscriptionsResponse
|
3062 | * @property {Array.<string>|null} [subscriptions] ListTopicSubscriptionsResponse subscriptions
|
3063 | * @property {string|null} [nextPageToken] ListTopicSubscriptionsResponse nextPageToken
|
3064 | */
|
3065 |
|
3066 | /**
|
3067 | * Constructs a new ListTopicSubscriptionsResponse.
|
3068 | * @memberof google.pubsub.v1
|
3069 | * @classdesc Represents a ListTopicSubscriptionsResponse.
|
3070 | * @implements IListTopicSubscriptionsResponse
|
3071 | * @constructor
|
3072 | * @param {google.pubsub.v1.IListTopicSubscriptionsResponse=} [properties] Properties to set
|
3073 | */
|
3074 | function ListTopicSubscriptionsResponse(properties) {
|
3075 | this.subscriptions = [];
|
3076 | if (properties)
|
3077 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
3078 | if (properties[keys[i]] != null)
|
3079 | this[keys[i]] = properties[keys[i]];
|
3080 | }
|
3081 |
|
3082 | /**
|
3083 | * ListTopicSubscriptionsResponse subscriptions.
|
3084 | * @member {Array.<string>} subscriptions
|
3085 | * @memberof google.pubsub.v1.ListTopicSubscriptionsResponse
|
3086 | * @instance
|
3087 | */
|
3088 | ListTopicSubscriptionsResponse.prototype.subscriptions = $util.emptyArray;
|
3089 |
|
3090 | /**
|
3091 | * ListTopicSubscriptionsResponse nextPageToken.
|
3092 | * @member {string} nextPageToken
|
3093 | * @memberof google.pubsub.v1.ListTopicSubscriptionsResponse
|
3094 | * @instance
|
3095 | */
|
3096 | ListTopicSubscriptionsResponse.prototype.nextPageToken = "";
|
3097 |
|
3098 | /**
|
3099 | * Creates a new ListTopicSubscriptionsResponse instance using the specified properties.
|
3100 | * @function create
|
3101 | * @memberof google.pubsub.v1.ListTopicSubscriptionsResponse
|
3102 | * @static
|
3103 | * @param {google.pubsub.v1.IListTopicSubscriptionsResponse=} [properties] Properties to set
|
3104 | * @returns {google.pubsub.v1.ListTopicSubscriptionsResponse} ListTopicSubscriptionsResponse instance
|
3105 | */
|
3106 | ListTopicSubscriptionsResponse.create = function create(properties) {
|
3107 | return new ListTopicSubscriptionsResponse(properties);
|
3108 | };
|
3109 |
|
3110 | /**
|
3111 | * Encodes the specified ListTopicSubscriptionsResponse message. Does not implicitly {@link google.pubsub.v1.ListTopicSubscriptionsResponse.verify|verify} messages.
|
3112 | * @function encode
|
3113 | * @memberof google.pubsub.v1.ListTopicSubscriptionsResponse
|
3114 | * @static
|
3115 | * @param {google.pubsub.v1.IListTopicSubscriptionsResponse} message ListTopicSubscriptionsResponse message or plain object to encode
|
3116 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
3117 | * @returns {$protobuf.Writer} Writer
|
3118 | */
|
3119 | ListTopicSubscriptionsResponse.encode = function encode(message, writer) {
|
3120 | if (!writer)
|
3121 | writer = $Writer.create();
|
3122 | if (message.subscriptions != null && message.subscriptions.length)
|
3123 | for (var i = 0; i < message.subscriptions.length; ++i)
|
3124 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.subscriptions[i]);
|
3125 | if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken"))
|
3126 | writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken);
|
3127 | return writer;
|
3128 | };
|
3129 |
|
3130 | /**
|
3131 | * Encodes the specified ListTopicSubscriptionsResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ListTopicSubscriptionsResponse.verify|verify} messages.
|
3132 | * @function encodeDelimited
|
3133 | * @memberof google.pubsub.v1.ListTopicSubscriptionsResponse
|
3134 | * @static
|
3135 | * @param {google.pubsub.v1.IListTopicSubscriptionsResponse} message ListTopicSubscriptionsResponse message or plain object to encode
|
3136 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
3137 | * @returns {$protobuf.Writer} Writer
|
3138 | */
|
3139 | ListTopicSubscriptionsResponse.encodeDelimited = function encodeDelimited(message, writer) {
|
3140 | return this.encode(message, writer).ldelim();
|
3141 | };
|
3142 |
|
3143 | /**
|
3144 | * Decodes a ListTopicSubscriptionsResponse message from the specified reader or buffer.
|
3145 | * @function decode
|
3146 | * @memberof google.pubsub.v1.ListTopicSubscriptionsResponse
|
3147 | * @static
|
3148 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
3149 | * @param {number} [length] Message length if known beforehand
|
3150 | * @returns {google.pubsub.v1.ListTopicSubscriptionsResponse} ListTopicSubscriptionsResponse
|
3151 | * @throws {Error} If the payload is not a reader or valid buffer
|
3152 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
3153 | */
|
3154 | ListTopicSubscriptionsResponse.decode = function decode(reader, length) {
|
3155 | if (!(reader instanceof $Reader))
|
3156 | reader = $Reader.create(reader);
|
3157 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.ListTopicSubscriptionsResponse();
|
3158 | while (reader.pos < end) {
|
3159 | var tag = reader.uint32();
|
3160 | switch (tag >>> 3) {
|
3161 | case 1:
|
3162 | if (!(message.subscriptions && message.subscriptions.length))
|
3163 | message.subscriptions = [];
|
3164 | message.subscriptions.push(reader.string());
|
3165 | break;
|
3166 | case 2:
|
3167 | message.nextPageToken = reader.string();
|
3168 | break;
|
3169 | default:
|
3170 | reader.skipType(tag & 7);
|
3171 | break;
|
3172 | }
|
3173 | }
|
3174 | return message;
|
3175 | };
|
3176 |
|
3177 | /**
|
3178 | * Decodes a ListTopicSubscriptionsResponse message from the specified reader or buffer, length delimited.
|
3179 | * @function decodeDelimited
|
3180 | * @memberof google.pubsub.v1.ListTopicSubscriptionsResponse
|
3181 | * @static
|
3182 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
3183 | * @returns {google.pubsub.v1.ListTopicSubscriptionsResponse} ListTopicSubscriptionsResponse
|
3184 | * @throws {Error} If the payload is not a reader or valid buffer
|
3185 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
3186 | */
|
3187 | ListTopicSubscriptionsResponse.decodeDelimited = function decodeDelimited(reader) {
|
3188 | if (!(reader instanceof $Reader))
|
3189 | reader = new $Reader(reader);
|
3190 | return this.decode(reader, reader.uint32());
|
3191 | };
|
3192 |
|
3193 | /**
|
3194 | * Verifies a ListTopicSubscriptionsResponse message.
|
3195 | * @function verify
|
3196 | * @memberof google.pubsub.v1.ListTopicSubscriptionsResponse
|
3197 | * @static
|
3198 | * @param {Object.<string,*>} message Plain object to verify
|
3199 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
3200 | */
|
3201 | ListTopicSubscriptionsResponse.verify = function verify(message) {
|
3202 | if (typeof message !== "object" || message === null)
|
3203 | return "object expected";
|
3204 | if (message.subscriptions != null && message.hasOwnProperty("subscriptions")) {
|
3205 | if (!Array.isArray(message.subscriptions))
|
3206 | return "subscriptions: array expected";
|
3207 | for (var i = 0; i < message.subscriptions.length; ++i)
|
3208 | if (!$util.isString(message.subscriptions[i]))
|
3209 | return "subscriptions: string[] expected";
|
3210 | }
|
3211 | if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken"))
|
3212 | if (!$util.isString(message.nextPageToken))
|
3213 | return "nextPageToken: string expected";
|
3214 | return null;
|
3215 | };
|
3216 |
|
3217 | /**
|
3218 | * Creates a ListTopicSubscriptionsResponse message from a plain object. Also converts values to their respective internal types.
|
3219 | * @function fromObject
|
3220 | * @memberof google.pubsub.v1.ListTopicSubscriptionsResponse
|
3221 | * @static
|
3222 | * @param {Object.<string,*>} object Plain object
|
3223 | * @returns {google.pubsub.v1.ListTopicSubscriptionsResponse} ListTopicSubscriptionsResponse
|
3224 | */
|
3225 | ListTopicSubscriptionsResponse.fromObject = function fromObject(object) {
|
3226 | if (object instanceof $root.google.pubsub.v1.ListTopicSubscriptionsResponse)
|
3227 | return object;
|
3228 | var message = new $root.google.pubsub.v1.ListTopicSubscriptionsResponse();
|
3229 | if (object.subscriptions) {
|
3230 | if (!Array.isArray(object.subscriptions))
|
3231 | throw TypeError(".google.pubsub.v1.ListTopicSubscriptionsResponse.subscriptions: array expected");
|
3232 | message.subscriptions = [];
|
3233 | for (var i = 0; i < object.subscriptions.length; ++i)
|
3234 | message.subscriptions[i] = String(object.subscriptions[i]);
|
3235 | }
|
3236 | if (object.nextPageToken != null)
|
3237 | message.nextPageToken = String(object.nextPageToken);
|
3238 | return message;
|
3239 | };
|
3240 |
|
3241 | /**
|
3242 | * Creates a plain object from a ListTopicSubscriptionsResponse message. Also converts values to other types if specified.
|
3243 | * @function toObject
|
3244 | * @memberof google.pubsub.v1.ListTopicSubscriptionsResponse
|
3245 | * @static
|
3246 | * @param {google.pubsub.v1.ListTopicSubscriptionsResponse} message ListTopicSubscriptionsResponse
|
3247 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
3248 | * @returns {Object.<string,*>} Plain object
|
3249 | */
|
3250 | ListTopicSubscriptionsResponse.toObject = function toObject(message, options) {
|
3251 | if (!options)
|
3252 | options = {};
|
3253 | var object = {};
|
3254 | if (options.arrays || options.defaults)
|
3255 | object.subscriptions = [];
|
3256 | if (options.defaults)
|
3257 | object.nextPageToken = "";
|
3258 | if (message.subscriptions && message.subscriptions.length) {
|
3259 | object.subscriptions = [];
|
3260 | for (var j = 0; j < message.subscriptions.length; ++j)
|
3261 | object.subscriptions[j] = message.subscriptions[j];
|
3262 | }
|
3263 | if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken"))
|
3264 | object.nextPageToken = message.nextPageToken;
|
3265 | return object;
|
3266 | };
|
3267 |
|
3268 | /**
|
3269 | * Converts this ListTopicSubscriptionsResponse to JSON.
|
3270 | * @function toJSON
|
3271 | * @memberof google.pubsub.v1.ListTopicSubscriptionsResponse
|
3272 | * @instance
|
3273 | * @returns {Object.<string,*>} JSON object
|
3274 | */
|
3275 | ListTopicSubscriptionsResponse.prototype.toJSON = function toJSON() {
|
3276 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
3277 | };
|
3278 |
|
3279 | return ListTopicSubscriptionsResponse;
|
3280 | })();
|
3281 |
|
3282 | v1.ListTopicSnapshotsRequest = (function() {
|
3283 |
|
3284 | /**
|
3285 | * Properties of a ListTopicSnapshotsRequest.
|
3286 | * @memberof google.pubsub.v1
|
3287 | * @interface IListTopicSnapshotsRequest
|
3288 | * @property {string|null} [topic] ListTopicSnapshotsRequest topic
|
3289 | * @property {number|null} [pageSize] ListTopicSnapshotsRequest pageSize
|
3290 | * @property {string|null} [pageToken] ListTopicSnapshotsRequest pageToken
|
3291 | */
|
3292 |
|
3293 | /**
|
3294 | * Constructs a new ListTopicSnapshotsRequest.
|
3295 | * @memberof google.pubsub.v1
|
3296 | * @classdesc Represents a ListTopicSnapshotsRequest.
|
3297 | * @implements IListTopicSnapshotsRequest
|
3298 | * @constructor
|
3299 | * @param {google.pubsub.v1.IListTopicSnapshotsRequest=} [properties] Properties to set
|
3300 | */
|
3301 | function ListTopicSnapshotsRequest(properties) {
|
3302 | if (properties)
|
3303 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
3304 | if (properties[keys[i]] != null)
|
3305 | this[keys[i]] = properties[keys[i]];
|
3306 | }
|
3307 |
|
3308 | /**
|
3309 | * ListTopicSnapshotsRequest topic.
|
3310 | * @member {string} topic
|
3311 | * @memberof google.pubsub.v1.ListTopicSnapshotsRequest
|
3312 | * @instance
|
3313 | */
|
3314 | ListTopicSnapshotsRequest.prototype.topic = "";
|
3315 |
|
3316 | /**
|
3317 | * ListTopicSnapshotsRequest pageSize.
|
3318 | * @member {number} pageSize
|
3319 | * @memberof google.pubsub.v1.ListTopicSnapshotsRequest
|
3320 | * @instance
|
3321 | */
|
3322 | ListTopicSnapshotsRequest.prototype.pageSize = 0;
|
3323 |
|
3324 | /**
|
3325 | * ListTopicSnapshotsRequest pageToken.
|
3326 | * @member {string} pageToken
|
3327 | * @memberof google.pubsub.v1.ListTopicSnapshotsRequest
|
3328 | * @instance
|
3329 | */
|
3330 | ListTopicSnapshotsRequest.prototype.pageToken = "";
|
3331 |
|
3332 | /**
|
3333 | * Creates a new ListTopicSnapshotsRequest instance using the specified properties.
|
3334 | * @function create
|
3335 | * @memberof google.pubsub.v1.ListTopicSnapshotsRequest
|
3336 | * @static
|
3337 | * @param {google.pubsub.v1.IListTopicSnapshotsRequest=} [properties] Properties to set
|
3338 | * @returns {google.pubsub.v1.ListTopicSnapshotsRequest} ListTopicSnapshotsRequest instance
|
3339 | */
|
3340 | ListTopicSnapshotsRequest.create = function create(properties) {
|
3341 | return new ListTopicSnapshotsRequest(properties);
|
3342 | };
|
3343 |
|
3344 | /**
|
3345 | * Encodes the specified ListTopicSnapshotsRequest message. Does not implicitly {@link google.pubsub.v1.ListTopicSnapshotsRequest.verify|verify} messages.
|
3346 | * @function encode
|
3347 | * @memberof google.pubsub.v1.ListTopicSnapshotsRequest
|
3348 | * @static
|
3349 | * @param {google.pubsub.v1.IListTopicSnapshotsRequest} message ListTopicSnapshotsRequest message or plain object to encode
|
3350 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
3351 | * @returns {$protobuf.Writer} Writer
|
3352 | */
|
3353 | ListTopicSnapshotsRequest.encode = function encode(message, writer) {
|
3354 | if (!writer)
|
3355 | writer = $Writer.create();
|
3356 | if (message.topic != null && Object.hasOwnProperty.call(message, "topic"))
|
3357 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.topic);
|
3358 | if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize"))
|
3359 | writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize);
|
3360 | if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken"))
|
3361 | writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken);
|
3362 | return writer;
|
3363 | };
|
3364 |
|
3365 | /**
|
3366 | * Encodes the specified ListTopicSnapshotsRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ListTopicSnapshotsRequest.verify|verify} messages.
|
3367 | * @function encodeDelimited
|
3368 | * @memberof google.pubsub.v1.ListTopicSnapshotsRequest
|
3369 | * @static
|
3370 | * @param {google.pubsub.v1.IListTopicSnapshotsRequest} message ListTopicSnapshotsRequest message or plain object to encode
|
3371 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
3372 | * @returns {$protobuf.Writer} Writer
|
3373 | */
|
3374 | ListTopicSnapshotsRequest.encodeDelimited = function encodeDelimited(message, writer) {
|
3375 | return this.encode(message, writer).ldelim();
|
3376 | };
|
3377 |
|
3378 | /**
|
3379 | * Decodes a ListTopicSnapshotsRequest message from the specified reader or buffer.
|
3380 | * @function decode
|
3381 | * @memberof google.pubsub.v1.ListTopicSnapshotsRequest
|
3382 | * @static
|
3383 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
3384 | * @param {number} [length] Message length if known beforehand
|
3385 | * @returns {google.pubsub.v1.ListTopicSnapshotsRequest} ListTopicSnapshotsRequest
|
3386 | * @throws {Error} If the payload is not a reader or valid buffer
|
3387 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
3388 | */
|
3389 | ListTopicSnapshotsRequest.decode = function decode(reader, length) {
|
3390 | if (!(reader instanceof $Reader))
|
3391 | reader = $Reader.create(reader);
|
3392 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.ListTopicSnapshotsRequest();
|
3393 | while (reader.pos < end) {
|
3394 | var tag = reader.uint32();
|
3395 | switch (tag >>> 3) {
|
3396 | case 1:
|
3397 | message.topic = reader.string();
|
3398 | break;
|
3399 | case 2:
|
3400 | message.pageSize = reader.int32();
|
3401 | break;
|
3402 | case 3:
|
3403 | message.pageToken = reader.string();
|
3404 | break;
|
3405 | default:
|
3406 | reader.skipType(tag & 7);
|
3407 | break;
|
3408 | }
|
3409 | }
|
3410 | return message;
|
3411 | };
|
3412 |
|
3413 | /**
|
3414 | * Decodes a ListTopicSnapshotsRequest message from the specified reader or buffer, length delimited.
|
3415 | * @function decodeDelimited
|
3416 | * @memberof google.pubsub.v1.ListTopicSnapshotsRequest
|
3417 | * @static
|
3418 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
3419 | * @returns {google.pubsub.v1.ListTopicSnapshotsRequest} ListTopicSnapshotsRequest
|
3420 | * @throws {Error} If the payload is not a reader or valid buffer
|
3421 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
3422 | */
|
3423 | ListTopicSnapshotsRequest.decodeDelimited = function decodeDelimited(reader) {
|
3424 | if (!(reader instanceof $Reader))
|
3425 | reader = new $Reader(reader);
|
3426 | return this.decode(reader, reader.uint32());
|
3427 | };
|
3428 |
|
3429 | /**
|
3430 | * Verifies a ListTopicSnapshotsRequest message.
|
3431 | * @function verify
|
3432 | * @memberof google.pubsub.v1.ListTopicSnapshotsRequest
|
3433 | * @static
|
3434 | * @param {Object.<string,*>} message Plain object to verify
|
3435 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
3436 | */
|
3437 | ListTopicSnapshotsRequest.verify = function verify(message) {
|
3438 | if (typeof message !== "object" || message === null)
|
3439 | return "object expected";
|
3440 | if (message.topic != null && message.hasOwnProperty("topic"))
|
3441 | if (!$util.isString(message.topic))
|
3442 | return "topic: string expected";
|
3443 | if (message.pageSize != null && message.hasOwnProperty("pageSize"))
|
3444 | if (!$util.isInteger(message.pageSize))
|
3445 | return "pageSize: integer expected";
|
3446 | if (message.pageToken != null && message.hasOwnProperty("pageToken"))
|
3447 | if (!$util.isString(message.pageToken))
|
3448 | return "pageToken: string expected";
|
3449 | return null;
|
3450 | };
|
3451 |
|
3452 | /**
|
3453 | * Creates a ListTopicSnapshotsRequest message from a plain object. Also converts values to their respective internal types.
|
3454 | * @function fromObject
|
3455 | * @memberof google.pubsub.v1.ListTopicSnapshotsRequest
|
3456 | * @static
|
3457 | * @param {Object.<string,*>} object Plain object
|
3458 | * @returns {google.pubsub.v1.ListTopicSnapshotsRequest} ListTopicSnapshotsRequest
|
3459 | */
|
3460 | ListTopicSnapshotsRequest.fromObject = function fromObject(object) {
|
3461 | if (object instanceof $root.google.pubsub.v1.ListTopicSnapshotsRequest)
|
3462 | return object;
|
3463 | var message = new $root.google.pubsub.v1.ListTopicSnapshotsRequest();
|
3464 | if (object.topic != null)
|
3465 | message.topic = String(object.topic);
|
3466 | if (object.pageSize != null)
|
3467 | message.pageSize = object.pageSize | 0;
|
3468 | if (object.pageToken != null)
|
3469 | message.pageToken = String(object.pageToken);
|
3470 | return message;
|
3471 | };
|
3472 |
|
3473 | /**
|
3474 | * Creates a plain object from a ListTopicSnapshotsRequest message. Also converts values to other types if specified.
|
3475 | * @function toObject
|
3476 | * @memberof google.pubsub.v1.ListTopicSnapshotsRequest
|
3477 | * @static
|
3478 | * @param {google.pubsub.v1.ListTopicSnapshotsRequest} message ListTopicSnapshotsRequest
|
3479 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
3480 | * @returns {Object.<string,*>} Plain object
|
3481 | */
|
3482 | ListTopicSnapshotsRequest.toObject = function toObject(message, options) {
|
3483 | if (!options)
|
3484 | options = {};
|
3485 | var object = {};
|
3486 | if (options.defaults) {
|
3487 | object.topic = "";
|
3488 | object.pageSize = 0;
|
3489 | object.pageToken = "";
|
3490 | }
|
3491 | if (message.topic != null && message.hasOwnProperty("topic"))
|
3492 | object.topic = message.topic;
|
3493 | if (message.pageSize != null && message.hasOwnProperty("pageSize"))
|
3494 | object.pageSize = message.pageSize;
|
3495 | if (message.pageToken != null && message.hasOwnProperty("pageToken"))
|
3496 | object.pageToken = message.pageToken;
|
3497 | return object;
|
3498 | };
|
3499 |
|
3500 | /**
|
3501 | * Converts this ListTopicSnapshotsRequest to JSON.
|
3502 | * @function toJSON
|
3503 | * @memberof google.pubsub.v1.ListTopicSnapshotsRequest
|
3504 | * @instance
|
3505 | * @returns {Object.<string,*>} JSON object
|
3506 | */
|
3507 | ListTopicSnapshotsRequest.prototype.toJSON = function toJSON() {
|
3508 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
3509 | };
|
3510 |
|
3511 | return ListTopicSnapshotsRequest;
|
3512 | })();
|
3513 |
|
3514 | v1.ListTopicSnapshotsResponse = (function() {
|
3515 |
|
3516 | /**
|
3517 | * Properties of a ListTopicSnapshotsResponse.
|
3518 | * @memberof google.pubsub.v1
|
3519 | * @interface IListTopicSnapshotsResponse
|
3520 | * @property {Array.<string>|null} [snapshots] ListTopicSnapshotsResponse snapshots
|
3521 | * @property {string|null} [nextPageToken] ListTopicSnapshotsResponse nextPageToken
|
3522 | */
|
3523 |
|
3524 | /**
|
3525 | * Constructs a new ListTopicSnapshotsResponse.
|
3526 | * @memberof google.pubsub.v1
|
3527 | * @classdesc Represents a ListTopicSnapshotsResponse.
|
3528 | * @implements IListTopicSnapshotsResponse
|
3529 | * @constructor
|
3530 | * @param {google.pubsub.v1.IListTopicSnapshotsResponse=} [properties] Properties to set
|
3531 | */
|
3532 | function ListTopicSnapshotsResponse(properties) {
|
3533 | this.snapshots = [];
|
3534 | if (properties)
|
3535 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
3536 | if (properties[keys[i]] != null)
|
3537 | this[keys[i]] = properties[keys[i]];
|
3538 | }
|
3539 |
|
3540 | /**
|
3541 | * ListTopicSnapshotsResponse snapshots.
|
3542 | * @member {Array.<string>} snapshots
|
3543 | * @memberof google.pubsub.v1.ListTopicSnapshotsResponse
|
3544 | * @instance
|
3545 | */
|
3546 | ListTopicSnapshotsResponse.prototype.snapshots = $util.emptyArray;
|
3547 |
|
3548 | /**
|
3549 | * ListTopicSnapshotsResponse nextPageToken.
|
3550 | * @member {string} nextPageToken
|
3551 | * @memberof google.pubsub.v1.ListTopicSnapshotsResponse
|
3552 | * @instance
|
3553 | */
|
3554 | ListTopicSnapshotsResponse.prototype.nextPageToken = "";
|
3555 |
|
3556 | /**
|
3557 | * Creates a new ListTopicSnapshotsResponse instance using the specified properties.
|
3558 | * @function create
|
3559 | * @memberof google.pubsub.v1.ListTopicSnapshotsResponse
|
3560 | * @static
|
3561 | * @param {google.pubsub.v1.IListTopicSnapshotsResponse=} [properties] Properties to set
|
3562 | * @returns {google.pubsub.v1.ListTopicSnapshotsResponse} ListTopicSnapshotsResponse instance
|
3563 | */
|
3564 | ListTopicSnapshotsResponse.create = function create(properties) {
|
3565 | return new ListTopicSnapshotsResponse(properties);
|
3566 | };
|
3567 |
|
3568 | /**
|
3569 | * Encodes the specified ListTopicSnapshotsResponse message. Does not implicitly {@link google.pubsub.v1.ListTopicSnapshotsResponse.verify|verify} messages.
|
3570 | * @function encode
|
3571 | * @memberof google.pubsub.v1.ListTopicSnapshotsResponse
|
3572 | * @static
|
3573 | * @param {google.pubsub.v1.IListTopicSnapshotsResponse} message ListTopicSnapshotsResponse message or plain object to encode
|
3574 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
3575 | * @returns {$protobuf.Writer} Writer
|
3576 | */
|
3577 | ListTopicSnapshotsResponse.encode = function encode(message, writer) {
|
3578 | if (!writer)
|
3579 | writer = $Writer.create();
|
3580 | if (message.snapshots != null && message.snapshots.length)
|
3581 | for (var i = 0; i < message.snapshots.length; ++i)
|
3582 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.snapshots[i]);
|
3583 | if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken"))
|
3584 | writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken);
|
3585 | return writer;
|
3586 | };
|
3587 |
|
3588 | /**
|
3589 | * Encodes the specified ListTopicSnapshotsResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ListTopicSnapshotsResponse.verify|verify} messages.
|
3590 | * @function encodeDelimited
|
3591 | * @memberof google.pubsub.v1.ListTopicSnapshotsResponse
|
3592 | * @static
|
3593 | * @param {google.pubsub.v1.IListTopicSnapshotsResponse} message ListTopicSnapshotsResponse message or plain object to encode
|
3594 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
3595 | * @returns {$protobuf.Writer} Writer
|
3596 | */
|
3597 | ListTopicSnapshotsResponse.encodeDelimited = function encodeDelimited(message, writer) {
|
3598 | return this.encode(message, writer).ldelim();
|
3599 | };
|
3600 |
|
3601 | /**
|
3602 | * Decodes a ListTopicSnapshotsResponse message from the specified reader or buffer.
|
3603 | * @function decode
|
3604 | * @memberof google.pubsub.v1.ListTopicSnapshotsResponse
|
3605 | * @static
|
3606 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
3607 | * @param {number} [length] Message length if known beforehand
|
3608 | * @returns {google.pubsub.v1.ListTopicSnapshotsResponse} ListTopicSnapshotsResponse
|
3609 | * @throws {Error} If the payload is not a reader or valid buffer
|
3610 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
3611 | */
|
3612 | ListTopicSnapshotsResponse.decode = function decode(reader, length) {
|
3613 | if (!(reader instanceof $Reader))
|
3614 | reader = $Reader.create(reader);
|
3615 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.ListTopicSnapshotsResponse();
|
3616 | while (reader.pos < end) {
|
3617 | var tag = reader.uint32();
|
3618 | switch (tag >>> 3) {
|
3619 | case 1:
|
3620 | if (!(message.snapshots && message.snapshots.length))
|
3621 | message.snapshots = [];
|
3622 | message.snapshots.push(reader.string());
|
3623 | break;
|
3624 | case 2:
|
3625 | message.nextPageToken = reader.string();
|
3626 | break;
|
3627 | default:
|
3628 | reader.skipType(tag & 7);
|
3629 | break;
|
3630 | }
|
3631 | }
|
3632 | return message;
|
3633 | };
|
3634 |
|
3635 | /**
|
3636 | * Decodes a ListTopicSnapshotsResponse message from the specified reader or buffer, length delimited.
|
3637 | * @function decodeDelimited
|
3638 | * @memberof google.pubsub.v1.ListTopicSnapshotsResponse
|
3639 | * @static
|
3640 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
3641 | * @returns {google.pubsub.v1.ListTopicSnapshotsResponse} ListTopicSnapshotsResponse
|
3642 | * @throws {Error} If the payload is not a reader or valid buffer
|
3643 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
3644 | */
|
3645 | ListTopicSnapshotsResponse.decodeDelimited = function decodeDelimited(reader) {
|
3646 | if (!(reader instanceof $Reader))
|
3647 | reader = new $Reader(reader);
|
3648 | return this.decode(reader, reader.uint32());
|
3649 | };
|
3650 |
|
3651 | /**
|
3652 | * Verifies a ListTopicSnapshotsResponse message.
|
3653 | * @function verify
|
3654 | * @memberof google.pubsub.v1.ListTopicSnapshotsResponse
|
3655 | * @static
|
3656 | * @param {Object.<string,*>} message Plain object to verify
|
3657 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
3658 | */
|
3659 | ListTopicSnapshotsResponse.verify = function verify(message) {
|
3660 | if (typeof message !== "object" || message === null)
|
3661 | return "object expected";
|
3662 | if (message.snapshots != null && message.hasOwnProperty("snapshots")) {
|
3663 | if (!Array.isArray(message.snapshots))
|
3664 | return "snapshots: array expected";
|
3665 | for (var i = 0; i < message.snapshots.length; ++i)
|
3666 | if (!$util.isString(message.snapshots[i]))
|
3667 | return "snapshots: string[] expected";
|
3668 | }
|
3669 | if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken"))
|
3670 | if (!$util.isString(message.nextPageToken))
|
3671 | return "nextPageToken: string expected";
|
3672 | return null;
|
3673 | };
|
3674 |
|
3675 | /**
|
3676 | * Creates a ListTopicSnapshotsResponse message from a plain object. Also converts values to their respective internal types.
|
3677 | * @function fromObject
|
3678 | * @memberof google.pubsub.v1.ListTopicSnapshotsResponse
|
3679 | * @static
|
3680 | * @param {Object.<string,*>} object Plain object
|
3681 | * @returns {google.pubsub.v1.ListTopicSnapshotsResponse} ListTopicSnapshotsResponse
|
3682 | */
|
3683 | ListTopicSnapshotsResponse.fromObject = function fromObject(object) {
|
3684 | if (object instanceof $root.google.pubsub.v1.ListTopicSnapshotsResponse)
|
3685 | return object;
|
3686 | var message = new $root.google.pubsub.v1.ListTopicSnapshotsResponse();
|
3687 | if (object.snapshots) {
|
3688 | if (!Array.isArray(object.snapshots))
|
3689 | throw TypeError(".google.pubsub.v1.ListTopicSnapshotsResponse.snapshots: array expected");
|
3690 | message.snapshots = [];
|
3691 | for (var i = 0; i < object.snapshots.length; ++i)
|
3692 | message.snapshots[i] = String(object.snapshots[i]);
|
3693 | }
|
3694 | if (object.nextPageToken != null)
|
3695 | message.nextPageToken = String(object.nextPageToken);
|
3696 | return message;
|
3697 | };
|
3698 |
|
3699 | /**
|
3700 | * Creates a plain object from a ListTopicSnapshotsResponse message. Also converts values to other types if specified.
|
3701 | * @function toObject
|
3702 | * @memberof google.pubsub.v1.ListTopicSnapshotsResponse
|
3703 | * @static
|
3704 | * @param {google.pubsub.v1.ListTopicSnapshotsResponse} message ListTopicSnapshotsResponse
|
3705 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
3706 | * @returns {Object.<string,*>} Plain object
|
3707 | */
|
3708 | ListTopicSnapshotsResponse.toObject = function toObject(message, options) {
|
3709 | if (!options)
|
3710 | options = {};
|
3711 | var object = {};
|
3712 | if (options.arrays || options.defaults)
|
3713 | object.snapshots = [];
|
3714 | if (options.defaults)
|
3715 | object.nextPageToken = "";
|
3716 | if (message.snapshots && message.snapshots.length) {
|
3717 | object.snapshots = [];
|
3718 | for (var j = 0; j < message.snapshots.length; ++j)
|
3719 | object.snapshots[j] = message.snapshots[j];
|
3720 | }
|
3721 | if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken"))
|
3722 | object.nextPageToken = message.nextPageToken;
|
3723 | return object;
|
3724 | };
|
3725 |
|
3726 | /**
|
3727 | * Converts this ListTopicSnapshotsResponse to JSON.
|
3728 | * @function toJSON
|
3729 | * @memberof google.pubsub.v1.ListTopicSnapshotsResponse
|
3730 | * @instance
|
3731 | * @returns {Object.<string,*>} JSON object
|
3732 | */
|
3733 | ListTopicSnapshotsResponse.prototype.toJSON = function toJSON() {
|
3734 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
3735 | };
|
3736 |
|
3737 | return ListTopicSnapshotsResponse;
|
3738 | })();
|
3739 |
|
3740 | v1.DeleteTopicRequest = (function() {
|
3741 |
|
3742 | /**
|
3743 | * Properties of a DeleteTopicRequest.
|
3744 | * @memberof google.pubsub.v1
|
3745 | * @interface IDeleteTopicRequest
|
3746 | * @property {string|null} [topic] DeleteTopicRequest topic
|
3747 | */
|
3748 |
|
3749 | /**
|
3750 | * Constructs a new DeleteTopicRequest.
|
3751 | * @memberof google.pubsub.v1
|
3752 | * @classdesc Represents a DeleteTopicRequest.
|
3753 | * @implements IDeleteTopicRequest
|
3754 | * @constructor
|
3755 | * @param {google.pubsub.v1.IDeleteTopicRequest=} [properties] Properties to set
|
3756 | */
|
3757 | function DeleteTopicRequest(properties) {
|
3758 | if (properties)
|
3759 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
3760 | if (properties[keys[i]] != null)
|
3761 | this[keys[i]] = properties[keys[i]];
|
3762 | }
|
3763 |
|
3764 | /**
|
3765 | * DeleteTopicRequest topic.
|
3766 | * @member {string} topic
|
3767 | * @memberof google.pubsub.v1.DeleteTopicRequest
|
3768 | * @instance
|
3769 | */
|
3770 | DeleteTopicRequest.prototype.topic = "";
|
3771 |
|
3772 | /**
|
3773 | * Creates a new DeleteTopicRequest instance using the specified properties.
|
3774 | * @function create
|
3775 | * @memberof google.pubsub.v1.DeleteTopicRequest
|
3776 | * @static
|
3777 | * @param {google.pubsub.v1.IDeleteTopicRequest=} [properties] Properties to set
|
3778 | * @returns {google.pubsub.v1.DeleteTopicRequest} DeleteTopicRequest instance
|
3779 | */
|
3780 | DeleteTopicRequest.create = function create(properties) {
|
3781 | return new DeleteTopicRequest(properties);
|
3782 | };
|
3783 |
|
3784 | /**
|
3785 | * Encodes the specified DeleteTopicRequest message. Does not implicitly {@link google.pubsub.v1.DeleteTopicRequest.verify|verify} messages.
|
3786 | * @function encode
|
3787 | * @memberof google.pubsub.v1.DeleteTopicRequest
|
3788 | * @static
|
3789 | * @param {google.pubsub.v1.IDeleteTopicRequest} message DeleteTopicRequest message or plain object to encode
|
3790 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
3791 | * @returns {$protobuf.Writer} Writer
|
3792 | */
|
3793 | DeleteTopicRequest.encode = function encode(message, writer) {
|
3794 | if (!writer)
|
3795 | writer = $Writer.create();
|
3796 | if (message.topic != null && Object.hasOwnProperty.call(message, "topic"))
|
3797 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.topic);
|
3798 | return writer;
|
3799 | };
|
3800 |
|
3801 | /**
|
3802 | * Encodes the specified DeleteTopicRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.DeleteTopicRequest.verify|verify} messages.
|
3803 | * @function encodeDelimited
|
3804 | * @memberof google.pubsub.v1.DeleteTopicRequest
|
3805 | * @static
|
3806 | * @param {google.pubsub.v1.IDeleteTopicRequest} message DeleteTopicRequest message or plain object to encode
|
3807 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
3808 | * @returns {$protobuf.Writer} Writer
|
3809 | */
|
3810 | DeleteTopicRequest.encodeDelimited = function encodeDelimited(message, writer) {
|
3811 | return this.encode(message, writer).ldelim();
|
3812 | };
|
3813 |
|
3814 | /**
|
3815 | * Decodes a DeleteTopicRequest message from the specified reader or buffer.
|
3816 | * @function decode
|
3817 | * @memberof google.pubsub.v1.DeleteTopicRequest
|
3818 | * @static
|
3819 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
3820 | * @param {number} [length] Message length if known beforehand
|
3821 | * @returns {google.pubsub.v1.DeleteTopicRequest} DeleteTopicRequest
|
3822 | * @throws {Error} If the payload is not a reader or valid buffer
|
3823 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
3824 | */
|
3825 | DeleteTopicRequest.decode = function decode(reader, length) {
|
3826 | if (!(reader instanceof $Reader))
|
3827 | reader = $Reader.create(reader);
|
3828 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.DeleteTopicRequest();
|
3829 | while (reader.pos < end) {
|
3830 | var tag = reader.uint32();
|
3831 | switch (tag >>> 3) {
|
3832 | case 1:
|
3833 | message.topic = reader.string();
|
3834 | break;
|
3835 | default:
|
3836 | reader.skipType(tag & 7);
|
3837 | break;
|
3838 | }
|
3839 | }
|
3840 | return message;
|
3841 | };
|
3842 |
|
3843 | /**
|
3844 | * Decodes a DeleteTopicRequest message from the specified reader or buffer, length delimited.
|
3845 | * @function decodeDelimited
|
3846 | * @memberof google.pubsub.v1.DeleteTopicRequest
|
3847 | * @static
|
3848 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
3849 | * @returns {google.pubsub.v1.DeleteTopicRequest} DeleteTopicRequest
|
3850 | * @throws {Error} If the payload is not a reader or valid buffer
|
3851 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
3852 | */
|
3853 | DeleteTopicRequest.decodeDelimited = function decodeDelimited(reader) {
|
3854 | if (!(reader instanceof $Reader))
|
3855 | reader = new $Reader(reader);
|
3856 | return this.decode(reader, reader.uint32());
|
3857 | };
|
3858 |
|
3859 | /**
|
3860 | * Verifies a DeleteTopicRequest message.
|
3861 | * @function verify
|
3862 | * @memberof google.pubsub.v1.DeleteTopicRequest
|
3863 | * @static
|
3864 | * @param {Object.<string,*>} message Plain object to verify
|
3865 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
3866 | */
|
3867 | DeleteTopicRequest.verify = function verify(message) {
|
3868 | if (typeof message !== "object" || message === null)
|
3869 | return "object expected";
|
3870 | if (message.topic != null && message.hasOwnProperty("topic"))
|
3871 | if (!$util.isString(message.topic))
|
3872 | return "topic: string expected";
|
3873 | return null;
|
3874 | };
|
3875 |
|
3876 | /**
|
3877 | * Creates a DeleteTopicRequest message from a plain object. Also converts values to their respective internal types.
|
3878 | * @function fromObject
|
3879 | * @memberof google.pubsub.v1.DeleteTopicRequest
|
3880 | * @static
|
3881 | * @param {Object.<string,*>} object Plain object
|
3882 | * @returns {google.pubsub.v1.DeleteTopicRequest} DeleteTopicRequest
|
3883 | */
|
3884 | DeleteTopicRequest.fromObject = function fromObject(object) {
|
3885 | if (object instanceof $root.google.pubsub.v1.DeleteTopicRequest)
|
3886 | return object;
|
3887 | var message = new $root.google.pubsub.v1.DeleteTopicRequest();
|
3888 | if (object.topic != null)
|
3889 | message.topic = String(object.topic);
|
3890 | return message;
|
3891 | };
|
3892 |
|
3893 | /**
|
3894 | * Creates a plain object from a DeleteTopicRequest message. Also converts values to other types if specified.
|
3895 | * @function toObject
|
3896 | * @memberof google.pubsub.v1.DeleteTopicRequest
|
3897 | * @static
|
3898 | * @param {google.pubsub.v1.DeleteTopicRequest} message DeleteTopicRequest
|
3899 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
3900 | * @returns {Object.<string,*>} Plain object
|
3901 | */
|
3902 | DeleteTopicRequest.toObject = function toObject(message, options) {
|
3903 | if (!options)
|
3904 | options = {};
|
3905 | var object = {};
|
3906 | if (options.defaults)
|
3907 | object.topic = "";
|
3908 | if (message.topic != null && message.hasOwnProperty("topic"))
|
3909 | object.topic = message.topic;
|
3910 | return object;
|
3911 | };
|
3912 |
|
3913 | /**
|
3914 | * Converts this DeleteTopicRequest to JSON.
|
3915 | * @function toJSON
|
3916 | * @memberof google.pubsub.v1.DeleteTopicRequest
|
3917 | * @instance
|
3918 | * @returns {Object.<string,*>} JSON object
|
3919 | */
|
3920 | DeleteTopicRequest.prototype.toJSON = function toJSON() {
|
3921 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
3922 | };
|
3923 |
|
3924 | return DeleteTopicRequest;
|
3925 | })();
|
3926 |
|
3927 | v1.DetachSubscriptionRequest = (function() {
|
3928 |
|
3929 | /**
|
3930 | * Properties of a DetachSubscriptionRequest.
|
3931 | * @memberof google.pubsub.v1
|
3932 | * @interface IDetachSubscriptionRequest
|
3933 | * @property {string|null} [subscription] DetachSubscriptionRequest subscription
|
3934 | */
|
3935 |
|
3936 | /**
|
3937 | * Constructs a new DetachSubscriptionRequest.
|
3938 | * @memberof google.pubsub.v1
|
3939 | * @classdesc Represents a DetachSubscriptionRequest.
|
3940 | * @implements IDetachSubscriptionRequest
|
3941 | * @constructor
|
3942 | * @param {google.pubsub.v1.IDetachSubscriptionRequest=} [properties] Properties to set
|
3943 | */
|
3944 | function DetachSubscriptionRequest(properties) {
|
3945 | if (properties)
|
3946 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
3947 | if (properties[keys[i]] != null)
|
3948 | this[keys[i]] = properties[keys[i]];
|
3949 | }
|
3950 |
|
3951 | /**
|
3952 | * DetachSubscriptionRequest subscription.
|
3953 | * @member {string} subscription
|
3954 | * @memberof google.pubsub.v1.DetachSubscriptionRequest
|
3955 | * @instance
|
3956 | */
|
3957 | DetachSubscriptionRequest.prototype.subscription = "";
|
3958 |
|
3959 | /**
|
3960 | * Creates a new DetachSubscriptionRequest instance using the specified properties.
|
3961 | * @function create
|
3962 | * @memberof google.pubsub.v1.DetachSubscriptionRequest
|
3963 | * @static
|
3964 | * @param {google.pubsub.v1.IDetachSubscriptionRequest=} [properties] Properties to set
|
3965 | * @returns {google.pubsub.v1.DetachSubscriptionRequest} DetachSubscriptionRequest instance
|
3966 | */
|
3967 | DetachSubscriptionRequest.create = function create(properties) {
|
3968 | return new DetachSubscriptionRequest(properties);
|
3969 | };
|
3970 |
|
3971 | /**
|
3972 | * Encodes the specified DetachSubscriptionRequest message. Does not implicitly {@link google.pubsub.v1.DetachSubscriptionRequest.verify|verify} messages.
|
3973 | * @function encode
|
3974 | * @memberof google.pubsub.v1.DetachSubscriptionRequest
|
3975 | * @static
|
3976 | * @param {google.pubsub.v1.IDetachSubscriptionRequest} message DetachSubscriptionRequest message or plain object to encode
|
3977 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
3978 | * @returns {$protobuf.Writer} Writer
|
3979 | */
|
3980 | DetachSubscriptionRequest.encode = function encode(message, writer) {
|
3981 | if (!writer)
|
3982 | writer = $Writer.create();
|
3983 | if (message.subscription != null && Object.hasOwnProperty.call(message, "subscription"))
|
3984 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.subscription);
|
3985 | return writer;
|
3986 | };
|
3987 |
|
3988 | /**
|
3989 | * Encodes the specified DetachSubscriptionRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.DetachSubscriptionRequest.verify|verify} messages.
|
3990 | * @function encodeDelimited
|
3991 | * @memberof google.pubsub.v1.DetachSubscriptionRequest
|
3992 | * @static
|
3993 | * @param {google.pubsub.v1.IDetachSubscriptionRequest} message DetachSubscriptionRequest message or plain object to encode
|
3994 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
3995 | * @returns {$protobuf.Writer} Writer
|
3996 | */
|
3997 | DetachSubscriptionRequest.encodeDelimited = function encodeDelimited(message, writer) {
|
3998 | return this.encode(message, writer).ldelim();
|
3999 | };
|
4000 |
|
4001 | /**
|
4002 | * Decodes a DetachSubscriptionRequest message from the specified reader or buffer.
|
4003 | * @function decode
|
4004 | * @memberof google.pubsub.v1.DetachSubscriptionRequest
|
4005 | * @static
|
4006 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
4007 | * @param {number} [length] Message length if known beforehand
|
4008 | * @returns {google.pubsub.v1.DetachSubscriptionRequest} DetachSubscriptionRequest
|
4009 | * @throws {Error} If the payload is not a reader or valid buffer
|
4010 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
4011 | */
|
4012 | DetachSubscriptionRequest.decode = function decode(reader, length) {
|
4013 | if (!(reader instanceof $Reader))
|
4014 | reader = $Reader.create(reader);
|
4015 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.DetachSubscriptionRequest();
|
4016 | while (reader.pos < end) {
|
4017 | var tag = reader.uint32();
|
4018 | switch (tag >>> 3) {
|
4019 | case 1:
|
4020 | message.subscription = reader.string();
|
4021 | break;
|
4022 | default:
|
4023 | reader.skipType(tag & 7);
|
4024 | break;
|
4025 | }
|
4026 | }
|
4027 | return message;
|
4028 | };
|
4029 |
|
4030 | /**
|
4031 | * Decodes a DetachSubscriptionRequest message from the specified reader or buffer, length delimited.
|
4032 | * @function decodeDelimited
|
4033 | * @memberof google.pubsub.v1.DetachSubscriptionRequest
|
4034 | * @static
|
4035 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
4036 | * @returns {google.pubsub.v1.DetachSubscriptionRequest} DetachSubscriptionRequest
|
4037 | * @throws {Error} If the payload is not a reader or valid buffer
|
4038 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
4039 | */
|
4040 | DetachSubscriptionRequest.decodeDelimited = function decodeDelimited(reader) {
|
4041 | if (!(reader instanceof $Reader))
|
4042 | reader = new $Reader(reader);
|
4043 | return this.decode(reader, reader.uint32());
|
4044 | };
|
4045 |
|
4046 | /**
|
4047 | * Verifies a DetachSubscriptionRequest message.
|
4048 | * @function verify
|
4049 | * @memberof google.pubsub.v1.DetachSubscriptionRequest
|
4050 | * @static
|
4051 | * @param {Object.<string,*>} message Plain object to verify
|
4052 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
4053 | */
|
4054 | DetachSubscriptionRequest.verify = function verify(message) {
|
4055 | if (typeof message !== "object" || message === null)
|
4056 | return "object expected";
|
4057 | if (message.subscription != null && message.hasOwnProperty("subscription"))
|
4058 | if (!$util.isString(message.subscription))
|
4059 | return "subscription: string expected";
|
4060 | return null;
|
4061 | };
|
4062 |
|
4063 | /**
|
4064 | * Creates a DetachSubscriptionRequest message from a plain object. Also converts values to their respective internal types.
|
4065 | * @function fromObject
|
4066 | * @memberof google.pubsub.v1.DetachSubscriptionRequest
|
4067 | * @static
|
4068 | * @param {Object.<string,*>} object Plain object
|
4069 | * @returns {google.pubsub.v1.DetachSubscriptionRequest} DetachSubscriptionRequest
|
4070 | */
|
4071 | DetachSubscriptionRequest.fromObject = function fromObject(object) {
|
4072 | if (object instanceof $root.google.pubsub.v1.DetachSubscriptionRequest)
|
4073 | return object;
|
4074 | var message = new $root.google.pubsub.v1.DetachSubscriptionRequest();
|
4075 | if (object.subscription != null)
|
4076 | message.subscription = String(object.subscription);
|
4077 | return message;
|
4078 | };
|
4079 |
|
4080 | /**
|
4081 | * Creates a plain object from a DetachSubscriptionRequest message. Also converts values to other types if specified.
|
4082 | * @function toObject
|
4083 | * @memberof google.pubsub.v1.DetachSubscriptionRequest
|
4084 | * @static
|
4085 | * @param {google.pubsub.v1.DetachSubscriptionRequest} message DetachSubscriptionRequest
|
4086 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
4087 | * @returns {Object.<string,*>} Plain object
|
4088 | */
|
4089 | DetachSubscriptionRequest.toObject = function toObject(message, options) {
|
4090 | if (!options)
|
4091 | options = {};
|
4092 | var object = {};
|
4093 | if (options.defaults)
|
4094 | object.subscription = "";
|
4095 | if (message.subscription != null && message.hasOwnProperty("subscription"))
|
4096 | object.subscription = message.subscription;
|
4097 | return object;
|
4098 | };
|
4099 |
|
4100 | /**
|
4101 | * Converts this DetachSubscriptionRequest to JSON.
|
4102 | * @function toJSON
|
4103 | * @memberof google.pubsub.v1.DetachSubscriptionRequest
|
4104 | * @instance
|
4105 | * @returns {Object.<string,*>} JSON object
|
4106 | */
|
4107 | DetachSubscriptionRequest.prototype.toJSON = function toJSON() {
|
4108 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
4109 | };
|
4110 |
|
4111 | return DetachSubscriptionRequest;
|
4112 | })();
|
4113 |
|
4114 | v1.DetachSubscriptionResponse = (function() {
|
4115 |
|
4116 | /**
|
4117 | * Properties of a DetachSubscriptionResponse.
|
4118 | * @memberof google.pubsub.v1
|
4119 | * @interface IDetachSubscriptionResponse
|
4120 | */
|
4121 |
|
4122 | /**
|
4123 | * Constructs a new DetachSubscriptionResponse.
|
4124 | * @memberof google.pubsub.v1
|
4125 | * @classdesc Represents a DetachSubscriptionResponse.
|
4126 | * @implements IDetachSubscriptionResponse
|
4127 | * @constructor
|
4128 | * @param {google.pubsub.v1.IDetachSubscriptionResponse=} [properties] Properties to set
|
4129 | */
|
4130 | function DetachSubscriptionResponse(properties) {
|
4131 | if (properties)
|
4132 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
4133 | if (properties[keys[i]] != null)
|
4134 | this[keys[i]] = properties[keys[i]];
|
4135 | }
|
4136 |
|
4137 | /**
|
4138 | * Creates a new DetachSubscriptionResponse instance using the specified properties.
|
4139 | * @function create
|
4140 | * @memberof google.pubsub.v1.DetachSubscriptionResponse
|
4141 | * @static
|
4142 | * @param {google.pubsub.v1.IDetachSubscriptionResponse=} [properties] Properties to set
|
4143 | * @returns {google.pubsub.v1.DetachSubscriptionResponse} DetachSubscriptionResponse instance
|
4144 | */
|
4145 | DetachSubscriptionResponse.create = function create(properties) {
|
4146 | return new DetachSubscriptionResponse(properties);
|
4147 | };
|
4148 |
|
4149 | /**
|
4150 | * Encodes the specified DetachSubscriptionResponse message. Does not implicitly {@link google.pubsub.v1.DetachSubscriptionResponse.verify|verify} messages.
|
4151 | * @function encode
|
4152 | * @memberof google.pubsub.v1.DetachSubscriptionResponse
|
4153 | * @static
|
4154 | * @param {google.pubsub.v1.IDetachSubscriptionResponse} message DetachSubscriptionResponse message or plain object to encode
|
4155 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
4156 | * @returns {$protobuf.Writer} Writer
|
4157 | */
|
4158 | DetachSubscriptionResponse.encode = function encode(message, writer) {
|
4159 | if (!writer)
|
4160 | writer = $Writer.create();
|
4161 | return writer;
|
4162 | };
|
4163 |
|
4164 | /**
|
4165 | * Encodes the specified DetachSubscriptionResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.DetachSubscriptionResponse.verify|verify} messages.
|
4166 | * @function encodeDelimited
|
4167 | * @memberof google.pubsub.v1.DetachSubscriptionResponse
|
4168 | * @static
|
4169 | * @param {google.pubsub.v1.IDetachSubscriptionResponse} message DetachSubscriptionResponse message or plain object to encode
|
4170 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
4171 | * @returns {$protobuf.Writer} Writer
|
4172 | */
|
4173 | DetachSubscriptionResponse.encodeDelimited = function encodeDelimited(message, writer) {
|
4174 | return this.encode(message, writer).ldelim();
|
4175 | };
|
4176 |
|
4177 | /**
|
4178 | * Decodes a DetachSubscriptionResponse message from the specified reader or buffer.
|
4179 | * @function decode
|
4180 | * @memberof google.pubsub.v1.DetachSubscriptionResponse
|
4181 | * @static
|
4182 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
4183 | * @param {number} [length] Message length if known beforehand
|
4184 | * @returns {google.pubsub.v1.DetachSubscriptionResponse} DetachSubscriptionResponse
|
4185 | * @throws {Error} If the payload is not a reader or valid buffer
|
4186 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
4187 | */
|
4188 | DetachSubscriptionResponse.decode = function decode(reader, length) {
|
4189 | if (!(reader instanceof $Reader))
|
4190 | reader = $Reader.create(reader);
|
4191 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.DetachSubscriptionResponse();
|
4192 | while (reader.pos < end) {
|
4193 | var tag = reader.uint32();
|
4194 | switch (tag >>> 3) {
|
4195 | default:
|
4196 | reader.skipType(tag & 7);
|
4197 | break;
|
4198 | }
|
4199 | }
|
4200 | return message;
|
4201 | };
|
4202 |
|
4203 | /**
|
4204 | * Decodes a DetachSubscriptionResponse message from the specified reader or buffer, length delimited.
|
4205 | * @function decodeDelimited
|
4206 | * @memberof google.pubsub.v1.DetachSubscriptionResponse
|
4207 | * @static
|
4208 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
4209 | * @returns {google.pubsub.v1.DetachSubscriptionResponse} DetachSubscriptionResponse
|
4210 | * @throws {Error} If the payload is not a reader or valid buffer
|
4211 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
4212 | */
|
4213 | DetachSubscriptionResponse.decodeDelimited = function decodeDelimited(reader) {
|
4214 | if (!(reader instanceof $Reader))
|
4215 | reader = new $Reader(reader);
|
4216 | return this.decode(reader, reader.uint32());
|
4217 | };
|
4218 |
|
4219 | /**
|
4220 | * Verifies a DetachSubscriptionResponse message.
|
4221 | * @function verify
|
4222 | * @memberof google.pubsub.v1.DetachSubscriptionResponse
|
4223 | * @static
|
4224 | * @param {Object.<string,*>} message Plain object to verify
|
4225 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
4226 | */
|
4227 | DetachSubscriptionResponse.verify = function verify(message) {
|
4228 | if (typeof message !== "object" || message === null)
|
4229 | return "object expected";
|
4230 | return null;
|
4231 | };
|
4232 |
|
4233 | /**
|
4234 | * Creates a DetachSubscriptionResponse message from a plain object. Also converts values to their respective internal types.
|
4235 | * @function fromObject
|
4236 | * @memberof google.pubsub.v1.DetachSubscriptionResponse
|
4237 | * @static
|
4238 | * @param {Object.<string,*>} object Plain object
|
4239 | * @returns {google.pubsub.v1.DetachSubscriptionResponse} DetachSubscriptionResponse
|
4240 | */
|
4241 | DetachSubscriptionResponse.fromObject = function fromObject(object) {
|
4242 | if (object instanceof $root.google.pubsub.v1.DetachSubscriptionResponse)
|
4243 | return object;
|
4244 | return new $root.google.pubsub.v1.DetachSubscriptionResponse();
|
4245 | };
|
4246 |
|
4247 | /**
|
4248 | * Creates a plain object from a DetachSubscriptionResponse message. Also converts values to other types if specified.
|
4249 | * @function toObject
|
4250 | * @memberof google.pubsub.v1.DetachSubscriptionResponse
|
4251 | * @static
|
4252 | * @param {google.pubsub.v1.DetachSubscriptionResponse} message DetachSubscriptionResponse
|
4253 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
4254 | * @returns {Object.<string,*>} Plain object
|
4255 | */
|
4256 | DetachSubscriptionResponse.toObject = function toObject() {
|
4257 | return {};
|
4258 | };
|
4259 |
|
4260 | /**
|
4261 | * Converts this DetachSubscriptionResponse to JSON.
|
4262 | * @function toJSON
|
4263 | * @memberof google.pubsub.v1.DetachSubscriptionResponse
|
4264 | * @instance
|
4265 | * @returns {Object.<string,*>} JSON object
|
4266 | */
|
4267 | DetachSubscriptionResponse.prototype.toJSON = function toJSON() {
|
4268 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
4269 | };
|
4270 |
|
4271 | return DetachSubscriptionResponse;
|
4272 | })();
|
4273 |
|
4274 | v1.Subscriber = (function() {
|
4275 |
|
4276 | /**
|
4277 | * Constructs a new Subscriber service.
|
4278 | * @memberof google.pubsub.v1
|
4279 | * @classdesc Represents a Subscriber
|
4280 | * @extends $protobuf.rpc.Service
|
4281 | * @constructor
|
4282 | * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
|
4283 | * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
|
4284 | * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
|
4285 | */
|
4286 | function Subscriber(rpcImpl, requestDelimited, responseDelimited) {
|
4287 | $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);
|
4288 | }
|
4289 |
|
4290 | (Subscriber.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Subscriber;
|
4291 |
|
4292 | /**
|
4293 | * Creates new Subscriber service using the specified rpc implementation.
|
4294 | * @function create
|
4295 | * @memberof google.pubsub.v1.Subscriber
|
4296 | * @static
|
4297 | * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
|
4298 | * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
|
4299 | * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
|
4300 | * @returns {Subscriber} RPC service. Useful where requests and/or responses are streamed.
|
4301 | */
|
4302 | Subscriber.create = function create(rpcImpl, requestDelimited, responseDelimited) {
|
4303 | return new this(rpcImpl, requestDelimited, responseDelimited);
|
4304 | };
|
4305 |
|
4306 | /**
|
4307 | * Callback as used by {@link google.pubsub.v1.Subscriber|createSubscription}.
|
4308 | * @memberof google.pubsub.v1.Subscriber
|
4309 | * @typedef CreateSubscriptionCallback
|
4310 | * @type {function}
|
4311 | * @param {Error|null} error Error, if any
|
4312 | * @param {google.pubsub.v1.Subscription} [response] Subscription
|
4313 | */
|
4314 |
|
4315 | /**
|
4316 | * Calls CreateSubscription.
|
4317 | * @function createSubscription
|
4318 | * @memberof google.pubsub.v1.Subscriber
|
4319 | * @instance
|
4320 | * @param {google.pubsub.v1.ISubscription} request Subscription message or plain object
|
4321 | * @param {google.pubsub.v1.Subscriber.CreateSubscriptionCallback} callback Node-style callback called with the error, if any, and Subscription
|
4322 | * @returns {undefined}
|
4323 | * @variation 1
|
4324 | */
|
4325 | Object.defineProperty(Subscriber.prototype.createSubscription = function createSubscription(request, callback) {
|
4326 | return this.rpcCall(createSubscription, $root.google.pubsub.v1.Subscription, $root.google.pubsub.v1.Subscription, request, callback);
|
4327 | }, "name", { value: "CreateSubscription" });
|
4328 |
|
4329 | /**
|
4330 | * Calls CreateSubscription.
|
4331 | * @function createSubscription
|
4332 | * @memberof google.pubsub.v1.Subscriber
|
4333 | * @instance
|
4334 | * @param {google.pubsub.v1.ISubscription} request Subscription message or plain object
|
4335 | * @returns {Promise<google.pubsub.v1.Subscription>} Promise
|
4336 | * @variation 2
|
4337 | */
|
4338 |
|
4339 | /**
|
4340 | * Callback as used by {@link google.pubsub.v1.Subscriber|getSubscription}.
|
4341 | * @memberof google.pubsub.v1.Subscriber
|
4342 | * @typedef GetSubscriptionCallback
|
4343 | * @type {function}
|
4344 | * @param {Error|null} error Error, if any
|
4345 | * @param {google.pubsub.v1.Subscription} [response] Subscription
|
4346 | */
|
4347 |
|
4348 | /**
|
4349 | * Calls GetSubscription.
|
4350 | * @function getSubscription
|
4351 | * @memberof google.pubsub.v1.Subscriber
|
4352 | * @instance
|
4353 | * @param {google.pubsub.v1.IGetSubscriptionRequest} request GetSubscriptionRequest message or plain object
|
4354 | * @param {google.pubsub.v1.Subscriber.GetSubscriptionCallback} callback Node-style callback called with the error, if any, and Subscription
|
4355 | * @returns {undefined}
|
4356 | * @variation 1
|
4357 | */
|
4358 | Object.defineProperty(Subscriber.prototype.getSubscription = function getSubscription(request, callback) {
|
4359 | return this.rpcCall(getSubscription, $root.google.pubsub.v1.GetSubscriptionRequest, $root.google.pubsub.v1.Subscription, request, callback);
|
4360 | }, "name", { value: "GetSubscription" });
|
4361 |
|
4362 | /**
|
4363 | * Calls GetSubscription.
|
4364 | * @function getSubscription
|
4365 | * @memberof google.pubsub.v1.Subscriber
|
4366 | * @instance
|
4367 | * @param {google.pubsub.v1.IGetSubscriptionRequest} request GetSubscriptionRequest message or plain object
|
4368 | * @returns {Promise<google.pubsub.v1.Subscription>} Promise
|
4369 | * @variation 2
|
4370 | */
|
4371 |
|
4372 | /**
|
4373 | * Callback as used by {@link google.pubsub.v1.Subscriber|updateSubscription}.
|
4374 | * @memberof google.pubsub.v1.Subscriber
|
4375 | * @typedef UpdateSubscriptionCallback
|
4376 | * @type {function}
|
4377 | * @param {Error|null} error Error, if any
|
4378 | * @param {google.pubsub.v1.Subscription} [response] Subscription
|
4379 | */
|
4380 |
|
4381 | /**
|
4382 | * Calls UpdateSubscription.
|
4383 | * @function updateSubscription
|
4384 | * @memberof google.pubsub.v1.Subscriber
|
4385 | * @instance
|
4386 | * @param {google.pubsub.v1.IUpdateSubscriptionRequest} request UpdateSubscriptionRequest message or plain object
|
4387 | * @param {google.pubsub.v1.Subscriber.UpdateSubscriptionCallback} callback Node-style callback called with the error, if any, and Subscription
|
4388 | * @returns {undefined}
|
4389 | * @variation 1
|
4390 | */
|
4391 | Object.defineProperty(Subscriber.prototype.updateSubscription = function updateSubscription(request, callback) {
|
4392 | return this.rpcCall(updateSubscription, $root.google.pubsub.v1.UpdateSubscriptionRequest, $root.google.pubsub.v1.Subscription, request, callback);
|
4393 | }, "name", { value: "UpdateSubscription" });
|
4394 |
|
4395 | /**
|
4396 | * Calls UpdateSubscription.
|
4397 | * @function updateSubscription
|
4398 | * @memberof google.pubsub.v1.Subscriber
|
4399 | * @instance
|
4400 | * @param {google.pubsub.v1.IUpdateSubscriptionRequest} request UpdateSubscriptionRequest message or plain object
|
4401 | * @returns {Promise<google.pubsub.v1.Subscription>} Promise
|
4402 | * @variation 2
|
4403 | */
|
4404 |
|
4405 | /**
|
4406 | * Callback as used by {@link google.pubsub.v1.Subscriber|listSubscriptions}.
|
4407 | * @memberof google.pubsub.v1.Subscriber
|
4408 | * @typedef ListSubscriptionsCallback
|
4409 | * @type {function}
|
4410 | * @param {Error|null} error Error, if any
|
4411 | * @param {google.pubsub.v1.ListSubscriptionsResponse} [response] ListSubscriptionsResponse
|
4412 | */
|
4413 |
|
4414 | /**
|
4415 | * Calls ListSubscriptions.
|
4416 | * @function listSubscriptions
|
4417 | * @memberof google.pubsub.v1.Subscriber
|
4418 | * @instance
|
4419 | * @param {google.pubsub.v1.IListSubscriptionsRequest} request ListSubscriptionsRequest message or plain object
|
4420 | * @param {google.pubsub.v1.Subscriber.ListSubscriptionsCallback} callback Node-style callback called with the error, if any, and ListSubscriptionsResponse
|
4421 | * @returns {undefined}
|
4422 | * @variation 1
|
4423 | */
|
4424 | Object.defineProperty(Subscriber.prototype.listSubscriptions = function listSubscriptions(request, callback) {
|
4425 | return this.rpcCall(listSubscriptions, $root.google.pubsub.v1.ListSubscriptionsRequest, $root.google.pubsub.v1.ListSubscriptionsResponse, request, callback);
|
4426 | }, "name", { value: "ListSubscriptions" });
|
4427 |
|
4428 | /**
|
4429 | * Calls ListSubscriptions.
|
4430 | * @function listSubscriptions
|
4431 | * @memberof google.pubsub.v1.Subscriber
|
4432 | * @instance
|
4433 | * @param {google.pubsub.v1.IListSubscriptionsRequest} request ListSubscriptionsRequest message or plain object
|
4434 | * @returns {Promise<google.pubsub.v1.ListSubscriptionsResponse>} Promise
|
4435 | * @variation 2
|
4436 | */
|
4437 |
|
4438 | /**
|
4439 | * Callback as used by {@link google.pubsub.v1.Subscriber|deleteSubscription}.
|
4440 | * @memberof google.pubsub.v1.Subscriber
|
4441 | * @typedef DeleteSubscriptionCallback
|
4442 | * @type {function}
|
4443 | * @param {Error|null} error Error, if any
|
4444 | * @param {google.protobuf.Empty} [response] Empty
|
4445 | */
|
4446 |
|
4447 | /**
|
4448 | * Calls DeleteSubscription.
|
4449 | * @function deleteSubscription
|
4450 | * @memberof google.pubsub.v1.Subscriber
|
4451 | * @instance
|
4452 | * @param {google.pubsub.v1.IDeleteSubscriptionRequest} request DeleteSubscriptionRequest message or plain object
|
4453 | * @param {google.pubsub.v1.Subscriber.DeleteSubscriptionCallback} callback Node-style callback called with the error, if any, and Empty
|
4454 | * @returns {undefined}
|
4455 | * @variation 1
|
4456 | */
|
4457 | Object.defineProperty(Subscriber.prototype.deleteSubscription = function deleteSubscription(request, callback) {
|
4458 | return this.rpcCall(deleteSubscription, $root.google.pubsub.v1.DeleteSubscriptionRequest, $root.google.protobuf.Empty, request, callback);
|
4459 | }, "name", { value: "DeleteSubscription" });
|
4460 |
|
4461 | /**
|
4462 | * Calls DeleteSubscription.
|
4463 | * @function deleteSubscription
|
4464 | * @memberof google.pubsub.v1.Subscriber
|
4465 | * @instance
|
4466 | * @param {google.pubsub.v1.IDeleteSubscriptionRequest} request DeleteSubscriptionRequest message or plain object
|
4467 | * @returns {Promise<google.protobuf.Empty>} Promise
|
4468 | * @variation 2
|
4469 | */
|
4470 |
|
4471 | /**
|
4472 | * Callback as used by {@link google.pubsub.v1.Subscriber|modifyAckDeadline}.
|
4473 | * @memberof google.pubsub.v1.Subscriber
|
4474 | * @typedef ModifyAckDeadlineCallback
|
4475 | * @type {function}
|
4476 | * @param {Error|null} error Error, if any
|
4477 | * @param {google.protobuf.Empty} [response] Empty
|
4478 | */
|
4479 |
|
4480 | /**
|
4481 | * Calls ModifyAckDeadline.
|
4482 | * @function modifyAckDeadline
|
4483 | * @memberof google.pubsub.v1.Subscriber
|
4484 | * @instance
|
4485 | * @param {google.pubsub.v1.IModifyAckDeadlineRequest} request ModifyAckDeadlineRequest message or plain object
|
4486 | * @param {google.pubsub.v1.Subscriber.ModifyAckDeadlineCallback} callback Node-style callback called with the error, if any, and Empty
|
4487 | * @returns {undefined}
|
4488 | * @variation 1
|
4489 | */
|
4490 | Object.defineProperty(Subscriber.prototype.modifyAckDeadline = function modifyAckDeadline(request, callback) {
|
4491 | return this.rpcCall(modifyAckDeadline, $root.google.pubsub.v1.ModifyAckDeadlineRequest, $root.google.protobuf.Empty, request, callback);
|
4492 | }, "name", { value: "ModifyAckDeadline" });
|
4493 |
|
4494 | /**
|
4495 | * Calls ModifyAckDeadline.
|
4496 | * @function modifyAckDeadline
|
4497 | * @memberof google.pubsub.v1.Subscriber
|
4498 | * @instance
|
4499 | * @param {google.pubsub.v1.IModifyAckDeadlineRequest} request ModifyAckDeadlineRequest message or plain object
|
4500 | * @returns {Promise<google.protobuf.Empty>} Promise
|
4501 | * @variation 2
|
4502 | */
|
4503 |
|
4504 | /**
|
4505 | * Callback as used by {@link google.pubsub.v1.Subscriber|acknowledge}.
|
4506 | * @memberof google.pubsub.v1.Subscriber
|
4507 | * @typedef AcknowledgeCallback
|
4508 | * @type {function}
|
4509 | * @param {Error|null} error Error, if any
|
4510 | * @param {google.protobuf.Empty} [response] Empty
|
4511 | */
|
4512 |
|
4513 | /**
|
4514 | * Calls Acknowledge.
|
4515 | * @function acknowledge
|
4516 | * @memberof google.pubsub.v1.Subscriber
|
4517 | * @instance
|
4518 | * @param {google.pubsub.v1.IAcknowledgeRequest} request AcknowledgeRequest message or plain object
|
4519 | * @param {google.pubsub.v1.Subscriber.AcknowledgeCallback} callback Node-style callback called with the error, if any, and Empty
|
4520 | * @returns {undefined}
|
4521 | * @variation 1
|
4522 | */
|
4523 | Object.defineProperty(Subscriber.prototype.acknowledge = function acknowledge(request, callback) {
|
4524 | return this.rpcCall(acknowledge, $root.google.pubsub.v1.AcknowledgeRequest, $root.google.protobuf.Empty, request, callback);
|
4525 | }, "name", { value: "Acknowledge" });
|
4526 |
|
4527 | /**
|
4528 | * Calls Acknowledge.
|
4529 | * @function acknowledge
|
4530 | * @memberof google.pubsub.v1.Subscriber
|
4531 | * @instance
|
4532 | * @param {google.pubsub.v1.IAcknowledgeRequest} request AcknowledgeRequest message or plain object
|
4533 | * @returns {Promise<google.protobuf.Empty>} Promise
|
4534 | * @variation 2
|
4535 | */
|
4536 |
|
4537 | /**
|
4538 | * Callback as used by {@link google.pubsub.v1.Subscriber|pull}.
|
4539 | * @memberof google.pubsub.v1.Subscriber
|
4540 | * @typedef PullCallback
|
4541 | * @type {function}
|
4542 | * @param {Error|null} error Error, if any
|
4543 | * @param {google.pubsub.v1.PullResponse} [response] PullResponse
|
4544 | */
|
4545 |
|
4546 | /**
|
4547 | * Calls Pull.
|
4548 | * @function pull
|
4549 | * @memberof google.pubsub.v1.Subscriber
|
4550 | * @instance
|
4551 | * @param {google.pubsub.v1.IPullRequest} request PullRequest message or plain object
|
4552 | * @param {google.pubsub.v1.Subscriber.PullCallback} callback Node-style callback called with the error, if any, and PullResponse
|
4553 | * @returns {undefined}
|
4554 | * @variation 1
|
4555 | */
|
4556 | Object.defineProperty(Subscriber.prototype.pull = function pull(request, callback) {
|
4557 | return this.rpcCall(pull, $root.google.pubsub.v1.PullRequest, $root.google.pubsub.v1.PullResponse, request, callback);
|
4558 | }, "name", { value: "Pull" });
|
4559 |
|
4560 | /**
|
4561 | * Calls Pull.
|
4562 | * @function pull
|
4563 | * @memberof google.pubsub.v1.Subscriber
|
4564 | * @instance
|
4565 | * @param {google.pubsub.v1.IPullRequest} request PullRequest message or plain object
|
4566 | * @returns {Promise<google.pubsub.v1.PullResponse>} Promise
|
4567 | * @variation 2
|
4568 | */
|
4569 |
|
4570 | /**
|
4571 | * Callback as used by {@link google.pubsub.v1.Subscriber|streamingPull}.
|
4572 | * @memberof google.pubsub.v1.Subscriber
|
4573 | * @typedef StreamingPullCallback
|
4574 | * @type {function}
|
4575 | * @param {Error|null} error Error, if any
|
4576 | * @param {google.pubsub.v1.StreamingPullResponse} [response] StreamingPullResponse
|
4577 | */
|
4578 |
|
4579 | /**
|
4580 | * Calls StreamingPull.
|
4581 | * @function streamingPull
|
4582 | * @memberof google.pubsub.v1.Subscriber
|
4583 | * @instance
|
4584 | * @param {google.pubsub.v1.IStreamingPullRequest} request StreamingPullRequest message or plain object
|
4585 | * @param {google.pubsub.v1.Subscriber.StreamingPullCallback} callback Node-style callback called with the error, if any, and StreamingPullResponse
|
4586 | * @returns {undefined}
|
4587 | * @variation 1
|
4588 | */
|
4589 | Object.defineProperty(Subscriber.prototype.streamingPull = function streamingPull(request, callback) {
|
4590 | return this.rpcCall(streamingPull, $root.google.pubsub.v1.StreamingPullRequest, $root.google.pubsub.v1.StreamingPullResponse, request, callback);
|
4591 | }, "name", { value: "StreamingPull" });
|
4592 |
|
4593 | /**
|
4594 | * Calls StreamingPull.
|
4595 | * @function streamingPull
|
4596 | * @memberof google.pubsub.v1.Subscriber
|
4597 | * @instance
|
4598 | * @param {google.pubsub.v1.IStreamingPullRequest} request StreamingPullRequest message or plain object
|
4599 | * @returns {Promise<google.pubsub.v1.StreamingPullResponse>} Promise
|
4600 | * @variation 2
|
4601 | */
|
4602 |
|
4603 | /**
|
4604 | * Callback as used by {@link google.pubsub.v1.Subscriber|modifyPushConfig}.
|
4605 | * @memberof google.pubsub.v1.Subscriber
|
4606 | * @typedef ModifyPushConfigCallback
|
4607 | * @type {function}
|
4608 | * @param {Error|null} error Error, if any
|
4609 | * @param {google.protobuf.Empty} [response] Empty
|
4610 | */
|
4611 |
|
4612 | /**
|
4613 | * Calls ModifyPushConfig.
|
4614 | * @function modifyPushConfig
|
4615 | * @memberof google.pubsub.v1.Subscriber
|
4616 | * @instance
|
4617 | * @param {google.pubsub.v1.IModifyPushConfigRequest} request ModifyPushConfigRequest message or plain object
|
4618 | * @param {google.pubsub.v1.Subscriber.ModifyPushConfigCallback} callback Node-style callback called with the error, if any, and Empty
|
4619 | * @returns {undefined}
|
4620 | * @variation 1
|
4621 | */
|
4622 | Object.defineProperty(Subscriber.prototype.modifyPushConfig = function modifyPushConfig(request, callback) {
|
4623 | return this.rpcCall(modifyPushConfig, $root.google.pubsub.v1.ModifyPushConfigRequest, $root.google.protobuf.Empty, request, callback);
|
4624 | }, "name", { value: "ModifyPushConfig" });
|
4625 |
|
4626 | /**
|
4627 | * Calls ModifyPushConfig.
|
4628 | * @function modifyPushConfig
|
4629 | * @memberof google.pubsub.v1.Subscriber
|
4630 | * @instance
|
4631 | * @param {google.pubsub.v1.IModifyPushConfigRequest} request ModifyPushConfigRequest message or plain object
|
4632 | * @returns {Promise<google.protobuf.Empty>} Promise
|
4633 | * @variation 2
|
4634 | */
|
4635 |
|
4636 | /**
|
4637 | * Callback as used by {@link google.pubsub.v1.Subscriber|getSnapshot}.
|
4638 | * @memberof google.pubsub.v1.Subscriber
|
4639 | * @typedef GetSnapshotCallback
|
4640 | * @type {function}
|
4641 | * @param {Error|null} error Error, if any
|
4642 | * @param {google.pubsub.v1.Snapshot} [response] Snapshot
|
4643 | */
|
4644 |
|
4645 | /**
|
4646 | * Calls GetSnapshot.
|
4647 | * @function getSnapshot
|
4648 | * @memberof google.pubsub.v1.Subscriber
|
4649 | * @instance
|
4650 | * @param {google.pubsub.v1.IGetSnapshotRequest} request GetSnapshotRequest message or plain object
|
4651 | * @param {google.pubsub.v1.Subscriber.GetSnapshotCallback} callback Node-style callback called with the error, if any, and Snapshot
|
4652 | * @returns {undefined}
|
4653 | * @variation 1
|
4654 | */
|
4655 | Object.defineProperty(Subscriber.prototype.getSnapshot = function getSnapshot(request, callback) {
|
4656 | return this.rpcCall(getSnapshot, $root.google.pubsub.v1.GetSnapshotRequest, $root.google.pubsub.v1.Snapshot, request, callback);
|
4657 | }, "name", { value: "GetSnapshot" });
|
4658 |
|
4659 | /**
|
4660 | * Calls GetSnapshot.
|
4661 | * @function getSnapshot
|
4662 | * @memberof google.pubsub.v1.Subscriber
|
4663 | * @instance
|
4664 | * @param {google.pubsub.v1.IGetSnapshotRequest} request GetSnapshotRequest message or plain object
|
4665 | * @returns {Promise<google.pubsub.v1.Snapshot>} Promise
|
4666 | * @variation 2
|
4667 | */
|
4668 |
|
4669 | /**
|
4670 | * Callback as used by {@link google.pubsub.v1.Subscriber|listSnapshots}.
|
4671 | * @memberof google.pubsub.v1.Subscriber
|
4672 | * @typedef ListSnapshotsCallback
|
4673 | * @type {function}
|
4674 | * @param {Error|null} error Error, if any
|
4675 | * @param {google.pubsub.v1.ListSnapshotsResponse} [response] ListSnapshotsResponse
|
4676 | */
|
4677 |
|
4678 | /**
|
4679 | * Calls ListSnapshots.
|
4680 | * @function listSnapshots
|
4681 | * @memberof google.pubsub.v1.Subscriber
|
4682 | * @instance
|
4683 | * @param {google.pubsub.v1.IListSnapshotsRequest} request ListSnapshotsRequest message or plain object
|
4684 | * @param {google.pubsub.v1.Subscriber.ListSnapshotsCallback} callback Node-style callback called with the error, if any, and ListSnapshotsResponse
|
4685 | * @returns {undefined}
|
4686 | * @variation 1
|
4687 | */
|
4688 | Object.defineProperty(Subscriber.prototype.listSnapshots = function listSnapshots(request, callback) {
|
4689 | return this.rpcCall(listSnapshots, $root.google.pubsub.v1.ListSnapshotsRequest, $root.google.pubsub.v1.ListSnapshotsResponse, request, callback);
|
4690 | }, "name", { value: "ListSnapshots" });
|
4691 |
|
4692 | /**
|
4693 | * Calls ListSnapshots.
|
4694 | * @function listSnapshots
|
4695 | * @memberof google.pubsub.v1.Subscriber
|
4696 | * @instance
|
4697 | * @param {google.pubsub.v1.IListSnapshotsRequest} request ListSnapshotsRequest message or plain object
|
4698 | * @returns {Promise<google.pubsub.v1.ListSnapshotsResponse>} Promise
|
4699 | * @variation 2
|
4700 | */
|
4701 |
|
4702 | /**
|
4703 | * Callback as used by {@link google.pubsub.v1.Subscriber|createSnapshot}.
|
4704 | * @memberof google.pubsub.v1.Subscriber
|
4705 | * @typedef CreateSnapshotCallback
|
4706 | * @type {function}
|
4707 | * @param {Error|null} error Error, if any
|
4708 | * @param {google.pubsub.v1.Snapshot} [response] Snapshot
|
4709 | */
|
4710 |
|
4711 | /**
|
4712 | * Calls CreateSnapshot.
|
4713 | * @function createSnapshot
|
4714 | * @memberof google.pubsub.v1.Subscriber
|
4715 | * @instance
|
4716 | * @param {google.pubsub.v1.ICreateSnapshotRequest} request CreateSnapshotRequest message or plain object
|
4717 | * @param {google.pubsub.v1.Subscriber.CreateSnapshotCallback} callback Node-style callback called with the error, if any, and Snapshot
|
4718 | * @returns {undefined}
|
4719 | * @variation 1
|
4720 | */
|
4721 | Object.defineProperty(Subscriber.prototype.createSnapshot = function createSnapshot(request, callback) {
|
4722 | return this.rpcCall(createSnapshot, $root.google.pubsub.v1.CreateSnapshotRequest, $root.google.pubsub.v1.Snapshot, request, callback);
|
4723 | }, "name", { value: "CreateSnapshot" });
|
4724 |
|
4725 | /**
|
4726 | * Calls CreateSnapshot.
|
4727 | * @function createSnapshot
|
4728 | * @memberof google.pubsub.v1.Subscriber
|
4729 | * @instance
|
4730 | * @param {google.pubsub.v1.ICreateSnapshotRequest} request CreateSnapshotRequest message or plain object
|
4731 | * @returns {Promise<google.pubsub.v1.Snapshot>} Promise
|
4732 | * @variation 2
|
4733 | */
|
4734 |
|
4735 | /**
|
4736 | * Callback as used by {@link google.pubsub.v1.Subscriber|updateSnapshot}.
|
4737 | * @memberof google.pubsub.v1.Subscriber
|
4738 | * @typedef UpdateSnapshotCallback
|
4739 | * @type {function}
|
4740 | * @param {Error|null} error Error, if any
|
4741 | * @param {google.pubsub.v1.Snapshot} [response] Snapshot
|
4742 | */
|
4743 |
|
4744 | /**
|
4745 | * Calls UpdateSnapshot.
|
4746 | * @function updateSnapshot
|
4747 | * @memberof google.pubsub.v1.Subscriber
|
4748 | * @instance
|
4749 | * @param {google.pubsub.v1.IUpdateSnapshotRequest} request UpdateSnapshotRequest message or plain object
|
4750 | * @param {google.pubsub.v1.Subscriber.UpdateSnapshotCallback} callback Node-style callback called with the error, if any, and Snapshot
|
4751 | * @returns {undefined}
|
4752 | * @variation 1
|
4753 | */
|
4754 | Object.defineProperty(Subscriber.prototype.updateSnapshot = function updateSnapshot(request, callback) {
|
4755 | return this.rpcCall(updateSnapshot, $root.google.pubsub.v1.UpdateSnapshotRequest, $root.google.pubsub.v1.Snapshot, request, callback);
|
4756 | }, "name", { value: "UpdateSnapshot" });
|
4757 |
|
4758 | /**
|
4759 | * Calls UpdateSnapshot.
|
4760 | * @function updateSnapshot
|
4761 | * @memberof google.pubsub.v1.Subscriber
|
4762 | * @instance
|
4763 | * @param {google.pubsub.v1.IUpdateSnapshotRequest} request UpdateSnapshotRequest message or plain object
|
4764 | * @returns {Promise<google.pubsub.v1.Snapshot>} Promise
|
4765 | * @variation 2
|
4766 | */
|
4767 |
|
4768 | /**
|
4769 | * Callback as used by {@link google.pubsub.v1.Subscriber|deleteSnapshot}.
|
4770 | * @memberof google.pubsub.v1.Subscriber
|
4771 | * @typedef DeleteSnapshotCallback
|
4772 | * @type {function}
|
4773 | * @param {Error|null} error Error, if any
|
4774 | * @param {google.protobuf.Empty} [response] Empty
|
4775 | */
|
4776 |
|
4777 | /**
|
4778 | * Calls DeleteSnapshot.
|
4779 | * @function deleteSnapshot
|
4780 | * @memberof google.pubsub.v1.Subscriber
|
4781 | * @instance
|
4782 | * @param {google.pubsub.v1.IDeleteSnapshotRequest} request DeleteSnapshotRequest message or plain object
|
4783 | * @param {google.pubsub.v1.Subscriber.DeleteSnapshotCallback} callback Node-style callback called with the error, if any, and Empty
|
4784 | * @returns {undefined}
|
4785 | * @variation 1
|
4786 | */
|
4787 | Object.defineProperty(Subscriber.prototype.deleteSnapshot = function deleteSnapshot(request, callback) {
|
4788 | return this.rpcCall(deleteSnapshot, $root.google.pubsub.v1.DeleteSnapshotRequest, $root.google.protobuf.Empty, request, callback);
|
4789 | }, "name", { value: "DeleteSnapshot" });
|
4790 |
|
4791 | /**
|
4792 | * Calls DeleteSnapshot.
|
4793 | * @function deleteSnapshot
|
4794 | * @memberof google.pubsub.v1.Subscriber
|
4795 | * @instance
|
4796 | * @param {google.pubsub.v1.IDeleteSnapshotRequest} request DeleteSnapshotRequest message or plain object
|
4797 | * @returns {Promise<google.protobuf.Empty>} Promise
|
4798 | * @variation 2
|
4799 | */
|
4800 |
|
4801 | /**
|
4802 | * Callback as used by {@link google.pubsub.v1.Subscriber|seek}.
|
4803 | * @memberof google.pubsub.v1.Subscriber
|
4804 | * @typedef SeekCallback
|
4805 | * @type {function}
|
4806 | * @param {Error|null} error Error, if any
|
4807 | * @param {google.pubsub.v1.SeekResponse} [response] SeekResponse
|
4808 | */
|
4809 |
|
4810 | /**
|
4811 | * Calls Seek.
|
4812 | * @function seek
|
4813 | * @memberof google.pubsub.v1.Subscriber
|
4814 | * @instance
|
4815 | * @param {google.pubsub.v1.ISeekRequest} request SeekRequest message or plain object
|
4816 | * @param {google.pubsub.v1.Subscriber.SeekCallback} callback Node-style callback called with the error, if any, and SeekResponse
|
4817 | * @returns {undefined}
|
4818 | * @variation 1
|
4819 | */
|
4820 | Object.defineProperty(Subscriber.prototype.seek = function seek(request, callback) {
|
4821 | return this.rpcCall(seek, $root.google.pubsub.v1.SeekRequest, $root.google.pubsub.v1.SeekResponse, request, callback);
|
4822 | }, "name", { value: "Seek" });
|
4823 |
|
4824 | /**
|
4825 | * Calls Seek.
|
4826 | * @function seek
|
4827 | * @memberof google.pubsub.v1.Subscriber
|
4828 | * @instance
|
4829 | * @param {google.pubsub.v1.ISeekRequest} request SeekRequest message or plain object
|
4830 | * @returns {Promise<google.pubsub.v1.SeekResponse>} Promise
|
4831 | * @variation 2
|
4832 | */
|
4833 |
|
4834 | return Subscriber;
|
4835 | })();
|
4836 |
|
4837 | v1.Subscription = (function() {
|
4838 |
|
4839 | /**
|
4840 | * Properties of a Subscription.
|
4841 | * @memberof google.pubsub.v1
|
4842 | * @interface ISubscription
|
4843 | * @property {string|null} [name] Subscription name
|
4844 | * @property {string|null} [topic] Subscription topic
|
4845 | * @property {google.pubsub.v1.IPushConfig|null} [pushConfig] Subscription pushConfig
|
4846 | * @property {google.pubsub.v1.IBigQueryConfig|null} [bigqueryConfig] Subscription bigqueryConfig
|
4847 | * @property {number|null} [ackDeadlineSeconds] Subscription ackDeadlineSeconds
|
4848 | * @property {boolean|null} [retainAckedMessages] Subscription retainAckedMessages
|
4849 | * @property {google.protobuf.IDuration|null} [messageRetentionDuration] Subscription messageRetentionDuration
|
4850 | * @property {Object.<string,string>|null} [labels] Subscription labels
|
4851 | * @property {boolean|null} [enableMessageOrdering] Subscription enableMessageOrdering
|
4852 | * @property {google.pubsub.v1.IExpirationPolicy|null} [expirationPolicy] Subscription expirationPolicy
|
4853 | * @property {string|null} [filter] Subscription filter
|
4854 | * @property {google.pubsub.v1.IDeadLetterPolicy|null} [deadLetterPolicy] Subscription deadLetterPolicy
|
4855 | * @property {google.pubsub.v1.IRetryPolicy|null} [retryPolicy] Subscription retryPolicy
|
4856 | * @property {boolean|null} [detached] Subscription detached
|
4857 | * @property {boolean|null} [enableExactlyOnceDelivery] Subscription enableExactlyOnceDelivery
|
4858 | * @property {google.protobuf.IDuration|null} [topicMessageRetentionDuration] Subscription topicMessageRetentionDuration
|
4859 | * @property {google.pubsub.v1.Subscription.State|null} [state] Subscription state
|
4860 | */
|
4861 |
|
4862 | /**
|
4863 | * Constructs a new Subscription.
|
4864 | * @memberof google.pubsub.v1
|
4865 | * @classdesc Represents a Subscription.
|
4866 | * @implements ISubscription
|
4867 | * @constructor
|
4868 | * @param {google.pubsub.v1.ISubscription=} [properties] Properties to set
|
4869 | */
|
4870 | function Subscription(properties) {
|
4871 | this.labels = {};
|
4872 | if (properties)
|
4873 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
4874 | if (properties[keys[i]] != null)
|
4875 | this[keys[i]] = properties[keys[i]];
|
4876 | }
|
4877 |
|
4878 | /**
|
4879 | * Subscription name.
|
4880 | * @member {string} name
|
4881 | * @memberof google.pubsub.v1.Subscription
|
4882 | * @instance
|
4883 | */
|
4884 | Subscription.prototype.name = "";
|
4885 |
|
4886 | /**
|
4887 | * Subscription topic.
|
4888 | * @member {string} topic
|
4889 | * @memberof google.pubsub.v1.Subscription
|
4890 | * @instance
|
4891 | */
|
4892 | Subscription.prototype.topic = "";
|
4893 |
|
4894 | /**
|
4895 | * Subscription pushConfig.
|
4896 | * @member {google.pubsub.v1.IPushConfig|null|undefined} pushConfig
|
4897 | * @memberof google.pubsub.v1.Subscription
|
4898 | * @instance
|
4899 | */
|
4900 | Subscription.prototype.pushConfig = null;
|
4901 |
|
4902 | /**
|
4903 | * Subscription bigqueryConfig.
|
4904 | * @member {google.pubsub.v1.IBigQueryConfig|null|undefined} bigqueryConfig
|
4905 | * @memberof google.pubsub.v1.Subscription
|
4906 | * @instance
|
4907 | */
|
4908 | Subscription.prototype.bigqueryConfig = null;
|
4909 |
|
4910 | /**
|
4911 | * Subscription ackDeadlineSeconds.
|
4912 | * @member {number} ackDeadlineSeconds
|
4913 | * @memberof google.pubsub.v1.Subscription
|
4914 | * @instance
|
4915 | */
|
4916 | Subscription.prototype.ackDeadlineSeconds = 0;
|
4917 |
|
4918 | /**
|
4919 | * Subscription retainAckedMessages.
|
4920 | * @member {boolean} retainAckedMessages
|
4921 | * @memberof google.pubsub.v1.Subscription
|
4922 | * @instance
|
4923 | */
|
4924 | Subscription.prototype.retainAckedMessages = false;
|
4925 |
|
4926 | /**
|
4927 | * Subscription messageRetentionDuration.
|
4928 | * @member {google.protobuf.IDuration|null|undefined} messageRetentionDuration
|
4929 | * @memberof google.pubsub.v1.Subscription
|
4930 | * @instance
|
4931 | */
|
4932 | Subscription.prototype.messageRetentionDuration = null;
|
4933 |
|
4934 | /**
|
4935 | * Subscription labels.
|
4936 | * @member {Object.<string,string>} labels
|
4937 | * @memberof google.pubsub.v1.Subscription
|
4938 | * @instance
|
4939 | */
|
4940 | Subscription.prototype.labels = $util.emptyObject;
|
4941 |
|
4942 | /**
|
4943 | * Subscription enableMessageOrdering.
|
4944 | * @member {boolean} enableMessageOrdering
|
4945 | * @memberof google.pubsub.v1.Subscription
|
4946 | * @instance
|
4947 | */
|
4948 | Subscription.prototype.enableMessageOrdering = false;
|
4949 |
|
4950 | /**
|
4951 | * Subscription expirationPolicy.
|
4952 | * @member {google.pubsub.v1.IExpirationPolicy|null|undefined} expirationPolicy
|
4953 | * @memberof google.pubsub.v1.Subscription
|
4954 | * @instance
|
4955 | */
|
4956 | Subscription.prototype.expirationPolicy = null;
|
4957 |
|
4958 | /**
|
4959 | * Subscription filter.
|
4960 | * @member {string} filter
|
4961 | * @memberof google.pubsub.v1.Subscription
|
4962 | * @instance
|
4963 | */
|
4964 | Subscription.prototype.filter = "";
|
4965 |
|
4966 | /**
|
4967 | * Subscription deadLetterPolicy.
|
4968 | * @member {google.pubsub.v1.IDeadLetterPolicy|null|undefined} deadLetterPolicy
|
4969 | * @memberof google.pubsub.v1.Subscription
|
4970 | * @instance
|
4971 | */
|
4972 | Subscription.prototype.deadLetterPolicy = null;
|
4973 |
|
4974 | /**
|
4975 | * Subscription retryPolicy.
|
4976 | * @member {google.pubsub.v1.IRetryPolicy|null|undefined} retryPolicy
|
4977 | * @memberof google.pubsub.v1.Subscription
|
4978 | * @instance
|
4979 | */
|
4980 | Subscription.prototype.retryPolicy = null;
|
4981 |
|
4982 | /**
|
4983 | * Subscription detached.
|
4984 | * @member {boolean} detached
|
4985 | * @memberof google.pubsub.v1.Subscription
|
4986 | * @instance
|
4987 | */
|
4988 | Subscription.prototype.detached = false;
|
4989 |
|
4990 | /**
|
4991 | * Subscription enableExactlyOnceDelivery.
|
4992 | * @member {boolean} enableExactlyOnceDelivery
|
4993 | * @memberof google.pubsub.v1.Subscription
|
4994 | * @instance
|
4995 | */
|
4996 | Subscription.prototype.enableExactlyOnceDelivery = false;
|
4997 |
|
4998 | /**
|
4999 | * Subscription topicMessageRetentionDuration.
|
5000 | * @member {google.protobuf.IDuration|null|undefined} topicMessageRetentionDuration
|
5001 | * @memberof google.pubsub.v1.Subscription
|
5002 | * @instance
|
5003 | */
|
5004 | Subscription.prototype.topicMessageRetentionDuration = null;
|
5005 |
|
5006 | /**
|
5007 | * Subscription state.
|
5008 | * @member {google.pubsub.v1.Subscription.State} state
|
5009 | * @memberof google.pubsub.v1.Subscription
|
5010 | * @instance
|
5011 | */
|
5012 | Subscription.prototype.state = 0;
|
5013 |
|
5014 | /**
|
5015 | * Creates a new Subscription instance using the specified properties.
|
5016 | * @function create
|
5017 | * @memberof google.pubsub.v1.Subscription
|
5018 | * @static
|
5019 | * @param {google.pubsub.v1.ISubscription=} [properties] Properties to set
|
5020 | * @returns {google.pubsub.v1.Subscription} Subscription instance
|
5021 | */
|
5022 | Subscription.create = function create(properties) {
|
5023 | return new Subscription(properties);
|
5024 | };
|
5025 |
|
5026 | /**
|
5027 | * Encodes the specified Subscription message. Does not implicitly {@link google.pubsub.v1.Subscription.verify|verify} messages.
|
5028 | * @function encode
|
5029 | * @memberof google.pubsub.v1.Subscription
|
5030 | * @static
|
5031 | * @param {google.pubsub.v1.ISubscription} message Subscription message or plain object to encode
|
5032 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
5033 | * @returns {$protobuf.Writer} Writer
|
5034 | */
|
5035 | Subscription.encode = function encode(message, writer) {
|
5036 | if (!writer)
|
5037 | writer = $Writer.create();
|
5038 | if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
5039 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
|
5040 | if (message.topic != null && Object.hasOwnProperty.call(message, "topic"))
|
5041 | writer.uint32(/* id 2, wireType 2 =*/18).string(message.topic);
|
5042 | if (message.pushConfig != null && Object.hasOwnProperty.call(message, "pushConfig"))
|
5043 | $root.google.pubsub.v1.PushConfig.encode(message.pushConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
|
5044 | if (message.ackDeadlineSeconds != null && Object.hasOwnProperty.call(message, "ackDeadlineSeconds"))
|
5045 | writer.uint32(/* id 5, wireType 0 =*/40).int32(message.ackDeadlineSeconds);
|
5046 | if (message.retainAckedMessages != null && Object.hasOwnProperty.call(message, "retainAckedMessages"))
|
5047 | writer.uint32(/* id 7, wireType 0 =*/56).bool(message.retainAckedMessages);
|
5048 | if (message.messageRetentionDuration != null && Object.hasOwnProperty.call(message, "messageRetentionDuration"))
|
5049 | $root.google.protobuf.Duration.encode(message.messageRetentionDuration, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();
|
5050 | if (message.labels != null && Object.hasOwnProperty.call(message, "labels"))
|
5051 | for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i)
|
5052 | writer.uint32(/* id 9, wireType 2 =*/74).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim();
|
5053 | if (message.enableMessageOrdering != null && Object.hasOwnProperty.call(message, "enableMessageOrdering"))
|
5054 | writer.uint32(/* id 10, wireType 0 =*/80).bool(message.enableMessageOrdering);
|
5055 | if (message.expirationPolicy != null && Object.hasOwnProperty.call(message, "expirationPolicy"))
|
5056 | $root.google.pubsub.v1.ExpirationPolicy.encode(message.expirationPolicy, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim();
|
5057 | if (message.filter != null && Object.hasOwnProperty.call(message, "filter"))
|
5058 | writer.uint32(/* id 12, wireType 2 =*/98).string(message.filter);
|
5059 | if (message.deadLetterPolicy != null && Object.hasOwnProperty.call(message, "deadLetterPolicy"))
|
5060 | $root.google.pubsub.v1.DeadLetterPolicy.encode(message.deadLetterPolicy, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim();
|
5061 | if (message.retryPolicy != null && Object.hasOwnProperty.call(message, "retryPolicy"))
|
5062 | $root.google.pubsub.v1.RetryPolicy.encode(message.retryPolicy, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim();
|
5063 | if (message.detached != null && Object.hasOwnProperty.call(message, "detached"))
|
5064 | writer.uint32(/* id 15, wireType 0 =*/120).bool(message.detached);
|
5065 | if (message.enableExactlyOnceDelivery != null && Object.hasOwnProperty.call(message, "enableExactlyOnceDelivery"))
|
5066 | writer.uint32(/* id 16, wireType 0 =*/128).bool(message.enableExactlyOnceDelivery);
|
5067 | if (message.topicMessageRetentionDuration != null && Object.hasOwnProperty.call(message, "topicMessageRetentionDuration"))
|
5068 | $root.google.protobuf.Duration.encode(message.topicMessageRetentionDuration, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim();
|
5069 | if (message.bigqueryConfig != null && Object.hasOwnProperty.call(message, "bigqueryConfig"))
|
5070 | $root.google.pubsub.v1.BigQueryConfig.encode(message.bigqueryConfig, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim();
|
5071 | if (message.state != null && Object.hasOwnProperty.call(message, "state"))
|
5072 | writer.uint32(/* id 19, wireType 0 =*/152).int32(message.state);
|
5073 | return writer;
|
5074 | };
|
5075 |
|
5076 | /**
|
5077 | * Encodes the specified Subscription message, length delimited. Does not implicitly {@link google.pubsub.v1.Subscription.verify|verify} messages.
|
5078 | * @function encodeDelimited
|
5079 | * @memberof google.pubsub.v1.Subscription
|
5080 | * @static
|
5081 | * @param {google.pubsub.v1.ISubscription} message Subscription message or plain object to encode
|
5082 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
5083 | * @returns {$protobuf.Writer} Writer
|
5084 | */
|
5085 | Subscription.encodeDelimited = function encodeDelimited(message, writer) {
|
5086 | return this.encode(message, writer).ldelim();
|
5087 | };
|
5088 |
|
5089 | /**
|
5090 | * Decodes a Subscription message from the specified reader or buffer.
|
5091 | * @function decode
|
5092 | * @memberof google.pubsub.v1.Subscription
|
5093 | * @static
|
5094 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
5095 | * @param {number} [length] Message length if known beforehand
|
5096 | * @returns {google.pubsub.v1.Subscription} Subscription
|
5097 | * @throws {Error} If the payload is not a reader or valid buffer
|
5098 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
5099 | */
|
5100 | Subscription.decode = function decode(reader, length) {
|
5101 | if (!(reader instanceof $Reader))
|
5102 | reader = $Reader.create(reader);
|
5103 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.Subscription(), key, value;
|
5104 | while (reader.pos < end) {
|
5105 | var tag = reader.uint32();
|
5106 | switch (tag >>> 3) {
|
5107 | case 1:
|
5108 | message.name = reader.string();
|
5109 | break;
|
5110 | case 2:
|
5111 | message.topic = reader.string();
|
5112 | break;
|
5113 | case 4:
|
5114 | message.pushConfig = $root.google.pubsub.v1.PushConfig.decode(reader, reader.uint32());
|
5115 | break;
|
5116 | case 18:
|
5117 | message.bigqueryConfig = $root.google.pubsub.v1.BigQueryConfig.decode(reader, reader.uint32());
|
5118 | break;
|
5119 | case 5:
|
5120 | message.ackDeadlineSeconds = reader.int32();
|
5121 | break;
|
5122 | case 7:
|
5123 | message.retainAckedMessages = reader.bool();
|
5124 | break;
|
5125 | case 8:
|
5126 | message.messageRetentionDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32());
|
5127 | break;
|
5128 | case 9:
|
5129 | if (message.labels === $util.emptyObject)
|
5130 | message.labels = {};
|
5131 | var end2 = reader.uint32() + reader.pos;
|
5132 | key = "";
|
5133 | value = "";
|
5134 | while (reader.pos < end2) {
|
5135 | var tag2 = reader.uint32();
|
5136 | switch (tag2 >>> 3) {
|
5137 | case 1:
|
5138 | key = reader.string();
|
5139 | break;
|
5140 | case 2:
|
5141 | value = reader.string();
|
5142 | break;
|
5143 | default:
|
5144 | reader.skipType(tag2 & 7);
|
5145 | break;
|
5146 | }
|
5147 | }
|
5148 | message.labels[key] = value;
|
5149 | break;
|
5150 | case 10:
|
5151 | message.enableMessageOrdering = reader.bool();
|
5152 | break;
|
5153 | case 11:
|
5154 | message.expirationPolicy = $root.google.pubsub.v1.ExpirationPolicy.decode(reader, reader.uint32());
|
5155 | break;
|
5156 | case 12:
|
5157 | message.filter = reader.string();
|
5158 | break;
|
5159 | case 13:
|
5160 | message.deadLetterPolicy = $root.google.pubsub.v1.DeadLetterPolicy.decode(reader, reader.uint32());
|
5161 | break;
|
5162 | case 14:
|
5163 | message.retryPolicy = $root.google.pubsub.v1.RetryPolicy.decode(reader, reader.uint32());
|
5164 | break;
|
5165 | case 15:
|
5166 | message.detached = reader.bool();
|
5167 | break;
|
5168 | case 16:
|
5169 | message.enableExactlyOnceDelivery = reader.bool();
|
5170 | break;
|
5171 | case 17:
|
5172 | message.topicMessageRetentionDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32());
|
5173 | break;
|
5174 | case 19:
|
5175 | message.state = reader.int32();
|
5176 | break;
|
5177 | default:
|
5178 | reader.skipType(tag & 7);
|
5179 | break;
|
5180 | }
|
5181 | }
|
5182 | return message;
|
5183 | };
|
5184 |
|
5185 | /**
|
5186 | * Decodes a Subscription message from the specified reader or buffer, length delimited.
|
5187 | * @function decodeDelimited
|
5188 | * @memberof google.pubsub.v1.Subscription
|
5189 | * @static
|
5190 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
5191 | * @returns {google.pubsub.v1.Subscription} Subscription
|
5192 | * @throws {Error} If the payload is not a reader or valid buffer
|
5193 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
5194 | */
|
5195 | Subscription.decodeDelimited = function decodeDelimited(reader) {
|
5196 | if (!(reader instanceof $Reader))
|
5197 | reader = new $Reader(reader);
|
5198 | return this.decode(reader, reader.uint32());
|
5199 | };
|
5200 |
|
5201 | /**
|
5202 | * Verifies a Subscription message.
|
5203 | * @function verify
|
5204 | * @memberof google.pubsub.v1.Subscription
|
5205 | * @static
|
5206 | * @param {Object.<string,*>} message Plain object to verify
|
5207 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
5208 | */
|
5209 | Subscription.verify = function verify(message) {
|
5210 | if (typeof message !== "object" || message === null)
|
5211 | return "object expected";
|
5212 | if (message.name != null && message.hasOwnProperty("name"))
|
5213 | if (!$util.isString(message.name))
|
5214 | return "name: string expected";
|
5215 | if (message.topic != null && message.hasOwnProperty("topic"))
|
5216 | if (!$util.isString(message.topic))
|
5217 | return "topic: string expected";
|
5218 | if (message.pushConfig != null && message.hasOwnProperty("pushConfig")) {
|
5219 | var error = $root.google.pubsub.v1.PushConfig.verify(message.pushConfig);
|
5220 | if (error)
|
5221 | return "pushConfig." + error;
|
5222 | }
|
5223 | if (message.bigqueryConfig != null && message.hasOwnProperty("bigqueryConfig")) {
|
5224 | var error = $root.google.pubsub.v1.BigQueryConfig.verify(message.bigqueryConfig);
|
5225 | if (error)
|
5226 | return "bigqueryConfig." + error;
|
5227 | }
|
5228 | if (message.ackDeadlineSeconds != null && message.hasOwnProperty("ackDeadlineSeconds"))
|
5229 | if (!$util.isInteger(message.ackDeadlineSeconds))
|
5230 | return "ackDeadlineSeconds: integer expected";
|
5231 | if (message.retainAckedMessages != null && message.hasOwnProperty("retainAckedMessages"))
|
5232 | if (typeof message.retainAckedMessages !== "boolean")
|
5233 | return "retainAckedMessages: boolean expected";
|
5234 | if (message.messageRetentionDuration != null && message.hasOwnProperty("messageRetentionDuration")) {
|
5235 | var error = $root.google.protobuf.Duration.verify(message.messageRetentionDuration);
|
5236 | if (error)
|
5237 | return "messageRetentionDuration." + error;
|
5238 | }
|
5239 | if (message.labels != null && message.hasOwnProperty("labels")) {
|
5240 | if (!$util.isObject(message.labels))
|
5241 | return "labels: object expected";
|
5242 | var key = Object.keys(message.labels);
|
5243 | for (var i = 0; i < key.length; ++i)
|
5244 | if (!$util.isString(message.labels[key[i]]))
|
5245 | return "labels: string{k:string} expected";
|
5246 | }
|
5247 | if (message.enableMessageOrdering != null && message.hasOwnProperty("enableMessageOrdering"))
|
5248 | if (typeof message.enableMessageOrdering !== "boolean")
|
5249 | return "enableMessageOrdering: boolean expected";
|
5250 | if (message.expirationPolicy != null && message.hasOwnProperty("expirationPolicy")) {
|
5251 | var error = $root.google.pubsub.v1.ExpirationPolicy.verify(message.expirationPolicy);
|
5252 | if (error)
|
5253 | return "expirationPolicy." + error;
|
5254 | }
|
5255 | if (message.filter != null && message.hasOwnProperty("filter"))
|
5256 | if (!$util.isString(message.filter))
|
5257 | return "filter: string expected";
|
5258 | if (message.deadLetterPolicy != null && message.hasOwnProperty("deadLetterPolicy")) {
|
5259 | var error = $root.google.pubsub.v1.DeadLetterPolicy.verify(message.deadLetterPolicy);
|
5260 | if (error)
|
5261 | return "deadLetterPolicy." + error;
|
5262 | }
|
5263 | if (message.retryPolicy != null && message.hasOwnProperty("retryPolicy")) {
|
5264 | var error = $root.google.pubsub.v1.RetryPolicy.verify(message.retryPolicy);
|
5265 | if (error)
|
5266 | return "retryPolicy." + error;
|
5267 | }
|
5268 | if (message.detached != null && message.hasOwnProperty("detached"))
|
5269 | if (typeof message.detached !== "boolean")
|
5270 | return "detached: boolean expected";
|
5271 | if (message.enableExactlyOnceDelivery != null && message.hasOwnProperty("enableExactlyOnceDelivery"))
|
5272 | if (typeof message.enableExactlyOnceDelivery !== "boolean")
|
5273 | return "enableExactlyOnceDelivery: boolean expected";
|
5274 | if (message.topicMessageRetentionDuration != null && message.hasOwnProperty("topicMessageRetentionDuration")) {
|
5275 | var error = $root.google.protobuf.Duration.verify(message.topicMessageRetentionDuration);
|
5276 | if (error)
|
5277 | return "topicMessageRetentionDuration." + error;
|
5278 | }
|
5279 | if (message.state != null && message.hasOwnProperty("state"))
|
5280 | switch (message.state) {
|
5281 | default:
|
5282 | return "state: enum value expected";
|
5283 | case 0:
|
5284 | case 1:
|
5285 | case 2:
|
5286 | break;
|
5287 | }
|
5288 | return null;
|
5289 | };
|
5290 |
|
5291 | /**
|
5292 | * Creates a Subscription message from a plain object. Also converts values to their respective internal types.
|
5293 | * @function fromObject
|
5294 | * @memberof google.pubsub.v1.Subscription
|
5295 | * @static
|
5296 | * @param {Object.<string,*>} object Plain object
|
5297 | * @returns {google.pubsub.v1.Subscription} Subscription
|
5298 | */
|
5299 | Subscription.fromObject = function fromObject(object) {
|
5300 | if (object instanceof $root.google.pubsub.v1.Subscription)
|
5301 | return object;
|
5302 | var message = new $root.google.pubsub.v1.Subscription();
|
5303 | if (object.name != null)
|
5304 | message.name = String(object.name);
|
5305 | if (object.topic != null)
|
5306 | message.topic = String(object.topic);
|
5307 | if (object.pushConfig != null) {
|
5308 | if (typeof object.pushConfig !== "object")
|
5309 | throw TypeError(".google.pubsub.v1.Subscription.pushConfig: object expected");
|
5310 | message.pushConfig = $root.google.pubsub.v1.PushConfig.fromObject(object.pushConfig);
|
5311 | }
|
5312 | if (object.bigqueryConfig != null) {
|
5313 | if (typeof object.bigqueryConfig !== "object")
|
5314 | throw TypeError(".google.pubsub.v1.Subscription.bigqueryConfig: object expected");
|
5315 | message.bigqueryConfig = $root.google.pubsub.v1.BigQueryConfig.fromObject(object.bigqueryConfig);
|
5316 | }
|
5317 | if (object.ackDeadlineSeconds != null)
|
5318 | message.ackDeadlineSeconds = object.ackDeadlineSeconds | 0;
|
5319 | if (object.retainAckedMessages != null)
|
5320 | message.retainAckedMessages = Boolean(object.retainAckedMessages);
|
5321 | if (object.messageRetentionDuration != null) {
|
5322 | if (typeof object.messageRetentionDuration !== "object")
|
5323 | throw TypeError(".google.pubsub.v1.Subscription.messageRetentionDuration: object expected");
|
5324 | message.messageRetentionDuration = $root.google.protobuf.Duration.fromObject(object.messageRetentionDuration);
|
5325 | }
|
5326 | if (object.labels) {
|
5327 | if (typeof object.labels !== "object")
|
5328 | throw TypeError(".google.pubsub.v1.Subscription.labels: object expected");
|
5329 | message.labels = {};
|
5330 | for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i)
|
5331 | message.labels[keys[i]] = String(object.labels[keys[i]]);
|
5332 | }
|
5333 | if (object.enableMessageOrdering != null)
|
5334 | message.enableMessageOrdering = Boolean(object.enableMessageOrdering);
|
5335 | if (object.expirationPolicy != null) {
|
5336 | if (typeof object.expirationPolicy !== "object")
|
5337 | throw TypeError(".google.pubsub.v1.Subscription.expirationPolicy: object expected");
|
5338 | message.expirationPolicy = $root.google.pubsub.v1.ExpirationPolicy.fromObject(object.expirationPolicy);
|
5339 | }
|
5340 | if (object.filter != null)
|
5341 | message.filter = String(object.filter);
|
5342 | if (object.deadLetterPolicy != null) {
|
5343 | if (typeof object.deadLetterPolicy !== "object")
|
5344 | throw TypeError(".google.pubsub.v1.Subscription.deadLetterPolicy: object expected");
|
5345 | message.deadLetterPolicy = $root.google.pubsub.v1.DeadLetterPolicy.fromObject(object.deadLetterPolicy);
|
5346 | }
|
5347 | if (object.retryPolicy != null) {
|
5348 | if (typeof object.retryPolicy !== "object")
|
5349 | throw TypeError(".google.pubsub.v1.Subscription.retryPolicy: object expected");
|
5350 | message.retryPolicy = $root.google.pubsub.v1.RetryPolicy.fromObject(object.retryPolicy);
|
5351 | }
|
5352 | if (object.detached != null)
|
5353 | message.detached = Boolean(object.detached);
|
5354 | if (object.enableExactlyOnceDelivery != null)
|
5355 | message.enableExactlyOnceDelivery = Boolean(object.enableExactlyOnceDelivery);
|
5356 | if (object.topicMessageRetentionDuration != null) {
|
5357 | if (typeof object.topicMessageRetentionDuration !== "object")
|
5358 | throw TypeError(".google.pubsub.v1.Subscription.topicMessageRetentionDuration: object expected");
|
5359 | message.topicMessageRetentionDuration = $root.google.protobuf.Duration.fromObject(object.topicMessageRetentionDuration);
|
5360 | }
|
5361 | switch (object.state) {
|
5362 | case "STATE_UNSPECIFIED":
|
5363 | case 0:
|
5364 | message.state = 0;
|
5365 | break;
|
5366 | case "ACTIVE":
|
5367 | case 1:
|
5368 | message.state = 1;
|
5369 | break;
|
5370 | case "RESOURCE_ERROR":
|
5371 | case 2:
|
5372 | message.state = 2;
|
5373 | break;
|
5374 | }
|
5375 | return message;
|
5376 | };
|
5377 |
|
5378 | /**
|
5379 | * Creates a plain object from a Subscription message. Also converts values to other types if specified.
|
5380 | * @function toObject
|
5381 | * @memberof google.pubsub.v1.Subscription
|
5382 | * @static
|
5383 | * @param {google.pubsub.v1.Subscription} message Subscription
|
5384 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
5385 | * @returns {Object.<string,*>} Plain object
|
5386 | */
|
5387 | Subscription.toObject = function toObject(message, options) {
|
5388 | if (!options)
|
5389 | options = {};
|
5390 | var object = {};
|
5391 | if (options.objects || options.defaults)
|
5392 | object.labels = {};
|
5393 | if (options.defaults) {
|
5394 | object.name = "";
|
5395 | object.topic = "";
|
5396 | object.pushConfig = null;
|
5397 | object.ackDeadlineSeconds = 0;
|
5398 | object.retainAckedMessages = false;
|
5399 | object.messageRetentionDuration = null;
|
5400 | object.enableMessageOrdering = false;
|
5401 | object.expirationPolicy = null;
|
5402 | object.filter = "";
|
5403 | object.deadLetterPolicy = null;
|
5404 | object.retryPolicy = null;
|
5405 | object.detached = false;
|
5406 | object.enableExactlyOnceDelivery = false;
|
5407 | object.topicMessageRetentionDuration = null;
|
5408 | object.bigqueryConfig = null;
|
5409 | object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0;
|
5410 | }
|
5411 | if (message.name != null && message.hasOwnProperty("name"))
|
5412 | object.name = message.name;
|
5413 | if (message.topic != null && message.hasOwnProperty("topic"))
|
5414 | object.topic = message.topic;
|
5415 | if (message.pushConfig != null && message.hasOwnProperty("pushConfig"))
|
5416 | object.pushConfig = $root.google.pubsub.v1.PushConfig.toObject(message.pushConfig, options);
|
5417 | if (message.ackDeadlineSeconds != null && message.hasOwnProperty("ackDeadlineSeconds"))
|
5418 | object.ackDeadlineSeconds = message.ackDeadlineSeconds;
|
5419 | if (message.retainAckedMessages != null && message.hasOwnProperty("retainAckedMessages"))
|
5420 | object.retainAckedMessages = message.retainAckedMessages;
|
5421 | if (message.messageRetentionDuration != null && message.hasOwnProperty("messageRetentionDuration"))
|
5422 | object.messageRetentionDuration = $root.google.protobuf.Duration.toObject(message.messageRetentionDuration, options);
|
5423 | var keys2;
|
5424 | if (message.labels && (keys2 = Object.keys(message.labels)).length) {
|
5425 | object.labels = {};
|
5426 | for (var j = 0; j < keys2.length; ++j)
|
5427 | object.labels[keys2[j]] = message.labels[keys2[j]];
|
5428 | }
|
5429 | if (message.enableMessageOrdering != null && message.hasOwnProperty("enableMessageOrdering"))
|
5430 | object.enableMessageOrdering = message.enableMessageOrdering;
|
5431 | if (message.expirationPolicy != null && message.hasOwnProperty("expirationPolicy"))
|
5432 | object.expirationPolicy = $root.google.pubsub.v1.ExpirationPolicy.toObject(message.expirationPolicy, options);
|
5433 | if (message.filter != null && message.hasOwnProperty("filter"))
|
5434 | object.filter = message.filter;
|
5435 | if (message.deadLetterPolicy != null && message.hasOwnProperty("deadLetterPolicy"))
|
5436 | object.deadLetterPolicy = $root.google.pubsub.v1.DeadLetterPolicy.toObject(message.deadLetterPolicy, options);
|
5437 | if (message.retryPolicy != null && message.hasOwnProperty("retryPolicy"))
|
5438 | object.retryPolicy = $root.google.pubsub.v1.RetryPolicy.toObject(message.retryPolicy, options);
|
5439 | if (message.detached != null && message.hasOwnProperty("detached"))
|
5440 | object.detached = message.detached;
|
5441 | if (message.enableExactlyOnceDelivery != null && message.hasOwnProperty("enableExactlyOnceDelivery"))
|
5442 | object.enableExactlyOnceDelivery = message.enableExactlyOnceDelivery;
|
5443 | if (message.topicMessageRetentionDuration != null && message.hasOwnProperty("topicMessageRetentionDuration"))
|
5444 | object.topicMessageRetentionDuration = $root.google.protobuf.Duration.toObject(message.topicMessageRetentionDuration, options);
|
5445 | if (message.bigqueryConfig != null && message.hasOwnProperty("bigqueryConfig"))
|
5446 | object.bigqueryConfig = $root.google.pubsub.v1.BigQueryConfig.toObject(message.bigqueryConfig, options);
|
5447 | if (message.state != null && message.hasOwnProperty("state"))
|
5448 | object.state = options.enums === String ? $root.google.pubsub.v1.Subscription.State[message.state] : message.state;
|
5449 | return object;
|
5450 | };
|
5451 |
|
5452 | /**
|
5453 | * Converts this Subscription to JSON.
|
5454 | * @function toJSON
|
5455 | * @memberof google.pubsub.v1.Subscription
|
5456 | * @instance
|
5457 | * @returns {Object.<string,*>} JSON object
|
5458 | */
|
5459 | Subscription.prototype.toJSON = function toJSON() {
|
5460 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
5461 | };
|
5462 |
|
5463 | /**
|
5464 | * State enum.
|
5465 | * @name google.pubsub.v1.Subscription.State
|
5466 | * @enum {number}
|
5467 | * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value
|
5468 | * @property {number} ACTIVE=1 ACTIVE value
|
5469 | * @property {number} RESOURCE_ERROR=2 RESOURCE_ERROR value
|
5470 | */
|
5471 | Subscription.State = (function() {
|
5472 | var valuesById = {}, values = Object.create(valuesById);
|
5473 | values[valuesById[0] = "STATE_UNSPECIFIED"] = 0;
|
5474 | values[valuesById[1] = "ACTIVE"] = 1;
|
5475 | values[valuesById[2] = "RESOURCE_ERROR"] = 2;
|
5476 | return values;
|
5477 | })();
|
5478 |
|
5479 | return Subscription;
|
5480 | })();
|
5481 |
|
5482 | v1.RetryPolicy = (function() {
|
5483 |
|
5484 | /**
|
5485 | * Properties of a RetryPolicy.
|
5486 | * @memberof google.pubsub.v1
|
5487 | * @interface IRetryPolicy
|
5488 | * @property {google.protobuf.IDuration|null} [minimumBackoff] RetryPolicy minimumBackoff
|
5489 | * @property {google.protobuf.IDuration|null} [maximumBackoff] RetryPolicy maximumBackoff
|
5490 | */
|
5491 |
|
5492 | /**
|
5493 | * Constructs a new RetryPolicy.
|
5494 | * @memberof google.pubsub.v1
|
5495 | * @classdesc Represents a RetryPolicy.
|
5496 | * @implements IRetryPolicy
|
5497 | * @constructor
|
5498 | * @param {google.pubsub.v1.IRetryPolicy=} [properties] Properties to set
|
5499 | */
|
5500 | function RetryPolicy(properties) {
|
5501 | if (properties)
|
5502 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
5503 | if (properties[keys[i]] != null)
|
5504 | this[keys[i]] = properties[keys[i]];
|
5505 | }
|
5506 |
|
5507 | /**
|
5508 | * RetryPolicy minimumBackoff.
|
5509 | * @member {google.protobuf.IDuration|null|undefined} minimumBackoff
|
5510 | * @memberof google.pubsub.v1.RetryPolicy
|
5511 | * @instance
|
5512 | */
|
5513 | RetryPolicy.prototype.minimumBackoff = null;
|
5514 |
|
5515 | /**
|
5516 | * RetryPolicy maximumBackoff.
|
5517 | * @member {google.protobuf.IDuration|null|undefined} maximumBackoff
|
5518 | * @memberof google.pubsub.v1.RetryPolicy
|
5519 | * @instance
|
5520 | */
|
5521 | RetryPolicy.prototype.maximumBackoff = null;
|
5522 |
|
5523 | /**
|
5524 | * Creates a new RetryPolicy instance using the specified properties.
|
5525 | * @function create
|
5526 | * @memberof google.pubsub.v1.RetryPolicy
|
5527 | * @static
|
5528 | * @param {google.pubsub.v1.IRetryPolicy=} [properties] Properties to set
|
5529 | * @returns {google.pubsub.v1.RetryPolicy} RetryPolicy instance
|
5530 | */
|
5531 | RetryPolicy.create = function create(properties) {
|
5532 | return new RetryPolicy(properties);
|
5533 | };
|
5534 |
|
5535 | /**
|
5536 | * Encodes the specified RetryPolicy message. Does not implicitly {@link google.pubsub.v1.RetryPolicy.verify|verify} messages.
|
5537 | * @function encode
|
5538 | * @memberof google.pubsub.v1.RetryPolicy
|
5539 | * @static
|
5540 | * @param {google.pubsub.v1.IRetryPolicy} message RetryPolicy message or plain object to encode
|
5541 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
5542 | * @returns {$protobuf.Writer} Writer
|
5543 | */
|
5544 | RetryPolicy.encode = function encode(message, writer) {
|
5545 | if (!writer)
|
5546 | writer = $Writer.create();
|
5547 | if (message.minimumBackoff != null && Object.hasOwnProperty.call(message, "minimumBackoff"))
|
5548 | $root.google.protobuf.Duration.encode(message.minimumBackoff, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
5549 | if (message.maximumBackoff != null && Object.hasOwnProperty.call(message, "maximumBackoff"))
|
5550 | $root.google.protobuf.Duration.encode(message.maximumBackoff, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
5551 | return writer;
|
5552 | };
|
5553 |
|
5554 | /**
|
5555 | * Encodes the specified RetryPolicy message, length delimited. Does not implicitly {@link google.pubsub.v1.RetryPolicy.verify|verify} messages.
|
5556 | * @function encodeDelimited
|
5557 | * @memberof google.pubsub.v1.RetryPolicy
|
5558 | * @static
|
5559 | * @param {google.pubsub.v1.IRetryPolicy} message RetryPolicy message or plain object to encode
|
5560 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
5561 | * @returns {$protobuf.Writer} Writer
|
5562 | */
|
5563 | RetryPolicy.encodeDelimited = function encodeDelimited(message, writer) {
|
5564 | return this.encode(message, writer).ldelim();
|
5565 | };
|
5566 |
|
5567 | /**
|
5568 | * Decodes a RetryPolicy message from the specified reader or buffer.
|
5569 | * @function decode
|
5570 | * @memberof google.pubsub.v1.RetryPolicy
|
5571 | * @static
|
5572 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
5573 | * @param {number} [length] Message length if known beforehand
|
5574 | * @returns {google.pubsub.v1.RetryPolicy} RetryPolicy
|
5575 | * @throws {Error} If the payload is not a reader or valid buffer
|
5576 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
5577 | */
|
5578 | RetryPolicy.decode = function decode(reader, length) {
|
5579 | if (!(reader instanceof $Reader))
|
5580 | reader = $Reader.create(reader);
|
5581 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.RetryPolicy();
|
5582 | while (reader.pos < end) {
|
5583 | var tag = reader.uint32();
|
5584 | switch (tag >>> 3) {
|
5585 | case 1:
|
5586 | message.minimumBackoff = $root.google.protobuf.Duration.decode(reader, reader.uint32());
|
5587 | break;
|
5588 | case 2:
|
5589 | message.maximumBackoff = $root.google.protobuf.Duration.decode(reader, reader.uint32());
|
5590 | break;
|
5591 | default:
|
5592 | reader.skipType(tag & 7);
|
5593 | break;
|
5594 | }
|
5595 | }
|
5596 | return message;
|
5597 | };
|
5598 |
|
5599 | /**
|
5600 | * Decodes a RetryPolicy message from the specified reader or buffer, length delimited.
|
5601 | * @function decodeDelimited
|
5602 | * @memberof google.pubsub.v1.RetryPolicy
|
5603 | * @static
|
5604 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
5605 | * @returns {google.pubsub.v1.RetryPolicy} RetryPolicy
|
5606 | * @throws {Error} If the payload is not a reader or valid buffer
|
5607 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
5608 | */
|
5609 | RetryPolicy.decodeDelimited = function decodeDelimited(reader) {
|
5610 | if (!(reader instanceof $Reader))
|
5611 | reader = new $Reader(reader);
|
5612 | return this.decode(reader, reader.uint32());
|
5613 | };
|
5614 |
|
5615 | /**
|
5616 | * Verifies a RetryPolicy message.
|
5617 | * @function verify
|
5618 | * @memberof google.pubsub.v1.RetryPolicy
|
5619 | * @static
|
5620 | * @param {Object.<string,*>} message Plain object to verify
|
5621 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
5622 | */
|
5623 | RetryPolicy.verify = function verify(message) {
|
5624 | if (typeof message !== "object" || message === null)
|
5625 | return "object expected";
|
5626 | if (message.minimumBackoff != null && message.hasOwnProperty("minimumBackoff")) {
|
5627 | var error = $root.google.protobuf.Duration.verify(message.minimumBackoff);
|
5628 | if (error)
|
5629 | return "minimumBackoff." + error;
|
5630 | }
|
5631 | if (message.maximumBackoff != null && message.hasOwnProperty("maximumBackoff")) {
|
5632 | var error = $root.google.protobuf.Duration.verify(message.maximumBackoff);
|
5633 | if (error)
|
5634 | return "maximumBackoff." + error;
|
5635 | }
|
5636 | return null;
|
5637 | };
|
5638 |
|
5639 | /**
|
5640 | * Creates a RetryPolicy message from a plain object. Also converts values to their respective internal types.
|
5641 | * @function fromObject
|
5642 | * @memberof google.pubsub.v1.RetryPolicy
|
5643 | * @static
|
5644 | * @param {Object.<string,*>} object Plain object
|
5645 | * @returns {google.pubsub.v1.RetryPolicy} RetryPolicy
|
5646 | */
|
5647 | RetryPolicy.fromObject = function fromObject(object) {
|
5648 | if (object instanceof $root.google.pubsub.v1.RetryPolicy)
|
5649 | return object;
|
5650 | var message = new $root.google.pubsub.v1.RetryPolicy();
|
5651 | if (object.minimumBackoff != null) {
|
5652 | if (typeof object.minimumBackoff !== "object")
|
5653 | throw TypeError(".google.pubsub.v1.RetryPolicy.minimumBackoff: object expected");
|
5654 | message.minimumBackoff = $root.google.protobuf.Duration.fromObject(object.minimumBackoff);
|
5655 | }
|
5656 | if (object.maximumBackoff != null) {
|
5657 | if (typeof object.maximumBackoff !== "object")
|
5658 | throw TypeError(".google.pubsub.v1.RetryPolicy.maximumBackoff: object expected");
|
5659 | message.maximumBackoff = $root.google.protobuf.Duration.fromObject(object.maximumBackoff);
|
5660 | }
|
5661 | return message;
|
5662 | };
|
5663 |
|
5664 | /**
|
5665 | * Creates a plain object from a RetryPolicy message. Also converts values to other types if specified.
|
5666 | * @function toObject
|
5667 | * @memberof google.pubsub.v1.RetryPolicy
|
5668 | * @static
|
5669 | * @param {google.pubsub.v1.RetryPolicy} message RetryPolicy
|
5670 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
5671 | * @returns {Object.<string,*>} Plain object
|
5672 | */
|
5673 | RetryPolicy.toObject = function toObject(message, options) {
|
5674 | if (!options)
|
5675 | options = {};
|
5676 | var object = {};
|
5677 | if (options.defaults) {
|
5678 | object.minimumBackoff = null;
|
5679 | object.maximumBackoff = null;
|
5680 | }
|
5681 | if (message.minimumBackoff != null && message.hasOwnProperty("minimumBackoff"))
|
5682 | object.minimumBackoff = $root.google.protobuf.Duration.toObject(message.minimumBackoff, options);
|
5683 | if (message.maximumBackoff != null && message.hasOwnProperty("maximumBackoff"))
|
5684 | object.maximumBackoff = $root.google.protobuf.Duration.toObject(message.maximumBackoff, options);
|
5685 | return object;
|
5686 | };
|
5687 |
|
5688 | /**
|
5689 | * Converts this RetryPolicy to JSON.
|
5690 | * @function toJSON
|
5691 | * @memberof google.pubsub.v1.RetryPolicy
|
5692 | * @instance
|
5693 | * @returns {Object.<string,*>} JSON object
|
5694 | */
|
5695 | RetryPolicy.prototype.toJSON = function toJSON() {
|
5696 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
5697 | };
|
5698 |
|
5699 | return RetryPolicy;
|
5700 | })();
|
5701 |
|
5702 | v1.DeadLetterPolicy = (function() {
|
5703 |
|
5704 | /**
|
5705 | * Properties of a DeadLetterPolicy.
|
5706 | * @memberof google.pubsub.v1
|
5707 | * @interface IDeadLetterPolicy
|
5708 | * @property {string|null} [deadLetterTopic] DeadLetterPolicy deadLetterTopic
|
5709 | * @property {number|null} [maxDeliveryAttempts] DeadLetterPolicy maxDeliveryAttempts
|
5710 | */
|
5711 |
|
5712 | /**
|
5713 | * Constructs a new DeadLetterPolicy.
|
5714 | * @memberof google.pubsub.v1
|
5715 | * @classdesc Represents a DeadLetterPolicy.
|
5716 | * @implements IDeadLetterPolicy
|
5717 | * @constructor
|
5718 | * @param {google.pubsub.v1.IDeadLetterPolicy=} [properties] Properties to set
|
5719 | */
|
5720 | function DeadLetterPolicy(properties) {
|
5721 | if (properties)
|
5722 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
5723 | if (properties[keys[i]] != null)
|
5724 | this[keys[i]] = properties[keys[i]];
|
5725 | }
|
5726 |
|
5727 | /**
|
5728 | * DeadLetterPolicy deadLetterTopic.
|
5729 | * @member {string} deadLetterTopic
|
5730 | * @memberof google.pubsub.v1.DeadLetterPolicy
|
5731 | * @instance
|
5732 | */
|
5733 | DeadLetterPolicy.prototype.deadLetterTopic = "";
|
5734 |
|
5735 | /**
|
5736 | * DeadLetterPolicy maxDeliveryAttempts.
|
5737 | * @member {number} maxDeliveryAttempts
|
5738 | * @memberof google.pubsub.v1.DeadLetterPolicy
|
5739 | * @instance
|
5740 | */
|
5741 | DeadLetterPolicy.prototype.maxDeliveryAttempts = 0;
|
5742 |
|
5743 | /**
|
5744 | * Creates a new DeadLetterPolicy instance using the specified properties.
|
5745 | * @function create
|
5746 | * @memberof google.pubsub.v1.DeadLetterPolicy
|
5747 | * @static
|
5748 | * @param {google.pubsub.v1.IDeadLetterPolicy=} [properties] Properties to set
|
5749 | * @returns {google.pubsub.v1.DeadLetterPolicy} DeadLetterPolicy instance
|
5750 | */
|
5751 | DeadLetterPolicy.create = function create(properties) {
|
5752 | return new DeadLetterPolicy(properties);
|
5753 | };
|
5754 |
|
5755 | /**
|
5756 | * Encodes the specified DeadLetterPolicy message. Does not implicitly {@link google.pubsub.v1.DeadLetterPolicy.verify|verify} messages.
|
5757 | * @function encode
|
5758 | * @memberof google.pubsub.v1.DeadLetterPolicy
|
5759 | * @static
|
5760 | * @param {google.pubsub.v1.IDeadLetterPolicy} message DeadLetterPolicy message or plain object to encode
|
5761 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
5762 | * @returns {$protobuf.Writer} Writer
|
5763 | */
|
5764 | DeadLetterPolicy.encode = function encode(message, writer) {
|
5765 | if (!writer)
|
5766 | writer = $Writer.create();
|
5767 | if (message.deadLetterTopic != null && Object.hasOwnProperty.call(message, "deadLetterTopic"))
|
5768 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.deadLetterTopic);
|
5769 | if (message.maxDeliveryAttempts != null && Object.hasOwnProperty.call(message, "maxDeliveryAttempts"))
|
5770 | writer.uint32(/* id 2, wireType 0 =*/16).int32(message.maxDeliveryAttempts);
|
5771 | return writer;
|
5772 | };
|
5773 |
|
5774 | /**
|
5775 | * Encodes the specified DeadLetterPolicy message, length delimited. Does not implicitly {@link google.pubsub.v1.DeadLetterPolicy.verify|verify} messages.
|
5776 | * @function encodeDelimited
|
5777 | * @memberof google.pubsub.v1.DeadLetterPolicy
|
5778 | * @static
|
5779 | * @param {google.pubsub.v1.IDeadLetterPolicy} message DeadLetterPolicy message or plain object to encode
|
5780 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
5781 | * @returns {$protobuf.Writer} Writer
|
5782 | */
|
5783 | DeadLetterPolicy.encodeDelimited = function encodeDelimited(message, writer) {
|
5784 | return this.encode(message, writer).ldelim();
|
5785 | };
|
5786 |
|
5787 | /**
|
5788 | * Decodes a DeadLetterPolicy message from the specified reader or buffer.
|
5789 | * @function decode
|
5790 | * @memberof google.pubsub.v1.DeadLetterPolicy
|
5791 | * @static
|
5792 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
5793 | * @param {number} [length] Message length if known beforehand
|
5794 | * @returns {google.pubsub.v1.DeadLetterPolicy} DeadLetterPolicy
|
5795 | * @throws {Error} If the payload is not a reader or valid buffer
|
5796 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
5797 | */
|
5798 | DeadLetterPolicy.decode = function decode(reader, length) {
|
5799 | if (!(reader instanceof $Reader))
|
5800 | reader = $Reader.create(reader);
|
5801 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.DeadLetterPolicy();
|
5802 | while (reader.pos < end) {
|
5803 | var tag = reader.uint32();
|
5804 | switch (tag >>> 3) {
|
5805 | case 1:
|
5806 | message.deadLetterTopic = reader.string();
|
5807 | break;
|
5808 | case 2:
|
5809 | message.maxDeliveryAttempts = reader.int32();
|
5810 | break;
|
5811 | default:
|
5812 | reader.skipType(tag & 7);
|
5813 | break;
|
5814 | }
|
5815 | }
|
5816 | return message;
|
5817 | };
|
5818 |
|
5819 | /**
|
5820 | * Decodes a DeadLetterPolicy message from the specified reader or buffer, length delimited.
|
5821 | * @function decodeDelimited
|
5822 | * @memberof google.pubsub.v1.DeadLetterPolicy
|
5823 | * @static
|
5824 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
5825 | * @returns {google.pubsub.v1.DeadLetterPolicy} DeadLetterPolicy
|
5826 | * @throws {Error} If the payload is not a reader or valid buffer
|
5827 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
5828 | */
|
5829 | DeadLetterPolicy.decodeDelimited = function decodeDelimited(reader) {
|
5830 | if (!(reader instanceof $Reader))
|
5831 | reader = new $Reader(reader);
|
5832 | return this.decode(reader, reader.uint32());
|
5833 | };
|
5834 |
|
5835 | /**
|
5836 | * Verifies a DeadLetterPolicy message.
|
5837 | * @function verify
|
5838 | * @memberof google.pubsub.v1.DeadLetterPolicy
|
5839 | * @static
|
5840 | * @param {Object.<string,*>} message Plain object to verify
|
5841 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
5842 | */
|
5843 | DeadLetterPolicy.verify = function verify(message) {
|
5844 | if (typeof message !== "object" || message === null)
|
5845 | return "object expected";
|
5846 | if (message.deadLetterTopic != null && message.hasOwnProperty("deadLetterTopic"))
|
5847 | if (!$util.isString(message.deadLetterTopic))
|
5848 | return "deadLetterTopic: string expected";
|
5849 | if (message.maxDeliveryAttempts != null && message.hasOwnProperty("maxDeliveryAttempts"))
|
5850 | if (!$util.isInteger(message.maxDeliveryAttempts))
|
5851 | return "maxDeliveryAttempts: integer expected";
|
5852 | return null;
|
5853 | };
|
5854 |
|
5855 | /**
|
5856 | * Creates a DeadLetterPolicy message from a plain object. Also converts values to their respective internal types.
|
5857 | * @function fromObject
|
5858 | * @memberof google.pubsub.v1.DeadLetterPolicy
|
5859 | * @static
|
5860 | * @param {Object.<string,*>} object Plain object
|
5861 | * @returns {google.pubsub.v1.DeadLetterPolicy} DeadLetterPolicy
|
5862 | */
|
5863 | DeadLetterPolicy.fromObject = function fromObject(object) {
|
5864 | if (object instanceof $root.google.pubsub.v1.DeadLetterPolicy)
|
5865 | return object;
|
5866 | var message = new $root.google.pubsub.v1.DeadLetterPolicy();
|
5867 | if (object.deadLetterTopic != null)
|
5868 | message.deadLetterTopic = String(object.deadLetterTopic);
|
5869 | if (object.maxDeliveryAttempts != null)
|
5870 | message.maxDeliveryAttempts = object.maxDeliveryAttempts | 0;
|
5871 | return message;
|
5872 | };
|
5873 |
|
5874 | /**
|
5875 | * Creates a plain object from a DeadLetterPolicy message. Also converts values to other types if specified.
|
5876 | * @function toObject
|
5877 | * @memberof google.pubsub.v1.DeadLetterPolicy
|
5878 | * @static
|
5879 | * @param {google.pubsub.v1.DeadLetterPolicy} message DeadLetterPolicy
|
5880 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
5881 | * @returns {Object.<string,*>} Plain object
|
5882 | */
|
5883 | DeadLetterPolicy.toObject = function toObject(message, options) {
|
5884 | if (!options)
|
5885 | options = {};
|
5886 | var object = {};
|
5887 | if (options.defaults) {
|
5888 | object.deadLetterTopic = "";
|
5889 | object.maxDeliveryAttempts = 0;
|
5890 | }
|
5891 | if (message.deadLetterTopic != null && message.hasOwnProperty("deadLetterTopic"))
|
5892 | object.deadLetterTopic = message.deadLetterTopic;
|
5893 | if (message.maxDeliveryAttempts != null && message.hasOwnProperty("maxDeliveryAttempts"))
|
5894 | object.maxDeliveryAttempts = message.maxDeliveryAttempts;
|
5895 | return object;
|
5896 | };
|
5897 |
|
5898 | /**
|
5899 | * Converts this DeadLetterPolicy to JSON.
|
5900 | * @function toJSON
|
5901 | * @memberof google.pubsub.v1.DeadLetterPolicy
|
5902 | * @instance
|
5903 | * @returns {Object.<string,*>} JSON object
|
5904 | */
|
5905 | DeadLetterPolicy.prototype.toJSON = function toJSON() {
|
5906 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
5907 | };
|
5908 |
|
5909 | return DeadLetterPolicy;
|
5910 | })();
|
5911 |
|
5912 | v1.ExpirationPolicy = (function() {
|
5913 |
|
5914 | /**
|
5915 | * Properties of an ExpirationPolicy.
|
5916 | * @memberof google.pubsub.v1
|
5917 | * @interface IExpirationPolicy
|
5918 | * @property {google.protobuf.IDuration|null} [ttl] ExpirationPolicy ttl
|
5919 | */
|
5920 |
|
5921 | /**
|
5922 | * Constructs a new ExpirationPolicy.
|
5923 | * @memberof google.pubsub.v1
|
5924 | * @classdesc Represents an ExpirationPolicy.
|
5925 | * @implements IExpirationPolicy
|
5926 | * @constructor
|
5927 | * @param {google.pubsub.v1.IExpirationPolicy=} [properties] Properties to set
|
5928 | */
|
5929 | function ExpirationPolicy(properties) {
|
5930 | if (properties)
|
5931 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
5932 | if (properties[keys[i]] != null)
|
5933 | this[keys[i]] = properties[keys[i]];
|
5934 | }
|
5935 |
|
5936 | /**
|
5937 | * ExpirationPolicy ttl.
|
5938 | * @member {google.protobuf.IDuration|null|undefined} ttl
|
5939 | * @memberof google.pubsub.v1.ExpirationPolicy
|
5940 | * @instance
|
5941 | */
|
5942 | ExpirationPolicy.prototype.ttl = null;
|
5943 |
|
5944 | /**
|
5945 | * Creates a new ExpirationPolicy instance using the specified properties.
|
5946 | * @function create
|
5947 | * @memberof google.pubsub.v1.ExpirationPolicy
|
5948 | * @static
|
5949 | * @param {google.pubsub.v1.IExpirationPolicy=} [properties] Properties to set
|
5950 | * @returns {google.pubsub.v1.ExpirationPolicy} ExpirationPolicy instance
|
5951 | */
|
5952 | ExpirationPolicy.create = function create(properties) {
|
5953 | return new ExpirationPolicy(properties);
|
5954 | };
|
5955 |
|
5956 | /**
|
5957 | * Encodes the specified ExpirationPolicy message. Does not implicitly {@link google.pubsub.v1.ExpirationPolicy.verify|verify} messages.
|
5958 | * @function encode
|
5959 | * @memberof google.pubsub.v1.ExpirationPolicy
|
5960 | * @static
|
5961 | * @param {google.pubsub.v1.IExpirationPolicy} message ExpirationPolicy message or plain object to encode
|
5962 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
5963 | * @returns {$protobuf.Writer} Writer
|
5964 | */
|
5965 | ExpirationPolicy.encode = function encode(message, writer) {
|
5966 | if (!writer)
|
5967 | writer = $Writer.create();
|
5968 | if (message.ttl != null && Object.hasOwnProperty.call(message, "ttl"))
|
5969 | $root.google.protobuf.Duration.encode(message.ttl, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
5970 | return writer;
|
5971 | };
|
5972 |
|
5973 | /**
|
5974 | * Encodes the specified ExpirationPolicy message, length delimited. Does not implicitly {@link google.pubsub.v1.ExpirationPolicy.verify|verify} messages.
|
5975 | * @function encodeDelimited
|
5976 | * @memberof google.pubsub.v1.ExpirationPolicy
|
5977 | * @static
|
5978 | * @param {google.pubsub.v1.IExpirationPolicy} message ExpirationPolicy message or plain object to encode
|
5979 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
5980 | * @returns {$protobuf.Writer} Writer
|
5981 | */
|
5982 | ExpirationPolicy.encodeDelimited = function encodeDelimited(message, writer) {
|
5983 | return this.encode(message, writer).ldelim();
|
5984 | };
|
5985 |
|
5986 | /**
|
5987 | * Decodes an ExpirationPolicy message from the specified reader or buffer.
|
5988 | * @function decode
|
5989 | * @memberof google.pubsub.v1.ExpirationPolicy
|
5990 | * @static
|
5991 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
5992 | * @param {number} [length] Message length if known beforehand
|
5993 | * @returns {google.pubsub.v1.ExpirationPolicy} ExpirationPolicy
|
5994 | * @throws {Error} If the payload is not a reader or valid buffer
|
5995 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
5996 | */
|
5997 | ExpirationPolicy.decode = function decode(reader, length) {
|
5998 | if (!(reader instanceof $Reader))
|
5999 | reader = $Reader.create(reader);
|
6000 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.ExpirationPolicy();
|
6001 | while (reader.pos < end) {
|
6002 | var tag = reader.uint32();
|
6003 | switch (tag >>> 3) {
|
6004 | case 1:
|
6005 | message.ttl = $root.google.protobuf.Duration.decode(reader, reader.uint32());
|
6006 | break;
|
6007 | default:
|
6008 | reader.skipType(tag & 7);
|
6009 | break;
|
6010 | }
|
6011 | }
|
6012 | return message;
|
6013 | };
|
6014 |
|
6015 | /**
|
6016 | * Decodes an ExpirationPolicy message from the specified reader or buffer, length delimited.
|
6017 | * @function decodeDelimited
|
6018 | * @memberof google.pubsub.v1.ExpirationPolicy
|
6019 | * @static
|
6020 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
6021 | * @returns {google.pubsub.v1.ExpirationPolicy} ExpirationPolicy
|
6022 | * @throws {Error} If the payload is not a reader or valid buffer
|
6023 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
6024 | */
|
6025 | ExpirationPolicy.decodeDelimited = function decodeDelimited(reader) {
|
6026 | if (!(reader instanceof $Reader))
|
6027 | reader = new $Reader(reader);
|
6028 | return this.decode(reader, reader.uint32());
|
6029 | };
|
6030 |
|
6031 | /**
|
6032 | * Verifies an ExpirationPolicy message.
|
6033 | * @function verify
|
6034 | * @memberof google.pubsub.v1.ExpirationPolicy
|
6035 | * @static
|
6036 | * @param {Object.<string,*>} message Plain object to verify
|
6037 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
6038 | */
|
6039 | ExpirationPolicy.verify = function verify(message) {
|
6040 | if (typeof message !== "object" || message === null)
|
6041 | return "object expected";
|
6042 | if (message.ttl != null && message.hasOwnProperty("ttl")) {
|
6043 | var error = $root.google.protobuf.Duration.verify(message.ttl);
|
6044 | if (error)
|
6045 | return "ttl." + error;
|
6046 | }
|
6047 | return null;
|
6048 | };
|
6049 |
|
6050 | /**
|
6051 | * Creates an ExpirationPolicy message from a plain object. Also converts values to their respective internal types.
|
6052 | * @function fromObject
|
6053 | * @memberof google.pubsub.v1.ExpirationPolicy
|
6054 | * @static
|
6055 | * @param {Object.<string,*>} object Plain object
|
6056 | * @returns {google.pubsub.v1.ExpirationPolicy} ExpirationPolicy
|
6057 | */
|
6058 | ExpirationPolicy.fromObject = function fromObject(object) {
|
6059 | if (object instanceof $root.google.pubsub.v1.ExpirationPolicy)
|
6060 | return object;
|
6061 | var message = new $root.google.pubsub.v1.ExpirationPolicy();
|
6062 | if (object.ttl != null) {
|
6063 | if (typeof object.ttl !== "object")
|
6064 | throw TypeError(".google.pubsub.v1.ExpirationPolicy.ttl: object expected");
|
6065 | message.ttl = $root.google.protobuf.Duration.fromObject(object.ttl);
|
6066 | }
|
6067 | return message;
|
6068 | };
|
6069 |
|
6070 | /**
|
6071 | * Creates a plain object from an ExpirationPolicy message. Also converts values to other types if specified.
|
6072 | * @function toObject
|
6073 | * @memberof google.pubsub.v1.ExpirationPolicy
|
6074 | * @static
|
6075 | * @param {google.pubsub.v1.ExpirationPolicy} message ExpirationPolicy
|
6076 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
6077 | * @returns {Object.<string,*>} Plain object
|
6078 | */
|
6079 | ExpirationPolicy.toObject = function toObject(message, options) {
|
6080 | if (!options)
|
6081 | options = {};
|
6082 | var object = {};
|
6083 | if (options.defaults)
|
6084 | object.ttl = null;
|
6085 | if (message.ttl != null && message.hasOwnProperty("ttl"))
|
6086 | object.ttl = $root.google.protobuf.Duration.toObject(message.ttl, options);
|
6087 | return object;
|
6088 | };
|
6089 |
|
6090 | /**
|
6091 | * Converts this ExpirationPolicy to JSON.
|
6092 | * @function toJSON
|
6093 | * @memberof google.pubsub.v1.ExpirationPolicy
|
6094 | * @instance
|
6095 | * @returns {Object.<string,*>} JSON object
|
6096 | */
|
6097 | ExpirationPolicy.prototype.toJSON = function toJSON() {
|
6098 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
6099 | };
|
6100 |
|
6101 | return ExpirationPolicy;
|
6102 | })();
|
6103 |
|
6104 | v1.PushConfig = (function() {
|
6105 |
|
6106 | /**
|
6107 | * Properties of a PushConfig.
|
6108 | * @memberof google.pubsub.v1
|
6109 | * @interface IPushConfig
|
6110 | * @property {string|null} [pushEndpoint] PushConfig pushEndpoint
|
6111 | * @property {Object.<string,string>|null} [attributes] PushConfig attributes
|
6112 | * @property {google.pubsub.v1.PushConfig.IOidcToken|null} [oidcToken] PushConfig oidcToken
|
6113 | */
|
6114 |
|
6115 | /**
|
6116 | * Constructs a new PushConfig.
|
6117 | * @memberof google.pubsub.v1
|
6118 | * @classdesc Represents a PushConfig.
|
6119 | * @implements IPushConfig
|
6120 | * @constructor
|
6121 | * @param {google.pubsub.v1.IPushConfig=} [properties] Properties to set
|
6122 | */
|
6123 | function PushConfig(properties) {
|
6124 | this.attributes = {};
|
6125 | if (properties)
|
6126 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
6127 | if (properties[keys[i]] != null)
|
6128 | this[keys[i]] = properties[keys[i]];
|
6129 | }
|
6130 |
|
6131 | /**
|
6132 | * PushConfig pushEndpoint.
|
6133 | * @member {string} pushEndpoint
|
6134 | * @memberof google.pubsub.v1.PushConfig
|
6135 | * @instance
|
6136 | */
|
6137 | PushConfig.prototype.pushEndpoint = "";
|
6138 |
|
6139 | /**
|
6140 | * PushConfig attributes.
|
6141 | * @member {Object.<string,string>} attributes
|
6142 | * @memberof google.pubsub.v1.PushConfig
|
6143 | * @instance
|
6144 | */
|
6145 | PushConfig.prototype.attributes = $util.emptyObject;
|
6146 |
|
6147 | /**
|
6148 | * PushConfig oidcToken.
|
6149 | * @member {google.pubsub.v1.PushConfig.IOidcToken|null|undefined} oidcToken
|
6150 | * @memberof google.pubsub.v1.PushConfig
|
6151 | * @instance
|
6152 | */
|
6153 | PushConfig.prototype.oidcToken = null;
|
6154 |
|
6155 | // OneOf field names bound to virtual getters and setters
|
6156 | var $oneOfFields;
|
6157 |
|
6158 | /**
|
6159 | * PushConfig authenticationMethod.
|
6160 | * @member {"oidcToken"|undefined} authenticationMethod
|
6161 | * @memberof google.pubsub.v1.PushConfig
|
6162 | * @instance
|
6163 | */
|
6164 | Object.defineProperty(PushConfig.prototype, "authenticationMethod", {
|
6165 | get: $util.oneOfGetter($oneOfFields = ["oidcToken"]),
|
6166 | set: $util.oneOfSetter($oneOfFields)
|
6167 | });
|
6168 |
|
6169 | /**
|
6170 | * Creates a new PushConfig instance using the specified properties.
|
6171 | * @function create
|
6172 | * @memberof google.pubsub.v1.PushConfig
|
6173 | * @static
|
6174 | * @param {google.pubsub.v1.IPushConfig=} [properties] Properties to set
|
6175 | * @returns {google.pubsub.v1.PushConfig} PushConfig instance
|
6176 | */
|
6177 | PushConfig.create = function create(properties) {
|
6178 | return new PushConfig(properties);
|
6179 | };
|
6180 |
|
6181 | /**
|
6182 | * Encodes the specified PushConfig message. Does not implicitly {@link google.pubsub.v1.PushConfig.verify|verify} messages.
|
6183 | * @function encode
|
6184 | * @memberof google.pubsub.v1.PushConfig
|
6185 | * @static
|
6186 | * @param {google.pubsub.v1.IPushConfig} message PushConfig message or plain object to encode
|
6187 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
6188 | * @returns {$protobuf.Writer} Writer
|
6189 | */
|
6190 | PushConfig.encode = function encode(message, writer) {
|
6191 | if (!writer)
|
6192 | writer = $Writer.create();
|
6193 | if (message.pushEndpoint != null && Object.hasOwnProperty.call(message, "pushEndpoint"))
|
6194 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.pushEndpoint);
|
6195 | if (message.attributes != null && Object.hasOwnProperty.call(message, "attributes"))
|
6196 | for (var keys = Object.keys(message.attributes), i = 0; i < keys.length; ++i)
|
6197 | writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.attributes[keys[i]]).ldelim();
|
6198 | if (message.oidcToken != null && Object.hasOwnProperty.call(message, "oidcToken"))
|
6199 | $root.google.pubsub.v1.PushConfig.OidcToken.encode(message.oidcToken, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
|
6200 | return writer;
|
6201 | };
|
6202 |
|
6203 | /**
|
6204 | * Encodes the specified PushConfig message, length delimited. Does not implicitly {@link google.pubsub.v1.PushConfig.verify|verify} messages.
|
6205 | * @function encodeDelimited
|
6206 | * @memberof google.pubsub.v1.PushConfig
|
6207 | * @static
|
6208 | * @param {google.pubsub.v1.IPushConfig} message PushConfig message or plain object to encode
|
6209 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
6210 | * @returns {$protobuf.Writer} Writer
|
6211 | */
|
6212 | PushConfig.encodeDelimited = function encodeDelimited(message, writer) {
|
6213 | return this.encode(message, writer).ldelim();
|
6214 | };
|
6215 |
|
6216 | /**
|
6217 | * Decodes a PushConfig message from the specified reader or buffer.
|
6218 | * @function decode
|
6219 | * @memberof google.pubsub.v1.PushConfig
|
6220 | * @static
|
6221 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
6222 | * @param {number} [length] Message length if known beforehand
|
6223 | * @returns {google.pubsub.v1.PushConfig} PushConfig
|
6224 | * @throws {Error} If the payload is not a reader or valid buffer
|
6225 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
6226 | */
|
6227 | PushConfig.decode = function decode(reader, length) {
|
6228 | if (!(reader instanceof $Reader))
|
6229 | reader = $Reader.create(reader);
|
6230 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.PushConfig(), key, value;
|
6231 | while (reader.pos < end) {
|
6232 | var tag = reader.uint32();
|
6233 | switch (tag >>> 3) {
|
6234 | case 1:
|
6235 | message.pushEndpoint = reader.string();
|
6236 | break;
|
6237 | case 2:
|
6238 | if (message.attributes === $util.emptyObject)
|
6239 | message.attributes = {};
|
6240 | var end2 = reader.uint32() + reader.pos;
|
6241 | key = "";
|
6242 | value = "";
|
6243 | while (reader.pos < end2) {
|
6244 | var tag2 = reader.uint32();
|
6245 | switch (tag2 >>> 3) {
|
6246 | case 1:
|
6247 | key = reader.string();
|
6248 | break;
|
6249 | case 2:
|
6250 | value = reader.string();
|
6251 | break;
|
6252 | default:
|
6253 | reader.skipType(tag2 & 7);
|
6254 | break;
|
6255 | }
|
6256 | }
|
6257 | message.attributes[key] = value;
|
6258 | break;
|
6259 | case 3:
|
6260 | message.oidcToken = $root.google.pubsub.v1.PushConfig.OidcToken.decode(reader, reader.uint32());
|
6261 | break;
|
6262 | default:
|
6263 | reader.skipType(tag & 7);
|
6264 | break;
|
6265 | }
|
6266 | }
|
6267 | return message;
|
6268 | };
|
6269 |
|
6270 | /**
|
6271 | * Decodes a PushConfig message from the specified reader or buffer, length delimited.
|
6272 | * @function decodeDelimited
|
6273 | * @memberof google.pubsub.v1.PushConfig
|
6274 | * @static
|
6275 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
6276 | * @returns {google.pubsub.v1.PushConfig} PushConfig
|
6277 | * @throws {Error} If the payload is not a reader or valid buffer
|
6278 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
6279 | */
|
6280 | PushConfig.decodeDelimited = function decodeDelimited(reader) {
|
6281 | if (!(reader instanceof $Reader))
|
6282 | reader = new $Reader(reader);
|
6283 | return this.decode(reader, reader.uint32());
|
6284 | };
|
6285 |
|
6286 | /**
|
6287 | * Verifies a PushConfig message.
|
6288 | * @function verify
|
6289 | * @memberof google.pubsub.v1.PushConfig
|
6290 | * @static
|
6291 | * @param {Object.<string,*>} message Plain object to verify
|
6292 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
6293 | */
|
6294 | PushConfig.verify = function verify(message) {
|
6295 | if (typeof message !== "object" || message === null)
|
6296 | return "object expected";
|
6297 | var properties = {};
|
6298 | if (message.pushEndpoint != null && message.hasOwnProperty("pushEndpoint"))
|
6299 | if (!$util.isString(message.pushEndpoint))
|
6300 | return "pushEndpoint: string expected";
|
6301 | if (message.attributes != null && message.hasOwnProperty("attributes")) {
|
6302 | if (!$util.isObject(message.attributes))
|
6303 | return "attributes: object expected";
|
6304 | var key = Object.keys(message.attributes);
|
6305 | for (var i = 0; i < key.length; ++i)
|
6306 | if (!$util.isString(message.attributes[key[i]]))
|
6307 | return "attributes: string{k:string} expected";
|
6308 | }
|
6309 | if (message.oidcToken != null && message.hasOwnProperty("oidcToken")) {
|
6310 | properties.authenticationMethod = 1;
|
6311 | {
|
6312 | var error = $root.google.pubsub.v1.PushConfig.OidcToken.verify(message.oidcToken);
|
6313 | if (error)
|
6314 | return "oidcToken." + error;
|
6315 | }
|
6316 | }
|
6317 | return null;
|
6318 | };
|
6319 |
|
6320 | /**
|
6321 | * Creates a PushConfig message from a plain object. Also converts values to their respective internal types.
|
6322 | * @function fromObject
|
6323 | * @memberof google.pubsub.v1.PushConfig
|
6324 | * @static
|
6325 | * @param {Object.<string,*>} object Plain object
|
6326 | * @returns {google.pubsub.v1.PushConfig} PushConfig
|
6327 | */
|
6328 | PushConfig.fromObject = function fromObject(object) {
|
6329 | if (object instanceof $root.google.pubsub.v1.PushConfig)
|
6330 | return object;
|
6331 | var message = new $root.google.pubsub.v1.PushConfig();
|
6332 | if (object.pushEndpoint != null)
|
6333 | message.pushEndpoint = String(object.pushEndpoint);
|
6334 | if (object.attributes) {
|
6335 | if (typeof object.attributes !== "object")
|
6336 | throw TypeError(".google.pubsub.v1.PushConfig.attributes: object expected");
|
6337 | message.attributes = {};
|
6338 | for (var keys = Object.keys(object.attributes), i = 0; i < keys.length; ++i)
|
6339 | message.attributes[keys[i]] = String(object.attributes[keys[i]]);
|
6340 | }
|
6341 | if (object.oidcToken != null) {
|
6342 | if (typeof object.oidcToken !== "object")
|
6343 | throw TypeError(".google.pubsub.v1.PushConfig.oidcToken: object expected");
|
6344 | message.oidcToken = $root.google.pubsub.v1.PushConfig.OidcToken.fromObject(object.oidcToken);
|
6345 | }
|
6346 | return message;
|
6347 | };
|
6348 |
|
6349 | /**
|
6350 | * Creates a plain object from a PushConfig message. Also converts values to other types if specified.
|
6351 | * @function toObject
|
6352 | * @memberof google.pubsub.v1.PushConfig
|
6353 | * @static
|
6354 | * @param {google.pubsub.v1.PushConfig} message PushConfig
|
6355 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
6356 | * @returns {Object.<string,*>} Plain object
|
6357 | */
|
6358 | PushConfig.toObject = function toObject(message, options) {
|
6359 | if (!options)
|
6360 | options = {};
|
6361 | var object = {};
|
6362 | if (options.objects || options.defaults)
|
6363 | object.attributes = {};
|
6364 | if (options.defaults)
|
6365 | object.pushEndpoint = "";
|
6366 | if (message.pushEndpoint != null && message.hasOwnProperty("pushEndpoint"))
|
6367 | object.pushEndpoint = message.pushEndpoint;
|
6368 | var keys2;
|
6369 | if (message.attributes && (keys2 = Object.keys(message.attributes)).length) {
|
6370 | object.attributes = {};
|
6371 | for (var j = 0; j < keys2.length; ++j)
|
6372 | object.attributes[keys2[j]] = message.attributes[keys2[j]];
|
6373 | }
|
6374 | if (message.oidcToken != null && message.hasOwnProperty("oidcToken")) {
|
6375 | object.oidcToken = $root.google.pubsub.v1.PushConfig.OidcToken.toObject(message.oidcToken, options);
|
6376 | if (options.oneofs)
|
6377 | object.authenticationMethod = "oidcToken";
|
6378 | }
|
6379 | return object;
|
6380 | };
|
6381 |
|
6382 | /**
|
6383 | * Converts this PushConfig to JSON.
|
6384 | * @function toJSON
|
6385 | * @memberof google.pubsub.v1.PushConfig
|
6386 | * @instance
|
6387 | * @returns {Object.<string,*>} JSON object
|
6388 | */
|
6389 | PushConfig.prototype.toJSON = function toJSON() {
|
6390 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
6391 | };
|
6392 |
|
6393 | PushConfig.OidcToken = (function() {
|
6394 |
|
6395 | /**
|
6396 | * Properties of an OidcToken.
|
6397 | * @memberof google.pubsub.v1.PushConfig
|
6398 | * @interface IOidcToken
|
6399 | * @property {string|null} [serviceAccountEmail] OidcToken serviceAccountEmail
|
6400 | * @property {string|null} [audience] OidcToken audience
|
6401 | */
|
6402 |
|
6403 | /**
|
6404 | * Constructs a new OidcToken.
|
6405 | * @memberof google.pubsub.v1.PushConfig
|
6406 | * @classdesc Represents an OidcToken.
|
6407 | * @implements IOidcToken
|
6408 | * @constructor
|
6409 | * @param {google.pubsub.v1.PushConfig.IOidcToken=} [properties] Properties to set
|
6410 | */
|
6411 | function OidcToken(properties) {
|
6412 | if (properties)
|
6413 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
6414 | if (properties[keys[i]] != null)
|
6415 | this[keys[i]] = properties[keys[i]];
|
6416 | }
|
6417 |
|
6418 | /**
|
6419 | * OidcToken serviceAccountEmail.
|
6420 | * @member {string} serviceAccountEmail
|
6421 | * @memberof google.pubsub.v1.PushConfig.OidcToken
|
6422 | * @instance
|
6423 | */
|
6424 | OidcToken.prototype.serviceAccountEmail = "";
|
6425 |
|
6426 | /**
|
6427 | * OidcToken audience.
|
6428 | * @member {string} audience
|
6429 | * @memberof google.pubsub.v1.PushConfig.OidcToken
|
6430 | * @instance
|
6431 | */
|
6432 | OidcToken.prototype.audience = "";
|
6433 |
|
6434 | /**
|
6435 | * Creates a new OidcToken instance using the specified properties.
|
6436 | * @function create
|
6437 | * @memberof google.pubsub.v1.PushConfig.OidcToken
|
6438 | * @static
|
6439 | * @param {google.pubsub.v1.PushConfig.IOidcToken=} [properties] Properties to set
|
6440 | * @returns {google.pubsub.v1.PushConfig.OidcToken} OidcToken instance
|
6441 | */
|
6442 | OidcToken.create = function create(properties) {
|
6443 | return new OidcToken(properties);
|
6444 | };
|
6445 |
|
6446 | /**
|
6447 | * Encodes the specified OidcToken message. Does not implicitly {@link google.pubsub.v1.PushConfig.OidcToken.verify|verify} messages.
|
6448 | * @function encode
|
6449 | * @memberof google.pubsub.v1.PushConfig.OidcToken
|
6450 | * @static
|
6451 | * @param {google.pubsub.v1.PushConfig.IOidcToken} message OidcToken message or plain object to encode
|
6452 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
6453 | * @returns {$protobuf.Writer} Writer
|
6454 | */
|
6455 | OidcToken.encode = function encode(message, writer) {
|
6456 | if (!writer)
|
6457 | writer = $Writer.create();
|
6458 | if (message.serviceAccountEmail != null && Object.hasOwnProperty.call(message, "serviceAccountEmail"))
|
6459 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.serviceAccountEmail);
|
6460 | if (message.audience != null && Object.hasOwnProperty.call(message, "audience"))
|
6461 | writer.uint32(/* id 2, wireType 2 =*/18).string(message.audience);
|
6462 | return writer;
|
6463 | };
|
6464 |
|
6465 | /**
|
6466 | * Encodes the specified OidcToken message, length delimited. Does not implicitly {@link google.pubsub.v1.PushConfig.OidcToken.verify|verify} messages.
|
6467 | * @function encodeDelimited
|
6468 | * @memberof google.pubsub.v1.PushConfig.OidcToken
|
6469 | * @static
|
6470 | * @param {google.pubsub.v1.PushConfig.IOidcToken} message OidcToken message or plain object to encode
|
6471 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
6472 | * @returns {$protobuf.Writer} Writer
|
6473 | */
|
6474 | OidcToken.encodeDelimited = function encodeDelimited(message, writer) {
|
6475 | return this.encode(message, writer).ldelim();
|
6476 | };
|
6477 |
|
6478 | /**
|
6479 | * Decodes an OidcToken message from the specified reader or buffer.
|
6480 | * @function decode
|
6481 | * @memberof google.pubsub.v1.PushConfig.OidcToken
|
6482 | * @static
|
6483 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
6484 | * @param {number} [length] Message length if known beforehand
|
6485 | * @returns {google.pubsub.v1.PushConfig.OidcToken} OidcToken
|
6486 | * @throws {Error} If the payload is not a reader or valid buffer
|
6487 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
6488 | */
|
6489 | OidcToken.decode = function decode(reader, length) {
|
6490 | if (!(reader instanceof $Reader))
|
6491 | reader = $Reader.create(reader);
|
6492 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.PushConfig.OidcToken();
|
6493 | while (reader.pos < end) {
|
6494 | var tag = reader.uint32();
|
6495 | switch (tag >>> 3) {
|
6496 | case 1:
|
6497 | message.serviceAccountEmail = reader.string();
|
6498 | break;
|
6499 | case 2:
|
6500 | message.audience = reader.string();
|
6501 | break;
|
6502 | default:
|
6503 | reader.skipType(tag & 7);
|
6504 | break;
|
6505 | }
|
6506 | }
|
6507 | return message;
|
6508 | };
|
6509 |
|
6510 | /**
|
6511 | * Decodes an OidcToken message from the specified reader or buffer, length delimited.
|
6512 | * @function decodeDelimited
|
6513 | * @memberof google.pubsub.v1.PushConfig.OidcToken
|
6514 | * @static
|
6515 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
6516 | * @returns {google.pubsub.v1.PushConfig.OidcToken} OidcToken
|
6517 | * @throws {Error} If the payload is not a reader or valid buffer
|
6518 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
6519 | */
|
6520 | OidcToken.decodeDelimited = function decodeDelimited(reader) {
|
6521 | if (!(reader instanceof $Reader))
|
6522 | reader = new $Reader(reader);
|
6523 | return this.decode(reader, reader.uint32());
|
6524 | };
|
6525 |
|
6526 | /**
|
6527 | * Verifies an OidcToken message.
|
6528 | * @function verify
|
6529 | * @memberof google.pubsub.v1.PushConfig.OidcToken
|
6530 | * @static
|
6531 | * @param {Object.<string,*>} message Plain object to verify
|
6532 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
6533 | */
|
6534 | OidcToken.verify = function verify(message) {
|
6535 | if (typeof message !== "object" || message === null)
|
6536 | return "object expected";
|
6537 | if (message.serviceAccountEmail != null && message.hasOwnProperty("serviceAccountEmail"))
|
6538 | if (!$util.isString(message.serviceAccountEmail))
|
6539 | return "serviceAccountEmail: string expected";
|
6540 | if (message.audience != null && message.hasOwnProperty("audience"))
|
6541 | if (!$util.isString(message.audience))
|
6542 | return "audience: string expected";
|
6543 | return null;
|
6544 | };
|
6545 |
|
6546 | /**
|
6547 | * Creates an OidcToken message from a plain object. Also converts values to their respective internal types.
|
6548 | * @function fromObject
|
6549 | * @memberof google.pubsub.v1.PushConfig.OidcToken
|
6550 | * @static
|
6551 | * @param {Object.<string,*>} object Plain object
|
6552 | * @returns {google.pubsub.v1.PushConfig.OidcToken} OidcToken
|
6553 | */
|
6554 | OidcToken.fromObject = function fromObject(object) {
|
6555 | if (object instanceof $root.google.pubsub.v1.PushConfig.OidcToken)
|
6556 | return object;
|
6557 | var message = new $root.google.pubsub.v1.PushConfig.OidcToken();
|
6558 | if (object.serviceAccountEmail != null)
|
6559 | message.serviceAccountEmail = String(object.serviceAccountEmail);
|
6560 | if (object.audience != null)
|
6561 | message.audience = String(object.audience);
|
6562 | return message;
|
6563 | };
|
6564 |
|
6565 | /**
|
6566 | * Creates a plain object from an OidcToken message. Also converts values to other types if specified.
|
6567 | * @function toObject
|
6568 | * @memberof google.pubsub.v1.PushConfig.OidcToken
|
6569 | * @static
|
6570 | * @param {google.pubsub.v1.PushConfig.OidcToken} message OidcToken
|
6571 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
6572 | * @returns {Object.<string,*>} Plain object
|
6573 | */
|
6574 | OidcToken.toObject = function toObject(message, options) {
|
6575 | if (!options)
|
6576 | options = {};
|
6577 | var object = {};
|
6578 | if (options.defaults) {
|
6579 | object.serviceAccountEmail = "";
|
6580 | object.audience = "";
|
6581 | }
|
6582 | if (message.serviceAccountEmail != null && message.hasOwnProperty("serviceAccountEmail"))
|
6583 | object.serviceAccountEmail = message.serviceAccountEmail;
|
6584 | if (message.audience != null && message.hasOwnProperty("audience"))
|
6585 | object.audience = message.audience;
|
6586 | return object;
|
6587 | };
|
6588 |
|
6589 | /**
|
6590 | * Converts this OidcToken to JSON.
|
6591 | * @function toJSON
|
6592 | * @memberof google.pubsub.v1.PushConfig.OidcToken
|
6593 | * @instance
|
6594 | * @returns {Object.<string,*>} JSON object
|
6595 | */
|
6596 | OidcToken.prototype.toJSON = function toJSON() {
|
6597 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
6598 | };
|
6599 |
|
6600 | return OidcToken;
|
6601 | })();
|
6602 |
|
6603 | return PushConfig;
|
6604 | })();
|
6605 |
|
6606 | v1.BigQueryConfig = (function() {
|
6607 |
|
6608 | /**
|
6609 | * Properties of a BigQueryConfig.
|
6610 | * @memberof google.pubsub.v1
|
6611 | * @interface IBigQueryConfig
|
6612 | * @property {string|null} [table] BigQueryConfig table
|
6613 | * @property {boolean|null} [useTopicSchema] BigQueryConfig useTopicSchema
|
6614 | * @property {boolean|null} [writeMetadata] BigQueryConfig writeMetadata
|
6615 | * @property {boolean|null} [dropUnknownFields] BigQueryConfig dropUnknownFields
|
6616 | * @property {google.pubsub.v1.BigQueryConfig.State|null} [state] BigQueryConfig state
|
6617 | */
|
6618 |
|
6619 | /**
|
6620 | * Constructs a new BigQueryConfig.
|
6621 | * @memberof google.pubsub.v1
|
6622 | * @classdesc Represents a BigQueryConfig.
|
6623 | * @implements IBigQueryConfig
|
6624 | * @constructor
|
6625 | * @param {google.pubsub.v1.IBigQueryConfig=} [properties] Properties to set
|
6626 | */
|
6627 | function BigQueryConfig(properties) {
|
6628 | if (properties)
|
6629 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
6630 | if (properties[keys[i]] != null)
|
6631 | this[keys[i]] = properties[keys[i]];
|
6632 | }
|
6633 |
|
6634 | /**
|
6635 | * BigQueryConfig table.
|
6636 | * @member {string} table
|
6637 | * @memberof google.pubsub.v1.BigQueryConfig
|
6638 | * @instance
|
6639 | */
|
6640 | BigQueryConfig.prototype.table = "";
|
6641 |
|
6642 | /**
|
6643 | * BigQueryConfig useTopicSchema.
|
6644 | * @member {boolean} useTopicSchema
|
6645 | * @memberof google.pubsub.v1.BigQueryConfig
|
6646 | * @instance
|
6647 | */
|
6648 | BigQueryConfig.prototype.useTopicSchema = false;
|
6649 |
|
6650 | /**
|
6651 | * BigQueryConfig writeMetadata.
|
6652 | * @member {boolean} writeMetadata
|
6653 | * @memberof google.pubsub.v1.BigQueryConfig
|
6654 | * @instance
|
6655 | */
|
6656 | BigQueryConfig.prototype.writeMetadata = false;
|
6657 |
|
6658 | /**
|
6659 | * BigQueryConfig dropUnknownFields.
|
6660 | * @member {boolean} dropUnknownFields
|
6661 | * @memberof google.pubsub.v1.BigQueryConfig
|
6662 | * @instance
|
6663 | */
|
6664 | BigQueryConfig.prototype.dropUnknownFields = false;
|
6665 |
|
6666 | /**
|
6667 | * BigQueryConfig state.
|
6668 | * @member {google.pubsub.v1.BigQueryConfig.State} state
|
6669 | * @memberof google.pubsub.v1.BigQueryConfig
|
6670 | * @instance
|
6671 | */
|
6672 | BigQueryConfig.prototype.state = 0;
|
6673 |
|
6674 | /**
|
6675 | * Creates a new BigQueryConfig instance using the specified properties.
|
6676 | * @function create
|
6677 | * @memberof google.pubsub.v1.BigQueryConfig
|
6678 | * @static
|
6679 | * @param {google.pubsub.v1.IBigQueryConfig=} [properties] Properties to set
|
6680 | * @returns {google.pubsub.v1.BigQueryConfig} BigQueryConfig instance
|
6681 | */
|
6682 | BigQueryConfig.create = function create(properties) {
|
6683 | return new BigQueryConfig(properties);
|
6684 | };
|
6685 |
|
6686 | /**
|
6687 | * Encodes the specified BigQueryConfig message. Does not implicitly {@link google.pubsub.v1.BigQueryConfig.verify|verify} messages.
|
6688 | * @function encode
|
6689 | * @memberof google.pubsub.v1.BigQueryConfig
|
6690 | * @static
|
6691 | * @param {google.pubsub.v1.IBigQueryConfig} message BigQueryConfig message or plain object to encode
|
6692 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
6693 | * @returns {$protobuf.Writer} Writer
|
6694 | */
|
6695 | BigQueryConfig.encode = function encode(message, writer) {
|
6696 | if (!writer)
|
6697 | writer = $Writer.create();
|
6698 | if (message.table != null && Object.hasOwnProperty.call(message, "table"))
|
6699 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.table);
|
6700 | if (message.useTopicSchema != null && Object.hasOwnProperty.call(message, "useTopicSchema"))
|
6701 | writer.uint32(/* id 2, wireType 0 =*/16).bool(message.useTopicSchema);
|
6702 | if (message.writeMetadata != null && Object.hasOwnProperty.call(message, "writeMetadata"))
|
6703 | writer.uint32(/* id 3, wireType 0 =*/24).bool(message.writeMetadata);
|
6704 | if (message.dropUnknownFields != null && Object.hasOwnProperty.call(message, "dropUnknownFields"))
|
6705 | writer.uint32(/* id 4, wireType 0 =*/32).bool(message.dropUnknownFields);
|
6706 | if (message.state != null && Object.hasOwnProperty.call(message, "state"))
|
6707 | writer.uint32(/* id 5, wireType 0 =*/40).int32(message.state);
|
6708 | return writer;
|
6709 | };
|
6710 |
|
6711 | /**
|
6712 | * Encodes the specified BigQueryConfig message, length delimited. Does not implicitly {@link google.pubsub.v1.BigQueryConfig.verify|verify} messages.
|
6713 | * @function encodeDelimited
|
6714 | * @memberof google.pubsub.v1.BigQueryConfig
|
6715 | * @static
|
6716 | * @param {google.pubsub.v1.IBigQueryConfig} message BigQueryConfig message or plain object to encode
|
6717 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
6718 | * @returns {$protobuf.Writer} Writer
|
6719 | */
|
6720 | BigQueryConfig.encodeDelimited = function encodeDelimited(message, writer) {
|
6721 | return this.encode(message, writer).ldelim();
|
6722 | };
|
6723 |
|
6724 | /**
|
6725 | * Decodes a BigQueryConfig message from the specified reader or buffer.
|
6726 | * @function decode
|
6727 | * @memberof google.pubsub.v1.BigQueryConfig
|
6728 | * @static
|
6729 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
6730 | * @param {number} [length] Message length if known beforehand
|
6731 | * @returns {google.pubsub.v1.BigQueryConfig} BigQueryConfig
|
6732 | * @throws {Error} If the payload is not a reader or valid buffer
|
6733 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
6734 | */
|
6735 | BigQueryConfig.decode = function decode(reader, length) {
|
6736 | if (!(reader instanceof $Reader))
|
6737 | reader = $Reader.create(reader);
|
6738 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.BigQueryConfig();
|
6739 | while (reader.pos < end) {
|
6740 | var tag = reader.uint32();
|
6741 | switch (tag >>> 3) {
|
6742 | case 1:
|
6743 | message.table = reader.string();
|
6744 | break;
|
6745 | case 2:
|
6746 | message.useTopicSchema = reader.bool();
|
6747 | break;
|
6748 | case 3:
|
6749 | message.writeMetadata = reader.bool();
|
6750 | break;
|
6751 | case 4:
|
6752 | message.dropUnknownFields = reader.bool();
|
6753 | break;
|
6754 | case 5:
|
6755 | message.state = reader.int32();
|
6756 | break;
|
6757 | default:
|
6758 | reader.skipType(tag & 7);
|
6759 | break;
|
6760 | }
|
6761 | }
|
6762 | return message;
|
6763 | };
|
6764 |
|
6765 | /**
|
6766 | * Decodes a BigQueryConfig message from the specified reader or buffer, length delimited.
|
6767 | * @function decodeDelimited
|
6768 | * @memberof google.pubsub.v1.BigQueryConfig
|
6769 | * @static
|
6770 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
6771 | * @returns {google.pubsub.v1.BigQueryConfig} BigQueryConfig
|
6772 | * @throws {Error} If the payload is not a reader or valid buffer
|
6773 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
6774 | */
|
6775 | BigQueryConfig.decodeDelimited = function decodeDelimited(reader) {
|
6776 | if (!(reader instanceof $Reader))
|
6777 | reader = new $Reader(reader);
|
6778 | return this.decode(reader, reader.uint32());
|
6779 | };
|
6780 |
|
6781 | /**
|
6782 | * Verifies a BigQueryConfig message.
|
6783 | * @function verify
|
6784 | * @memberof google.pubsub.v1.BigQueryConfig
|
6785 | * @static
|
6786 | * @param {Object.<string,*>} message Plain object to verify
|
6787 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
6788 | */
|
6789 | BigQueryConfig.verify = function verify(message) {
|
6790 | if (typeof message !== "object" || message === null)
|
6791 | return "object expected";
|
6792 | if (message.table != null && message.hasOwnProperty("table"))
|
6793 | if (!$util.isString(message.table))
|
6794 | return "table: string expected";
|
6795 | if (message.useTopicSchema != null && message.hasOwnProperty("useTopicSchema"))
|
6796 | if (typeof message.useTopicSchema !== "boolean")
|
6797 | return "useTopicSchema: boolean expected";
|
6798 | if (message.writeMetadata != null && message.hasOwnProperty("writeMetadata"))
|
6799 | if (typeof message.writeMetadata !== "boolean")
|
6800 | return "writeMetadata: boolean expected";
|
6801 | if (message.dropUnknownFields != null && message.hasOwnProperty("dropUnknownFields"))
|
6802 | if (typeof message.dropUnknownFields !== "boolean")
|
6803 | return "dropUnknownFields: boolean expected";
|
6804 | if (message.state != null && message.hasOwnProperty("state"))
|
6805 | switch (message.state) {
|
6806 | default:
|
6807 | return "state: enum value expected";
|
6808 | case 0:
|
6809 | case 1:
|
6810 | case 2:
|
6811 | case 3:
|
6812 | case 4:
|
6813 | break;
|
6814 | }
|
6815 | return null;
|
6816 | };
|
6817 |
|
6818 | /**
|
6819 | * Creates a BigQueryConfig message from a plain object. Also converts values to their respective internal types.
|
6820 | * @function fromObject
|
6821 | * @memberof google.pubsub.v1.BigQueryConfig
|
6822 | * @static
|
6823 | * @param {Object.<string,*>} object Plain object
|
6824 | * @returns {google.pubsub.v1.BigQueryConfig} BigQueryConfig
|
6825 | */
|
6826 | BigQueryConfig.fromObject = function fromObject(object) {
|
6827 | if (object instanceof $root.google.pubsub.v1.BigQueryConfig)
|
6828 | return object;
|
6829 | var message = new $root.google.pubsub.v1.BigQueryConfig();
|
6830 | if (object.table != null)
|
6831 | message.table = String(object.table);
|
6832 | if (object.useTopicSchema != null)
|
6833 | message.useTopicSchema = Boolean(object.useTopicSchema);
|
6834 | if (object.writeMetadata != null)
|
6835 | message.writeMetadata = Boolean(object.writeMetadata);
|
6836 | if (object.dropUnknownFields != null)
|
6837 | message.dropUnknownFields = Boolean(object.dropUnknownFields);
|
6838 | switch (object.state) {
|
6839 | case "STATE_UNSPECIFIED":
|
6840 | case 0:
|
6841 | message.state = 0;
|
6842 | break;
|
6843 | case "ACTIVE":
|
6844 | case 1:
|
6845 | message.state = 1;
|
6846 | break;
|
6847 | case "PERMISSION_DENIED":
|
6848 | case 2:
|
6849 | message.state = 2;
|
6850 | break;
|
6851 | case "NOT_FOUND":
|
6852 | case 3:
|
6853 | message.state = 3;
|
6854 | break;
|
6855 | case "SCHEMA_MISMATCH":
|
6856 | case 4:
|
6857 | message.state = 4;
|
6858 | break;
|
6859 | }
|
6860 | return message;
|
6861 | };
|
6862 |
|
6863 | /**
|
6864 | * Creates a plain object from a BigQueryConfig message. Also converts values to other types if specified.
|
6865 | * @function toObject
|
6866 | * @memberof google.pubsub.v1.BigQueryConfig
|
6867 | * @static
|
6868 | * @param {google.pubsub.v1.BigQueryConfig} message BigQueryConfig
|
6869 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
6870 | * @returns {Object.<string,*>} Plain object
|
6871 | */
|
6872 | BigQueryConfig.toObject = function toObject(message, options) {
|
6873 | if (!options)
|
6874 | options = {};
|
6875 | var object = {};
|
6876 | if (options.defaults) {
|
6877 | object.table = "";
|
6878 | object.useTopicSchema = false;
|
6879 | object.writeMetadata = false;
|
6880 | object.dropUnknownFields = false;
|
6881 | object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0;
|
6882 | }
|
6883 | if (message.table != null && message.hasOwnProperty("table"))
|
6884 | object.table = message.table;
|
6885 | if (message.useTopicSchema != null && message.hasOwnProperty("useTopicSchema"))
|
6886 | object.useTopicSchema = message.useTopicSchema;
|
6887 | if (message.writeMetadata != null && message.hasOwnProperty("writeMetadata"))
|
6888 | object.writeMetadata = message.writeMetadata;
|
6889 | if (message.dropUnknownFields != null && message.hasOwnProperty("dropUnknownFields"))
|
6890 | object.dropUnknownFields = message.dropUnknownFields;
|
6891 | if (message.state != null && message.hasOwnProperty("state"))
|
6892 | object.state = options.enums === String ? $root.google.pubsub.v1.BigQueryConfig.State[message.state] : message.state;
|
6893 | return object;
|
6894 | };
|
6895 |
|
6896 | /**
|
6897 | * Converts this BigQueryConfig to JSON.
|
6898 | * @function toJSON
|
6899 | * @memberof google.pubsub.v1.BigQueryConfig
|
6900 | * @instance
|
6901 | * @returns {Object.<string,*>} JSON object
|
6902 | */
|
6903 | BigQueryConfig.prototype.toJSON = function toJSON() {
|
6904 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
6905 | };
|
6906 |
|
6907 | /**
|
6908 | * State enum.
|
6909 | * @name google.pubsub.v1.BigQueryConfig.State
|
6910 | * @enum {number}
|
6911 | * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value
|
6912 | * @property {number} ACTIVE=1 ACTIVE value
|
6913 | * @property {number} PERMISSION_DENIED=2 PERMISSION_DENIED value
|
6914 | * @property {number} NOT_FOUND=3 NOT_FOUND value
|
6915 | * @property {number} SCHEMA_MISMATCH=4 SCHEMA_MISMATCH value
|
6916 | */
|
6917 | BigQueryConfig.State = (function() {
|
6918 | var valuesById = {}, values = Object.create(valuesById);
|
6919 | values[valuesById[0] = "STATE_UNSPECIFIED"] = 0;
|
6920 | values[valuesById[1] = "ACTIVE"] = 1;
|
6921 | values[valuesById[2] = "PERMISSION_DENIED"] = 2;
|
6922 | values[valuesById[3] = "NOT_FOUND"] = 3;
|
6923 | values[valuesById[4] = "SCHEMA_MISMATCH"] = 4;
|
6924 | return values;
|
6925 | })();
|
6926 |
|
6927 | return BigQueryConfig;
|
6928 | })();
|
6929 |
|
6930 | v1.ReceivedMessage = (function() {
|
6931 |
|
6932 | /**
|
6933 | * Properties of a ReceivedMessage.
|
6934 | * @memberof google.pubsub.v1
|
6935 | * @interface IReceivedMessage
|
6936 | * @property {string|null} [ackId] ReceivedMessage ackId
|
6937 | * @property {google.pubsub.v1.IPubsubMessage|null} [message] ReceivedMessage message
|
6938 | * @property {number|null} [deliveryAttempt] ReceivedMessage deliveryAttempt
|
6939 | */
|
6940 |
|
6941 | /**
|
6942 | * Constructs a new ReceivedMessage.
|
6943 | * @memberof google.pubsub.v1
|
6944 | * @classdesc Represents a ReceivedMessage.
|
6945 | * @implements IReceivedMessage
|
6946 | * @constructor
|
6947 | * @param {google.pubsub.v1.IReceivedMessage=} [properties] Properties to set
|
6948 | */
|
6949 | function ReceivedMessage(properties) {
|
6950 | if (properties)
|
6951 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
6952 | if (properties[keys[i]] != null)
|
6953 | this[keys[i]] = properties[keys[i]];
|
6954 | }
|
6955 |
|
6956 | /**
|
6957 | * ReceivedMessage ackId.
|
6958 | * @member {string} ackId
|
6959 | * @memberof google.pubsub.v1.ReceivedMessage
|
6960 | * @instance
|
6961 | */
|
6962 | ReceivedMessage.prototype.ackId = "";
|
6963 |
|
6964 | /**
|
6965 | * ReceivedMessage message.
|
6966 | * @member {google.pubsub.v1.IPubsubMessage|null|undefined} message
|
6967 | * @memberof google.pubsub.v1.ReceivedMessage
|
6968 | * @instance
|
6969 | */
|
6970 | ReceivedMessage.prototype.message = null;
|
6971 |
|
6972 | /**
|
6973 | * ReceivedMessage deliveryAttempt.
|
6974 | * @member {number} deliveryAttempt
|
6975 | * @memberof google.pubsub.v1.ReceivedMessage
|
6976 | * @instance
|
6977 | */
|
6978 | ReceivedMessage.prototype.deliveryAttempt = 0;
|
6979 |
|
6980 | /**
|
6981 | * Creates a new ReceivedMessage instance using the specified properties.
|
6982 | * @function create
|
6983 | * @memberof google.pubsub.v1.ReceivedMessage
|
6984 | * @static
|
6985 | * @param {google.pubsub.v1.IReceivedMessage=} [properties] Properties to set
|
6986 | * @returns {google.pubsub.v1.ReceivedMessage} ReceivedMessage instance
|
6987 | */
|
6988 | ReceivedMessage.create = function create(properties) {
|
6989 | return new ReceivedMessage(properties);
|
6990 | };
|
6991 |
|
6992 | /**
|
6993 | * Encodes the specified ReceivedMessage message. Does not implicitly {@link google.pubsub.v1.ReceivedMessage.verify|verify} messages.
|
6994 | * @function encode
|
6995 | * @memberof google.pubsub.v1.ReceivedMessage
|
6996 | * @static
|
6997 | * @param {google.pubsub.v1.IReceivedMessage} message ReceivedMessage message or plain object to encode
|
6998 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
6999 | * @returns {$protobuf.Writer} Writer
|
7000 | */
|
7001 | ReceivedMessage.encode = function encode(message, writer) {
|
7002 | if (!writer)
|
7003 | writer = $Writer.create();
|
7004 | if (message.ackId != null && Object.hasOwnProperty.call(message, "ackId"))
|
7005 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.ackId);
|
7006 | if (message.message != null && Object.hasOwnProperty.call(message, "message"))
|
7007 | $root.google.pubsub.v1.PubsubMessage.encode(message.message, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
7008 | if (message.deliveryAttempt != null && Object.hasOwnProperty.call(message, "deliveryAttempt"))
|
7009 | writer.uint32(/* id 3, wireType 0 =*/24).int32(message.deliveryAttempt);
|
7010 | return writer;
|
7011 | };
|
7012 |
|
7013 | /**
|
7014 | * Encodes the specified ReceivedMessage message, length delimited. Does not implicitly {@link google.pubsub.v1.ReceivedMessage.verify|verify} messages.
|
7015 | * @function encodeDelimited
|
7016 | * @memberof google.pubsub.v1.ReceivedMessage
|
7017 | * @static
|
7018 | * @param {google.pubsub.v1.IReceivedMessage} message ReceivedMessage message or plain object to encode
|
7019 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
7020 | * @returns {$protobuf.Writer} Writer
|
7021 | */
|
7022 | ReceivedMessage.encodeDelimited = function encodeDelimited(message, writer) {
|
7023 | return this.encode(message, writer).ldelim();
|
7024 | };
|
7025 |
|
7026 | /**
|
7027 | * Decodes a ReceivedMessage message from the specified reader or buffer.
|
7028 | * @function decode
|
7029 | * @memberof google.pubsub.v1.ReceivedMessage
|
7030 | * @static
|
7031 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
7032 | * @param {number} [length] Message length if known beforehand
|
7033 | * @returns {google.pubsub.v1.ReceivedMessage} ReceivedMessage
|
7034 | * @throws {Error} If the payload is not a reader or valid buffer
|
7035 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
7036 | */
|
7037 | ReceivedMessage.decode = function decode(reader, length) {
|
7038 | if (!(reader instanceof $Reader))
|
7039 | reader = $Reader.create(reader);
|
7040 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.ReceivedMessage();
|
7041 | while (reader.pos < end) {
|
7042 | var tag = reader.uint32();
|
7043 | switch (tag >>> 3) {
|
7044 | case 1:
|
7045 | message.ackId = reader.string();
|
7046 | break;
|
7047 | case 2:
|
7048 | message.message = $root.google.pubsub.v1.PubsubMessage.decode(reader, reader.uint32());
|
7049 | break;
|
7050 | case 3:
|
7051 | message.deliveryAttempt = reader.int32();
|
7052 | break;
|
7053 | default:
|
7054 | reader.skipType(tag & 7);
|
7055 | break;
|
7056 | }
|
7057 | }
|
7058 | return message;
|
7059 | };
|
7060 |
|
7061 | /**
|
7062 | * Decodes a ReceivedMessage message from the specified reader or buffer, length delimited.
|
7063 | * @function decodeDelimited
|
7064 | * @memberof google.pubsub.v1.ReceivedMessage
|
7065 | * @static
|
7066 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
7067 | * @returns {google.pubsub.v1.ReceivedMessage} ReceivedMessage
|
7068 | * @throws {Error} If the payload is not a reader or valid buffer
|
7069 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
7070 | */
|
7071 | ReceivedMessage.decodeDelimited = function decodeDelimited(reader) {
|
7072 | if (!(reader instanceof $Reader))
|
7073 | reader = new $Reader(reader);
|
7074 | return this.decode(reader, reader.uint32());
|
7075 | };
|
7076 |
|
7077 | /**
|
7078 | * Verifies a ReceivedMessage message.
|
7079 | * @function verify
|
7080 | * @memberof google.pubsub.v1.ReceivedMessage
|
7081 | * @static
|
7082 | * @param {Object.<string,*>} message Plain object to verify
|
7083 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
7084 | */
|
7085 | ReceivedMessage.verify = function verify(message) {
|
7086 | if (typeof message !== "object" || message === null)
|
7087 | return "object expected";
|
7088 | if (message.ackId != null && message.hasOwnProperty("ackId"))
|
7089 | if (!$util.isString(message.ackId))
|
7090 | return "ackId: string expected";
|
7091 | if (message.message != null && message.hasOwnProperty("message")) {
|
7092 | var error = $root.google.pubsub.v1.PubsubMessage.verify(message.message);
|
7093 | if (error)
|
7094 | return "message." + error;
|
7095 | }
|
7096 | if (message.deliveryAttempt != null && message.hasOwnProperty("deliveryAttempt"))
|
7097 | if (!$util.isInteger(message.deliveryAttempt))
|
7098 | return "deliveryAttempt: integer expected";
|
7099 | return null;
|
7100 | };
|
7101 |
|
7102 | /**
|
7103 | * Creates a ReceivedMessage message from a plain object. Also converts values to their respective internal types.
|
7104 | * @function fromObject
|
7105 | * @memberof google.pubsub.v1.ReceivedMessage
|
7106 | * @static
|
7107 | * @param {Object.<string,*>} object Plain object
|
7108 | * @returns {google.pubsub.v1.ReceivedMessage} ReceivedMessage
|
7109 | */
|
7110 | ReceivedMessage.fromObject = function fromObject(object) {
|
7111 | if (object instanceof $root.google.pubsub.v1.ReceivedMessage)
|
7112 | return object;
|
7113 | var message = new $root.google.pubsub.v1.ReceivedMessage();
|
7114 | if (object.ackId != null)
|
7115 | message.ackId = String(object.ackId);
|
7116 | if (object.message != null) {
|
7117 | if (typeof object.message !== "object")
|
7118 | throw TypeError(".google.pubsub.v1.ReceivedMessage.message: object expected");
|
7119 | message.message = $root.google.pubsub.v1.PubsubMessage.fromObject(object.message);
|
7120 | }
|
7121 | if (object.deliveryAttempt != null)
|
7122 | message.deliveryAttempt = object.deliveryAttempt | 0;
|
7123 | return message;
|
7124 | };
|
7125 |
|
7126 | /**
|
7127 | * Creates a plain object from a ReceivedMessage message. Also converts values to other types if specified.
|
7128 | * @function toObject
|
7129 | * @memberof google.pubsub.v1.ReceivedMessage
|
7130 | * @static
|
7131 | * @param {google.pubsub.v1.ReceivedMessage} message ReceivedMessage
|
7132 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
7133 | * @returns {Object.<string,*>} Plain object
|
7134 | */
|
7135 | ReceivedMessage.toObject = function toObject(message, options) {
|
7136 | if (!options)
|
7137 | options = {};
|
7138 | var object = {};
|
7139 | if (options.defaults) {
|
7140 | object.ackId = "";
|
7141 | object.message = null;
|
7142 | object.deliveryAttempt = 0;
|
7143 | }
|
7144 | if (message.ackId != null && message.hasOwnProperty("ackId"))
|
7145 | object.ackId = message.ackId;
|
7146 | if (message.message != null && message.hasOwnProperty("message"))
|
7147 | object.message = $root.google.pubsub.v1.PubsubMessage.toObject(message.message, options);
|
7148 | if (message.deliveryAttempt != null && message.hasOwnProperty("deliveryAttempt"))
|
7149 | object.deliveryAttempt = message.deliveryAttempt;
|
7150 | return object;
|
7151 | };
|
7152 |
|
7153 | /**
|
7154 | * Converts this ReceivedMessage to JSON.
|
7155 | * @function toJSON
|
7156 | * @memberof google.pubsub.v1.ReceivedMessage
|
7157 | * @instance
|
7158 | * @returns {Object.<string,*>} JSON object
|
7159 | */
|
7160 | ReceivedMessage.prototype.toJSON = function toJSON() {
|
7161 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
7162 | };
|
7163 |
|
7164 | return ReceivedMessage;
|
7165 | })();
|
7166 |
|
7167 | v1.GetSubscriptionRequest = (function() {
|
7168 |
|
7169 | /**
|
7170 | * Properties of a GetSubscriptionRequest.
|
7171 | * @memberof google.pubsub.v1
|
7172 | * @interface IGetSubscriptionRequest
|
7173 | * @property {string|null} [subscription] GetSubscriptionRequest subscription
|
7174 | */
|
7175 |
|
7176 | /**
|
7177 | * Constructs a new GetSubscriptionRequest.
|
7178 | * @memberof google.pubsub.v1
|
7179 | * @classdesc Represents a GetSubscriptionRequest.
|
7180 | * @implements IGetSubscriptionRequest
|
7181 | * @constructor
|
7182 | * @param {google.pubsub.v1.IGetSubscriptionRequest=} [properties] Properties to set
|
7183 | */
|
7184 | function GetSubscriptionRequest(properties) {
|
7185 | if (properties)
|
7186 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
7187 | if (properties[keys[i]] != null)
|
7188 | this[keys[i]] = properties[keys[i]];
|
7189 | }
|
7190 |
|
7191 | /**
|
7192 | * GetSubscriptionRequest subscription.
|
7193 | * @member {string} subscription
|
7194 | * @memberof google.pubsub.v1.GetSubscriptionRequest
|
7195 | * @instance
|
7196 | */
|
7197 | GetSubscriptionRequest.prototype.subscription = "";
|
7198 |
|
7199 | /**
|
7200 | * Creates a new GetSubscriptionRequest instance using the specified properties.
|
7201 | * @function create
|
7202 | * @memberof google.pubsub.v1.GetSubscriptionRequest
|
7203 | * @static
|
7204 | * @param {google.pubsub.v1.IGetSubscriptionRequest=} [properties] Properties to set
|
7205 | * @returns {google.pubsub.v1.GetSubscriptionRequest} GetSubscriptionRequest instance
|
7206 | */
|
7207 | GetSubscriptionRequest.create = function create(properties) {
|
7208 | return new GetSubscriptionRequest(properties);
|
7209 | };
|
7210 |
|
7211 | /**
|
7212 | * Encodes the specified GetSubscriptionRequest message. Does not implicitly {@link google.pubsub.v1.GetSubscriptionRequest.verify|verify} messages.
|
7213 | * @function encode
|
7214 | * @memberof google.pubsub.v1.GetSubscriptionRequest
|
7215 | * @static
|
7216 | * @param {google.pubsub.v1.IGetSubscriptionRequest} message GetSubscriptionRequest message or plain object to encode
|
7217 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
7218 | * @returns {$protobuf.Writer} Writer
|
7219 | */
|
7220 | GetSubscriptionRequest.encode = function encode(message, writer) {
|
7221 | if (!writer)
|
7222 | writer = $Writer.create();
|
7223 | if (message.subscription != null && Object.hasOwnProperty.call(message, "subscription"))
|
7224 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.subscription);
|
7225 | return writer;
|
7226 | };
|
7227 |
|
7228 | /**
|
7229 | * Encodes the specified GetSubscriptionRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.GetSubscriptionRequest.verify|verify} messages.
|
7230 | * @function encodeDelimited
|
7231 | * @memberof google.pubsub.v1.GetSubscriptionRequest
|
7232 | * @static
|
7233 | * @param {google.pubsub.v1.IGetSubscriptionRequest} message GetSubscriptionRequest message or plain object to encode
|
7234 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
7235 | * @returns {$protobuf.Writer} Writer
|
7236 | */
|
7237 | GetSubscriptionRequest.encodeDelimited = function encodeDelimited(message, writer) {
|
7238 | return this.encode(message, writer).ldelim();
|
7239 | };
|
7240 |
|
7241 | /**
|
7242 | * Decodes a GetSubscriptionRequest message from the specified reader or buffer.
|
7243 | * @function decode
|
7244 | * @memberof google.pubsub.v1.GetSubscriptionRequest
|
7245 | * @static
|
7246 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
7247 | * @param {number} [length] Message length if known beforehand
|
7248 | * @returns {google.pubsub.v1.GetSubscriptionRequest} GetSubscriptionRequest
|
7249 | * @throws {Error} If the payload is not a reader or valid buffer
|
7250 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
7251 | */
|
7252 | GetSubscriptionRequest.decode = function decode(reader, length) {
|
7253 | if (!(reader instanceof $Reader))
|
7254 | reader = $Reader.create(reader);
|
7255 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.GetSubscriptionRequest();
|
7256 | while (reader.pos < end) {
|
7257 | var tag = reader.uint32();
|
7258 | switch (tag >>> 3) {
|
7259 | case 1:
|
7260 | message.subscription = reader.string();
|
7261 | break;
|
7262 | default:
|
7263 | reader.skipType(tag & 7);
|
7264 | break;
|
7265 | }
|
7266 | }
|
7267 | return message;
|
7268 | };
|
7269 |
|
7270 | /**
|
7271 | * Decodes a GetSubscriptionRequest message from the specified reader or buffer, length delimited.
|
7272 | * @function decodeDelimited
|
7273 | * @memberof google.pubsub.v1.GetSubscriptionRequest
|
7274 | * @static
|
7275 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
7276 | * @returns {google.pubsub.v1.GetSubscriptionRequest} GetSubscriptionRequest
|
7277 | * @throws {Error} If the payload is not a reader or valid buffer
|
7278 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
7279 | */
|
7280 | GetSubscriptionRequest.decodeDelimited = function decodeDelimited(reader) {
|
7281 | if (!(reader instanceof $Reader))
|
7282 | reader = new $Reader(reader);
|
7283 | return this.decode(reader, reader.uint32());
|
7284 | };
|
7285 |
|
7286 | /**
|
7287 | * Verifies a GetSubscriptionRequest message.
|
7288 | * @function verify
|
7289 | * @memberof google.pubsub.v1.GetSubscriptionRequest
|
7290 | * @static
|
7291 | * @param {Object.<string,*>} message Plain object to verify
|
7292 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
7293 | */
|
7294 | GetSubscriptionRequest.verify = function verify(message) {
|
7295 | if (typeof message !== "object" || message === null)
|
7296 | return "object expected";
|
7297 | if (message.subscription != null && message.hasOwnProperty("subscription"))
|
7298 | if (!$util.isString(message.subscription))
|
7299 | return "subscription: string expected";
|
7300 | return null;
|
7301 | };
|
7302 |
|
7303 | /**
|
7304 | * Creates a GetSubscriptionRequest message from a plain object. Also converts values to their respective internal types.
|
7305 | * @function fromObject
|
7306 | * @memberof google.pubsub.v1.GetSubscriptionRequest
|
7307 | * @static
|
7308 | * @param {Object.<string,*>} object Plain object
|
7309 | * @returns {google.pubsub.v1.GetSubscriptionRequest} GetSubscriptionRequest
|
7310 | */
|
7311 | GetSubscriptionRequest.fromObject = function fromObject(object) {
|
7312 | if (object instanceof $root.google.pubsub.v1.GetSubscriptionRequest)
|
7313 | return object;
|
7314 | var message = new $root.google.pubsub.v1.GetSubscriptionRequest();
|
7315 | if (object.subscription != null)
|
7316 | message.subscription = String(object.subscription);
|
7317 | return message;
|
7318 | };
|
7319 |
|
7320 | /**
|
7321 | * Creates a plain object from a GetSubscriptionRequest message. Also converts values to other types if specified.
|
7322 | * @function toObject
|
7323 | * @memberof google.pubsub.v1.GetSubscriptionRequest
|
7324 | * @static
|
7325 | * @param {google.pubsub.v1.GetSubscriptionRequest} message GetSubscriptionRequest
|
7326 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
7327 | * @returns {Object.<string,*>} Plain object
|
7328 | */
|
7329 | GetSubscriptionRequest.toObject = function toObject(message, options) {
|
7330 | if (!options)
|
7331 | options = {};
|
7332 | var object = {};
|
7333 | if (options.defaults)
|
7334 | object.subscription = "";
|
7335 | if (message.subscription != null && message.hasOwnProperty("subscription"))
|
7336 | object.subscription = message.subscription;
|
7337 | return object;
|
7338 | };
|
7339 |
|
7340 | /**
|
7341 | * Converts this GetSubscriptionRequest to JSON.
|
7342 | * @function toJSON
|
7343 | * @memberof google.pubsub.v1.GetSubscriptionRequest
|
7344 | * @instance
|
7345 | * @returns {Object.<string,*>} JSON object
|
7346 | */
|
7347 | GetSubscriptionRequest.prototype.toJSON = function toJSON() {
|
7348 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
7349 | };
|
7350 |
|
7351 | return GetSubscriptionRequest;
|
7352 | })();
|
7353 |
|
7354 | v1.UpdateSubscriptionRequest = (function() {
|
7355 |
|
7356 | /**
|
7357 | * Properties of an UpdateSubscriptionRequest.
|
7358 | * @memberof google.pubsub.v1
|
7359 | * @interface IUpdateSubscriptionRequest
|
7360 | * @property {google.pubsub.v1.ISubscription|null} [subscription] UpdateSubscriptionRequest subscription
|
7361 | * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSubscriptionRequest updateMask
|
7362 | */
|
7363 |
|
7364 | /**
|
7365 | * Constructs a new UpdateSubscriptionRequest.
|
7366 | * @memberof google.pubsub.v1
|
7367 | * @classdesc Represents an UpdateSubscriptionRequest.
|
7368 | * @implements IUpdateSubscriptionRequest
|
7369 | * @constructor
|
7370 | * @param {google.pubsub.v1.IUpdateSubscriptionRequest=} [properties] Properties to set
|
7371 | */
|
7372 | function UpdateSubscriptionRequest(properties) {
|
7373 | if (properties)
|
7374 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
7375 | if (properties[keys[i]] != null)
|
7376 | this[keys[i]] = properties[keys[i]];
|
7377 | }
|
7378 |
|
7379 | /**
|
7380 | * UpdateSubscriptionRequest subscription.
|
7381 | * @member {google.pubsub.v1.ISubscription|null|undefined} subscription
|
7382 | * @memberof google.pubsub.v1.UpdateSubscriptionRequest
|
7383 | * @instance
|
7384 | */
|
7385 | UpdateSubscriptionRequest.prototype.subscription = null;
|
7386 |
|
7387 | /**
|
7388 | * UpdateSubscriptionRequest updateMask.
|
7389 | * @member {google.protobuf.IFieldMask|null|undefined} updateMask
|
7390 | * @memberof google.pubsub.v1.UpdateSubscriptionRequest
|
7391 | * @instance
|
7392 | */
|
7393 | UpdateSubscriptionRequest.prototype.updateMask = null;
|
7394 |
|
7395 | /**
|
7396 | * Creates a new UpdateSubscriptionRequest instance using the specified properties.
|
7397 | * @function create
|
7398 | * @memberof google.pubsub.v1.UpdateSubscriptionRequest
|
7399 | * @static
|
7400 | * @param {google.pubsub.v1.IUpdateSubscriptionRequest=} [properties] Properties to set
|
7401 | * @returns {google.pubsub.v1.UpdateSubscriptionRequest} UpdateSubscriptionRequest instance
|
7402 | */
|
7403 | UpdateSubscriptionRequest.create = function create(properties) {
|
7404 | return new UpdateSubscriptionRequest(properties);
|
7405 | };
|
7406 |
|
7407 | /**
|
7408 | * Encodes the specified UpdateSubscriptionRequest message. Does not implicitly {@link google.pubsub.v1.UpdateSubscriptionRequest.verify|verify} messages.
|
7409 | * @function encode
|
7410 | * @memberof google.pubsub.v1.UpdateSubscriptionRequest
|
7411 | * @static
|
7412 | * @param {google.pubsub.v1.IUpdateSubscriptionRequest} message UpdateSubscriptionRequest message or plain object to encode
|
7413 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
7414 | * @returns {$protobuf.Writer} Writer
|
7415 | */
|
7416 | UpdateSubscriptionRequest.encode = function encode(message, writer) {
|
7417 | if (!writer)
|
7418 | writer = $Writer.create();
|
7419 | if (message.subscription != null && Object.hasOwnProperty.call(message, "subscription"))
|
7420 | $root.google.pubsub.v1.Subscription.encode(message.subscription, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
7421 | if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask"))
|
7422 | $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
7423 | return writer;
|
7424 | };
|
7425 |
|
7426 | /**
|
7427 | * Encodes the specified UpdateSubscriptionRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.UpdateSubscriptionRequest.verify|verify} messages.
|
7428 | * @function encodeDelimited
|
7429 | * @memberof google.pubsub.v1.UpdateSubscriptionRequest
|
7430 | * @static
|
7431 | * @param {google.pubsub.v1.IUpdateSubscriptionRequest} message UpdateSubscriptionRequest message or plain object to encode
|
7432 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
7433 | * @returns {$protobuf.Writer} Writer
|
7434 | */
|
7435 | UpdateSubscriptionRequest.encodeDelimited = function encodeDelimited(message, writer) {
|
7436 | return this.encode(message, writer).ldelim();
|
7437 | };
|
7438 |
|
7439 | /**
|
7440 | * Decodes an UpdateSubscriptionRequest message from the specified reader or buffer.
|
7441 | * @function decode
|
7442 | * @memberof google.pubsub.v1.UpdateSubscriptionRequest
|
7443 | * @static
|
7444 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
7445 | * @param {number} [length] Message length if known beforehand
|
7446 | * @returns {google.pubsub.v1.UpdateSubscriptionRequest} UpdateSubscriptionRequest
|
7447 | * @throws {Error} If the payload is not a reader or valid buffer
|
7448 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
7449 | */
|
7450 | UpdateSubscriptionRequest.decode = function decode(reader, length) {
|
7451 | if (!(reader instanceof $Reader))
|
7452 | reader = $Reader.create(reader);
|
7453 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.UpdateSubscriptionRequest();
|
7454 | while (reader.pos < end) {
|
7455 | var tag = reader.uint32();
|
7456 | switch (tag >>> 3) {
|
7457 | case 1:
|
7458 | message.subscription = $root.google.pubsub.v1.Subscription.decode(reader, reader.uint32());
|
7459 | break;
|
7460 | case 2:
|
7461 | message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32());
|
7462 | break;
|
7463 | default:
|
7464 | reader.skipType(tag & 7);
|
7465 | break;
|
7466 | }
|
7467 | }
|
7468 | return message;
|
7469 | };
|
7470 |
|
7471 | /**
|
7472 | * Decodes an UpdateSubscriptionRequest message from the specified reader or buffer, length delimited.
|
7473 | * @function decodeDelimited
|
7474 | * @memberof google.pubsub.v1.UpdateSubscriptionRequest
|
7475 | * @static
|
7476 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
7477 | * @returns {google.pubsub.v1.UpdateSubscriptionRequest} UpdateSubscriptionRequest
|
7478 | * @throws {Error} If the payload is not a reader or valid buffer
|
7479 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
7480 | */
|
7481 | UpdateSubscriptionRequest.decodeDelimited = function decodeDelimited(reader) {
|
7482 | if (!(reader instanceof $Reader))
|
7483 | reader = new $Reader(reader);
|
7484 | return this.decode(reader, reader.uint32());
|
7485 | };
|
7486 |
|
7487 | /**
|
7488 | * Verifies an UpdateSubscriptionRequest message.
|
7489 | * @function verify
|
7490 | * @memberof google.pubsub.v1.UpdateSubscriptionRequest
|
7491 | * @static
|
7492 | * @param {Object.<string,*>} message Plain object to verify
|
7493 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
7494 | */
|
7495 | UpdateSubscriptionRequest.verify = function verify(message) {
|
7496 | if (typeof message !== "object" || message === null)
|
7497 | return "object expected";
|
7498 | if (message.subscription != null && message.hasOwnProperty("subscription")) {
|
7499 | var error = $root.google.pubsub.v1.Subscription.verify(message.subscription);
|
7500 | if (error)
|
7501 | return "subscription." + error;
|
7502 | }
|
7503 | if (message.updateMask != null && message.hasOwnProperty("updateMask")) {
|
7504 | var error = $root.google.protobuf.FieldMask.verify(message.updateMask);
|
7505 | if (error)
|
7506 | return "updateMask." + error;
|
7507 | }
|
7508 | return null;
|
7509 | };
|
7510 |
|
7511 | /**
|
7512 | * Creates an UpdateSubscriptionRequest message from a plain object. Also converts values to their respective internal types.
|
7513 | * @function fromObject
|
7514 | * @memberof google.pubsub.v1.UpdateSubscriptionRequest
|
7515 | * @static
|
7516 | * @param {Object.<string,*>} object Plain object
|
7517 | * @returns {google.pubsub.v1.UpdateSubscriptionRequest} UpdateSubscriptionRequest
|
7518 | */
|
7519 | UpdateSubscriptionRequest.fromObject = function fromObject(object) {
|
7520 | if (object instanceof $root.google.pubsub.v1.UpdateSubscriptionRequest)
|
7521 | return object;
|
7522 | var message = new $root.google.pubsub.v1.UpdateSubscriptionRequest();
|
7523 | if (object.subscription != null) {
|
7524 | if (typeof object.subscription !== "object")
|
7525 | throw TypeError(".google.pubsub.v1.UpdateSubscriptionRequest.subscription: object expected");
|
7526 | message.subscription = $root.google.pubsub.v1.Subscription.fromObject(object.subscription);
|
7527 | }
|
7528 | if (object.updateMask != null) {
|
7529 | if (typeof object.updateMask !== "object")
|
7530 | throw TypeError(".google.pubsub.v1.UpdateSubscriptionRequest.updateMask: object expected");
|
7531 | message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask);
|
7532 | }
|
7533 | return message;
|
7534 | };
|
7535 |
|
7536 | /**
|
7537 | * Creates a plain object from an UpdateSubscriptionRequest message. Also converts values to other types if specified.
|
7538 | * @function toObject
|
7539 | * @memberof google.pubsub.v1.UpdateSubscriptionRequest
|
7540 | * @static
|
7541 | * @param {google.pubsub.v1.UpdateSubscriptionRequest} message UpdateSubscriptionRequest
|
7542 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
7543 | * @returns {Object.<string,*>} Plain object
|
7544 | */
|
7545 | UpdateSubscriptionRequest.toObject = function toObject(message, options) {
|
7546 | if (!options)
|
7547 | options = {};
|
7548 | var object = {};
|
7549 | if (options.defaults) {
|
7550 | object.subscription = null;
|
7551 | object.updateMask = null;
|
7552 | }
|
7553 | if (message.subscription != null && message.hasOwnProperty("subscription"))
|
7554 | object.subscription = $root.google.pubsub.v1.Subscription.toObject(message.subscription, options);
|
7555 | if (message.updateMask != null && message.hasOwnProperty("updateMask"))
|
7556 | object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options);
|
7557 | return object;
|
7558 | };
|
7559 |
|
7560 | /**
|
7561 | * Converts this UpdateSubscriptionRequest to JSON.
|
7562 | * @function toJSON
|
7563 | * @memberof google.pubsub.v1.UpdateSubscriptionRequest
|
7564 | * @instance
|
7565 | * @returns {Object.<string,*>} JSON object
|
7566 | */
|
7567 | UpdateSubscriptionRequest.prototype.toJSON = function toJSON() {
|
7568 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
7569 | };
|
7570 |
|
7571 | return UpdateSubscriptionRequest;
|
7572 | })();
|
7573 |
|
7574 | v1.ListSubscriptionsRequest = (function() {
|
7575 |
|
7576 | /**
|
7577 | * Properties of a ListSubscriptionsRequest.
|
7578 | * @memberof google.pubsub.v1
|
7579 | * @interface IListSubscriptionsRequest
|
7580 | * @property {string|null} [project] ListSubscriptionsRequest project
|
7581 | * @property {number|null} [pageSize] ListSubscriptionsRequest pageSize
|
7582 | * @property {string|null} [pageToken] ListSubscriptionsRequest pageToken
|
7583 | */
|
7584 |
|
7585 | /**
|
7586 | * Constructs a new ListSubscriptionsRequest.
|
7587 | * @memberof google.pubsub.v1
|
7588 | * @classdesc Represents a ListSubscriptionsRequest.
|
7589 | * @implements IListSubscriptionsRequest
|
7590 | * @constructor
|
7591 | * @param {google.pubsub.v1.IListSubscriptionsRequest=} [properties] Properties to set
|
7592 | */
|
7593 | function ListSubscriptionsRequest(properties) {
|
7594 | if (properties)
|
7595 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
7596 | if (properties[keys[i]] != null)
|
7597 | this[keys[i]] = properties[keys[i]];
|
7598 | }
|
7599 |
|
7600 | /**
|
7601 | * ListSubscriptionsRequest project.
|
7602 | * @member {string} project
|
7603 | * @memberof google.pubsub.v1.ListSubscriptionsRequest
|
7604 | * @instance
|
7605 | */
|
7606 | ListSubscriptionsRequest.prototype.project = "";
|
7607 |
|
7608 | /**
|
7609 | * ListSubscriptionsRequest pageSize.
|
7610 | * @member {number} pageSize
|
7611 | * @memberof google.pubsub.v1.ListSubscriptionsRequest
|
7612 | * @instance
|
7613 | */
|
7614 | ListSubscriptionsRequest.prototype.pageSize = 0;
|
7615 |
|
7616 | /**
|
7617 | * ListSubscriptionsRequest pageToken.
|
7618 | * @member {string} pageToken
|
7619 | * @memberof google.pubsub.v1.ListSubscriptionsRequest
|
7620 | * @instance
|
7621 | */
|
7622 | ListSubscriptionsRequest.prototype.pageToken = "";
|
7623 |
|
7624 | /**
|
7625 | * Creates a new ListSubscriptionsRequest instance using the specified properties.
|
7626 | * @function create
|
7627 | * @memberof google.pubsub.v1.ListSubscriptionsRequest
|
7628 | * @static
|
7629 | * @param {google.pubsub.v1.IListSubscriptionsRequest=} [properties] Properties to set
|
7630 | * @returns {google.pubsub.v1.ListSubscriptionsRequest} ListSubscriptionsRequest instance
|
7631 | */
|
7632 | ListSubscriptionsRequest.create = function create(properties) {
|
7633 | return new ListSubscriptionsRequest(properties);
|
7634 | };
|
7635 |
|
7636 | /**
|
7637 | * Encodes the specified ListSubscriptionsRequest message. Does not implicitly {@link google.pubsub.v1.ListSubscriptionsRequest.verify|verify} messages.
|
7638 | * @function encode
|
7639 | * @memberof google.pubsub.v1.ListSubscriptionsRequest
|
7640 | * @static
|
7641 | * @param {google.pubsub.v1.IListSubscriptionsRequest} message ListSubscriptionsRequest message or plain object to encode
|
7642 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
7643 | * @returns {$protobuf.Writer} Writer
|
7644 | */
|
7645 | ListSubscriptionsRequest.encode = function encode(message, writer) {
|
7646 | if (!writer)
|
7647 | writer = $Writer.create();
|
7648 | if (message.project != null && Object.hasOwnProperty.call(message, "project"))
|
7649 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.project);
|
7650 | if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize"))
|
7651 | writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize);
|
7652 | if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken"))
|
7653 | writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken);
|
7654 | return writer;
|
7655 | };
|
7656 |
|
7657 | /**
|
7658 | * Encodes the specified ListSubscriptionsRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ListSubscriptionsRequest.verify|verify} messages.
|
7659 | * @function encodeDelimited
|
7660 | * @memberof google.pubsub.v1.ListSubscriptionsRequest
|
7661 | * @static
|
7662 | * @param {google.pubsub.v1.IListSubscriptionsRequest} message ListSubscriptionsRequest message or plain object to encode
|
7663 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
7664 | * @returns {$protobuf.Writer} Writer
|
7665 | */
|
7666 | ListSubscriptionsRequest.encodeDelimited = function encodeDelimited(message, writer) {
|
7667 | return this.encode(message, writer).ldelim();
|
7668 | };
|
7669 |
|
7670 | /**
|
7671 | * Decodes a ListSubscriptionsRequest message from the specified reader or buffer.
|
7672 | * @function decode
|
7673 | * @memberof google.pubsub.v1.ListSubscriptionsRequest
|
7674 | * @static
|
7675 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
7676 | * @param {number} [length] Message length if known beforehand
|
7677 | * @returns {google.pubsub.v1.ListSubscriptionsRequest} ListSubscriptionsRequest
|
7678 | * @throws {Error} If the payload is not a reader or valid buffer
|
7679 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
7680 | */
|
7681 | ListSubscriptionsRequest.decode = function decode(reader, length) {
|
7682 | if (!(reader instanceof $Reader))
|
7683 | reader = $Reader.create(reader);
|
7684 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.ListSubscriptionsRequest();
|
7685 | while (reader.pos < end) {
|
7686 | var tag = reader.uint32();
|
7687 | switch (tag >>> 3) {
|
7688 | case 1:
|
7689 | message.project = reader.string();
|
7690 | break;
|
7691 | case 2:
|
7692 | message.pageSize = reader.int32();
|
7693 | break;
|
7694 | case 3:
|
7695 | message.pageToken = reader.string();
|
7696 | break;
|
7697 | default:
|
7698 | reader.skipType(tag & 7);
|
7699 | break;
|
7700 | }
|
7701 | }
|
7702 | return message;
|
7703 | };
|
7704 |
|
7705 | /**
|
7706 | * Decodes a ListSubscriptionsRequest message from the specified reader or buffer, length delimited.
|
7707 | * @function decodeDelimited
|
7708 | * @memberof google.pubsub.v1.ListSubscriptionsRequest
|
7709 | * @static
|
7710 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
7711 | * @returns {google.pubsub.v1.ListSubscriptionsRequest} ListSubscriptionsRequest
|
7712 | * @throws {Error} If the payload is not a reader or valid buffer
|
7713 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
7714 | */
|
7715 | ListSubscriptionsRequest.decodeDelimited = function decodeDelimited(reader) {
|
7716 | if (!(reader instanceof $Reader))
|
7717 | reader = new $Reader(reader);
|
7718 | return this.decode(reader, reader.uint32());
|
7719 | };
|
7720 |
|
7721 | /**
|
7722 | * Verifies a ListSubscriptionsRequest message.
|
7723 | * @function verify
|
7724 | * @memberof google.pubsub.v1.ListSubscriptionsRequest
|
7725 | * @static
|
7726 | * @param {Object.<string,*>} message Plain object to verify
|
7727 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
7728 | */
|
7729 | ListSubscriptionsRequest.verify = function verify(message) {
|
7730 | if (typeof message !== "object" || message === null)
|
7731 | return "object expected";
|
7732 | if (message.project != null && message.hasOwnProperty("project"))
|
7733 | if (!$util.isString(message.project))
|
7734 | return "project: string expected";
|
7735 | if (message.pageSize != null && message.hasOwnProperty("pageSize"))
|
7736 | if (!$util.isInteger(message.pageSize))
|
7737 | return "pageSize: integer expected";
|
7738 | if (message.pageToken != null && message.hasOwnProperty("pageToken"))
|
7739 | if (!$util.isString(message.pageToken))
|
7740 | return "pageToken: string expected";
|
7741 | return null;
|
7742 | };
|
7743 |
|
7744 | /**
|
7745 | * Creates a ListSubscriptionsRequest message from a plain object. Also converts values to their respective internal types.
|
7746 | * @function fromObject
|
7747 | * @memberof google.pubsub.v1.ListSubscriptionsRequest
|
7748 | * @static
|
7749 | * @param {Object.<string,*>} object Plain object
|
7750 | * @returns {google.pubsub.v1.ListSubscriptionsRequest} ListSubscriptionsRequest
|
7751 | */
|
7752 | ListSubscriptionsRequest.fromObject = function fromObject(object) {
|
7753 | if (object instanceof $root.google.pubsub.v1.ListSubscriptionsRequest)
|
7754 | return object;
|
7755 | var message = new $root.google.pubsub.v1.ListSubscriptionsRequest();
|
7756 | if (object.project != null)
|
7757 | message.project = String(object.project);
|
7758 | if (object.pageSize != null)
|
7759 | message.pageSize = object.pageSize | 0;
|
7760 | if (object.pageToken != null)
|
7761 | message.pageToken = String(object.pageToken);
|
7762 | return message;
|
7763 | };
|
7764 |
|
7765 | /**
|
7766 | * Creates a plain object from a ListSubscriptionsRequest message. Also converts values to other types if specified.
|
7767 | * @function toObject
|
7768 | * @memberof google.pubsub.v1.ListSubscriptionsRequest
|
7769 | * @static
|
7770 | * @param {google.pubsub.v1.ListSubscriptionsRequest} message ListSubscriptionsRequest
|
7771 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
7772 | * @returns {Object.<string,*>} Plain object
|
7773 | */
|
7774 | ListSubscriptionsRequest.toObject = function toObject(message, options) {
|
7775 | if (!options)
|
7776 | options = {};
|
7777 | var object = {};
|
7778 | if (options.defaults) {
|
7779 | object.project = "";
|
7780 | object.pageSize = 0;
|
7781 | object.pageToken = "";
|
7782 | }
|
7783 | if (message.project != null && message.hasOwnProperty("project"))
|
7784 | object.project = message.project;
|
7785 | if (message.pageSize != null && message.hasOwnProperty("pageSize"))
|
7786 | object.pageSize = message.pageSize;
|
7787 | if (message.pageToken != null && message.hasOwnProperty("pageToken"))
|
7788 | object.pageToken = message.pageToken;
|
7789 | return object;
|
7790 | };
|
7791 |
|
7792 | /**
|
7793 | * Converts this ListSubscriptionsRequest to JSON.
|
7794 | * @function toJSON
|
7795 | * @memberof google.pubsub.v1.ListSubscriptionsRequest
|
7796 | * @instance
|
7797 | * @returns {Object.<string,*>} JSON object
|
7798 | */
|
7799 | ListSubscriptionsRequest.prototype.toJSON = function toJSON() {
|
7800 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
7801 | };
|
7802 |
|
7803 | return ListSubscriptionsRequest;
|
7804 | })();
|
7805 |
|
7806 | v1.ListSubscriptionsResponse = (function() {
|
7807 |
|
7808 | /**
|
7809 | * Properties of a ListSubscriptionsResponse.
|
7810 | * @memberof google.pubsub.v1
|
7811 | * @interface IListSubscriptionsResponse
|
7812 | * @property {Array.<google.pubsub.v1.ISubscription>|null} [subscriptions] ListSubscriptionsResponse subscriptions
|
7813 | * @property {string|null} [nextPageToken] ListSubscriptionsResponse nextPageToken
|
7814 | */
|
7815 |
|
7816 | /**
|
7817 | * Constructs a new ListSubscriptionsResponse.
|
7818 | * @memberof google.pubsub.v1
|
7819 | * @classdesc Represents a ListSubscriptionsResponse.
|
7820 | * @implements IListSubscriptionsResponse
|
7821 | * @constructor
|
7822 | * @param {google.pubsub.v1.IListSubscriptionsResponse=} [properties] Properties to set
|
7823 | */
|
7824 | function ListSubscriptionsResponse(properties) {
|
7825 | this.subscriptions = [];
|
7826 | if (properties)
|
7827 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
7828 | if (properties[keys[i]] != null)
|
7829 | this[keys[i]] = properties[keys[i]];
|
7830 | }
|
7831 |
|
7832 | /**
|
7833 | * ListSubscriptionsResponse subscriptions.
|
7834 | * @member {Array.<google.pubsub.v1.ISubscription>} subscriptions
|
7835 | * @memberof google.pubsub.v1.ListSubscriptionsResponse
|
7836 | * @instance
|
7837 | */
|
7838 | ListSubscriptionsResponse.prototype.subscriptions = $util.emptyArray;
|
7839 |
|
7840 | /**
|
7841 | * ListSubscriptionsResponse nextPageToken.
|
7842 | * @member {string} nextPageToken
|
7843 | * @memberof google.pubsub.v1.ListSubscriptionsResponse
|
7844 | * @instance
|
7845 | */
|
7846 | ListSubscriptionsResponse.prototype.nextPageToken = "";
|
7847 |
|
7848 | /**
|
7849 | * Creates a new ListSubscriptionsResponse instance using the specified properties.
|
7850 | * @function create
|
7851 | * @memberof google.pubsub.v1.ListSubscriptionsResponse
|
7852 | * @static
|
7853 | * @param {google.pubsub.v1.IListSubscriptionsResponse=} [properties] Properties to set
|
7854 | * @returns {google.pubsub.v1.ListSubscriptionsResponse} ListSubscriptionsResponse instance
|
7855 | */
|
7856 | ListSubscriptionsResponse.create = function create(properties) {
|
7857 | return new ListSubscriptionsResponse(properties);
|
7858 | };
|
7859 |
|
7860 | /**
|
7861 | * Encodes the specified ListSubscriptionsResponse message. Does not implicitly {@link google.pubsub.v1.ListSubscriptionsResponse.verify|verify} messages.
|
7862 | * @function encode
|
7863 | * @memberof google.pubsub.v1.ListSubscriptionsResponse
|
7864 | * @static
|
7865 | * @param {google.pubsub.v1.IListSubscriptionsResponse} message ListSubscriptionsResponse message or plain object to encode
|
7866 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
7867 | * @returns {$protobuf.Writer} Writer
|
7868 | */
|
7869 | ListSubscriptionsResponse.encode = function encode(message, writer) {
|
7870 | if (!writer)
|
7871 | writer = $Writer.create();
|
7872 | if (message.subscriptions != null && message.subscriptions.length)
|
7873 | for (var i = 0; i < message.subscriptions.length; ++i)
|
7874 | $root.google.pubsub.v1.Subscription.encode(message.subscriptions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
7875 | if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken"))
|
7876 | writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken);
|
7877 | return writer;
|
7878 | };
|
7879 |
|
7880 | /**
|
7881 | * Encodes the specified ListSubscriptionsResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ListSubscriptionsResponse.verify|verify} messages.
|
7882 | * @function encodeDelimited
|
7883 | * @memberof google.pubsub.v1.ListSubscriptionsResponse
|
7884 | * @static
|
7885 | * @param {google.pubsub.v1.IListSubscriptionsResponse} message ListSubscriptionsResponse message or plain object to encode
|
7886 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
7887 | * @returns {$protobuf.Writer} Writer
|
7888 | */
|
7889 | ListSubscriptionsResponse.encodeDelimited = function encodeDelimited(message, writer) {
|
7890 | return this.encode(message, writer).ldelim();
|
7891 | };
|
7892 |
|
7893 | /**
|
7894 | * Decodes a ListSubscriptionsResponse message from the specified reader or buffer.
|
7895 | * @function decode
|
7896 | * @memberof google.pubsub.v1.ListSubscriptionsResponse
|
7897 | * @static
|
7898 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
7899 | * @param {number} [length] Message length if known beforehand
|
7900 | * @returns {google.pubsub.v1.ListSubscriptionsResponse} ListSubscriptionsResponse
|
7901 | * @throws {Error} If the payload is not a reader or valid buffer
|
7902 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
7903 | */
|
7904 | ListSubscriptionsResponse.decode = function decode(reader, length) {
|
7905 | if (!(reader instanceof $Reader))
|
7906 | reader = $Reader.create(reader);
|
7907 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.ListSubscriptionsResponse();
|
7908 | while (reader.pos < end) {
|
7909 | var tag = reader.uint32();
|
7910 | switch (tag >>> 3) {
|
7911 | case 1:
|
7912 | if (!(message.subscriptions && message.subscriptions.length))
|
7913 | message.subscriptions = [];
|
7914 | message.subscriptions.push($root.google.pubsub.v1.Subscription.decode(reader, reader.uint32()));
|
7915 | break;
|
7916 | case 2:
|
7917 | message.nextPageToken = reader.string();
|
7918 | break;
|
7919 | default:
|
7920 | reader.skipType(tag & 7);
|
7921 | break;
|
7922 | }
|
7923 | }
|
7924 | return message;
|
7925 | };
|
7926 |
|
7927 | /**
|
7928 | * Decodes a ListSubscriptionsResponse message from the specified reader or buffer, length delimited.
|
7929 | * @function decodeDelimited
|
7930 | * @memberof google.pubsub.v1.ListSubscriptionsResponse
|
7931 | * @static
|
7932 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
7933 | * @returns {google.pubsub.v1.ListSubscriptionsResponse} ListSubscriptionsResponse
|
7934 | * @throws {Error} If the payload is not a reader or valid buffer
|
7935 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
7936 | */
|
7937 | ListSubscriptionsResponse.decodeDelimited = function decodeDelimited(reader) {
|
7938 | if (!(reader instanceof $Reader))
|
7939 | reader = new $Reader(reader);
|
7940 | return this.decode(reader, reader.uint32());
|
7941 | };
|
7942 |
|
7943 | /**
|
7944 | * Verifies a ListSubscriptionsResponse message.
|
7945 | * @function verify
|
7946 | * @memberof google.pubsub.v1.ListSubscriptionsResponse
|
7947 | * @static
|
7948 | * @param {Object.<string,*>} message Plain object to verify
|
7949 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
7950 | */
|
7951 | ListSubscriptionsResponse.verify = function verify(message) {
|
7952 | if (typeof message !== "object" || message === null)
|
7953 | return "object expected";
|
7954 | if (message.subscriptions != null && message.hasOwnProperty("subscriptions")) {
|
7955 | if (!Array.isArray(message.subscriptions))
|
7956 | return "subscriptions: array expected";
|
7957 | for (var i = 0; i < message.subscriptions.length; ++i) {
|
7958 | var error = $root.google.pubsub.v1.Subscription.verify(message.subscriptions[i]);
|
7959 | if (error)
|
7960 | return "subscriptions." + error;
|
7961 | }
|
7962 | }
|
7963 | if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken"))
|
7964 | if (!$util.isString(message.nextPageToken))
|
7965 | return "nextPageToken: string expected";
|
7966 | return null;
|
7967 | };
|
7968 |
|
7969 | /**
|
7970 | * Creates a ListSubscriptionsResponse message from a plain object. Also converts values to their respective internal types.
|
7971 | * @function fromObject
|
7972 | * @memberof google.pubsub.v1.ListSubscriptionsResponse
|
7973 | * @static
|
7974 | * @param {Object.<string,*>} object Plain object
|
7975 | * @returns {google.pubsub.v1.ListSubscriptionsResponse} ListSubscriptionsResponse
|
7976 | */
|
7977 | ListSubscriptionsResponse.fromObject = function fromObject(object) {
|
7978 | if (object instanceof $root.google.pubsub.v1.ListSubscriptionsResponse)
|
7979 | return object;
|
7980 | var message = new $root.google.pubsub.v1.ListSubscriptionsResponse();
|
7981 | if (object.subscriptions) {
|
7982 | if (!Array.isArray(object.subscriptions))
|
7983 | throw TypeError(".google.pubsub.v1.ListSubscriptionsResponse.subscriptions: array expected");
|
7984 | message.subscriptions = [];
|
7985 | for (var i = 0; i < object.subscriptions.length; ++i) {
|
7986 | if (typeof object.subscriptions[i] !== "object")
|
7987 | throw TypeError(".google.pubsub.v1.ListSubscriptionsResponse.subscriptions: object expected");
|
7988 | message.subscriptions[i] = $root.google.pubsub.v1.Subscription.fromObject(object.subscriptions[i]);
|
7989 | }
|
7990 | }
|
7991 | if (object.nextPageToken != null)
|
7992 | message.nextPageToken = String(object.nextPageToken);
|
7993 | return message;
|
7994 | };
|
7995 |
|
7996 | /**
|
7997 | * Creates a plain object from a ListSubscriptionsResponse message. Also converts values to other types if specified.
|
7998 | * @function toObject
|
7999 | * @memberof google.pubsub.v1.ListSubscriptionsResponse
|
8000 | * @static
|
8001 | * @param {google.pubsub.v1.ListSubscriptionsResponse} message ListSubscriptionsResponse
|
8002 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
8003 | * @returns {Object.<string,*>} Plain object
|
8004 | */
|
8005 | ListSubscriptionsResponse.toObject = function toObject(message, options) {
|
8006 | if (!options)
|
8007 | options = {};
|
8008 | var object = {};
|
8009 | if (options.arrays || options.defaults)
|
8010 | object.subscriptions = [];
|
8011 | if (options.defaults)
|
8012 | object.nextPageToken = "";
|
8013 | if (message.subscriptions && message.subscriptions.length) {
|
8014 | object.subscriptions = [];
|
8015 | for (var j = 0; j < message.subscriptions.length; ++j)
|
8016 | object.subscriptions[j] = $root.google.pubsub.v1.Subscription.toObject(message.subscriptions[j], options);
|
8017 | }
|
8018 | if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken"))
|
8019 | object.nextPageToken = message.nextPageToken;
|
8020 | return object;
|
8021 | };
|
8022 |
|
8023 | /**
|
8024 | * Converts this ListSubscriptionsResponse to JSON.
|
8025 | * @function toJSON
|
8026 | * @memberof google.pubsub.v1.ListSubscriptionsResponse
|
8027 | * @instance
|
8028 | * @returns {Object.<string,*>} JSON object
|
8029 | */
|
8030 | ListSubscriptionsResponse.prototype.toJSON = function toJSON() {
|
8031 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
8032 | };
|
8033 |
|
8034 | return ListSubscriptionsResponse;
|
8035 | })();
|
8036 |
|
8037 | v1.DeleteSubscriptionRequest = (function() {
|
8038 |
|
8039 | /**
|
8040 | * Properties of a DeleteSubscriptionRequest.
|
8041 | * @memberof google.pubsub.v1
|
8042 | * @interface IDeleteSubscriptionRequest
|
8043 | * @property {string|null} [subscription] DeleteSubscriptionRequest subscription
|
8044 | */
|
8045 |
|
8046 | /**
|
8047 | * Constructs a new DeleteSubscriptionRequest.
|
8048 | * @memberof google.pubsub.v1
|
8049 | * @classdesc Represents a DeleteSubscriptionRequest.
|
8050 | * @implements IDeleteSubscriptionRequest
|
8051 | * @constructor
|
8052 | * @param {google.pubsub.v1.IDeleteSubscriptionRequest=} [properties] Properties to set
|
8053 | */
|
8054 | function DeleteSubscriptionRequest(properties) {
|
8055 | if (properties)
|
8056 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
8057 | if (properties[keys[i]] != null)
|
8058 | this[keys[i]] = properties[keys[i]];
|
8059 | }
|
8060 |
|
8061 | /**
|
8062 | * DeleteSubscriptionRequest subscription.
|
8063 | * @member {string} subscription
|
8064 | * @memberof google.pubsub.v1.DeleteSubscriptionRequest
|
8065 | * @instance
|
8066 | */
|
8067 | DeleteSubscriptionRequest.prototype.subscription = "";
|
8068 |
|
8069 | /**
|
8070 | * Creates a new DeleteSubscriptionRequest instance using the specified properties.
|
8071 | * @function create
|
8072 | * @memberof google.pubsub.v1.DeleteSubscriptionRequest
|
8073 | * @static
|
8074 | * @param {google.pubsub.v1.IDeleteSubscriptionRequest=} [properties] Properties to set
|
8075 | * @returns {google.pubsub.v1.DeleteSubscriptionRequest} DeleteSubscriptionRequest instance
|
8076 | */
|
8077 | DeleteSubscriptionRequest.create = function create(properties) {
|
8078 | return new DeleteSubscriptionRequest(properties);
|
8079 | };
|
8080 |
|
8081 | /**
|
8082 | * Encodes the specified DeleteSubscriptionRequest message. Does not implicitly {@link google.pubsub.v1.DeleteSubscriptionRequest.verify|verify} messages.
|
8083 | * @function encode
|
8084 | * @memberof google.pubsub.v1.DeleteSubscriptionRequest
|
8085 | * @static
|
8086 | * @param {google.pubsub.v1.IDeleteSubscriptionRequest} message DeleteSubscriptionRequest message or plain object to encode
|
8087 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
8088 | * @returns {$protobuf.Writer} Writer
|
8089 | */
|
8090 | DeleteSubscriptionRequest.encode = function encode(message, writer) {
|
8091 | if (!writer)
|
8092 | writer = $Writer.create();
|
8093 | if (message.subscription != null && Object.hasOwnProperty.call(message, "subscription"))
|
8094 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.subscription);
|
8095 | return writer;
|
8096 | };
|
8097 |
|
8098 | /**
|
8099 | * Encodes the specified DeleteSubscriptionRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.DeleteSubscriptionRequest.verify|verify} messages.
|
8100 | * @function encodeDelimited
|
8101 | * @memberof google.pubsub.v1.DeleteSubscriptionRequest
|
8102 | * @static
|
8103 | * @param {google.pubsub.v1.IDeleteSubscriptionRequest} message DeleteSubscriptionRequest message or plain object to encode
|
8104 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
8105 | * @returns {$protobuf.Writer} Writer
|
8106 | */
|
8107 | DeleteSubscriptionRequest.encodeDelimited = function encodeDelimited(message, writer) {
|
8108 | return this.encode(message, writer).ldelim();
|
8109 | };
|
8110 |
|
8111 | /**
|
8112 | * Decodes a DeleteSubscriptionRequest message from the specified reader or buffer.
|
8113 | * @function decode
|
8114 | * @memberof google.pubsub.v1.DeleteSubscriptionRequest
|
8115 | * @static
|
8116 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
8117 | * @param {number} [length] Message length if known beforehand
|
8118 | * @returns {google.pubsub.v1.DeleteSubscriptionRequest} DeleteSubscriptionRequest
|
8119 | * @throws {Error} If the payload is not a reader or valid buffer
|
8120 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
8121 | */
|
8122 | DeleteSubscriptionRequest.decode = function decode(reader, length) {
|
8123 | if (!(reader instanceof $Reader))
|
8124 | reader = $Reader.create(reader);
|
8125 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.DeleteSubscriptionRequest();
|
8126 | while (reader.pos < end) {
|
8127 | var tag = reader.uint32();
|
8128 | switch (tag >>> 3) {
|
8129 | case 1:
|
8130 | message.subscription = reader.string();
|
8131 | break;
|
8132 | default:
|
8133 | reader.skipType(tag & 7);
|
8134 | break;
|
8135 | }
|
8136 | }
|
8137 | return message;
|
8138 | };
|
8139 |
|
8140 | /**
|
8141 | * Decodes a DeleteSubscriptionRequest message from the specified reader or buffer, length delimited.
|
8142 | * @function decodeDelimited
|
8143 | * @memberof google.pubsub.v1.DeleteSubscriptionRequest
|
8144 | * @static
|
8145 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
8146 | * @returns {google.pubsub.v1.DeleteSubscriptionRequest} DeleteSubscriptionRequest
|
8147 | * @throws {Error} If the payload is not a reader or valid buffer
|
8148 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
8149 | */
|
8150 | DeleteSubscriptionRequest.decodeDelimited = function decodeDelimited(reader) {
|
8151 | if (!(reader instanceof $Reader))
|
8152 | reader = new $Reader(reader);
|
8153 | return this.decode(reader, reader.uint32());
|
8154 | };
|
8155 |
|
8156 | /**
|
8157 | * Verifies a DeleteSubscriptionRequest message.
|
8158 | * @function verify
|
8159 | * @memberof google.pubsub.v1.DeleteSubscriptionRequest
|
8160 | * @static
|
8161 | * @param {Object.<string,*>} message Plain object to verify
|
8162 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
8163 | */
|
8164 | DeleteSubscriptionRequest.verify = function verify(message) {
|
8165 | if (typeof message !== "object" || message === null)
|
8166 | return "object expected";
|
8167 | if (message.subscription != null && message.hasOwnProperty("subscription"))
|
8168 | if (!$util.isString(message.subscription))
|
8169 | return "subscription: string expected";
|
8170 | return null;
|
8171 | };
|
8172 |
|
8173 | /**
|
8174 | * Creates a DeleteSubscriptionRequest message from a plain object. Also converts values to their respective internal types.
|
8175 | * @function fromObject
|
8176 | * @memberof google.pubsub.v1.DeleteSubscriptionRequest
|
8177 | * @static
|
8178 | * @param {Object.<string,*>} object Plain object
|
8179 | * @returns {google.pubsub.v1.DeleteSubscriptionRequest} DeleteSubscriptionRequest
|
8180 | */
|
8181 | DeleteSubscriptionRequest.fromObject = function fromObject(object) {
|
8182 | if (object instanceof $root.google.pubsub.v1.DeleteSubscriptionRequest)
|
8183 | return object;
|
8184 | var message = new $root.google.pubsub.v1.DeleteSubscriptionRequest();
|
8185 | if (object.subscription != null)
|
8186 | message.subscription = String(object.subscription);
|
8187 | return message;
|
8188 | };
|
8189 |
|
8190 | /**
|
8191 | * Creates a plain object from a DeleteSubscriptionRequest message. Also converts values to other types if specified.
|
8192 | * @function toObject
|
8193 | * @memberof google.pubsub.v1.DeleteSubscriptionRequest
|
8194 | * @static
|
8195 | * @param {google.pubsub.v1.DeleteSubscriptionRequest} message DeleteSubscriptionRequest
|
8196 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
8197 | * @returns {Object.<string,*>} Plain object
|
8198 | */
|
8199 | DeleteSubscriptionRequest.toObject = function toObject(message, options) {
|
8200 | if (!options)
|
8201 | options = {};
|
8202 | var object = {};
|
8203 | if (options.defaults)
|
8204 | object.subscription = "";
|
8205 | if (message.subscription != null && message.hasOwnProperty("subscription"))
|
8206 | object.subscription = message.subscription;
|
8207 | return object;
|
8208 | };
|
8209 |
|
8210 | /**
|
8211 | * Converts this DeleteSubscriptionRequest to JSON.
|
8212 | * @function toJSON
|
8213 | * @memberof google.pubsub.v1.DeleteSubscriptionRequest
|
8214 | * @instance
|
8215 | * @returns {Object.<string,*>} JSON object
|
8216 | */
|
8217 | DeleteSubscriptionRequest.prototype.toJSON = function toJSON() {
|
8218 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
8219 | };
|
8220 |
|
8221 | return DeleteSubscriptionRequest;
|
8222 | })();
|
8223 |
|
8224 | v1.ModifyPushConfigRequest = (function() {
|
8225 |
|
8226 | /**
|
8227 | * Properties of a ModifyPushConfigRequest.
|
8228 | * @memberof google.pubsub.v1
|
8229 | * @interface IModifyPushConfigRequest
|
8230 | * @property {string|null} [subscription] ModifyPushConfigRequest subscription
|
8231 | * @property {google.pubsub.v1.IPushConfig|null} [pushConfig] ModifyPushConfigRequest pushConfig
|
8232 | */
|
8233 |
|
8234 | /**
|
8235 | * Constructs a new ModifyPushConfigRequest.
|
8236 | * @memberof google.pubsub.v1
|
8237 | * @classdesc Represents a ModifyPushConfigRequest.
|
8238 | * @implements IModifyPushConfigRequest
|
8239 | * @constructor
|
8240 | * @param {google.pubsub.v1.IModifyPushConfigRequest=} [properties] Properties to set
|
8241 | */
|
8242 | function ModifyPushConfigRequest(properties) {
|
8243 | if (properties)
|
8244 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
8245 | if (properties[keys[i]] != null)
|
8246 | this[keys[i]] = properties[keys[i]];
|
8247 | }
|
8248 |
|
8249 | /**
|
8250 | * ModifyPushConfigRequest subscription.
|
8251 | * @member {string} subscription
|
8252 | * @memberof google.pubsub.v1.ModifyPushConfigRequest
|
8253 | * @instance
|
8254 | */
|
8255 | ModifyPushConfigRequest.prototype.subscription = "";
|
8256 |
|
8257 | /**
|
8258 | * ModifyPushConfigRequest pushConfig.
|
8259 | * @member {google.pubsub.v1.IPushConfig|null|undefined} pushConfig
|
8260 | * @memberof google.pubsub.v1.ModifyPushConfigRequest
|
8261 | * @instance
|
8262 | */
|
8263 | ModifyPushConfigRequest.prototype.pushConfig = null;
|
8264 |
|
8265 | /**
|
8266 | * Creates a new ModifyPushConfigRequest instance using the specified properties.
|
8267 | * @function create
|
8268 | * @memberof google.pubsub.v1.ModifyPushConfigRequest
|
8269 | * @static
|
8270 | * @param {google.pubsub.v1.IModifyPushConfigRequest=} [properties] Properties to set
|
8271 | * @returns {google.pubsub.v1.ModifyPushConfigRequest} ModifyPushConfigRequest instance
|
8272 | */
|
8273 | ModifyPushConfigRequest.create = function create(properties) {
|
8274 | return new ModifyPushConfigRequest(properties);
|
8275 | };
|
8276 |
|
8277 | /**
|
8278 | * Encodes the specified ModifyPushConfigRequest message. Does not implicitly {@link google.pubsub.v1.ModifyPushConfigRequest.verify|verify} messages.
|
8279 | * @function encode
|
8280 | * @memberof google.pubsub.v1.ModifyPushConfigRequest
|
8281 | * @static
|
8282 | * @param {google.pubsub.v1.IModifyPushConfigRequest} message ModifyPushConfigRequest message or plain object to encode
|
8283 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
8284 | * @returns {$protobuf.Writer} Writer
|
8285 | */
|
8286 | ModifyPushConfigRequest.encode = function encode(message, writer) {
|
8287 | if (!writer)
|
8288 | writer = $Writer.create();
|
8289 | if (message.subscription != null && Object.hasOwnProperty.call(message, "subscription"))
|
8290 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.subscription);
|
8291 | if (message.pushConfig != null && Object.hasOwnProperty.call(message, "pushConfig"))
|
8292 | $root.google.pubsub.v1.PushConfig.encode(message.pushConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
8293 | return writer;
|
8294 | };
|
8295 |
|
8296 | /**
|
8297 | * Encodes the specified ModifyPushConfigRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ModifyPushConfigRequest.verify|verify} messages.
|
8298 | * @function encodeDelimited
|
8299 | * @memberof google.pubsub.v1.ModifyPushConfigRequest
|
8300 | * @static
|
8301 | * @param {google.pubsub.v1.IModifyPushConfigRequest} message ModifyPushConfigRequest message or plain object to encode
|
8302 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
8303 | * @returns {$protobuf.Writer} Writer
|
8304 | */
|
8305 | ModifyPushConfigRequest.encodeDelimited = function encodeDelimited(message, writer) {
|
8306 | return this.encode(message, writer).ldelim();
|
8307 | };
|
8308 |
|
8309 | /**
|
8310 | * Decodes a ModifyPushConfigRequest message from the specified reader or buffer.
|
8311 | * @function decode
|
8312 | * @memberof google.pubsub.v1.ModifyPushConfigRequest
|
8313 | * @static
|
8314 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
8315 | * @param {number} [length] Message length if known beforehand
|
8316 | * @returns {google.pubsub.v1.ModifyPushConfigRequest} ModifyPushConfigRequest
|
8317 | * @throws {Error} If the payload is not a reader or valid buffer
|
8318 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
8319 | */
|
8320 | ModifyPushConfigRequest.decode = function decode(reader, length) {
|
8321 | if (!(reader instanceof $Reader))
|
8322 | reader = $Reader.create(reader);
|
8323 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.ModifyPushConfigRequest();
|
8324 | while (reader.pos < end) {
|
8325 | var tag = reader.uint32();
|
8326 | switch (tag >>> 3) {
|
8327 | case 1:
|
8328 | message.subscription = reader.string();
|
8329 | break;
|
8330 | case 2:
|
8331 | message.pushConfig = $root.google.pubsub.v1.PushConfig.decode(reader, reader.uint32());
|
8332 | break;
|
8333 | default:
|
8334 | reader.skipType(tag & 7);
|
8335 | break;
|
8336 | }
|
8337 | }
|
8338 | return message;
|
8339 | };
|
8340 |
|
8341 | /**
|
8342 | * Decodes a ModifyPushConfigRequest message from the specified reader or buffer, length delimited.
|
8343 | * @function decodeDelimited
|
8344 | * @memberof google.pubsub.v1.ModifyPushConfigRequest
|
8345 | * @static
|
8346 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
8347 | * @returns {google.pubsub.v1.ModifyPushConfigRequest} ModifyPushConfigRequest
|
8348 | * @throws {Error} If the payload is not a reader or valid buffer
|
8349 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
8350 | */
|
8351 | ModifyPushConfigRequest.decodeDelimited = function decodeDelimited(reader) {
|
8352 | if (!(reader instanceof $Reader))
|
8353 | reader = new $Reader(reader);
|
8354 | return this.decode(reader, reader.uint32());
|
8355 | };
|
8356 |
|
8357 | /**
|
8358 | * Verifies a ModifyPushConfigRequest message.
|
8359 | * @function verify
|
8360 | * @memberof google.pubsub.v1.ModifyPushConfigRequest
|
8361 | * @static
|
8362 | * @param {Object.<string,*>} message Plain object to verify
|
8363 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
8364 | */
|
8365 | ModifyPushConfigRequest.verify = function verify(message) {
|
8366 | if (typeof message !== "object" || message === null)
|
8367 | return "object expected";
|
8368 | if (message.subscription != null && message.hasOwnProperty("subscription"))
|
8369 | if (!$util.isString(message.subscription))
|
8370 | return "subscription: string expected";
|
8371 | if (message.pushConfig != null && message.hasOwnProperty("pushConfig")) {
|
8372 | var error = $root.google.pubsub.v1.PushConfig.verify(message.pushConfig);
|
8373 | if (error)
|
8374 | return "pushConfig." + error;
|
8375 | }
|
8376 | return null;
|
8377 | };
|
8378 |
|
8379 | /**
|
8380 | * Creates a ModifyPushConfigRequest message from a plain object. Also converts values to their respective internal types.
|
8381 | * @function fromObject
|
8382 | * @memberof google.pubsub.v1.ModifyPushConfigRequest
|
8383 | * @static
|
8384 | * @param {Object.<string,*>} object Plain object
|
8385 | * @returns {google.pubsub.v1.ModifyPushConfigRequest} ModifyPushConfigRequest
|
8386 | */
|
8387 | ModifyPushConfigRequest.fromObject = function fromObject(object) {
|
8388 | if (object instanceof $root.google.pubsub.v1.ModifyPushConfigRequest)
|
8389 | return object;
|
8390 | var message = new $root.google.pubsub.v1.ModifyPushConfigRequest();
|
8391 | if (object.subscription != null)
|
8392 | message.subscription = String(object.subscription);
|
8393 | if (object.pushConfig != null) {
|
8394 | if (typeof object.pushConfig !== "object")
|
8395 | throw TypeError(".google.pubsub.v1.ModifyPushConfigRequest.pushConfig: object expected");
|
8396 | message.pushConfig = $root.google.pubsub.v1.PushConfig.fromObject(object.pushConfig);
|
8397 | }
|
8398 | return message;
|
8399 | };
|
8400 |
|
8401 | /**
|
8402 | * Creates a plain object from a ModifyPushConfigRequest message. Also converts values to other types if specified.
|
8403 | * @function toObject
|
8404 | * @memberof google.pubsub.v1.ModifyPushConfigRequest
|
8405 | * @static
|
8406 | * @param {google.pubsub.v1.ModifyPushConfigRequest} message ModifyPushConfigRequest
|
8407 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
8408 | * @returns {Object.<string,*>} Plain object
|
8409 | */
|
8410 | ModifyPushConfigRequest.toObject = function toObject(message, options) {
|
8411 | if (!options)
|
8412 | options = {};
|
8413 | var object = {};
|
8414 | if (options.defaults) {
|
8415 | object.subscription = "";
|
8416 | object.pushConfig = null;
|
8417 | }
|
8418 | if (message.subscription != null && message.hasOwnProperty("subscription"))
|
8419 | object.subscription = message.subscription;
|
8420 | if (message.pushConfig != null && message.hasOwnProperty("pushConfig"))
|
8421 | object.pushConfig = $root.google.pubsub.v1.PushConfig.toObject(message.pushConfig, options);
|
8422 | return object;
|
8423 | };
|
8424 |
|
8425 | /**
|
8426 | * Converts this ModifyPushConfigRequest to JSON.
|
8427 | * @function toJSON
|
8428 | * @memberof google.pubsub.v1.ModifyPushConfigRequest
|
8429 | * @instance
|
8430 | * @returns {Object.<string,*>} JSON object
|
8431 | */
|
8432 | ModifyPushConfigRequest.prototype.toJSON = function toJSON() {
|
8433 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
8434 | };
|
8435 |
|
8436 | return ModifyPushConfigRequest;
|
8437 | })();
|
8438 |
|
8439 | v1.PullRequest = (function() {
|
8440 |
|
8441 | /**
|
8442 | * Properties of a PullRequest.
|
8443 | * @memberof google.pubsub.v1
|
8444 | * @interface IPullRequest
|
8445 | * @property {string|null} [subscription] PullRequest subscription
|
8446 | * @property {boolean|null} [returnImmediately] PullRequest returnImmediately
|
8447 | * @property {number|null} [maxMessages] PullRequest maxMessages
|
8448 | */
|
8449 |
|
8450 | /**
|
8451 | * Constructs a new PullRequest.
|
8452 | * @memberof google.pubsub.v1
|
8453 | * @classdesc Represents a PullRequest.
|
8454 | * @implements IPullRequest
|
8455 | * @constructor
|
8456 | * @param {google.pubsub.v1.IPullRequest=} [properties] Properties to set
|
8457 | */
|
8458 | function PullRequest(properties) {
|
8459 | if (properties)
|
8460 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
8461 | if (properties[keys[i]] != null)
|
8462 | this[keys[i]] = properties[keys[i]];
|
8463 | }
|
8464 |
|
8465 | /**
|
8466 | * PullRequest subscription.
|
8467 | * @member {string} subscription
|
8468 | * @memberof google.pubsub.v1.PullRequest
|
8469 | * @instance
|
8470 | */
|
8471 | PullRequest.prototype.subscription = "";
|
8472 |
|
8473 | /**
|
8474 | * PullRequest returnImmediately.
|
8475 | * @member {boolean} returnImmediately
|
8476 | * @memberof google.pubsub.v1.PullRequest
|
8477 | * @instance
|
8478 | */
|
8479 | PullRequest.prototype.returnImmediately = false;
|
8480 |
|
8481 | /**
|
8482 | * PullRequest maxMessages.
|
8483 | * @member {number} maxMessages
|
8484 | * @memberof google.pubsub.v1.PullRequest
|
8485 | * @instance
|
8486 | */
|
8487 | PullRequest.prototype.maxMessages = 0;
|
8488 |
|
8489 | /**
|
8490 | * Creates a new PullRequest instance using the specified properties.
|
8491 | * @function create
|
8492 | * @memberof google.pubsub.v1.PullRequest
|
8493 | * @static
|
8494 | * @param {google.pubsub.v1.IPullRequest=} [properties] Properties to set
|
8495 | * @returns {google.pubsub.v1.PullRequest} PullRequest instance
|
8496 | */
|
8497 | PullRequest.create = function create(properties) {
|
8498 | return new PullRequest(properties);
|
8499 | };
|
8500 |
|
8501 | /**
|
8502 | * Encodes the specified PullRequest message. Does not implicitly {@link google.pubsub.v1.PullRequest.verify|verify} messages.
|
8503 | * @function encode
|
8504 | * @memberof google.pubsub.v1.PullRequest
|
8505 | * @static
|
8506 | * @param {google.pubsub.v1.IPullRequest} message PullRequest message or plain object to encode
|
8507 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
8508 | * @returns {$protobuf.Writer} Writer
|
8509 | */
|
8510 | PullRequest.encode = function encode(message, writer) {
|
8511 | if (!writer)
|
8512 | writer = $Writer.create();
|
8513 | if (message.subscription != null && Object.hasOwnProperty.call(message, "subscription"))
|
8514 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.subscription);
|
8515 | if (message.returnImmediately != null && Object.hasOwnProperty.call(message, "returnImmediately"))
|
8516 | writer.uint32(/* id 2, wireType 0 =*/16).bool(message.returnImmediately);
|
8517 | if (message.maxMessages != null && Object.hasOwnProperty.call(message, "maxMessages"))
|
8518 | writer.uint32(/* id 3, wireType 0 =*/24).int32(message.maxMessages);
|
8519 | return writer;
|
8520 | };
|
8521 |
|
8522 | /**
|
8523 | * Encodes the specified PullRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.PullRequest.verify|verify} messages.
|
8524 | * @function encodeDelimited
|
8525 | * @memberof google.pubsub.v1.PullRequest
|
8526 | * @static
|
8527 | * @param {google.pubsub.v1.IPullRequest} message PullRequest message or plain object to encode
|
8528 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
8529 | * @returns {$protobuf.Writer} Writer
|
8530 | */
|
8531 | PullRequest.encodeDelimited = function encodeDelimited(message, writer) {
|
8532 | return this.encode(message, writer).ldelim();
|
8533 | };
|
8534 |
|
8535 | /**
|
8536 | * Decodes a PullRequest message from the specified reader or buffer.
|
8537 | * @function decode
|
8538 | * @memberof google.pubsub.v1.PullRequest
|
8539 | * @static
|
8540 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
8541 | * @param {number} [length] Message length if known beforehand
|
8542 | * @returns {google.pubsub.v1.PullRequest} PullRequest
|
8543 | * @throws {Error} If the payload is not a reader or valid buffer
|
8544 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
8545 | */
|
8546 | PullRequest.decode = function decode(reader, length) {
|
8547 | if (!(reader instanceof $Reader))
|
8548 | reader = $Reader.create(reader);
|
8549 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.PullRequest();
|
8550 | while (reader.pos < end) {
|
8551 | var tag = reader.uint32();
|
8552 | switch (tag >>> 3) {
|
8553 | case 1:
|
8554 | message.subscription = reader.string();
|
8555 | break;
|
8556 | case 2:
|
8557 | message.returnImmediately = reader.bool();
|
8558 | break;
|
8559 | case 3:
|
8560 | message.maxMessages = reader.int32();
|
8561 | break;
|
8562 | default:
|
8563 | reader.skipType(tag & 7);
|
8564 | break;
|
8565 | }
|
8566 | }
|
8567 | return message;
|
8568 | };
|
8569 |
|
8570 | /**
|
8571 | * Decodes a PullRequest message from the specified reader or buffer, length delimited.
|
8572 | * @function decodeDelimited
|
8573 | * @memberof google.pubsub.v1.PullRequest
|
8574 | * @static
|
8575 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
8576 | * @returns {google.pubsub.v1.PullRequest} PullRequest
|
8577 | * @throws {Error} If the payload is not a reader or valid buffer
|
8578 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
8579 | */
|
8580 | PullRequest.decodeDelimited = function decodeDelimited(reader) {
|
8581 | if (!(reader instanceof $Reader))
|
8582 | reader = new $Reader(reader);
|
8583 | return this.decode(reader, reader.uint32());
|
8584 | };
|
8585 |
|
8586 | /**
|
8587 | * Verifies a PullRequest message.
|
8588 | * @function verify
|
8589 | * @memberof google.pubsub.v1.PullRequest
|
8590 | * @static
|
8591 | * @param {Object.<string,*>} message Plain object to verify
|
8592 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
8593 | */
|
8594 | PullRequest.verify = function verify(message) {
|
8595 | if (typeof message !== "object" || message === null)
|
8596 | return "object expected";
|
8597 | if (message.subscription != null && message.hasOwnProperty("subscription"))
|
8598 | if (!$util.isString(message.subscription))
|
8599 | return "subscription: string expected";
|
8600 | if (message.returnImmediately != null && message.hasOwnProperty("returnImmediately"))
|
8601 | if (typeof message.returnImmediately !== "boolean")
|
8602 | return "returnImmediately: boolean expected";
|
8603 | if (message.maxMessages != null && message.hasOwnProperty("maxMessages"))
|
8604 | if (!$util.isInteger(message.maxMessages))
|
8605 | return "maxMessages: integer expected";
|
8606 | return null;
|
8607 | };
|
8608 |
|
8609 | /**
|
8610 | * Creates a PullRequest message from a plain object. Also converts values to their respective internal types.
|
8611 | * @function fromObject
|
8612 | * @memberof google.pubsub.v1.PullRequest
|
8613 | * @static
|
8614 | * @param {Object.<string,*>} object Plain object
|
8615 | * @returns {google.pubsub.v1.PullRequest} PullRequest
|
8616 | */
|
8617 | PullRequest.fromObject = function fromObject(object) {
|
8618 | if (object instanceof $root.google.pubsub.v1.PullRequest)
|
8619 | return object;
|
8620 | var message = new $root.google.pubsub.v1.PullRequest();
|
8621 | if (object.subscription != null)
|
8622 | message.subscription = String(object.subscription);
|
8623 | if (object.returnImmediately != null)
|
8624 | message.returnImmediately = Boolean(object.returnImmediately);
|
8625 | if (object.maxMessages != null)
|
8626 | message.maxMessages = object.maxMessages | 0;
|
8627 | return message;
|
8628 | };
|
8629 |
|
8630 | /**
|
8631 | * Creates a plain object from a PullRequest message. Also converts values to other types if specified.
|
8632 | * @function toObject
|
8633 | * @memberof google.pubsub.v1.PullRequest
|
8634 | * @static
|
8635 | * @param {google.pubsub.v1.PullRequest} message PullRequest
|
8636 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
8637 | * @returns {Object.<string,*>} Plain object
|
8638 | */
|
8639 | PullRequest.toObject = function toObject(message, options) {
|
8640 | if (!options)
|
8641 | options = {};
|
8642 | var object = {};
|
8643 | if (options.defaults) {
|
8644 | object.subscription = "";
|
8645 | object.returnImmediately = false;
|
8646 | object.maxMessages = 0;
|
8647 | }
|
8648 | if (message.subscription != null && message.hasOwnProperty("subscription"))
|
8649 | object.subscription = message.subscription;
|
8650 | if (message.returnImmediately != null && message.hasOwnProperty("returnImmediately"))
|
8651 | object.returnImmediately = message.returnImmediately;
|
8652 | if (message.maxMessages != null && message.hasOwnProperty("maxMessages"))
|
8653 | object.maxMessages = message.maxMessages;
|
8654 | return object;
|
8655 | };
|
8656 |
|
8657 | /**
|
8658 | * Converts this PullRequest to JSON.
|
8659 | * @function toJSON
|
8660 | * @memberof google.pubsub.v1.PullRequest
|
8661 | * @instance
|
8662 | * @returns {Object.<string,*>} JSON object
|
8663 | */
|
8664 | PullRequest.prototype.toJSON = function toJSON() {
|
8665 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
8666 | };
|
8667 |
|
8668 | return PullRequest;
|
8669 | })();
|
8670 |
|
8671 | v1.PullResponse = (function() {
|
8672 |
|
8673 | /**
|
8674 | * Properties of a PullResponse.
|
8675 | * @memberof google.pubsub.v1
|
8676 | * @interface IPullResponse
|
8677 | * @property {Array.<google.pubsub.v1.IReceivedMessage>|null} [receivedMessages] PullResponse receivedMessages
|
8678 | */
|
8679 |
|
8680 | /**
|
8681 | * Constructs a new PullResponse.
|
8682 | * @memberof google.pubsub.v1
|
8683 | * @classdesc Represents a PullResponse.
|
8684 | * @implements IPullResponse
|
8685 | * @constructor
|
8686 | * @param {google.pubsub.v1.IPullResponse=} [properties] Properties to set
|
8687 | */
|
8688 | function PullResponse(properties) {
|
8689 | this.receivedMessages = [];
|
8690 | if (properties)
|
8691 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
8692 | if (properties[keys[i]] != null)
|
8693 | this[keys[i]] = properties[keys[i]];
|
8694 | }
|
8695 |
|
8696 | /**
|
8697 | * PullResponse receivedMessages.
|
8698 | * @member {Array.<google.pubsub.v1.IReceivedMessage>} receivedMessages
|
8699 | * @memberof google.pubsub.v1.PullResponse
|
8700 | * @instance
|
8701 | */
|
8702 | PullResponse.prototype.receivedMessages = $util.emptyArray;
|
8703 |
|
8704 | /**
|
8705 | * Creates a new PullResponse instance using the specified properties.
|
8706 | * @function create
|
8707 | * @memberof google.pubsub.v1.PullResponse
|
8708 | * @static
|
8709 | * @param {google.pubsub.v1.IPullResponse=} [properties] Properties to set
|
8710 | * @returns {google.pubsub.v1.PullResponse} PullResponse instance
|
8711 | */
|
8712 | PullResponse.create = function create(properties) {
|
8713 | return new PullResponse(properties);
|
8714 | };
|
8715 |
|
8716 | /**
|
8717 | * Encodes the specified PullResponse message. Does not implicitly {@link google.pubsub.v1.PullResponse.verify|verify} messages.
|
8718 | * @function encode
|
8719 | * @memberof google.pubsub.v1.PullResponse
|
8720 | * @static
|
8721 | * @param {google.pubsub.v1.IPullResponse} message PullResponse message or plain object to encode
|
8722 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
8723 | * @returns {$protobuf.Writer} Writer
|
8724 | */
|
8725 | PullResponse.encode = function encode(message, writer) {
|
8726 | if (!writer)
|
8727 | writer = $Writer.create();
|
8728 | if (message.receivedMessages != null && message.receivedMessages.length)
|
8729 | for (var i = 0; i < message.receivedMessages.length; ++i)
|
8730 | $root.google.pubsub.v1.ReceivedMessage.encode(message.receivedMessages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
8731 | return writer;
|
8732 | };
|
8733 |
|
8734 | /**
|
8735 | * Encodes the specified PullResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.PullResponse.verify|verify} messages.
|
8736 | * @function encodeDelimited
|
8737 | * @memberof google.pubsub.v1.PullResponse
|
8738 | * @static
|
8739 | * @param {google.pubsub.v1.IPullResponse} message PullResponse message or plain object to encode
|
8740 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
8741 | * @returns {$protobuf.Writer} Writer
|
8742 | */
|
8743 | PullResponse.encodeDelimited = function encodeDelimited(message, writer) {
|
8744 | return this.encode(message, writer).ldelim();
|
8745 | };
|
8746 |
|
8747 | /**
|
8748 | * Decodes a PullResponse message from the specified reader or buffer.
|
8749 | * @function decode
|
8750 | * @memberof google.pubsub.v1.PullResponse
|
8751 | * @static
|
8752 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
8753 | * @param {number} [length] Message length if known beforehand
|
8754 | * @returns {google.pubsub.v1.PullResponse} PullResponse
|
8755 | * @throws {Error} If the payload is not a reader or valid buffer
|
8756 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
8757 | */
|
8758 | PullResponse.decode = function decode(reader, length) {
|
8759 | if (!(reader instanceof $Reader))
|
8760 | reader = $Reader.create(reader);
|
8761 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.PullResponse();
|
8762 | while (reader.pos < end) {
|
8763 | var tag = reader.uint32();
|
8764 | switch (tag >>> 3) {
|
8765 | case 1:
|
8766 | if (!(message.receivedMessages && message.receivedMessages.length))
|
8767 | message.receivedMessages = [];
|
8768 | message.receivedMessages.push($root.google.pubsub.v1.ReceivedMessage.decode(reader, reader.uint32()));
|
8769 | break;
|
8770 | default:
|
8771 | reader.skipType(tag & 7);
|
8772 | break;
|
8773 | }
|
8774 | }
|
8775 | return message;
|
8776 | };
|
8777 |
|
8778 | /**
|
8779 | * Decodes a PullResponse message from the specified reader or buffer, length delimited.
|
8780 | * @function decodeDelimited
|
8781 | * @memberof google.pubsub.v1.PullResponse
|
8782 | * @static
|
8783 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
8784 | * @returns {google.pubsub.v1.PullResponse} PullResponse
|
8785 | * @throws {Error} If the payload is not a reader or valid buffer
|
8786 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
8787 | */
|
8788 | PullResponse.decodeDelimited = function decodeDelimited(reader) {
|
8789 | if (!(reader instanceof $Reader))
|
8790 | reader = new $Reader(reader);
|
8791 | return this.decode(reader, reader.uint32());
|
8792 | };
|
8793 |
|
8794 | /**
|
8795 | * Verifies a PullResponse message.
|
8796 | * @function verify
|
8797 | * @memberof google.pubsub.v1.PullResponse
|
8798 | * @static
|
8799 | * @param {Object.<string,*>} message Plain object to verify
|
8800 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
8801 | */
|
8802 | PullResponse.verify = function verify(message) {
|
8803 | if (typeof message !== "object" || message === null)
|
8804 | return "object expected";
|
8805 | if (message.receivedMessages != null && message.hasOwnProperty("receivedMessages")) {
|
8806 | if (!Array.isArray(message.receivedMessages))
|
8807 | return "receivedMessages: array expected";
|
8808 | for (var i = 0; i < message.receivedMessages.length; ++i) {
|
8809 | var error = $root.google.pubsub.v1.ReceivedMessage.verify(message.receivedMessages[i]);
|
8810 | if (error)
|
8811 | return "receivedMessages." + error;
|
8812 | }
|
8813 | }
|
8814 | return null;
|
8815 | };
|
8816 |
|
8817 | /**
|
8818 | * Creates a PullResponse message from a plain object. Also converts values to their respective internal types.
|
8819 | * @function fromObject
|
8820 | * @memberof google.pubsub.v1.PullResponse
|
8821 | * @static
|
8822 | * @param {Object.<string,*>} object Plain object
|
8823 | * @returns {google.pubsub.v1.PullResponse} PullResponse
|
8824 | */
|
8825 | PullResponse.fromObject = function fromObject(object) {
|
8826 | if (object instanceof $root.google.pubsub.v1.PullResponse)
|
8827 | return object;
|
8828 | var message = new $root.google.pubsub.v1.PullResponse();
|
8829 | if (object.receivedMessages) {
|
8830 | if (!Array.isArray(object.receivedMessages))
|
8831 | throw TypeError(".google.pubsub.v1.PullResponse.receivedMessages: array expected");
|
8832 | message.receivedMessages = [];
|
8833 | for (var i = 0; i < object.receivedMessages.length; ++i) {
|
8834 | if (typeof object.receivedMessages[i] !== "object")
|
8835 | throw TypeError(".google.pubsub.v1.PullResponse.receivedMessages: object expected");
|
8836 | message.receivedMessages[i] = $root.google.pubsub.v1.ReceivedMessage.fromObject(object.receivedMessages[i]);
|
8837 | }
|
8838 | }
|
8839 | return message;
|
8840 | };
|
8841 |
|
8842 | /**
|
8843 | * Creates a plain object from a PullResponse message. Also converts values to other types if specified.
|
8844 | * @function toObject
|
8845 | * @memberof google.pubsub.v1.PullResponse
|
8846 | * @static
|
8847 | * @param {google.pubsub.v1.PullResponse} message PullResponse
|
8848 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
8849 | * @returns {Object.<string,*>} Plain object
|
8850 | */
|
8851 | PullResponse.toObject = function toObject(message, options) {
|
8852 | if (!options)
|
8853 | options = {};
|
8854 | var object = {};
|
8855 | if (options.arrays || options.defaults)
|
8856 | object.receivedMessages = [];
|
8857 | if (message.receivedMessages && message.receivedMessages.length) {
|
8858 | object.receivedMessages = [];
|
8859 | for (var j = 0; j < message.receivedMessages.length; ++j)
|
8860 | object.receivedMessages[j] = $root.google.pubsub.v1.ReceivedMessage.toObject(message.receivedMessages[j], options);
|
8861 | }
|
8862 | return object;
|
8863 | };
|
8864 |
|
8865 | /**
|
8866 | * Converts this PullResponse to JSON.
|
8867 | * @function toJSON
|
8868 | * @memberof google.pubsub.v1.PullResponse
|
8869 | * @instance
|
8870 | * @returns {Object.<string,*>} JSON object
|
8871 | */
|
8872 | PullResponse.prototype.toJSON = function toJSON() {
|
8873 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
8874 | };
|
8875 |
|
8876 | return PullResponse;
|
8877 | })();
|
8878 |
|
8879 | v1.ModifyAckDeadlineRequest = (function() {
|
8880 |
|
8881 | /**
|
8882 | * Properties of a ModifyAckDeadlineRequest.
|
8883 | * @memberof google.pubsub.v1
|
8884 | * @interface IModifyAckDeadlineRequest
|
8885 | * @property {string|null} [subscription] ModifyAckDeadlineRequest subscription
|
8886 | * @property {Array.<string>|null} [ackIds] ModifyAckDeadlineRequest ackIds
|
8887 | * @property {number|null} [ackDeadlineSeconds] ModifyAckDeadlineRequest ackDeadlineSeconds
|
8888 | */
|
8889 |
|
8890 | /**
|
8891 | * Constructs a new ModifyAckDeadlineRequest.
|
8892 | * @memberof google.pubsub.v1
|
8893 | * @classdesc Represents a ModifyAckDeadlineRequest.
|
8894 | * @implements IModifyAckDeadlineRequest
|
8895 | * @constructor
|
8896 | * @param {google.pubsub.v1.IModifyAckDeadlineRequest=} [properties] Properties to set
|
8897 | */
|
8898 | function ModifyAckDeadlineRequest(properties) {
|
8899 | this.ackIds = [];
|
8900 | if (properties)
|
8901 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
8902 | if (properties[keys[i]] != null)
|
8903 | this[keys[i]] = properties[keys[i]];
|
8904 | }
|
8905 |
|
8906 | /**
|
8907 | * ModifyAckDeadlineRequest subscription.
|
8908 | * @member {string} subscription
|
8909 | * @memberof google.pubsub.v1.ModifyAckDeadlineRequest
|
8910 | * @instance
|
8911 | */
|
8912 | ModifyAckDeadlineRequest.prototype.subscription = "";
|
8913 |
|
8914 | /**
|
8915 | * ModifyAckDeadlineRequest ackIds.
|
8916 | * @member {Array.<string>} ackIds
|
8917 | * @memberof google.pubsub.v1.ModifyAckDeadlineRequest
|
8918 | * @instance
|
8919 | */
|
8920 | ModifyAckDeadlineRequest.prototype.ackIds = $util.emptyArray;
|
8921 |
|
8922 | /**
|
8923 | * ModifyAckDeadlineRequest ackDeadlineSeconds.
|
8924 | * @member {number} ackDeadlineSeconds
|
8925 | * @memberof google.pubsub.v1.ModifyAckDeadlineRequest
|
8926 | * @instance
|
8927 | */
|
8928 | ModifyAckDeadlineRequest.prototype.ackDeadlineSeconds = 0;
|
8929 |
|
8930 | /**
|
8931 | * Creates a new ModifyAckDeadlineRequest instance using the specified properties.
|
8932 | * @function create
|
8933 | * @memberof google.pubsub.v1.ModifyAckDeadlineRequest
|
8934 | * @static
|
8935 | * @param {google.pubsub.v1.IModifyAckDeadlineRequest=} [properties] Properties to set
|
8936 | * @returns {google.pubsub.v1.ModifyAckDeadlineRequest} ModifyAckDeadlineRequest instance
|
8937 | */
|
8938 | ModifyAckDeadlineRequest.create = function create(properties) {
|
8939 | return new ModifyAckDeadlineRequest(properties);
|
8940 | };
|
8941 |
|
8942 | /**
|
8943 | * Encodes the specified ModifyAckDeadlineRequest message. Does not implicitly {@link google.pubsub.v1.ModifyAckDeadlineRequest.verify|verify} messages.
|
8944 | * @function encode
|
8945 | * @memberof google.pubsub.v1.ModifyAckDeadlineRequest
|
8946 | * @static
|
8947 | * @param {google.pubsub.v1.IModifyAckDeadlineRequest} message ModifyAckDeadlineRequest message or plain object to encode
|
8948 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
8949 | * @returns {$protobuf.Writer} Writer
|
8950 | */
|
8951 | ModifyAckDeadlineRequest.encode = function encode(message, writer) {
|
8952 | if (!writer)
|
8953 | writer = $Writer.create();
|
8954 | if (message.subscription != null && Object.hasOwnProperty.call(message, "subscription"))
|
8955 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.subscription);
|
8956 | if (message.ackDeadlineSeconds != null && Object.hasOwnProperty.call(message, "ackDeadlineSeconds"))
|
8957 | writer.uint32(/* id 3, wireType 0 =*/24).int32(message.ackDeadlineSeconds);
|
8958 | if (message.ackIds != null && message.ackIds.length)
|
8959 | for (var i = 0; i < message.ackIds.length; ++i)
|
8960 | writer.uint32(/* id 4, wireType 2 =*/34).string(message.ackIds[i]);
|
8961 | return writer;
|
8962 | };
|
8963 |
|
8964 | /**
|
8965 | * Encodes the specified ModifyAckDeadlineRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ModifyAckDeadlineRequest.verify|verify} messages.
|
8966 | * @function encodeDelimited
|
8967 | * @memberof google.pubsub.v1.ModifyAckDeadlineRequest
|
8968 | * @static
|
8969 | * @param {google.pubsub.v1.IModifyAckDeadlineRequest} message ModifyAckDeadlineRequest message or plain object to encode
|
8970 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
8971 | * @returns {$protobuf.Writer} Writer
|
8972 | */
|
8973 | ModifyAckDeadlineRequest.encodeDelimited = function encodeDelimited(message, writer) {
|
8974 | return this.encode(message, writer).ldelim();
|
8975 | };
|
8976 |
|
8977 | /**
|
8978 | * Decodes a ModifyAckDeadlineRequest message from the specified reader or buffer.
|
8979 | * @function decode
|
8980 | * @memberof google.pubsub.v1.ModifyAckDeadlineRequest
|
8981 | * @static
|
8982 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
8983 | * @param {number} [length] Message length if known beforehand
|
8984 | * @returns {google.pubsub.v1.ModifyAckDeadlineRequest} ModifyAckDeadlineRequest
|
8985 | * @throws {Error} If the payload is not a reader or valid buffer
|
8986 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
8987 | */
|
8988 | ModifyAckDeadlineRequest.decode = function decode(reader, length) {
|
8989 | if (!(reader instanceof $Reader))
|
8990 | reader = $Reader.create(reader);
|
8991 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.ModifyAckDeadlineRequest();
|
8992 | while (reader.pos < end) {
|
8993 | var tag = reader.uint32();
|
8994 | switch (tag >>> 3) {
|
8995 | case 1:
|
8996 | message.subscription = reader.string();
|
8997 | break;
|
8998 | case 4:
|
8999 | if (!(message.ackIds && message.ackIds.length))
|
9000 | message.ackIds = [];
|
9001 | message.ackIds.push(reader.string());
|
9002 | break;
|
9003 | case 3:
|
9004 | message.ackDeadlineSeconds = reader.int32();
|
9005 | break;
|
9006 | default:
|
9007 | reader.skipType(tag & 7);
|
9008 | break;
|
9009 | }
|
9010 | }
|
9011 | return message;
|
9012 | };
|
9013 |
|
9014 | /**
|
9015 | * Decodes a ModifyAckDeadlineRequest message from the specified reader or buffer, length delimited.
|
9016 | * @function decodeDelimited
|
9017 | * @memberof google.pubsub.v1.ModifyAckDeadlineRequest
|
9018 | * @static
|
9019 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
9020 | * @returns {google.pubsub.v1.ModifyAckDeadlineRequest} ModifyAckDeadlineRequest
|
9021 | * @throws {Error} If the payload is not a reader or valid buffer
|
9022 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
9023 | */
|
9024 | ModifyAckDeadlineRequest.decodeDelimited = function decodeDelimited(reader) {
|
9025 | if (!(reader instanceof $Reader))
|
9026 | reader = new $Reader(reader);
|
9027 | return this.decode(reader, reader.uint32());
|
9028 | };
|
9029 |
|
9030 | /**
|
9031 | * Verifies a ModifyAckDeadlineRequest message.
|
9032 | * @function verify
|
9033 | * @memberof google.pubsub.v1.ModifyAckDeadlineRequest
|
9034 | * @static
|
9035 | * @param {Object.<string,*>} message Plain object to verify
|
9036 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
9037 | */
|
9038 | ModifyAckDeadlineRequest.verify = function verify(message) {
|
9039 | if (typeof message !== "object" || message === null)
|
9040 | return "object expected";
|
9041 | if (message.subscription != null && message.hasOwnProperty("subscription"))
|
9042 | if (!$util.isString(message.subscription))
|
9043 | return "subscription: string expected";
|
9044 | if (message.ackIds != null && message.hasOwnProperty("ackIds")) {
|
9045 | if (!Array.isArray(message.ackIds))
|
9046 | return "ackIds: array expected";
|
9047 | for (var i = 0; i < message.ackIds.length; ++i)
|
9048 | if (!$util.isString(message.ackIds[i]))
|
9049 | return "ackIds: string[] expected";
|
9050 | }
|
9051 | if (message.ackDeadlineSeconds != null && message.hasOwnProperty("ackDeadlineSeconds"))
|
9052 | if (!$util.isInteger(message.ackDeadlineSeconds))
|
9053 | return "ackDeadlineSeconds: integer expected";
|
9054 | return null;
|
9055 | };
|
9056 |
|
9057 | /**
|
9058 | * Creates a ModifyAckDeadlineRequest message from a plain object. Also converts values to their respective internal types.
|
9059 | * @function fromObject
|
9060 | * @memberof google.pubsub.v1.ModifyAckDeadlineRequest
|
9061 | * @static
|
9062 | * @param {Object.<string,*>} object Plain object
|
9063 | * @returns {google.pubsub.v1.ModifyAckDeadlineRequest} ModifyAckDeadlineRequest
|
9064 | */
|
9065 | ModifyAckDeadlineRequest.fromObject = function fromObject(object) {
|
9066 | if (object instanceof $root.google.pubsub.v1.ModifyAckDeadlineRequest)
|
9067 | return object;
|
9068 | var message = new $root.google.pubsub.v1.ModifyAckDeadlineRequest();
|
9069 | if (object.subscription != null)
|
9070 | message.subscription = String(object.subscription);
|
9071 | if (object.ackIds) {
|
9072 | if (!Array.isArray(object.ackIds))
|
9073 | throw TypeError(".google.pubsub.v1.ModifyAckDeadlineRequest.ackIds: array expected");
|
9074 | message.ackIds = [];
|
9075 | for (var i = 0; i < object.ackIds.length; ++i)
|
9076 | message.ackIds[i] = String(object.ackIds[i]);
|
9077 | }
|
9078 | if (object.ackDeadlineSeconds != null)
|
9079 | message.ackDeadlineSeconds = object.ackDeadlineSeconds | 0;
|
9080 | return message;
|
9081 | };
|
9082 |
|
9083 | /**
|
9084 | * Creates a plain object from a ModifyAckDeadlineRequest message. Also converts values to other types if specified.
|
9085 | * @function toObject
|
9086 | * @memberof google.pubsub.v1.ModifyAckDeadlineRequest
|
9087 | * @static
|
9088 | * @param {google.pubsub.v1.ModifyAckDeadlineRequest} message ModifyAckDeadlineRequest
|
9089 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
9090 | * @returns {Object.<string,*>} Plain object
|
9091 | */
|
9092 | ModifyAckDeadlineRequest.toObject = function toObject(message, options) {
|
9093 | if (!options)
|
9094 | options = {};
|
9095 | var object = {};
|
9096 | if (options.arrays || options.defaults)
|
9097 | object.ackIds = [];
|
9098 | if (options.defaults) {
|
9099 | object.subscription = "";
|
9100 | object.ackDeadlineSeconds = 0;
|
9101 | }
|
9102 | if (message.subscription != null && message.hasOwnProperty("subscription"))
|
9103 | object.subscription = message.subscription;
|
9104 | if (message.ackDeadlineSeconds != null && message.hasOwnProperty("ackDeadlineSeconds"))
|
9105 | object.ackDeadlineSeconds = message.ackDeadlineSeconds;
|
9106 | if (message.ackIds && message.ackIds.length) {
|
9107 | object.ackIds = [];
|
9108 | for (var j = 0; j < message.ackIds.length; ++j)
|
9109 | object.ackIds[j] = message.ackIds[j];
|
9110 | }
|
9111 | return object;
|
9112 | };
|
9113 |
|
9114 | /**
|
9115 | * Converts this ModifyAckDeadlineRequest to JSON.
|
9116 | * @function toJSON
|
9117 | * @memberof google.pubsub.v1.ModifyAckDeadlineRequest
|
9118 | * @instance
|
9119 | * @returns {Object.<string,*>} JSON object
|
9120 | */
|
9121 | ModifyAckDeadlineRequest.prototype.toJSON = function toJSON() {
|
9122 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
9123 | };
|
9124 |
|
9125 | return ModifyAckDeadlineRequest;
|
9126 | })();
|
9127 |
|
9128 | v1.AcknowledgeRequest = (function() {
|
9129 |
|
9130 | /**
|
9131 | * Properties of an AcknowledgeRequest.
|
9132 | * @memberof google.pubsub.v1
|
9133 | * @interface IAcknowledgeRequest
|
9134 | * @property {string|null} [subscription] AcknowledgeRequest subscription
|
9135 | * @property {Array.<string>|null} [ackIds] AcknowledgeRequest ackIds
|
9136 | */
|
9137 |
|
9138 | /**
|
9139 | * Constructs a new AcknowledgeRequest.
|
9140 | * @memberof google.pubsub.v1
|
9141 | * @classdesc Represents an AcknowledgeRequest.
|
9142 | * @implements IAcknowledgeRequest
|
9143 | * @constructor
|
9144 | * @param {google.pubsub.v1.IAcknowledgeRequest=} [properties] Properties to set
|
9145 | */
|
9146 | function AcknowledgeRequest(properties) {
|
9147 | this.ackIds = [];
|
9148 | if (properties)
|
9149 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
9150 | if (properties[keys[i]] != null)
|
9151 | this[keys[i]] = properties[keys[i]];
|
9152 | }
|
9153 |
|
9154 | /**
|
9155 | * AcknowledgeRequest subscription.
|
9156 | * @member {string} subscription
|
9157 | * @memberof google.pubsub.v1.AcknowledgeRequest
|
9158 | * @instance
|
9159 | */
|
9160 | AcknowledgeRequest.prototype.subscription = "";
|
9161 |
|
9162 | /**
|
9163 | * AcknowledgeRequest ackIds.
|
9164 | * @member {Array.<string>} ackIds
|
9165 | * @memberof google.pubsub.v1.AcknowledgeRequest
|
9166 | * @instance
|
9167 | */
|
9168 | AcknowledgeRequest.prototype.ackIds = $util.emptyArray;
|
9169 |
|
9170 | /**
|
9171 | * Creates a new AcknowledgeRequest instance using the specified properties.
|
9172 | * @function create
|
9173 | * @memberof google.pubsub.v1.AcknowledgeRequest
|
9174 | * @static
|
9175 | * @param {google.pubsub.v1.IAcknowledgeRequest=} [properties] Properties to set
|
9176 | * @returns {google.pubsub.v1.AcknowledgeRequest} AcknowledgeRequest instance
|
9177 | */
|
9178 | AcknowledgeRequest.create = function create(properties) {
|
9179 | return new AcknowledgeRequest(properties);
|
9180 | };
|
9181 |
|
9182 | /**
|
9183 | * Encodes the specified AcknowledgeRequest message. Does not implicitly {@link google.pubsub.v1.AcknowledgeRequest.verify|verify} messages.
|
9184 | * @function encode
|
9185 | * @memberof google.pubsub.v1.AcknowledgeRequest
|
9186 | * @static
|
9187 | * @param {google.pubsub.v1.IAcknowledgeRequest} message AcknowledgeRequest message or plain object to encode
|
9188 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
9189 | * @returns {$protobuf.Writer} Writer
|
9190 | */
|
9191 | AcknowledgeRequest.encode = function encode(message, writer) {
|
9192 | if (!writer)
|
9193 | writer = $Writer.create();
|
9194 | if (message.subscription != null && Object.hasOwnProperty.call(message, "subscription"))
|
9195 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.subscription);
|
9196 | if (message.ackIds != null && message.ackIds.length)
|
9197 | for (var i = 0; i < message.ackIds.length; ++i)
|
9198 | writer.uint32(/* id 2, wireType 2 =*/18).string(message.ackIds[i]);
|
9199 | return writer;
|
9200 | };
|
9201 |
|
9202 | /**
|
9203 | * Encodes the specified AcknowledgeRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.AcknowledgeRequest.verify|verify} messages.
|
9204 | * @function encodeDelimited
|
9205 | * @memberof google.pubsub.v1.AcknowledgeRequest
|
9206 | * @static
|
9207 | * @param {google.pubsub.v1.IAcknowledgeRequest} message AcknowledgeRequest message or plain object to encode
|
9208 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
9209 | * @returns {$protobuf.Writer} Writer
|
9210 | */
|
9211 | AcknowledgeRequest.encodeDelimited = function encodeDelimited(message, writer) {
|
9212 | return this.encode(message, writer).ldelim();
|
9213 | };
|
9214 |
|
9215 | /**
|
9216 | * Decodes an AcknowledgeRequest message from the specified reader or buffer.
|
9217 | * @function decode
|
9218 | * @memberof google.pubsub.v1.AcknowledgeRequest
|
9219 | * @static
|
9220 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
9221 | * @param {number} [length] Message length if known beforehand
|
9222 | * @returns {google.pubsub.v1.AcknowledgeRequest} AcknowledgeRequest
|
9223 | * @throws {Error} If the payload is not a reader or valid buffer
|
9224 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
9225 | */
|
9226 | AcknowledgeRequest.decode = function decode(reader, length) {
|
9227 | if (!(reader instanceof $Reader))
|
9228 | reader = $Reader.create(reader);
|
9229 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.AcknowledgeRequest();
|
9230 | while (reader.pos < end) {
|
9231 | var tag = reader.uint32();
|
9232 | switch (tag >>> 3) {
|
9233 | case 1:
|
9234 | message.subscription = reader.string();
|
9235 | break;
|
9236 | case 2:
|
9237 | if (!(message.ackIds && message.ackIds.length))
|
9238 | message.ackIds = [];
|
9239 | message.ackIds.push(reader.string());
|
9240 | break;
|
9241 | default:
|
9242 | reader.skipType(tag & 7);
|
9243 | break;
|
9244 | }
|
9245 | }
|
9246 | return message;
|
9247 | };
|
9248 |
|
9249 | /**
|
9250 | * Decodes an AcknowledgeRequest message from the specified reader or buffer, length delimited.
|
9251 | * @function decodeDelimited
|
9252 | * @memberof google.pubsub.v1.AcknowledgeRequest
|
9253 | * @static
|
9254 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
9255 | * @returns {google.pubsub.v1.AcknowledgeRequest} AcknowledgeRequest
|
9256 | * @throws {Error} If the payload is not a reader or valid buffer
|
9257 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
9258 | */
|
9259 | AcknowledgeRequest.decodeDelimited = function decodeDelimited(reader) {
|
9260 | if (!(reader instanceof $Reader))
|
9261 | reader = new $Reader(reader);
|
9262 | return this.decode(reader, reader.uint32());
|
9263 | };
|
9264 |
|
9265 | /**
|
9266 | * Verifies an AcknowledgeRequest message.
|
9267 | * @function verify
|
9268 | * @memberof google.pubsub.v1.AcknowledgeRequest
|
9269 | * @static
|
9270 | * @param {Object.<string,*>} message Plain object to verify
|
9271 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
9272 | */
|
9273 | AcknowledgeRequest.verify = function verify(message) {
|
9274 | if (typeof message !== "object" || message === null)
|
9275 | return "object expected";
|
9276 | if (message.subscription != null && message.hasOwnProperty("subscription"))
|
9277 | if (!$util.isString(message.subscription))
|
9278 | return "subscription: string expected";
|
9279 | if (message.ackIds != null && message.hasOwnProperty("ackIds")) {
|
9280 | if (!Array.isArray(message.ackIds))
|
9281 | return "ackIds: array expected";
|
9282 | for (var i = 0; i < message.ackIds.length; ++i)
|
9283 | if (!$util.isString(message.ackIds[i]))
|
9284 | return "ackIds: string[] expected";
|
9285 | }
|
9286 | return null;
|
9287 | };
|
9288 |
|
9289 | /**
|
9290 | * Creates an AcknowledgeRequest message from a plain object. Also converts values to their respective internal types.
|
9291 | * @function fromObject
|
9292 | * @memberof google.pubsub.v1.AcknowledgeRequest
|
9293 | * @static
|
9294 | * @param {Object.<string,*>} object Plain object
|
9295 | * @returns {google.pubsub.v1.AcknowledgeRequest} AcknowledgeRequest
|
9296 | */
|
9297 | AcknowledgeRequest.fromObject = function fromObject(object) {
|
9298 | if (object instanceof $root.google.pubsub.v1.AcknowledgeRequest)
|
9299 | return object;
|
9300 | var message = new $root.google.pubsub.v1.AcknowledgeRequest();
|
9301 | if (object.subscription != null)
|
9302 | message.subscription = String(object.subscription);
|
9303 | if (object.ackIds) {
|
9304 | if (!Array.isArray(object.ackIds))
|
9305 | throw TypeError(".google.pubsub.v1.AcknowledgeRequest.ackIds: array expected");
|
9306 | message.ackIds = [];
|
9307 | for (var i = 0; i < object.ackIds.length; ++i)
|
9308 | message.ackIds[i] = String(object.ackIds[i]);
|
9309 | }
|
9310 | return message;
|
9311 | };
|
9312 |
|
9313 | /**
|
9314 | * Creates a plain object from an AcknowledgeRequest message. Also converts values to other types if specified.
|
9315 | * @function toObject
|
9316 | * @memberof google.pubsub.v1.AcknowledgeRequest
|
9317 | * @static
|
9318 | * @param {google.pubsub.v1.AcknowledgeRequest} message AcknowledgeRequest
|
9319 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
9320 | * @returns {Object.<string,*>} Plain object
|
9321 | */
|
9322 | AcknowledgeRequest.toObject = function toObject(message, options) {
|
9323 | if (!options)
|
9324 | options = {};
|
9325 | var object = {};
|
9326 | if (options.arrays || options.defaults)
|
9327 | object.ackIds = [];
|
9328 | if (options.defaults)
|
9329 | object.subscription = "";
|
9330 | if (message.subscription != null && message.hasOwnProperty("subscription"))
|
9331 | object.subscription = message.subscription;
|
9332 | if (message.ackIds && message.ackIds.length) {
|
9333 | object.ackIds = [];
|
9334 | for (var j = 0; j < message.ackIds.length; ++j)
|
9335 | object.ackIds[j] = message.ackIds[j];
|
9336 | }
|
9337 | return object;
|
9338 | };
|
9339 |
|
9340 | /**
|
9341 | * Converts this AcknowledgeRequest to JSON.
|
9342 | * @function toJSON
|
9343 | * @memberof google.pubsub.v1.AcknowledgeRequest
|
9344 | * @instance
|
9345 | * @returns {Object.<string,*>} JSON object
|
9346 | */
|
9347 | AcknowledgeRequest.prototype.toJSON = function toJSON() {
|
9348 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
9349 | };
|
9350 |
|
9351 | return AcknowledgeRequest;
|
9352 | })();
|
9353 |
|
9354 | v1.StreamingPullRequest = (function() {
|
9355 |
|
9356 | /**
|
9357 | * Properties of a StreamingPullRequest.
|
9358 | * @memberof google.pubsub.v1
|
9359 | * @interface IStreamingPullRequest
|
9360 | * @property {string|null} [subscription] StreamingPullRequest subscription
|
9361 | * @property {Array.<string>|null} [ackIds] StreamingPullRequest ackIds
|
9362 | * @property {Array.<number>|null} [modifyDeadlineSeconds] StreamingPullRequest modifyDeadlineSeconds
|
9363 | * @property {Array.<string>|null} [modifyDeadlineAckIds] StreamingPullRequest modifyDeadlineAckIds
|
9364 | * @property {number|null} [streamAckDeadlineSeconds] StreamingPullRequest streamAckDeadlineSeconds
|
9365 | * @property {string|null} [clientId] StreamingPullRequest clientId
|
9366 | * @property {number|Long|null} [maxOutstandingMessages] StreamingPullRequest maxOutstandingMessages
|
9367 | * @property {number|Long|null} [maxOutstandingBytes] StreamingPullRequest maxOutstandingBytes
|
9368 | */
|
9369 |
|
9370 | /**
|
9371 | * Constructs a new StreamingPullRequest.
|
9372 | * @memberof google.pubsub.v1
|
9373 | * @classdesc Represents a StreamingPullRequest.
|
9374 | * @implements IStreamingPullRequest
|
9375 | * @constructor
|
9376 | * @param {google.pubsub.v1.IStreamingPullRequest=} [properties] Properties to set
|
9377 | */
|
9378 | function StreamingPullRequest(properties) {
|
9379 | this.ackIds = [];
|
9380 | this.modifyDeadlineSeconds = [];
|
9381 | this.modifyDeadlineAckIds = [];
|
9382 | if (properties)
|
9383 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
9384 | if (properties[keys[i]] != null)
|
9385 | this[keys[i]] = properties[keys[i]];
|
9386 | }
|
9387 |
|
9388 | /**
|
9389 | * StreamingPullRequest subscription.
|
9390 | * @member {string} subscription
|
9391 | * @memberof google.pubsub.v1.StreamingPullRequest
|
9392 | * @instance
|
9393 | */
|
9394 | StreamingPullRequest.prototype.subscription = "";
|
9395 |
|
9396 | /**
|
9397 | * StreamingPullRequest ackIds.
|
9398 | * @member {Array.<string>} ackIds
|
9399 | * @memberof google.pubsub.v1.StreamingPullRequest
|
9400 | * @instance
|
9401 | */
|
9402 | StreamingPullRequest.prototype.ackIds = $util.emptyArray;
|
9403 |
|
9404 | /**
|
9405 | * StreamingPullRequest modifyDeadlineSeconds.
|
9406 | * @member {Array.<number>} modifyDeadlineSeconds
|
9407 | * @memberof google.pubsub.v1.StreamingPullRequest
|
9408 | * @instance
|
9409 | */
|
9410 | StreamingPullRequest.prototype.modifyDeadlineSeconds = $util.emptyArray;
|
9411 |
|
9412 | /**
|
9413 | * StreamingPullRequest modifyDeadlineAckIds.
|
9414 | * @member {Array.<string>} modifyDeadlineAckIds
|
9415 | * @memberof google.pubsub.v1.StreamingPullRequest
|
9416 | * @instance
|
9417 | */
|
9418 | StreamingPullRequest.prototype.modifyDeadlineAckIds = $util.emptyArray;
|
9419 |
|
9420 | /**
|
9421 | * StreamingPullRequest streamAckDeadlineSeconds.
|
9422 | * @member {number} streamAckDeadlineSeconds
|
9423 | * @memberof google.pubsub.v1.StreamingPullRequest
|
9424 | * @instance
|
9425 | */
|
9426 | StreamingPullRequest.prototype.streamAckDeadlineSeconds = 0;
|
9427 |
|
9428 | /**
|
9429 | * StreamingPullRequest clientId.
|
9430 | * @member {string} clientId
|
9431 | * @memberof google.pubsub.v1.StreamingPullRequest
|
9432 | * @instance
|
9433 | */
|
9434 | StreamingPullRequest.prototype.clientId = "";
|
9435 |
|
9436 | /**
|
9437 | * StreamingPullRequest maxOutstandingMessages.
|
9438 | * @member {number|Long} maxOutstandingMessages
|
9439 | * @memberof google.pubsub.v1.StreamingPullRequest
|
9440 | * @instance
|
9441 | */
|
9442 | StreamingPullRequest.prototype.maxOutstandingMessages = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
9443 |
|
9444 | /**
|
9445 | * StreamingPullRequest maxOutstandingBytes.
|
9446 | * @member {number|Long} maxOutstandingBytes
|
9447 | * @memberof google.pubsub.v1.StreamingPullRequest
|
9448 | * @instance
|
9449 | */
|
9450 | StreamingPullRequest.prototype.maxOutstandingBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
9451 |
|
9452 | /**
|
9453 | * Creates a new StreamingPullRequest instance using the specified properties.
|
9454 | * @function create
|
9455 | * @memberof google.pubsub.v1.StreamingPullRequest
|
9456 | * @static
|
9457 | * @param {google.pubsub.v1.IStreamingPullRequest=} [properties] Properties to set
|
9458 | * @returns {google.pubsub.v1.StreamingPullRequest} StreamingPullRequest instance
|
9459 | */
|
9460 | StreamingPullRequest.create = function create(properties) {
|
9461 | return new StreamingPullRequest(properties);
|
9462 | };
|
9463 |
|
9464 | /**
|
9465 | * Encodes the specified StreamingPullRequest message. Does not implicitly {@link google.pubsub.v1.StreamingPullRequest.verify|verify} messages.
|
9466 | * @function encode
|
9467 | * @memberof google.pubsub.v1.StreamingPullRequest
|
9468 | * @static
|
9469 | * @param {google.pubsub.v1.IStreamingPullRequest} message StreamingPullRequest message or plain object to encode
|
9470 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
9471 | * @returns {$protobuf.Writer} Writer
|
9472 | */
|
9473 | StreamingPullRequest.encode = function encode(message, writer) {
|
9474 | if (!writer)
|
9475 | writer = $Writer.create();
|
9476 | if (message.subscription != null && Object.hasOwnProperty.call(message, "subscription"))
|
9477 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.subscription);
|
9478 | if (message.ackIds != null && message.ackIds.length)
|
9479 | for (var i = 0; i < message.ackIds.length; ++i)
|
9480 | writer.uint32(/* id 2, wireType 2 =*/18).string(message.ackIds[i]);
|
9481 | if (message.modifyDeadlineSeconds != null && message.modifyDeadlineSeconds.length) {
|
9482 | writer.uint32(/* id 3, wireType 2 =*/26).fork();
|
9483 | for (var i = 0; i < message.modifyDeadlineSeconds.length; ++i)
|
9484 | writer.int32(message.modifyDeadlineSeconds[i]);
|
9485 | writer.ldelim();
|
9486 | }
|
9487 | if (message.modifyDeadlineAckIds != null && message.modifyDeadlineAckIds.length)
|
9488 | for (var i = 0; i < message.modifyDeadlineAckIds.length; ++i)
|
9489 | writer.uint32(/* id 4, wireType 2 =*/34).string(message.modifyDeadlineAckIds[i]);
|
9490 | if (message.streamAckDeadlineSeconds != null && Object.hasOwnProperty.call(message, "streamAckDeadlineSeconds"))
|
9491 | writer.uint32(/* id 5, wireType 0 =*/40).int32(message.streamAckDeadlineSeconds);
|
9492 | if (message.clientId != null && Object.hasOwnProperty.call(message, "clientId"))
|
9493 | writer.uint32(/* id 6, wireType 2 =*/50).string(message.clientId);
|
9494 | if (message.maxOutstandingMessages != null && Object.hasOwnProperty.call(message, "maxOutstandingMessages"))
|
9495 | writer.uint32(/* id 7, wireType 0 =*/56).int64(message.maxOutstandingMessages);
|
9496 | if (message.maxOutstandingBytes != null && Object.hasOwnProperty.call(message, "maxOutstandingBytes"))
|
9497 | writer.uint32(/* id 8, wireType 0 =*/64).int64(message.maxOutstandingBytes);
|
9498 | return writer;
|
9499 | };
|
9500 |
|
9501 | /**
|
9502 | * Encodes the specified StreamingPullRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.StreamingPullRequest.verify|verify} messages.
|
9503 | * @function encodeDelimited
|
9504 | * @memberof google.pubsub.v1.StreamingPullRequest
|
9505 | * @static
|
9506 | * @param {google.pubsub.v1.IStreamingPullRequest} message StreamingPullRequest message or plain object to encode
|
9507 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
9508 | * @returns {$protobuf.Writer} Writer
|
9509 | */
|
9510 | StreamingPullRequest.encodeDelimited = function encodeDelimited(message, writer) {
|
9511 | return this.encode(message, writer).ldelim();
|
9512 | };
|
9513 |
|
9514 | /**
|
9515 | * Decodes a StreamingPullRequest message from the specified reader or buffer.
|
9516 | * @function decode
|
9517 | * @memberof google.pubsub.v1.StreamingPullRequest
|
9518 | * @static
|
9519 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
9520 | * @param {number} [length] Message length if known beforehand
|
9521 | * @returns {google.pubsub.v1.StreamingPullRequest} StreamingPullRequest
|
9522 | * @throws {Error} If the payload is not a reader or valid buffer
|
9523 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
9524 | */
|
9525 | StreamingPullRequest.decode = function decode(reader, length) {
|
9526 | if (!(reader instanceof $Reader))
|
9527 | reader = $Reader.create(reader);
|
9528 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.StreamingPullRequest();
|
9529 | while (reader.pos < end) {
|
9530 | var tag = reader.uint32();
|
9531 | switch (tag >>> 3) {
|
9532 | case 1:
|
9533 | message.subscription = reader.string();
|
9534 | break;
|
9535 | case 2:
|
9536 | if (!(message.ackIds && message.ackIds.length))
|
9537 | message.ackIds = [];
|
9538 | message.ackIds.push(reader.string());
|
9539 | break;
|
9540 | case 3:
|
9541 | if (!(message.modifyDeadlineSeconds && message.modifyDeadlineSeconds.length))
|
9542 | message.modifyDeadlineSeconds = [];
|
9543 | if ((tag & 7) === 2) {
|
9544 | var end2 = reader.uint32() + reader.pos;
|
9545 | while (reader.pos < end2)
|
9546 | message.modifyDeadlineSeconds.push(reader.int32());
|
9547 | } else
|
9548 | message.modifyDeadlineSeconds.push(reader.int32());
|
9549 | break;
|
9550 | case 4:
|
9551 | if (!(message.modifyDeadlineAckIds && message.modifyDeadlineAckIds.length))
|
9552 | message.modifyDeadlineAckIds = [];
|
9553 | message.modifyDeadlineAckIds.push(reader.string());
|
9554 | break;
|
9555 | case 5:
|
9556 | message.streamAckDeadlineSeconds = reader.int32();
|
9557 | break;
|
9558 | case 6:
|
9559 | message.clientId = reader.string();
|
9560 | break;
|
9561 | case 7:
|
9562 | message.maxOutstandingMessages = reader.int64();
|
9563 | break;
|
9564 | case 8:
|
9565 | message.maxOutstandingBytes = reader.int64();
|
9566 | break;
|
9567 | default:
|
9568 | reader.skipType(tag & 7);
|
9569 | break;
|
9570 | }
|
9571 | }
|
9572 | return message;
|
9573 | };
|
9574 |
|
9575 | /**
|
9576 | * Decodes a StreamingPullRequest message from the specified reader or buffer, length delimited.
|
9577 | * @function decodeDelimited
|
9578 | * @memberof google.pubsub.v1.StreamingPullRequest
|
9579 | * @static
|
9580 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
9581 | * @returns {google.pubsub.v1.StreamingPullRequest} StreamingPullRequest
|
9582 | * @throws {Error} If the payload is not a reader or valid buffer
|
9583 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
9584 | */
|
9585 | StreamingPullRequest.decodeDelimited = function decodeDelimited(reader) {
|
9586 | if (!(reader instanceof $Reader))
|
9587 | reader = new $Reader(reader);
|
9588 | return this.decode(reader, reader.uint32());
|
9589 | };
|
9590 |
|
9591 | /**
|
9592 | * Verifies a StreamingPullRequest message.
|
9593 | * @function verify
|
9594 | * @memberof google.pubsub.v1.StreamingPullRequest
|
9595 | * @static
|
9596 | * @param {Object.<string,*>} message Plain object to verify
|
9597 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
9598 | */
|
9599 | StreamingPullRequest.verify = function verify(message) {
|
9600 | if (typeof message !== "object" || message === null)
|
9601 | return "object expected";
|
9602 | if (message.subscription != null && message.hasOwnProperty("subscription"))
|
9603 | if (!$util.isString(message.subscription))
|
9604 | return "subscription: string expected";
|
9605 | if (message.ackIds != null && message.hasOwnProperty("ackIds")) {
|
9606 | if (!Array.isArray(message.ackIds))
|
9607 | return "ackIds: array expected";
|
9608 | for (var i = 0; i < message.ackIds.length; ++i)
|
9609 | if (!$util.isString(message.ackIds[i]))
|
9610 | return "ackIds: string[] expected";
|
9611 | }
|
9612 | if (message.modifyDeadlineSeconds != null && message.hasOwnProperty("modifyDeadlineSeconds")) {
|
9613 | if (!Array.isArray(message.modifyDeadlineSeconds))
|
9614 | return "modifyDeadlineSeconds: array expected";
|
9615 | for (var i = 0; i < message.modifyDeadlineSeconds.length; ++i)
|
9616 | if (!$util.isInteger(message.modifyDeadlineSeconds[i]))
|
9617 | return "modifyDeadlineSeconds: integer[] expected";
|
9618 | }
|
9619 | if (message.modifyDeadlineAckIds != null && message.hasOwnProperty("modifyDeadlineAckIds")) {
|
9620 | if (!Array.isArray(message.modifyDeadlineAckIds))
|
9621 | return "modifyDeadlineAckIds: array expected";
|
9622 | for (var i = 0; i < message.modifyDeadlineAckIds.length; ++i)
|
9623 | if (!$util.isString(message.modifyDeadlineAckIds[i]))
|
9624 | return "modifyDeadlineAckIds: string[] expected";
|
9625 | }
|
9626 | if (message.streamAckDeadlineSeconds != null && message.hasOwnProperty("streamAckDeadlineSeconds"))
|
9627 | if (!$util.isInteger(message.streamAckDeadlineSeconds))
|
9628 | return "streamAckDeadlineSeconds: integer expected";
|
9629 | if (message.clientId != null && message.hasOwnProperty("clientId"))
|
9630 | if (!$util.isString(message.clientId))
|
9631 | return "clientId: string expected";
|
9632 | if (message.maxOutstandingMessages != null && message.hasOwnProperty("maxOutstandingMessages"))
|
9633 | if (!$util.isInteger(message.maxOutstandingMessages) && !(message.maxOutstandingMessages && $util.isInteger(message.maxOutstandingMessages.low) && $util.isInteger(message.maxOutstandingMessages.high)))
|
9634 | return "maxOutstandingMessages: integer|Long expected";
|
9635 | if (message.maxOutstandingBytes != null && message.hasOwnProperty("maxOutstandingBytes"))
|
9636 | if (!$util.isInteger(message.maxOutstandingBytes) && !(message.maxOutstandingBytes && $util.isInteger(message.maxOutstandingBytes.low) && $util.isInteger(message.maxOutstandingBytes.high)))
|
9637 | return "maxOutstandingBytes: integer|Long expected";
|
9638 | return null;
|
9639 | };
|
9640 |
|
9641 | /**
|
9642 | * Creates a StreamingPullRequest message from a plain object. Also converts values to their respective internal types.
|
9643 | * @function fromObject
|
9644 | * @memberof google.pubsub.v1.StreamingPullRequest
|
9645 | * @static
|
9646 | * @param {Object.<string,*>} object Plain object
|
9647 | * @returns {google.pubsub.v1.StreamingPullRequest} StreamingPullRequest
|
9648 | */
|
9649 | StreamingPullRequest.fromObject = function fromObject(object) {
|
9650 | if (object instanceof $root.google.pubsub.v1.StreamingPullRequest)
|
9651 | return object;
|
9652 | var message = new $root.google.pubsub.v1.StreamingPullRequest();
|
9653 | if (object.subscription != null)
|
9654 | message.subscription = String(object.subscription);
|
9655 | if (object.ackIds) {
|
9656 | if (!Array.isArray(object.ackIds))
|
9657 | throw TypeError(".google.pubsub.v1.StreamingPullRequest.ackIds: array expected");
|
9658 | message.ackIds = [];
|
9659 | for (var i = 0; i < object.ackIds.length; ++i)
|
9660 | message.ackIds[i] = String(object.ackIds[i]);
|
9661 | }
|
9662 | if (object.modifyDeadlineSeconds) {
|
9663 | if (!Array.isArray(object.modifyDeadlineSeconds))
|
9664 | throw TypeError(".google.pubsub.v1.StreamingPullRequest.modifyDeadlineSeconds: array expected");
|
9665 | message.modifyDeadlineSeconds = [];
|
9666 | for (var i = 0; i < object.modifyDeadlineSeconds.length; ++i)
|
9667 | message.modifyDeadlineSeconds[i] = object.modifyDeadlineSeconds[i] | 0;
|
9668 | }
|
9669 | if (object.modifyDeadlineAckIds) {
|
9670 | if (!Array.isArray(object.modifyDeadlineAckIds))
|
9671 | throw TypeError(".google.pubsub.v1.StreamingPullRequest.modifyDeadlineAckIds: array expected");
|
9672 | message.modifyDeadlineAckIds = [];
|
9673 | for (var i = 0; i < object.modifyDeadlineAckIds.length; ++i)
|
9674 | message.modifyDeadlineAckIds[i] = String(object.modifyDeadlineAckIds[i]);
|
9675 | }
|
9676 | if (object.streamAckDeadlineSeconds != null)
|
9677 | message.streamAckDeadlineSeconds = object.streamAckDeadlineSeconds | 0;
|
9678 | if (object.clientId != null)
|
9679 | message.clientId = String(object.clientId);
|
9680 | if (object.maxOutstandingMessages != null)
|
9681 | if ($util.Long)
|
9682 | (message.maxOutstandingMessages = $util.Long.fromValue(object.maxOutstandingMessages)).unsigned = false;
|
9683 | else if (typeof object.maxOutstandingMessages === "string")
|
9684 | message.maxOutstandingMessages = parseInt(object.maxOutstandingMessages, 10);
|
9685 | else if (typeof object.maxOutstandingMessages === "number")
|
9686 | message.maxOutstandingMessages = object.maxOutstandingMessages;
|
9687 | else if (typeof object.maxOutstandingMessages === "object")
|
9688 | message.maxOutstandingMessages = new $util.LongBits(object.maxOutstandingMessages.low >>> 0, object.maxOutstandingMessages.high >>> 0).toNumber();
|
9689 | if (object.maxOutstandingBytes != null)
|
9690 | if ($util.Long)
|
9691 | (message.maxOutstandingBytes = $util.Long.fromValue(object.maxOutstandingBytes)).unsigned = false;
|
9692 | else if (typeof object.maxOutstandingBytes === "string")
|
9693 | message.maxOutstandingBytes = parseInt(object.maxOutstandingBytes, 10);
|
9694 | else if (typeof object.maxOutstandingBytes === "number")
|
9695 | message.maxOutstandingBytes = object.maxOutstandingBytes;
|
9696 | else if (typeof object.maxOutstandingBytes === "object")
|
9697 | message.maxOutstandingBytes = new $util.LongBits(object.maxOutstandingBytes.low >>> 0, object.maxOutstandingBytes.high >>> 0).toNumber();
|
9698 | return message;
|
9699 | };
|
9700 |
|
9701 | /**
|
9702 | * Creates a plain object from a StreamingPullRequest message. Also converts values to other types if specified.
|
9703 | * @function toObject
|
9704 | * @memberof google.pubsub.v1.StreamingPullRequest
|
9705 | * @static
|
9706 | * @param {google.pubsub.v1.StreamingPullRequest} message StreamingPullRequest
|
9707 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
9708 | * @returns {Object.<string,*>} Plain object
|
9709 | */
|
9710 | StreamingPullRequest.toObject = function toObject(message, options) {
|
9711 | if (!options)
|
9712 | options = {};
|
9713 | var object = {};
|
9714 | if (options.arrays || options.defaults) {
|
9715 | object.ackIds = [];
|
9716 | object.modifyDeadlineSeconds = [];
|
9717 | object.modifyDeadlineAckIds = [];
|
9718 | }
|
9719 | if (options.defaults) {
|
9720 | object.subscription = "";
|
9721 | object.streamAckDeadlineSeconds = 0;
|
9722 | object.clientId = "";
|
9723 | if ($util.Long) {
|
9724 | var long = new $util.Long(0, 0, false);
|
9725 | object.maxOutstandingMessages = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
9726 | } else
|
9727 | object.maxOutstandingMessages = options.longs === String ? "0" : 0;
|
9728 | if ($util.Long) {
|
9729 | var long = new $util.Long(0, 0, false);
|
9730 | object.maxOutstandingBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
9731 | } else
|
9732 | object.maxOutstandingBytes = options.longs === String ? "0" : 0;
|
9733 | }
|
9734 | if (message.subscription != null && message.hasOwnProperty("subscription"))
|
9735 | object.subscription = message.subscription;
|
9736 | if (message.ackIds && message.ackIds.length) {
|
9737 | object.ackIds = [];
|
9738 | for (var j = 0; j < message.ackIds.length; ++j)
|
9739 | object.ackIds[j] = message.ackIds[j];
|
9740 | }
|
9741 | if (message.modifyDeadlineSeconds && message.modifyDeadlineSeconds.length) {
|
9742 | object.modifyDeadlineSeconds = [];
|
9743 | for (var j = 0; j < message.modifyDeadlineSeconds.length; ++j)
|
9744 | object.modifyDeadlineSeconds[j] = message.modifyDeadlineSeconds[j];
|
9745 | }
|
9746 | if (message.modifyDeadlineAckIds && message.modifyDeadlineAckIds.length) {
|
9747 | object.modifyDeadlineAckIds = [];
|
9748 | for (var j = 0; j < message.modifyDeadlineAckIds.length; ++j)
|
9749 | object.modifyDeadlineAckIds[j] = message.modifyDeadlineAckIds[j];
|
9750 | }
|
9751 | if (message.streamAckDeadlineSeconds != null && message.hasOwnProperty("streamAckDeadlineSeconds"))
|
9752 | object.streamAckDeadlineSeconds = message.streamAckDeadlineSeconds;
|
9753 | if (message.clientId != null && message.hasOwnProperty("clientId"))
|
9754 | object.clientId = message.clientId;
|
9755 | if (message.maxOutstandingMessages != null && message.hasOwnProperty("maxOutstandingMessages"))
|
9756 | if (typeof message.maxOutstandingMessages === "number")
|
9757 | object.maxOutstandingMessages = options.longs === String ? String(message.maxOutstandingMessages) : message.maxOutstandingMessages;
|
9758 | else
|
9759 | object.maxOutstandingMessages = options.longs === String ? $util.Long.prototype.toString.call(message.maxOutstandingMessages) : options.longs === Number ? new $util.LongBits(message.maxOutstandingMessages.low >>> 0, message.maxOutstandingMessages.high >>> 0).toNumber() : message.maxOutstandingMessages;
|
9760 | if (message.maxOutstandingBytes != null && message.hasOwnProperty("maxOutstandingBytes"))
|
9761 | if (typeof message.maxOutstandingBytes === "number")
|
9762 | object.maxOutstandingBytes = options.longs === String ? String(message.maxOutstandingBytes) : message.maxOutstandingBytes;
|
9763 | else
|
9764 | object.maxOutstandingBytes = options.longs === String ? $util.Long.prototype.toString.call(message.maxOutstandingBytes) : options.longs === Number ? new $util.LongBits(message.maxOutstandingBytes.low >>> 0, message.maxOutstandingBytes.high >>> 0).toNumber() : message.maxOutstandingBytes;
|
9765 | return object;
|
9766 | };
|
9767 |
|
9768 | /**
|
9769 | * Converts this StreamingPullRequest to JSON.
|
9770 | * @function toJSON
|
9771 | * @memberof google.pubsub.v1.StreamingPullRequest
|
9772 | * @instance
|
9773 | * @returns {Object.<string,*>} JSON object
|
9774 | */
|
9775 | StreamingPullRequest.prototype.toJSON = function toJSON() {
|
9776 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
9777 | };
|
9778 |
|
9779 | return StreamingPullRequest;
|
9780 | })();
|
9781 |
|
9782 | v1.StreamingPullResponse = (function() {
|
9783 |
|
9784 | /**
|
9785 | * Properties of a StreamingPullResponse.
|
9786 | * @memberof google.pubsub.v1
|
9787 | * @interface IStreamingPullResponse
|
9788 | * @property {Array.<google.pubsub.v1.IReceivedMessage>|null} [receivedMessages] StreamingPullResponse receivedMessages
|
9789 | * @property {google.pubsub.v1.StreamingPullResponse.IAcknowledgeConfirmation|null} [acknowledgeConfirmation] StreamingPullResponse acknowledgeConfirmation
|
9790 | * @property {google.pubsub.v1.StreamingPullResponse.IModifyAckDeadlineConfirmation|null} [modifyAckDeadlineConfirmation] StreamingPullResponse modifyAckDeadlineConfirmation
|
9791 | * @property {google.pubsub.v1.StreamingPullResponse.ISubscriptionProperties|null} [subscriptionProperties] StreamingPullResponse subscriptionProperties
|
9792 | */
|
9793 |
|
9794 | /**
|
9795 | * Constructs a new StreamingPullResponse.
|
9796 | * @memberof google.pubsub.v1
|
9797 | * @classdesc Represents a StreamingPullResponse.
|
9798 | * @implements IStreamingPullResponse
|
9799 | * @constructor
|
9800 | * @param {google.pubsub.v1.IStreamingPullResponse=} [properties] Properties to set
|
9801 | */
|
9802 | function StreamingPullResponse(properties) {
|
9803 | this.receivedMessages = [];
|
9804 | if (properties)
|
9805 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
9806 | if (properties[keys[i]] != null)
|
9807 | this[keys[i]] = properties[keys[i]];
|
9808 | }
|
9809 |
|
9810 | /**
|
9811 | * StreamingPullResponse receivedMessages.
|
9812 | * @member {Array.<google.pubsub.v1.IReceivedMessage>} receivedMessages
|
9813 | * @memberof google.pubsub.v1.StreamingPullResponse
|
9814 | * @instance
|
9815 | */
|
9816 | StreamingPullResponse.prototype.receivedMessages = $util.emptyArray;
|
9817 |
|
9818 | /**
|
9819 | * StreamingPullResponse acknowledgeConfirmation.
|
9820 | * @member {google.pubsub.v1.StreamingPullResponse.IAcknowledgeConfirmation|null|undefined} acknowledgeConfirmation
|
9821 | * @memberof google.pubsub.v1.StreamingPullResponse
|
9822 | * @instance
|
9823 | */
|
9824 | StreamingPullResponse.prototype.acknowledgeConfirmation = null;
|
9825 |
|
9826 | /**
|
9827 | * StreamingPullResponse modifyAckDeadlineConfirmation.
|
9828 | * @member {google.pubsub.v1.StreamingPullResponse.IModifyAckDeadlineConfirmation|null|undefined} modifyAckDeadlineConfirmation
|
9829 | * @memberof google.pubsub.v1.StreamingPullResponse
|
9830 | * @instance
|
9831 | */
|
9832 | StreamingPullResponse.prototype.modifyAckDeadlineConfirmation = null;
|
9833 |
|
9834 | /**
|
9835 | * StreamingPullResponse subscriptionProperties.
|
9836 | * @member {google.pubsub.v1.StreamingPullResponse.ISubscriptionProperties|null|undefined} subscriptionProperties
|
9837 | * @memberof google.pubsub.v1.StreamingPullResponse
|
9838 | * @instance
|
9839 | */
|
9840 | StreamingPullResponse.prototype.subscriptionProperties = null;
|
9841 |
|
9842 | /**
|
9843 | * Creates a new StreamingPullResponse instance using the specified properties.
|
9844 | * @function create
|
9845 | * @memberof google.pubsub.v1.StreamingPullResponse
|
9846 | * @static
|
9847 | * @param {google.pubsub.v1.IStreamingPullResponse=} [properties] Properties to set
|
9848 | * @returns {google.pubsub.v1.StreamingPullResponse} StreamingPullResponse instance
|
9849 | */
|
9850 | StreamingPullResponse.create = function create(properties) {
|
9851 | return new StreamingPullResponse(properties);
|
9852 | };
|
9853 |
|
9854 | /**
|
9855 | * Encodes the specified StreamingPullResponse message. Does not implicitly {@link google.pubsub.v1.StreamingPullResponse.verify|verify} messages.
|
9856 | * @function encode
|
9857 | * @memberof google.pubsub.v1.StreamingPullResponse
|
9858 | * @static
|
9859 | * @param {google.pubsub.v1.IStreamingPullResponse} message StreamingPullResponse message or plain object to encode
|
9860 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
9861 | * @returns {$protobuf.Writer} Writer
|
9862 | */
|
9863 | StreamingPullResponse.encode = function encode(message, writer) {
|
9864 | if (!writer)
|
9865 | writer = $Writer.create();
|
9866 | if (message.receivedMessages != null && message.receivedMessages.length)
|
9867 | for (var i = 0; i < message.receivedMessages.length; ++i)
|
9868 | $root.google.pubsub.v1.ReceivedMessage.encode(message.receivedMessages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
9869 | if (message.modifyAckDeadlineConfirmation != null && Object.hasOwnProperty.call(message, "modifyAckDeadlineConfirmation"))
|
9870 | $root.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation.encode(message.modifyAckDeadlineConfirmation, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
|
9871 | if (message.subscriptionProperties != null && Object.hasOwnProperty.call(message, "subscriptionProperties"))
|
9872 | $root.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties.encode(message.subscriptionProperties, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
|
9873 | if (message.acknowledgeConfirmation != null && Object.hasOwnProperty.call(message, "acknowledgeConfirmation"))
|
9874 | $root.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation.encode(message.acknowledgeConfirmation, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
|
9875 | return writer;
|
9876 | };
|
9877 |
|
9878 | /**
|
9879 | * Encodes the specified StreamingPullResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.StreamingPullResponse.verify|verify} messages.
|
9880 | * @function encodeDelimited
|
9881 | * @memberof google.pubsub.v1.StreamingPullResponse
|
9882 | * @static
|
9883 | * @param {google.pubsub.v1.IStreamingPullResponse} message StreamingPullResponse message or plain object to encode
|
9884 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
9885 | * @returns {$protobuf.Writer} Writer
|
9886 | */
|
9887 | StreamingPullResponse.encodeDelimited = function encodeDelimited(message, writer) {
|
9888 | return this.encode(message, writer).ldelim();
|
9889 | };
|
9890 |
|
9891 | /**
|
9892 | * Decodes a StreamingPullResponse message from the specified reader or buffer.
|
9893 | * @function decode
|
9894 | * @memberof google.pubsub.v1.StreamingPullResponse
|
9895 | * @static
|
9896 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
9897 | * @param {number} [length] Message length if known beforehand
|
9898 | * @returns {google.pubsub.v1.StreamingPullResponse} StreamingPullResponse
|
9899 | * @throws {Error} If the payload is not a reader or valid buffer
|
9900 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
9901 | */
|
9902 | StreamingPullResponse.decode = function decode(reader, length) {
|
9903 | if (!(reader instanceof $Reader))
|
9904 | reader = $Reader.create(reader);
|
9905 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.StreamingPullResponse();
|
9906 | while (reader.pos < end) {
|
9907 | var tag = reader.uint32();
|
9908 | switch (tag >>> 3) {
|
9909 | case 1:
|
9910 | if (!(message.receivedMessages && message.receivedMessages.length))
|
9911 | message.receivedMessages = [];
|
9912 | message.receivedMessages.push($root.google.pubsub.v1.ReceivedMessage.decode(reader, reader.uint32()));
|
9913 | break;
|
9914 | case 5:
|
9915 | message.acknowledgeConfirmation = $root.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation.decode(reader, reader.uint32());
|
9916 | break;
|
9917 | case 3:
|
9918 | message.modifyAckDeadlineConfirmation = $root.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation.decode(reader, reader.uint32());
|
9919 | break;
|
9920 | case 4:
|
9921 | message.subscriptionProperties = $root.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties.decode(reader, reader.uint32());
|
9922 | break;
|
9923 | default:
|
9924 | reader.skipType(tag & 7);
|
9925 | break;
|
9926 | }
|
9927 | }
|
9928 | return message;
|
9929 | };
|
9930 |
|
9931 | /**
|
9932 | * Decodes a StreamingPullResponse message from the specified reader or buffer, length delimited.
|
9933 | * @function decodeDelimited
|
9934 | * @memberof google.pubsub.v1.StreamingPullResponse
|
9935 | * @static
|
9936 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
9937 | * @returns {google.pubsub.v1.StreamingPullResponse} StreamingPullResponse
|
9938 | * @throws {Error} If the payload is not a reader or valid buffer
|
9939 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
9940 | */
|
9941 | StreamingPullResponse.decodeDelimited = function decodeDelimited(reader) {
|
9942 | if (!(reader instanceof $Reader))
|
9943 | reader = new $Reader(reader);
|
9944 | return this.decode(reader, reader.uint32());
|
9945 | };
|
9946 |
|
9947 | /**
|
9948 | * Verifies a StreamingPullResponse message.
|
9949 | * @function verify
|
9950 | * @memberof google.pubsub.v1.StreamingPullResponse
|
9951 | * @static
|
9952 | * @param {Object.<string,*>} message Plain object to verify
|
9953 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
9954 | */
|
9955 | StreamingPullResponse.verify = function verify(message) {
|
9956 | if (typeof message !== "object" || message === null)
|
9957 | return "object expected";
|
9958 | if (message.receivedMessages != null && message.hasOwnProperty("receivedMessages")) {
|
9959 | if (!Array.isArray(message.receivedMessages))
|
9960 | return "receivedMessages: array expected";
|
9961 | for (var i = 0; i < message.receivedMessages.length; ++i) {
|
9962 | var error = $root.google.pubsub.v1.ReceivedMessage.verify(message.receivedMessages[i]);
|
9963 | if (error)
|
9964 | return "receivedMessages." + error;
|
9965 | }
|
9966 | }
|
9967 | if (message.acknowledgeConfirmation != null && message.hasOwnProperty("acknowledgeConfirmation")) {
|
9968 | var error = $root.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation.verify(message.acknowledgeConfirmation);
|
9969 | if (error)
|
9970 | return "acknowledgeConfirmation." + error;
|
9971 | }
|
9972 | if (message.modifyAckDeadlineConfirmation != null && message.hasOwnProperty("modifyAckDeadlineConfirmation")) {
|
9973 | var error = $root.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation.verify(message.modifyAckDeadlineConfirmation);
|
9974 | if (error)
|
9975 | return "modifyAckDeadlineConfirmation." + error;
|
9976 | }
|
9977 | if (message.subscriptionProperties != null && message.hasOwnProperty("subscriptionProperties")) {
|
9978 | var error = $root.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties.verify(message.subscriptionProperties);
|
9979 | if (error)
|
9980 | return "subscriptionProperties." + error;
|
9981 | }
|
9982 | return null;
|
9983 | };
|
9984 |
|
9985 | /**
|
9986 | * Creates a StreamingPullResponse message from a plain object. Also converts values to their respective internal types.
|
9987 | * @function fromObject
|
9988 | * @memberof google.pubsub.v1.StreamingPullResponse
|
9989 | * @static
|
9990 | * @param {Object.<string,*>} object Plain object
|
9991 | * @returns {google.pubsub.v1.StreamingPullResponse} StreamingPullResponse
|
9992 | */
|
9993 | StreamingPullResponse.fromObject = function fromObject(object) {
|
9994 | if (object instanceof $root.google.pubsub.v1.StreamingPullResponse)
|
9995 | return object;
|
9996 | var message = new $root.google.pubsub.v1.StreamingPullResponse();
|
9997 | if (object.receivedMessages) {
|
9998 | if (!Array.isArray(object.receivedMessages))
|
9999 | throw TypeError(".google.pubsub.v1.StreamingPullResponse.receivedMessages: array expected");
|
10000 | message.receivedMessages = [];
|
10001 | for (var i = 0; i < object.receivedMessages.length; ++i) {
|
10002 | if (typeof object.receivedMessages[i] !== "object")
|
10003 | throw TypeError(".google.pubsub.v1.StreamingPullResponse.receivedMessages: object expected");
|
10004 | message.receivedMessages[i] = $root.google.pubsub.v1.ReceivedMessage.fromObject(object.receivedMessages[i]);
|
10005 | }
|
10006 | }
|
10007 | if (object.acknowledgeConfirmation != null) {
|
10008 | if (typeof object.acknowledgeConfirmation !== "object")
|
10009 | throw TypeError(".google.pubsub.v1.StreamingPullResponse.acknowledgeConfirmation: object expected");
|
10010 | message.acknowledgeConfirmation = $root.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation.fromObject(object.acknowledgeConfirmation);
|
10011 | }
|
10012 | if (object.modifyAckDeadlineConfirmation != null) {
|
10013 | if (typeof object.modifyAckDeadlineConfirmation !== "object")
|
10014 | throw TypeError(".google.pubsub.v1.StreamingPullResponse.modifyAckDeadlineConfirmation: object expected");
|
10015 | message.modifyAckDeadlineConfirmation = $root.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation.fromObject(object.modifyAckDeadlineConfirmation);
|
10016 | }
|
10017 | if (object.subscriptionProperties != null) {
|
10018 | if (typeof object.subscriptionProperties !== "object")
|
10019 | throw TypeError(".google.pubsub.v1.StreamingPullResponse.subscriptionProperties: object expected");
|
10020 | message.subscriptionProperties = $root.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties.fromObject(object.subscriptionProperties);
|
10021 | }
|
10022 | return message;
|
10023 | };
|
10024 |
|
10025 | /**
|
10026 | * Creates a plain object from a StreamingPullResponse message. Also converts values to other types if specified.
|
10027 | * @function toObject
|
10028 | * @memberof google.pubsub.v1.StreamingPullResponse
|
10029 | * @static
|
10030 | * @param {google.pubsub.v1.StreamingPullResponse} message StreamingPullResponse
|
10031 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
10032 | * @returns {Object.<string,*>} Plain object
|
10033 | */
|
10034 | StreamingPullResponse.toObject = function toObject(message, options) {
|
10035 | if (!options)
|
10036 | options = {};
|
10037 | var object = {};
|
10038 | if (options.arrays || options.defaults)
|
10039 | object.receivedMessages = [];
|
10040 | if (options.defaults) {
|
10041 | object.modifyAckDeadlineConfirmation = null;
|
10042 | object.subscriptionProperties = null;
|
10043 | object.acknowledgeConfirmation = null;
|
10044 | }
|
10045 | if (message.receivedMessages && message.receivedMessages.length) {
|
10046 | object.receivedMessages = [];
|
10047 | for (var j = 0; j < message.receivedMessages.length; ++j)
|
10048 | object.receivedMessages[j] = $root.google.pubsub.v1.ReceivedMessage.toObject(message.receivedMessages[j], options);
|
10049 | }
|
10050 | if (message.modifyAckDeadlineConfirmation != null && message.hasOwnProperty("modifyAckDeadlineConfirmation"))
|
10051 | object.modifyAckDeadlineConfirmation = $root.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation.toObject(message.modifyAckDeadlineConfirmation, options);
|
10052 | if (message.subscriptionProperties != null && message.hasOwnProperty("subscriptionProperties"))
|
10053 | object.subscriptionProperties = $root.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties.toObject(message.subscriptionProperties, options);
|
10054 | if (message.acknowledgeConfirmation != null && message.hasOwnProperty("acknowledgeConfirmation"))
|
10055 | object.acknowledgeConfirmation = $root.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation.toObject(message.acknowledgeConfirmation, options);
|
10056 | return object;
|
10057 | };
|
10058 |
|
10059 | /**
|
10060 | * Converts this StreamingPullResponse to JSON.
|
10061 | * @function toJSON
|
10062 | * @memberof google.pubsub.v1.StreamingPullResponse
|
10063 | * @instance
|
10064 | * @returns {Object.<string,*>} JSON object
|
10065 | */
|
10066 | StreamingPullResponse.prototype.toJSON = function toJSON() {
|
10067 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
10068 | };
|
10069 |
|
10070 | StreamingPullResponse.AcknowledgeConfirmation = (function() {
|
10071 |
|
10072 | /**
|
10073 | * Properties of an AcknowledgeConfirmation.
|
10074 | * @memberof google.pubsub.v1.StreamingPullResponse
|
10075 | * @interface IAcknowledgeConfirmation
|
10076 | * @property {Array.<string>|null} [ackIds] AcknowledgeConfirmation ackIds
|
10077 | * @property {Array.<string>|null} [invalidAckIds] AcknowledgeConfirmation invalidAckIds
|
10078 | * @property {Array.<string>|null} [unorderedAckIds] AcknowledgeConfirmation unorderedAckIds
|
10079 | */
|
10080 |
|
10081 | /**
|
10082 | * Constructs a new AcknowledgeConfirmation.
|
10083 | * @memberof google.pubsub.v1.StreamingPullResponse
|
10084 | * @classdesc Represents an AcknowledgeConfirmation.
|
10085 | * @implements IAcknowledgeConfirmation
|
10086 | * @constructor
|
10087 | * @param {google.pubsub.v1.StreamingPullResponse.IAcknowledgeConfirmation=} [properties] Properties to set
|
10088 | */
|
10089 | function AcknowledgeConfirmation(properties) {
|
10090 | this.ackIds = [];
|
10091 | this.invalidAckIds = [];
|
10092 | this.unorderedAckIds = [];
|
10093 | if (properties)
|
10094 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
10095 | if (properties[keys[i]] != null)
|
10096 | this[keys[i]] = properties[keys[i]];
|
10097 | }
|
10098 |
|
10099 | /**
|
10100 | * AcknowledgeConfirmation ackIds.
|
10101 | * @member {Array.<string>} ackIds
|
10102 | * @memberof google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation
|
10103 | * @instance
|
10104 | */
|
10105 | AcknowledgeConfirmation.prototype.ackIds = $util.emptyArray;
|
10106 |
|
10107 | /**
|
10108 | * AcknowledgeConfirmation invalidAckIds.
|
10109 | * @member {Array.<string>} invalidAckIds
|
10110 | * @memberof google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation
|
10111 | * @instance
|
10112 | */
|
10113 | AcknowledgeConfirmation.prototype.invalidAckIds = $util.emptyArray;
|
10114 |
|
10115 | /**
|
10116 | * AcknowledgeConfirmation unorderedAckIds.
|
10117 | * @member {Array.<string>} unorderedAckIds
|
10118 | * @memberof google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation
|
10119 | * @instance
|
10120 | */
|
10121 | AcknowledgeConfirmation.prototype.unorderedAckIds = $util.emptyArray;
|
10122 |
|
10123 | /**
|
10124 | * Creates a new AcknowledgeConfirmation instance using the specified properties.
|
10125 | * @function create
|
10126 | * @memberof google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation
|
10127 | * @static
|
10128 | * @param {google.pubsub.v1.StreamingPullResponse.IAcknowledgeConfirmation=} [properties] Properties to set
|
10129 | * @returns {google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation} AcknowledgeConfirmation instance
|
10130 | */
|
10131 | AcknowledgeConfirmation.create = function create(properties) {
|
10132 | return new AcknowledgeConfirmation(properties);
|
10133 | };
|
10134 |
|
10135 | /**
|
10136 | * Encodes the specified AcknowledgeConfirmation message. Does not implicitly {@link google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation.verify|verify} messages.
|
10137 | * @function encode
|
10138 | * @memberof google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation
|
10139 | * @static
|
10140 | * @param {google.pubsub.v1.StreamingPullResponse.IAcknowledgeConfirmation} message AcknowledgeConfirmation message or plain object to encode
|
10141 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
10142 | * @returns {$protobuf.Writer} Writer
|
10143 | */
|
10144 | AcknowledgeConfirmation.encode = function encode(message, writer) {
|
10145 | if (!writer)
|
10146 | writer = $Writer.create();
|
10147 | if (message.ackIds != null && message.ackIds.length)
|
10148 | for (var i = 0; i < message.ackIds.length; ++i)
|
10149 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.ackIds[i]);
|
10150 | if (message.invalidAckIds != null && message.invalidAckIds.length)
|
10151 | for (var i = 0; i < message.invalidAckIds.length; ++i)
|
10152 | writer.uint32(/* id 2, wireType 2 =*/18).string(message.invalidAckIds[i]);
|
10153 | if (message.unorderedAckIds != null && message.unorderedAckIds.length)
|
10154 | for (var i = 0; i < message.unorderedAckIds.length; ++i)
|
10155 | writer.uint32(/* id 3, wireType 2 =*/26).string(message.unorderedAckIds[i]);
|
10156 | return writer;
|
10157 | };
|
10158 |
|
10159 | /**
|
10160 | * Encodes the specified AcknowledgeConfirmation message, length delimited. Does not implicitly {@link google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation.verify|verify} messages.
|
10161 | * @function encodeDelimited
|
10162 | * @memberof google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation
|
10163 | * @static
|
10164 | * @param {google.pubsub.v1.StreamingPullResponse.IAcknowledgeConfirmation} message AcknowledgeConfirmation message or plain object to encode
|
10165 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
10166 | * @returns {$protobuf.Writer} Writer
|
10167 | */
|
10168 | AcknowledgeConfirmation.encodeDelimited = function encodeDelimited(message, writer) {
|
10169 | return this.encode(message, writer).ldelim();
|
10170 | };
|
10171 |
|
10172 | /**
|
10173 | * Decodes an AcknowledgeConfirmation message from the specified reader or buffer.
|
10174 | * @function decode
|
10175 | * @memberof google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation
|
10176 | * @static
|
10177 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
10178 | * @param {number} [length] Message length if known beforehand
|
10179 | * @returns {google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation} AcknowledgeConfirmation
|
10180 | * @throws {Error} If the payload is not a reader or valid buffer
|
10181 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
10182 | */
|
10183 | AcknowledgeConfirmation.decode = function decode(reader, length) {
|
10184 | if (!(reader instanceof $Reader))
|
10185 | reader = $Reader.create(reader);
|
10186 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation();
|
10187 | while (reader.pos < end) {
|
10188 | var tag = reader.uint32();
|
10189 | switch (tag >>> 3) {
|
10190 | case 1:
|
10191 | if (!(message.ackIds && message.ackIds.length))
|
10192 | message.ackIds = [];
|
10193 | message.ackIds.push(reader.string());
|
10194 | break;
|
10195 | case 2:
|
10196 | if (!(message.invalidAckIds && message.invalidAckIds.length))
|
10197 | message.invalidAckIds = [];
|
10198 | message.invalidAckIds.push(reader.string());
|
10199 | break;
|
10200 | case 3:
|
10201 | if (!(message.unorderedAckIds && message.unorderedAckIds.length))
|
10202 | message.unorderedAckIds = [];
|
10203 | message.unorderedAckIds.push(reader.string());
|
10204 | break;
|
10205 | default:
|
10206 | reader.skipType(tag & 7);
|
10207 | break;
|
10208 | }
|
10209 | }
|
10210 | return message;
|
10211 | };
|
10212 |
|
10213 | /**
|
10214 | * Decodes an AcknowledgeConfirmation message from the specified reader or buffer, length delimited.
|
10215 | * @function decodeDelimited
|
10216 | * @memberof google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation
|
10217 | * @static
|
10218 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
10219 | * @returns {google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation} AcknowledgeConfirmation
|
10220 | * @throws {Error} If the payload is not a reader or valid buffer
|
10221 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
10222 | */
|
10223 | AcknowledgeConfirmation.decodeDelimited = function decodeDelimited(reader) {
|
10224 | if (!(reader instanceof $Reader))
|
10225 | reader = new $Reader(reader);
|
10226 | return this.decode(reader, reader.uint32());
|
10227 | };
|
10228 |
|
10229 | /**
|
10230 | * Verifies an AcknowledgeConfirmation message.
|
10231 | * @function verify
|
10232 | * @memberof google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation
|
10233 | * @static
|
10234 | * @param {Object.<string,*>} message Plain object to verify
|
10235 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
10236 | */
|
10237 | AcknowledgeConfirmation.verify = function verify(message) {
|
10238 | if (typeof message !== "object" || message === null)
|
10239 | return "object expected";
|
10240 | if (message.ackIds != null && message.hasOwnProperty("ackIds")) {
|
10241 | if (!Array.isArray(message.ackIds))
|
10242 | return "ackIds: array expected";
|
10243 | for (var i = 0; i < message.ackIds.length; ++i)
|
10244 | if (!$util.isString(message.ackIds[i]))
|
10245 | return "ackIds: string[] expected";
|
10246 | }
|
10247 | if (message.invalidAckIds != null && message.hasOwnProperty("invalidAckIds")) {
|
10248 | if (!Array.isArray(message.invalidAckIds))
|
10249 | return "invalidAckIds: array expected";
|
10250 | for (var i = 0; i < message.invalidAckIds.length; ++i)
|
10251 | if (!$util.isString(message.invalidAckIds[i]))
|
10252 | return "invalidAckIds: string[] expected";
|
10253 | }
|
10254 | if (message.unorderedAckIds != null && message.hasOwnProperty("unorderedAckIds")) {
|
10255 | if (!Array.isArray(message.unorderedAckIds))
|
10256 | return "unorderedAckIds: array expected";
|
10257 | for (var i = 0; i < message.unorderedAckIds.length; ++i)
|
10258 | if (!$util.isString(message.unorderedAckIds[i]))
|
10259 | return "unorderedAckIds: string[] expected";
|
10260 | }
|
10261 | return null;
|
10262 | };
|
10263 |
|
10264 | /**
|
10265 | * Creates an AcknowledgeConfirmation message from a plain object. Also converts values to their respective internal types.
|
10266 | * @function fromObject
|
10267 | * @memberof google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation
|
10268 | * @static
|
10269 | * @param {Object.<string,*>} object Plain object
|
10270 | * @returns {google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation} AcknowledgeConfirmation
|
10271 | */
|
10272 | AcknowledgeConfirmation.fromObject = function fromObject(object) {
|
10273 | if (object instanceof $root.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation)
|
10274 | return object;
|
10275 | var message = new $root.google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation();
|
10276 | if (object.ackIds) {
|
10277 | if (!Array.isArray(object.ackIds))
|
10278 | throw TypeError(".google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation.ackIds: array expected");
|
10279 | message.ackIds = [];
|
10280 | for (var i = 0; i < object.ackIds.length; ++i)
|
10281 | message.ackIds[i] = String(object.ackIds[i]);
|
10282 | }
|
10283 | if (object.invalidAckIds) {
|
10284 | if (!Array.isArray(object.invalidAckIds))
|
10285 | throw TypeError(".google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation.invalidAckIds: array expected");
|
10286 | message.invalidAckIds = [];
|
10287 | for (var i = 0; i < object.invalidAckIds.length; ++i)
|
10288 | message.invalidAckIds[i] = String(object.invalidAckIds[i]);
|
10289 | }
|
10290 | if (object.unorderedAckIds) {
|
10291 | if (!Array.isArray(object.unorderedAckIds))
|
10292 | throw TypeError(".google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation.unorderedAckIds: array expected");
|
10293 | message.unorderedAckIds = [];
|
10294 | for (var i = 0; i < object.unorderedAckIds.length; ++i)
|
10295 | message.unorderedAckIds[i] = String(object.unorderedAckIds[i]);
|
10296 | }
|
10297 | return message;
|
10298 | };
|
10299 |
|
10300 | /**
|
10301 | * Creates a plain object from an AcknowledgeConfirmation message. Also converts values to other types if specified.
|
10302 | * @function toObject
|
10303 | * @memberof google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation
|
10304 | * @static
|
10305 | * @param {google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation} message AcknowledgeConfirmation
|
10306 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
10307 | * @returns {Object.<string,*>} Plain object
|
10308 | */
|
10309 | AcknowledgeConfirmation.toObject = function toObject(message, options) {
|
10310 | if (!options)
|
10311 | options = {};
|
10312 | var object = {};
|
10313 | if (options.arrays || options.defaults) {
|
10314 | object.ackIds = [];
|
10315 | object.invalidAckIds = [];
|
10316 | object.unorderedAckIds = [];
|
10317 | }
|
10318 | if (message.ackIds && message.ackIds.length) {
|
10319 | object.ackIds = [];
|
10320 | for (var j = 0; j < message.ackIds.length; ++j)
|
10321 | object.ackIds[j] = message.ackIds[j];
|
10322 | }
|
10323 | if (message.invalidAckIds && message.invalidAckIds.length) {
|
10324 | object.invalidAckIds = [];
|
10325 | for (var j = 0; j < message.invalidAckIds.length; ++j)
|
10326 | object.invalidAckIds[j] = message.invalidAckIds[j];
|
10327 | }
|
10328 | if (message.unorderedAckIds && message.unorderedAckIds.length) {
|
10329 | object.unorderedAckIds = [];
|
10330 | for (var j = 0; j < message.unorderedAckIds.length; ++j)
|
10331 | object.unorderedAckIds[j] = message.unorderedAckIds[j];
|
10332 | }
|
10333 | return object;
|
10334 | };
|
10335 |
|
10336 | /**
|
10337 | * Converts this AcknowledgeConfirmation to JSON.
|
10338 | * @function toJSON
|
10339 | * @memberof google.pubsub.v1.StreamingPullResponse.AcknowledgeConfirmation
|
10340 | * @instance
|
10341 | * @returns {Object.<string,*>} JSON object
|
10342 | */
|
10343 | AcknowledgeConfirmation.prototype.toJSON = function toJSON() {
|
10344 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
10345 | };
|
10346 |
|
10347 | return AcknowledgeConfirmation;
|
10348 | })();
|
10349 |
|
10350 | StreamingPullResponse.ModifyAckDeadlineConfirmation = (function() {
|
10351 |
|
10352 | /**
|
10353 | * Properties of a ModifyAckDeadlineConfirmation.
|
10354 | * @memberof google.pubsub.v1.StreamingPullResponse
|
10355 | * @interface IModifyAckDeadlineConfirmation
|
10356 | * @property {Array.<string>|null} [ackIds] ModifyAckDeadlineConfirmation ackIds
|
10357 | * @property {Array.<string>|null} [invalidAckIds] ModifyAckDeadlineConfirmation invalidAckIds
|
10358 | */
|
10359 |
|
10360 | /**
|
10361 | * Constructs a new ModifyAckDeadlineConfirmation.
|
10362 | * @memberof google.pubsub.v1.StreamingPullResponse
|
10363 | * @classdesc Represents a ModifyAckDeadlineConfirmation.
|
10364 | * @implements IModifyAckDeadlineConfirmation
|
10365 | * @constructor
|
10366 | * @param {google.pubsub.v1.StreamingPullResponse.IModifyAckDeadlineConfirmation=} [properties] Properties to set
|
10367 | */
|
10368 | function ModifyAckDeadlineConfirmation(properties) {
|
10369 | this.ackIds = [];
|
10370 | this.invalidAckIds = [];
|
10371 | if (properties)
|
10372 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
10373 | if (properties[keys[i]] != null)
|
10374 | this[keys[i]] = properties[keys[i]];
|
10375 | }
|
10376 |
|
10377 | /**
|
10378 | * ModifyAckDeadlineConfirmation ackIds.
|
10379 | * @member {Array.<string>} ackIds
|
10380 | * @memberof google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation
|
10381 | * @instance
|
10382 | */
|
10383 | ModifyAckDeadlineConfirmation.prototype.ackIds = $util.emptyArray;
|
10384 |
|
10385 | /**
|
10386 | * ModifyAckDeadlineConfirmation invalidAckIds.
|
10387 | * @member {Array.<string>} invalidAckIds
|
10388 | * @memberof google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation
|
10389 | * @instance
|
10390 | */
|
10391 | ModifyAckDeadlineConfirmation.prototype.invalidAckIds = $util.emptyArray;
|
10392 |
|
10393 | /**
|
10394 | * Creates a new ModifyAckDeadlineConfirmation instance using the specified properties.
|
10395 | * @function create
|
10396 | * @memberof google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation
|
10397 | * @static
|
10398 | * @param {google.pubsub.v1.StreamingPullResponse.IModifyAckDeadlineConfirmation=} [properties] Properties to set
|
10399 | * @returns {google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation} ModifyAckDeadlineConfirmation instance
|
10400 | */
|
10401 | ModifyAckDeadlineConfirmation.create = function create(properties) {
|
10402 | return new ModifyAckDeadlineConfirmation(properties);
|
10403 | };
|
10404 |
|
10405 | /**
|
10406 | * Encodes the specified ModifyAckDeadlineConfirmation message. Does not implicitly {@link google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation.verify|verify} messages.
|
10407 | * @function encode
|
10408 | * @memberof google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation
|
10409 | * @static
|
10410 | * @param {google.pubsub.v1.StreamingPullResponse.IModifyAckDeadlineConfirmation} message ModifyAckDeadlineConfirmation message or plain object to encode
|
10411 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
10412 | * @returns {$protobuf.Writer} Writer
|
10413 | */
|
10414 | ModifyAckDeadlineConfirmation.encode = function encode(message, writer) {
|
10415 | if (!writer)
|
10416 | writer = $Writer.create();
|
10417 | if (message.ackIds != null && message.ackIds.length)
|
10418 | for (var i = 0; i < message.ackIds.length; ++i)
|
10419 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.ackIds[i]);
|
10420 | if (message.invalidAckIds != null && message.invalidAckIds.length)
|
10421 | for (var i = 0; i < message.invalidAckIds.length; ++i)
|
10422 | writer.uint32(/* id 2, wireType 2 =*/18).string(message.invalidAckIds[i]);
|
10423 | return writer;
|
10424 | };
|
10425 |
|
10426 | /**
|
10427 | * Encodes the specified ModifyAckDeadlineConfirmation message, length delimited. Does not implicitly {@link google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation.verify|verify} messages.
|
10428 | * @function encodeDelimited
|
10429 | * @memberof google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation
|
10430 | * @static
|
10431 | * @param {google.pubsub.v1.StreamingPullResponse.IModifyAckDeadlineConfirmation} message ModifyAckDeadlineConfirmation message or plain object to encode
|
10432 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
10433 | * @returns {$protobuf.Writer} Writer
|
10434 | */
|
10435 | ModifyAckDeadlineConfirmation.encodeDelimited = function encodeDelimited(message, writer) {
|
10436 | return this.encode(message, writer).ldelim();
|
10437 | };
|
10438 |
|
10439 | /**
|
10440 | * Decodes a ModifyAckDeadlineConfirmation message from the specified reader or buffer.
|
10441 | * @function decode
|
10442 | * @memberof google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation
|
10443 | * @static
|
10444 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
10445 | * @param {number} [length] Message length if known beforehand
|
10446 | * @returns {google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation} ModifyAckDeadlineConfirmation
|
10447 | * @throws {Error} If the payload is not a reader or valid buffer
|
10448 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
10449 | */
|
10450 | ModifyAckDeadlineConfirmation.decode = function decode(reader, length) {
|
10451 | if (!(reader instanceof $Reader))
|
10452 | reader = $Reader.create(reader);
|
10453 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation();
|
10454 | while (reader.pos < end) {
|
10455 | var tag = reader.uint32();
|
10456 | switch (tag >>> 3) {
|
10457 | case 1:
|
10458 | if (!(message.ackIds && message.ackIds.length))
|
10459 | message.ackIds = [];
|
10460 | message.ackIds.push(reader.string());
|
10461 | break;
|
10462 | case 2:
|
10463 | if (!(message.invalidAckIds && message.invalidAckIds.length))
|
10464 | message.invalidAckIds = [];
|
10465 | message.invalidAckIds.push(reader.string());
|
10466 | break;
|
10467 | default:
|
10468 | reader.skipType(tag & 7);
|
10469 | break;
|
10470 | }
|
10471 | }
|
10472 | return message;
|
10473 | };
|
10474 |
|
10475 | /**
|
10476 | * Decodes a ModifyAckDeadlineConfirmation message from the specified reader or buffer, length delimited.
|
10477 | * @function decodeDelimited
|
10478 | * @memberof google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation
|
10479 | * @static
|
10480 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
10481 | * @returns {google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation} ModifyAckDeadlineConfirmation
|
10482 | * @throws {Error} If the payload is not a reader or valid buffer
|
10483 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
10484 | */
|
10485 | ModifyAckDeadlineConfirmation.decodeDelimited = function decodeDelimited(reader) {
|
10486 | if (!(reader instanceof $Reader))
|
10487 | reader = new $Reader(reader);
|
10488 | return this.decode(reader, reader.uint32());
|
10489 | };
|
10490 |
|
10491 | /**
|
10492 | * Verifies a ModifyAckDeadlineConfirmation message.
|
10493 | * @function verify
|
10494 | * @memberof google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation
|
10495 | * @static
|
10496 | * @param {Object.<string,*>} message Plain object to verify
|
10497 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
10498 | */
|
10499 | ModifyAckDeadlineConfirmation.verify = function verify(message) {
|
10500 | if (typeof message !== "object" || message === null)
|
10501 | return "object expected";
|
10502 | if (message.ackIds != null && message.hasOwnProperty("ackIds")) {
|
10503 | if (!Array.isArray(message.ackIds))
|
10504 | return "ackIds: array expected";
|
10505 | for (var i = 0; i < message.ackIds.length; ++i)
|
10506 | if (!$util.isString(message.ackIds[i]))
|
10507 | return "ackIds: string[] expected";
|
10508 | }
|
10509 | if (message.invalidAckIds != null && message.hasOwnProperty("invalidAckIds")) {
|
10510 | if (!Array.isArray(message.invalidAckIds))
|
10511 | return "invalidAckIds: array expected";
|
10512 | for (var i = 0; i < message.invalidAckIds.length; ++i)
|
10513 | if (!$util.isString(message.invalidAckIds[i]))
|
10514 | return "invalidAckIds: string[] expected";
|
10515 | }
|
10516 | return null;
|
10517 | };
|
10518 |
|
10519 | /**
|
10520 | * Creates a ModifyAckDeadlineConfirmation message from a plain object. Also converts values to their respective internal types.
|
10521 | * @function fromObject
|
10522 | * @memberof google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation
|
10523 | * @static
|
10524 | * @param {Object.<string,*>} object Plain object
|
10525 | * @returns {google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation} ModifyAckDeadlineConfirmation
|
10526 | */
|
10527 | ModifyAckDeadlineConfirmation.fromObject = function fromObject(object) {
|
10528 | if (object instanceof $root.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation)
|
10529 | return object;
|
10530 | var message = new $root.google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation();
|
10531 | if (object.ackIds) {
|
10532 | if (!Array.isArray(object.ackIds))
|
10533 | throw TypeError(".google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation.ackIds: array expected");
|
10534 | message.ackIds = [];
|
10535 | for (var i = 0; i < object.ackIds.length; ++i)
|
10536 | message.ackIds[i] = String(object.ackIds[i]);
|
10537 | }
|
10538 | if (object.invalidAckIds) {
|
10539 | if (!Array.isArray(object.invalidAckIds))
|
10540 | throw TypeError(".google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation.invalidAckIds: array expected");
|
10541 | message.invalidAckIds = [];
|
10542 | for (var i = 0; i < object.invalidAckIds.length; ++i)
|
10543 | message.invalidAckIds[i] = String(object.invalidAckIds[i]);
|
10544 | }
|
10545 | return message;
|
10546 | };
|
10547 |
|
10548 | /**
|
10549 | * Creates a plain object from a ModifyAckDeadlineConfirmation message. Also converts values to other types if specified.
|
10550 | * @function toObject
|
10551 | * @memberof google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation
|
10552 | * @static
|
10553 | * @param {google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation} message ModifyAckDeadlineConfirmation
|
10554 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
10555 | * @returns {Object.<string,*>} Plain object
|
10556 | */
|
10557 | ModifyAckDeadlineConfirmation.toObject = function toObject(message, options) {
|
10558 | if (!options)
|
10559 | options = {};
|
10560 | var object = {};
|
10561 | if (options.arrays || options.defaults) {
|
10562 | object.ackIds = [];
|
10563 | object.invalidAckIds = [];
|
10564 | }
|
10565 | if (message.ackIds && message.ackIds.length) {
|
10566 | object.ackIds = [];
|
10567 | for (var j = 0; j < message.ackIds.length; ++j)
|
10568 | object.ackIds[j] = message.ackIds[j];
|
10569 | }
|
10570 | if (message.invalidAckIds && message.invalidAckIds.length) {
|
10571 | object.invalidAckIds = [];
|
10572 | for (var j = 0; j < message.invalidAckIds.length; ++j)
|
10573 | object.invalidAckIds[j] = message.invalidAckIds[j];
|
10574 | }
|
10575 | return object;
|
10576 | };
|
10577 |
|
10578 | /**
|
10579 | * Converts this ModifyAckDeadlineConfirmation to JSON.
|
10580 | * @function toJSON
|
10581 | * @memberof google.pubsub.v1.StreamingPullResponse.ModifyAckDeadlineConfirmation
|
10582 | * @instance
|
10583 | * @returns {Object.<string,*>} JSON object
|
10584 | */
|
10585 | ModifyAckDeadlineConfirmation.prototype.toJSON = function toJSON() {
|
10586 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
10587 | };
|
10588 |
|
10589 | return ModifyAckDeadlineConfirmation;
|
10590 | })();
|
10591 |
|
10592 | StreamingPullResponse.SubscriptionProperties = (function() {
|
10593 |
|
10594 | /**
|
10595 | * Properties of a SubscriptionProperties.
|
10596 | * @memberof google.pubsub.v1.StreamingPullResponse
|
10597 | * @interface ISubscriptionProperties
|
10598 | * @property {boolean|null} [exactlyOnceDeliveryEnabled] SubscriptionProperties exactlyOnceDeliveryEnabled
|
10599 | * @property {boolean|null} [messageOrderingEnabled] SubscriptionProperties messageOrderingEnabled
|
10600 | */
|
10601 |
|
10602 | /**
|
10603 | * Constructs a new SubscriptionProperties.
|
10604 | * @memberof google.pubsub.v1.StreamingPullResponse
|
10605 | * @classdesc Represents a SubscriptionProperties.
|
10606 | * @implements ISubscriptionProperties
|
10607 | * @constructor
|
10608 | * @param {google.pubsub.v1.StreamingPullResponse.ISubscriptionProperties=} [properties] Properties to set
|
10609 | */
|
10610 | function SubscriptionProperties(properties) {
|
10611 | if (properties)
|
10612 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
10613 | if (properties[keys[i]] != null)
|
10614 | this[keys[i]] = properties[keys[i]];
|
10615 | }
|
10616 |
|
10617 | /**
|
10618 | * SubscriptionProperties exactlyOnceDeliveryEnabled.
|
10619 | * @member {boolean} exactlyOnceDeliveryEnabled
|
10620 | * @memberof google.pubsub.v1.StreamingPullResponse.SubscriptionProperties
|
10621 | * @instance
|
10622 | */
|
10623 | SubscriptionProperties.prototype.exactlyOnceDeliveryEnabled = false;
|
10624 |
|
10625 | /**
|
10626 | * SubscriptionProperties messageOrderingEnabled.
|
10627 | * @member {boolean} messageOrderingEnabled
|
10628 | * @memberof google.pubsub.v1.StreamingPullResponse.SubscriptionProperties
|
10629 | * @instance
|
10630 | */
|
10631 | SubscriptionProperties.prototype.messageOrderingEnabled = false;
|
10632 |
|
10633 | /**
|
10634 | * Creates a new SubscriptionProperties instance using the specified properties.
|
10635 | * @function create
|
10636 | * @memberof google.pubsub.v1.StreamingPullResponse.SubscriptionProperties
|
10637 | * @static
|
10638 | * @param {google.pubsub.v1.StreamingPullResponse.ISubscriptionProperties=} [properties] Properties to set
|
10639 | * @returns {google.pubsub.v1.StreamingPullResponse.SubscriptionProperties} SubscriptionProperties instance
|
10640 | */
|
10641 | SubscriptionProperties.create = function create(properties) {
|
10642 | return new SubscriptionProperties(properties);
|
10643 | };
|
10644 |
|
10645 | /**
|
10646 | * Encodes the specified SubscriptionProperties message. Does not implicitly {@link google.pubsub.v1.StreamingPullResponse.SubscriptionProperties.verify|verify} messages.
|
10647 | * @function encode
|
10648 | * @memberof google.pubsub.v1.StreamingPullResponse.SubscriptionProperties
|
10649 | * @static
|
10650 | * @param {google.pubsub.v1.StreamingPullResponse.ISubscriptionProperties} message SubscriptionProperties message or plain object to encode
|
10651 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
10652 | * @returns {$protobuf.Writer} Writer
|
10653 | */
|
10654 | SubscriptionProperties.encode = function encode(message, writer) {
|
10655 | if (!writer)
|
10656 | writer = $Writer.create();
|
10657 | if (message.exactlyOnceDeliveryEnabled != null && Object.hasOwnProperty.call(message, "exactlyOnceDeliveryEnabled"))
|
10658 | writer.uint32(/* id 1, wireType 0 =*/8).bool(message.exactlyOnceDeliveryEnabled);
|
10659 | if (message.messageOrderingEnabled != null && Object.hasOwnProperty.call(message, "messageOrderingEnabled"))
|
10660 | writer.uint32(/* id 2, wireType 0 =*/16).bool(message.messageOrderingEnabled);
|
10661 | return writer;
|
10662 | };
|
10663 |
|
10664 | /**
|
10665 | * Encodes the specified SubscriptionProperties message, length delimited. Does not implicitly {@link google.pubsub.v1.StreamingPullResponse.SubscriptionProperties.verify|verify} messages.
|
10666 | * @function encodeDelimited
|
10667 | * @memberof google.pubsub.v1.StreamingPullResponse.SubscriptionProperties
|
10668 | * @static
|
10669 | * @param {google.pubsub.v1.StreamingPullResponse.ISubscriptionProperties} message SubscriptionProperties message or plain object to encode
|
10670 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
10671 | * @returns {$protobuf.Writer} Writer
|
10672 | */
|
10673 | SubscriptionProperties.encodeDelimited = function encodeDelimited(message, writer) {
|
10674 | return this.encode(message, writer).ldelim();
|
10675 | };
|
10676 |
|
10677 | /**
|
10678 | * Decodes a SubscriptionProperties message from the specified reader or buffer.
|
10679 | * @function decode
|
10680 | * @memberof google.pubsub.v1.StreamingPullResponse.SubscriptionProperties
|
10681 | * @static
|
10682 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
10683 | * @param {number} [length] Message length if known beforehand
|
10684 | * @returns {google.pubsub.v1.StreamingPullResponse.SubscriptionProperties} SubscriptionProperties
|
10685 | * @throws {Error} If the payload is not a reader or valid buffer
|
10686 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
10687 | */
|
10688 | SubscriptionProperties.decode = function decode(reader, length) {
|
10689 | if (!(reader instanceof $Reader))
|
10690 | reader = $Reader.create(reader);
|
10691 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties();
|
10692 | while (reader.pos < end) {
|
10693 | var tag = reader.uint32();
|
10694 | switch (tag >>> 3) {
|
10695 | case 1:
|
10696 | message.exactlyOnceDeliveryEnabled = reader.bool();
|
10697 | break;
|
10698 | case 2:
|
10699 | message.messageOrderingEnabled = reader.bool();
|
10700 | break;
|
10701 | default:
|
10702 | reader.skipType(tag & 7);
|
10703 | break;
|
10704 | }
|
10705 | }
|
10706 | return message;
|
10707 | };
|
10708 |
|
10709 | /**
|
10710 | * Decodes a SubscriptionProperties message from the specified reader or buffer, length delimited.
|
10711 | * @function decodeDelimited
|
10712 | * @memberof google.pubsub.v1.StreamingPullResponse.SubscriptionProperties
|
10713 | * @static
|
10714 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
10715 | * @returns {google.pubsub.v1.StreamingPullResponse.SubscriptionProperties} SubscriptionProperties
|
10716 | * @throws {Error} If the payload is not a reader or valid buffer
|
10717 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
10718 | */
|
10719 | SubscriptionProperties.decodeDelimited = function decodeDelimited(reader) {
|
10720 | if (!(reader instanceof $Reader))
|
10721 | reader = new $Reader(reader);
|
10722 | return this.decode(reader, reader.uint32());
|
10723 | };
|
10724 |
|
10725 | /**
|
10726 | * Verifies a SubscriptionProperties message.
|
10727 | * @function verify
|
10728 | * @memberof google.pubsub.v1.StreamingPullResponse.SubscriptionProperties
|
10729 | * @static
|
10730 | * @param {Object.<string,*>} message Plain object to verify
|
10731 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
10732 | */
|
10733 | SubscriptionProperties.verify = function verify(message) {
|
10734 | if (typeof message !== "object" || message === null)
|
10735 | return "object expected";
|
10736 | if (message.exactlyOnceDeliveryEnabled != null && message.hasOwnProperty("exactlyOnceDeliveryEnabled"))
|
10737 | if (typeof message.exactlyOnceDeliveryEnabled !== "boolean")
|
10738 | return "exactlyOnceDeliveryEnabled: boolean expected";
|
10739 | if (message.messageOrderingEnabled != null && message.hasOwnProperty("messageOrderingEnabled"))
|
10740 | if (typeof message.messageOrderingEnabled !== "boolean")
|
10741 | return "messageOrderingEnabled: boolean expected";
|
10742 | return null;
|
10743 | };
|
10744 |
|
10745 | /**
|
10746 | * Creates a SubscriptionProperties message from a plain object. Also converts values to their respective internal types.
|
10747 | * @function fromObject
|
10748 | * @memberof google.pubsub.v1.StreamingPullResponse.SubscriptionProperties
|
10749 | * @static
|
10750 | * @param {Object.<string,*>} object Plain object
|
10751 | * @returns {google.pubsub.v1.StreamingPullResponse.SubscriptionProperties} SubscriptionProperties
|
10752 | */
|
10753 | SubscriptionProperties.fromObject = function fromObject(object) {
|
10754 | if (object instanceof $root.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties)
|
10755 | return object;
|
10756 | var message = new $root.google.pubsub.v1.StreamingPullResponse.SubscriptionProperties();
|
10757 | if (object.exactlyOnceDeliveryEnabled != null)
|
10758 | message.exactlyOnceDeliveryEnabled = Boolean(object.exactlyOnceDeliveryEnabled);
|
10759 | if (object.messageOrderingEnabled != null)
|
10760 | message.messageOrderingEnabled = Boolean(object.messageOrderingEnabled);
|
10761 | return message;
|
10762 | };
|
10763 |
|
10764 | /**
|
10765 | * Creates a plain object from a SubscriptionProperties message. Also converts values to other types if specified.
|
10766 | * @function toObject
|
10767 | * @memberof google.pubsub.v1.StreamingPullResponse.SubscriptionProperties
|
10768 | * @static
|
10769 | * @param {google.pubsub.v1.StreamingPullResponse.SubscriptionProperties} message SubscriptionProperties
|
10770 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
10771 | * @returns {Object.<string,*>} Plain object
|
10772 | */
|
10773 | SubscriptionProperties.toObject = function toObject(message, options) {
|
10774 | if (!options)
|
10775 | options = {};
|
10776 | var object = {};
|
10777 | if (options.defaults) {
|
10778 | object.exactlyOnceDeliveryEnabled = false;
|
10779 | object.messageOrderingEnabled = false;
|
10780 | }
|
10781 | if (message.exactlyOnceDeliveryEnabled != null && message.hasOwnProperty("exactlyOnceDeliveryEnabled"))
|
10782 | object.exactlyOnceDeliveryEnabled = message.exactlyOnceDeliveryEnabled;
|
10783 | if (message.messageOrderingEnabled != null && message.hasOwnProperty("messageOrderingEnabled"))
|
10784 | object.messageOrderingEnabled = message.messageOrderingEnabled;
|
10785 | return object;
|
10786 | };
|
10787 |
|
10788 | /**
|
10789 | * Converts this SubscriptionProperties to JSON.
|
10790 | * @function toJSON
|
10791 | * @memberof google.pubsub.v1.StreamingPullResponse.SubscriptionProperties
|
10792 | * @instance
|
10793 | * @returns {Object.<string,*>} JSON object
|
10794 | */
|
10795 | SubscriptionProperties.prototype.toJSON = function toJSON() {
|
10796 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
10797 | };
|
10798 |
|
10799 | return SubscriptionProperties;
|
10800 | })();
|
10801 |
|
10802 | return StreamingPullResponse;
|
10803 | })();
|
10804 |
|
10805 | v1.CreateSnapshotRequest = (function() {
|
10806 |
|
10807 | /**
|
10808 | * Properties of a CreateSnapshotRequest.
|
10809 | * @memberof google.pubsub.v1
|
10810 | * @interface ICreateSnapshotRequest
|
10811 | * @property {string|null} [name] CreateSnapshotRequest name
|
10812 | * @property {string|null} [subscription] CreateSnapshotRequest subscription
|
10813 | * @property {Object.<string,string>|null} [labels] CreateSnapshotRequest labels
|
10814 | */
|
10815 |
|
10816 | /**
|
10817 | * Constructs a new CreateSnapshotRequest.
|
10818 | * @memberof google.pubsub.v1
|
10819 | * @classdesc Represents a CreateSnapshotRequest.
|
10820 | * @implements ICreateSnapshotRequest
|
10821 | * @constructor
|
10822 | * @param {google.pubsub.v1.ICreateSnapshotRequest=} [properties] Properties to set
|
10823 | */
|
10824 | function CreateSnapshotRequest(properties) {
|
10825 | this.labels = {};
|
10826 | if (properties)
|
10827 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
10828 | if (properties[keys[i]] != null)
|
10829 | this[keys[i]] = properties[keys[i]];
|
10830 | }
|
10831 |
|
10832 | /**
|
10833 | * CreateSnapshotRequest name.
|
10834 | * @member {string} name
|
10835 | * @memberof google.pubsub.v1.CreateSnapshotRequest
|
10836 | * @instance
|
10837 | */
|
10838 | CreateSnapshotRequest.prototype.name = "";
|
10839 |
|
10840 | /**
|
10841 | * CreateSnapshotRequest subscription.
|
10842 | * @member {string} subscription
|
10843 | * @memberof google.pubsub.v1.CreateSnapshotRequest
|
10844 | * @instance
|
10845 | */
|
10846 | CreateSnapshotRequest.prototype.subscription = "";
|
10847 |
|
10848 | /**
|
10849 | * CreateSnapshotRequest labels.
|
10850 | * @member {Object.<string,string>} labels
|
10851 | * @memberof google.pubsub.v1.CreateSnapshotRequest
|
10852 | * @instance
|
10853 | */
|
10854 | CreateSnapshotRequest.prototype.labels = $util.emptyObject;
|
10855 |
|
10856 | /**
|
10857 | * Creates a new CreateSnapshotRequest instance using the specified properties.
|
10858 | * @function create
|
10859 | * @memberof google.pubsub.v1.CreateSnapshotRequest
|
10860 | * @static
|
10861 | * @param {google.pubsub.v1.ICreateSnapshotRequest=} [properties] Properties to set
|
10862 | * @returns {google.pubsub.v1.CreateSnapshotRequest} CreateSnapshotRequest instance
|
10863 | */
|
10864 | CreateSnapshotRequest.create = function create(properties) {
|
10865 | return new CreateSnapshotRequest(properties);
|
10866 | };
|
10867 |
|
10868 | /**
|
10869 | * Encodes the specified CreateSnapshotRequest message. Does not implicitly {@link google.pubsub.v1.CreateSnapshotRequest.verify|verify} messages.
|
10870 | * @function encode
|
10871 | * @memberof google.pubsub.v1.CreateSnapshotRequest
|
10872 | * @static
|
10873 | * @param {google.pubsub.v1.ICreateSnapshotRequest} message CreateSnapshotRequest message or plain object to encode
|
10874 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
10875 | * @returns {$protobuf.Writer} Writer
|
10876 | */
|
10877 | CreateSnapshotRequest.encode = function encode(message, writer) {
|
10878 | if (!writer)
|
10879 | writer = $Writer.create();
|
10880 | if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
10881 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
|
10882 | if (message.subscription != null && Object.hasOwnProperty.call(message, "subscription"))
|
10883 | writer.uint32(/* id 2, wireType 2 =*/18).string(message.subscription);
|
10884 | if (message.labels != null && Object.hasOwnProperty.call(message, "labels"))
|
10885 | for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i)
|
10886 | writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim();
|
10887 | return writer;
|
10888 | };
|
10889 |
|
10890 | /**
|
10891 | * Encodes the specified CreateSnapshotRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.CreateSnapshotRequest.verify|verify} messages.
|
10892 | * @function encodeDelimited
|
10893 | * @memberof google.pubsub.v1.CreateSnapshotRequest
|
10894 | * @static
|
10895 | * @param {google.pubsub.v1.ICreateSnapshotRequest} message CreateSnapshotRequest message or plain object to encode
|
10896 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
10897 | * @returns {$protobuf.Writer} Writer
|
10898 | */
|
10899 | CreateSnapshotRequest.encodeDelimited = function encodeDelimited(message, writer) {
|
10900 | return this.encode(message, writer).ldelim();
|
10901 | };
|
10902 |
|
10903 | /**
|
10904 | * Decodes a CreateSnapshotRequest message from the specified reader or buffer.
|
10905 | * @function decode
|
10906 | * @memberof google.pubsub.v1.CreateSnapshotRequest
|
10907 | * @static
|
10908 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
10909 | * @param {number} [length] Message length if known beforehand
|
10910 | * @returns {google.pubsub.v1.CreateSnapshotRequest} CreateSnapshotRequest
|
10911 | * @throws {Error} If the payload is not a reader or valid buffer
|
10912 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
10913 | */
|
10914 | CreateSnapshotRequest.decode = function decode(reader, length) {
|
10915 | if (!(reader instanceof $Reader))
|
10916 | reader = $Reader.create(reader);
|
10917 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.CreateSnapshotRequest(), key, value;
|
10918 | while (reader.pos < end) {
|
10919 | var tag = reader.uint32();
|
10920 | switch (tag >>> 3) {
|
10921 | case 1:
|
10922 | message.name = reader.string();
|
10923 | break;
|
10924 | case 2:
|
10925 | message.subscription = reader.string();
|
10926 | break;
|
10927 | case 3:
|
10928 | if (message.labels === $util.emptyObject)
|
10929 | message.labels = {};
|
10930 | var end2 = reader.uint32() + reader.pos;
|
10931 | key = "";
|
10932 | value = "";
|
10933 | while (reader.pos < end2) {
|
10934 | var tag2 = reader.uint32();
|
10935 | switch (tag2 >>> 3) {
|
10936 | case 1:
|
10937 | key = reader.string();
|
10938 | break;
|
10939 | case 2:
|
10940 | value = reader.string();
|
10941 | break;
|
10942 | default:
|
10943 | reader.skipType(tag2 & 7);
|
10944 | break;
|
10945 | }
|
10946 | }
|
10947 | message.labels[key] = value;
|
10948 | break;
|
10949 | default:
|
10950 | reader.skipType(tag & 7);
|
10951 | break;
|
10952 | }
|
10953 | }
|
10954 | return message;
|
10955 | };
|
10956 |
|
10957 | /**
|
10958 | * Decodes a CreateSnapshotRequest message from the specified reader or buffer, length delimited.
|
10959 | * @function decodeDelimited
|
10960 | * @memberof google.pubsub.v1.CreateSnapshotRequest
|
10961 | * @static
|
10962 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
10963 | * @returns {google.pubsub.v1.CreateSnapshotRequest} CreateSnapshotRequest
|
10964 | * @throws {Error} If the payload is not a reader or valid buffer
|
10965 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
10966 | */
|
10967 | CreateSnapshotRequest.decodeDelimited = function decodeDelimited(reader) {
|
10968 | if (!(reader instanceof $Reader))
|
10969 | reader = new $Reader(reader);
|
10970 | return this.decode(reader, reader.uint32());
|
10971 | };
|
10972 |
|
10973 | /**
|
10974 | * Verifies a CreateSnapshotRequest message.
|
10975 | * @function verify
|
10976 | * @memberof google.pubsub.v1.CreateSnapshotRequest
|
10977 | * @static
|
10978 | * @param {Object.<string,*>} message Plain object to verify
|
10979 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
10980 | */
|
10981 | CreateSnapshotRequest.verify = function verify(message) {
|
10982 | if (typeof message !== "object" || message === null)
|
10983 | return "object expected";
|
10984 | if (message.name != null && message.hasOwnProperty("name"))
|
10985 | if (!$util.isString(message.name))
|
10986 | return "name: string expected";
|
10987 | if (message.subscription != null && message.hasOwnProperty("subscription"))
|
10988 | if (!$util.isString(message.subscription))
|
10989 | return "subscription: string expected";
|
10990 | if (message.labels != null && message.hasOwnProperty("labels")) {
|
10991 | if (!$util.isObject(message.labels))
|
10992 | return "labels: object expected";
|
10993 | var key = Object.keys(message.labels);
|
10994 | for (var i = 0; i < key.length; ++i)
|
10995 | if (!$util.isString(message.labels[key[i]]))
|
10996 | return "labels: string{k:string} expected";
|
10997 | }
|
10998 | return null;
|
10999 | };
|
11000 |
|
11001 | /**
|
11002 | * Creates a CreateSnapshotRequest message from a plain object. Also converts values to their respective internal types.
|
11003 | * @function fromObject
|
11004 | * @memberof google.pubsub.v1.CreateSnapshotRequest
|
11005 | * @static
|
11006 | * @param {Object.<string,*>} object Plain object
|
11007 | * @returns {google.pubsub.v1.CreateSnapshotRequest} CreateSnapshotRequest
|
11008 | */
|
11009 | CreateSnapshotRequest.fromObject = function fromObject(object) {
|
11010 | if (object instanceof $root.google.pubsub.v1.CreateSnapshotRequest)
|
11011 | return object;
|
11012 | var message = new $root.google.pubsub.v1.CreateSnapshotRequest();
|
11013 | if (object.name != null)
|
11014 | message.name = String(object.name);
|
11015 | if (object.subscription != null)
|
11016 | message.subscription = String(object.subscription);
|
11017 | if (object.labels) {
|
11018 | if (typeof object.labels !== "object")
|
11019 | throw TypeError(".google.pubsub.v1.CreateSnapshotRequest.labels: object expected");
|
11020 | message.labels = {};
|
11021 | for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i)
|
11022 | message.labels[keys[i]] = String(object.labels[keys[i]]);
|
11023 | }
|
11024 | return message;
|
11025 | };
|
11026 |
|
11027 | /**
|
11028 | * Creates a plain object from a CreateSnapshotRequest message. Also converts values to other types if specified.
|
11029 | * @function toObject
|
11030 | * @memberof google.pubsub.v1.CreateSnapshotRequest
|
11031 | * @static
|
11032 | * @param {google.pubsub.v1.CreateSnapshotRequest} message CreateSnapshotRequest
|
11033 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
11034 | * @returns {Object.<string,*>} Plain object
|
11035 | */
|
11036 | CreateSnapshotRequest.toObject = function toObject(message, options) {
|
11037 | if (!options)
|
11038 | options = {};
|
11039 | var object = {};
|
11040 | if (options.objects || options.defaults)
|
11041 | object.labels = {};
|
11042 | if (options.defaults) {
|
11043 | object.name = "";
|
11044 | object.subscription = "";
|
11045 | }
|
11046 | if (message.name != null && message.hasOwnProperty("name"))
|
11047 | object.name = message.name;
|
11048 | if (message.subscription != null && message.hasOwnProperty("subscription"))
|
11049 | object.subscription = message.subscription;
|
11050 | var keys2;
|
11051 | if (message.labels && (keys2 = Object.keys(message.labels)).length) {
|
11052 | object.labels = {};
|
11053 | for (var j = 0; j < keys2.length; ++j)
|
11054 | object.labels[keys2[j]] = message.labels[keys2[j]];
|
11055 | }
|
11056 | return object;
|
11057 | };
|
11058 |
|
11059 | /**
|
11060 | * Converts this CreateSnapshotRequest to JSON.
|
11061 | * @function toJSON
|
11062 | * @memberof google.pubsub.v1.CreateSnapshotRequest
|
11063 | * @instance
|
11064 | * @returns {Object.<string,*>} JSON object
|
11065 | */
|
11066 | CreateSnapshotRequest.prototype.toJSON = function toJSON() {
|
11067 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
11068 | };
|
11069 |
|
11070 | return CreateSnapshotRequest;
|
11071 | })();
|
11072 |
|
11073 | v1.UpdateSnapshotRequest = (function() {
|
11074 |
|
11075 | /**
|
11076 | * Properties of an UpdateSnapshotRequest.
|
11077 | * @memberof google.pubsub.v1
|
11078 | * @interface IUpdateSnapshotRequest
|
11079 | * @property {google.pubsub.v1.ISnapshot|null} [snapshot] UpdateSnapshotRequest snapshot
|
11080 | * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSnapshotRequest updateMask
|
11081 | */
|
11082 |
|
11083 | /**
|
11084 | * Constructs a new UpdateSnapshotRequest.
|
11085 | * @memberof google.pubsub.v1
|
11086 | * @classdesc Represents an UpdateSnapshotRequest.
|
11087 | * @implements IUpdateSnapshotRequest
|
11088 | * @constructor
|
11089 | * @param {google.pubsub.v1.IUpdateSnapshotRequest=} [properties] Properties to set
|
11090 | */
|
11091 | function UpdateSnapshotRequest(properties) {
|
11092 | if (properties)
|
11093 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
11094 | if (properties[keys[i]] != null)
|
11095 | this[keys[i]] = properties[keys[i]];
|
11096 | }
|
11097 |
|
11098 | /**
|
11099 | * UpdateSnapshotRequest snapshot.
|
11100 | * @member {google.pubsub.v1.ISnapshot|null|undefined} snapshot
|
11101 | * @memberof google.pubsub.v1.UpdateSnapshotRequest
|
11102 | * @instance
|
11103 | */
|
11104 | UpdateSnapshotRequest.prototype.snapshot = null;
|
11105 |
|
11106 | /**
|
11107 | * UpdateSnapshotRequest updateMask.
|
11108 | * @member {google.protobuf.IFieldMask|null|undefined} updateMask
|
11109 | * @memberof google.pubsub.v1.UpdateSnapshotRequest
|
11110 | * @instance
|
11111 | */
|
11112 | UpdateSnapshotRequest.prototype.updateMask = null;
|
11113 |
|
11114 | /**
|
11115 | * Creates a new UpdateSnapshotRequest instance using the specified properties.
|
11116 | * @function create
|
11117 | * @memberof google.pubsub.v1.UpdateSnapshotRequest
|
11118 | * @static
|
11119 | * @param {google.pubsub.v1.IUpdateSnapshotRequest=} [properties] Properties to set
|
11120 | * @returns {google.pubsub.v1.UpdateSnapshotRequest} UpdateSnapshotRequest instance
|
11121 | */
|
11122 | UpdateSnapshotRequest.create = function create(properties) {
|
11123 | return new UpdateSnapshotRequest(properties);
|
11124 | };
|
11125 |
|
11126 | /**
|
11127 | * Encodes the specified UpdateSnapshotRequest message. Does not implicitly {@link google.pubsub.v1.UpdateSnapshotRequest.verify|verify} messages.
|
11128 | * @function encode
|
11129 | * @memberof google.pubsub.v1.UpdateSnapshotRequest
|
11130 | * @static
|
11131 | * @param {google.pubsub.v1.IUpdateSnapshotRequest} message UpdateSnapshotRequest message or plain object to encode
|
11132 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
11133 | * @returns {$protobuf.Writer} Writer
|
11134 | */
|
11135 | UpdateSnapshotRequest.encode = function encode(message, writer) {
|
11136 | if (!writer)
|
11137 | writer = $Writer.create();
|
11138 | if (message.snapshot != null && Object.hasOwnProperty.call(message, "snapshot"))
|
11139 | $root.google.pubsub.v1.Snapshot.encode(message.snapshot, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
11140 | if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask"))
|
11141 | $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
11142 | return writer;
|
11143 | };
|
11144 |
|
11145 | /**
|
11146 | * Encodes the specified UpdateSnapshotRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.UpdateSnapshotRequest.verify|verify} messages.
|
11147 | * @function encodeDelimited
|
11148 | * @memberof google.pubsub.v1.UpdateSnapshotRequest
|
11149 | * @static
|
11150 | * @param {google.pubsub.v1.IUpdateSnapshotRequest} message UpdateSnapshotRequest message or plain object to encode
|
11151 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
11152 | * @returns {$protobuf.Writer} Writer
|
11153 | */
|
11154 | UpdateSnapshotRequest.encodeDelimited = function encodeDelimited(message, writer) {
|
11155 | return this.encode(message, writer).ldelim();
|
11156 | };
|
11157 |
|
11158 | /**
|
11159 | * Decodes an UpdateSnapshotRequest message from the specified reader or buffer.
|
11160 | * @function decode
|
11161 | * @memberof google.pubsub.v1.UpdateSnapshotRequest
|
11162 | * @static
|
11163 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
11164 | * @param {number} [length] Message length if known beforehand
|
11165 | * @returns {google.pubsub.v1.UpdateSnapshotRequest} UpdateSnapshotRequest
|
11166 | * @throws {Error} If the payload is not a reader or valid buffer
|
11167 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
11168 | */
|
11169 | UpdateSnapshotRequest.decode = function decode(reader, length) {
|
11170 | if (!(reader instanceof $Reader))
|
11171 | reader = $Reader.create(reader);
|
11172 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.UpdateSnapshotRequest();
|
11173 | while (reader.pos < end) {
|
11174 | var tag = reader.uint32();
|
11175 | switch (tag >>> 3) {
|
11176 | case 1:
|
11177 | message.snapshot = $root.google.pubsub.v1.Snapshot.decode(reader, reader.uint32());
|
11178 | break;
|
11179 | case 2:
|
11180 | message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32());
|
11181 | break;
|
11182 | default:
|
11183 | reader.skipType(tag & 7);
|
11184 | break;
|
11185 | }
|
11186 | }
|
11187 | return message;
|
11188 | };
|
11189 |
|
11190 | /**
|
11191 | * Decodes an UpdateSnapshotRequest message from the specified reader or buffer, length delimited.
|
11192 | * @function decodeDelimited
|
11193 | * @memberof google.pubsub.v1.UpdateSnapshotRequest
|
11194 | * @static
|
11195 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
11196 | * @returns {google.pubsub.v1.UpdateSnapshotRequest} UpdateSnapshotRequest
|
11197 | * @throws {Error} If the payload is not a reader or valid buffer
|
11198 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
11199 | */
|
11200 | UpdateSnapshotRequest.decodeDelimited = function decodeDelimited(reader) {
|
11201 | if (!(reader instanceof $Reader))
|
11202 | reader = new $Reader(reader);
|
11203 | return this.decode(reader, reader.uint32());
|
11204 | };
|
11205 |
|
11206 | /**
|
11207 | * Verifies an UpdateSnapshotRequest message.
|
11208 | * @function verify
|
11209 | * @memberof google.pubsub.v1.UpdateSnapshotRequest
|
11210 | * @static
|
11211 | * @param {Object.<string,*>} message Plain object to verify
|
11212 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
11213 | */
|
11214 | UpdateSnapshotRequest.verify = function verify(message) {
|
11215 | if (typeof message !== "object" || message === null)
|
11216 | return "object expected";
|
11217 | if (message.snapshot != null && message.hasOwnProperty("snapshot")) {
|
11218 | var error = $root.google.pubsub.v1.Snapshot.verify(message.snapshot);
|
11219 | if (error)
|
11220 | return "snapshot." + error;
|
11221 | }
|
11222 | if (message.updateMask != null && message.hasOwnProperty("updateMask")) {
|
11223 | var error = $root.google.protobuf.FieldMask.verify(message.updateMask);
|
11224 | if (error)
|
11225 | return "updateMask." + error;
|
11226 | }
|
11227 | return null;
|
11228 | };
|
11229 |
|
11230 | /**
|
11231 | * Creates an UpdateSnapshotRequest message from a plain object. Also converts values to their respective internal types.
|
11232 | * @function fromObject
|
11233 | * @memberof google.pubsub.v1.UpdateSnapshotRequest
|
11234 | * @static
|
11235 | * @param {Object.<string,*>} object Plain object
|
11236 | * @returns {google.pubsub.v1.UpdateSnapshotRequest} UpdateSnapshotRequest
|
11237 | */
|
11238 | UpdateSnapshotRequest.fromObject = function fromObject(object) {
|
11239 | if (object instanceof $root.google.pubsub.v1.UpdateSnapshotRequest)
|
11240 | return object;
|
11241 | var message = new $root.google.pubsub.v1.UpdateSnapshotRequest();
|
11242 | if (object.snapshot != null) {
|
11243 | if (typeof object.snapshot !== "object")
|
11244 | throw TypeError(".google.pubsub.v1.UpdateSnapshotRequest.snapshot: object expected");
|
11245 | message.snapshot = $root.google.pubsub.v1.Snapshot.fromObject(object.snapshot);
|
11246 | }
|
11247 | if (object.updateMask != null) {
|
11248 | if (typeof object.updateMask !== "object")
|
11249 | throw TypeError(".google.pubsub.v1.UpdateSnapshotRequest.updateMask: object expected");
|
11250 | message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask);
|
11251 | }
|
11252 | return message;
|
11253 | };
|
11254 |
|
11255 | /**
|
11256 | * Creates a plain object from an UpdateSnapshotRequest message. Also converts values to other types if specified.
|
11257 | * @function toObject
|
11258 | * @memberof google.pubsub.v1.UpdateSnapshotRequest
|
11259 | * @static
|
11260 | * @param {google.pubsub.v1.UpdateSnapshotRequest} message UpdateSnapshotRequest
|
11261 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
11262 | * @returns {Object.<string,*>} Plain object
|
11263 | */
|
11264 | UpdateSnapshotRequest.toObject = function toObject(message, options) {
|
11265 | if (!options)
|
11266 | options = {};
|
11267 | var object = {};
|
11268 | if (options.defaults) {
|
11269 | object.snapshot = null;
|
11270 | object.updateMask = null;
|
11271 | }
|
11272 | if (message.snapshot != null && message.hasOwnProperty("snapshot"))
|
11273 | object.snapshot = $root.google.pubsub.v1.Snapshot.toObject(message.snapshot, options);
|
11274 | if (message.updateMask != null && message.hasOwnProperty("updateMask"))
|
11275 | object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options);
|
11276 | return object;
|
11277 | };
|
11278 |
|
11279 | /**
|
11280 | * Converts this UpdateSnapshotRequest to JSON.
|
11281 | * @function toJSON
|
11282 | * @memberof google.pubsub.v1.UpdateSnapshotRequest
|
11283 | * @instance
|
11284 | * @returns {Object.<string,*>} JSON object
|
11285 | */
|
11286 | UpdateSnapshotRequest.prototype.toJSON = function toJSON() {
|
11287 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
11288 | };
|
11289 |
|
11290 | return UpdateSnapshotRequest;
|
11291 | })();
|
11292 |
|
11293 | v1.Snapshot = (function() {
|
11294 |
|
11295 | /**
|
11296 | * Properties of a Snapshot.
|
11297 | * @memberof google.pubsub.v1
|
11298 | * @interface ISnapshot
|
11299 | * @property {string|null} [name] Snapshot name
|
11300 | * @property {string|null} [topic] Snapshot topic
|
11301 | * @property {google.protobuf.ITimestamp|null} [expireTime] Snapshot expireTime
|
11302 | * @property {Object.<string,string>|null} [labels] Snapshot labels
|
11303 | */
|
11304 |
|
11305 | /**
|
11306 | * Constructs a new Snapshot.
|
11307 | * @memberof google.pubsub.v1
|
11308 | * @classdesc Represents a Snapshot.
|
11309 | * @implements ISnapshot
|
11310 | * @constructor
|
11311 | * @param {google.pubsub.v1.ISnapshot=} [properties] Properties to set
|
11312 | */
|
11313 | function Snapshot(properties) {
|
11314 | this.labels = {};
|
11315 | if (properties)
|
11316 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
11317 | if (properties[keys[i]] != null)
|
11318 | this[keys[i]] = properties[keys[i]];
|
11319 | }
|
11320 |
|
11321 | /**
|
11322 | * Snapshot name.
|
11323 | * @member {string} name
|
11324 | * @memberof google.pubsub.v1.Snapshot
|
11325 | * @instance
|
11326 | */
|
11327 | Snapshot.prototype.name = "";
|
11328 |
|
11329 | /**
|
11330 | * Snapshot topic.
|
11331 | * @member {string} topic
|
11332 | * @memberof google.pubsub.v1.Snapshot
|
11333 | * @instance
|
11334 | */
|
11335 | Snapshot.prototype.topic = "";
|
11336 |
|
11337 | /**
|
11338 | * Snapshot expireTime.
|
11339 | * @member {google.protobuf.ITimestamp|null|undefined} expireTime
|
11340 | * @memberof google.pubsub.v1.Snapshot
|
11341 | * @instance
|
11342 | */
|
11343 | Snapshot.prototype.expireTime = null;
|
11344 |
|
11345 | /**
|
11346 | * Snapshot labels.
|
11347 | * @member {Object.<string,string>} labels
|
11348 | * @memberof google.pubsub.v1.Snapshot
|
11349 | * @instance
|
11350 | */
|
11351 | Snapshot.prototype.labels = $util.emptyObject;
|
11352 |
|
11353 | /**
|
11354 | * Creates a new Snapshot instance using the specified properties.
|
11355 | * @function create
|
11356 | * @memberof google.pubsub.v1.Snapshot
|
11357 | * @static
|
11358 | * @param {google.pubsub.v1.ISnapshot=} [properties] Properties to set
|
11359 | * @returns {google.pubsub.v1.Snapshot} Snapshot instance
|
11360 | */
|
11361 | Snapshot.create = function create(properties) {
|
11362 | return new Snapshot(properties);
|
11363 | };
|
11364 |
|
11365 | /**
|
11366 | * Encodes the specified Snapshot message. Does not implicitly {@link google.pubsub.v1.Snapshot.verify|verify} messages.
|
11367 | * @function encode
|
11368 | * @memberof google.pubsub.v1.Snapshot
|
11369 | * @static
|
11370 | * @param {google.pubsub.v1.ISnapshot} message Snapshot message or plain object to encode
|
11371 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
11372 | * @returns {$protobuf.Writer} Writer
|
11373 | */
|
11374 | Snapshot.encode = function encode(message, writer) {
|
11375 | if (!writer)
|
11376 | writer = $Writer.create();
|
11377 | if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
11378 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
|
11379 | if (message.topic != null && Object.hasOwnProperty.call(message, "topic"))
|
11380 | writer.uint32(/* id 2, wireType 2 =*/18).string(message.topic);
|
11381 | if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime"))
|
11382 | $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
|
11383 | if (message.labels != null && Object.hasOwnProperty.call(message, "labels"))
|
11384 | for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i)
|
11385 | writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim();
|
11386 | return writer;
|
11387 | };
|
11388 |
|
11389 | /**
|
11390 | * Encodes the specified Snapshot message, length delimited. Does not implicitly {@link google.pubsub.v1.Snapshot.verify|verify} messages.
|
11391 | * @function encodeDelimited
|
11392 | * @memberof google.pubsub.v1.Snapshot
|
11393 | * @static
|
11394 | * @param {google.pubsub.v1.ISnapshot} message Snapshot message or plain object to encode
|
11395 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
11396 | * @returns {$protobuf.Writer} Writer
|
11397 | */
|
11398 | Snapshot.encodeDelimited = function encodeDelimited(message, writer) {
|
11399 | return this.encode(message, writer).ldelim();
|
11400 | };
|
11401 |
|
11402 | /**
|
11403 | * Decodes a Snapshot message from the specified reader or buffer.
|
11404 | * @function decode
|
11405 | * @memberof google.pubsub.v1.Snapshot
|
11406 | * @static
|
11407 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
11408 | * @param {number} [length] Message length if known beforehand
|
11409 | * @returns {google.pubsub.v1.Snapshot} Snapshot
|
11410 | * @throws {Error} If the payload is not a reader or valid buffer
|
11411 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
11412 | */
|
11413 | Snapshot.decode = function decode(reader, length) {
|
11414 | if (!(reader instanceof $Reader))
|
11415 | reader = $Reader.create(reader);
|
11416 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.Snapshot(), key, value;
|
11417 | while (reader.pos < end) {
|
11418 | var tag = reader.uint32();
|
11419 | switch (tag >>> 3) {
|
11420 | case 1:
|
11421 | message.name = reader.string();
|
11422 | break;
|
11423 | case 2:
|
11424 | message.topic = reader.string();
|
11425 | break;
|
11426 | case 3:
|
11427 | message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
|
11428 | break;
|
11429 | case 4:
|
11430 | if (message.labels === $util.emptyObject)
|
11431 | message.labels = {};
|
11432 | var end2 = reader.uint32() + reader.pos;
|
11433 | key = "";
|
11434 | value = "";
|
11435 | while (reader.pos < end2) {
|
11436 | var tag2 = reader.uint32();
|
11437 | switch (tag2 >>> 3) {
|
11438 | case 1:
|
11439 | key = reader.string();
|
11440 | break;
|
11441 | case 2:
|
11442 | value = reader.string();
|
11443 | break;
|
11444 | default:
|
11445 | reader.skipType(tag2 & 7);
|
11446 | break;
|
11447 | }
|
11448 | }
|
11449 | message.labels[key] = value;
|
11450 | break;
|
11451 | default:
|
11452 | reader.skipType(tag & 7);
|
11453 | break;
|
11454 | }
|
11455 | }
|
11456 | return message;
|
11457 | };
|
11458 |
|
11459 | /**
|
11460 | * Decodes a Snapshot message from the specified reader or buffer, length delimited.
|
11461 | * @function decodeDelimited
|
11462 | * @memberof google.pubsub.v1.Snapshot
|
11463 | * @static
|
11464 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
11465 | * @returns {google.pubsub.v1.Snapshot} Snapshot
|
11466 | * @throws {Error} If the payload is not a reader or valid buffer
|
11467 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
11468 | */
|
11469 | Snapshot.decodeDelimited = function decodeDelimited(reader) {
|
11470 | if (!(reader instanceof $Reader))
|
11471 | reader = new $Reader(reader);
|
11472 | return this.decode(reader, reader.uint32());
|
11473 | };
|
11474 |
|
11475 | /**
|
11476 | * Verifies a Snapshot message.
|
11477 | * @function verify
|
11478 | * @memberof google.pubsub.v1.Snapshot
|
11479 | * @static
|
11480 | * @param {Object.<string,*>} message Plain object to verify
|
11481 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
11482 | */
|
11483 | Snapshot.verify = function verify(message) {
|
11484 | if (typeof message !== "object" || message === null)
|
11485 | return "object expected";
|
11486 | if (message.name != null && message.hasOwnProperty("name"))
|
11487 | if (!$util.isString(message.name))
|
11488 | return "name: string expected";
|
11489 | if (message.topic != null && message.hasOwnProperty("topic"))
|
11490 | if (!$util.isString(message.topic))
|
11491 | return "topic: string expected";
|
11492 | if (message.expireTime != null && message.hasOwnProperty("expireTime")) {
|
11493 | var error = $root.google.protobuf.Timestamp.verify(message.expireTime);
|
11494 | if (error)
|
11495 | return "expireTime." + error;
|
11496 | }
|
11497 | if (message.labels != null && message.hasOwnProperty("labels")) {
|
11498 | if (!$util.isObject(message.labels))
|
11499 | return "labels: object expected";
|
11500 | var key = Object.keys(message.labels);
|
11501 | for (var i = 0; i < key.length; ++i)
|
11502 | if (!$util.isString(message.labels[key[i]]))
|
11503 | return "labels: string{k:string} expected";
|
11504 | }
|
11505 | return null;
|
11506 | };
|
11507 |
|
11508 | /**
|
11509 | * Creates a Snapshot message from a plain object. Also converts values to their respective internal types.
|
11510 | * @function fromObject
|
11511 | * @memberof google.pubsub.v1.Snapshot
|
11512 | * @static
|
11513 | * @param {Object.<string,*>} object Plain object
|
11514 | * @returns {google.pubsub.v1.Snapshot} Snapshot
|
11515 | */
|
11516 | Snapshot.fromObject = function fromObject(object) {
|
11517 | if (object instanceof $root.google.pubsub.v1.Snapshot)
|
11518 | return object;
|
11519 | var message = new $root.google.pubsub.v1.Snapshot();
|
11520 | if (object.name != null)
|
11521 | message.name = String(object.name);
|
11522 | if (object.topic != null)
|
11523 | message.topic = String(object.topic);
|
11524 | if (object.expireTime != null) {
|
11525 | if (typeof object.expireTime !== "object")
|
11526 | throw TypeError(".google.pubsub.v1.Snapshot.expireTime: object expected");
|
11527 | message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime);
|
11528 | }
|
11529 | if (object.labels) {
|
11530 | if (typeof object.labels !== "object")
|
11531 | throw TypeError(".google.pubsub.v1.Snapshot.labels: object expected");
|
11532 | message.labels = {};
|
11533 | for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i)
|
11534 | message.labels[keys[i]] = String(object.labels[keys[i]]);
|
11535 | }
|
11536 | return message;
|
11537 | };
|
11538 |
|
11539 | /**
|
11540 | * Creates a plain object from a Snapshot message. Also converts values to other types if specified.
|
11541 | * @function toObject
|
11542 | * @memberof google.pubsub.v1.Snapshot
|
11543 | * @static
|
11544 | * @param {google.pubsub.v1.Snapshot} message Snapshot
|
11545 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
11546 | * @returns {Object.<string,*>} Plain object
|
11547 | */
|
11548 | Snapshot.toObject = function toObject(message, options) {
|
11549 | if (!options)
|
11550 | options = {};
|
11551 | var object = {};
|
11552 | if (options.objects || options.defaults)
|
11553 | object.labels = {};
|
11554 | if (options.defaults) {
|
11555 | object.name = "";
|
11556 | object.topic = "";
|
11557 | object.expireTime = null;
|
11558 | }
|
11559 | if (message.name != null && message.hasOwnProperty("name"))
|
11560 | object.name = message.name;
|
11561 | if (message.topic != null && message.hasOwnProperty("topic"))
|
11562 | object.topic = message.topic;
|
11563 | if (message.expireTime != null && message.hasOwnProperty("expireTime"))
|
11564 | object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options);
|
11565 | var keys2;
|
11566 | if (message.labels && (keys2 = Object.keys(message.labels)).length) {
|
11567 | object.labels = {};
|
11568 | for (var j = 0; j < keys2.length; ++j)
|
11569 | object.labels[keys2[j]] = message.labels[keys2[j]];
|
11570 | }
|
11571 | return object;
|
11572 | };
|
11573 |
|
11574 | /**
|
11575 | * Converts this Snapshot to JSON.
|
11576 | * @function toJSON
|
11577 | * @memberof google.pubsub.v1.Snapshot
|
11578 | * @instance
|
11579 | * @returns {Object.<string,*>} JSON object
|
11580 | */
|
11581 | Snapshot.prototype.toJSON = function toJSON() {
|
11582 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
11583 | };
|
11584 |
|
11585 | return Snapshot;
|
11586 | })();
|
11587 |
|
11588 | v1.GetSnapshotRequest = (function() {
|
11589 |
|
11590 | /**
|
11591 | * Properties of a GetSnapshotRequest.
|
11592 | * @memberof google.pubsub.v1
|
11593 | * @interface IGetSnapshotRequest
|
11594 | * @property {string|null} [snapshot] GetSnapshotRequest snapshot
|
11595 | */
|
11596 |
|
11597 | /**
|
11598 | * Constructs a new GetSnapshotRequest.
|
11599 | * @memberof google.pubsub.v1
|
11600 | * @classdesc Represents a GetSnapshotRequest.
|
11601 | * @implements IGetSnapshotRequest
|
11602 | * @constructor
|
11603 | * @param {google.pubsub.v1.IGetSnapshotRequest=} [properties] Properties to set
|
11604 | */
|
11605 | function GetSnapshotRequest(properties) {
|
11606 | if (properties)
|
11607 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
11608 | if (properties[keys[i]] != null)
|
11609 | this[keys[i]] = properties[keys[i]];
|
11610 | }
|
11611 |
|
11612 | /**
|
11613 | * GetSnapshotRequest snapshot.
|
11614 | * @member {string} snapshot
|
11615 | * @memberof google.pubsub.v1.GetSnapshotRequest
|
11616 | * @instance
|
11617 | */
|
11618 | GetSnapshotRequest.prototype.snapshot = "";
|
11619 |
|
11620 | /**
|
11621 | * Creates a new GetSnapshotRequest instance using the specified properties.
|
11622 | * @function create
|
11623 | * @memberof google.pubsub.v1.GetSnapshotRequest
|
11624 | * @static
|
11625 | * @param {google.pubsub.v1.IGetSnapshotRequest=} [properties] Properties to set
|
11626 | * @returns {google.pubsub.v1.GetSnapshotRequest} GetSnapshotRequest instance
|
11627 | */
|
11628 | GetSnapshotRequest.create = function create(properties) {
|
11629 | return new GetSnapshotRequest(properties);
|
11630 | };
|
11631 |
|
11632 | /**
|
11633 | * Encodes the specified GetSnapshotRequest message. Does not implicitly {@link google.pubsub.v1.GetSnapshotRequest.verify|verify} messages.
|
11634 | * @function encode
|
11635 | * @memberof google.pubsub.v1.GetSnapshotRequest
|
11636 | * @static
|
11637 | * @param {google.pubsub.v1.IGetSnapshotRequest} message GetSnapshotRequest message or plain object to encode
|
11638 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
11639 | * @returns {$protobuf.Writer} Writer
|
11640 | */
|
11641 | GetSnapshotRequest.encode = function encode(message, writer) {
|
11642 | if (!writer)
|
11643 | writer = $Writer.create();
|
11644 | if (message.snapshot != null && Object.hasOwnProperty.call(message, "snapshot"))
|
11645 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.snapshot);
|
11646 | return writer;
|
11647 | };
|
11648 |
|
11649 | /**
|
11650 | * Encodes the specified GetSnapshotRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.GetSnapshotRequest.verify|verify} messages.
|
11651 | * @function encodeDelimited
|
11652 | * @memberof google.pubsub.v1.GetSnapshotRequest
|
11653 | * @static
|
11654 | * @param {google.pubsub.v1.IGetSnapshotRequest} message GetSnapshotRequest message or plain object to encode
|
11655 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
11656 | * @returns {$protobuf.Writer} Writer
|
11657 | */
|
11658 | GetSnapshotRequest.encodeDelimited = function encodeDelimited(message, writer) {
|
11659 | return this.encode(message, writer).ldelim();
|
11660 | };
|
11661 |
|
11662 | /**
|
11663 | * Decodes a GetSnapshotRequest message from the specified reader or buffer.
|
11664 | * @function decode
|
11665 | * @memberof google.pubsub.v1.GetSnapshotRequest
|
11666 | * @static
|
11667 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
11668 | * @param {number} [length] Message length if known beforehand
|
11669 | * @returns {google.pubsub.v1.GetSnapshotRequest} GetSnapshotRequest
|
11670 | * @throws {Error} If the payload is not a reader or valid buffer
|
11671 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
11672 | */
|
11673 | GetSnapshotRequest.decode = function decode(reader, length) {
|
11674 | if (!(reader instanceof $Reader))
|
11675 | reader = $Reader.create(reader);
|
11676 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.GetSnapshotRequest();
|
11677 | while (reader.pos < end) {
|
11678 | var tag = reader.uint32();
|
11679 | switch (tag >>> 3) {
|
11680 | case 1:
|
11681 | message.snapshot = reader.string();
|
11682 | break;
|
11683 | default:
|
11684 | reader.skipType(tag & 7);
|
11685 | break;
|
11686 | }
|
11687 | }
|
11688 | return message;
|
11689 | };
|
11690 |
|
11691 | /**
|
11692 | * Decodes a GetSnapshotRequest message from the specified reader or buffer, length delimited.
|
11693 | * @function decodeDelimited
|
11694 | * @memberof google.pubsub.v1.GetSnapshotRequest
|
11695 | * @static
|
11696 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
11697 | * @returns {google.pubsub.v1.GetSnapshotRequest} GetSnapshotRequest
|
11698 | * @throws {Error} If the payload is not a reader or valid buffer
|
11699 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
11700 | */
|
11701 | GetSnapshotRequest.decodeDelimited = function decodeDelimited(reader) {
|
11702 | if (!(reader instanceof $Reader))
|
11703 | reader = new $Reader(reader);
|
11704 | return this.decode(reader, reader.uint32());
|
11705 | };
|
11706 |
|
11707 | /**
|
11708 | * Verifies a GetSnapshotRequest message.
|
11709 | * @function verify
|
11710 | * @memberof google.pubsub.v1.GetSnapshotRequest
|
11711 | * @static
|
11712 | * @param {Object.<string,*>} message Plain object to verify
|
11713 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
11714 | */
|
11715 | GetSnapshotRequest.verify = function verify(message) {
|
11716 | if (typeof message !== "object" || message === null)
|
11717 | return "object expected";
|
11718 | if (message.snapshot != null && message.hasOwnProperty("snapshot"))
|
11719 | if (!$util.isString(message.snapshot))
|
11720 | return "snapshot: string expected";
|
11721 | return null;
|
11722 | };
|
11723 |
|
11724 | /**
|
11725 | * Creates a GetSnapshotRequest message from a plain object. Also converts values to their respective internal types.
|
11726 | * @function fromObject
|
11727 | * @memberof google.pubsub.v1.GetSnapshotRequest
|
11728 | * @static
|
11729 | * @param {Object.<string,*>} object Plain object
|
11730 | * @returns {google.pubsub.v1.GetSnapshotRequest} GetSnapshotRequest
|
11731 | */
|
11732 | GetSnapshotRequest.fromObject = function fromObject(object) {
|
11733 | if (object instanceof $root.google.pubsub.v1.GetSnapshotRequest)
|
11734 | return object;
|
11735 | var message = new $root.google.pubsub.v1.GetSnapshotRequest();
|
11736 | if (object.snapshot != null)
|
11737 | message.snapshot = String(object.snapshot);
|
11738 | return message;
|
11739 | };
|
11740 |
|
11741 | /**
|
11742 | * Creates a plain object from a GetSnapshotRequest message. Also converts values to other types if specified.
|
11743 | * @function toObject
|
11744 | * @memberof google.pubsub.v1.GetSnapshotRequest
|
11745 | * @static
|
11746 | * @param {google.pubsub.v1.GetSnapshotRequest} message GetSnapshotRequest
|
11747 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
11748 | * @returns {Object.<string,*>} Plain object
|
11749 | */
|
11750 | GetSnapshotRequest.toObject = function toObject(message, options) {
|
11751 | if (!options)
|
11752 | options = {};
|
11753 | var object = {};
|
11754 | if (options.defaults)
|
11755 | object.snapshot = "";
|
11756 | if (message.snapshot != null && message.hasOwnProperty("snapshot"))
|
11757 | object.snapshot = message.snapshot;
|
11758 | return object;
|
11759 | };
|
11760 |
|
11761 | /**
|
11762 | * Converts this GetSnapshotRequest to JSON.
|
11763 | * @function toJSON
|
11764 | * @memberof google.pubsub.v1.GetSnapshotRequest
|
11765 | * @instance
|
11766 | * @returns {Object.<string,*>} JSON object
|
11767 | */
|
11768 | GetSnapshotRequest.prototype.toJSON = function toJSON() {
|
11769 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
11770 | };
|
11771 |
|
11772 | return GetSnapshotRequest;
|
11773 | })();
|
11774 |
|
11775 | v1.ListSnapshotsRequest = (function() {
|
11776 |
|
11777 | /**
|
11778 | * Properties of a ListSnapshotsRequest.
|
11779 | * @memberof google.pubsub.v1
|
11780 | * @interface IListSnapshotsRequest
|
11781 | * @property {string|null} [project] ListSnapshotsRequest project
|
11782 | * @property {number|null} [pageSize] ListSnapshotsRequest pageSize
|
11783 | * @property {string|null} [pageToken] ListSnapshotsRequest pageToken
|
11784 | */
|
11785 |
|
11786 | /**
|
11787 | * Constructs a new ListSnapshotsRequest.
|
11788 | * @memberof google.pubsub.v1
|
11789 | * @classdesc Represents a ListSnapshotsRequest.
|
11790 | * @implements IListSnapshotsRequest
|
11791 | * @constructor
|
11792 | * @param {google.pubsub.v1.IListSnapshotsRequest=} [properties] Properties to set
|
11793 | */
|
11794 | function ListSnapshotsRequest(properties) {
|
11795 | if (properties)
|
11796 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
11797 | if (properties[keys[i]] != null)
|
11798 | this[keys[i]] = properties[keys[i]];
|
11799 | }
|
11800 |
|
11801 | /**
|
11802 | * ListSnapshotsRequest project.
|
11803 | * @member {string} project
|
11804 | * @memberof google.pubsub.v1.ListSnapshotsRequest
|
11805 | * @instance
|
11806 | */
|
11807 | ListSnapshotsRequest.prototype.project = "";
|
11808 |
|
11809 | /**
|
11810 | * ListSnapshotsRequest pageSize.
|
11811 | * @member {number} pageSize
|
11812 | * @memberof google.pubsub.v1.ListSnapshotsRequest
|
11813 | * @instance
|
11814 | */
|
11815 | ListSnapshotsRequest.prototype.pageSize = 0;
|
11816 |
|
11817 | /**
|
11818 | * ListSnapshotsRequest pageToken.
|
11819 | * @member {string} pageToken
|
11820 | * @memberof google.pubsub.v1.ListSnapshotsRequest
|
11821 | * @instance
|
11822 | */
|
11823 | ListSnapshotsRequest.prototype.pageToken = "";
|
11824 |
|
11825 | /**
|
11826 | * Creates a new ListSnapshotsRequest instance using the specified properties.
|
11827 | * @function create
|
11828 | * @memberof google.pubsub.v1.ListSnapshotsRequest
|
11829 | * @static
|
11830 | * @param {google.pubsub.v1.IListSnapshotsRequest=} [properties] Properties to set
|
11831 | * @returns {google.pubsub.v1.ListSnapshotsRequest} ListSnapshotsRequest instance
|
11832 | */
|
11833 | ListSnapshotsRequest.create = function create(properties) {
|
11834 | return new ListSnapshotsRequest(properties);
|
11835 | };
|
11836 |
|
11837 | /**
|
11838 | * Encodes the specified ListSnapshotsRequest message. Does not implicitly {@link google.pubsub.v1.ListSnapshotsRequest.verify|verify} messages.
|
11839 | * @function encode
|
11840 | * @memberof google.pubsub.v1.ListSnapshotsRequest
|
11841 | * @static
|
11842 | * @param {google.pubsub.v1.IListSnapshotsRequest} message ListSnapshotsRequest message or plain object to encode
|
11843 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
11844 | * @returns {$protobuf.Writer} Writer
|
11845 | */
|
11846 | ListSnapshotsRequest.encode = function encode(message, writer) {
|
11847 | if (!writer)
|
11848 | writer = $Writer.create();
|
11849 | if (message.project != null && Object.hasOwnProperty.call(message, "project"))
|
11850 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.project);
|
11851 | if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize"))
|
11852 | writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize);
|
11853 | if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken"))
|
11854 | writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken);
|
11855 | return writer;
|
11856 | };
|
11857 |
|
11858 | /**
|
11859 | * Encodes the specified ListSnapshotsRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ListSnapshotsRequest.verify|verify} messages.
|
11860 | * @function encodeDelimited
|
11861 | * @memberof google.pubsub.v1.ListSnapshotsRequest
|
11862 | * @static
|
11863 | * @param {google.pubsub.v1.IListSnapshotsRequest} message ListSnapshotsRequest message or plain object to encode
|
11864 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
11865 | * @returns {$protobuf.Writer} Writer
|
11866 | */
|
11867 | ListSnapshotsRequest.encodeDelimited = function encodeDelimited(message, writer) {
|
11868 | return this.encode(message, writer).ldelim();
|
11869 | };
|
11870 |
|
11871 | /**
|
11872 | * Decodes a ListSnapshotsRequest message from the specified reader or buffer.
|
11873 | * @function decode
|
11874 | * @memberof google.pubsub.v1.ListSnapshotsRequest
|
11875 | * @static
|
11876 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
11877 | * @param {number} [length] Message length if known beforehand
|
11878 | * @returns {google.pubsub.v1.ListSnapshotsRequest} ListSnapshotsRequest
|
11879 | * @throws {Error} If the payload is not a reader or valid buffer
|
11880 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
11881 | */
|
11882 | ListSnapshotsRequest.decode = function decode(reader, length) {
|
11883 | if (!(reader instanceof $Reader))
|
11884 | reader = $Reader.create(reader);
|
11885 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.ListSnapshotsRequest();
|
11886 | while (reader.pos < end) {
|
11887 | var tag = reader.uint32();
|
11888 | switch (tag >>> 3) {
|
11889 | case 1:
|
11890 | message.project = reader.string();
|
11891 | break;
|
11892 | case 2:
|
11893 | message.pageSize = reader.int32();
|
11894 | break;
|
11895 | case 3:
|
11896 | message.pageToken = reader.string();
|
11897 | break;
|
11898 | default:
|
11899 | reader.skipType(tag & 7);
|
11900 | break;
|
11901 | }
|
11902 | }
|
11903 | return message;
|
11904 | };
|
11905 |
|
11906 | /**
|
11907 | * Decodes a ListSnapshotsRequest message from the specified reader or buffer, length delimited.
|
11908 | * @function decodeDelimited
|
11909 | * @memberof google.pubsub.v1.ListSnapshotsRequest
|
11910 | * @static
|
11911 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
11912 | * @returns {google.pubsub.v1.ListSnapshotsRequest} ListSnapshotsRequest
|
11913 | * @throws {Error} If the payload is not a reader or valid buffer
|
11914 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
11915 | */
|
11916 | ListSnapshotsRequest.decodeDelimited = function decodeDelimited(reader) {
|
11917 | if (!(reader instanceof $Reader))
|
11918 | reader = new $Reader(reader);
|
11919 | return this.decode(reader, reader.uint32());
|
11920 | };
|
11921 |
|
11922 | /**
|
11923 | * Verifies a ListSnapshotsRequest message.
|
11924 | * @function verify
|
11925 | * @memberof google.pubsub.v1.ListSnapshotsRequest
|
11926 | * @static
|
11927 | * @param {Object.<string,*>} message Plain object to verify
|
11928 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
11929 | */
|
11930 | ListSnapshotsRequest.verify = function verify(message) {
|
11931 | if (typeof message !== "object" || message === null)
|
11932 | return "object expected";
|
11933 | if (message.project != null && message.hasOwnProperty("project"))
|
11934 | if (!$util.isString(message.project))
|
11935 | return "project: string expected";
|
11936 | if (message.pageSize != null && message.hasOwnProperty("pageSize"))
|
11937 | if (!$util.isInteger(message.pageSize))
|
11938 | return "pageSize: integer expected";
|
11939 | if (message.pageToken != null && message.hasOwnProperty("pageToken"))
|
11940 | if (!$util.isString(message.pageToken))
|
11941 | return "pageToken: string expected";
|
11942 | return null;
|
11943 | };
|
11944 |
|
11945 | /**
|
11946 | * Creates a ListSnapshotsRequest message from a plain object. Also converts values to their respective internal types.
|
11947 | * @function fromObject
|
11948 | * @memberof google.pubsub.v1.ListSnapshotsRequest
|
11949 | * @static
|
11950 | * @param {Object.<string,*>} object Plain object
|
11951 | * @returns {google.pubsub.v1.ListSnapshotsRequest} ListSnapshotsRequest
|
11952 | */
|
11953 | ListSnapshotsRequest.fromObject = function fromObject(object) {
|
11954 | if (object instanceof $root.google.pubsub.v1.ListSnapshotsRequest)
|
11955 | return object;
|
11956 | var message = new $root.google.pubsub.v1.ListSnapshotsRequest();
|
11957 | if (object.project != null)
|
11958 | message.project = String(object.project);
|
11959 | if (object.pageSize != null)
|
11960 | message.pageSize = object.pageSize | 0;
|
11961 | if (object.pageToken != null)
|
11962 | message.pageToken = String(object.pageToken);
|
11963 | return message;
|
11964 | };
|
11965 |
|
11966 | /**
|
11967 | * Creates a plain object from a ListSnapshotsRequest message. Also converts values to other types if specified.
|
11968 | * @function toObject
|
11969 | * @memberof google.pubsub.v1.ListSnapshotsRequest
|
11970 | * @static
|
11971 | * @param {google.pubsub.v1.ListSnapshotsRequest} message ListSnapshotsRequest
|
11972 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
11973 | * @returns {Object.<string,*>} Plain object
|
11974 | */
|
11975 | ListSnapshotsRequest.toObject = function toObject(message, options) {
|
11976 | if (!options)
|
11977 | options = {};
|
11978 | var object = {};
|
11979 | if (options.defaults) {
|
11980 | object.project = "";
|
11981 | object.pageSize = 0;
|
11982 | object.pageToken = "";
|
11983 | }
|
11984 | if (message.project != null && message.hasOwnProperty("project"))
|
11985 | object.project = message.project;
|
11986 | if (message.pageSize != null && message.hasOwnProperty("pageSize"))
|
11987 | object.pageSize = message.pageSize;
|
11988 | if (message.pageToken != null && message.hasOwnProperty("pageToken"))
|
11989 | object.pageToken = message.pageToken;
|
11990 | return object;
|
11991 | };
|
11992 |
|
11993 | /**
|
11994 | * Converts this ListSnapshotsRequest to JSON.
|
11995 | * @function toJSON
|
11996 | * @memberof google.pubsub.v1.ListSnapshotsRequest
|
11997 | * @instance
|
11998 | * @returns {Object.<string,*>} JSON object
|
11999 | */
|
12000 | ListSnapshotsRequest.prototype.toJSON = function toJSON() {
|
12001 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
12002 | };
|
12003 |
|
12004 | return ListSnapshotsRequest;
|
12005 | })();
|
12006 |
|
12007 | v1.ListSnapshotsResponse = (function() {
|
12008 |
|
12009 | /**
|
12010 | * Properties of a ListSnapshotsResponse.
|
12011 | * @memberof google.pubsub.v1
|
12012 | * @interface IListSnapshotsResponse
|
12013 | * @property {Array.<google.pubsub.v1.ISnapshot>|null} [snapshots] ListSnapshotsResponse snapshots
|
12014 | * @property {string|null} [nextPageToken] ListSnapshotsResponse nextPageToken
|
12015 | */
|
12016 |
|
12017 | /**
|
12018 | * Constructs a new ListSnapshotsResponse.
|
12019 | * @memberof google.pubsub.v1
|
12020 | * @classdesc Represents a ListSnapshotsResponse.
|
12021 | * @implements IListSnapshotsResponse
|
12022 | * @constructor
|
12023 | * @param {google.pubsub.v1.IListSnapshotsResponse=} [properties] Properties to set
|
12024 | */
|
12025 | function ListSnapshotsResponse(properties) {
|
12026 | this.snapshots = [];
|
12027 | if (properties)
|
12028 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
12029 | if (properties[keys[i]] != null)
|
12030 | this[keys[i]] = properties[keys[i]];
|
12031 | }
|
12032 |
|
12033 | /**
|
12034 | * ListSnapshotsResponse snapshots.
|
12035 | * @member {Array.<google.pubsub.v1.ISnapshot>} snapshots
|
12036 | * @memberof google.pubsub.v1.ListSnapshotsResponse
|
12037 | * @instance
|
12038 | */
|
12039 | ListSnapshotsResponse.prototype.snapshots = $util.emptyArray;
|
12040 |
|
12041 | /**
|
12042 | * ListSnapshotsResponse nextPageToken.
|
12043 | * @member {string} nextPageToken
|
12044 | * @memberof google.pubsub.v1.ListSnapshotsResponse
|
12045 | * @instance
|
12046 | */
|
12047 | ListSnapshotsResponse.prototype.nextPageToken = "";
|
12048 |
|
12049 | /**
|
12050 | * Creates a new ListSnapshotsResponse instance using the specified properties.
|
12051 | * @function create
|
12052 | * @memberof google.pubsub.v1.ListSnapshotsResponse
|
12053 | * @static
|
12054 | * @param {google.pubsub.v1.IListSnapshotsResponse=} [properties] Properties to set
|
12055 | * @returns {google.pubsub.v1.ListSnapshotsResponse} ListSnapshotsResponse instance
|
12056 | */
|
12057 | ListSnapshotsResponse.create = function create(properties) {
|
12058 | return new ListSnapshotsResponse(properties);
|
12059 | };
|
12060 |
|
12061 | /**
|
12062 | * Encodes the specified ListSnapshotsResponse message. Does not implicitly {@link google.pubsub.v1.ListSnapshotsResponse.verify|verify} messages.
|
12063 | * @function encode
|
12064 | * @memberof google.pubsub.v1.ListSnapshotsResponse
|
12065 | * @static
|
12066 | * @param {google.pubsub.v1.IListSnapshotsResponse} message ListSnapshotsResponse message or plain object to encode
|
12067 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
12068 | * @returns {$protobuf.Writer} Writer
|
12069 | */
|
12070 | ListSnapshotsResponse.encode = function encode(message, writer) {
|
12071 | if (!writer)
|
12072 | writer = $Writer.create();
|
12073 | if (message.snapshots != null && message.snapshots.length)
|
12074 | for (var i = 0; i < message.snapshots.length; ++i)
|
12075 | $root.google.pubsub.v1.Snapshot.encode(message.snapshots[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
12076 | if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken"))
|
12077 | writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken);
|
12078 | return writer;
|
12079 | };
|
12080 |
|
12081 | /**
|
12082 | * Encodes the specified ListSnapshotsResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ListSnapshotsResponse.verify|verify} messages.
|
12083 | * @function encodeDelimited
|
12084 | * @memberof google.pubsub.v1.ListSnapshotsResponse
|
12085 | * @static
|
12086 | * @param {google.pubsub.v1.IListSnapshotsResponse} message ListSnapshotsResponse message or plain object to encode
|
12087 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
12088 | * @returns {$protobuf.Writer} Writer
|
12089 | */
|
12090 | ListSnapshotsResponse.encodeDelimited = function encodeDelimited(message, writer) {
|
12091 | return this.encode(message, writer).ldelim();
|
12092 | };
|
12093 |
|
12094 | /**
|
12095 | * Decodes a ListSnapshotsResponse message from the specified reader or buffer.
|
12096 | * @function decode
|
12097 | * @memberof google.pubsub.v1.ListSnapshotsResponse
|
12098 | * @static
|
12099 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
12100 | * @param {number} [length] Message length if known beforehand
|
12101 | * @returns {google.pubsub.v1.ListSnapshotsResponse} ListSnapshotsResponse
|
12102 | * @throws {Error} If the payload is not a reader or valid buffer
|
12103 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
12104 | */
|
12105 | ListSnapshotsResponse.decode = function decode(reader, length) {
|
12106 | if (!(reader instanceof $Reader))
|
12107 | reader = $Reader.create(reader);
|
12108 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.ListSnapshotsResponse();
|
12109 | while (reader.pos < end) {
|
12110 | var tag = reader.uint32();
|
12111 | switch (tag >>> 3) {
|
12112 | case 1:
|
12113 | if (!(message.snapshots && message.snapshots.length))
|
12114 | message.snapshots = [];
|
12115 | message.snapshots.push($root.google.pubsub.v1.Snapshot.decode(reader, reader.uint32()));
|
12116 | break;
|
12117 | case 2:
|
12118 | message.nextPageToken = reader.string();
|
12119 | break;
|
12120 | default:
|
12121 | reader.skipType(tag & 7);
|
12122 | break;
|
12123 | }
|
12124 | }
|
12125 | return message;
|
12126 | };
|
12127 |
|
12128 | /**
|
12129 | * Decodes a ListSnapshotsResponse message from the specified reader or buffer, length delimited.
|
12130 | * @function decodeDelimited
|
12131 | * @memberof google.pubsub.v1.ListSnapshotsResponse
|
12132 | * @static
|
12133 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
12134 | * @returns {google.pubsub.v1.ListSnapshotsResponse} ListSnapshotsResponse
|
12135 | * @throws {Error} If the payload is not a reader or valid buffer
|
12136 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
12137 | */
|
12138 | ListSnapshotsResponse.decodeDelimited = function decodeDelimited(reader) {
|
12139 | if (!(reader instanceof $Reader))
|
12140 | reader = new $Reader(reader);
|
12141 | return this.decode(reader, reader.uint32());
|
12142 | };
|
12143 |
|
12144 | /**
|
12145 | * Verifies a ListSnapshotsResponse message.
|
12146 | * @function verify
|
12147 | * @memberof google.pubsub.v1.ListSnapshotsResponse
|
12148 | * @static
|
12149 | * @param {Object.<string,*>} message Plain object to verify
|
12150 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
12151 | */
|
12152 | ListSnapshotsResponse.verify = function verify(message) {
|
12153 | if (typeof message !== "object" || message === null)
|
12154 | return "object expected";
|
12155 | if (message.snapshots != null && message.hasOwnProperty("snapshots")) {
|
12156 | if (!Array.isArray(message.snapshots))
|
12157 | return "snapshots: array expected";
|
12158 | for (var i = 0; i < message.snapshots.length; ++i) {
|
12159 | var error = $root.google.pubsub.v1.Snapshot.verify(message.snapshots[i]);
|
12160 | if (error)
|
12161 | return "snapshots." + error;
|
12162 | }
|
12163 | }
|
12164 | if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken"))
|
12165 | if (!$util.isString(message.nextPageToken))
|
12166 | return "nextPageToken: string expected";
|
12167 | return null;
|
12168 | };
|
12169 |
|
12170 | /**
|
12171 | * Creates a ListSnapshotsResponse message from a plain object. Also converts values to their respective internal types.
|
12172 | * @function fromObject
|
12173 | * @memberof google.pubsub.v1.ListSnapshotsResponse
|
12174 | * @static
|
12175 | * @param {Object.<string,*>} object Plain object
|
12176 | * @returns {google.pubsub.v1.ListSnapshotsResponse} ListSnapshotsResponse
|
12177 | */
|
12178 | ListSnapshotsResponse.fromObject = function fromObject(object) {
|
12179 | if (object instanceof $root.google.pubsub.v1.ListSnapshotsResponse)
|
12180 | return object;
|
12181 | var message = new $root.google.pubsub.v1.ListSnapshotsResponse();
|
12182 | if (object.snapshots) {
|
12183 | if (!Array.isArray(object.snapshots))
|
12184 | throw TypeError(".google.pubsub.v1.ListSnapshotsResponse.snapshots: array expected");
|
12185 | message.snapshots = [];
|
12186 | for (var i = 0; i < object.snapshots.length; ++i) {
|
12187 | if (typeof object.snapshots[i] !== "object")
|
12188 | throw TypeError(".google.pubsub.v1.ListSnapshotsResponse.snapshots: object expected");
|
12189 | message.snapshots[i] = $root.google.pubsub.v1.Snapshot.fromObject(object.snapshots[i]);
|
12190 | }
|
12191 | }
|
12192 | if (object.nextPageToken != null)
|
12193 | message.nextPageToken = String(object.nextPageToken);
|
12194 | return message;
|
12195 | };
|
12196 |
|
12197 | /**
|
12198 | * Creates a plain object from a ListSnapshotsResponse message. Also converts values to other types if specified.
|
12199 | * @function toObject
|
12200 | * @memberof google.pubsub.v1.ListSnapshotsResponse
|
12201 | * @static
|
12202 | * @param {google.pubsub.v1.ListSnapshotsResponse} message ListSnapshotsResponse
|
12203 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
12204 | * @returns {Object.<string,*>} Plain object
|
12205 | */
|
12206 | ListSnapshotsResponse.toObject = function toObject(message, options) {
|
12207 | if (!options)
|
12208 | options = {};
|
12209 | var object = {};
|
12210 | if (options.arrays || options.defaults)
|
12211 | object.snapshots = [];
|
12212 | if (options.defaults)
|
12213 | object.nextPageToken = "";
|
12214 | if (message.snapshots && message.snapshots.length) {
|
12215 | object.snapshots = [];
|
12216 | for (var j = 0; j < message.snapshots.length; ++j)
|
12217 | object.snapshots[j] = $root.google.pubsub.v1.Snapshot.toObject(message.snapshots[j], options);
|
12218 | }
|
12219 | if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken"))
|
12220 | object.nextPageToken = message.nextPageToken;
|
12221 | return object;
|
12222 | };
|
12223 |
|
12224 | /**
|
12225 | * Converts this ListSnapshotsResponse to JSON.
|
12226 | * @function toJSON
|
12227 | * @memberof google.pubsub.v1.ListSnapshotsResponse
|
12228 | * @instance
|
12229 | * @returns {Object.<string,*>} JSON object
|
12230 | */
|
12231 | ListSnapshotsResponse.prototype.toJSON = function toJSON() {
|
12232 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
12233 | };
|
12234 |
|
12235 | return ListSnapshotsResponse;
|
12236 | })();
|
12237 |
|
12238 | v1.DeleteSnapshotRequest = (function() {
|
12239 |
|
12240 | /**
|
12241 | * Properties of a DeleteSnapshotRequest.
|
12242 | * @memberof google.pubsub.v1
|
12243 | * @interface IDeleteSnapshotRequest
|
12244 | * @property {string|null} [snapshot] DeleteSnapshotRequest snapshot
|
12245 | */
|
12246 |
|
12247 | /**
|
12248 | * Constructs a new DeleteSnapshotRequest.
|
12249 | * @memberof google.pubsub.v1
|
12250 | * @classdesc Represents a DeleteSnapshotRequest.
|
12251 | * @implements IDeleteSnapshotRequest
|
12252 | * @constructor
|
12253 | * @param {google.pubsub.v1.IDeleteSnapshotRequest=} [properties] Properties to set
|
12254 | */
|
12255 | function DeleteSnapshotRequest(properties) {
|
12256 | if (properties)
|
12257 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
12258 | if (properties[keys[i]] != null)
|
12259 | this[keys[i]] = properties[keys[i]];
|
12260 | }
|
12261 |
|
12262 | /**
|
12263 | * DeleteSnapshotRequest snapshot.
|
12264 | * @member {string} snapshot
|
12265 | * @memberof google.pubsub.v1.DeleteSnapshotRequest
|
12266 | * @instance
|
12267 | */
|
12268 | DeleteSnapshotRequest.prototype.snapshot = "";
|
12269 |
|
12270 | /**
|
12271 | * Creates a new DeleteSnapshotRequest instance using the specified properties.
|
12272 | * @function create
|
12273 | * @memberof google.pubsub.v1.DeleteSnapshotRequest
|
12274 | * @static
|
12275 | * @param {google.pubsub.v1.IDeleteSnapshotRequest=} [properties] Properties to set
|
12276 | * @returns {google.pubsub.v1.DeleteSnapshotRequest} DeleteSnapshotRequest instance
|
12277 | */
|
12278 | DeleteSnapshotRequest.create = function create(properties) {
|
12279 | return new DeleteSnapshotRequest(properties);
|
12280 | };
|
12281 |
|
12282 | /**
|
12283 | * Encodes the specified DeleteSnapshotRequest message. Does not implicitly {@link google.pubsub.v1.DeleteSnapshotRequest.verify|verify} messages.
|
12284 | * @function encode
|
12285 | * @memberof google.pubsub.v1.DeleteSnapshotRequest
|
12286 | * @static
|
12287 | * @param {google.pubsub.v1.IDeleteSnapshotRequest} message DeleteSnapshotRequest message or plain object to encode
|
12288 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
12289 | * @returns {$protobuf.Writer} Writer
|
12290 | */
|
12291 | DeleteSnapshotRequest.encode = function encode(message, writer) {
|
12292 | if (!writer)
|
12293 | writer = $Writer.create();
|
12294 | if (message.snapshot != null && Object.hasOwnProperty.call(message, "snapshot"))
|
12295 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.snapshot);
|
12296 | return writer;
|
12297 | };
|
12298 |
|
12299 | /**
|
12300 | * Encodes the specified DeleteSnapshotRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.DeleteSnapshotRequest.verify|verify} messages.
|
12301 | * @function encodeDelimited
|
12302 | * @memberof google.pubsub.v1.DeleteSnapshotRequest
|
12303 | * @static
|
12304 | * @param {google.pubsub.v1.IDeleteSnapshotRequest} message DeleteSnapshotRequest message or plain object to encode
|
12305 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
12306 | * @returns {$protobuf.Writer} Writer
|
12307 | */
|
12308 | DeleteSnapshotRequest.encodeDelimited = function encodeDelimited(message, writer) {
|
12309 | return this.encode(message, writer).ldelim();
|
12310 | };
|
12311 |
|
12312 | /**
|
12313 | * Decodes a DeleteSnapshotRequest message from the specified reader or buffer.
|
12314 | * @function decode
|
12315 | * @memberof google.pubsub.v1.DeleteSnapshotRequest
|
12316 | * @static
|
12317 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
12318 | * @param {number} [length] Message length if known beforehand
|
12319 | * @returns {google.pubsub.v1.DeleteSnapshotRequest} DeleteSnapshotRequest
|
12320 | * @throws {Error} If the payload is not a reader or valid buffer
|
12321 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
12322 | */
|
12323 | DeleteSnapshotRequest.decode = function decode(reader, length) {
|
12324 | if (!(reader instanceof $Reader))
|
12325 | reader = $Reader.create(reader);
|
12326 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.DeleteSnapshotRequest();
|
12327 | while (reader.pos < end) {
|
12328 | var tag = reader.uint32();
|
12329 | switch (tag >>> 3) {
|
12330 | case 1:
|
12331 | message.snapshot = reader.string();
|
12332 | break;
|
12333 | default:
|
12334 | reader.skipType(tag & 7);
|
12335 | break;
|
12336 | }
|
12337 | }
|
12338 | return message;
|
12339 | };
|
12340 |
|
12341 | /**
|
12342 | * Decodes a DeleteSnapshotRequest message from the specified reader or buffer, length delimited.
|
12343 | * @function decodeDelimited
|
12344 | * @memberof google.pubsub.v1.DeleteSnapshotRequest
|
12345 | * @static
|
12346 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
12347 | * @returns {google.pubsub.v1.DeleteSnapshotRequest} DeleteSnapshotRequest
|
12348 | * @throws {Error} If the payload is not a reader or valid buffer
|
12349 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
12350 | */
|
12351 | DeleteSnapshotRequest.decodeDelimited = function decodeDelimited(reader) {
|
12352 | if (!(reader instanceof $Reader))
|
12353 | reader = new $Reader(reader);
|
12354 | return this.decode(reader, reader.uint32());
|
12355 | };
|
12356 |
|
12357 | /**
|
12358 | * Verifies a DeleteSnapshotRequest message.
|
12359 | * @function verify
|
12360 | * @memberof google.pubsub.v1.DeleteSnapshotRequest
|
12361 | * @static
|
12362 | * @param {Object.<string,*>} message Plain object to verify
|
12363 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
12364 | */
|
12365 | DeleteSnapshotRequest.verify = function verify(message) {
|
12366 | if (typeof message !== "object" || message === null)
|
12367 | return "object expected";
|
12368 | if (message.snapshot != null && message.hasOwnProperty("snapshot"))
|
12369 | if (!$util.isString(message.snapshot))
|
12370 | return "snapshot: string expected";
|
12371 | return null;
|
12372 | };
|
12373 |
|
12374 | /**
|
12375 | * Creates a DeleteSnapshotRequest message from a plain object. Also converts values to their respective internal types.
|
12376 | * @function fromObject
|
12377 | * @memberof google.pubsub.v1.DeleteSnapshotRequest
|
12378 | * @static
|
12379 | * @param {Object.<string,*>} object Plain object
|
12380 | * @returns {google.pubsub.v1.DeleteSnapshotRequest} DeleteSnapshotRequest
|
12381 | */
|
12382 | DeleteSnapshotRequest.fromObject = function fromObject(object) {
|
12383 | if (object instanceof $root.google.pubsub.v1.DeleteSnapshotRequest)
|
12384 | return object;
|
12385 | var message = new $root.google.pubsub.v1.DeleteSnapshotRequest();
|
12386 | if (object.snapshot != null)
|
12387 | message.snapshot = String(object.snapshot);
|
12388 | return message;
|
12389 | };
|
12390 |
|
12391 | /**
|
12392 | * Creates a plain object from a DeleteSnapshotRequest message. Also converts values to other types if specified.
|
12393 | * @function toObject
|
12394 | * @memberof google.pubsub.v1.DeleteSnapshotRequest
|
12395 | * @static
|
12396 | * @param {google.pubsub.v1.DeleteSnapshotRequest} message DeleteSnapshotRequest
|
12397 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
12398 | * @returns {Object.<string,*>} Plain object
|
12399 | */
|
12400 | DeleteSnapshotRequest.toObject = function toObject(message, options) {
|
12401 | if (!options)
|
12402 | options = {};
|
12403 | var object = {};
|
12404 | if (options.defaults)
|
12405 | object.snapshot = "";
|
12406 | if (message.snapshot != null && message.hasOwnProperty("snapshot"))
|
12407 | object.snapshot = message.snapshot;
|
12408 | return object;
|
12409 | };
|
12410 |
|
12411 | /**
|
12412 | * Converts this DeleteSnapshotRequest to JSON.
|
12413 | * @function toJSON
|
12414 | * @memberof google.pubsub.v1.DeleteSnapshotRequest
|
12415 | * @instance
|
12416 | * @returns {Object.<string,*>} JSON object
|
12417 | */
|
12418 | DeleteSnapshotRequest.prototype.toJSON = function toJSON() {
|
12419 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
12420 | };
|
12421 |
|
12422 | return DeleteSnapshotRequest;
|
12423 | })();
|
12424 |
|
12425 | v1.SeekRequest = (function() {
|
12426 |
|
12427 | /**
|
12428 | * Properties of a SeekRequest.
|
12429 | * @memberof google.pubsub.v1
|
12430 | * @interface ISeekRequest
|
12431 | * @property {string|null} [subscription] SeekRequest subscription
|
12432 | * @property {google.protobuf.ITimestamp|null} [time] SeekRequest time
|
12433 | * @property {string|null} [snapshot] SeekRequest snapshot
|
12434 | */
|
12435 |
|
12436 | /**
|
12437 | * Constructs a new SeekRequest.
|
12438 | * @memberof google.pubsub.v1
|
12439 | * @classdesc Represents a SeekRequest.
|
12440 | * @implements ISeekRequest
|
12441 | * @constructor
|
12442 | * @param {google.pubsub.v1.ISeekRequest=} [properties] Properties to set
|
12443 | */
|
12444 | function SeekRequest(properties) {
|
12445 | if (properties)
|
12446 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
12447 | if (properties[keys[i]] != null)
|
12448 | this[keys[i]] = properties[keys[i]];
|
12449 | }
|
12450 |
|
12451 | /**
|
12452 | * SeekRequest subscription.
|
12453 | * @member {string} subscription
|
12454 | * @memberof google.pubsub.v1.SeekRequest
|
12455 | * @instance
|
12456 | */
|
12457 | SeekRequest.prototype.subscription = "";
|
12458 |
|
12459 | /**
|
12460 | * SeekRequest time.
|
12461 | * @member {google.protobuf.ITimestamp|null|undefined} time
|
12462 | * @memberof google.pubsub.v1.SeekRequest
|
12463 | * @instance
|
12464 | */
|
12465 | SeekRequest.prototype.time = null;
|
12466 |
|
12467 | /**
|
12468 | * SeekRequest snapshot.
|
12469 | * @member {string|null|undefined} snapshot
|
12470 | * @memberof google.pubsub.v1.SeekRequest
|
12471 | * @instance
|
12472 | */
|
12473 | SeekRequest.prototype.snapshot = null;
|
12474 |
|
12475 | // OneOf field names bound to virtual getters and setters
|
12476 | var $oneOfFields;
|
12477 |
|
12478 | /**
|
12479 | * SeekRequest target.
|
12480 | * @member {"time"|"snapshot"|undefined} target
|
12481 | * @memberof google.pubsub.v1.SeekRequest
|
12482 | * @instance
|
12483 | */
|
12484 | Object.defineProperty(SeekRequest.prototype, "target", {
|
12485 | get: $util.oneOfGetter($oneOfFields = ["time", "snapshot"]),
|
12486 | set: $util.oneOfSetter($oneOfFields)
|
12487 | });
|
12488 |
|
12489 | /**
|
12490 | * Creates a new SeekRequest instance using the specified properties.
|
12491 | * @function create
|
12492 | * @memberof google.pubsub.v1.SeekRequest
|
12493 | * @static
|
12494 | * @param {google.pubsub.v1.ISeekRequest=} [properties] Properties to set
|
12495 | * @returns {google.pubsub.v1.SeekRequest} SeekRequest instance
|
12496 | */
|
12497 | SeekRequest.create = function create(properties) {
|
12498 | return new SeekRequest(properties);
|
12499 | };
|
12500 |
|
12501 | /**
|
12502 | * Encodes the specified SeekRequest message. Does not implicitly {@link google.pubsub.v1.SeekRequest.verify|verify} messages.
|
12503 | * @function encode
|
12504 | * @memberof google.pubsub.v1.SeekRequest
|
12505 | * @static
|
12506 | * @param {google.pubsub.v1.ISeekRequest} message SeekRequest message or plain object to encode
|
12507 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
12508 | * @returns {$protobuf.Writer} Writer
|
12509 | */
|
12510 | SeekRequest.encode = function encode(message, writer) {
|
12511 | if (!writer)
|
12512 | writer = $Writer.create();
|
12513 | if (message.subscription != null && Object.hasOwnProperty.call(message, "subscription"))
|
12514 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.subscription);
|
12515 | if (message.time != null && Object.hasOwnProperty.call(message, "time"))
|
12516 | $root.google.protobuf.Timestamp.encode(message.time, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
12517 | if (message.snapshot != null && Object.hasOwnProperty.call(message, "snapshot"))
|
12518 | writer.uint32(/* id 3, wireType 2 =*/26).string(message.snapshot);
|
12519 | return writer;
|
12520 | };
|
12521 |
|
12522 | /**
|
12523 | * Encodes the specified SeekRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.SeekRequest.verify|verify} messages.
|
12524 | * @function encodeDelimited
|
12525 | * @memberof google.pubsub.v1.SeekRequest
|
12526 | * @static
|
12527 | * @param {google.pubsub.v1.ISeekRequest} message SeekRequest message or plain object to encode
|
12528 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
12529 | * @returns {$protobuf.Writer} Writer
|
12530 | */
|
12531 | SeekRequest.encodeDelimited = function encodeDelimited(message, writer) {
|
12532 | return this.encode(message, writer).ldelim();
|
12533 | };
|
12534 |
|
12535 | /**
|
12536 | * Decodes a SeekRequest message from the specified reader or buffer.
|
12537 | * @function decode
|
12538 | * @memberof google.pubsub.v1.SeekRequest
|
12539 | * @static
|
12540 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
12541 | * @param {number} [length] Message length if known beforehand
|
12542 | * @returns {google.pubsub.v1.SeekRequest} SeekRequest
|
12543 | * @throws {Error} If the payload is not a reader or valid buffer
|
12544 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
12545 | */
|
12546 | SeekRequest.decode = function decode(reader, length) {
|
12547 | if (!(reader instanceof $Reader))
|
12548 | reader = $Reader.create(reader);
|
12549 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.SeekRequest();
|
12550 | while (reader.pos < end) {
|
12551 | var tag = reader.uint32();
|
12552 | switch (tag >>> 3) {
|
12553 | case 1:
|
12554 | message.subscription = reader.string();
|
12555 | break;
|
12556 | case 2:
|
12557 | message.time = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
|
12558 | break;
|
12559 | case 3:
|
12560 | message.snapshot = reader.string();
|
12561 | break;
|
12562 | default:
|
12563 | reader.skipType(tag & 7);
|
12564 | break;
|
12565 | }
|
12566 | }
|
12567 | return message;
|
12568 | };
|
12569 |
|
12570 | /**
|
12571 | * Decodes a SeekRequest message from the specified reader or buffer, length delimited.
|
12572 | * @function decodeDelimited
|
12573 | * @memberof google.pubsub.v1.SeekRequest
|
12574 | * @static
|
12575 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
12576 | * @returns {google.pubsub.v1.SeekRequest} SeekRequest
|
12577 | * @throws {Error} If the payload is not a reader or valid buffer
|
12578 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
12579 | */
|
12580 | SeekRequest.decodeDelimited = function decodeDelimited(reader) {
|
12581 | if (!(reader instanceof $Reader))
|
12582 | reader = new $Reader(reader);
|
12583 | return this.decode(reader, reader.uint32());
|
12584 | };
|
12585 |
|
12586 | /**
|
12587 | * Verifies a SeekRequest message.
|
12588 | * @function verify
|
12589 | * @memberof google.pubsub.v1.SeekRequest
|
12590 | * @static
|
12591 | * @param {Object.<string,*>} message Plain object to verify
|
12592 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
12593 | */
|
12594 | SeekRequest.verify = function verify(message) {
|
12595 | if (typeof message !== "object" || message === null)
|
12596 | return "object expected";
|
12597 | var properties = {};
|
12598 | if (message.subscription != null && message.hasOwnProperty("subscription"))
|
12599 | if (!$util.isString(message.subscription))
|
12600 | return "subscription: string expected";
|
12601 | if (message.time != null && message.hasOwnProperty("time")) {
|
12602 | properties.target = 1;
|
12603 | {
|
12604 | var error = $root.google.protobuf.Timestamp.verify(message.time);
|
12605 | if (error)
|
12606 | return "time." + error;
|
12607 | }
|
12608 | }
|
12609 | if (message.snapshot != null && message.hasOwnProperty("snapshot")) {
|
12610 | if (properties.target === 1)
|
12611 | return "target: multiple values";
|
12612 | properties.target = 1;
|
12613 | if (!$util.isString(message.snapshot))
|
12614 | return "snapshot: string expected";
|
12615 | }
|
12616 | return null;
|
12617 | };
|
12618 |
|
12619 | /**
|
12620 | * Creates a SeekRequest message from a plain object. Also converts values to their respective internal types.
|
12621 | * @function fromObject
|
12622 | * @memberof google.pubsub.v1.SeekRequest
|
12623 | * @static
|
12624 | * @param {Object.<string,*>} object Plain object
|
12625 | * @returns {google.pubsub.v1.SeekRequest} SeekRequest
|
12626 | */
|
12627 | SeekRequest.fromObject = function fromObject(object) {
|
12628 | if (object instanceof $root.google.pubsub.v1.SeekRequest)
|
12629 | return object;
|
12630 | var message = new $root.google.pubsub.v1.SeekRequest();
|
12631 | if (object.subscription != null)
|
12632 | message.subscription = String(object.subscription);
|
12633 | if (object.time != null) {
|
12634 | if (typeof object.time !== "object")
|
12635 | throw TypeError(".google.pubsub.v1.SeekRequest.time: object expected");
|
12636 | message.time = $root.google.protobuf.Timestamp.fromObject(object.time);
|
12637 | }
|
12638 | if (object.snapshot != null)
|
12639 | message.snapshot = String(object.snapshot);
|
12640 | return message;
|
12641 | };
|
12642 |
|
12643 | /**
|
12644 | * Creates a plain object from a SeekRequest message. Also converts values to other types if specified.
|
12645 | * @function toObject
|
12646 | * @memberof google.pubsub.v1.SeekRequest
|
12647 | * @static
|
12648 | * @param {google.pubsub.v1.SeekRequest} message SeekRequest
|
12649 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
12650 | * @returns {Object.<string,*>} Plain object
|
12651 | */
|
12652 | SeekRequest.toObject = function toObject(message, options) {
|
12653 | if (!options)
|
12654 | options = {};
|
12655 | var object = {};
|
12656 | if (options.defaults)
|
12657 | object.subscription = "";
|
12658 | if (message.subscription != null && message.hasOwnProperty("subscription"))
|
12659 | object.subscription = message.subscription;
|
12660 | if (message.time != null && message.hasOwnProperty("time")) {
|
12661 | object.time = $root.google.protobuf.Timestamp.toObject(message.time, options);
|
12662 | if (options.oneofs)
|
12663 | object.target = "time";
|
12664 | }
|
12665 | if (message.snapshot != null && message.hasOwnProperty("snapshot")) {
|
12666 | object.snapshot = message.snapshot;
|
12667 | if (options.oneofs)
|
12668 | object.target = "snapshot";
|
12669 | }
|
12670 | return object;
|
12671 | };
|
12672 |
|
12673 | /**
|
12674 | * Converts this SeekRequest to JSON.
|
12675 | * @function toJSON
|
12676 | * @memberof google.pubsub.v1.SeekRequest
|
12677 | * @instance
|
12678 | * @returns {Object.<string,*>} JSON object
|
12679 | */
|
12680 | SeekRequest.prototype.toJSON = function toJSON() {
|
12681 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
12682 | };
|
12683 |
|
12684 | return SeekRequest;
|
12685 | })();
|
12686 |
|
12687 | v1.SeekResponse = (function() {
|
12688 |
|
12689 | /**
|
12690 | * Properties of a SeekResponse.
|
12691 | * @memberof google.pubsub.v1
|
12692 | * @interface ISeekResponse
|
12693 | */
|
12694 |
|
12695 | /**
|
12696 | * Constructs a new SeekResponse.
|
12697 | * @memberof google.pubsub.v1
|
12698 | * @classdesc Represents a SeekResponse.
|
12699 | * @implements ISeekResponse
|
12700 | * @constructor
|
12701 | * @param {google.pubsub.v1.ISeekResponse=} [properties] Properties to set
|
12702 | */
|
12703 | function SeekResponse(properties) {
|
12704 | if (properties)
|
12705 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
12706 | if (properties[keys[i]] != null)
|
12707 | this[keys[i]] = properties[keys[i]];
|
12708 | }
|
12709 |
|
12710 | /**
|
12711 | * Creates a new SeekResponse instance using the specified properties.
|
12712 | * @function create
|
12713 | * @memberof google.pubsub.v1.SeekResponse
|
12714 | * @static
|
12715 | * @param {google.pubsub.v1.ISeekResponse=} [properties] Properties to set
|
12716 | * @returns {google.pubsub.v1.SeekResponse} SeekResponse instance
|
12717 | */
|
12718 | SeekResponse.create = function create(properties) {
|
12719 | return new SeekResponse(properties);
|
12720 | };
|
12721 |
|
12722 | /**
|
12723 | * Encodes the specified SeekResponse message. Does not implicitly {@link google.pubsub.v1.SeekResponse.verify|verify} messages.
|
12724 | * @function encode
|
12725 | * @memberof google.pubsub.v1.SeekResponse
|
12726 | * @static
|
12727 | * @param {google.pubsub.v1.ISeekResponse} message SeekResponse message or plain object to encode
|
12728 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
12729 | * @returns {$protobuf.Writer} Writer
|
12730 | */
|
12731 | SeekResponse.encode = function encode(message, writer) {
|
12732 | if (!writer)
|
12733 | writer = $Writer.create();
|
12734 | return writer;
|
12735 | };
|
12736 |
|
12737 | /**
|
12738 | * Encodes the specified SeekResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.SeekResponse.verify|verify} messages.
|
12739 | * @function encodeDelimited
|
12740 | * @memberof google.pubsub.v1.SeekResponse
|
12741 | * @static
|
12742 | * @param {google.pubsub.v1.ISeekResponse} message SeekResponse message or plain object to encode
|
12743 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
12744 | * @returns {$protobuf.Writer} Writer
|
12745 | */
|
12746 | SeekResponse.encodeDelimited = function encodeDelimited(message, writer) {
|
12747 | return this.encode(message, writer).ldelim();
|
12748 | };
|
12749 |
|
12750 | /**
|
12751 | * Decodes a SeekResponse message from the specified reader or buffer.
|
12752 | * @function decode
|
12753 | * @memberof google.pubsub.v1.SeekResponse
|
12754 | * @static
|
12755 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
12756 | * @param {number} [length] Message length if known beforehand
|
12757 | * @returns {google.pubsub.v1.SeekResponse} SeekResponse
|
12758 | * @throws {Error} If the payload is not a reader or valid buffer
|
12759 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
12760 | */
|
12761 | SeekResponse.decode = function decode(reader, length) {
|
12762 | if (!(reader instanceof $Reader))
|
12763 | reader = $Reader.create(reader);
|
12764 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.SeekResponse();
|
12765 | while (reader.pos < end) {
|
12766 | var tag = reader.uint32();
|
12767 | switch (tag >>> 3) {
|
12768 | default:
|
12769 | reader.skipType(tag & 7);
|
12770 | break;
|
12771 | }
|
12772 | }
|
12773 | return message;
|
12774 | };
|
12775 |
|
12776 | /**
|
12777 | * Decodes a SeekResponse message from the specified reader or buffer, length delimited.
|
12778 | * @function decodeDelimited
|
12779 | * @memberof google.pubsub.v1.SeekResponse
|
12780 | * @static
|
12781 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
12782 | * @returns {google.pubsub.v1.SeekResponse} SeekResponse
|
12783 | * @throws {Error} If the payload is not a reader or valid buffer
|
12784 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
12785 | */
|
12786 | SeekResponse.decodeDelimited = function decodeDelimited(reader) {
|
12787 | if (!(reader instanceof $Reader))
|
12788 | reader = new $Reader(reader);
|
12789 | return this.decode(reader, reader.uint32());
|
12790 | };
|
12791 |
|
12792 | /**
|
12793 | * Verifies a SeekResponse message.
|
12794 | * @function verify
|
12795 | * @memberof google.pubsub.v1.SeekResponse
|
12796 | * @static
|
12797 | * @param {Object.<string,*>} message Plain object to verify
|
12798 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
12799 | */
|
12800 | SeekResponse.verify = function verify(message) {
|
12801 | if (typeof message !== "object" || message === null)
|
12802 | return "object expected";
|
12803 | return null;
|
12804 | };
|
12805 |
|
12806 | /**
|
12807 | * Creates a SeekResponse message from a plain object. Also converts values to their respective internal types.
|
12808 | * @function fromObject
|
12809 | * @memberof google.pubsub.v1.SeekResponse
|
12810 | * @static
|
12811 | * @param {Object.<string,*>} object Plain object
|
12812 | * @returns {google.pubsub.v1.SeekResponse} SeekResponse
|
12813 | */
|
12814 | SeekResponse.fromObject = function fromObject(object) {
|
12815 | if (object instanceof $root.google.pubsub.v1.SeekResponse)
|
12816 | return object;
|
12817 | return new $root.google.pubsub.v1.SeekResponse();
|
12818 | };
|
12819 |
|
12820 | /**
|
12821 | * Creates a plain object from a SeekResponse message. Also converts values to other types if specified.
|
12822 | * @function toObject
|
12823 | * @memberof google.pubsub.v1.SeekResponse
|
12824 | * @static
|
12825 | * @param {google.pubsub.v1.SeekResponse} message SeekResponse
|
12826 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
12827 | * @returns {Object.<string,*>} Plain object
|
12828 | */
|
12829 | SeekResponse.toObject = function toObject() {
|
12830 | return {};
|
12831 | };
|
12832 |
|
12833 | /**
|
12834 | * Converts this SeekResponse to JSON.
|
12835 | * @function toJSON
|
12836 | * @memberof google.pubsub.v1.SeekResponse
|
12837 | * @instance
|
12838 | * @returns {Object.<string,*>} JSON object
|
12839 | */
|
12840 | SeekResponse.prototype.toJSON = function toJSON() {
|
12841 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
12842 | };
|
12843 |
|
12844 | return SeekResponse;
|
12845 | })();
|
12846 |
|
12847 | v1.SchemaService = (function() {
|
12848 |
|
12849 | /**
|
12850 | * Constructs a new SchemaService service.
|
12851 | * @memberof google.pubsub.v1
|
12852 | * @classdesc Represents a SchemaService
|
12853 | * @extends $protobuf.rpc.Service
|
12854 | * @constructor
|
12855 | * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
|
12856 | * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
|
12857 | * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
|
12858 | */
|
12859 | function SchemaService(rpcImpl, requestDelimited, responseDelimited) {
|
12860 | $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);
|
12861 | }
|
12862 |
|
12863 | (SchemaService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = SchemaService;
|
12864 |
|
12865 | /**
|
12866 | * Creates new SchemaService service using the specified rpc implementation.
|
12867 | * @function create
|
12868 | * @memberof google.pubsub.v1.SchemaService
|
12869 | * @static
|
12870 | * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
|
12871 | * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
|
12872 | * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
|
12873 | * @returns {SchemaService} RPC service. Useful where requests and/or responses are streamed.
|
12874 | */
|
12875 | SchemaService.create = function create(rpcImpl, requestDelimited, responseDelimited) {
|
12876 | return new this(rpcImpl, requestDelimited, responseDelimited);
|
12877 | };
|
12878 |
|
12879 | /**
|
12880 | * Callback as used by {@link google.pubsub.v1.SchemaService|createSchema}.
|
12881 | * @memberof google.pubsub.v1.SchemaService
|
12882 | * @typedef CreateSchemaCallback
|
12883 | * @type {function}
|
12884 | * @param {Error|null} error Error, if any
|
12885 | * @param {google.pubsub.v1.Schema} [response] Schema
|
12886 | */
|
12887 |
|
12888 | /**
|
12889 | * Calls CreateSchema.
|
12890 | * @function createSchema
|
12891 | * @memberof google.pubsub.v1.SchemaService
|
12892 | * @instance
|
12893 | * @param {google.pubsub.v1.ICreateSchemaRequest} request CreateSchemaRequest message or plain object
|
12894 | * @param {google.pubsub.v1.SchemaService.CreateSchemaCallback} callback Node-style callback called with the error, if any, and Schema
|
12895 | * @returns {undefined}
|
12896 | * @variation 1
|
12897 | */
|
12898 | Object.defineProperty(SchemaService.prototype.createSchema = function createSchema(request, callback) {
|
12899 | return this.rpcCall(createSchema, $root.google.pubsub.v1.CreateSchemaRequest, $root.google.pubsub.v1.Schema, request, callback);
|
12900 | }, "name", { value: "CreateSchema" });
|
12901 |
|
12902 | /**
|
12903 | * Calls CreateSchema.
|
12904 | * @function createSchema
|
12905 | * @memberof google.pubsub.v1.SchemaService
|
12906 | * @instance
|
12907 | * @param {google.pubsub.v1.ICreateSchemaRequest} request CreateSchemaRequest message or plain object
|
12908 | * @returns {Promise<google.pubsub.v1.Schema>} Promise
|
12909 | * @variation 2
|
12910 | */
|
12911 |
|
12912 | /**
|
12913 | * Callback as used by {@link google.pubsub.v1.SchemaService|getSchema}.
|
12914 | * @memberof google.pubsub.v1.SchemaService
|
12915 | * @typedef GetSchemaCallback
|
12916 | * @type {function}
|
12917 | * @param {Error|null} error Error, if any
|
12918 | * @param {google.pubsub.v1.Schema} [response] Schema
|
12919 | */
|
12920 |
|
12921 | /**
|
12922 | * Calls GetSchema.
|
12923 | * @function getSchema
|
12924 | * @memberof google.pubsub.v1.SchemaService
|
12925 | * @instance
|
12926 | * @param {google.pubsub.v1.IGetSchemaRequest} request GetSchemaRequest message or plain object
|
12927 | * @param {google.pubsub.v1.SchemaService.GetSchemaCallback} callback Node-style callback called with the error, if any, and Schema
|
12928 | * @returns {undefined}
|
12929 | * @variation 1
|
12930 | */
|
12931 | Object.defineProperty(SchemaService.prototype.getSchema = function getSchema(request, callback) {
|
12932 | return this.rpcCall(getSchema, $root.google.pubsub.v1.GetSchemaRequest, $root.google.pubsub.v1.Schema, request, callback);
|
12933 | }, "name", { value: "GetSchema" });
|
12934 |
|
12935 | /**
|
12936 | * Calls GetSchema.
|
12937 | * @function getSchema
|
12938 | * @memberof google.pubsub.v1.SchemaService
|
12939 | * @instance
|
12940 | * @param {google.pubsub.v1.IGetSchemaRequest} request GetSchemaRequest message or plain object
|
12941 | * @returns {Promise<google.pubsub.v1.Schema>} Promise
|
12942 | * @variation 2
|
12943 | */
|
12944 |
|
12945 | /**
|
12946 | * Callback as used by {@link google.pubsub.v1.SchemaService|listSchemas}.
|
12947 | * @memberof google.pubsub.v1.SchemaService
|
12948 | * @typedef ListSchemasCallback
|
12949 | * @type {function}
|
12950 | * @param {Error|null} error Error, if any
|
12951 | * @param {google.pubsub.v1.ListSchemasResponse} [response] ListSchemasResponse
|
12952 | */
|
12953 |
|
12954 | /**
|
12955 | * Calls ListSchemas.
|
12956 | * @function listSchemas
|
12957 | * @memberof google.pubsub.v1.SchemaService
|
12958 | * @instance
|
12959 | * @param {google.pubsub.v1.IListSchemasRequest} request ListSchemasRequest message or plain object
|
12960 | * @param {google.pubsub.v1.SchemaService.ListSchemasCallback} callback Node-style callback called with the error, if any, and ListSchemasResponse
|
12961 | * @returns {undefined}
|
12962 | * @variation 1
|
12963 | */
|
12964 | Object.defineProperty(SchemaService.prototype.listSchemas = function listSchemas(request, callback) {
|
12965 | return this.rpcCall(listSchemas, $root.google.pubsub.v1.ListSchemasRequest, $root.google.pubsub.v1.ListSchemasResponse, request, callback);
|
12966 | }, "name", { value: "ListSchemas" });
|
12967 |
|
12968 | /**
|
12969 | * Calls ListSchemas.
|
12970 | * @function listSchemas
|
12971 | * @memberof google.pubsub.v1.SchemaService
|
12972 | * @instance
|
12973 | * @param {google.pubsub.v1.IListSchemasRequest} request ListSchemasRequest message or plain object
|
12974 | * @returns {Promise<google.pubsub.v1.ListSchemasResponse>} Promise
|
12975 | * @variation 2
|
12976 | */
|
12977 |
|
12978 | /**
|
12979 | * Callback as used by {@link google.pubsub.v1.SchemaService|deleteSchema}.
|
12980 | * @memberof google.pubsub.v1.SchemaService
|
12981 | * @typedef DeleteSchemaCallback
|
12982 | * @type {function}
|
12983 | * @param {Error|null} error Error, if any
|
12984 | * @param {google.protobuf.Empty} [response] Empty
|
12985 | */
|
12986 |
|
12987 | /**
|
12988 | * Calls DeleteSchema.
|
12989 | * @function deleteSchema
|
12990 | * @memberof google.pubsub.v1.SchemaService
|
12991 | * @instance
|
12992 | * @param {google.pubsub.v1.IDeleteSchemaRequest} request DeleteSchemaRequest message or plain object
|
12993 | * @param {google.pubsub.v1.SchemaService.DeleteSchemaCallback} callback Node-style callback called with the error, if any, and Empty
|
12994 | * @returns {undefined}
|
12995 | * @variation 1
|
12996 | */
|
12997 | Object.defineProperty(SchemaService.prototype.deleteSchema = function deleteSchema(request, callback) {
|
12998 | return this.rpcCall(deleteSchema, $root.google.pubsub.v1.DeleteSchemaRequest, $root.google.protobuf.Empty, request, callback);
|
12999 | }, "name", { value: "DeleteSchema" });
|
13000 |
|
13001 | /**
|
13002 | * Calls DeleteSchema.
|
13003 | * @function deleteSchema
|
13004 | * @memberof google.pubsub.v1.SchemaService
|
13005 | * @instance
|
13006 | * @param {google.pubsub.v1.IDeleteSchemaRequest} request DeleteSchemaRequest message or plain object
|
13007 | * @returns {Promise<google.protobuf.Empty>} Promise
|
13008 | * @variation 2
|
13009 | */
|
13010 |
|
13011 | /**
|
13012 | * Callback as used by {@link google.pubsub.v1.SchemaService|validateSchema}.
|
13013 | * @memberof google.pubsub.v1.SchemaService
|
13014 | * @typedef ValidateSchemaCallback
|
13015 | * @type {function}
|
13016 | * @param {Error|null} error Error, if any
|
13017 | * @param {google.pubsub.v1.ValidateSchemaResponse} [response] ValidateSchemaResponse
|
13018 | */
|
13019 |
|
13020 | /**
|
13021 | * Calls ValidateSchema.
|
13022 | * @function validateSchema
|
13023 | * @memberof google.pubsub.v1.SchemaService
|
13024 | * @instance
|
13025 | * @param {google.pubsub.v1.IValidateSchemaRequest} request ValidateSchemaRequest message or plain object
|
13026 | * @param {google.pubsub.v1.SchemaService.ValidateSchemaCallback} callback Node-style callback called with the error, if any, and ValidateSchemaResponse
|
13027 | * @returns {undefined}
|
13028 | * @variation 1
|
13029 | */
|
13030 | Object.defineProperty(SchemaService.prototype.validateSchema = function validateSchema(request, callback) {
|
13031 | return this.rpcCall(validateSchema, $root.google.pubsub.v1.ValidateSchemaRequest, $root.google.pubsub.v1.ValidateSchemaResponse, request, callback);
|
13032 | }, "name", { value: "ValidateSchema" });
|
13033 |
|
13034 | /**
|
13035 | * Calls ValidateSchema.
|
13036 | * @function validateSchema
|
13037 | * @memberof google.pubsub.v1.SchemaService
|
13038 | * @instance
|
13039 | * @param {google.pubsub.v1.IValidateSchemaRequest} request ValidateSchemaRequest message or plain object
|
13040 | * @returns {Promise<google.pubsub.v1.ValidateSchemaResponse>} Promise
|
13041 | * @variation 2
|
13042 | */
|
13043 |
|
13044 | /**
|
13045 | * Callback as used by {@link google.pubsub.v1.SchemaService|validateMessage}.
|
13046 | * @memberof google.pubsub.v1.SchemaService
|
13047 | * @typedef ValidateMessageCallback
|
13048 | * @type {function}
|
13049 | * @param {Error|null} error Error, if any
|
13050 | * @param {google.pubsub.v1.ValidateMessageResponse} [response] ValidateMessageResponse
|
13051 | */
|
13052 |
|
13053 | /**
|
13054 | * Calls ValidateMessage.
|
13055 | * @function validateMessage
|
13056 | * @memberof google.pubsub.v1.SchemaService
|
13057 | * @instance
|
13058 | * @param {google.pubsub.v1.IValidateMessageRequest} request ValidateMessageRequest message or plain object
|
13059 | * @param {google.pubsub.v1.SchemaService.ValidateMessageCallback} callback Node-style callback called with the error, if any, and ValidateMessageResponse
|
13060 | * @returns {undefined}
|
13061 | * @variation 1
|
13062 | */
|
13063 | Object.defineProperty(SchemaService.prototype.validateMessage = function validateMessage(request, callback) {
|
13064 | return this.rpcCall(validateMessage, $root.google.pubsub.v1.ValidateMessageRequest, $root.google.pubsub.v1.ValidateMessageResponse, request, callback);
|
13065 | }, "name", { value: "ValidateMessage" });
|
13066 |
|
13067 | /**
|
13068 | * Calls ValidateMessage.
|
13069 | * @function validateMessage
|
13070 | * @memberof google.pubsub.v1.SchemaService
|
13071 | * @instance
|
13072 | * @param {google.pubsub.v1.IValidateMessageRequest} request ValidateMessageRequest message or plain object
|
13073 | * @returns {Promise<google.pubsub.v1.ValidateMessageResponse>} Promise
|
13074 | * @variation 2
|
13075 | */
|
13076 |
|
13077 | return SchemaService;
|
13078 | })();
|
13079 |
|
13080 | v1.Schema = (function() {
|
13081 |
|
13082 | /**
|
13083 | * Properties of a Schema.
|
13084 | * @memberof google.pubsub.v1
|
13085 | * @interface ISchema
|
13086 | * @property {string|null} [name] Schema name
|
13087 | * @property {google.pubsub.v1.Schema.Type|null} [type] Schema type
|
13088 | * @property {string|null} [definition] Schema definition
|
13089 | */
|
13090 |
|
13091 | /**
|
13092 | * Constructs a new Schema.
|
13093 | * @memberof google.pubsub.v1
|
13094 | * @classdesc Represents a Schema.
|
13095 | * @implements ISchema
|
13096 | * @constructor
|
13097 | * @param {google.pubsub.v1.ISchema=} [properties] Properties to set
|
13098 | */
|
13099 | function Schema(properties) {
|
13100 | if (properties)
|
13101 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
13102 | if (properties[keys[i]] != null)
|
13103 | this[keys[i]] = properties[keys[i]];
|
13104 | }
|
13105 |
|
13106 | /**
|
13107 | * Schema name.
|
13108 | * @member {string} name
|
13109 | * @memberof google.pubsub.v1.Schema
|
13110 | * @instance
|
13111 | */
|
13112 | Schema.prototype.name = "";
|
13113 |
|
13114 | /**
|
13115 | * Schema type.
|
13116 | * @member {google.pubsub.v1.Schema.Type} type
|
13117 | * @memberof google.pubsub.v1.Schema
|
13118 | * @instance
|
13119 | */
|
13120 | Schema.prototype.type = 0;
|
13121 |
|
13122 | /**
|
13123 | * Schema definition.
|
13124 | * @member {string} definition
|
13125 | * @memberof google.pubsub.v1.Schema
|
13126 | * @instance
|
13127 | */
|
13128 | Schema.prototype.definition = "";
|
13129 |
|
13130 | /**
|
13131 | * Creates a new Schema instance using the specified properties.
|
13132 | * @function create
|
13133 | * @memberof google.pubsub.v1.Schema
|
13134 | * @static
|
13135 | * @param {google.pubsub.v1.ISchema=} [properties] Properties to set
|
13136 | * @returns {google.pubsub.v1.Schema} Schema instance
|
13137 | */
|
13138 | Schema.create = function create(properties) {
|
13139 | return new Schema(properties);
|
13140 | };
|
13141 |
|
13142 | /**
|
13143 | * Encodes the specified Schema message. Does not implicitly {@link google.pubsub.v1.Schema.verify|verify} messages.
|
13144 | * @function encode
|
13145 | * @memberof google.pubsub.v1.Schema
|
13146 | * @static
|
13147 | * @param {google.pubsub.v1.ISchema} message Schema message or plain object to encode
|
13148 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
13149 | * @returns {$protobuf.Writer} Writer
|
13150 | */
|
13151 | Schema.encode = function encode(message, writer) {
|
13152 | if (!writer)
|
13153 | writer = $Writer.create();
|
13154 | if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
13155 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
|
13156 | if (message.type != null && Object.hasOwnProperty.call(message, "type"))
|
13157 | writer.uint32(/* id 2, wireType 0 =*/16).int32(message.type);
|
13158 | if (message.definition != null && Object.hasOwnProperty.call(message, "definition"))
|
13159 | writer.uint32(/* id 3, wireType 2 =*/26).string(message.definition);
|
13160 | return writer;
|
13161 | };
|
13162 |
|
13163 | /**
|
13164 | * Encodes the specified Schema message, length delimited. Does not implicitly {@link google.pubsub.v1.Schema.verify|verify} messages.
|
13165 | * @function encodeDelimited
|
13166 | * @memberof google.pubsub.v1.Schema
|
13167 | * @static
|
13168 | * @param {google.pubsub.v1.ISchema} message Schema message or plain object to encode
|
13169 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
13170 | * @returns {$protobuf.Writer} Writer
|
13171 | */
|
13172 | Schema.encodeDelimited = function encodeDelimited(message, writer) {
|
13173 | return this.encode(message, writer).ldelim();
|
13174 | };
|
13175 |
|
13176 | /**
|
13177 | * Decodes a Schema message from the specified reader or buffer.
|
13178 | * @function decode
|
13179 | * @memberof google.pubsub.v1.Schema
|
13180 | * @static
|
13181 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
13182 | * @param {number} [length] Message length if known beforehand
|
13183 | * @returns {google.pubsub.v1.Schema} Schema
|
13184 | * @throws {Error} If the payload is not a reader or valid buffer
|
13185 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
13186 | */
|
13187 | Schema.decode = function decode(reader, length) {
|
13188 | if (!(reader instanceof $Reader))
|
13189 | reader = $Reader.create(reader);
|
13190 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.Schema();
|
13191 | while (reader.pos < end) {
|
13192 | var tag = reader.uint32();
|
13193 | switch (tag >>> 3) {
|
13194 | case 1:
|
13195 | message.name = reader.string();
|
13196 | break;
|
13197 | case 2:
|
13198 | message.type = reader.int32();
|
13199 | break;
|
13200 | case 3:
|
13201 | message.definition = reader.string();
|
13202 | break;
|
13203 | default:
|
13204 | reader.skipType(tag & 7);
|
13205 | break;
|
13206 | }
|
13207 | }
|
13208 | return message;
|
13209 | };
|
13210 |
|
13211 | /**
|
13212 | * Decodes a Schema message from the specified reader or buffer, length delimited.
|
13213 | * @function decodeDelimited
|
13214 | * @memberof google.pubsub.v1.Schema
|
13215 | * @static
|
13216 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
13217 | * @returns {google.pubsub.v1.Schema} Schema
|
13218 | * @throws {Error} If the payload is not a reader or valid buffer
|
13219 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
13220 | */
|
13221 | Schema.decodeDelimited = function decodeDelimited(reader) {
|
13222 | if (!(reader instanceof $Reader))
|
13223 | reader = new $Reader(reader);
|
13224 | return this.decode(reader, reader.uint32());
|
13225 | };
|
13226 |
|
13227 | /**
|
13228 | * Verifies a Schema message.
|
13229 | * @function verify
|
13230 | * @memberof google.pubsub.v1.Schema
|
13231 | * @static
|
13232 | * @param {Object.<string,*>} message Plain object to verify
|
13233 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
13234 | */
|
13235 | Schema.verify = function verify(message) {
|
13236 | if (typeof message !== "object" || message === null)
|
13237 | return "object expected";
|
13238 | if (message.name != null && message.hasOwnProperty("name"))
|
13239 | if (!$util.isString(message.name))
|
13240 | return "name: string expected";
|
13241 | if (message.type != null && message.hasOwnProperty("type"))
|
13242 | switch (message.type) {
|
13243 | default:
|
13244 | return "type: enum value expected";
|
13245 | case 0:
|
13246 | case 1:
|
13247 | case 2:
|
13248 | break;
|
13249 | }
|
13250 | if (message.definition != null && message.hasOwnProperty("definition"))
|
13251 | if (!$util.isString(message.definition))
|
13252 | return "definition: string expected";
|
13253 | return null;
|
13254 | };
|
13255 |
|
13256 | /**
|
13257 | * Creates a Schema message from a plain object. Also converts values to their respective internal types.
|
13258 | * @function fromObject
|
13259 | * @memberof google.pubsub.v1.Schema
|
13260 | * @static
|
13261 | * @param {Object.<string,*>} object Plain object
|
13262 | * @returns {google.pubsub.v1.Schema} Schema
|
13263 | */
|
13264 | Schema.fromObject = function fromObject(object) {
|
13265 | if (object instanceof $root.google.pubsub.v1.Schema)
|
13266 | return object;
|
13267 | var message = new $root.google.pubsub.v1.Schema();
|
13268 | if (object.name != null)
|
13269 | message.name = String(object.name);
|
13270 | switch (object.type) {
|
13271 | case "TYPE_UNSPECIFIED":
|
13272 | case 0:
|
13273 | message.type = 0;
|
13274 | break;
|
13275 | case "PROTOCOL_BUFFER":
|
13276 | case 1:
|
13277 | message.type = 1;
|
13278 | break;
|
13279 | case "AVRO":
|
13280 | case 2:
|
13281 | message.type = 2;
|
13282 | break;
|
13283 | }
|
13284 | if (object.definition != null)
|
13285 | message.definition = String(object.definition);
|
13286 | return message;
|
13287 | };
|
13288 |
|
13289 | /**
|
13290 | * Creates a plain object from a Schema message. Also converts values to other types if specified.
|
13291 | * @function toObject
|
13292 | * @memberof google.pubsub.v1.Schema
|
13293 | * @static
|
13294 | * @param {google.pubsub.v1.Schema} message Schema
|
13295 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
13296 | * @returns {Object.<string,*>} Plain object
|
13297 | */
|
13298 | Schema.toObject = function toObject(message, options) {
|
13299 | if (!options)
|
13300 | options = {};
|
13301 | var object = {};
|
13302 | if (options.defaults) {
|
13303 | object.name = "";
|
13304 | object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0;
|
13305 | object.definition = "";
|
13306 | }
|
13307 | if (message.name != null && message.hasOwnProperty("name"))
|
13308 | object.name = message.name;
|
13309 | if (message.type != null && message.hasOwnProperty("type"))
|
13310 | object.type = options.enums === String ? $root.google.pubsub.v1.Schema.Type[message.type] : message.type;
|
13311 | if (message.definition != null && message.hasOwnProperty("definition"))
|
13312 | object.definition = message.definition;
|
13313 | return object;
|
13314 | };
|
13315 |
|
13316 | /**
|
13317 | * Converts this Schema to JSON.
|
13318 | * @function toJSON
|
13319 | * @memberof google.pubsub.v1.Schema
|
13320 | * @instance
|
13321 | * @returns {Object.<string,*>} JSON object
|
13322 | */
|
13323 | Schema.prototype.toJSON = function toJSON() {
|
13324 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
13325 | };
|
13326 |
|
13327 | /**
|
13328 | * Type enum.
|
13329 | * @name google.pubsub.v1.Schema.Type
|
13330 | * @enum {number}
|
13331 | * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value
|
13332 | * @property {number} PROTOCOL_BUFFER=1 PROTOCOL_BUFFER value
|
13333 | * @property {number} AVRO=2 AVRO value
|
13334 | */
|
13335 | Schema.Type = (function() {
|
13336 | var valuesById = {}, values = Object.create(valuesById);
|
13337 | values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0;
|
13338 | values[valuesById[1] = "PROTOCOL_BUFFER"] = 1;
|
13339 | values[valuesById[2] = "AVRO"] = 2;
|
13340 | return values;
|
13341 | })();
|
13342 |
|
13343 | return Schema;
|
13344 | })();
|
13345 |
|
13346 | v1.CreateSchemaRequest = (function() {
|
13347 |
|
13348 | /**
|
13349 | * Properties of a CreateSchemaRequest.
|
13350 | * @memberof google.pubsub.v1
|
13351 | * @interface ICreateSchemaRequest
|
13352 | * @property {string|null} [parent] CreateSchemaRequest parent
|
13353 | * @property {google.pubsub.v1.ISchema|null} [schema] CreateSchemaRequest schema
|
13354 | * @property {string|null} [schemaId] CreateSchemaRequest schemaId
|
13355 | */
|
13356 |
|
13357 | /**
|
13358 | * Constructs a new CreateSchemaRequest.
|
13359 | * @memberof google.pubsub.v1
|
13360 | * @classdesc Represents a CreateSchemaRequest.
|
13361 | * @implements ICreateSchemaRequest
|
13362 | * @constructor
|
13363 | * @param {google.pubsub.v1.ICreateSchemaRequest=} [properties] Properties to set
|
13364 | */
|
13365 | function CreateSchemaRequest(properties) {
|
13366 | if (properties)
|
13367 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
13368 | if (properties[keys[i]] != null)
|
13369 | this[keys[i]] = properties[keys[i]];
|
13370 | }
|
13371 |
|
13372 | /**
|
13373 | * CreateSchemaRequest parent.
|
13374 | * @member {string} parent
|
13375 | * @memberof google.pubsub.v1.CreateSchemaRequest
|
13376 | * @instance
|
13377 | */
|
13378 | CreateSchemaRequest.prototype.parent = "";
|
13379 |
|
13380 | /**
|
13381 | * CreateSchemaRequest schema.
|
13382 | * @member {google.pubsub.v1.ISchema|null|undefined} schema
|
13383 | * @memberof google.pubsub.v1.CreateSchemaRequest
|
13384 | * @instance
|
13385 | */
|
13386 | CreateSchemaRequest.prototype.schema = null;
|
13387 |
|
13388 | /**
|
13389 | * CreateSchemaRequest schemaId.
|
13390 | * @member {string} schemaId
|
13391 | * @memberof google.pubsub.v1.CreateSchemaRequest
|
13392 | * @instance
|
13393 | */
|
13394 | CreateSchemaRequest.prototype.schemaId = "";
|
13395 |
|
13396 | /**
|
13397 | * Creates a new CreateSchemaRequest instance using the specified properties.
|
13398 | * @function create
|
13399 | * @memberof google.pubsub.v1.CreateSchemaRequest
|
13400 | * @static
|
13401 | * @param {google.pubsub.v1.ICreateSchemaRequest=} [properties] Properties to set
|
13402 | * @returns {google.pubsub.v1.CreateSchemaRequest} CreateSchemaRequest instance
|
13403 | */
|
13404 | CreateSchemaRequest.create = function create(properties) {
|
13405 | return new CreateSchemaRequest(properties);
|
13406 | };
|
13407 |
|
13408 | /**
|
13409 | * Encodes the specified CreateSchemaRequest message. Does not implicitly {@link google.pubsub.v1.CreateSchemaRequest.verify|verify} messages.
|
13410 | * @function encode
|
13411 | * @memberof google.pubsub.v1.CreateSchemaRequest
|
13412 | * @static
|
13413 | * @param {google.pubsub.v1.ICreateSchemaRequest} message CreateSchemaRequest message or plain object to encode
|
13414 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
13415 | * @returns {$protobuf.Writer} Writer
|
13416 | */
|
13417 | CreateSchemaRequest.encode = function encode(message, writer) {
|
13418 | if (!writer)
|
13419 | writer = $Writer.create();
|
13420 | if (message.parent != null && Object.hasOwnProperty.call(message, "parent"))
|
13421 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent);
|
13422 | if (message.schema != null && Object.hasOwnProperty.call(message, "schema"))
|
13423 | $root.google.pubsub.v1.Schema.encode(message.schema, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
13424 | if (message.schemaId != null && Object.hasOwnProperty.call(message, "schemaId"))
|
13425 | writer.uint32(/* id 3, wireType 2 =*/26).string(message.schemaId);
|
13426 | return writer;
|
13427 | };
|
13428 |
|
13429 | /**
|
13430 | * Encodes the specified CreateSchemaRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.CreateSchemaRequest.verify|verify} messages.
|
13431 | * @function encodeDelimited
|
13432 | * @memberof google.pubsub.v1.CreateSchemaRequest
|
13433 | * @static
|
13434 | * @param {google.pubsub.v1.ICreateSchemaRequest} message CreateSchemaRequest message or plain object to encode
|
13435 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
13436 | * @returns {$protobuf.Writer} Writer
|
13437 | */
|
13438 | CreateSchemaRequest.encodeDelimited = function encodeDelimited(message, writer) {
|
13439 | return this.encode(message, writer).ldelim();
|
13440 | };
|
13441 |
|
13442 | /**
|
13443 | * Decodes a CreateSchemaRequest message from the specified reader or buffer.
|
13444 | * @function decode
|
13445 | * @memberof google.pubsub.v1.CreateSchemaRequest
|
13446 | * @static
|
13447 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
13448 | * @param {number} [length] Message length if known beforehand
|
13449 | * @returns {google.pubsub.v1.CreateSchemaRequest} CreateSchemaRequest
|
13450 | * @throws {Error} If the payload is not a reader or valid buffer
|
13451 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
13452 | */
|
13453 | CreateSchemaRequest.decode = function decode(reader, length) {
|
13454 | if (!(reader instanceof $Reader))
|
13455 | reader = $Reader.create(reader);
|
13456 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.CreateSchemaRequest();
|
13457 | while (reader.pos < end) {
|
13458 | var tag = reader.uint32();
|
13459 | switch (tag >>> 3) {
|
13460 | case 1:
|
13461 | message.parent = reader.string();
|
13462 | break;
|
13463 | case 2:
|
13464 | message.schema = $root.google.pubsub.v1.Schema.decode(reader, reader.uint32());
|
13465 | break;
|
13466 | case 3:
|
13467 | message.schemaId = reader.string();
|
13468 | break;
|
13469 | default:
|
13470 | reader.skipType(tag & 7);
|
13471 | break;
|
13472 | }
|
13473 | }
|
13474 | return message;
|
13475 | };
|
13476 |
|
13477 | /**
|
13478 | * Decodes a CreateSchemaRequest message from the specified reader or buffer, length delimited.
|
13479 | * @function decodeDelimited
|
13480 | * @memberof google.pubsub.v1.CreateSchemaRequest
|
13481 | * @static
|
13482 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
13483 | * @returns {google.pubsub.v1.CreateSchemaRequest} CreateSchemaRequest
|
13484 | * @throws {Error} If the payload is not a reader or valid buffer
|
13485 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
13486 | */
|
13487 | CreateSchemaRequest.decodeDelimited = function decodeDelimited(reader) {
|
13488 | if (!(reader instanceof $Reader))
|
13489 | reader = new $Reader(reader);
|
13490 | return this.decode(reader, reader.uint32());
|
13491 | };
|
13492 |
|
13493 | /**
|
13494 | * Verifies a CreateSchemaRequest message.
|
13495 | * @function verify
|
13496 | * @memberof google.pubsub.v1.CreateSchemaRequest
|
13497 | * @static
|
13498 | * @param {Object.<string,*>} message Plain object to verify
|
13499 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
13500 | */
|
13501 | CreateSchemaRequest.verify = function verify(message) {
|
13502 | if (typeof message !== "object" || message === null)
|
13503 | return "object expected";
|
13504 | if (message.parent != null && message.hasOwnProperty("parent"))
|
13505 | if (!$util.isString(message.parent))
|
13506 | return "parent: string expected";
|
13507 | if (message.schema != null && message.hasOwnProperty("schema")) {
|
13508 | var error = $root.google.pubsub.v1.Schema.verify(message.schema);
|
13509 | if (error)
|
13510 | return "schema." + error;
|
13511 | }
|
13512 | if (message.schemaId != null && message.hasOwnProperty("schemaId"))
|
13513 | if (!$util.isString(message.schemaId))
|
13514 | return "schemaId: string expected";
|
13515 | return null;
|
13516 | };
|
13517 |
|
13518 | /**
|
13519 | * Creates a CreateSchemaRequest message from a plain object. Also converts values to their respective internal types.
|
13520 | * @function fromObject
|
13521 | * @memberof google.pubsub.v1.CreateSchemaRequest
|
13522 | * @static
|
13523 | * @param {Object.<string,*>} object Plain object
|
13524 | * @returns {google.pubsub.v1.CreateSchemaRequest} CreateSchemaRequest
|
13525 | */
|
13526 | CreateSchemaRequest.fromObject = function fromObject(object) {
|
13527 | if (object instanceof $root.google.pubsub.v1.CreateSchemaRequest)
|
13528 | return object;
|
13529 | var message = new $root.google.pubsub.v1.CreateSchemaRequest();
|
13530 | if (object.parent != null)
|
13531 | message.parent = String(object.parent);
|
13532 | if (object.schema != null) {
|
13533 | if (typeof object.schema !== "object")
|
13534 | throw TypeError(".google.pubsub.v1.CreateSchemaRequest.schema: object expected");
|
13535 | message.schema = $root.google.pubsub.v1.Schema.fromObject(object.schema);
|
13536 | }
|
13537 | if (object.schemaId != null)
|
13538 | message.schemaId = String(object.schemaId);
|
13539 | return message;
|
13540 | };
|
13541 |
|
13542 | /**
|
13543 | * Creates a plain object from a CreateSchemaRequest message. Also converts values to other types if specified.
|
13544 | * @function toObject
|
13545 | * @memberof google.pubsub.v1.CreateSchemaRequest
|
13546 | * @static
|
13547 | * @param {google.pubsub.v1.CreateSchemaRequest} message CreateSchemaRequest
|
13548 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
13549 | * @returns {Object.<string,*>} Plain object
|
13550 | */
|
13551 | CreateSchemaRequest.toObject = function toObject(message, options) {
|
13552 | if (!options)
|
13553 | options = {};
|
13554 | var object = {};
|
13555 | if (options.defaults) {
|
13556 | object.parent = "";
|
13557 | object.schema = null;
|
13558 | object.schemaId = "";
|
13559 | }
|
13560 | if (message.parent != null && message.hasOwnProperty("parent"))
|
13561 | object.parent = message.parent;
|
13562 | if (message.schema != null && message.hasOwnProperty("schema"))
|
13563 | object.schema = $root.google.pubsub.v1.Schema.toObject(message.schema, options);
|
13564 | if (message.schemaId != null && message.hasOwnProperty("schemaId"))
|
13565 | object.schemaId = message.schemaId;
|
13566 | return object;
|
13567 | };
|
13568 |
|
13569 | /**
|
13570 | * Converts this CreateSchemaRequest to JSON.
|
13571 | * @function toJSON
|
13572 | * @memberof google.pubsub.v1.CreateSchemaRequest
|
13573 | * @instance
|
13574 | * @returns {Object.<string,*>} JSON object
|
13575 | */
|
13576 | CreateSchemaRequest.prototype.toJSON = function toJSON() {
|
13577 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
13578 | };
|
13579 |
|
13580 | return CreateSchemaRequest;
|
13581 | })();
|
13582 |
|
13583 | /**
|
13584 | * SchemaView enum.
|
13585 | * @name google.pubsub.v1.SchemaView
|
13586 | * @enum {number}
|
13587 | * @property {number} SCHEMA_VIEW_UNSPECIFIED=0 SCHEMA_VIEW_UNSPECIFIED value
|
13588 | * @property {number} BASIC=1 BASIC value
|
13589 | * @property {number} FULL=2 FULL value
|
13590 | */
|
13591 | v1.SchemaView = (function() {
|
13592 | var valuesById = {}, values = Object.create(valuesById);
|
13593 | values[valuesById[0] = "SCHEMA_VIEW_UNSPECIFIED"] = 0;
|
13594 | values[valuesById[1] = "BASIC"] = 1;
|
13595 | values[valuesById[2] = "FULL"] = 2;
|
13596 | return values;
|
13597 | })();
|
13598 |
|
13599 | v1.GetSchemaRequest = (function() {
|
13600 |
|
13601 | /**
|
13602 | * Properties of a GetSchemaRequest.
|
13603 | * @memberof google.pubsub.v1
|
13604 | * @interface IGetSchemaRequest
|
13605 | * @property {string|null} [name] GetSchemaRequest name
|
13606 | * @property {google.pubsub.v1.SchemaView|null} [view] GetSchemaRequest view
|
13607 | */
|
13608 |
|
13609 | /**
|
13610 | * Constructs a new GetSchemaRequest.
|
13611 | * @memberof google.pubsub.v1
|
13612 | * @classdesc Represents a GetSchemaRequest.
|
13613 | * @implements IGetSchemaRequest
|
13614 | * @constructor
|
13615 | * @param {google.pubsub.v1.IGetSchemaRequest=} [properties] Properties to set
|
13616 | */
|
13617 | function GetSchemaRequest(properties) {
|
13618 | if (properties)
|
13619 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
13620 | if (properties[keys[i]] != null)
|
13621 | this[keys[i]] = properties[keys[i]];
|
13622 | }
|
13623 |
|
13624 | /**
|
13625 | * GetSchemaRequest name.
|
13626 | * @member {string} name
|
13627 | * @memberof google.pubsub.v1.GetSchemaRequest
|
13628 | * @instance
|
13629 | */
|
13630 | GetSchemaRequest.prototype.name = "";
|
13631 |
|
13632 | /**
|
13633 | * GetSchemaRequest view.
|
13634 | * @member {google.pubsub.v1.SchemaView} view
|
13635 | * @memberof google.pubsub.v1.GetSchemaRequest
|
13636 | * @instance
|
13637 | */
|
13638 | GetSchemaRequest.prototype.view = 0;
|
13639 |
|
13640 | /**
|
13641 | * Creates a new GetSchemaRequest instance using the specified properties.
|
13642 | * @function create
|
13643 | * @memberof google.pubsub.v1.GetSchemaRequest
|
13644 | * @static
|
13645 | * @param {google.pubsub.v1.IGetSchemaRequest=} [properties] Properties to set
|
13646 | * @returns {google.pubsub.v1.GetSchemaRequest} GetSchemaRequest instance
|
13647 | */
|
13648 | GetSchemaRequest.create = function create(properties) {
|
13649 | return new GetSchemaRequest(properties);
|
13650 | };
|
13651 |
|
13652 | /**
|
13653 | * Encodes the specified GetSchemaRequest message. Does not implicitly {@link google.pubsub.v1.GetSchemaRequest.verify|verify} messages.
|
13654 | * @function encode
|
13655 | * @memberof google.pubsub.v1.GetSchemaRequest
|
13656 | * @static
|
13657 | * @param {google.pubsub.v1.IGetSchemaRequest} message GetSchemaRequest message or plain object to encode
|
13658 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
13659 | * @returns {$protobuf.Writer} Writer
|
13660 | */
|
13661 | GetSchemaRequest.encode = function encode(message, writer) {
|
13662 | if (!writer)
|
13663 | writer = $Writer.create();
|
13664 | if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
13665 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
|
13666 | if (message.view != null && Object.hasOwnProperty.call(message, "view"))
|
13667 | writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view);
|
13668 | return writer;
|
13669 | };
|
13670 |
|
13671 | /**
|
13672 | * Encodes the specified GetSchemaRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.GetSchemaRequest.verify|verify} messages.
|
13673 | * @function encodeDelimited
|
13674 | * @memberof google.pubsub.v1.GetSchemaRequest
|
13675 | * @static
|
13676 | * @param {google.pubsub.v1.IGetSchemaRequest} message GetSchemaRequest message or plain object to encode
|
13677 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
13678 | * @returns {$protobuf.Writer} Writer
|
13679 | */
|
13680 | GetSchemaRequest.encodeDelimited = function encodeDelimited(message, writer) {
|
13681 | return this.encode(message, writer).ldelim();
|
13682 | };
|
13683 |
|
13684 | /**
|
13685 | * Decodes a GetSchemaRequest message from the specified reader or buffer.
|
13686 | * @function decode
|
13687 | * @memberof google.pubsub.v1.GetSchemaRequest
|
13688 | * @static
|
13689 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
13690 | * @param {number} [length] Message length if known beforehand
|
13691 | * @returns {google.pubsub.v1.GetSchemaRequest} GetSchemaRequest
|
13692 | * @throws {Error} If the payload is not a reader or valid buffer
|
13693 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
13694 | */
|
13695 | GetSchemaRequest.decode = function decode(reader, length) {
|
13696 | if (!(reader instanceof $Reader))
|
13697 | reader = $Reader.create(reader);
|
13698 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.GetSchemaRequest();
|
13699 | while (reader.pos < end) {
|
13700 | var tag = reader.uint32();
|
13701 | switch (tag >>> 3) {
|
13702 | case 1:
|
13703 | message.name = reader.string();
|
13704 | break;
|
13705 | case 2:
|
13706 | message.view = reader.int32();
|
13707 | break;
|
13708 | default:
|
13709 | reader.skipType(tag & 7);
|
13710 | break;
|
13711 | }
|
13712 | }
|
13713 | return message;
|
13714 | };
|
13715 |
|
13716 | /**
|
13717 | * Decodes a GetSchemaRequest message from the specified reader or buffer, length delimited.
|
13718 | * @function decodeDelimited
|
13719 | * @memberof google.pubsub.v1.GetSchemaRequest
|
13720 | * @static
|
13721 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
13722 | * @returns {google.pubsub.v1.GetSchemaRequest} GetSchemaRequest
|
13723 | * @throws {Error} If the payload is not a reader or valid buffer
|
13724 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
13725 | */
|
13726 | GetSchemaRequest.decodeDelimited = function decodeDelimited(reader) {
|
13727 | if (!(reader instanceof $Reader))
|
13728 | reader = new $Reader(reader);
|
13729 | return this.decode(reader, reader.uint32());
|
13730 | };
|
13731 |
|
13732 | /**
|
13733 | * Verifies a GetSchemaRequest message.
|
13734 | * @function verify
|
13735 | * @memberof google.pubsub.v1.GetSchemaRequest
|
13736 | * @static
|
13737 | * @param {Object.<string,*>} message Plain object to verify
|
13738 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
13739 | */
|
13740 | GetSchemaRequest.verify = function verify(message) {
|
13741 | if (typeof message !== "object" || message === null)
|
13742 | return "object expected";
|
13743 | if (message.name != null && message.hasOwnProperty("name"))
|
13744 | if (!$util.isString(message.name))
|
13745 | return "name: string expected";
|
13746 | if (message.view != null && message.hasOwnProperty("view"))
|
13747 | switch (message.view) {
|
13748 | default:
|
13749 | return "view: enum value expected";
|
13750 | case 0:
|
13751 | case 1:
|
13752 | case 2:
|
13753 | break;
|
13754 | }
|
13755 | return null;
|
13756 | };
|
13757 |
|
13758 | /**
|
13759 | * Creates a GetSchemaRequest message from a plain object. Also converts values to their respective internal types.
|
13760 | * @function fromObject
|
13761 | * @memberof google.pubsub.v1.GetSchemaRequest
|
13762 | * @static
|
13763 | * @param {Object.<string,*>} object Plain object
|
13764 | * @returns {google.pubsub.v1.GetSchemaRequest} GetSchemaRequest
|
13765 | */
|
13766 | GetSchemaRequest.fromObject = function fromObject(object) {
|
13767 | if (object instanceof $root.google.pubsub.v1.GetSchemaRequest)
|
13768 | return object;
|
13769 | var message = new $root.google.pubsub.v1.GetSchemaRequest();
|
13770 | if (object.name != null)
|
13771 | message.name = String(object.name);
|
13772 | switch (object.view) {
|
13773 | case "SCHEMA_VIEW_UNSPECIFIED":
|
13774 | case 0:
|
13775 | message.view = 0;
|
13776 | break;
|
13777 | case "BASIC":
|
13778 | case 1:
|
13779 | message.view = 1;
|
13780 | break;
|
13781 | case "FULL":
|
13782 | case 2:
|
13783 | message.view = 2;
|
13784 | break;
|
13785 | }
|
13786 | return message;
|
13787 | };
|
13788 |
|
13789 | /**
|
13790 | * Creates a plain object from a GetSchemaRequest message. Also converts values to other types if specified.
|
13791 | * @function toObject
|
13792 | * @memberof google.pubsub.v1.GetSchemaRequest
|
13793 | * @static
|
13794 | * @param {google.pubsub.v1.GetSchemaRequest} message GetSchemaRequest
|
13795 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
13796 | * @returns {Object.<string,*>} Plain object
|
13797 | */
|
13798 | GetSchemaRequest.toObject = function toObject(message, options) {
|
13799 | if (!options)
|
13800 | options = {};
|
13801 | var object = {};
|
13802 | if (options.defaults) {
|
13803 | object.name = "";
|
13804 | object.view = options.enums === String ? "SCHEMA_VIEW_UNSPECIFIED" : 0;
|
13805 | }
|
13806 | if (message.name != null && message.hasOwnProperty("name"))
|
13807 | object.name = message.name;
|
13808 | if (message.view != null && message.hasOwnProperty("view"))
|
13809 | object.view = options.enums === String ? $root.google.pubsub.v1.SchemaView[message.view] : message.view;
|
13810 | return object;
|
13811 | };
|
13812 |
|
13813 | /**
|
13814 | * Converts this GetSchemaRequest to JSON.
|
13815 | * @function toJSON
|
13816 | * @memberof google.pubsub.v1.GetSchemaRequest
|
13817 | * @instance
|
13818 | * @returns {Object.<string,*>} JSON object
|
13819 | */
|
13820 | GetSchemaRequest.prototype.toJSON = function toJSON() {
|
13821 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
13822 | };
|
13823 |
|
13824 | return GetSchemaRequest;
|
13825 | })();
|
13826 |
|
13827 | v1.ListSchemasRequest = (function() {
|
13828 |
|
13829 | /**
|
13830 | * Properties of a ListSchemasRequest.
|
13831 | * @memberof google.pubsub.v1
|
13832 | * @interface IListSchemasRequest
|
13833 | * @property {string|null} [parent] ListSchemasRequest parent
|
13834 | * @property {google.pubsub.v1.SchemaView|null} [view] ListSchemasRequest view
|
13835 | * @property {number|null} [pageSize] ListSchemasRequest pageSize
|
13836 | * @property {string|null} [pageToken] ListSchemasRequest pageToken
|
13837 | */
|
13838 |
|
13839 | /**
|
13840 | * Constructs a new ListSchemasRequest.
|
13841 | * @memberof google.pubsub.v1
|
13842 | * @classdesc Represents a ListSchemasRequest.
|
13843 | * @implements IListSchemasRequest
|
13844 | * @constructor
|
13845 | * @param {google.pubsub.v1.IListSchemasRequest=} [properties] Properties to set
|
13846 | */
|
13847 | function ListSchemasRequest(properties) {
|
13848 | if (properties)
|
13849 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
13850 | if (properties[keys[i]] != null)
|
13851 | this[keys[i]] = properties[keys[i]];
|
13852 | }
|
13853 |
|
13854 | /**
|
13855 | * ListSchemasRequest parent.
|
13856 | * @member {string} parent
|
13857 | * @memberof google.pubsub.v1.ListSchemasRequest
|
13858 | * @instance
|
13859 | */
|
13860 | ListSchemasRequest.prototype.parent = "";
|
13861 |
|
13862 | /**
|
13863 | * ListSchemasRequest view.
|
13864 | * @member {google.pubsub.v1.SchemaView} view
|
13865 | * @memberof google.pubsub.v1.ListSchemasRequest
|
13866 | * @instance
|
13867 | */
|
13868 | ListSchemasRequest.prototype.view = 0;
|
13869 |
|
13870 | /**
|
13871 | * ListSchemasRequest pageSize.
|
13872 | * @member {number} pageSize
|
13873 | * @memberof google.pubsub.v1.ListSchemasRequest
|
13874 | * @instance
|
13875 | */
|
13876 | ListSchemasRequest.prototype.pageSize = 0;
|
13877 |
|
13878 | /**
|
13879 | * ListSchemasRequest pageToken.
|
13880 | * @member {string} pageToken
|
13881 | * @memberof google.pubsub.v1.ListSchemasRequest
|
13882 | * @instance
|
13883 | */
|
13884 | ListSchemasRequest.prototype.pageToken = "";
|
13885 |
|
13886 | /**
|
13887 | * Creates a new ListSchemasRequest instance using the specified properties.
|
13888 | * @function create
|
13889 | * @memberof google.pubsub.v1.ListSchemasRequest
|
13890 | * @static
|
13891 | * @param {google.pubsub.v1.IListSchemasRequest=} [properties] Properties to set
|
13892 | * @returns {google.pubsub.v1.ListSchemasRequest} ListSchemasRequest instance
|
13893 | */
|
13894 | ListSchemasRequest.create = function create(properties) {
|
13895 | return new ListSchemasRequest(properties);
|
13896 | };
|
13897 |
|
13898 | /**
|
13899 | * Encodes the specified ListSchemasRequest message. Does not implicitly {@link google.pubsub.v1.ListSchemasRequest.verify|verify} messages.
|
13900 | * @function encode
|
13901 | * @memberof google.pubsub.v1.ListSchemasRequest
|
13902 | * @static
|
13903 | * @param {google.pubsub.v1.IListSchemasRequest} message ListSchemasRequest message or plain object to encode
|
13904 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
13905 | * @returns {$protobuf.Writer} Writer
|
13906 | */
|
13907 | ListSchemasRequest.encode = function encode(message, writer) {
|
13908 | if (!writer)
|
13909 | writer = $Writer.create();
|
13910 | if (message.parent != null && Object.hasOwnProperty.call(message, "parent"))
|
13911 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent);
|
13912 | if (message.view != null && Object.hasOwnProperty.call(message, "view"))
|
13913 | writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view);
|
13914 | if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize"))
|
13915 | writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize);
|
13916 | if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken"))
|
13917 | writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken);
|
13918 | return writer;
|
13919 | };
|
13920 |
|
13921 | /**
|
13922 | * Encodes the specified ListSchemasRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ListSchemasRequest.verify|verify} messages.
|
13923 | * @function encodeDelimited
|
13924 | * @memberof google.pubsub.v1.ListSchemasRequest
|
13925 | * @static
|
13926 | * @param {google.pubsub.v1.IListSchemasRequest} message ListSchemasRequest message or plain object to encode
|
13927 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
13928 | * @returns {$protobuf.Writer} Writer
|
13929 | */
|
13930 | ListSchemasRequest.encodeDelimited = function encodeDelimited(message, writer) {
|
13931 | return this.encode(message, writer).ldelim();
|
13932 | };
|
13933 |
|
13934 | /**
|
13935 | * Decodes a ListSchemasRequest message from the specified reader or buffer.
|
13936 | * @function decode
|
13937 | * @memberof google.pubsub.v1.ListSchemasRequest
|
13938 | * @static
|
13939 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
13940 | * @param {number} [length] Message length if known beforehand
|
13941 | * @returns {google.pubsub.v1.ListSchemasRequest} ListSchemasRequest
|
13942 | * @throws {Error} If the payload is not a reader or valid buffer
|
13943 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
13944 | */
|
13945 | ListSchemasRequest.decode = function decode(reader, length) {
|
13946 | if (!(reader instanceof $Reader))
|
13947 | reader = $Reader.create(reader);
|
13948 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.ListSchemasRequest();
|
13949 | while (reader.pos < end) {
|
13950 | var tag = reader.uint32();
|
13951 | switch (tag >>> 3) {
|
13952 | case 1:
|
13953 | message.parent = reader.string();
|
13954 | break;
|
13955 | case 2:
|
13956 | message.view = reader.int32();
|
13957 | break;
|
13958 | case 3:
|
13959 | message.pageSize = reader.int32();
|
13960 | break;
|
13961 | case 4:
|
13962 | message.pageToken = reader.string();
|
13963 | break;
|
13964 | default:
|
13965 | reader.skipType(tag & 7);
|
13966 | break;
|
13967 | }
|
13968 | }
|
13969 | return message;
|
13970 | };
|
13971 |
|
13972 | /**
|
13973 | * Decodes a ListSchemasRequest message from the specified reader or buffer, length delimited.
|
13974 | * @function decodeDelimited
|
13975 | * @memberof google.pubsub.v1.ListSchemasRequest
|
13976 | * @static
|
13977 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
13978 | * @returns {google.pubsub.v1.ListSchemasRequest} ListSchemasRequest
|
13979 | * @throws {Error} If the payload is not a reader or valid buffer
|
13980 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
13981 | */
|
13982 | ListSchemasRequest.decodeDelimited = function decodeDelimited(reader) {
|
13983 | if (!(reader instanceof $Reader))
|
13984 | reader = new $Reader(reader);
|
13985 | return this.decode(reader, reader.uint32());
|
13986 | };
|
13987 |
|
13988 | /**
|
13989 | * Verifies a ListSchemasRequest message.
|
13990 | * @function verify
|
13991 | * @memberof google.pubsub.v1.ListSchemasRequest
|
13992 | * @static
|
13993 | * @param {Object.<string,*>} message Plain object to verify
|
13994 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
13995 | */
|
13996 | ListSchemasRequest.verify = function verify(message) {
|
13997 | if (typeof message !== "object" || message === null)
|
13998 | return "object expected";
|
13999 | if (message.parent != null && message.hasOwnProperty("parent"))
|
14000 | if (!$util.isString(message.parent))
|
14001 | return "parent: string expected";
|
14002 | if (message.view != null && message.hasOwnProperty("view"))
|
14003 | switch (message.view) {
|
14004 | default:
|
14005 | return "view: enum value expected";
|
14006 | case 0:
|
14007 | case 1:
|
14008 | case 2:
|
14009 | break;
|
14010 | }
|
14011 | if (message.pageSize != null && message.hasOwnProperty("pageSize"))
|
14012 | if (!$util.isInteger(message.pageSize))
|
14013 | return "pageSize: integer expected";
|
14014 | if (message.pageToken != null && message.hasOwnProperty("pageToken"))
|
14015 | if (!$util.isString(message.pageToken))
|
14016 | return "pageToken: string expected";
|
14017 | return null;
|
14018 | };
|
14019 |
|
14020 | /**
|
14021 | * Creates a ListSchemasRequest message from a plain object. Also converts values to their respective internal types.
|
14022 | * @function fromObject
|
14023 | * @memberof google.pubsub.v1.ListSchemasRequest
|
14024 | * @static
|
14025 | * @param {Object.<string,*>} object Plain object
|
14026 | * @returns {google.pubsub.v1.ListSchemasRequest} ListSchemasRequest
|
14027 | */
|
14028 | ListSchemasRequest.fromObject = function fromObject(object) {
|
14029 | if (object instanceof $root.google.pubsub.v1.ListSchemasRequest)
|
14030 | return object;
|
14031 | var message = new $root.google.pubsub.v1.ListSchemasRequest();
|
14032 | if (object.parent != null)
|
14033 | message.parent = String(object.parent);
|
14034 | switch (object.view) {
|
14035 | case "SCHEMA_VIEW_UNSPECIFIED":
|
14036 | case 0:
|
14037 | message.view = 0;
|
14038 | break;
|
14039 | case "BASIC":
|
14040 | case 1:
|
14041 | message.view = 1;
|
14042 | break;
|
14043 | case "FULL":
|
14044 | case 2:
|
14045 | message.view = 2;
|
14046 | break;
|
14047 | }
|
14048 | if (object.pageSize != null)
|
14049 | message.pageSize = object.pageSize | 0;
|
14050 | if (object.pageToken != null)
|
14051 | message.pageToken = String(object.pageToken);
|
14052 | return message;
|
14053 | };
|
14054 |
|
14055 | /**
|
14056 | * Creates a plain object from a ListSchemasRequest message. Also converts values to other types if specified.
|
14057 | * @function toObject
|
14058 | * @memberof google.pubsub.v1.ListSchemasRequest
|
14059 | * @static
|
14060 | * @param {google.pubsub.v1.ListSchemasRequest} message ListSchemasRequest
|
14061 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
14062 | * @returns {Object.<string,*>} Plain object
|
14063 | */
|
14064 | ListSchemasRequest.toObject = function toObject(message, options) {
|
14065 | if (!options)
|
14066 | options = {};
|
14067 | var object = {};
|
14068 | if (options.defaults) {
|
14069 | object.parent = "";
|
14070 | object.view = options.enums === String ? "SCHEMA_VIEW_UNSPECIFIED" : 0;
|
14071 | object.pageSize = 0;
|
14072 | object.pageToken = "";
|
14073 | }
|
14074 | if (message.parent != null && message.hasOwnProperty("parent"))
|
14075 | object.parent = message.parent;
|
14076 | if (message.view != null && message.hasOwnProperty("view"))
|
14077 | object.view = options.enums === String ? $root.google.pubsub.v1.SchemaView[message.view] : message.view;
|
14078 | if (message.pageSize != null && message.hasOwnProperty("pageSize"))
|
14079 | object.pageSize = message.pageSize;
|
14080 | if (message.pageToken != null && message.hasOwnProperty("pageToken"))
|
14081 | object.pageToken = message.pageToken;
|
14082 | return object;
|
14083 | };
|
14084 |
|
14085 | /**
|
14086 | * Converts this ListSchemasRequest to JSON.
|
14087 | * @function toJSON
|
14088 | * @memberof google.pubsub.v1.ListSchemasRequest
|
14089 | * @instance
|
14090 | * @returns {Object.<string,*>} JSON object
|
14091 | */
|
14092 | ListSchemasRequest.prototype.toJSON = function toJSON() {
|
14093 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
14094 | };
|
14095 |
|
14096 | return ListSchemasRequest;
|
14097 | })();
|
14098 |
|
14099 | v1.ListSchemasResponse = (function() {
|
14100 |
|
14101 | /**
|
14102 | * Properties of a ListSchemasResponse.
|
14103 | * @memberof google.pubsub.v1
|
14104 | * @interface IListSchemasResponse
|
14105 | * @property {Array.<google.pubsub.v1.ISchema>|null} [schemas] ListSchemasResponse schemas
|
14106 | * @property {string|null} [nextPageToken] ListSchemasResponse nextPageToken
|
14107 | */
|
14108 |
|
14109 | /**
|
14110 | * Constructs a new ListSchemasResponse.
|
14111 | * @memberof google.pubsub.v1
|
14112 | * @classdesc Represents a ListSchemasResponse.
|
14113 | * @implements IListSchemasResponse
|
14114 | * @constructor
|
14115 | * @param {google.pubsub.v1.IListSchemasResponse=} [properties] Properties to set
|
14116 | */
|
14117 | function ListSchemasResponse(properties) {
|
14118 | this.schemas = [];
|
14119 | if (properties)
|
14120 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
14121 | if (properties[keys[i]] != null)
|
14122 | this[keys[i]] = properties[keys[i]];
|
14123 | }
|
14124 |
|
14125 | /**
|
14126 | * ListSchemasResponse schemas.
|
14127 | * @member {Array.<google.pubsub.v1.ISchema>} schemas
|
14128 | * @memberof google.pubsub.v1.ListSchemasResponse
|
14129 | * @instance
|
14130 | */
|
14131 | ListSchemasResponse.prototype.schemas = $util.emptyArray;
|
14132 |
|
14133 | /**
|
14134 | * ListSchemasResponse nextPageToken.
|
14135 | * @member {string} nextPageToken
|
14136 | * @memberof google.pubsub.v1.ListSchemasResponse
|
14137 | * @instance
|
14138 | */
|
14139 | ListSchemasResponse.prototype.nextPageToken = "";
|
14140 |
|
14141 | /**
|
14142 | * Creates a new ListSchemasResponse instance using the specified properties.
|
14143 | * @function create
|
14144 | * @memberof google.pubsub.v1.ListSchemasResponse
|
14145 | * @static
|
14146 | * @param {google.pubsub.v1.IListSchemasResponse=} [properties] Properties to set
|
14147 | * @returns {google.pubsub.v1.ListSchemasResponse} ListSchemasResponse instance
|
14148 | */
|
14149 | ListSchemasResponse.create = function create(properties) {
|
14150 | return new ListSchemasResponse(properties);
|
14151 | };
|
14152 |
|
14153 | /**
|
14154 | * Encodes the specified ListSchemasResponse message. Does not implicitly {@link google.pubsub.v1.ListSchemasResponse.verify|verify} messages.
|
14155 | * @function encode
|
14156 | * @memberof google.pubsub.v1.ListSchemasResponse
|
14157 | * @static
|
14158 | * @param {google.pubsub.v1.IListSchemasResponse} message ListSchemasResponse message or plain object to encode
|
14159 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
14160 | * @returns {$protobuf.Writer} Writer
|
14161 | */
|
14162 | ListSchemasResponse.encode = function encode(message, writer) {
|
14163 | if (!writer)
|
14164 | writer = $Writer.create();
|
14165 | if (message.schemas != null && message.schemas.length)
|
14166 | for (var i = 0; i < message.schemas.length; ++i)
|
14167 | $root.google.pubsub.v1.Schema.encode(message.schemas[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
14168 | if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken"))
|
14169 | writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken);
|
14170 | return writer;
|
14171 | };
|
14172 |
|
14173 | /**
|
14174 | * Encodes the specified ListSchemasResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ListSchemasResponse.verify|verify} messages.
|
14175 | * @function encodeDelimited
|
14176 | * @memberof google.pubsub.v1.ListSchemasResponse
|
14177 | * @static
|
14178 | * @param {google.pubsub.v1.IListSchemasResponse} message ListSchemasResponse message or plain object to encode
|
14179 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
14180 | * @returns {$protobuf.Writer} Writer
|
14181 | */
|
14182 | ListSchemasResponse.encodeDelimited = function encodeDelimited(message, writer) {
|
14183 | return this.encode(message, writer).ldelim();
|
14184 | };
|
14185 |
|
14186 | /**
|
14187 | * Decodes a ListSchemasResponse message from the specified reader or buffer.
|
14188 | * @function decode
|
14189 | * @memberof google.pubsub.v1.ListSchemasResponse
|
14190 | * @static
|
14191 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
14192 | * @param {number} [length] Message length if known beforehand
|
14193 | * @returns {google.pubsub.v1.ListSchemasResponse} ListSchemasResponse
|
14194 | * @throws {Error} If the payload is not a reader or valid buffer
|
14195 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
14196 | */
|
14197 | ListSchemasResponse.decode = function decode(reader, length) {
|
14198 | if (!(reader instanceof $Reader))
|
14199 | reader = $Reader.create(reader);
|
14200 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.ListSchemasResponse();
|
14201 | while (reader.pos < end) {
|
14202 | var tag = reader.uint32();
|
14203 | switch (tag >>> 3) {
|
14204 | case 1:
|
14205 | if (!(message.schemas && message.schemas.length))
|
14206 | message.schemas = [];
|
14207 | message.schemas.push($root.google.pubsub.v1.Schema.decode(reader, reader.uint32()));
|
14208 | break;
|
14209 | case 2:
|
14210 | message.nextPageToken = reader.string();
|
14211 | break;
|
14212 | default:
|
14213 | reader.skipType(tag & 7);
|
14214 | break;
|
14215 | }
|
14216 | }
|
14217 | return message;
|
14218 | };
|
14219 |
|
14220 | /**
|
14221 | * Decodes a ListSchemasResponse message from the specified reader or buffer, length delimited.
|
14222 | * @function decodeDelimited
|
14223 | * @memberof google.pubsub.v1.ListSchemasResponse
|
14224 | * @static
|
14225 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
14226 | * @returns {google.pubsub.v1.ListSchemasResponse} ListSchemasResponse
|
14227 | * @throws {Error} If the payload is not a reader or valid buffer
|
14228 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
14229 | */
|
14230 | ListSchemasResponse.decodeDelimited = function decodeDelimited(reader) {
|
14231 | if (!(reader instanceof $Reader))
|
14232 | reader = new $Reader(reader);
|
14233 | return this.decode(reader, reader.uint32());
|
14234 | };
|
14235 |
|
14236 | /**
|
14237 | * Verifies a ListSchemasResponse message.
|
14238 | * @function verify
|
14239 | * @memberof google.pubsub.v1.ListSchemasResponse
|
14240 | * @static
|
14241 | * @param {Object.<string,*>} message Plain object to verify
|
14242 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
14243 | */
|
14244 | ListSchemasResponse.verify = function verify(message) {
|
14245 | if (typeof message !== "object" || message === null)
|
14246 | return "object expected";
|
14247 | if (message.schemas != null && message.hasOwnProperty("schemas")) {
|
14248 | if (!Array.isArray(message.schemas))
|
14249 | return "schemas: array expected";
|
14250 | for (var i = 0; i < message.schemas.length; ++i) {
|
14251 | var error = $root.google.pubsub.v1.Schema.verify(message.schemas[i]);
|
14252 | if (error)
|
14253 | return "schemas." + error;
|
14254 | }
|
14255 | }
|
14256 | if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken"))
|
14257 | if (!$util.isString(message.nextPageToken))
|
14258 | return "nextPageToken: string expected";
|
14259 | return null;
|
14260 | };
|
14261 |
|
14262 | /**
|
14263 | * Creates a ListSchemasResponse message from a plain object. Also converts values to their respective internal types.
|
14264 | * @function fromObject
|
14265 | * @memberof google.pubsub.v1.ListSchemasResponse
|
14266 | * @static
|
14267 | * @param {Object.<string,*>} object Plain object
|
14268 | * @returns {google.pubsub.v1.ListSchemasResponse} ListSchemasResponse
|
14269 | */
|
14270 | ListSchemasResponse.fromObject = function fromObject(object) {
|
14271 | if (object instanceof $root.google.pubsub.v1.ListSchemasResponse)
|
14272 | return object;
|
14273 | var message = new $root.google.pubsub.v1.ListSchemasResponse();
|
14274 | if (object.schemas) {
|
14275 | if (!Array.isArray(object.schemas))
|
14276 | throw TypeError(".google.pubsub.v1.ListSchemasResponse.schemas: array expected");
|
14277 | message.schemas = [];
|
14278 | for (var i = 0; i < object.schemas.length; ++i) {
|
14279 | if (typeof object.schemas[i] !== "object")
|
14280 | throw TypeError(".google.pubsub.v1.ListSchemasResponse.schemas: object expected");
|
14281 | message.schemas[i] = $root.google.pubsub.v1.Schema.fromObject(object.schemas[i]);
|
14282 | }
|
14283 | }
|
14284 | if (object.nextPageToken != null)
|
14285 | message.nextPageToken = String(object.nextPageToken);
|
14286 | return message;
|
14287 | };
|
14288 |
|
14289 | /**
|
14290 | * Creates a plain object from a ListSchemasResponse message. Also converts values to other types if specified.
|
14291 | * @function toObject
|
14292 | * @memberof google.pubsub.v1.ListSchemasResponse
|
14293 | * @static
|
14294 | * @param {google.pubsub.v1.ListSchemasResponse} message ListSchemasResponse
|
14295 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
14296 | * @returns {Object.<string,*>} Plain object
|
14297 | */
|
14298 | ListSchemasResponse.toObject = function toObject(message, options) {
|
14299 | if (!options)
|
14300 | options = {};
|
14301 | var object = {};
|
14302 | if (options.arrays || options.defaults)
|
14303 | object.schemas = [];
|
14304 | if (options.defaults)
|
14305 | object.nextPageToken = "";
|
14306 | if (message.schemas && message.schemas.length) {
|
14307 | object.schemas = [];
|
14308 | for (var j = 0; j < message.schemas.length; ++j)
|
14309 | object.schemas[j] = $root.google.pubsub.v1.Schema.toObject(message.schemas[j], options);
|
14310 | }
|
14311 | if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken"))
|
14312 | object.nextPageToken = message.nextPageToken;
|
14313 | return object;
|
14314 | };
|
14315 |
|
14316 | /**
|
14317 | * Converts this ListSchemasResponse to JSON.
|
14318 | * @function toJSON
|
14319 | * @memberof google.pubsub.v1.ListSchemasResponse
|
14320 | * @instance
|
14321 | * @returns {Object.<string,*>} JSON object
|
14322 | */
|
14323 | ListSchemasResponse.prototype.toJSON = function toJSON() {
|
14324 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
14325 | };
|
14326 |
|
14327 | return ListSchemasResponse;
|
14328 | })();
|
14329 |
|
14330 | v1.DeleteSchemaRequest = (function() {
|
14331 |
|
14332 | /**
|
14333 | * Properties of a DeleteSchemaRequest.
|
14334 | * @memberof google.pubsub.v1
|
14335 | * @interface IDeleteSchemaRequest
|
14336 | * @property {string|null} [name] DeleteSchemaRequest name
|
14337 | */
|
14338 |
|
14339 | /**
|
14340 | * Constructs a new DeleteSchemaRequest.
|
14341 | * @memberof google.pubsub.v1
|
14342 | * @classdesc Represents a DeleteSchemaRequest.
|
14343 | * @implements IDeleteSchemaRequest
|
14344 | * @constructor
|
14345 | * @param {google.pubsub.v1.IDeleteSchemaRequest=} [properties] Properties to set
|
14346 | */
|
14347 | function DeleteSchemaRequest(properties) {
|
14348 | if (properties)
|
14349 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
14350 | if (properties[keys[i]] != null)
|
14351 | this[keys[i]] = properties[keys[i]];
|
14352 | }
|
14353 |
|
14354 | /**
|
14355 | * DeleteSchemaRequest name.
|
14356 | * @member {string} name
|
14357 | * @memberof google.pubsub.v1.DeleteSchemaRequest
|
14358 | * @instance
|
14359 | */
|
14360 | DeleteSchemaRequest.prototype.name = "";
|
14361 |
|
14362 | /**
|
14363 | * Creates a new DeleteSchemaRequest instance using the specified properties.
|
14364 | * @function create
|
14365 | * @memberof google.pubsub.v1.DeleteSchemaRequest
|
14366 | * @static
|
14367 | * @param {google.pubsub.v1.IDeleteSchemaRequest=} [properties] Properties to set
|
14368 | * @returns {google.pubsub.v1.DeleteSchemaRequest} DeleteSchemaRequest instance
|
14369 | */
|
14370 | DeleteSchemaRequest.create = function create(properties) {
|
14371 | return new DeleteSchemaRequest(properties);
|
14372 | };
|
14373 |
|
14374 | /**
|
14375 | * Encodes the specified DeleteSchemaRequest message. Does not implicitly {@link google.pubsub.v1.DeleteSchemaRequest.verify|verify} messages.
|
14376 | * @function encode
|
14377 | * @memberof google.pubsub.v1.DeleteSchemaRequest
|
14378 | * @static
|
14379 | * @param {google.pubsub.v1.IDeleteSchemaRequest} message DeleteSchemaRequest message or plain object to encode
|
14380 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
14381 | * @returns {$protobuf.Writer} Writer
|
14382 | */
|
14383 | DeleteSchemaRequest.encode = function encode(message, writer) {
|
14384 | if (!writer)
|
14385 | writer = $Writer.create();
|
14386 | if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
14387 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
|
14388 | return writer;
|
14389 | };
|
14390 |
|
14391 | /**
|
14392 | * Encodes the specified DeleteSchemaRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.DeleteSchemaRequest.verify|verify} messages.
|
14393 | * @function encodeDelimited
|
14394 | * @memberof google.pubsub.v1.DeleteSchemaRequest
|
14395 | * @static
|
14396 | * @param {google.pubsub.v1.IDeleteSchemaRequest} message DeleteSchemaRequest message or plain object to encode
|
14397 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
14398 | * @returns {$protobuf.Writer} Writer
|
14399 | */
|
14400 | DeleteSchemaRequest.encodeDelimited = function encodeDelimited(message, writer) {
|
14401 | return this.encode(message, writer).ldelim();
|
14402 | };
|
14403 |
|
14404 | /**
|
14405 | * Decodes a DeleteSchemaRequest message from the specified reader or buffer.
|
14406 | * @function decode
|
14407 | * @memberof google.pubsub.v1.DeleteSchemaRequest
|
14408 | * @static
|
14409 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
14410 | * @param {number} [length] Message length if known beforehand
|
14411 | * @returns {google.pubsub.v1.DeleteSchemaRequest} DeleteSchemaRequest
|
14412 | * @throws {Error} If the payload is not a reader or valid buffer
|
14413 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
14414 | */
|
14415 | DeleteSchemaRequest.decode = function decode(reader, length) {
|
14416 | if (!(reader instanceof $Reader))
|
14417 | reader = $Reader.create(reader);
|
14418 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.DeleteSchemaRequest();
|
14419 | while (reader.pos < end) {
|
14420 | var tag = reader.uint32();
|
14421 | switch (tag >>> 3) {
|
14422 | case 1:
|
14423 | message.name = reader.string();
|
14424 | break;
|
14425 | default:
|
14426 | reader.skipType(tag & 7);
|
14427 | break;
|
14428 | }
|
14429 | }
|
14430 | return message;
|
14431 | };
|
14432 |
|
14433 | /**
|
14434 | * Decodes a DeleteSchemaRequest message from the specified reader or buffer, length delimited.
|
14435 | * @function decodeDelimited
|
14436 | * @memberof google.pubsub.v1.DeleteSchemaRequest
|
14437 | * @static
|
14438 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
14439 | * @returns {google.pubsub.v1.DeleteSchemaRequest} DeleteSchemaRequest
|
14440 | * @throws {Error} If the payload is not a reader or valid buffer
|
14441 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
14442 | */
|
14443 | DeleteSchemaRequest.decodeDelimited = function decodeDelimited(reader) {
|
14444 | if (!(reader instanceof $Reader))
|
14445 | reader = new $Reader(reader);
|
14446 | return this.decode(reader, reader.uint32());
|
14447 | };
|
14448 |
|
14449 | /**
|
14450 | * Verifies a DeleteSchemaRequest message.
|
14451 | * @function verify
|
14452 | * @memberof google.pubsub.v1.DeleteSchemaRequest
|
14453 | * @static
|
14454 | * @param {Object.<string,*>} message Plain object to verify
|
14455 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
14456 | */
|
14457 | DeleteSchemaRequest.verify = function verify(message) {
|
14458 | if (typeof message !== "object" || message === null)
|
14459 | return "object expected";
|
14460 | if (message.name != null && message.hasOwnProperty("name"))
|
14461 | if (!$util.isString(message.name))
|
14462 | return "name: string expected";
|
14463 | return null;
|
14464 | };
|
14465 |
|
14466 | /**
|
14467 | * Creates a DeleteSchemaRequest message from a plain object. Also converts values to their respective internal types.
|
14468 | * @function fromObject
|
14469 | * @memberof google.pubsub.v1.DeleteSchemaRequest
|
14470 | * @static
|
14471 | * @param {Object.<string,*>} object Plain object
|
14472 | * @returns {google.pubsub.v1.DeleteSchemaRequest} DeleteSchemaRequest
|
14473 | */
|
14474 | DeleteSchemaRequest.fromObject = function fromObject(object) {
|
14475 | if (object instanceof $root.google.pubsub.v1.DeleteSchemaRequest)
|
14476 | return object;
|
14477 | var message = new $root.google.pubsub.v1.DeleteSchemaRequest();
|
14478 | if (object.name != null)
|
14479 | message.name = String(object.name);
|
14480 | return message;
|
14481 | };
|
14482 |
|
14483 | /**
|
14484 | * Creates a plain object from a DeleteSchemaRequest message. Also converts values to other types if specified.
|
14485 | * @function toObject
|
14486 | * @memberof google.pubsub.v1.DeleteSchemaRequest
|
14487 | * @static
|
14488 | * @param {google.pubsub.v1.DeleteSchemaRequest} message DeleteSchemaRequest
|
14489 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
14490 | * @returns {Object.<string,*>} Plain object
|
14491 | */
|
14492 | DeleteSchemaRequest.toObject = function toObject(message, options) {
|
14493 | if (!options)
|
14494 | options = {};
|
14495 | var object = {};
|
14496 | if (options.defaults)
|
14497 | object.name = "";
|
14498 | if (message.name != null && message.hasOwnProperty("name"))
|
14499 | object.name = message.name;
|
14500 | return object;
|
14501 | };
|
14502 |
|
14503 | /**
|
14504 | * Converts this DeleteSchemaRequest to JSON.
|
14505 | * @function toJSON
|
14506 | * @memberof google.pubsub.v1.DeleteSchemaRequest
|
14507 | * @instance
|
14508 | * @returns {Object.<string,*>} JSON object
|
14509 | */
|
14510 | DeleteSchemaRequest.prototype.toJSON = function toJSON() {
|
14511 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
14512 | };
|
14513 |
|
14514 | return DeleteSchemaRequest;
|
14515 | })();
|
14516 |
|
14517 | v1.ValidateSchemaRequest = (function() {
|
14518 |
|
14519 | /**
|
14520 | * Properties of a ValidateSchemaRequest.
|
14521 | * @memberof google.pubsub.v1
|
14522 | * @interface IValidateSchemaRequest
|
14523 | * @property {string|null} [parent] ValidateSchemaRequest parent
|
14524 | * @property {google.pubsub.v1.ISchema|null} [schema] ValidateSchemaRequest schema
|
14525 | */
|
14526 |
|
14527 | /**
|
14528 | * Constructs a new ValidateSchemaRequest.
|
14529 | * @memberof google.pubsub.v1
|
14530 | * @classdesc Represents a ValidateSchemaRequest.
|
14531 | * @implements IValidateSchemaRequest
|
14532 | * @constructor
|
14533 | * @param {google.pubsub.v1.IValidateSchemaRequest=} [properties] Properties to set
|
14534 | */
|
14535 | function ValidateSchemaRequest(properties) {
|
14536 | if (properties)
|
14537 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
14538 | if (properties[keys[i]] != null)
|
14539 | this[keys[i]] = properties[keys[i]];
|
14540 | }
|
14541 |
|
14542 | /**
|
14543 | * ValidateSchemaRequest parent.
|
14544 | * @member {string} parent
|
14545 | * @memberof google.pubsub.v1.ValidateSchemaRequest
|
14546 | * @instance
|
14547 | */
|
14548 | ValidateSchemaRequest.prototype.parent = "";
|
14549 |
|
14550 | /**
|
14551 | * ValidateSchemaRequest schema.
|
14552 | * @member {google.pubsub.v1.ISchema|null|undefined} schema
|
14553 | * @memberof google.pubsub.v1.ValidateSchemaRequest
|
14554 | * @instance
|
14555 | */
|
14556 | ValidateSchemaRequest.prototype.schema = null;
|
14557 |
|
14558 | /**
|
14559 | * Creates a new ValidateSchemaRequest instance using the specified properties.
|
14560 | * @function create
|
14561 | * @memberof google.pubsub.v1.ValidateSchemaRequest
|
14562 | * @static
|
14563 | * @param {google.pubsub.v1.IValidateSchemaRequest=} [properties] Properties to set
|
14564 | * @returns {google.pubsub.v1.ValidateSchemaRequest} ValidateSchemaRequest instance
|
14565 | */
|
14566 | ValidateSchemaRequest.create = function create(properties) {
|
14567 | return new ValidateSchemaRequest(properties);
|
14568 | };
|
14569 |
|
14570 | /**
|
14571 | * Encodes the specified ValidateSchemaRequest message. Does not implicitly {@link google.pubsub.v1.ValidateSchemaRequest.verify|verify} messages.
|
14572 | * @function encode
|
14573 | * @memberof google.pubsub.v1.ValidateSchemaRequest
|
14574 | * @static
|
14575 | * @param {google.pubsub.v1.IValidateSchemaRequest} message ValidateSchemaRequest message or plain object to encode
|
14576 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
14577 | * @returns {$protobuf.Writer} Writer
|
14578 | */
|
14579 | ValidateSchemaRequest.encode = function encode(message, writer) {
|
14580 | if (!writer)
|
14581 | writer = $Writer.create();
|
14582 | if (message.parent != null && Object.hasOwnProperty.call(message, "parent"))
|
14583 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent);
|
14584 | if (message.schema != null && Object.hasOwnProperty.call(message, "schema"))
|
14585 | $root.google.pubsub.v1.Schema.encode(message.schema, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
14586 | return writer;
|
14587 | };
|
14588 |
|
14589 | /**
|
14590 | * Encodes the specified ValidateSchemaRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ValidateSchemaRequest.verify|verify} messages.
|
14591 | * @function encodeDelimited
|
14592 | * @memberof google.pubsub.v1.ValidateSchemaRequest
|
14593 | * @static
|
14594 | * @param {google.pubsub.v1.IValidateSchemaRequest} message ValidateSchemaRequest message or plain object to encode
|
14595 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
14596 | * @returns {$protobuf.Writer} Writer
|
14597 | */
|
14598 | ValidateSchemaRequest.encodeDelimited = function encodeDelimited(message, writer) {
|
14599 | return this.encode(message, writer).ldelim();
|
14600 | };
|
14601 |
|
14602 | /**
|
14603 | * Decodes a ValidateSchemaRequest message from the specified reader or buffer.
|
14604 | * @function decode
|
14605 | * @memberof google.pubsub.v1.ValidateSchemaRequest
|
14606 | * @static
|
14607 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
14608 | * @param {number} [length] Message length if known beforehand
|
14609 | * @returns {google.pubsub.v1.ValidateSchemaRequest} ValidateSchemaRequest
|
14610 | * @throws {Error} If the payload is not a reader or valid buffer
|
14611 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
14612 | */
|
14613 | ValidateSchemaRequest.decode = function decode(reader, length) {
|
14614 | if (!(reader instanceof $Reader))
|
14615 | reader = $Reader.create(reader);
|
14616 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.ValidateSchemaRequest();
|
14617 | while (reader.pos < end) {
|
14618 | var tag = reader.uint32();
|
14619 | switch (tag >>> 3) {
|
14620 | case 1:
|
14621 | message.parent = reader.string();
|
14622 | break;
|
14623 | case 2:
|
14624 | message.schema = $root.google.pubsub.v1.Schema.decode(reader, reader.uint32());
|
14625 | break;
|
14626 | default:
|
14627 | reader.skipType(tag & 7);
|
14628 | break;
|
14629 | }
|
14630 | }
|
14631 | return message;
|
14632 | };
|
14633 |
|
14634 | /**
|
14635 | * Decodes a ValidateSchemaRequest message from the specified reader or buffer, length delimited.
|
14636 | * @function decodeDelimited
|
14637 | * @memberof google.pubsub.v1.ValidateSchemaRequest
|
14638 | * @static
|
14639 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
14640 | * @returns {google.pubsub.v1.ValidateSchemaRequest} ValidateSchemaRequest
|
14641 | * @throws {Error} If the payload is not a reader or valid buffer
|
14642 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
14643 | */
|
14644 | ValidateSchemaRequest.decodeDelimited = function decodeDelimited(reader) {
|
14645 | if (!(reader instanceof $Reader))
|
14646 | reader = new $Reader(reader);
|
14647 | return this.decode(reader, reader.uint32());
|
14648 | };
|
14649 |
|
14650 | /**
|
14651 | * Verifies a ValidateSchemaRequest message.
|
14652 | * @function verify
|
14653 | * @memberof google.pubsub.v1.ValidateSchemaRequest
|
14654 | * @static
|
14655 | * @param {Object.<string,*>} message Plain object to verify
|
14656 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
14657 | */
|
14658 | ValidateSchemaRequest.verify = function verify(message) {
|
14659 | if (typeof message !== "object" || message === null)
|
14660 | return "object expected";
|
14661 | if (message.parent != null && message.hasOwnProperty("parent"))
|
14662 | if (!$util.isString(message.parent))
|
14663 | return "parent: string expected";
|
14664 | if (message.schema != null && message.hasOwnProperty("schema")) {
|
14665 | var error = $root.google.pubsub.v1.Schema.verify(message.schema);
|
14666 | if (error)
|
14667 | return "schema." + error;
|
14668 | }
|
14669 | return null;
|
14670 | };
|
14671 |
|
14672 | /**
|
14673 | * Creates a ValidateSchemaRequest message from a plain object. Also converts values to their respective internal types.
|
14674 | * @function fromObject
|
14675 | * @memberof google.pubsub.v1.ValidateSchemaRequest
|
14676 | * @static
|
14677 | * @param {Object.<string,*>} object Plain object
|
14678 | * @returns {google.pubsub.v1.ValidateSchemaRequest} ValidateSchemaRequest
|
14679 | */
|
14680 | ValidateSchemaRequest.fromObject = function fromObject(object) {
|
14681 | if (object instanceof $root.google.pubsub.v1.ValidateSchemaRequest)
|
14682 | return object;
|
14683 | var message = new $root.google.pubsub.v1.ValidateSchemaRequest();
|
14684 | if (object.parent != null)
|
14685 | message.parent = String(object.parent);
|
14686 | if (object.schema != null) {
|
14687 | if (typeof object.schema !== "object")
|
14688 | throw TypeError(".google.pubsub.v1.ValidateSchemaRequest.schema: object expected");
|
14689 | message.schema = $root.google.pubsub.v1.Schema.fromObject(object.schema);
|
14690 | }
|
14691 | return message;
|
14692 | };
|
14693 |
|
14694 | /**
|
14695 | * Creates a plain object from a ValidateSchemaRequest message. Also converts values to other types if specified.
|
14696 | * @function toObject
|
14697 | * @memberof google.pubsub.v1.ValidateSchemaRequest
|
14698 | * @static
|
14699 | * @param {google.pubsub.v1.ValidateSchemaRequest} message ValidateSchemaRequest
|
14700 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
14701 | * @returns {Object.<string,*>} Plain object
|
14702 | */
|
14703 | ValidateSchemaRequest.toObject = function toObject(message, options) {
|
14704 | if (!options)
|
14705 | options = {};
|
14706 | var object = {};
|
14707 | if (options.defaults) {
|
14708 | object.parent = "";
|
14709 | object.schema = null;
|
14710 | }
|
14711 | if (message.parent != null && message.hasOwnProperty("parent"))
|
14712 | object.parent = message.parent;
|
14713 | if (message.schema != null && message.hasOwnProperty("schema"))
|
14714 | object.schema = $root.google.pubsub.v1.Schema.toObject(message.schema, options);
|
14715 | return object;
|
14716 | };
|
14717 |
|
14718 | /**
|
14719 | * Converts this ValidateSchemaRequest to JSON.
|
14720 | * @function toJSON
|
14721 | * @memberof google.pubsub.v1.ValidateSchemaRequest
|
14722 | * @instance
|
14723 | * @returns {Object.<string,*>} JSON object
|
14724 | */
|
14725 | ValidateSchemaRequest.prototype.toJSON = function toJSON() {
|
14726 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
14727 | };
|
14728 |
|
14729 | return ValidateSchemaRequest;
|
14730 | })();
|
14731 |
|
14732 | v1.ValidateSchemaResponse = (function() {
|
14733 |
|
14734 | /**
|
14735 | * Properties of a ValidateSchemaResponse.
|
14736 | * @memberof google.pubsub.v1
|
14737 | * @interface IValidateSchemaResponse
|
14738 | */
|
14739 |
|
14740 | /**
|
14741 | * Constructs a new ValidateSchemaResponse.
|
14742 | * @memberof google.pubsub.v1
|
14743 | * @classdesc Represents a ValidateSchemaResponse.
|
14744 | * @implements IValidateSchemaResponse
|
14745 | * @constructor
|
14746 | * @param {google.pubsub.v1.IValidateSchemaResponse=} [properties] Properties to set
|
14747 | */
|
14748 | function ValidateSchemaResponse(properties) {
|
14749 | if (properties)
|
14750 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
14751 | if (properties[keys[i]] != null)
|
14752 | this[keys[i]] = properties[keys[i]];
|
14753 | }
|
14754 |
|
14755 | /**
|
14756 | * Creates a new ValidateSchemaResponse instance using the specified properties.
|
14757 | * @function create
|
14758 | * @memberof google.pubsub.v1.ValidateSchemaResponse
|
14759 | * @static
|
14760 | * @param {google.pubsub.v1.IValidateSchemaResponse=} [properties] Properties to set
|
14761 | * @returns {google.pubsub.v1.ValidateSchemaResponse} ValidateSchemaResponse instance
|
14762 | */
|
14763 | ValidateSchemaResponse.create = function create(properties) {
|
14764 | return new ValidateSchemaResponse(properties);
|
14765 | };
|
14766 |
|
14767 | /**
|
14768 | * Encodes the specified ValidateSchemaResponse message. Does not implicitly {@link google.pubsub.v1.ValidateSchemaResponse.verify|verify} messages.
|
14769 | * @function encode
|
14770 | * @memberof google.pubsub.v1.ValidateSchemaResponse
|
14771 | * @static
|
14772 | * @param {google.pubsub.v1.IValidateSchemaResponse} message ValidateSchemaResponse message or plain object to encode
|
14773 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
14774 | * @returns {$protobuf.Writer} Writer
|
14775 | */
|
14776 | ValidateSchemaResponse.encode = function encode(message, writer) {
|
14777 | if (!writer)
|
14778 | writer = $Writer.create();
|
14779 | return writer;
|
14780 | };
|
14781 |
|
14782 | /**
|
14783 | * Encodes the specified ValidateSchemaResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ValidateSchemaResponse.verify|verify} messages.
|
14784 | * @function encodeDelimited
|
14785 | * @memberof google.pubsub.v1.ValidateSchemaResponse
|
14786 | * @static
|
14787 | * @param {google.pubsub.v1.IValidateSchemaResponse} message ValidateSchemaResponse message or plain object to encode
|
14788 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
14789 | * @returns {$protobuf.Writer} Writer
|
14790 | */
|
14791 | ValidateSchemaResponse.encodeDelimited = function encodeDelimited(message, writer) {
|
14792 | return this.encode(message, writer).ldelim();
|
14793 | };
|
14794 |
|
14795 | /**
|
14796 | * Decodes a ValidateSchemaResponse message from the specified reader or buffer.
|
14797 | * @function decode
|
14798 | * @memberof google.pubsub.v1.ValidateSchemaResponse
|
14799 | * @static
|
14800 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
14801 | * @param {number} [length] Message length if known beforehand
|
14802 | * @returns {google.pubsub.v1.ValidateSchemaResponse} ValidateSchemaResponse
|
14803 | * @throws {Error} If the payload is not a reader or valid buffer
|
14804 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
14805 | */
|
14806 | ValidateSchemaResponse.decode = function decode(reader, length) {
|
14807 | if (!(reader instanceof $Reader))
|
14808 | reader = $Reader.create(reader);
|
14809 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.ValidateSchemaResponse();
|
14810 | while (reader.pos < end) {
|
14811 | var tag = reader.uint32();
|
14812 | switch (tag >>> 3) {
|
14813 | default:
|
14814 | reader.skipType(tag & 7);
|
14815 | break;
|
14816 | }
|
14817 | }
|
14818 | return message;
|
14819 | };
|
14820 |
|
14821 | /**
|
14822 | * Decodes a ValidateSchemaResponse message from the specified reader or buffer, length delimited.
|
14823 | * @function decodeDelimited
|
14824 | * @memberof google.pubsub.v1.ValidateSchemaResponse
|
14825 | * @static
|
14826 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
14827 | * @returns {google.pubsub.v1.ValidateSchemaResponse} ValidateSchemaResponse
|
14828 | * @throws {Error} If the payload is not a reader or valid buffer
|
14829 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
14830 | */
|
14831 | ValidateSchemaResponse.decodeDelimited = function decodeDelimited(reader) {
|
14832 | if (!(reader instanceof $Reader))
|
14833 | reader = new $Reader(reader);
|
14834 | return this.decode(reader, reader.uint32());
|
14835 | };
|
14836 |
|
14837 | /**
|
14838 | * Verifies a ValidateSchemaResponse message.
|
14839 | * @function verify
|
14840 | * @memberof google.pubsub.v1.ValidateSchemaResponse
|
14841 | * @static
|
14842 | * @param {Object.<string,*>} message Plain object to verify
|
14843 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
14844 | */
|
14845 | ValidateSchemaResponse.verify = function verify(message) {
|
14846 | if (typeof message !== "object" || message === null)
|
14847 | return "object expected";
|
14848 | return null;
|
14849 | };
|
14850 |
|
14851 | /**
|
14852 | * Creates a ValidateSchemaResponse message from a plain object. Also converts values to their respective internal types.
|
14853 | * @function fromObject
|
14854 | * @memberof google.pubsub.v1.ValidateSchemaResponse
|
14855 | * @static
|
14856 | * @param {Object.<string,*>} object Plain object
|
14857 | * @returns {google.pubsub.v1.ValidateSchemaResponse} ValidateSchemaResponse
|
14858 | */
|
14859 | ValidateSchemaResponse.fromObject = function fromObject(object) {
|
14860 | if (object instanceof $root.google.pubsub.v1.ValidateSchemaResponse)
|
14861 | return object;
|
14862 | return new $root.google.pubsub.v1.ValidateSchemaResponse();
|
14863 | };
|
14864 |
|
14865 | /**
|
14866 | * Creates a plain object from a ValidateSchemaResponse message. Also converts values to other types if specified.
|
14867 | * @function toObject
|
14868 | * @memberof google.pubsub.v1.ValidateSchemaResponse
|
14869 | * @static
|
14870 | * @param {google.pubsub.v1.ValidateSchemaResponse} message ValidateSchemaResponse
|
14871 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
14872 | * @returns {Object.<string,*>} Plain object
|
14873 | */
|
14874 | ValidateSchemaResponse.toObject = function toObject() {
|
14875 | return {};
|
14876 | };
|
14877 |
|
14878 | /**
|
14879 | * Converts this ValidateSchemaResponse to JSON.
|
14880 | * @function toJSON
|
14881 | * @memberof google.pubsub.v1.ValidateSchemaResponse
|
14882 | * @instance
|
14883 | * @returns {Object.<string,*>} JSON object
|
14884 | */
|
14885 | ValidateSchemaResponse.prototype.toJSON = function toJSON() {
|
14886 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
14887 | };
|
14888 |
|
14889 | return ValidateSchemaResponse;
|
14890 | })();
|
14891 |
|
14892 | v1.ValidateMessageRequest = (function() {
|
14893 |
|
14894 | /**
|
14895 | * Properties of a ValidateMessageRequest.
|
14896 | * @memberof google.pubsub.v1
|
14897 | * @interface IValidateMessageRequest
|
14898 | * @property {string|null} [parent] ValidateMessageRequest parent
|
14899 | * @property {string|null} [name] ValidateMessageRequest name
|
14900 | * @property {google.pubsub.v1.ISchema|null} [schema] ValidateMessageRequest schema
|
14901 | * @property {Uint8Array|null} [message] ValidateMessageRequest message
|
14902 | * @property {google.pubsub.v1.Encoding|null} [encoding] ValidateMessageRequest encoding
|
14903 | */
|
14904 |
|
14905 | /**
|
14906 | * Constructs a new ValidateMessageRequest.
|
14907 | * @memberof google.pubsub.v1
|
14908 | * @classdesc Represents a ValidateMessageRequest.
|
14909 | * @implements IValidateMessageRequest
|
14910 | * @constructor
|
14911 | * @param {google.pubsub.v1.IValidateMessageRequest=} [properties] Properties to set
|
14912 | */
|
14913 | function ValidateMessageRequest(properties) {
|
14914 | if (properties)
|
14915 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
14916 | if (properties[keys[i]] != null)
|
14917 | this[keys[i]] = properties[keys[i]];
|
14918 | }
|
14919 |
|
14920 | /**
|
14921 | * ValidateMessageRequest parent.
|
14922 | * @member {string} parent
|
14923 | * @memberof google.pubsub.v1.ValidateMessageRequest
|
14924 | * @instance
|
14925 | */
|
14926 | ValidateMessageRequest.prototype.parent = "";
|
14927 |
|
14928 | /**
|
14929 | * ValidateMessageRequest name.
|
14930 | * @member {string|null|undefined} name
|
14931 | * @memberof google.pubsub.v1.ValidateMessageRequest
|
14932 | * @instance
|
14933 | */
|
14934 | ValidateMessageRequest.prototype.name = null;
|
14935 |
|
14936 | /**
|
14937 | * ValidateMessageRequest schema.
|
14938 | * @member {google.pubsub.v1.ISchema|null|undefined} schema
|
14939 | * @memberof google.pubsub.v1.ValidateMessageRequest
|
14940 | * @instance
|
14941 | */
|
14942 | ValidateMessageRequest.prototype.schema = null;
|
14943 |
|
14944 | /**
|
14945 | * ValidateMessageRequest message.
|
14946 | * @member {Uint8Array} message
|
14947 | * @memberof google.pubsub.v1.ValidateMessageRequest
|
14948 | * @instance
|
14949 | */
|
14950 | ValidateMessageRequest.prototype.message = $util.newBuffer([]);
|
14951 |
|
14952 | /**
|
14953 | * ValidateMessageRequest encoding.
|
14954 | * @member {google.pubsub.v1.Encoding} encoding
|
14955 | * @memberof google.pubsub.v1.ValidateMessageRequest
|
14956 | * @instance
|
14957 | */
|
14958 | ValidateMessageRequest.prototype.encoding = 0;
|
14959 |
|
14960 | // OneOf field names bound to virtual getters and setters
|
14961 | var $oneOfFields;
|
14962 |
|
14963 | /**
|
14964 | * ValidateMessageRequest schemaSpec.
|
14965 | * @member {"name"|"schema"|undefined} schemaSpec
|
14966 | * @memberof google.pubsub.v1.ValidateMessageRequest
|
14967 | * @instance
|
14968 | */
|
14969 | Object.defineProperty(ValidateMessageRequest.prototype, "schemaSpec", {
|
14970 | get: $util.oneOfGetter($oneOfFields = ["name", "schema"]),
|
14971 | set: $util.oneOfSetter($oneOfFields)
|
14972 | });
|
14973 |
|
14974 | /**
|
14975 | * Creates a new ValidateMessageRequest instance using the specified properties.
|
14976 | * @function create
|
14977 | * @memberof google.pubsub.v1.ValidateMessageRequest
|
14978 | * @static
|
14979 | * @param {google.pubsub.v1.IValidateMessageRequest=} [properties] Properties to set
|
14980 | * @returns {google.pubsub.v1.ValidateMessageRequest} ValidateMessageRequest instance
|
14981 | */
|
14982 | ValidateMessageRequest.create = function create(properties) {
|
14983 | return new ValidateMessageRequest(properties);
|
14984 | };
|
14985 |
|
14986 | /**
|
14987 | * Encodes the specified ValidateMessageRequest message. Does not implicitly {@link google.pubsub.v1.ValidateMessageRequest.verify|verify} messages.
|
14988 | * @function encode
|
14989 | * @memberof google.pubsub.v1.ValidateMessageRequest
|
14990 | * @static
|
14991 | * @param {google.pubsub.v1.IValidateMessageRequest} message ValidateMessageRequest message or plain object to encode
|
14992 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
14993 | * @returns {$protobuf.Writer} Writer
|
14994 | */
|
14995 | ValidateMessageRequest.encode = function encode(message, writer) {
|
14996 | if (!writer)
|
14997 | writer = $Writer.create();
|
14998 | if (message.parent != null && Object.hasOwnProperty.call(message, "parent"))
|
14999 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent);
|
15000 | if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
15001 | writer.uint32(/* id 2, wireType 2 =*/18).string(message.name);
|
15002 | if (message.schema != null && Object.hasOwnProperty.call(message, "schema"))
|
15003 | $root.google.pubsub.v1.Schema.encode(message.schema, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
|
15004 | if (message.message != null && Object.hasOwnProperty.call(message, "message"))
|
15005 | writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.message);
|
15006 | if (message.encoding != null && Object.hasOwnProperty.call(message, "encoding"))
|
15007 | writer.uint32(/* id 5, wireType 0 =*/40).int32(message.encoding);
|
15008 | return writer;
|
15009 | };
|
15010 |
|
15011 | /**
|
15012 | * Encodes the specified ValidateMessageRequest message, length delimited. Does not implicitly {@link google.pubsub.v1.ValidateMessageRequest.verify|verify} messages.
|
15013 | * @function encodeDelimited
|
15014 | * @memberof google.pubsub.v1.ValidateMessageRequest
|
15015 | * @static
|
15016 | * @param {google.pubsub.v1.IValidateMessageRequest} message ValidateMessageRequest message or plain object to encode
|
15017 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
15018 | * @returns {$protobuf.Writer} Writer
|
15019 | */
|
15020 | ValidateMessageRequest.encodeDelimited = function encodeDelimited(message, writer) {
|
15021 | return this.encode(message, writer).ldelim();
|
15022 | };
|
15023 |
|
15024 | /**
|
15025 | * Decodes a ValidateMessageRequest message from the specified reader or buffer.
|
15026 | * @function decode
|
15027 | * @memberof google.pubsub.v1.ValidateMessageRequest
|
15028 | * @static
|
15029 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
15030 | * @param {number} [length] Message length if known beforehand
|
15031 | * @returns {google.pubsub.v1.ValidateMessageRequest} ValidateMessageRequest
|
15032 | * @throws {Error} If the payload is not a reader or valid buffer
|
15033 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
15034 | */
|
15035 | ValidateMessageRequest.decode = function decode(reader, length) {
|
15036 | if (!(reader instanceof $Reader))
|
15037 | reader = $Reader.create(reader);
|
15038 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.ValidateMessageRequest();
|
15039 | while (reader.pos < end) {
|
15040 | var tag = reader.uint32();
|
15041 | switch (tag >>> 3) {
|
15042 | case 1:
|
15043 | message.parent = reader.string();
|
15044 | break;
|
15045 | case 2:
|
15046 | message.name = reader.string();
|
15047 | break;
|
15048 | case 3:
|
15049 | message.schema = $root.google.pubsub.v1.Schema.decode(reader, reader.uint32());
|
15050 | break;
|
15051 | case 4:
|
15052 | message.message = reader.bytes();
|
15053 | break;
|
15054 | case 5:
|
15055 | message.encoding = reader.int32();
|
15056 | break;
|
15057 | default:
|
15058 | reader.skipType(tag & 7);
|
15059 | break;
|
15060 | }
|
15061 | }
|
15062 | return message;
|
15063 | };
|
15064 |
|
15065 | /**
|
15066 | * Decodes a ValidateMessageRequest message from the specified reader or buffer, length delimited.
|
15067 | * @function decodeDelimited
|
15068 | * @memberof google.pubsub.v1.ValidateMessageRequest
|
15069 | * @static
|
15070 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
15071 | * @returns {google.pubsub.v1.ValidateMessageRequest} ValidateMessageRequest
|
15072 | * @throws {Error} If the payload is not a reader or valid buffer
|
15073 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
15074 | */
|
15075 | ValidateMessageRequest.decodeDelimited = function decodeDelimited(reader) {
|
15076 | if (!(reader instanceof $Reader))
|
15077 | reader = new $Reader(reader);
|
15078 | return this.decode(reader, reader.uint32());
|
15079 | };
|
15080 |
|
15081 | /**
|
15082 | * Verifies a ValidateMessageRequest message.
|
15083 | * @function verify
|
15084 | * @memberof google.pubsub.v1.ValidateMessageRequest
|
15085 | * @static
|
15086 | * @param {Object.<string,*>} message Plain object to verify
|
15087 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
15088 | */
|
15089 | ValidateMessageRequest.verify = function verify(message) {
|
15090 | if (typeof message !== "object" || message === null)
|
15091 | return "object expected";
|
15092 | var properties = {};
|
15093 | if (message.parent != null && message.hasOwnProperty("parent"))
|
15094 | if (!$util.isString(message.parent))
|
15095 | return "parent: string expected";
|
15096 | if (message.name != null && message.hasOwnProperty("name")) {
|
15097 | properties.schemaSpec = 1;
|
15098 | if (!$util.isString(message.name))
|
15099 | return "name: string expected";
|
15100 | }
|
15101 | if (message.schema != null && message.hasOwnProperty("schema")) {
|
15102 | if (properties.schemaSpec === 1)
|
15103 | return "schemaSpec: multiple values";
|
15104 | properties.schemaSpec = 1;
|
15105 | {
|
15106 | var error = $root.google.pubsub.v1.Schema.verify(message.schema);
|
15107 | if (error)
|
15108 | return "schema." + error;
|
15109 | }
|
15110 | }
|
15111 | if (message.message != null && message.hasOwnProperty("message"))
|
15112 | if (!(message.message && typeof message.message.length === "number" || $util.isString(message.message)))
|
15113 | return "message: buffer expected";
|
15114 | if (message.encoding != null && message.hasOwnProperty("encoding"))
|
15115 | switch (message.encoding) {
|
15116 | default:
|
15117 | return "encoding: enum value expected";
|
15118 | case 0:
|
15119 | case 1:
|
15120 | case 2:
|
15121 | break;
|
15122 | }
|
15123 | return null;
|
15124 | };
|
15125 |
|
15126 | /**
|
15127 | * Creates a ValidateMessageRequest message from a plain object. Also converts values to their respective internal types.
|
15128 | * @function fromObject
|
15129 | * @memberof google.pubsub.v1.ValidateMessageRequest
|
15130 | * @static
|
15131 | * @param {Object.<string,*>} object Plain object
|
15132 | * @returns {google.pubsub.v1.ValidateMessageRequest} ValidateMessageRequest
|
15133 | */
|
15134 | ValidateMessageRequest.fromObject = function fromObject(object) {
|
15135 | if (object instanceof $root.google.pubsub.v1.ValidateMessageRequest)
|
15136 | return object;
|
15137 | var message = new $root.google.pubsub.v1.ValidateMessageRequest();
|
15138 | if (object.parent != null)
|
15139 | message.parent = String(object.parent);
|
15140 | if (object.name != null)
|
15141 | message.name = String(object.name);
|
15142 | if (object.schema != null) {
|
15143 | if (typeof object.schema !== "object")
|
15144 | throw TypeError(".google.pubsub.v1.ValidateMessageRequest.schema: object expected");
|
15145 | message.schema = $root.google.pubsub.v1.Schema.fromObject(object.schema);
|
15146 | }
|
15147 | if (object.message != null)
|
15148 | if (typeof object.message === "string")
|
15149 | $util.base64.decode(object.message, message.message = $util.newBuffer($util.base64.length(object.message)), 0);
|
15150 | else if (object.message.length)
|
15151 | message.message = object.message;
|
15152 | switch (object.encoding) {
|
15153 | case "ENCODING_UNSPECIFIED":
|
15154 | case 0:
|
15155 | message.encoding = 0;
|
15156 | break;
|
15157 | case "JSON":
|
15158 | case 1:
|
15159 | message.encoding = 1;
|
15160 | break;
|
15161 | case "BINARY":
|
15162 | case 2:
|
15163 | message.encoding = 2;
|
15164 | break;
|
15165 | }
|
15166 | return message;
|
15167 | };
|
15168 |
|
15169 | /**
|
15170 | * Creates a plain object from a ValidateMessageRequest message. Also converts values to other types if specified.
|
15171 | * @function toObject
|
15172 | * @memberof google.pubsub.v1.ValidateMessageRequest
|
15173 | * @static
|
15174 | * @param {google.pubsub.v1.ValidateMessageRequest} message ValidateMessageRequest
|
15175 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
15176 | * @returns {Object.<string,*>} Plain object
|
15177 | */
|
15178 | ValidateMessageRequest.toObject = function toObject(message, options) {
|
15179 | if (!options)
|
15180 | options = {};
|
15181 | var object = {};
|
15182 | if (options.defaults) {
|
15183 | object.parent = "";
|
15184 | if (options.bytes === String)
|
15185 | object.message = "";
|
15186 | else {
|
15187 | object.message = [];
|
15188 | if (options.bytes !== Array)
|
15189 | object.message = $util.newBuffer(object.message);
|
15190 | }
|
15191 | object.encoding = options.enums === String ? "ENCODING_UNSPECIFIED" : 0;
|
15192 | }
|
15193 | if (message.parent != null && message.hasOwnProperty("parent"))
|
15194 | object.parent = message.parent;
|
15195 | if (message.name != null && message.hasOwnProperty("name")) {
|
15196 | object.name = message.name;
|
15197 | if (options.oneofs)
|
15198 | object.schemaSpec = "name";
|
15199 | }
|
15200 | if (message.schema != null && message.hasOwnProperty("schema")) {
|
15201 | object.schema = $root.google.pubsub.v1.Schema.toObject(message.schema, options);
|
15202 | if (options.oneofs)
|
15203 | object.schemaSpec = "schema";
|
15204 | }
|
15205 | if (message.message != null && message.hasOwnProperty("message"))
|
15206 | object.message = options.bytes === String ? $util.base64.encode(message.message, 0, message.message.length) : options.bytes === Array ? Array.prototype.slice.call(message.message) : message.message;
|
15207 | if (message.encoding != null && message.hasOwnProperty("encoding"))
|
15208 | object.encoding = options.enums === String ? $root.google.pubsub.v1.Encoding[message.encoding] : message.encoding;
|
15209 | return object;
|
15210 | };
|
15211 |
|
15212 | /**
|
15213 | * Converts this ValidateMessageRequest to JSON.
|
15214 | * @function toJSON
|
15215 | * @memberof google.pubsub.v1.ValidateMessageRequest
|
15216 | * @instance
|
15217 | * @returns {Object.<string,*>} JSON object
|
15218 | */
|
15219 | ValidateMessageRequest.prototype.toJSON = function toJSON() {
|
15220 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
15221 | };
|
15222 |
|
15223 | return ValidateMessageRequest;
|
15224 | })();
|
15225 |
|
15226 | v1.ValidateMessageResponse = (function() {
|
15227 |
|
15228 | /**
|
15229 | * Properties of a ValidateMessageResponse.
|
15230 | * @memberof google.pubsub.v1
|
15231 | * @interface IValidateMessageResponse
|
15232 | */
|
15233 |
|
15234 | /**
|
15235 | * Constructs a new ValidateMessageResponse.
|
15236 | * @memberof google.pubsub.v1
|
15237 | * @classdesc Represents a ValidateMessageResponse.
|
15238 | * @implements IValidateMessageResponse
|
15239 | * @constructor
|
15240 | * @param {google.pubsub.v1.IValidateMessageResponse=} [properties] Properties to set
|
15241 | */
|
15242 | function ValidateMessageResponse(properties) {
|
15243 | if (properties)
|
15244 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
15245 | if (properties[keys[i]] != null)
|
15246 | this[keys[i]] = properties[keys[i]];
|
15247 | }
|
15248 |
|
15249 | /**
|
15250 | * Creates a new ValidateMessageResponse instance using the specified properties.
|
15251 | * @function create
|
15252 | * @memberof google.pubsub.v1.ValidateMessageResponse
|
15253 | * @static
|
15254 | * @param {google.pubsub.v1.IValidateMessageResponse=} [properties] Properties to set
|
15255 | * @returns {google.pubsub.v1.ValidateMessageResponse} ValidateMessageResponse instance
|
15256 | */
|
15257 | ValidateMessageResponse.create = function create(properties) {
|
15258 | return new ValidateMessageResponse(properties);
|
15259 | };
|
15260 |
|
15261 | /**
|
15262 | * Encodes the specified ValidateMessageResponse message. Does not implicitly {@link google.pubsub.v1.ValidateMessageResponse.verify|verify} messages.
|
15263 | * @function encode
|
15264 | * @memberof google.pubsub.v1.ValidateMessageResponse
|
15265 | * @static
|
15266 | * @param {google.pubsub.v1.IValidateMessageResponse} message ValidateMessageResponse message or plain object to encode
|
15267 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
15268 | * @returns {$protobuf.Writer} Writer
|
15269 | */
|
15270 | ValidateMessageResponse.encode = function encode(message, writer) {
|
15271 | if (!writer)
|
15272 | writer = $Writer.create();
|
15273 | return writer;
|
15274 | };
|
15275 |
|
15276 | /**
|
15277 | * Encodes the specified ValidateMessageResponse message, length delimited. Does not implicitly {@link google.pubsub.v1.ValidateMessageResponse.verify|verify} messages.
|
15278 | * @function encodeDelimited
|
15279 | * @memberof google.pubsub.v1.ValidateMessageResponse
|
15280 | * @static
|
15281 | * @param {google.pubsub.v1.IValidateMessageResponse} message ValidateMessageResponse message or plain object to encode
|
15282 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
15283 | * @returns {$protobuf.Writer} Writer
|
15284 | */
|
15285 | ValidateMessageResponse.encodeDelimited = function encodeDelimited(message, writer) {
|
15286 | return this.encode(message, writer).ldelim();
|
15287 | };
|
15288 |
|
15289 | /**
|
15290 | * Decodes a ValidateMessageResponse message from the specified reader or buffer.
|
15291 | * @function decode
|
15292 | * @memberof google.pubsub.v1.ValidateMessageResponse
|
15293 | * @static
|
15294 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
15295 | * @param {number} [length] Message length if known beforehand
|
15296 | * @returns {google.pubsub.v1.ValidateMessageResponse} ValidateMessageResponse
|
15297 | * @throws {Error} If the payload is not a reader or valid buffer
|
15298 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
15299 | */
|
15300 | ValidateMessageResponse.decode = function decode(reader, length) {
|
15301 | if (!(reader instanceof $Reader))
|
15302 | reader = $Reader.create(reader);
|
15303 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.pubsub.v1.ValidateMessageResponse();
|
15304 | while (reader.pos < end) {
|
15305 | var tag = reader.uint32();
|
15306 | switch (tag >>> 3) {
|
15307 | default:
|
15308 | reader.skipType(tag & 7);
|
15309 | break;
|
15310 | }
|
15311 | }
|
15312 | return message;
|
15313 | };
|
15314 |
|
15315 | /**
|
15316 | * Decodes a ValidateMessageResponse message from the specified reader or buffer, length delimited.
|
15317 | * @function decodeDelimited
|
15318 | * @memberof google.pubsub.v1.ValidateMessageResponse
|
15319 | * @static
|
15320 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
15321 | * @returns {google.pubsub.v1.ValidateMessageResponse} ValidateMessageResponse
|
15322 | * @throws {Error} If the payload is not a reader or valid buffer
|
15323 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
15324 | */
|
15325 | ValidateMessageResponse.decodeDelimited = function decodeDelimited(reader) {
|
15326 | if (!(reader instanceof $Reader))
|
15327 | reader = new $Reader(reader);
|
15328 | return this.decode(reader, reader.uint32());
|
15329 | };
|
15330 |
|
15331 | /**
|
15332 | * Verifies a ValidateMessageResponse message.
|
15333 | * @function verify
|
15334 | * @memberof google.pubsub.v1.ValidateMessageResponse
|
15335 | * @static
|
15336 | * @param {Object.<string,*>} message Plain object to verify
|
15337 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
15338 | */
|
15339 | ValidateMessageResponse.verify = function verify(message) {
|
15340 | if (typeof message !== "object" || message === null)
|
15341 | return "object expected";
|
15342 | return null;
|
15343 | };
|
15344 |
|
15345 | /**
|
15346 | * Creates a ValidateMessageResponse message from a plain object. Also converts values to their respective internal types.
|
15347 | * @function fromObject
|
15348 | * @memberof google.pubsub.v1.ValidateMessageResponse
|
15349 | * @static
|
15350 | * @param {Object.<string,*>} object Plain object
|
15351 | * @returns {google.pubsub.v1.ValidateMessageResponse} ValidateMessageResponse
|
15352 | */
|
15353 | ValidateMessageResponse.fromObject = function fromObject(object) {
|
15354 | if (object instanceof $root.google.pubsub.v1.ValidateMessageResponse)
|
15355 | return object;
|
15356 | return new $root.google.pubsub.v1.ValidateMessageResponse();
|
15357 | };
|
15358 |
|
15359 | /**
|
15360 | * Creates a plain object from a ValidateMessageResponse message. Also converts values to other types if specified.
|
15361 | * @function toObject
|
15362 | * @memberof google.pubsub.v1.ValidateMessageResponse
|
15363 | * @static
|
15364 | * @param {google.pubsub.v1.ValidateMessageResponse} message ValidateMessageResponse
|
15365 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
15366 | * @returns {Object.<string,*>} Plain object
|
15367 | */
|
15368 | ValidateMessageResponse.toObject = function toObject() {
|
15369 | return {};
|
15370 | };
|
15371 |
|
15372 | /**
|
15373 | * Converts this ValidateMessageResponse to JSON.
|
15374 | * @function toJSON
|
15375 | * @memberof google.pubsub.v1.ValidateMessageResponse
|
15376 | * @instance
|
15377 | * @returns {Object.<string,*>} JSON object
|
15378 | */
|
15379 | ValidateMessageResponse.prototype.toJSON = function toJSON() {
|
15380 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
15381 | };
|
15382 |
|
15383 | return ValidateMessageResponse;
|
15384 | })();
|
15385 |
|
15386 | /**
|
15387 | * Encoding enum.
|
15388 | * @name google.pubsub.v1.Encoding
|
15389 | * @enum {number}
|
15390 | * @property {number} ENCODING_UNSPECIFIED=0 ENCODING_UNSPECIFIED value
|
15391 | * @property {number} JSON=1 JSON value
|
15392 | * @property {number} BINARY=2 BINARY value
|
15393 | */
|
15394 | v1.Encoding = (function() {
|
15395 | var valuesById = {}, values = Object.create(valuesById);
|
15396 | values[valuesById[0] = "ENCODING_UNSPECIFIED"] = 0;
|
15397 | values[valuesById[1] = "JSON"] = 1;
|
15398 | values[valuesById[2] = "BINARY"] = 2;
|
15399 | return values;
|
15400 | })();
|
15401 |
|
15402 | return v1;
|
15403 | })();
|
15404 |
|
15405 | return pubsub;
|
15406 | })();
|
15407 |
|
15408 | google.api = (function() {
|
15409 |
|
15410 | /**
|
15411 | * Namespace api.
|
15412 | * @memberof google
|
15413 | * @namespace
|
15414 | */
|
15415 | var api = {};
|
15416 |
|
15417 | api.Http = (function() {
|
15418 |
|
15419 | /**
|
15420 | * Properties of a Http.
|
15421 | * @memberof google.api
|
15422 | * @interface IHttp
|
15423 | * @property {Array.<google.api.IHttpRule>|null} [rules] Http rules
|
15424 | * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion
|
15425 | */
|
15426 |
|
15427 | /**
|
15428 | * Constructs a new Http.
|
15429 | * @memberof google.api
|
15430 | * @classdesc Represents a Http.
|
15431 | * @implements IHttp
|
15432 | * @constructor
|
15433 | * @param {google.api.IHttp=} [properties] Properties to set
|
15434 | */
|
15435 | function Http(properties) {
|
15436 | this.rules = [];
|
15437 | if (properties)
|
15438 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
15439 | if (properties[keys[i]] != null)
|
15440 | this[keys[i]] = properties[keys[i]];
|
15441 | }
|
15442 |
|
15443 | /**
|
15444 | * Http rules.
|
15445 | * @member {Array.<google.api.IHttpRule>} rules
|
15446 | * @memberof google.api.Http
|
15447 | * @instance
|
15448 | */
|
15449 | Http.prototype.rules = $util.emptyArray;
|
15450 |
|
15451 | /**
|
15452 | * Http fullyDecodeReservedExpansion.
|
15453 | * @member {boolean} fullyDecodeReservedExpansion
|
15454 | * @memberof google.api.Http
|
15455 | * @instance
|
15456 | */
|
15457 | Http.prototype.fullyDecodeReservedExpansion = false;
|
15458 |
|
15459 | /**
|
15460 | * Creates a new Http instance using the specified properties.
|
15461 | * @function create
|
15462 | * @memberof google.api.Http
|
15463 | * @static
|
15464 | * @param {google.api.IHttp=} [properties] Properties to set
|
15465 | * @returns {google.api.Http} Http instance
|
15466 | */
|
15467 | Http.create = function create(properties) {
|
15468 | return new Http(properties);
|
15469 | };
|
15470 |
|
15471 | /**
|
15472 | * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages.
|
15473 | * @function encode
|
15474 | * @memberof google.api.Http
|
15475 | * @static
|
15476 | * @param {google.api.IHttp} message Http message or plain object to encode
|
15477 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
15478 | * @returns {$protobuf.Writer} Writer
|
15479 | */
|
15480 | Http.encode = function encode(message, writer) {
|
15481 | if (!writer)
|
15482 | writer = $Writer.create();
|
15483 | if (message.rules != null && message.rules.length)
|
15484 | for (var i = 0; i < message.rules.length; ++i)
|
15485 | $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
15486 | if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion"))
|
15487 | writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion);
|
15488 | return writer;
|
15489 | };
|
15490 |
|
15491 | /**
|
15492 | * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages.
|
15493 | * @function encodeDelimited
|
15494 | * @memberof google.api.Http
|
15495 | * @static
|
15496 | * @param {google.api.IHttp} message Http message or plain object to encode
|
15497 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
15498 | * @returns {$protobuf.Writer} Writer
|
15499 | */
|
15500 | Http.encodeDelimited = function encodeDelimited(message, writer) {
|
15501 | return this.encode(message, writer).ldelim();
|
15502 | };
|
15503 |
|
15504 | /**
|
15505 | * Decodes a Http message from the specified reader or buffer.
|
15506 | * @function decode
|
15507 | * @memberof google.api.Http
|
15508 | * @static
|
15509 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
15510 | * @param {number} [length] Message length if known beforehand
|
15511 | * @returns {google.api.Http} Http
|
15512 | * @throws {Error} If the payload is not a reader or valid buffer
|
15513 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
15514 | */
|
15515 | Http.decode = function decode(reader, length) {
|
15516 | if (!(reader instanceof $Reader))
|
15517 | reader = $Reader.create(reader);
|
15518 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http();
|
15519 | while (reader.pos < end) {
|
15520 | var tag = reader.uint32();
|
15521 | switch (tag >>> 3) {
|
15522 | case 1:
|
15523 | if (!(message.rules && message.rules.length))
|
15524 | message.rules = [];
|
15525 | message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32()));
|
15526 | break;
|
15527 | case 2:
|
15528 | message.fullyDecodeReservedExpansion = reader.bool();
|
15529 | break;
|
15530 | default:
|
15531 | reader.skipType(tag & 7);
|
15532 | break;
|
15533 | }
|
15534 | }
|
15535 | return message;
|
15536 | };
|
15537 |
|
15538 | /**
|
15539 | * Decodes a Http message from the specified reader or buffer, length delimited.
|
15540 | * @function decodeDelimited
|
15541 | * @memberof google.api.Http
|
15542 | * @static
|
15543 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
15544 | * @returns {google.api.Http} Http
|
15545 | * @throws {Error} If the payload is not a reader or valid buffer
|
15546 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
15547 | */
|
15548 | Http.decodeDelimited = function decodeDelimited(reader) {
|
15549 | if (!(reader instanceof $Reader))
|
15550 | reader = new $Reader(reader);
|
15551 | return this.decode(reader, reader.uint32());
|
15552 | };
|
15553 |
|
15554 | /**
|
15555 | * Verifies a Http message.
|
15556 | * @function verify
|
15557 | * @memberof google.api.Http
|
15558 | * @static
|
15559 | * @param {Object.<string,*>} message Plain object to verify
|
15560 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
15561 | */
|
15562 | Http.verify = function verify(message) {
|
15563 | if (typeof message !== "object" || message === null)
|
15564 | return "object expected";
|
15565 | if (message.rules != null && message.hasOwnProperty("rules")) {
|
15566 | if (!Array.isArray(message.rules))
|
15567 | return "rules: array expected";
|
15568 | for (var i = 0; i < message.rules.length; ++i) {
|
15569 | var error = $root.google.api.HttpRule.verify(message.rules[i]);
|
15570 | if (error)
|
15571 | return "rules." + error;
|
15572 | }
|
15573 | }
|
15574 | if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion"))
|
15575 | if (typeof message.fullyDecodeReservedExpansion !== "boolean")
|
15576 | return "fullyDecodeReservedExpansion: boolean expected";
|
15577 | return null;
|
15578 | };
|
15579 |
|
15580 | /**
|
15581 | * Creates a Http message from a plain object. Also converts values to their respective internal types.
|
15582 | * @function fromObject
|
15583 | * @memberof google.api.Http
|
15584 | * @static
|
15585 | * @param {Object.<string,*>} object Plain object
|
15586 | * @returns {google.api.Http} Http
|
15587 | */
|
15588 | Http.fromObject = function fromObject(object) {
|
15589 | if (object instanceof $root.google.api.Http)
|
15590 | return object;
|
15591 | var message = new $root.google.api.Http();
|
15592 | if (object.rules) {
|
15593 | if (!Array.isArray(object.rules))
|
15594 | throw TypeError(".google.api.Http.rules: array expected");
|
15595 | message.rules = [];
|
15596 | for (var i = 0; i < object.rules.length; ++i) {
|
15597 | if (typeof object.rules[i] !== "object")
|
15598 | throw TypeError(".google.api.Http.rules: object expected");
|
15599 | message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]);
|
15600 | }
|
15601 | }
|
15602 | if (object.fullyDecodeReservedExpansion != null)
|
15603 | message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion);
|
15604 | return message;
|
15605 | };
|
15606 |
|
15607 | /**
|
15608 | * Creates a plain object from a Http message. Also converts values to other types if specified.
|
15609 | * @function toObject
|
15610 | * @memberof google.api.Http
|
15611 | * @static
|
15612 | * @param {google.api.Http} message Http
|
15613 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
15614 | * @returns {Object.<string,*>} Plain object
|
15615 | */
|
15616 | Http.toObject = function toObject(message, options) {
|
15617 | if (!options)
|
15618 | options = {};
|
15619 | var object = {};
|
15620 | if (options.arrays || options.defaults)
|
15621 | object.rules = [];
|
15622 | if (options.defaults)
|
15623 | object.fullyDecodeReservedExpansion = false;
|
15624 | if (message.rules && message.rules.length) {
|
15625 | object.rules = [];
|
15626 | for (var j = 0; j < message.rules.length; ++j)
|
15627 | object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options);
|
15628 | }
|
15629 | if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion"))
|
15630 | object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion;
|
15631 | return object;
|
15632 | };
|
15633 |
|
15634 | /**
|
15635 | * Converts this Http to JSON.
|
15636 | * @function toJSON
|
15637 | * @memberof google.api.Http
|
15638 | * @instance
|
15639 | * @returns {Object.<string,*>} JSON object
|
15640 | */
|
15641 | Http.prototype.toJSON = function toJSON() {
|
15642 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
15643 | };
|
15644 |
|
15645 | return Http;
|
15646 | })();
|
15647 |
|
15648 | api.HttpRule = (function() {
|
15649 |
|
15650 | /**
|
15651 | * Properties of a HttpRule.
|
15652 | * @memberof google.api
|
15653 | * @interface IHttpRule
|
15654 | * @property {string|null} [selector] HttpRule selector
|
15655 | * @property {string|null} [get] HttpRule get
|
15656 | * @property {string|null} [put] HttpRule put
|
15657 | * @property {string|null} [post] HttpRule post
|
15658 | * @property {string|null} ["delete"] HttpRule delete
|
15659 | * @property {string|null} [patch] HttpRule patch
|
15660 | * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom
|
15661 | * @property {string|null} [body] HttpRule body
|
15662 | * @property {string|null} [responseBody] HttpRule responseBody
|
15663 | * @property {Array.<google.api.IHttpRule>|null} [additionalBindings] HttpRule additionalBindings
|
15664 | */
|
15665 |
|
15666 | /**
|
15667 | * Constructs a new HttpRule.
|
15668 | * @memberof google.api
|
15669 | * @classdesc Represents a HttpRule.
|
15670 | * @implements IHttpRule
|
15671 | * @constructor
|
15672 | * @param {google.api.IHttpRule=} [properties] Properties to set
|
15673 | */
|
15674 | function HttpRule(properties) {
|
15675 | this.additionalBindings = [];
|
15676 | if (properties)
|
15677 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
15678 | if (properties[keys[i]] != null)
|
15679 | this[keys[i]] = properties[keys[i]];
|
15680 | }
|
15681 |
|
15682 | /**
|
15683 | * HttpRule selector.
|
15684 | * @member {string} selector
|
15685 | * @memberof google.api.HttpRule
|
15686 | * @instance
|
15687 | */
|
15688 | HttpRule.prototype.selector = "";
|
15689 |
|
15690 | /**
|
15691 | * HttpRule get.
|
15692 | * @member {string|null|undefined} get
|
15693 | * @memberof google.api.HttpRule
|
15694 | * @instance
|
15695 | */
|
15696 | HttpRule.prototype.get = null;
|
15697 |
|
15698 | /**
|
15699 | * HttpRule put.
|
15700 | * @member {string|null|undefined} put
|
15701 | * @memberof google.api.HttpRule
|
15702 | * @instance
|
15703 | */
|
15704 | HttpRule.prototype.put = null;
|
15705 |
|
15706 | /**
|
15707 | * HttpRule post.
|
15708 | * @member {string|null|undefined} post
|
15709 | * @memberof google.api.HttpRule
|
15710 | * @instance
|
15711 | */
|
15712 | HttpRule.prototype.post = null;
|
15713 |
|
15714 | /**
|
15715 | * HttpRule delete.
|
15716 | * @member {string|null|undefined} delete
|
15717 | * @memberof google.api.HttpRule
|
15718 | * @instance
|
15719 | */
|
15720 | HttpRule.prototype["delete"] = null;
|
15721 |
|
15722 | /**
|
15723 | * HttpRule patch.
|
15724 | * @member {string|null|undefined} patch
|
15725 | * @memberof google.api.HttpRule
|
15726 | * @instance
|
15727 | */
|
15728 | HttpRule.prototype.patch = null;
|
15729 |
|
15730 | /**
|
15731 | * HttpRule custom.
|
15732 | * @member {google.api.ICustomHttpPattern|null|undefined} custom
|
15733 | * @memberof google.api.HttpRule
|
15734 | * @instance
|
15735 | */
|
15736 | HttpRule.prototype.custom = null;
|
15737 |
|
15738 | /**
|
15739 | * HttpRule body.
|
15740 | * @member {string} body
|
15741 | * @memberof google.api.HttpRule
|
15742 | * @instance
|
15743 | */
|
15744 | HttpRule.prototype.body = "";
|
15745 |
|
15746 | /**
|
15747 | * HttpRule responseBody.
|
15748 | * @member {string} responseBody
|
15749 | * @memberof google.api.HttpRule
|
15750 | * @instance
|
15751 | */
|
15752 | HttpRule.prototype.responseBody = "";
|
15753 |
|
15754 | /**
|
15755 | * HttpRule additionalBindings.
|
15756 | * @member {Array.<google.api.IHttpRule>} additionalBindings
|
15757 | * @memberof google.api.HttpRule
|
15758 | * @instance
|
15759 | */
|
15760 | HttpRule.prototype.additionalBindings = $util.emptyArray;
|
15761 |
|
15762 | // OneOf field names bound to virtual getters and setters
|
15763 | var $oneOfFields;
|
15764 |
|
15765 | /**
|
15766 | * HttpRule pattern.
|
15767 | * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern
|
15768 | * @memberof google.api.HttpRule
|
15769 | * @instance
|
15770 | */
|
15771 | Object.defineProperty(HttpRule.prototype, "pattern", {
|
15772 | get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]),
|
15773 | set: $util.oneOfSetter($oneOfFields)
|
15774 | });
|
15775 |
|
15776 | /**
|
15777 | * Creates a new HttpRule instance using the specified properties.
|
15778 | * @function create
|
15779 | * @memberof google.api.HttpRule
|
15780 | * @static
|
15781 | * @param {google.api.IHttpRule=} [properties] Properties to set
|
15782 | * @returns {google.api.HttpRule} HttpRule instance
|
15783 | */
|
15784 | HttpRule.create = function create(properties) {
|
15785 | return new HttpRule(properties);
|
15786 | };
|
15787 |
|
15788 | /**
|
15789 | * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages.
|
15790 | * @function encode
|
15791 | * @memberof google.api.HttpRule
|
15792 | * @static
|
15793 | * @param {google.api.IHttpRule} message HttpRule message or plain object to encode
|
15794 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
15795 | * @returns {$protobuf.Writer} Writer
|
15796 | */
|
15797 | HttpRule.encode = function encode(message, writer) {
|
15798 | if (!writer)
|
15799 | writer = $Writer.create();
|
15800 | if (message.selector != null && Object.hasOwnProperty.call(message, "selector"))
|
15801 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector);
|
15802 | if (message.get != null && Object.hasOwnProperty.call(message, "get"))
|
15803 | writer.uint32(/* id 2, wireType 2 =*/18).string(message.get);
|
15804 | if (message.put != null && Object.hasOwnProperty.call(message, "put"))
|
15805 | writer.uint32(/* id 3, wireType 2 =*/26).string(message.put);
|
15806 | if (message.post != null && Object.hasOwnProperty.call(message, "post"))
|
15807 | writer.uint32(/* id 4, wireType 2 =*/34).string(message.post);
|
15808 | if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete"))
|
15809 | writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]);
|
15810 | if (message.patch != null && Object.hasOwnProperty.call(message, "patch"))
|
15811 | writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch);
|
15812 | if (message.body != null && Object.hasOwnProperty.call(message, "body"))
|
15813 | writer.uint32(/* id 7, wireType 2 =*/58).string(message.body);
|
15814 | if (message.custom != null && Object.hasOwnProperty.call(message, "custom"))
|
15815 | $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();
|
15816 | if (message.additionalBindings != null && message.additionalBindings.length)
|
15817 | for (var i = 0; i < message.additionalBindings.length; ++i)
|
15818 | $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim();
|
15819 | if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody"))
|
15820 | writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody);
|
15821 | return writer;
|
15822 | };
|
15823 |
|
15824 | /**
|
15825 | * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages.
|
15826 | * @function encodeDelimited
|
15827 | * @memberof google.api.HttpRule
|
15828 | * @static
|
15829 | * @param {google.api.IHttpRule} message HttpRule message or plain object to encode
|
15830 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
15831 | * @returns {$protobuf.Writer} Writer
|
15832 | */
|
15833 | HttpRule.encodeDelimited = function encodeDelimited(message, writer) {
|
15834 | return this.encode(message, writer).ldelim();
|
15835 | };
|
15836 |
|
15837 | /**
|
15838 | * Decodes a HttpRule message from the specified reader or buffer.
|
15839 | * @function decode
|
15840 | * @memberof google.api.HttpRule
|
15841 | * @static
|
15842 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
15843 | * @param {number} [length] Message length if known beforehand
|
15844 | * @returns {google.api.HttpRule} HttpRule
|
15845 | * @throws {Error} If the payload is not a reader or valid buffer
|
15846 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
15847 | */
|
15848 | HttpRule.decode = function decode(reader, length) {
|
15849 | if (!(reader instanceof $Reader))
|
15850 | reader = $Reader.create(reader);
|
15851 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule();
|
15852 | while (reader.pos < end) {
|
15853 | var tag = reader.uint32();
|
15854 | switch (tag >>> 3) {
|
15855 | case 1:
|
15856 | message.selector = reader.string();
|
15857 | break;
|
15858 | case 2:
|
15859 | message.get = reader.string();
|
15860 | break;
|
15861 | case 3:
|
15862 | message.put = reader.string();
|
15863 | break;
|
15864 | case 4:
|
15865 | message.post = reader.string();
|
15866 | break;
|
15867 | case 5:
|
15868 | message["delete"] = reader.string();
|
15869 | break;
|
15870 | case 6:
|
15871 | message.patch = reader.string();
|
15872 | break;
|
15873 | case 8:
|
15874 | message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32());
|
15875 | break;
|
15876 | case 7:
|
15877 | message.body = reader.string();
|
15878 | break;
|
15879 | case 12:
|
15880 | message.responseBody = reader.string();
|
15881 | break;
|
15882 | case 11:
|
15883 | if (!(message.additionalBindings && message.additionalBindings.length))
|
15884 | message.additionalBindings = [];
|
15885 | message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32()));
|
15886 | break;
|
15887 | default:
|
15888 | reader.skipType(tag & 7);
|
15889 | break;
|
15890 | }
|
15891 | }
|
15892 | return message;
|
15893 | };
|
15894 |
|
15895 | /**
|
15896 | * Decodes a HttpRule message from the specified reader or buffer, length delimited.
|
15897 | * @function decodeDelimited
|
15898 | * @memberof google.api.HttpRule
|
15899 | * @static
|
15900 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
15901 | * @returns {google.api.HttpRule} HttpRule
|
15902 | * @throws {Error} If the payload is not a reader or valid buffer
|
15903 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
15904 | */
|
15905 | HttpRule.decodeDelimited = function decodeDelimited(reader) {
|
15906 | if (!(reader instanceof $Reader))
|
15907 | reader = new $Reader(reader);
|
15908 | return this.decode(reader, reader.uint32());
|
15909 | };
|
15910 |
|
15911 | /**
|
15912 | * Verifies a HttpRule message.
|
15913 | * @function verify
|
15914 | * @memberof google.api.HttpRule
|
15915 | * @static
|
15916 | * @param {Object.<string,*>} message Plain object to verify
|
15917 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
15918 | */
|
15919 | HttpRule.verify = function verify(message) {
|
15920 | if (typeof message !== "object" || message === null)
|
15921 | return "object expected";
|
15922 | var properties = {};
|
15923 | if (message.selector != null && message.hasOwnProperty("selector"))
|
15924 | if (!$util.isString(message.selector))
|
15925 | return "selector: string expected";
|
15926 | if (message.get != null && message.hasOwnProperty("get")) {
|
15927 | properties.pattern = 1;
|
15928 | if (!$util.isString(message.get))
|
15929 | return "get: string expected";
|
15930 | }
|
15931 | if (message.put != null && message.hasOwnProperty("put")) {
|
15932 | if (properties.pattern === 1)
|
15933 | return "pattern: multiple values";
|
15934 | properties.pattern = 1;
|
15935 | if (!$util.isString(message.put))
|
15936 | return "put: string expected";
|
15937 | }
|
15938 | if (message.post != null && message.hasOwnProperty("post")) {
|
15939 | if (properties.pattern === 1)
|
15940 | return "pattern: multiple values";
|
15941 | properties.pattern = 1;
|
15942 | if (!$util.isString(message.post))
|
15943 | return "post: string expected";
|
15944 | }
|
15945 | if (message["delete"] != null && message.hasOwnProperty("delete")) {
|
15946 | if (properties.pattern === 1)
|
15947 | return "pattern: multiple values";
|
15948 | properties.pattern = 1;
|
15949 | if (!$util.isString(message["delete"]))
|
15950 | return "delete: string expected";
|
15951 | }
|
15952 | if (message.patch != null && message.hasOwnProperty("patch")) {
|
15953 | if (properties.pattern === 1)
|
15954 | return "pattern: multiple values";
|
15955 | properties.pattern = 1;
|
15956 | if (!$util.isString(message.patch))
|
15957 | return "patch: string expected";
|
15958 | }
|
15959 | if (message.custom != null && message.hasOwnProperty("custom")) {
|
15960 | if (properties.pattern === 1)
|
15961 | return "pattern: multiple values";
|
15962 | properties.pattern = 1;
|
15963 | {
|
15964 | var error = $root.google.api.CustomHttpPattern.verify(message.custom);
|
15965 | if (error)
|
15966 | return "custom." + error;
|
15967 | }
|
15968 | }
|
15969 | if (message.body != null && message.hasOwnProperty("body"))
|
15970 | if (!$util.isString(message.body))
|
15971 | return "body: string expected";
|
15972 | if (message.responseBody != null && message.hasOwnProperty("responseBody"))
|
15973 | if (!$util.isString(message.responseBody))
|
15974 | return "responseBody: string expected";
|
15975 | if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) {
|
15976 | if (!Array.isArray(message.additionalBindings))
|
15977 | return "additionalBindings: array expected";
|
15978 | for (var i = 0; i < message.additionalBindings.length; ++i) {
|
15979 | var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]);
|
15980 | if (error)
|
15981 | return "additionalBindings." + error;
|
15982 | }
|
15983 | }
|
15984 | return null;
|
15985 | };
|
15986 |
|
15987 | /**
|
15988 | * Creates a HttpRule message from a plain object. Also converts values to their respective internal types.
|
15989 | * @function fromObject
|
15990 | * @memberof google.api.HttpRule
|
15991 | * @static
|
15992 | * @param {Object.<string,*>} object Plain object
|
15993 | * @returns {google.api.HttpRule} HttpRule
|
15994 | */
|
15995 | HttpRule.fromObject = function fromObject(object) {
|
15996 | if (object instanceof $root.google.api.HttpRule)
|
15997 | return object;
|
15998 | var message = new $root.google.api.HttpRule();
|
15999 | if (object.selector != null)
|
16000 | message.selector = String(object.selector);
|
16001 | if (object.get != null)
|
16002 | message.get = String(object.get);
|
16003 | if (object.put != null)
|
16004 | message.put = String(object.put);
|
16005 | if (object.post != null)
|
16006 | message.post = String(object.post);
|
16007 | if (object["delete"] != null)
|
16008 | message["delete"] = String(object["delete"]);
|
16009 | if (object.patch != null)
|
16010 | message.patch = String(object.patch);
|
16011 | if (object.custom != null) {
|
16012 | if (typeof object.custom !== "object")
|
16013 | throw TypeError(".google.api.HttpRule.custom: object expected");
|
16014 | message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom);
|
16015 | }
|
16016 | if (object.body != null)
|
16017 | message.body = String(object.body);
|
16018 | if (object.responseBody != null)
|
16019 | message.responseBody = String(object.responseBody);
|
16020 | if (object.additionalBindings) {
|
16021 | if (!Array.isArray(object.additionalBindings))
|
16022 | throw TypeError(".google.api.HttpRule.additionalBindings: array expected");
|
16023 | message.additionalBindings = [];
|
16024 | for (var i = 0; i < object.additionalBindings.length; ++i) {
|
16025 | if (typeof object.additionalBindings[i] !== "object")
|
16026 | throw TypeError(".google.api.HttpRule.additionalBindings: object expected");
|
16027 | message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]);
|
16028 | }
|
16029 | }
|
16030 | return message;
|
16031 | };
|
16032 |
|
16033 | /**
|
16034 | * Creates a plain object from a HttpRule message. Also converts values to other types if specified.
|
16035 | * @function toObject
|
16036 | * @memberof google.api.HttpRule
|
16037 | * @static
|
16038 | * @param {google.api.HttpRule} message HttpRule
|
16039 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
16040 | * @returns {Object.<string,*>} Plain object
|
16041 | */
|
16042 | HttpRule.toObject = function toObject(message, options) {
|
16043 | if (!options)
|
16044 | options = {};
|
16045 | var object = {};
|
16046 | if (options.arrays || options.defaults)
|
16047 | object.additionalBindings = [];
|
16048 | if (options.defaults) {
|
16049 | object.selector = "";
|
16050 | object.body = "";
|
16051 | object.responseBody = "";
|
16052 | }
|
16053 | if (message.selector != null && message.hasOwnProperty("selector"))
|
16054 | object.selector = message.selector;
|
16055 | if (message.get != null && message.hasOwnProperty("get")) {
|
16056 | object.get = message.get;
|
16057 | if (options.oneofs)
|
16058 | object.pattern = "get";
|
16059 | }
|
16060 | if (message.put != null && message.hasOwnProperty("put")) {
|
16061 | object.put = message.put;
|
16062 | if (options.oneofs)
|
16063 | object.pattern = "put";
|
16064 | }
|
16065 | if (message.post != null && message.hasOwnProperty("post")) {
|
16066 | object.post = message.post;
|
16067 | if (options.oneofs)
|
16068 | object.pattern = "post";
|
16069 | }
|
16070 | if (message["delete"] != null && message.hasOwnProperty("delete")) {
|
16071 | object["delete"] = message["delete"];
|
16072 | if (options.oneofs)
|
16073 | object.pattern = "delete";
|
16074 | }
|
16075 | if (message.patch != null && message.hasOwnProperty("patch")) {
|
16076 | object.patch = message.patch;
|
16077 | if (options.oneofs)
|
16078 | object.pattern = "patch";
|
16079 | }
|
16080 | if (message.body != null && message.hasOwnProperty("body"))
|
16081 | object.body = message.body;
|
16082 | if (message.custom != null && message.hasOwnProperty("custom")) {
|
16083 | object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options);
|
16084 | if (options.oneofs)
|
16085 | object.pattern = "custom";
|
16086 | }
|
16087 | if (message.additionalBindings && message.additionalBindings.length) {
|
16088 | object.additionalBindings = [];
|
16089 | for (var j = 0; j < message.additionalBindings.length; ++j)
|
16090 | object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options);
|
16091 | }
|
16092 | if (message.responseBody != null && message.hasOwnProperty("responseBody"))
|
16093 | object.responseBody = message.responseBody;
|
16094 | return object;
|
16095 | };
|
16096 |
|
16097 | /**
|
16098 | * Converts this HttpRule to JSON.
|
16099 | * @function toJSON
|
16100 | * @memberof google.api.HttpRule
|
16101 | * @instance
|
16102 | * @returns {Object.<string,*>} JSON object
|
16103 | */
|
16104 | HttpRule.prototype.toJSON = function toJSON() {
|
16105 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
16106 | };
|
16107 |
|
16108 | return HttpRule;
|
16109 | })();
|
16110 |
|
16111 | api.CustomHttpPattern = (function() {
|
16112 |
|
16113 | /**
|
16114 | * Properties of a CustomHttpPattern.
|
16115 | * @memberof google.api
|
16116 | * @interface ICustomHttpPattern
|
16117 | * @property {string|null} [kind] CustomHttpPattern kind
|
16118 | * @property {string|null} [path] CustomHttpPattern path
|
16119 | */
|
16120 |
|
16121 | /**
|
16122 | * Constructs a new CustomHttpPattern.
|
16123 | * @memberof google.api
|
16124 | * @classdesc Represents a CustomHttpPattern.
|
16125 | * @implements ICustomHttpPattern
|
16126 | * @constructor
|
16127 | * @param {google.api.ICustomHttpPattern=} [properties] Properties to set
|
16128 | */
|
16129 | function CustomHttpPattern(properties) {
|
16130 | if (properties)
|
16131 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
16132 | if (properties[keys[i]] != null)
|
16133 | this[keys[i]] = properties[keys[i]];
|
16134 | }
|
16135 |
|
16136 | /**
|
16137 | * CustomHttpPattern kind.
|
16138 | * @member {string} kind
|
16139 | * @memberof google.api.CustomHttpPattern
|
16140 | * @instance
|
16141 | */
|
16142 | CustomHttpPattern.prototype.kind = "";
|
16143 |
|
16144 | /**
|
16145 | * CustomHttpPattern path.
|
16146 | * @member {string} path
|
16147 | * @memberof google.api.CustomHttpPattern
|
16148 | * @instance
|
16149 | */
|
16150 | CustomHttpPattern.prototype.path = "";
|
16151 |
|
16152 | /**
|
16153 | * Creates a new CustomHttpPattern instance using the specified properties.
|
16154 | * @function create
|
16155 | * @memberof google.api.CustomHttpPattern
|
16156 | * @static
|
16157 | * @param {google.api.ICustomHttpPattern=} [properties] Properties to set
|
16158 | * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance
|
16159 | */
|
16160 | CustomHttpPattern.create = function create(properties) {
|
16161 | return new CustomHttpPattern(properties);
|
16162 | };
|
16163 |
|
16164 | /**
|
16165 | * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages.
|
16166 | * @function encode
|
16167 | * @memberof google.api.CustomHttpPattern
|
16168 | * @static
|
16169 | * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode
|
16170 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
16171 | * @returns {$protobuf.Writer} Writer
|
16172 | */
|
16173 | CustomHttpPattern.encode = function encode(message, writer) {
|
16174 | if (!writer)
|
16175 | writer = $Writer.create();
|
16176 | if (message.kind != null && Object.hasOwnProperty.call(message, "kind"))
|
16177 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind);
|
16178 | if (message.path != null && Object.hasOwnProperty.call(message, "path"))
|
16179 | writer.uint32(/* id 2, wireType 2 =*/18).string(message.path);
|
16180 | return writer;
|
16181 | };
|
16182 |
|
16183 | /**
|
16184 | * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages.
|
16185 | * @function encodeDelimited
|
16186 | * @memberof google.api.CustomHttpPattern
|
16187 | * @static
|
16188 | * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode
|
16189 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
16190 | * @returns {$protobuf.Writer} Writer
|
16191 | */
|
16192 | CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) {
|
16193 | return this.encode(message, writer).ldelim();
|
16194 | };
|
16195 |
|
16196 | /**
|
16197 | * Decodes a CustomHttpPattern message from the specified reader or buffer.
|
16198 | * @function decode
|
16199 | * @memberof google.api.CustomHttpPattern
|
16200 | * @static
|
16201 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
16202 | * @param {number} [length] Message length if known beforehand
|
16203 | * @returns {google.api.CustomHttpPattern} CustomHttpPattern
|
16204 | * @throws {Error} If the payload is not a reader or valid buffer
|
16205 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
16206 | */
|
16207 | CustomHttpPattern.decode = function decode(reader, length) {
|
16208 | if (!(reader instanceof $Reader))
|
16209 | reader = $Reader.create(reader);
|
16210 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern();
|
16211 | while (reader.pos < end) {
|
16212 | var tag = reader.uint32();
|
16213 | switch (tag >>> 3) {
|
16214 | case 1:
|
16215 | message.kind = reader.string();
|
16216 | break;
|
16217 | case 2:
|
16218 | message.path = reader.string();
|
16219 | break;
|
16220 | default:
|
16221 | reader.skipType(tag & 7);
|
16222 | break;
|
16223 | }
|
16224 | }
|
16225 | return message;
|
16226 | };
|
16227 |
|
16228 | /**
|
16229 | * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited.
|
16230 | * @function decodeDelimited
|
16231 | * @memberof google.api.CustomHttpPattern
|
16232 | * @static
|
16233 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
16234 | * @returns {google.api.CustomHttpPattern} CustomHttpPattern
|
16235 | * @throws {Error} If the payload is not a reader or valid buffer
|
16236 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
16237 | */
|
16238 | CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) {
|
16239 | if (!(reader instanceof $Reader))
|
16240 | reader = new $Reader(reader);
|
16241 | return this.decode(reader, reader.uint32());
|
16242 | };
|
16243 |
|
16244 | /**
|
16245 | * Verifies a CustomHttpPattern message.
|
16246 | * @function verify
|
16247 | * @memberof google.api.CustomHttpPattern
|
16248 | * @static
|
16249 | * @param {Object.<string,*>} message Plain object to verify
|
16250 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
16251 | */
|
16252 | CustomHttpPattern.verify = function verify(message) {
|
16253 | if (typeof message !== "object" || message === null)
|
16254 | return "object expected";
|
16255 | if (message.kind != null && message.hasOwnProperty("kind"))
|
16256 | if (!$util.isString(message.kind))
|
16257 | return "kind: string expected";
|
16258 | if (message.path != null && message.hasOwnProperty("path"))
|
16259 | if (!$util.isString(message.path))
|
16260 | return "path: string expected";
|
16261 | return null;
|
16262 | };
|
16263 |
|
16264 | /**
|
16265 | * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types.
|
16266 | * @function fromObject
|
16267 | * @memberof google.api.CustomHttpPattern
|
16268 | * @static
|
16269 | * @param {Object.<string,*>} object Plain object
|
16270 | * @returns {google.api.CustomHttpPattern} CustomHttpPattern
|
16271 | */
|
16272 | CustomHttpPattern.fromObject = function fromObject(object) {
|
16273 | if (object instanceof $root.google.api.CustomHttpPattern)
|
16274 | return object;
|
16275 | var message = new $root.google.api.CustomHttpPattern();
|
16276 | if (object.kind != null)
|
16277 | message.kind = String(object.kind);
|
16278 | if (object.path != null)
|
16279 | message.path = String(object.path);
|
16280 | return message;
|
16281 | };
|
16282 |
|
16283 | /**
|
16284 | * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified.
|
16285 | * @function toObject
|
16286 | * @memberof google.api.CustomHttpPattern
|
16287 | * @static
|
16288 | * @param {google.api.CustomHttpPattern} message CustomHttpPattern
|
16289 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
16290 | * @returns {Object.<string,*>} Plain object
|
16291 | */
|
16292 | CustomHttpPattern.toObject = function toObject(message, options) {
|
16293 | if (!options)
|
16294 | options = {};
|
16295 | var object = {};
|
16296 | if (options.defaults) {
|
16297 | object.kind = "";
|
16298 | object.path = "";
|
16299 | }
|
16300 | if (message.kind != null && message.hasOwnProperty("kind"))
|
16301 | object.kind = message.kind;
|
16302 | if (message.path != null && message.hasOwnProperty("path"))
|
16303 | object.path = message.path;
|
16304 | return object;
|
16305 | };
|
16306 |
|
16307 | /**
|
16308 | * Converts this CustomHttpPattern to JSON.
|
16309 | * @function toJSON
|
16310 | * @memberof google.api.CustomHttpPattern
|
16311 | * @instance
|
16312 | * @returns {Object.<string,*>} JSON object
|
16313 | */
|
16314 | CustomHttpPattern.prototype.toJSON = function toJSON() {
|
16315 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
16316 | };
|
16317 |
|
16318 | return CustomHttpPattern;
|
16319 | })();
|
16320 |
|
16321 | /**
|
16322 | * FieldBehavior enum.
|
16323 | * @name google.api.FieldBehavior
|
16324 | * @enum {number}
|
16325 | * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value
|
16326 | * @property {number} OPTIONAL=1 OPTIONAL value
|
16327 | * @property {number} REQUIRED=2 REQUIRED value
|
16328 | * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value
|
16329 | * @property {number} INPUT_ONLY=4 INPUT_ONLY value
|
16330 | * @property {number} IMMUTABLE=5 IMMUTABLE value
|
16331 | * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value
|
16332 | * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value
|
16333 | */
|
16334 | api.FieldBehavior = (function() {
|
16335 | var valuesById = {}, values = Object.create(valuesById);
|
16336 | values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0;
|
16337 | values[valuesById[1] = "OPTIONAL"] = 1;
|
16338 | values[valuesById[2] = "REQUIRED"] = 2;
|
16339 | values[valuesById[3] = "OUTPUT_ONLY"] = 3;
|
16340 | values[valuesById[4] = "INPUT_ONLY"] = 4;
|
16341 | values[valuesById[5] = "IMMUTABLE"] = 5;
|
16342 | values[valuesById[6] = "UNORDERED_LIST"] = 6;
|
16343 | values[valuesById[7] = "NON_EMPTY_DEFAULT"] = 7;
|
16344 | return values;
|
16345 | })();
|
16346 |
|
16347 | api.ResourceDescriptor = (function() {
|
16348 |
|
16349 | /**
|
16350 | * Properties of a ResourceDescriptor.
|
16351 | * @memberof google.api
|
16352 | * @interface IResourceDescriptor
|
16353 | * @property {string|null} [type] ResourceDescriptor type
|
16354 | * @property {Array.<string>|null} [pattern] ResourceDescriptor pattern
|
16355 | * @property {string|null} [nameField] ResourceDescriptor nameField
|
16356 | * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history
|
16357 | * @property {string|null} [plural] ResourceDescriptor plural
|
16358 | * @property {string|null} [singular] ResourceDescriptor singular
|
16359 | * @property {Array.<google.api.ResourceDescriptor.Style>|null} [style] ResourceDescriptor style
|
16360 | */
|
16361 |
|
16362 | /**
|
16363 | * Constructs a new ResourceDescriptor.
|
16364 | * @memberof google.api
|
16365 | * @classdesc Represents a ResourceDescriptor.
|
16366 | * @implements IResourceDescriptor
|
16367 | * @constructor
|
16368 | * @param {google.api.IResourceDescriptor=} [properties] Properties to set
|
16369 | */
|
16370 | function ResourceDescriptor(properties) {
|
16371 | this.pattern = [];
|
16372 | this.style = [];
|
16373 | if (properties)
|
16374 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
16375 | if (properties[keys[i]] != null)
|
16376 | this[keys[i]] = properties[keys[i]];
|
16377 | }
|
16378 |
|
16379 | /**
|
16380 | * ResourceDescriptor type.
|
16381 | * @member {string} type
|
16382 | * @memberof google.api.ResourceDescriptor
|
16383 | * @instance
|
16384 | */
|
16385 | ResourceDescriptor.prototype.type = "";
|
16386 |
|
16387 | /**
|
16388 | * ResourceDescriptor pattern.
|
16389 | * @member {Array.<string>} pattern
|
16390 | * @memberof google.api.ResourceDescriptor
|
16391 | * @instance
|
16392 | */
|
16393 | ResourceDescriptor.prototype.pattern = $util.emptyArray;
|
16394 |
|
16395 | /**
|
16396 | * ResourceDescriptor nameField.
|
16397 | * @member {string} nameField
|
16398 | * @memberof google.api.ResourceDescriptor
|
16399 | * @instance
|
16400 | */
|
16401 | ResourceDescriptor.prototype.nameField = "";
|
16402 |
|
16403 | /**
|
16404 | * ResourceDescriptor history.
|
16405 | * @member {google.api.ResourceDescriptor.History} history
|
16406 | * @memberof google.api.ResourceDescriptor
|
16407 | * @instance
|
16408 | */
|
16409 | ResourceDescriptor.prototype.history = 0;
|
16410 |
|
16411 | /**
|
16412 | * ResourceDescriptor plural.
|
16413 | * @member {string} plural
|
16414 | * @memberof google.api.ResourceDescriptor
|
16415 | * @instance
|
16416 | */
|
16417 | ResourceDescriptor.prototype.plural = "";
|
16418 |
|
16419 | /**
|
16420 | * ResourceDescriptor singular.
|
16421 | * @member {string} singular
|
16422 | * @memberof google.api.ResourceDescriptor
|
16423 | * @instance
|
16424 | */
|
16425 | ResourceDescriptor.prototype.singular = "";
|
16426 |
|
16427 | /**
|
16428 | * ResourceDescriptor style.
|
16429 | * @member {Array.<google.api.ResourceDescriptor.Style>} style
|
16430 | * @memberof google.api.ResourceDescriptor
|
16431 | * @instance
|
16432 | */
|
16433 | ResourceDescriptor.prototype.style = $util.emptyArray;
|
16434 |
|
16435 | /**
|
16436 | * Creates a new ResourceDescriptor instance using the specified properties.
|
16437 | * @function create
|
16438 | * @memberof google.api.ResourceDescriptor
|
16439 | * @static
|
16440 | * @param {google.api.IResourceDescriptor=} [properties] Properties to set
|
16441 | * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance
|
16442 | */
|
16443 | ResourceDescriptor.create = function create(properties) {
|
16444 | return new ResourceDescriptor(properties);
|
16445 | };
|
16446 |
|
16447 | /**
|
16448 | * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages.
|
16449 | * @function encode
|
16450 | * @memberof google.api.ResourceDescriptor
|
16451 | * @static
|
16452 | * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode
|
16453 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
16454 | * @returns {$protobuf.Writer} Writer
|
16455 | */
|
16456 | ResourceDescriptor.encode = function encode(message, writer) {
|
16457 | if (!writer)
|
16458 | writer = $Writer.create();
|
16459 | if (message.type != null && Object.hasOwnProperty.call(message, "type"))
|
16460 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.type);
|
16461 | if (message.pattern != null && message.pattern.length)
|
16462 | for (var i = 0; i < message.pattern.length; ++i)
|
16463 | writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]);
|
16464 | if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField"))
|
16465 | writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField);
|
16466 | if (message.history != null && Object.hasOwnProperty.call(message, "history"))
|
16467 | writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history);
|
16468 | if (message.plural != null && Object.hasOwnProperty.call(message, "plural"))
|
16469 | writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural);
|
16470 | if (message.singular != null && Object.hasOwnProperty.call(message, "singular"))
|
16471 | writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular);
|
16472 | if (message.style != null && message.style.length) {
|
16473 | writer.uint32(/* id 10, wireType 2 =*/82).fork();
|
16474 | for (var i = 0; i < message.style.length; ++i)
|
16475 | writer.int32(message.style[i]);
|
16476 | writer.ldelim();
|
16477 | }
|
16478 | return writer;
|
16479 | };
|
16480 |
|
16481 | /**
|
16482 | * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages.
|
16483 | * @function encodeDelimited
|
16484 | * @memberof google.api.ResourceDescriptor
|
16485 | * @static
|
16486 | * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode
|
16487 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
16488 | * @returns {$protobuf.Writer} Writer
|
16489 | */
|
16490 | ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) {
|
16491 | return this.encode(message, writer).ldelim();
|
16492 | };
|
16493 |
|
16494 | /**
|
16495 | * Decodes a ResourceDescriptor message from the specified reader or buffer.
|
16496 | * @function decode
|
16497 | * @memberof google.api.ResourceDescriptor
|
16498 | * @static
|
16499 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
16500 | * @param {number} [length] Message length if known beforehand
|
16501 | * @returns {google.api.ResourceDescriptor} ResourceDescriptor
|
16502 | * @throws {Error} If the payload is not a reader or valid buffer
|
16503 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
16504 | */
|
16505 | ResourceDescriptor.decode = function decode(reader, length) {
|
16506 | if (!(reader instanceof $Reader))
|
16507 | reader = $Reader.create(reader);
|
16508 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor();
|
16509 | while (reader.pos < end) {
|
16510 | var tag = reader.uint32();
|
16511 | switch (tag >>> 3) {
|
16512 | case 1:
|
16513 | message.type = reader.string();
|
16514 | break;
|
16515 | case 2:
|
16516 | if (!(message.pattern && message.pattern.length))
|
16517 | message.pattern = [];
|
16518 | message.pattern.push(reader.string());
|
16519 | break;
|
16520 | case 3:
|
16521 | message.nameField = reader.string();
|
16522 | break;
|
16523 | case 4:
|
16524 | message.history = reader.int32();
|
16525 | break;
|
16526 | case 5:
|
16527 | message.plural = reader.string();
|
16528 | break;
|
16529 | case 6:
|
16530 | message.singular = reader.string();
|
16531 | break;
|
16532 | case 10:
|
16533 | if (!(message.style && message.style.length))
|
16534 | message.style = [];
|
16535 | if ((tag & 7) === 2) {
|
16536 | var end2 = reader.uint32() + reader.pos;
|
16537 | while (reader.pos < end2)
|
16538 | message.style.push(reader.int32());
|
16539 | } else
|
16540 | message.style.push(reader.int32());
|
16541 | break;
|
16542 | default:
|
16543 | reader.skipType(tag & 7);
|
16544 | break;
|
16545 | }
|
16546 | }
|
16547 | return message;
|
16548 | };
|
16549 |
|
16550 | /**
|
16551 | * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited.
|
16552 | * @function decodeDelimited
|
16553 | * @memberof google.api.ResourceDescriptor
|
16554 | * @static
|
16555 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
16556 | * @returns {google.api.ResourceDescriptor} ResourceDescriptor
|
16557 | * @throws {Error} If the payload is not a reader or valid buffer
|
16558 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
16559 | */
|
16560 | ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) {
|
16561 | if (!(reader instanceof $Reader))
|
16562 | reader = new $Reader(reader);
|
16563 | return this.decode(reader, reader.uint32());
|
16564 | };
|
16565 |
|
16566 | /**
|
16567 | * Verifies a ResourceDescriptor message.
|
16568 | * @function verify
|
16569 | * @memberof google.api.ResourceDescriptor
|
16570 | * @static
|
16571 | * @param {Object.<string,*>} message Plain object to verify
|
16572 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
16573 | */
|
16574 | ResourceDescriptor.verify = function verify(message) {
|
16575 | if (typeof message !== "object" || message === null)
|
16576 | return "object expected";
|
16577 | if (message.type != null && message.hasOwnProperty("type"))
|
16578 | if (!$util.isString(message.type))
|
16579 | return "type: string expected";
|
16580 | if (message.pattern != null && message.hasOwnProperty("pattern")) {
|
16581 | if (!Array.isArray(message.pattern))
|
16582 | return "pattern: array expected";
|
16583 | for (var i = 0; i < message.pattern.length; ++i)
|
16584 | if (!$util.isString(message.pattern[i]))
|
16585 | return "pattern: string[] expected";
|
16586 | }
|
16587 | if (message.nameField != null && message.hasOwnProperty("nameField"))
|
16588 | if (!$util.isString(message.nameField))
|
16589 | return "nameField: string expected";
|
16590 | if (message.history != null && message.hasOwnProperty("history"))
|
16591 | switch (message.history) {
|
16592 | default:
|
16593 | return "history: enum value expected";
|
16594 | case 0:
|
16595 | case 1:
|
16596 | case 2:
|
16597 | break;
|
16598 | }
|
16599 | if (message.plural != null && message.hasOwnProperty("plural"))
|
16600 | if (!$util.isString(message.plural))
|
16601 | return "plural: string expected";
|
16602 | if (message.singular != null && message.hasOwnProperty("singular"))
|
16603 | if (!$util.isString(message.singular))
|
16604 | return "singular: string expected";
|
16605 | if (message.style != null && message.hasOwnProperty("style")) {
|
16606 | if (!Array.isArray(message.style))
|
16607 | return "style: array expected";
|
16608 | for (var i = 0; i < message.style.length; ++i)
|
16609 | switch (message.style[i]) {
|
16610 | default:
|
16611 | return "style: enum value[] expected";
|
16612 | case 0:
|
16613 | case 1:
|
16614 | break;
|
16615 | }
|
16616 | }
|
16617 | return null;
|
16618 | };
|
16619 |
|
16620 | /**
|
16621 | * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types.
|
16622 | * @function fromObject
|
16623 | * @memberof google.api.ResourceDescriptor
|
16624 | * @static
|
16625 | * @param {Object.<string,*>} object Plain object
|
16626 | * @returns {google.api.ResourceDescriptor} ResourceDescriptor
|
16627 | */
|
16628 | ResourceDescriptor.fromObject = function fromObject(object) {
|
16629 | if (object instanceof $root.google.api.ResourceDescriptor)
|
16630 | return object;
|
16631 | var message = new $root.google.api.ResourceDescriptor();
|
16632 | if (object.type != null)
|
16633 | message.type = String(object.type);
|
16634 | if (object.pattern) {
|
16635 | if (!Array.isArray(object.pattern))
|
16636 | throw TypeError(".google.api.ResourceDescriptor.pattern: array expected");
|
16637 | message.pattern = [];
|
16638 | for (var i = 0; i < object.pattern.length; ++i)
|
16639 | message.pattern[i] = String(object.pattern[i]);
|
16640 | }
|
16641 | if (object.nameField != null)
|
16642 | message.nameField = String(object.nameField);
|
16643 | switch (object.history) {
|
16644 | case "HISTORY_UNSPECIFIED":
|
16645 | case 0:
|
16646 | message.history = 0;
|
16647 | break;
|
16648 | case "ORIGINALLY_SINGLE_PATTERN":
|
16649 | case 1:
|
16650 | message.history = 1;
|
16651 | break;
|
16652 | case "FUTURE_MULTI_PATTERN":
|
16653 | case 2:
|
16654 | message.history = 2;
|
16655 | break;
|
16656 | }
|
16657 | if (object.plural != null)
|
16658 | message.plural = String(object.plural);
|
16659 | if (object.singular != null)
|
16660 | message.singular = String(object.singular);
|
16661 | if (object.style) {
|
16662 | if (!Array.isArray(object.style))
|
16663 | throw TypeError(".google.api.ResourceDescriptor.style: array expected");
|
16664 | message.style = [];
|
16665 | for (var i = 0; i < object.style.length; ++i)
|
16666 | switch (object.style[i]) {
|
16667 | default:
|
16668 | case "STYLE_UNSPECIFIED":
|
16669 | case 0:
|
16670 | message.style[i] = 0;
|
16671 | break;
|
16672 | case "DECLARATIVE_FRIENDLY":
|
16673 | case 1:
|
16674 | message.style[i] = 1;
|
16675 | break;
|
16676 | }
|
16677 | }
|
16678 | return message;
|
16679 | };
|
16680 |
|
16681 | /**
|
16682 | * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified.
|
16683 | * @function toObject
|
16684 | * @memberof google.api.ResourceDescriptor
|
16685 | * @static
|
16686 | * @param {google.api.ResourceDescriptor} message ResourceDescriptor
|
16687 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
16688 | * @returns {Object.<string,*>} Plain object
|
16689 | */
|
16690 | ResourceDescriptor.toObject = function toObject(message, options) {
|
16691 | if (!options)
|
16692 | options = {};
|
16693 | var object = {};
|
16694 | if (options.arrays || options.defaults) {
|
16695 | object.pattern = [];
|
16696 | object.style = [];
|
16697 | }
|
16698 | if (options.defaults) {
|
16699 | object.type = "";
|
16700 | object.nameField = "";
|
16701 | object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0;
|
16702 | object.plural = "";
|
16703 | object.singular = "";
|
16704 | }
|
16705 | if (message.type != null && message.hasOwnProperty("type"))
|
16706 | object.type = message.type;
|
16707 | if (message.pattern && message.pattern.length) {
|
16708 | object.pattern = [];
|
16709 | for (var j = 0; j < message.pattern.length; ++j)
|
16710 | object.pattern[j] = message.pattern[j];
|
16711 | }
|
16712 | if (message.nameField != null && message.hasOwnProperty("nameField"))
|
16713 | object.nameField = message.nameField;
|
16714 | if (message.history != null && message.hasOwnProperty("history"))
|
16715 | object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] : message.history;
|
16716 | if (message.plural != null && message.hasOwnProperty("plural"))
|
16717 | object.plural = message.plural;
|
16718 | if (message.singular != null && message.hasOwnProperty("singular"))
|
16719 | object.singular = message.singular;
|
16720 | if (message.style && message.style.length) {
|
16721 | object.style = [];
|
16722 | for (var j = 0; j < message.style.length; ++j)
|
16723 | object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j];
|
16724 | }
|
16725 | return object;
|
16726 | };
|
16727 |
|
16728 | /**
|
16729 | * Converts this ResourceDescriptor to JSON.
|
16730 | * @function toJSON
|
16731 | * @memberof google.api.ResourceDescriptor
|
16732 | * @instance
|
16733 | * @returns {Object.<string,*>} JSON object
|
16734 | */
|
16735 | ResourceDescriptor.prototype.toJSON = function toJSON() {
|
16736 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
16737 | };
|
16738 |
|
16739 | /**
|
16740 | * History enum.
|
16741 | * @name google.api.ResourceDescriptor.History
|
16742 | * @enum {number}
|
16743 | * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value
|
16744 | * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value
|
16745 | * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value
|
16746 | */
|
16747 | ResourceDescriptor.History = (function() {
|
16748 | var valuesById = {}, values = Object.create(valuesById);
|
16749 | values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0;
|
16750 | values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1;
|
16751 | values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2;
|
16752 | return values;
|
16753 | })();
|
16754 |
|
16755 | /**
|
16756 | * Style enum.
|
16757 | * @name google.api.ResourceDescriptor.Style
|
16758 | * @enum {number}
|
16759 | * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value
|
16760 | * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value
|
16761 | */
|
16762 | ResourceDescriptor.Style = (function() {
|
16763 | var valuesById = {}, values = Object.create(valuesById);
|
16764 | values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0;
|
16765 | values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1;
|
16766 | return values;
|
16767 | })();
|
16768 |
|
16769 | return ResourceDescriptor;
|
16770 | })();
|
16771 |
|
16772 | api.ResourceReference = (function() {
|
16773 |
|
16774 | /**
|
16775 | * Properties of a ResourceReference.
|
16776 | * @memberof google.api
|
16777 | * @interface IResourceReference
|
16778 | * @property {string|null} [type] ResourceReference type
|
16779 | * @property {string|null} [childType] ResourceReference childType
|
16780 | */
|
16781 |
|
16782 | /**
|
16783 | * Constructs a new ResourceReference.
|
16784 | * @memberof google.api
|
16785 | * @classdesc Represents a ResourceReference.
|
16786 | * @implements IResourceReference
|
16787 | * @constructor
|
16788 | * @param {google.api.IResourceReference=} [properties] Properties to set
|
16789 | */
|
16790 | function ResourceReference(properties) {
|
16791 | if (properties)
|
16792 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
16793 | if (properties[keys[i]] != null)
|
16794 | this[keys[i]] = properties[keys[i]];
|
16795 | }
|
16796 |
|
16797 | /**
|
16798 | * ResourceReference type.
|
16799 | * @member {string} type
|
16800 | * @memberof google.api.ResourceReference
|
16801 | * @instance
|
16802 | */
|
16803 | ResourceReference.prototype.type = "";
|
16804 |
|
16805 | /**
|
16806 | * ResourceReference childType.
|
16807 | * @member {string} childType
|
16808 | * @memberof google.api.ResourceReference
|
16809 | * @instance
|
16810 | */
|
16811 | ResourceReference.prototype.childType = "";
|
16812 |
|
16813 | /**
|
16814 | * Creates a new ResourceReference instance using the specified properties.
|
16815 | * @function create
|
16816 | * @memberof google.api.ResourceReference
|
16817 | * @static
|
16818 | * @param {google.api.IResourceReference=} [properties] Properties to set
|
16819 | * @returns {google.api.ResourceReference} ResourceReference instance
|
16820 | */
|
16821 | ResourceReference.create = function create(properties) {
|
16822 | return new ResourceReference(properties);
|
16823 | };
|
16824 |
|
16825 | /**
|
16826 | * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages.
|
16827 | * @function encode
|
16828 | * @memberof google.api.ResourceReference
|
16829 | * @static
|
16830 | * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode
|
16831 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
16832 | * @returns {$protobuf.Writer} Writer
|
16833 | */
|
16834 | ResourceReference.encode = function encode(message, writer) {
|
16835 | if (!writer)
|
16836 | writer = $Writer.create();
|
16837 | if (message.type != null && Object.hasOwnProperty.call(message, "type"))
|
16838 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.type);
|
16839 | if (message.childType != null && Object.hasOwnProperty.call(message, "childType"))
|
16840 | writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType);
|
16841 | return writer;
|
16842 | };
|
16843 |
|
16844 | /**
|
16845 | * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages.
|
16846 | * @function encodeDelimited
|
16847 | * @memberof google.api.ResourceReference
|
16848 | * @static
|
16849 | * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode
|
16850 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
16851 | * @returns {$protobuf.Writer} Writer
|
16852 | */
|
16853 | ResourceReference.encodeDelimited = function encodeDelimited(message, writer) {
|
16854 | return this.encode(message, writer).ldelim();
|
16855 | };
|
16856 |
|
16857 | /**
|
16858 | * Decodes a ResourceReference message from the specified reader or buffer.
|
16859 | * @function decode
|
16860 | * @memberof google.api.ResourceReference
|
16861 | * @static
|
16862 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
16863 | * @param {number} [length] Message length if known beforehand
|
16864 | * @returns {google.api.ResourceReference} ResourceReference
|
16865 | * @throws {Error} If the payload is not a reader or valid buffer
|
16866 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
16867 | */
|
16868 | ResourceReference.decode = function decode(reader, length) {
|
16869 | if (!(reader instanceof $Reader))
|
16870 | reader = $Reader.create(reader);
|
16871 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference();
|
16872 | while (reader.pos < end) {
|
16873 | var tag = reader.uint32();
|
16874 | switch (tag >>> 3) {
|
16875 | case 1:
|
16876 | message.type = reader.string();
|
16877 | break;
|
16878 | case 2:
|
16879 | message.childType = reader.string();
|
16880 | break;
|
16881 | default:
|
16882 | reader.skipType(tag & 7);
|
16883 | break;
|
16884 | }
|
16885 | }
|
16886 | return message;
|
16887 | };
|
16888 |
|
16889 | /**
|
16890 | * Decodes a ResourceReference message from the specified reader or buffer, length delimited.
|
16891 | * @function decodeDelimited
|
16892 | * @memberof google.api.ResourceReference
|
16893 | * @static
|
16894 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
16895 | * @returns {google.api.ResourceReference} ResourceReference
|
16896 | * @throws {Error} If the payload is not a reader or valid buffer
|
16897 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
16898 | */
|
16899 | ResourceReference.decodeDelimited = function decodeDelimited(reader) {
|
16900 | if (!(reader instanceof $Reader))
|
16901 | reader = new $Reader(reader);
|
16902 | return this.decode(reader, reader.uint32());
|
16903 | };
|
16904 |
|
16905 | /**
|
16906 | * Verifies a ResourceReference message.
|
16907 | * @function verify
|
16908 | * @memberof google.api.ResourceReference
|
16909 | * @static
|
16910 | * @param {Object.<string,*>} message Plain object to verify
|
16911 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
16912 | */
|
16913 | ResourceReference.verify = function verify(message) {
|
16914 | if (typeof message !== "object" || message === null)
|
16915 | return "object expected";
|
16916 | if (message.type != null && message.hasOwnProperty("type"))
|
16917 | if (!$util.isString(message.type))
|
16918 | return "type: string expected";
|
16919 | if (message.childType != null && message.hasOwnProperty("childType"))
|
16920 | if (!$util.isString(message.childType))
|
16921 | return "childType: string expected";
|
16922 | return null;
|
16923 | };
|
16924 |
|
16925 | /**
|
16926 | * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types.
|
16927 | * @function fromObject
|
16928 | * @memberof google.api.ResourceReference
|
16929 | * @static
|
16930 | * @param {Object.<string,*>} object Plain object
|
16931 | * @returns {google.api.ResourceReference} ResourceReference
|
16932 | */
|
16933 | ResourceReference.fromObject = function fromObject(object) {
|
16934 | if (object instanceof $root.google.api.ResourceReference)
|
16935 | return object;
|
16936 | var message = new $root.google.api.ResourceReference();
|
16937 | if (object.type != null)
|
16938 | message.type = String(object.type);
|
16939 | if (object.childType != null)
|
16940 | message.childType = String(object.childType);
|
16941 | return message;
|
16942 | };
|
16943 |
|
16944 | /**
|
16945 | * Creates a plain object from a ResourceReference message. Also converts values to other types if specified.
|
16946 | * @function toObject
|
16947 | * @memberof google.api.ResourceReference
|
16948 | * @static
|
16949 | * @param {google.api.ResourceReference} message ResourceReference
|
16950 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
16951 | * @returns {Object.<string,*>} Plain object
|
16952 | */
|
16953 | ResourceReference.toObject = function toObject(message, options) {
|
16954 | if (!options)
|
16955 | options = {};
|
16956 | var object = {};
|
16957 | if (options.defaults) {
|
16958 | object.type = "";
|
16959 | object.childType = "";
|
16960 | }
|
16961 | if (message.type != null && message.hasOwnProperty("type"))
|
16962 | object.type = message.type;
|
16963 | if (message.childType != null && message.hasOwnProperty("childType"))
|
16964 | object.childType = message.childType;
|
16965 | return object;
|
16966 | };
|
16967 |
|
16968 | /**
|
16969 | * Converts this ResourceReference to JSON.
|
16970 | * @function toJSON
|
16971 | * @memberof google.api.ResourceReference
|
16972 | * @instance
|
16973 | * @returns {Object.<string,*>} JSON object
|
16974 | */
|
16975 | ResourceReference.prototype.toJSON = function toJSON() {
|
16976 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
16977 | };
|
16978 |
|
16979 | return ResourceReference;
|
16980 | })();
|
16981 |
|
16982 | return api;
|
16983 | })();
|
16984 |
|
16985 | google.protobuf = (function() {
|
16986 |
|
16987 | /**
|
16988 | * Namespace protobuf.
|
16989 | * @memberof google
|
16990 | * @namespace
|
16991 | */
|
16992 | var protobuf = {};
|
16993 |
|
16994 | protobuf.FileDescriptorSet = (function() {
|
16995 |
|
16996 | /**
|
16997 | * Properties of a FileDescriptorSet.
|
16998 | * @memberof google.protobuf
|
16999 | * @interface IFileDescriptorSet
|
17000 | * @property {Array.<google.protobuf.IFileDescriptorProto>|null} [file] FileDescriptorSet file
|
17001 | */
|
17002 |
|
17003 | /**
|
17004 | * Constructs a new FileDescriptorSet.
|
17005 | * @memberof google.protobuf
|
17006 | * @classdesc Represents a FileDescriptorSet.
|
17007 | * @implements IFileDescriptorSet
|
17008 | * @constructor
|
17009 | * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set
|
17010 | */
|
17011 | function FileDescriptorSet(properties) {
|
17012 | this.file = [];
|
17013 | if (properties)
|
17014 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
17015 | if (properties[keys[i]] != null)
|
17016 | this[keys[i]] = properties[keys[i]];
|
17017 | }
|
17018 |
|
17019 | /**
|
17020 | * FileDescriptorSet file.
|
17021 | * @member {Array.<google.protobuf.IFileDescriptorProto>} file
|
17022 | * @memberof google.protobuf.FileDescriptorSet
|
17023 | * @instance
|
17024 | */
|
17025 | FileDescriptorSet.prototype.file = $util.emptyArray;
|
17026 |
|
17027 | /**
|
17028 | * Creates a new FileDescriptorSet instance using the specified properties.
|
17029 | * @function create
|
17030 | * @memberof google.protobuf.FileDescriptorSet
|
17031 | * @static
|
17032 | * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set
|
17033 | * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance
|
17034 | */
|
17035 | FileDescriptorSet.create = function create(properties) {
|
17036 | return new FileDescriptorSet(properties);
|
17037 | };
|
17038 |
|
17039 | /**
|
17040 | * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages.
|
17041 | * @function encode
|
17042 | * @memberof google.protobuf.FileDescriptorSet
|
17043 | * @static
|
17044 | * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode
|
17045 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
17046 | * @returns {$protobuf.Writer} Writer
|
17047 | */
|
17048 | FileDescriptorSet.encode = function encode(message, writer) {
|
17049 | if (!writer)
|
17050 | writer = $Writer.create();
|
17051 | if (message.file != null && message.file.length)
|
17052 | for (var i = 0; i < message.file.length; ++i)
|
17053 | $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
17054 | return writer;
|
17055 | };
|
17056 |
|
17057 | /**
|
17058 | * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages.
|
17059 | * @function encodeDelimited
|
17060 | * @memberof google.protobuf.FileDescriptorSet
|
17061 | * @static
|
17062 | * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode
|
17063 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
17064 | * @returns {$protobuf.Writer} Writer
|
17065 | */
|
17066 | FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) {
|
17067 | return this.encode(message, writer).ldelim();
|
17068 | };
|
17069 |
|
17070 | /**
|
17071 | * Decodes a FileDescriptorSet message from the specified reader or buffer.
|
17072 | * @function decode
|
17073 | * @memberof google.protobuf.FileDescriptorSet
|
17074 | * @static
|
17075 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
17076 | * @param {number} [length] Message length if known beforehand
|
17077 | * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet
|
17078 | * @throws {Error} If the payload is not a reader or valid buffer
|
17079 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
17080 | */
|
17081 | FileDescriptorSet.decode = function decode(reader, length) {
|
17082 | if (!(reader instanceof $Reader))
|
17083 | reader = $Reader.create(reader);
|
17084 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet();
|
17085 | while (reader.pos < end) {
|
17086 | var tag = reader.uint32();
|
17087 | switch (tag >>> 3) {
|
17088 | case 1:
|
17089 | if (!(message.file && message.file.length))
|
17090 | message.file = [];
|
17091 | message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32()));
|
17092 | break;
|
17093 | default:
|
17094 | reader.skipType(tag & 7);
|
17095 | break;
|
17096 | }
|
17097 | }
|
17098 | return message;
|
17099 | };
|
17100 |
|
17101 | /**
|
17102 | * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited.
|
17103 | * @function decodeDelimited
|
17104 | * @memberof google.protobuf.FileDescriptorSet
|
17105 | * @static
|
17106 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
17107 | * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet
|
17108 | * @throws {Error} If the payload is not a reader or valid buffer
|
17109 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
17110 | */
|
17111 | FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) {
|
17112 | if (!(reader instanceof $Reader))
|
17113 | reader = new $Reader(reader);
|
17114 | return this.decode(reader, reader.uint32());
|
17115 | };
|
17116 |
|
17117 | /**
|
17118 | * Verifies a FileDescriptorSet message.
|
17119 | * @function verify
|
17120 | * @memberof google.protobuf.FileDescriptorSet
|
17121 | * @static
|
17122 | * @param {Object.<string,*>} message Plain object to verify
|
17123 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
17124 | */
|
17125 | FileDescriptorSet.verify = function verify(message) {
|
17126 | if (typeof message !== "object" || message === null)
|
17127 | return "object expected";
|
17128 | if (message.file != null && message.hasOwnProperty("file")) {
|
17129 | if (!Array.isArray(message.file))
|
17130 | return "file: array expected";
|
17131 | for (var i = 0; i < message.file.length; ++i) {
|
17132 | var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]);
|
17133 | if (error)
|
17134 | return "file." + error;
|
17135 | }
|
17136 | }
|
17137 | return null;
|
17138 | };
|
17139 |
|
17140 | /**
|
17141 | * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types.
|
17142 | * @function fromObject
|
17143 | * @memberof google.protobuf.FileDescriptorSet
|
17144 | * @static
|
17145 | * @param {Object.<string,*>} object Plain object
|
17146 | * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet
|
17147 | */
|
17148 | FileDescriptorSet.fromObject = function fromObject(object) {
|
17149 | if (object instanceof $root.google.protobuf.FileDescriptorSet)
|
17150 | return object;
|
17151 | var message = new $root.google.protobuf.FileDescriptorSet();
|
17152 | if (object.file) {
|
17153 | if (!Array.isArray(object.file))
|
17154 | throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected");
|
17155 | message.file = [];
|
17156 | for (var i = 0; i < object.file.length; ++i) {
|
17157 | if (typeof object.file[i] !== "object")
|
17158 | throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected");
|
17159 | message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]);
|
17160 | }
|
17161 | }
|
17162 | return message;
|
17163 | };
|
17164 |
|
17165 | /**
|
17166 | * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified.
|
17167 | * @function toObject
|
17168 | * @memberof google.protobuf.FileDescriptorSet
|
17169 | * @static
|
17170 | * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet
|
17171 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
17172 | * @returns {Object.<string,*>} Plain object
|
17173 | */
|
17174 | FileDescriptorSet.toObject = function toObject(message, options) {
|
17175 | if (!options)
|
17176 | options = {};
|
17177 | var object = {};
|
17178 | if (options.arrays || options.defaults)
|
17179 | object.file = [];
|
17180 | if (message.file && message.file.length) {
|
17181 | object.file = [];
|
17182 | for (var j = 0; j < message.file.length; ++j)
|
17183 | object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options);
|
17184 | }
|
17185 | return object;
|
17186 | };
|
17187 |
|
17188 | /**
|
17189 | * Converts this FileDescriptorSet to JSON.
|
17190 | * @function toJSON
|
17191 | * @memberof google.protobuf.FileDescriptorSet
|
17192 | * @instance
|
17193 | * @returns {Object.<string,*>} JSON object
|
17194 | */
|
17195 | FileDescriptorSet.prototype.toJSON = function toJSON() {
|
17196 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
17197 | };
|
17198 |
|
17199 | return FileDescriptorSet;
|
17200 | })();
|
17201 |
|
17202 | protobuf.FileDescriptorProto = (function() {
|
17203 |
|
17204 | /**
|
17205 | * Properties of a FileDescriptorProto.
|
17206 | * @memberof google.protobuf
|
17207 | * @interface IFileDescriptorProto
|
17208 | * @property {string|null} [name] FileDescriptorProto name
|
17209 | * @property {string|null} ["package"] FileDescriptorProto package
|
17210 | * @property {Array.<string>|null} [dependency] FileDescriptorProto dependency
|
17211 | * @property {Array.<number>|null} [publicDependency] FileDescriptorProto publicDependency
|
17212 | * @property {Array.<number>|null} [weakDependency] FileDescriptorProto weakDependency
|
17213 | * @property {Array.<google.protobuf.IDescriptorProto>|null} [messageType] FileDescriptorProto messageType
|
17214 | * @property {Array.<google.protobuf.IEnumDescriptorProto>|null} [enumType] FileDescriptorProto enumType
|
17215 | * @property {Array.<google.protobuf.IServiceDescriptorProto>|null} [service] FileDescriptorProto service
|
17216 | * @property {Array.<google.protobuf.IFieldDescriptorProto>|null} [extension] FileDescriptorProto extension
|
17217 | * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options
|
17218 | * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo
|
17219 | * @property {string|null} [syntax] FileDescriptorProto syntax
|
17220 | */
|
17221 |
|
17222 | /**
|
17223 | * Constructs a new FileDescriptorProto.
|
17224 | * @memberof google.protobuf
|
17225 | * @classdesc Represents a FileDescriptorProto.
|
17226 | * @implements IFileDescriptorProto
|
17227 | * @constructor
|
17228 | * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set
|
17229 | */
|
17230 | function FileDescriptorProto(properties) {
|
17231 | this.dependency = [];
|
17232 | this.publicDependency = [];
|
17233 | this.weakDependency = [];
|
17234 | this.messageType = [];
|
17235 | this.enumType = [];
|
17236 | this.service = [];
|
17237 | this.extension = [];
|
17238 | if (properties)
|
17239 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
17240 | if (properties[keys[i]] != null)
|
17241 | this[keys[i]] = properties[keys[i]];
|
17242 | }
|
17243 |
|
17244 | /**
|
17245 | * FileDescriptorProto name.
|
17246 | * @member {string} name
|
17247 | * @memberof google.protobuf.FileDescriptorProto
|
17248 | * @instance
|
17249 | */
|
17250 | FileDescriptorProto.prototype.name = "";
|
17251 |
|
17252 | /**
|
17253 | * FileDescriptorProto package.
|
17254 | * @member {string} package
|
17255 | * @memberof google.protobuf.FileDescriptorProto
|
17256 | * @instance
|
17257 | */
|
17258 | FileDescriptorProto.prototype["package"] = "";
|
17259 |
|
17260 | /**
|
17261 | * FileDescriptorProto dependency.
|
17262 | * @member {Array.<string>} dependency
|
17263 | * @memberof google.protobuf.FileDescriptorProto
|
17264 | * @instance
|
17265 | */
|
17266 | FileDescriptorProto.prototype.dependency = $util.emptyArray;
|
17267 |
|
17268 | /**
|
17269 | * FileDescriptorProto publicDependency.
|
17270 | * @member {Array.<number>} publicDependency
|
17271 | * @memberof google.protobuf.FileDescriptorProto
|
17272 | * @instance
|
17273 | */
|
17274 | FileDescriptorProto.prototype.publicDependency = $util.emptyArray;
|
17275 |
|
17276 | /**
|
17277 | * FileDescriptorProto weakDependency.
|
17278 | * @member {Array.<number>} weakDependency
|
17279 | * @memberof google.protobuf.FileDescriptorProto
|
17280 | * @instance
|
17281 | */
|
17282 | FileDescriptorProto.prototype.weakDependency = $util.emptyArray;
|
17283 |
|
17284 | /**
|
17285 | * FileDescriptorProto messageType.
|
17286 | * @member {Array.<google.protobuf.IDescriptorProto>} messageType
|
17287 | * @memberof google.protobuf.FileDescriptorProto
|
17288 | * @instance
|
17289 | */
|
17290 | FileDescriptorProto.prototype.messageType = $util.emptyArray;
|
17291 |
|
17292 | /**
|
17293 | * FileDescriptorProto enumType.
|
17294 | * @member {Array.<google.protobuf.IEnumDescriptorProto>} enumType
|
17295 | * @memberof google.protobuf.FileDescriptorProto
|
17296 | * @instance
|
17297 | */
|
17298 | FileDescriptorProto.prototype.enumType = $util.emptyArray;
|
17299 |
|
17300 | /**
|
17301 | * FileDescriptorProto service.
|
17302 | * @member {Array.<google.protobuf.IServiceDescriptorProto>} service
|
17303 | * @memberof google.protobuf.FileDescriptorProto
|
17304 | * @instance
|
17305 | */
|
17306 | FileDescriptorProto.prototype.service = $util.emptyArray;
|
17307 |
|
17308 | /**
|
17309 | * FileDescriptorProto extension.
|
17310 | * @member {Array.<google.protobuf.IFieldDescriptorProto>} extension
|
17311 | * @memberof google.protobuf.FileDescriptorProto
|
17312 | * @instance
|
17313 | */
|
17314 | FileDescriptorProto.prototype.extension = $util.emptyArray;
|
17315 |
|
17316 | /**
|
17317 | * FileDescriptorProto options.
|
17318 | * @member {google.protobuf.IFileOptions|null|undefined} options
|
17319 | * @memberof google.protobuf.FileDescriptorProto
|
17320 | * @instance
|
17321 | */
|
17322 | FileDescriptorProto.prototype.options = null;
|
17323 |
|
17324 | /**
|
17325 | * FileDescriptorProto sourceCodeInfo.
|
17326 | * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo
|
17327 | * @memberof google.protobuf.FileDescriptorProto
|
17328 | * @instance
|
17329 | */
|
17330 | FileDescriptorProto.prototype.sourceCodeInfo = null;
|
17331 |
|
17332 | /**
|
17333 | * FileDescriptorProto syntax.
|
17334 | * @member {string} syntax
|
17335 | * @memberof google.protobuf.FileDescriptorProto
|
17336 | * @instance
|
17337 | */
|
17338 | FileDescriptorProto.prototype.syntax = "";
|
17339 |
|
17340 | /**
|
17341 | * Creates a new FileDescriptorProto instance using the specified properties.
|
17342 | * @function create
|
17343 | * @memberof google.protobuf.FileDescriptorProto
|
17344 | * @static
|
17345 | * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set
|
17346 | * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance
|
17347 | */
|
17348 | FileDescriptorProto.create = function create(properties) {
|
17349 | return new FileDescriptorProto(properties);
|
17350 | };
|
17351 |
|
17352 | /**
|
17353 | * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages.
|
17354 | * @function encode
|
17355 | * @memberof google.protobuf.FileDescriptorProto
|
17356 | * @static
|
17357 | * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode
|
17358 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
17359 | * @returns {$protobuf.Writer} Writer
|
17360 | */
|
17361 | FileDescriptorProto.encode = function encode(message, writer) {
|
17362 | if (!writer)
|
17363 | writer = $Writer.create();
|
17364 | if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
17365 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
|
17366 | if (message["package"] != null && Object.hasOwnProperty.call(message, "package"))
|
17367 | writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]);
|
17368 | if (message.dependency != null && message.dependency.length)
|
17369 | for (var i = 0; i < message.dependency.length; ++i)
|
17370 | writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]);
|
17371 | if (message.messageType != null && message.messageType.length)
|
17372 | for (var i = 0; i < message.messageType.length; ++i)
|
17373 | $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
|
17374 | if (message.enumType != null && message.enumType.length)
|
17375 | for (var i = 0; i < message.enumType.length; ++i)
|
17376 | $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
|
17377 | if (message.service != null && message.service.length)
|
17378 | for (var i = 0; i < message.service.length; ++i)
|
17379 | $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
|
17380 | if (message.extension != null && message.extension.length)
|
17381 | for (var i = 0; i < message.extension.length; ++i)
|
17382 | $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();
|
17383 | if (message.options != null && Object.hasOwnProperty.call(message, "options"))
|
17384 | $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();
|
17385 | if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo"))
|
17386 | $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim();
|
17387 | if (message.publicDependency != null && message.publicDependency.length)
|
17388 | for (var i = 0; i < message.publicDependency.length; ++i)
|
17389 | writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]);
|
17390 | if (message.weakDependency != null && message.weakDependency.length)
|
17391 | for (var i = 0; i < message.weakDependency.length; ++i)
|
17392 | writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]);
|
17393 | if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax"))
|
17394 | writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax);
|
17395 | return writer;
|
17396 | };
|
17397 |
|
17398 | /**
|
17399 | * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages.
|
17400 | * @function encodeDelimited
|
17401 | * @memberof google.protobuf.FileDescriptorProto
|
17402 | * @static
|
17403 | * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode
|
17404 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
17405 | * @returns {$protobuf.Writer} Writer
|
17406 | */
|
17407 | FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) {
|
17408 | return this.encode(message, writer).ldelim();
|
17409 | };
|
17410 |
|
17411 | /**
|
17412 | * Decodes a FileDescriptorProto message from the specified reader or buffer.
|
17413 | * @function decode
|
17414 | * @memberof google.protobuf.FileDescriptorProto
|
17415 | * @static
|
17416 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
17417 | * @param {number} [length] Message length if known beforehand
|
17418 | * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto
|
17419 | * @throws {Error} If the payload is not a reader or valid buffer
|
17420 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
17421 | */
|
17422 | FileDescriptorProto.decode = function decode(reader, length) {
|
17423 | if (!(reader instanceof $Reader))
|
17424 | reader = $Reader.create(reader);
|
17425 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto();
|
17426 | while (reader.pos < end) {
|
17427 | var tag = reader.uint32();
|
17428 | switch (tag >>> 3) {
|
17429 | case 1:
|
17430 | message.name = reader.string();
|
17431 | break;
|
17432 | case 2:
|
17433 | message["package"] = reader.string();
|
17434 | break;
|
17435 | case 3:
|
17436 | if (!(message.dependency && message.dependency.length))
|
17437 | message.dependency = [];
|
17438 | message.dependency.push(reader.string());
|
17439 | break;
|
17440 | case 10:
|
17441 | if (!(message.publicDependency && message.publicDependency.length))
|
17442 | message.publicDependency = [];
|
17443 | if ((tag & 7) === 2) {
|
17444 | var end2 = reader.uint32() + reader.pos;
|
17445 | while (reader.pos < end2)
|
17446 | message.publicDependency.push(reader.int32());
|
17447 | } else
|
17448 | message.publicDependency.push(reader.int32());
|
17449 | break;
|
17450 | case 11:
|
17451 | if (!(message.weakDependency && message.weakDependency.length))
|
17452 | message.weakDependency = [];
|
17453 | if ((tag & 7) === 2) {
|
17454 | var end2 = reader.uint32() + reader.pos;
|
17455 | while (reader.pos < end2)
|
17456 | message.weakDependency.push(reader.int32());
|
17457 | } else
|
17458 | message.weakDependency.push(reader.int32());
|
17459 | break;
|
17460 | case 4:
|
17461 | if (!(message.messageType && message.messageType.length))
|
17462 | message.messageType = [];
|
17463 | message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32()));
|
17464 | break;
|
17465 | case 5:
|
17466 | if (!(message.enumType && message.enumType.length))
|
17467 | message.enumType = [];
|
17468 | message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32()));
|
17469 | break;
|
17470 | case 6:
|
17471 | if (!(message.service && message.service.length))
|
17472 | message.service = [];
|
17473 | message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32()));
|
17474 | break;
|
17475 | case 7:
|
17476 | if (!(message.extension && message.extension.length))
|
17477 | message.extension = [];
|
17478 | message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32()));
|
17479 | break;
|
17480 | case 8:
|
17481 | message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32());
|
17482 | break;
|
17483 | case 9:
|
17484 | message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32());
|
17485 | break;
|
17486 | case 12:
|
17487 | message.syntax = reader.string();
|
17488 | break;
|
17489 | default:
|
17490 | reader.skipType(tag & 7);
|
17491 | break;
|
17492 | }
|
17493 | }
|
17494 | return message;
|
17495 | };
|
17496 |
|
17497 | /**
|
17498 | * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited.
|
17499 | * @function decodeDelimited
|
17500 | * @memberof google.protobuf.FileDescriptorProto
|
17501 | * @static
|
17502 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
17503 | * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto
|
17504 | * @throws {Error} If the payload is not a reader or valid buffer
|
17505 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
17506 | */
|
17507 | FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) {
|
17508 | if (!(reader instanceof $Reader))
|
17509 | reader = new $Reader(reader);
|
17510 | return this.decode(reader, reader.uint32());
|
17511 | };
|
17512 |
|
17513 | /**
|
17514 | * Verifies a FileDescriptorProto message.
|
17515 | * @function verify
|
17516 | * @memberof google.protobuf.FileDescriptorProto
|
17517 | * @static
|
17518 | * @param {Object.<string,*>} message Plain object to verify
|
17519 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
17520 | */
|
17521 | FileDescriptorProto.verify = function verify(message) {
|
17522 | if (typeof message !== "object" || message === null)
|
17523 | return "object expected";
|
17524 | if (message.name != null && message.hasOwnProperty("name"))
|
17525 | if (!$util.isString(message.name))
|
17526 | return "name: string expected";
|
17527 | if (message["package"] != null && message.hasOwnProperty("package"))
|
17528 | if (!$util.isString(message["package"]))
|
17529 | return "package: string expected";
|
17530 | if (message.dependency != null && message.hasOwnProperty("dependency")) {
|
17531 | if (!Array.isArray(message.dependency))
|
17532 | return "dependency: array expected";
|
17533 | for (var i = 0; i < message.dependency.length; ++i)
|
17534 | if (!$util.isString(message.dependency[i]))
|
17535 | return "dependency: string[] expected";
|
17536 | }
|
17537 | if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) {
|
17538 | if (!Array.isArray(message.publicDependency))
|
17539 | return "publicDependency: array expected";
|
17540 | for (var i = 0; i < message.publicDependency.length; ++i)
|
17541 | if (!$util.isInteger(message.publicDependency[i]))
|
17542 | return "publicDependency: integer[] expected";
|
17543 | }
|
17544 | if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) {
|
17545 | if (!Array.isArray(message.weakDependency))
|
17546 | return "weakDependency: array expected";
|
17547 | for (var i = 0; i < message.weakDependency.length; ++i)
|
17548 | if (!$util.isInteger(message.weakDependency[i]))
|
17549 | return "weakDependency: integer[] expected";
|
17550 | }
|
17551 | if (message.messageType != null && message.hasOwnProperty("messageType")) {
|
17552 | if (!Array.isArray(message.messageType))
|
17553 | return "messageType: array expected";
|
17554 | for (var i = 0; i < message.messageType.length; ++i) {
|
17555 | var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]);
|
17556 | if (error)
|
17557 | return "messageType." + error;
|
17558 | }
|
17559 | }
|
17560 | if (message.enumType != null && message.hasOwnProperty("enumType")) {
|
17561 | if (!Array.isArray(message.enumType))
|
17562 | return "enumType: array expected";
|
17563 | for (var i = 0; i < message.enumType.length; ++i) {
|
17564 | var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]);
|
17565 | if (error)
|
17566 | return "enumType." + error;
|
17567 | }
|
17568 | }
|
17569 | if (message.service != null && message.hasOwnProperty("service")) {
|
17570 | if (!Array.isArray(message.service))
|
17571 | return "service: array expected";
|
17572 | for (var i = 0; i < message.service.length; ++i) {
|
17573 | var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]);
|
17574 | if (error)
|
17575 | return "service." + error;
|
17576 | }
|
17577 | }
|
17578 | if (message.extension != null && message.hasOwnProperty("extension")) {
|
17579 | if (!Array.isArray(message.extension))
|
17580 | return "extension: array expected";
|
17581 | for (var i = 0; i < message.extension.length; ++i) {
|
17582 | var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]);
|
17583 | if (error)
|
17584 | return "extension." + error;
|
17585 | }
|
17586 | }
|
17587 | if (message.options != null && message.hasOwnProperty("options")) {
|
17588 | var error = $root.google.protobuf.FileOptions.verify(message.options);
|
17589 | if (error)
|
17590 | return "options." + error;
|
17591 | }
|
17592 | if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) {
|
17593 | var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo);
|
17594 | if (error)
|
17595 | return "sourceCodeInfo." + error;
|
17596 | }
|
17597 | if (message.syntax != null && message.hasOwnProperty("syntax"))
|
17598 | if (!$util.isString(message.syntax))
|
17599 | return "syntax: string expected";
|
17600 | return null;
|
17601 | };
|
17602 |
|
17603 | /**
|
17604 | * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types.
|
17605 | * @function fromObject
|
17606 | * @memberof google.protobuf.FileDescriptorProto
|
17607 | * @static
|
17608 | * @param {Object.<string,*>} object Plain object
|
17609 | * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto
|
17610 | */
|
17611 | FileDescriptorProto.fromObject = function fromObject(object) {
|
17612 | if (object instanceof $root.google.protobuf.FileDescriptorProto)
|
17613 | return object;
|
17614 | var message = new $root.google.protobuf.FileDescriptorProto();
|
17615 | if (object.name != null)
|
17616 | message.name = String(object.name);
|
17617 | if (object["package"] != null)
|
17618 | message["package"] = String(object["package"]);
|
17619 | if (object.dependency) {
|
17620 | if (!Array.isArray(object.dependency))
|
17621 | throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected");
|
17622 | message.dependency = [];
|
17623 | for (var i = 0; i < object.dependency.length; ++i)
|
17624 | message.dependency[i] = String(object.dependency[i]);
|
17625 | }
|
17626 | if (object.publicDependency) {
|
17627 | if (!Array.isArray(object.publicDependency))
|
17628 | throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected");
|
17629 | message.publicDependency = [];
|
17630 | for (var i = 0; i < object.publicDependency.length; ++i)
|
17631 | message.publicDependency[i] = object.publicDependency[i] | 0;
|
17632 | }
|
17633 | if (object.weakDependency) {
|
17634 | if (!Array.isArray(object.weakDependency))
|
17635 | throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected");
|
17636 | message.weakDependency = [];
|
17637 | for (var i = 0; i < object.weakDependency.length; ++i)
|
17638 | message.weakDependency[i] = object.weakDependency[i] | 0;
|
17639 | }
|
17640 | if (object.messageType) {
|
17641 | if (!Array.isArray(object.messageType))
|
17642 | throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected");
|
17643 | message.messageType = [];
|
17644 | for (var i = 0; i < object.messageType.length; ++i) {
|
17645 | if (typeof object.messageType[i] !== "object")
|
17646 | throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected");
|
17647 | message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]);
|
17648 | }
|
17649 | }
|
17650 | if (object.enumType) {
|
17651 | if (!Array.isArray(object.enumType))
|
17652 | throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected");
|
17653 | message.enumType = [];
|
17654 | for (var i = 0; i < object.enumType.length; ++i) {
|
17655 | if (typeof object.enumType[i] !== "object")
|
17656 | throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected");
|
17657 | message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]);
|
17658 | }
|
17659 | }
|
17660 | if (object.service) {
|
17661 | if (!Array.isArray(object.service))
|
17662 | throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected");
|
17663 | message.service = [];
|
17664 | for (var i = 0; i < object.service.length; ++i) {
|
17665 | if (typeof object.service[i] !== "object")
|
17666 | throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected");
|
17667 | message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]);
|
17668 | }
|
17669 | }
|
17670 | if (object.extension) {
|
17671 | if (!Array.isArray(object.extension))
|
17672 | throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected");
|
17673 | message.extension = [];
|
17674 | for (var i = 0; i < object.extension.length; ++i) {
|
17675 | if (typeof object.extension[i] !== "object")
|
17676 | throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected");
|
17677 | message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]);
|
17678 | }
|
17679 | }
|
17680 | if (object.options != null) {
|
17681 | if (typeof object.options !== "object")
|
17682 | throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected");
|
17683 | message.options = $root.google.protobuf.FileOptions.fromObject(object.options);
|
17684 | }
|
17685 | if (object.sourceCodeInfo != null) {
|
17686 | if (typeof object.sourceCodeInfo !== "object")
|
17687 | throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected");
|
17688 | message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo);
|
17689 | }
|
17690 | if (object.syntax != null)
|
17691 | message.syntax = String(object.syntax);
|
17692 | return message;
|
17693 | };
|
17694 |
|
17695 | /**
|
17696 | * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified.
|
17697 | * @function toObject
|
17698 | * @memberof google.protobuf.FileDescriptorProto
|
17699 | * @static
|
17700 | * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto
|
17701 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
17702 | * @returns {Object.<string,*>} Plain object
|
17703 | */
|
17704 | FileDescriptorProto.toObject = function toObject(message, options) {
|
17705 | if (!options)
|
17706 | options = {};
|
17707 | var object = {};
|
17708 | if (options.arrays || options.defaults) {
|
17709 | object.dependency = [];
|
17710 | object.messageType = [];
|
17711 | object.enumType = [];
|
17712 | object.service = [];
|
17713 | object.extension = [];
|
17714 | object.publicDependency = [];
|
17715 | object.weakDependency = [];
|
17716 | }
|
17717 | if (options.defaults) {
|
17718 | object.name = "";
|
17719 | object["package"] = "";
|
17720 | object.options = null;
|
17721 | object.sourceCodeInfo = null;
|
17722 | object.syntax = "";
|
17723 | }
|
17724 | if (message.name != null && message.hasOwnProperty("name"))
|
17725 | object.name = message.name;
|
17726 | if (message["package"] != null && message.hasOwnProperty("package"))
|
17727 | object["package"] = message["package"];
|
17728 | if (message.dependency && message.dependency.length) {
|
17729 | object.dependency = [];
|
17730 | for (var j = 0; j < message.dependency.length; ++j)
|
17731 | object.dependency[j] = message.dependency[j];
|
17732 | }
|
17733 | if (message.messageType && message.messageType.length) {
|
17734 | object.messageType = [];
|
17735 | for (var j = 0; j < message.messageType.length; ++j)
|
17736 | object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options);
|
17737 | }
|
17738 | if (message.enumType && message.enumType.length) {
|
17739 | object.enumType = [];
|
17740 | for (var j = 0; j < message.enumType.length; ++j)
|
17741 | object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options);
|
17742 | }
|
17743 | if (message.service && message.service.length) {
|
17744 | object.service = [];
|
17745 | for (var j = 0; j < message.service.length; ++j)
|
17746 | object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options);
|
17747 | }
|
17748 | if (message.extension && message.extension.length) {
|
17749 | object.extension = [];
|
17750 | for (var j = 0; j < message.extension.length; ++j)
|
17751 | object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options);
|
17752 | }
|
17753 | if (message.options != null && message.hasOwnProperty("options"))
|
17754 | object.options = $root.google.protobuf.FileOptions.toObject(message.options, options);
|
17755 | if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo"))
|
17756 | object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options);
|
17757 | if (message.publicDependency && message.publicDependency.length) {
|
17758 | object.publicDependency = [];
|
17759 | for (var j = 0; j < message.publicDependency.length; ++j)
|
17760 | object.publicDependency[j] = message.publicDependency[j];
|
17761 | }
|
17762 | if (message.weakDependency && message.weakDependency.length) {
|
17763 | object.weakDependency = [];
|
17764 | for (var j = 0; j < message.weakDependency.length; ++j)
|
17765 | object.weakDependency[j] = message.weakDependency[j];
|
17766 | }
|
17767 | if (message.syntax != null && message.hasOwnProperty("syntax"))
|
17768 | object.syntax = message.syntax;
|
17769 | return object;
|
17770 | };
|
17771 |
|
17772 | /**
|
17773 | * Converts this FileDescriptorProto to JSON.
|
17774 | * @function toJSON
|
17775 | * @memberof google.protobuf.FileDescriptorProto
|
17776 | * @instance
|
17777 | * @returns {Object.<string,*>} JSON object
|
17778 | */
|
17779 | FileDescriptorProto.prototype.toJSON = function toJSON() {
|
17780 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
17781 | };
|
17782 |
|
17783 | return FileDescriptorProto;
|
17784 | })();
|
17785 |
|
17786 | protobuf.DescriptorProto = (function() {
|
17787 |
|
17788 | /**
|
17789 | * Properties of a DescriptorProto.
|
17790 | * @memberof google.protobuf
|
17791 | * @interface IDescriptorProto
|
17792 | * @property {string|null} [name] DescriptorProto name
|
17793 | * @property {Array.<google.protobuf.IFieldDescriptorProto>|null} [field] DescriptorProto field
|
17794 | * @property {Array.<google.protobuf.IFieldDescriptorProto>|null} [extension] DescriptorProto extension
|
17795 | * @property {Array.<google.protobuf.IDescriptorProto>|null} [nestedType] DescriptorProto nestedType
|
17796 | * @property {Array.<google.protobuf.IEnumDescriptorProto>|null} [enumType] DescriptorProto enumType
|
17797 | * @property {Array.<google.protobuf.DescriptorProto.IExtensionRange>|null} [extensionRange] DescriptorProto extensionRange
|
17798 | * @property {Array.<google.protobuf.IOneofDescriptorProto>|null} [oneofDecl] DescriptorProto oneofDecl
|
17799 | * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options
|
17800 | * @property {Array.<google.protobuf.DescriptorProto.IReservedRange>|null} [reservedRange] DescriptorProto reservedRange
|
17801 | * @property {Array.<string>|null} [reservedName] DescriptorProto reservedName
|
17802 | */
|
17803 |
|
17804 | /**
|
17805 | * Constructs a new DescriptorProto.
|
17806 | * @memberof google.protobuf
|
17807 | * @classdesc Represents a DescriptorProto.
|
17808 | * @implements IDescriptorProto
|
17809 | * @constructor
|
17810 | * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set
|
17811 | */
|
17812 | function DescriptorProto(properties) {
|
17813 | this.field = [];
|
17814 | this.extension = [];
|
17815 | this.nestedType = [];
|
17816 | this.enumType = [];
|
17817 | this.extensionRange = [];
|
17818 | this.oneofDecl = [];
|
17819 | this.reservedRange = [];
|
17820 | this.reservedName = [];
|
17821 | if (properties)
|
17822 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
17823 | if (properties[keys[i]] != null)
|
17824 | this[keys[i]] = properties[keys[i]];
|
17825 | }
|
17826 |
|
17827 | /**
|
17828 | * DescriptorProto name.
|
17829 | * @member {string} name
|
17830 | * @memberof google.protobuf.DescriptorProto
|
17831 | * @instance
|
17832 | */
|
17833 | DescriptorProto.prototype.name = "";
|
17834 |
|
17835 | /**
|
17836 | * DescriptorProto field.
|
17837 | * @member {Array.<google.protobuf.IFieldDescriptorProto>} field
|
17838 | * @memberof google.protobuf.DescriptorProto
|
17839 | * @instance
|
17840 | */
|
17841 | DescriptorProto.prototype.field = $util.emptyArray;
|
17842 |
|
17843 | /**
|
17844 | * DescriptorProto extension.
|
17845 | * @member {Array.<google.protobuf.IFieldDescriptorProto>} extension
|
17846 | * @memberof google.protobuf.DescriptorProto
|
17847 | * @instance
|
17848 | */
|
17849 | DescriptorProto.prototype.extension = $util.emptyArray;
|
17850 |
|
17851 | /**
|
17852 | * DescriptorProto nestedType.
|
17853 | * @member {Array.<google.protobuf.IDescriptorProto>} nestedType
|
17854 | * @memberof google.protobuf.DescriptorProto
|
17855 | * @instance
|
17856 | */
|
17857 | DescriptorProto.prototype.nestedType = $util.emptyArray;
|
17858 |
|
17859 | /**
|
17860 | * DescriptorProto enumType.
|
17861 | * @member {Array.<google.protobuf.IEnumDescriptorProto>} enumType
|
17862 | * @memberof google.protobuf.DescriptorProto
|
17863 | * @instance
|
17864 | */
|
17865 | DescriptorProto.prototype.enumType = $util.emptyArray;
|
17866 |
|
17867 | /**
|
17868 | * DescriptorProto extensionRange.
|
17869 | * @member {Array.<google.protobuf.DescriptorProto.IExtensionRange>} extensionRange
|
17870 | * @memberof google.protobuf.DescriptorProto
|
17871 | * @instance
|
17872 | */
|
17873 | DescriptorProto.prototype.extensionRange = $util.emptyArray;
|
17874 |
|
17875 | /**
|
17876 | * DescriptorProto oneofDecl.
|
17877 | * @member {Array.<google.protobuf.IOneofDescriptorProto>} oneofDecl
|
17878 | * @memberof google.protobuf.DescriptorProto
|
17879 | * @instance
|
17880 | */
|
17881 | DescriptorProto.prototype.oneofDecl = $util.emptyArray;
|
17882 |
|
17883 | /**
|
17884 | * DescriptorProto options.
|
17885 | * @member {google.protobuf.IMessageOptions|null|undefined} options
|
17886 | * @memberof google.protobuf.DescriptorProto
|
17887 | * @instance
|
17888 | */
|
17889 | DescriptorProto.prototype.options = null;
|
17890 |
|
17891 | /**
|
17892 | * DescriptorProto reservedRange.
|
17893 | * @member {Array.<google.protobuf.DescriptorProto.IReservedRange>} reservedRange
|
17894 | * @memberof google.protobuf.DescriptorProto
|
17895 | * @instance
|
17896 | */
|
17897 | DescriptorProto.prototype.reservedRange = $util.emptyArray;
|
17898 |
|
17899 | /**
|
17900 | * DescriptorProto reservedName.
|
17901 | * @member {Array.<string>} reservedName
|
17902 | * @memberof google.protobuf.DescriptorProto
|
17903 | * @instance
|
17904 | */
|
17905 | DescriptorProto.prototype.reservedName = $util.emptyArray;
|
17906 |
|
17907 | /**
|
17908 | * Creates a new DescriptorProto instance using the specified properties.
|
17909 | * @function create
|
17910 | * @memberof google.protobuf.DescriptorProto
|
17911 | * @static
|
17912 | * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set
|
17913 | * @returns {google.protobuf.DescriptorProto} DescriptorProto instance
|
17914 | */
|
17915 | DescriptorProto.create = function create(properties) {
|
17916 | return new DescriptorProto(properties);
|
17917 | };
|
17918 |
|
17919 | /**
|
17920 | * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages.
|
17921 | * @function encode
|
17922 | * @memberof google.protobuf.DescriptorProto
|
17923 | * @static
|
17924 | * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode
|
17925 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
17926 | * @returns {$protobuf.Writer} Writer
|
17927 | */
|
17928 | DescriptorProto.encode = function encode(message, writer) {
|
17929 | if (!writer)
|
17930 | writer = $Writer.create();
|
17931 | if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
17932 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
|
17933 | if (message.field != null && message.field.length)
|
17934 | for (var i = 0; i < message.field.length; ++i)
|
17935 | $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
17936 | if (message.nestedType != null && message.nestedType.length)
|
17937 | for (var i = 0; i < message.nestedType.length; ++i)
|
17938 | $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
|
17939 | if (message.enumType != null && message.enumType.length)
|
17940 | for (var i = 0; i < message.enumType.length; ++i)
|
17941 | $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
|
17942 | if (message.extensionRange != null && message.extensionRange.length)
|
17943 | for (var i = 0; i < message.extensionRange.length; ++i)
|
17944 | $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
|
17945 | if (message.extension != null && message.extension.length)
|
17946 | for (var i = 0; i < message.extension.length; ++i)
|
17947 | $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
|
17948 | if (message.options != null && Object.hasOwnProperty.call(message, "options"))
|
17949 | $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();
|
17950 | if (message.oneofDecl != null && message.oneofDecl.length)
|
17951 | for (var i = 0; i < message.oneofDecl.length; ++i)
|
17952 | $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();
|
17953 | if (message.reservedRange != null && message.reservedRange.length)
|
17954 | for (var i = 0; i < message.reservedRange.length; ++i)
|
17955 | $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim();
|
17956 | if (message.reservedName != null && message.reservedName.length)
|
17957 | for (var i = 0; i < message.reservedName.length; ++i)
|
17958 | writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]);
|
17959 | return writer;
|
17960 | };
|
17961 |
|
17962 | /**
|
17963 | * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages.
|
17964 | * @function encodeDelimited
|
17965 | * @memberof google.protobuf.DescriptorProto
|
17966 | * @static
|
17967 | * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode
|
17968 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
17969 | * @returns {$protobuf.Writer} Writer
|
17970 | */
|
17971 | DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) {
|
17972 | return this.encode(message, writer).ldelim();
|
17973 | };
|
17974 |
|
17975 | /**
|
17976 | * Decodes a DescriptorProto message from the specified reader or buffer.
|
17977 | * @function decode
|
17978 | * @memberof google.protobuf.DescriptorProto
|
17979 | * @static
|
17980 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
17981 | * @param {number} [length] Message length if known beforehand
|
17982 | * @returns {google.protobuf.DescriptorProto} DescriptorProto
|
17983 | * @throws {Error} If the payload is not a reader or valid buffer
|
17984 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
17985 | */
|
17986 | DescriptorProto.decode = function decode(reader, length) {
|
17987 | if (!(reader instanceof $Reader))
|
17988 | reader = $Reader.create(reader);
|
17989 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto();
|
17990 | while (reader.pos < end) {
|
17991 | var tag = reader.uint32();
|
17992 | switch (tag >>> 3) {
|
17993 | case 1:
|
17994 | message.name = reader.string();
|
17995 | break;
|
17996 | case 2:
|
17997 | if (!(message.field && message.field.length))
|
17998 | message.field = [];
|
17999 | message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32()));
|
18000 | break;
|
18001 | case 6:
|
18002 | if (!(message.extension && message.extension.length))
|
18003 | message.extension = [];
|
18004 | message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32()));
|
18005 | break;
|
18006 | case 3:
|
18007 | if (!(message.nestedType && message.nestedType.length))
|
18008 | message.nestedType = [];
|
18009 | message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32()));
|
18010 | break;
|
18011 | case 4:
|
18012 | if (!(message.enumType && message.enumType.length))
|
18013 | message.enumType = [];
|
18014 | message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32()));
|
18015 | break;
|
18016 | case 5:
|
18017 | if (!(message.extensionRange && message.extensionRange.length))
|
18018 | message.extensionRange = [];
|
18019 | message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32()));
|
18020 | break;
|
18021 | case 8:
|
18022 | if (!(message.oneofDecl && message.oneofDecl.length))
|
18023 | message.oneofDecl = [];
|
18024 | message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32()));
|
18025 | break;
|
18026 | case 7:
|
18027 | message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32());
|
18028 | break;
|
18029 | case 9:
|
18030 | if (!(message.reservedRange && message.reservedRange.length))
|
18031 | message.reservedRange = [];
|
18032 | message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32()));
|
18033 | break;
|
18034 | case 10:
|
18035 | if (!(message.reservedName && message.reservedName.length))
|
18036 | message.reservedName = [];
|
18037 | message.reservedName.push(reader.string());
|
18038 | break;
|
18039 | default:
|
18040 | reader.skipType(tag & 7);
|
18041 | break;
|
18042 | }
|
18043 | }
|
18044 | return message;
|
18045 | };
|
18046 |
|
18047 | /**
|
18048 | * Decodes a DescriptorProto message from the specified reader or buffer, length delimited.
|
18049 | * @function decodeDelimited
|
18050 | * @memberof google.protobuf.DescriptorProto
|
18051 | * @static
|
18052 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
18053 | * @returns {google.protobuf.DescriptorProto} DescriptorProto
|
18054 | * @throws {Error} If the payload is not a reader or valid buffer
|
18055 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
18056 | */
|
18057 | DescriptorProto.decodeDelimited = function decodeDelimited(reader) {
|
18058 | if (!(reader instanceof $Reader))
|
18059 | reader = new $Reader(reader);
|
18060 | return this.decode(reader, reader.uint32());
|
18061 | };
|
18062 |
|
18063 | /**
|
18064 | * Verifies a DescriptorProto message.
|
18065 | * @function verify
|
18066 | * @memberof google.protobuf.DescriptorProto
|
18067 | * @static
|
18068 | * @param {Object.<string,*>} message Plain object to verify
|
18069 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
18070 | */
|
18071 | DescriptorProto.verify = function verify(message) {
|
18072 | if (typeof message !== "object" || message === null)
|
18073 | return "object expected";
|
18074 | if (message.name != null && message.hasOwnProperty("name"))
|
18075 | if (!$util.isString(message.name))
|
18076 | return "name: string expected";
|
18077 | if (message.field != null && message.hasOwnProperty("field")) {
|
18078 | if (!Array.isArray(message.field))
|
18079 | return "field: array expected";
|
18080 | for (var i = 0; i < message.field.length; ++i) {
|
18081 | var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]);
|
18082 | if (error)
|
18083 | return "field." + error;
|
18084 | }
|
18085 | }
|
18086 | if (message.extension != null && message.hasOwnProperty("extension")) {
|
18087 | if (!Array.isArray(message.extension))
|
18088 | return "extension: array expected";
|
18089 | for (var i = 0; i < message.extension.length; ++i) {
|
18090 | var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]);
|
18091 | if (error)
|
18092 | return "extension." + error;
|
18093 | }
|
18094 | }
|
18095 | if (message.nestedType != null && message.hasOwnProperty("nestedType")) {
|
18096 | if (!Array.isArray(message.nestedType))
|
18097 | return "nestedType: array expected";
|
18098 | for (var i = 0; i < message.nestedType.length; ++i) {
|
18099 | var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]);
|
18100 | if (error)
|
18101 | return "nestedType." + error;
|
18102 | }
|
18103 | }
|
18104 | if (message.enumType != null && message.hasOwnProperty("enumType")) {
|
18105 | if (!Array.isArray(message.enumType))
|
18106 | return "enumType: array expected";
|
18107 | for (var i = 0; i < message.enumType.length; ++i) {
|
18108 | var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]);
|
18109 | if (error)
|
18110 | return "enumType." + error;
|
18111 | }
|
18112 | }
|
18113 | if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) {
|
18114 | if (!Array.isArray(message.extensionRange))
|
18115 | return "extensionRange: array expected";
|
18116 | for (var i = 0; i < message.extensionRange.length; ++i) {
|
18117 | var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]);
|
18118 | if (error)
|
18119 | return "extensionRange." + error;
|
18120 | }
|
18121 | }
|
18122 | if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) {
|
18123 | if (!Array.isArray(message.oneofDecl))
|
18124 | return "oneofDecl: array expected";
|
18125 | for (var i = 0; i < message.oneofDecl.length; ++i) {
|
18126 | var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]);
|
18127 | if (error)
|
18128 | return "oneofDecl." + error;
|
18129 | }
|
18130 | }
|
18131 | if (message.options != null && message.hasOwnProperty("options")) {
|
18132 | var error = $root.google.protobuf.MessageOptions.verify(message.options);
|
18133 | if (error)
|
18134 | return "options." + error;
|
18135 | }
|
18136 | if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) {
|
18137 | if (!Array.isArray(message.reservedRange))
|
18138 | return "reservedRange: array expected";
|
18139 | for (var i = 0; i < message.reservedRange.length; ++i) {
|
18140 | var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]);
|
18141 | if (error)
|
18142 | return "reservedRange." + error;
|
18143 | }
|
18144 | }
|
18145 | if (message.reservedName != null && message.hasOwnProperty("reservedName")) {
|
18146 | if (!Array.isArray(message.reservedName))
|
18147 | return "reservedName: array expected";
|
18148 | for (var i = 0; i < message.reservedName.length; ++i)
|
18149 | if (!$util.isString(message.reservedName[i]))
|
18150 | return "reservedName: string[] expected";
|
18151 | }
|
18152 | return null;
|
18153 | };
|
18154 |
|
18155 | /**
|
18156 | * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types.
|
18157 | * @function fromObject
|
18158 | * @memberof google.protobuf.DescriptorProto
|
18159 | * @static
|
18160 | * @param {Object.<string,*>} object Plain object
|
18161 | * @returns {google.protobuf.DescriptorProto} DescriptorProto
|
18162 | */
|
18163 | DescriptorProto.fromObject = function fromObject(object) {
|
18164 | if (object instanceof $root.google.protobuf.DescriptorProto)
|
18165 | return object;
|
18166 | var message = new $root.google.protobuf.DescriptorProto();
|
18167 | if (object.name != null)
|
18168 | message.name = String(object.name);
|
18169 | if (object.field) {
|
18170 | if (!Array.isArray(object.field))
|
18171 | throw TypeError(".google.protobuf.DescriptorProto.field: array expected");
|
18172 | message.field = [];
|
18173 | for (var i = 0; i < object.field.length; ++i) {
|
18174 | if (typeof object.field[i] !== "object")
|
18175 | throw TypeError(".google.protobuf.DescriptorProto.field: object expected");
|
18176 | message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]);
|
18177 | }
|
18178 | }
|
18179 | if (object.extension) {
|
18180 | if (!Array.isArray(object.extension))
|
18181 | throw TypeError(".google.protobuf.DescriptorProto.extension: array expected");
|
18182 | message.extension = [];
|
18183 | for (var i = 0; i < object.extension.length; ++i) {
|
18184 | if (typeof object.extension[i] !== "object")
|
18185 | throw TypeError(".google.protobuf.DescriptorProto.extension: object expected");
|
18186 | message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]);
|
18187 | }
|
18188 | }
|
18189 | if (object.nestedType) {
|
18190 | if (!Array.isArray(object.nestedType))
|
18191 | throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected");
|
18192 | message.nestedType = [];
|
18193 | for (var i = 0; i < object.nestedType.length; ++i) {
|
18194 | if (typeof object.nestedType[i] !== "object")
|
18195 | throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected");
|
18196 | message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]);
|
18197 | }
|
18198 | }
|
18199 | if (object.enumType) {
|
18200 | if (!Array.isArray(object.enumType))
|
18201 | throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected");
|
18202 | message.enumType = [];
|
18203 | for (var i = 0; i < object.enumType.length; ++i) {
|
18204 | if (typeof object.enumType[i] !== "object")
|
18205 | throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected");
|
18206 | message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]);
|
18207 | }
|
18208 | }
|
18209 | if (object.extensionRange) {
|
18210 | if (!Array.isArray(object.extensionRange))
|
18211 | throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected");
|
18212 | message.extensionRange = [];
|
18213 | for (var i = 0; i < object.extensionRange.length; ++i) {
|
18214 | if (typeof object.extensionRange[i] !== "object")
|
18215 | throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected");
|
18216 | message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]);
|
18217 | }
|
18218 | }
|
18219 | if (object.oneofDecl) {
|
18220 | if (!Array.isArray(object.oneofDecl))
|
18221 | throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected");
|
18222 | message.oneofDecl = [];
|
18223 | for (var i = 0; i < object.oneofDecl.length; ++i) {
|
18224 | if (typeof object.oneofDecl[i] !== "object")
|
18225 | throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected");
|
18226 | message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]);
|
18227 | }
|
18228 | }
|
18229 | if (object.options != null) {
|
18230 | if (typeof object.options !== "object")
|
18231 | throw TypeError(".google.protobuf.DescriptorProto.options: object expected");
|
18232 | message.options = $root.google.protobuf.MessageOptions.fromObject(object.options);
|
18233 | }
|
18234 | if (object.reservedRange) {
|
18235 | if (!Array.isArray(object.reservedRange))
|
18236 | throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected");
|
18237 | message.reservedRange = [];
|
18238 | for (var i = 0; i < object.reservedRange.length; ++i) {
|
18239 | if (typeof object.reservedRange[i] !== "object")
|
18240 | throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected");
|
18241 | message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]);
|
18242 | }
|
18243 | }
|
18244 | if (object.reservedName) {
|
18245 | if (!Array.isArray(object.reservedName))
|
18246 | throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected");
|
18247 | message.reservedName = [];
|
18248 | for (var i = 0; i < object.reservedName.length; ++i)
|
18249 | message.reservedName[i] = String(object.reservedName[i]);
|
18250 | }
|
18251 | return message;
|
18252 | };
|
18253 |
|
18254 | /**
|
18255 | * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified.
|
18256 | * @function toObject
|
18257 | * @memberof google.protobuf.DescriptorProto
|
18258 | * @static
|
18259 | * @param {google.protobuf.DescriptorProto} message DescriptorProto
|
18260 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
18261 | * @returns {Object.<string,*>} Plain object
|
18262 | */
|
18263 | DescriptorProto.toObject = function toObject(message, options) {
|
18264 | if (!options)
|
18265 | options = {};
|
18266 | var object = {};
|
18267 | if (options.arrays || options.defaults) {
|
18268 | object.field = [];
|
18269 | object.nestedType = [];
|
18270 | object.enumType = [];
|
18271 | object.extensionRange = [];
|
18272 | object.extension = [];
|
18273 | object.oneofDecl = [];
|
18274 | object.reservedRange = [];
|
18275 | object.reservedName = [];
|
18276 | }
|
18277 | if (options.defaults) {
|
18278 | object.name = "";
|
18279 | object.options = null;
|
18280 | }
|
18281 | if (message.name != null && message.hasOwnProperty("name"))
|
18282 | object.name = message.name;
|
18283 | if (message.field && message.field.length) {
|
18284 | object.field = [];
|
18285 | for (var j = 0; j < message.field.length; ++j)
|
18286 | object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options);
|
18287 | }
|
18288 | if (message.nestedType && message.nestedType.length) {
|
18289 | object.nestedType = [];
|
18290 | for (var j = 0; j < message.nestedType.length; ++j)
|
18291 | object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options);
|
18292 | }
|
18293 | if (message.enumType && message.enumType.length) {
|
18294 | object.enumType = [];
|
18295 | for (var j = 0; j < message.enumType.length; ++j)
|
18296 | object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options);
|
18297 | }
|
18298 | if (message.extensionRange && message.extensionRange.length) {
|
18299 | object.extensionRange = [];
|
18300 | for (var j = 0; j < message.extensionRange.length; ++j)
|
18301 | object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options);
|
18302 | }
|
18303 | if (message.extension && message.extension.length) {
|
18304 | object.extension = [];
|
18305 | for (var j = 0; j < message.extension.length; ++j)
|
18306 | object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options);
|
18307 | }
|
18308 | if (message.options != null && message.hasOwnProperty("options"))
|
18309 | object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options);
|
18310 | if (message.oneofDecl && message.oneofDecl.length) {
|
18311 | object.oneofDecl = [];
|
18312 | for (var j = 0; j < message.oneofDecl.length; ++j)
|
18313 | object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options);
|
18314 | }
|
18315 | if (message.reservedRange && message.reservedRange.length) {
|
18316 | object.reservedRange = [];
|
18317 | for (var j = 0; j < message.reservedRange.length; ++j)
|
18318 | object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options);
|
18319 | }
|
18320 | if (message.reservedName && message.reservedName.length) {
|
18321 | object.reservedName = [];
|
18322 | for (var j = 0; j < message.reservedName.length; ++j)
|
18323 | object.reservedName[j] = message.reservedName[j];
|
18324 | }
|
18325 | return object;
|
18326 | };
|
18327 |
|
18328 | /**
|
18329 | * Converts this DescriptorProto to JSON.
|
18330 | * @function toJSON
|
18331 | * @memberof google.protobuf.DescriptorProto
|
18332 | * @instance
|
18333 | * @returns {Object.<string,*>} JSON object
|
18334 | */
|
18335 | DescriptorProto.prototype.toJSON = function toJSON() {
|
18336 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
18337 | };
|
18338 |
|
18339 | DescriptorProto.ExtensionRange = (function() {
|
18340 |
|
18341 | /**
|
18342 | * Properties of an ExtensionRange.
|
18343 | * @memberof google.protobuf.DescriptorProto
|
18344 | * @interface IExtensionRange
|
18345 | * @property {number|null} [start] ExtensionRange start
|
18346 | * @property {number|null} [end] ExtensionRange end
|
18347 | * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options
|
18348 | */
|
18349 |
|
18350 | /**
|
18351 | * Constructs a new ExtensionRange.
|
18352 | * @memberof google.protobuf.DescriptorProto
|
18353 | * @classdesc Represents an ExtensionRange.
|
18354 | * @implements IExtensionRange
|
18355 | * @constructor
|
18356 | * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set
|
18357 | */
|
18358 | function ExtensionRange(properties) {
|
18359 | if (properties)
|
18360 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
18361 | if (properties[keys[i]] != null)
|
18362 | this[keys[i]] = properties[keys[i]];
|
18363 | }
|
18364 |
|
18365 | /**
|
18366 | * ExtensionRange start.
|
18367 | * @member {number} start
|
18368 | * @memberof google.protobuf.DescriptorProto.ExtensionRange
|
18369 | * @instance
|
18370 | */
|
18371 | ExtensionRange.prototype.start = 0;
|
18372 |
|
18373 | /**
|
18374 | * ExtensionRange end.
|
18375 | * @member {number} end
|
18376 | * @memberof google.protobuf.DescriptorProto.ExtensionRange
|
18377 | * @instance
|
18378 | */
|
18379 | ExtensionRange.prototype.end = 0;
|
18380 |
|
18381 | /**
|
18382 | * ExtensionRange options.
|
18383 | * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options
|
18384 | * @memberof google.protobuf.DescriptorProto.ExtensionRange
|
18385 | * @instance
|
18386 | */
|
18387 | ExtensionRange.prototype.options = null;
|
18388 |
|
18389 | /**
|
18390 | * Creates a new ExtensionRange instance using the specified properties.
|
18391 | * @function create
|
18392 | * @memberof google.protobuf.DescriptorProto.ExtensionRange
|
18393 | * @static
|
18394 | * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set
|
18395 | * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance
|
18396 | */
|
18397 | ExtensionRange.create = function create(properties) {
|
18398 | return new ExtensionRange(properties);
|
18399 | };
|
18400 |
|
18401 | /**
|
18402 | * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages.
|
18403 | * @function encode
|
18404 | * @memberof google.protobuf.DescriptorProto.ExtensionRange
|
18405 | * @static
|
18406 | * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode
|
18407 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
18408 | * @returns {$protobuf.Writer} Writer
|
18409 | */
|
18410 | ExtensionRange.encode = function encode(message, writer) {
|
18411 | if (!writer)
|
18412 | writer = $Writer.create();
|
18413 | if (message.start != null && Object.hasOwnProperty.call(message, "start"))
|
18414 | writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start);
|
18415 | if (message.end != null && Object.hasOwnProperty.call(message, "end"))
|
18416 | writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end);
|
18417 | if (message.options != null && Object.hasOwnProperty.call(message, "options"))
|
18418 | $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
|
18419 | return writer;
|
18420 | };
|
18421 |
|
18422 | /**
|
18423 | * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages.
|
18424 | * @function encodeDelimited
|
18425 | * @memberof google.protobuf.DescriptorProto.ExtensionRange
|
18426 | * @static
|
18427 | * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode
|
18428 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
18429 | * @returns {$protobuf.Writer} Writer
|
18430 | */
|
18431 | ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) {
|
18432 | return this.encode(message, writer).ldelim();
|
18433 | };
|
18434 |
|
18435 | /**
|
18436 | * Decodes an ExtensionRange message from the specified reader or buffer.
|
18437 | * @function decode
|
18438 | * @memberof google.protobuf.DescriptorProto.ExtensionRange
|
18439 | * @static
|
18440 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
18441 | * @param {number} [length] Message length if known beforehand
|
18442 | * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange
|
18443 | * @throws {Error} If the payload is not a reader or valid buffer
|
18444 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
18445 | */
|
18446 | ExtensionRange.decode = function decode(reader, length) {
|
18447 | if (!(reader instanceof $Reader))
|
18448 | reader = $Reader.create(reader);
|
18449 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange();
|
18450 | while (reader.pos < end) {
|
18451 | var tag = reader.uint32();
|
18452 | switch (tag >>> 3) {
|
18453 | case 1:
|
18454 | message.start = reader.int32();
|
18455 | break;
|
18456 | case 2:
|
18457 | message.end = reader.int32();
|
18458 | break;
|
18459 | case 3:
|
18460 | message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32());
|
18461 | break;
|
18462 | default:
|
18463 | reader.skipType(tag & 7);
|
18464 | break;
|
18465 | }
|
18466 | }
|
18467 | return message;
|
18468 | };
|
18469 |
|
18470 | /**
|
18471 | * Decodes an ExtensionRange message from the specified reader or buffer, length delimited.
|
18472 | * @function decodeDelimited
|
18473 | * @memberof google.protobuf.DescriptorProto.ExtensionRange
|
18474 | * @static
|
18475 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
18476 | * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange
|
18477 | * @throws {Error} If the payload is not a reader or valid buffer
|
18478 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
18479 | */
|
18480 | ExtensionRange.decodeDelimited = function decodeDelimited(reader) {
|
18481 | if (!(reader instanceof $Reader))
|
18482 | reader = new $Reader(reader);
|
18483 | return this.decode(reader, reader.uint32());
|
18484 | };
|
18485 |
|
18486 | /**
|
18487 | * Verifies an ExtensionRange message.
|
18488 | * @function verify
|
18489 | * @memberof google.protobuf.DescriptorProto.ExtensionRange
|
18490 | * @static
|
18491 | * @param {Object.<string,*>} message Plain object to verify
|
18492 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
18493 | */
|
18494 | ExtensionRange.verify = function verify(message) {
|
18495 | if (typeof message !== "object" || message === null)
|
18496 | return "object expected";
|
18497 | if (message.start != null && message.hasOwnProperty("start"))
|
18498 | if (!$util.isInteger(message.start))
|
18499 | return "start: integer expected";
|
18500 | if (message.end != null && message.hasOwnProperty("end"))
|
18501 | if (!$util.isInteger(message.end))
|
18502 | return "end: integer expected";
|
18503 | if (message.options != null && message.hasOwnProperty("options")) {
|
18504 | var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options);
|
18505 | if (error)
|
18506 | return "options." + error;
|
18507 | }
|
18508 | return null;
|
18509 | };
|
18510 |
|
18511 | /**
|
18512 | * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types.
|
18513 | * @function fromObject
|
18514 | * @memberof google.protobuf.DescriptorProto.ExtensionRange
|
18515 | * @static
|
18516 | * @param {Object.<string,*>} object Plain object
|
18517 | * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange
|
18518 | */
|
18519 | ExtensionRange.fromObject = function fromObject(object) {
|
18520 | if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange)
|
18521 | return object;
|
18522 | var message = new $root.google.protobuf.DescriptorProto.ExtensionRange();
|
18523 | if (object.start != null)
|
18524 | message.start = object.start | 0;
|
18525 | if (object.end != null)
|
18526 | message.end = object.end | 0;
|
18527 | if (object.options != null) {
|
18528 | if (typeof object.options !== "object")
|
18529 | throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected");
|
18530 | message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options);
|
18531 | }
|
18532 | return message;
|
18533 | };
|
18534 |
|
18535 | /**
|
18536 | * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified.
|
18537 | * @function toObject
|
18538 | * @memberof google.protobuf.DescriptorProto.ExtensionRange
|
18539 | * @static
|
18540 | * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange
|
18541 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
18542 | * @returns {Object.<string,*>} Plain object
|
18543 | */
|
18544 | ExtensionRange.toObject = function toObject(message, options) {
|
18545 | if (!options)
|
18546 | options = {};
|
18547 | var object = {};
|
18548 | if (options.defaults) {
|
18549 | object.start = 0;
|
18550 | object.end = 0;
|
18551 | object.options = null;
|
18552 | }
|
18553 | if (message.start != null && message.hasOwnProperty("start"))
|
18554 | object.start = message.start;
|
18555 | if (message.end != null && message.hasOwnProperty("end"))
|
18556 | object.end = message.end;
|
18557 | if (message.options != null && message.hasOwnProperty("options"))
|
18558 | object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options);
|
18559 | return object;
|
18560 | };
|
18561 |
|
18562 | /**
|
18563 | * Converts this ExtensionRange to JSON.
|
18564 | * @function toJSON
|
18565 | * @memberof google.protobuf.DescriptorProto.ExtensionRange
|
18566 | * @instance
|
18567 | * @returns {Object.<string,*>} JSON object
|
18568 | */
|
18569 | ExtensionRange.prototype.toJSON = function toJSON() {
|
18570 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
18571 | };
|
18572 |
|
18573 | return ExtensionRange;
|
18574 | })();
|
18575 |
|
18576 | DescriptorProto.ReservedRange = (function() {
|
18577 |
|
18578 | /**
|
18579 | * Properties of a ReservedRange.
|
18580 | * @memberof google.protobuf.DescriptorProto
|
18581 | * @interface IReservedRange
|
18582 | * @property {number|null} [start] ReservedRange start
|
18583 | * @property {number|null} [end] ReservedRange end
|
18584 | */
|
18585 |
|
18586 | /**
|
18587 | * Constructs a new ReservedRange.
|
18588 | * @memberof google.protobuf.DescriptorProto
|
18589 | * @classdesc Represents a ReservedRange.
|
18590 | * @implements IReservedRange
|
18591 | * @constructor
|
18592 | * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set
|
18593 | */
|
18594 | function ReservedRange(properties) {
|
18595 | if (properties)
|
18596 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
18597 | if (properties[keys[i]] != null)
|
18598 | this[keys[i]] = properties[keys[i]];
|
18599 | }
|
18600 |
|
18601 | /**
|
18602 | * ReservedRange start.
|
18603 | * @member {number} start
|
18604 | * @memberof google.protobuf.DescriptorProto.ReservedRange
|
18605 | * @instance
|
18606 | */
|
18607 | ReservedRange.prototype.start = 0;
|
18608 |
|
18609 | /**
|
18610 | * ReservedRange end.
|
18611 | * @member {number} end
|
18612 | * @memberof google.protobuf.DescriptorProto.ReservedRange
|
18613 | * @instance
|
18614 | */
|
18615 | ReservedRange.prototype.end = 0;
|
18616 |
|
18617 | /**
|
18618 | * Creates a new ReservedRange instance using the specified properties.
|
18619 | * @function create
|
18620 | * @memberof google.protobuf.DescriptorProto.ReservedRange
|
18621 | * @static
|
18622 | * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set
|
18623 | * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance
|
18624 | */
|
18625 | ReservedRange.create = function create(properties) {
|
18626 | return new ReservedRange(properties);
|
18627 | };
|
18628 |
|
18629 | /**
|
18630 | * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages.
|
18631 | * @function encode
|
18632 | * @memberof google.protobuf.DescriptorProto.ReservedRange
|
18633 | * @static
|
18634 | * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode
|
18635 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
18636 | * @returns {$protobuf.Writer} Writer
|
18637 | */
|
18638 | ReservedRange.encode = function encode(message, writer) {
|
18639 | if (!writer)
|
18640 | writer = $Writer.create();
|
18641 | if (message.start != null && Object.hasOwnProperty.call(message, "start"))
|
18642 | writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start);
|
18643 | if (message.end != null && Object.hasOwnProperty.call(message, "end"))
|
18644 | writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end);
|
18645 | return writer;
|
18646 | };
|
18647 |
|
18648 | /**
|
18649 | * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages.
|
18650 | * @function encodeDelimited
|
18651 | * @memberof google.protobuf.DescriptorProto.ReservedRange
|
18652 | * @static
|
18653 | * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode
|
18654 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
18655 | * @returns {$protobuf.Writer} Writer
|
18656 | */
|
18657 | ReservedRange.encodeDelimited = function encodeDelimited(message, writer) {
|
18658 | return this.encode(message, writer).ldelim();
|
18659 | };
|
18660 |
|
18661 | /**
|
18662 | * Decodes a ReservedRange message from the specified reader or buffer.
|
18663 | * @function decode
|
18664 | * @memberof google.protobuf.DescriptorProto.ReservedRange
|
18665 | * @static
|
18666 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
18667 | * @param {number} [length] Message length if known beforehand
|
18668 | * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange
|
18669 | * @throws {Error} If the payload is not a reader or valid buffer
|
18670 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
18671 | */
|
18672 | ReservedRange.decode = function decode(reader, length) {
|
18673 | if (!(reader instanceof $Reader))
|
18674 | reader = $Reader.create(reader);
|
18675 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange();
|
18676 | while (reader.pos < end) {
|
18677 | var tag = reader.uint32();
|
18678 | switch (tag >>> 3) {
|
18679 | case 1:
|
18680 | message.start = reader.int32();
|
18681 | break;
|
18682 | case 2:
|
18683 | message.end = reader.int32();
|
18684 | break;
|
18685 | default:
|
18686 | reader.skipType(tag & 7);
|
18687 | break;
|
18688 | }
|
18689 | }
|
18690 | return message;
|
18691 | };
|
18692 |
|
18693 | /**
|
18694 | * Decodes a ReservedRange message from the specified reader or buffer, length delimited.
|
18695 | * @function decodeDelimited
|
18696 | * @memberof google.protobuf.DescriptorProto.ReservedRange
|
18697 | * @static
|
18698 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
18699 | * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange
|
18700 | * @throws {Error} If the payload is not a reader or valid buffer
|
18701 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
18702 | */
|
18703 | ReservedRange.decodeDelimited = function decodeDelimited(reader) {
|
18704 | if (!(reader instanceof $Reader))
|
18705 | reader = new $Reader(reader);
|
18706 | return this.decode(reader, reader.uint32());
|
18707 | };
|
18708 |
|
18709 | /**
|
18710 | * Verifies a ReservedRange message.
|
18711 | * @function verify
|
18712 | * @memberof google.protobuf.DescriptorProto.ReservedRange
|
18713 | * @static
|
18714 | * @param {Object.<string,*>} message Plain object to verify
|
18715 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
18716 | */
|
18717 | ReservedRange.verify = function verify(message) {
|
18718 | if (typeof message !== "object" || message === null)
|
18719 | return "object expected";
|
18720 | if (message.start != null && message.hasOwnProperty("start"))
|
18721 | if (!$util.isInteger(message.start))
|
18722 | return "start: integer expected";
|
18723 | if (message.end != null && message.hasOwnProperty("end"))
|
18724 | if (!$util.isInteger(message.end))
|
18725 | return "end: integer expected";
|
18726 | return null;
|
18727 | };
|
18728 |
|
18729 | /**
|
18730 | * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types.
|
18731 | * @function fromObject
|
18732 | * @memberof google.protobuf.DescriptorProto.ReservedRange
|
18733 | * @static
|
18734 | * @param {Object.<string,*>} object Plain object
|
18735 | * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange
|
18736 | */
|
18737 | ReservedRange.fromObject = function fromObject(object) {
|
18738 | if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange)
|
18739 | return object;
|
18740 | var message = new $root.google.protobuf.DescriptorProto.ReservedRange();
|
18741 | if (object.start != null)
|
18742 | message.start = object.start | 0;
|
18743 | if (object.end != null)
|
18744 | message.end = object.end | 0;
|
18745 | return message;
|
18746 | };
|
18747 |
|
18748 | /**
|
18749 | * Creates a plain object from a ReservedRange message. Also converts values to other types if specified.
|
18750 | * @function toObject
|
18751 | * @memberof google.protobuf.DescriptorProto.ReservedRange
|
18752 | * @static
|
18753 | * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange
|
18754 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
18755 | * @returns {Object.<string,*>} Plain object
|
18756 | */
|
18757 | ReservedRange.toObject = function toObject(message, options) {
|
18758 | if (!options)
|
18759 | options = {};
|
18760 | var object = {};
|
18761 | if (options.defaults) {
|
18762 | object.start = 0;
|
18763 | object.end = 0;
|
18764 | }
|
18765 | if (message.start != null && message.hasOwnProperty("start"))
|
18766 | object.start = message.start;
|
18767 | if (message.end != null && message.hasOwnProperty("end"))
|
18768 | object.end = message.end;
|
18769 | return object;
|
18770 | };
|
18771 |
|
18772 | /**
|
18773 | * Converts this ReservedRange to JSON.
|
18774 | * @function toJSON
|
18775 | * @memberof google.protobuf.DescriptorProto.ReservedRange
|
18776 | * @instance
|
18777 | * @returns {Object.<string,*>} JSON object
|
18778 | */
|
18779 | ReservedRange.prototype.toJSON = function toJSON() {
|
18780 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
18781 | };
|
18782 |
|
18783 | return ReservedRange;
|
18784 | })();
|
18785 |
|
18786 | return DescriptorProto;
|
18787 | })();
|
18788 |
|
18789 | protobuf.ExtensionRangeOptions = (function() {
|
18790 |
|
18791 | /**
|
18792 | * Properties of an ExtensionRangeOptions.
|
18793 | * @memberof google.protobuf
|
18794 | * @interface IExtensionRangeOptions
|
18795 | * @property {Array.<google.protobuf.IUninterpretedOption>|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption
|
18796 | */
|
18797 |
|
18798 | /**
|
18799 | * Constructs a new ExtensionRangeOptions.
|
18800 | * @memberof google.protobuf
|
18801 | * @classdesc Represents an ExtensionRangeOptions.
|
18802 | * @implements IExtensionRangeOptions
|
18803 | * @constructor
|
18804 | * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set
|
18805 | */
|
18806 | function ExtensionRangeOptions(properties) {
|
18807 | this.uninterpretedOption = [];
|
18808 | if (properties)
|
18809 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
18810 | if (properties[keys[i]] != null)
|
18811 | this[keys[i]] = properties[keys[i]];
|
18812 | }
|
18813 |
|
18814 | /**
|
18815 | * ExtensionRangeOptions uninterpretedOption.
|
18816 | * @member {Array.<google.protobuf.IUninterpretedOption>} uninterpretedOption
|
18817 | * @memberof google.protobuf.ExtensionRangeOptions
|
18818 | * @instance
|
18819 | */
|
18820 | ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray;
|
18821 |
|
18822 | /**
|
18823 | * Creates a new ExtensionRangeOptions instance using the specified properties.
|
18824 | * @function create
|
18825 | * @memberof google.protobuf.ExtensionRangeOptions
|
18826 | * @static
|
18827 | * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set
|
18828 | * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance
|
18829 | */
|
18830 | ExtensionRangeOptions.create = function create(properties) {
|
18831 | return new ExtensionRangeOptions(properties);
|
18832 | };
|
18833 |
|
18834 | /**
|
18835 | * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages.
|
18836 | * @function encode
|
18837 | * @memberof google.protobuf.ExtensionRangeOptions
|
18838 | * @static
|
18839 | * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode
|
18840 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
18841 | * @returns {$protobuf.Writer} Writer
|
18842 | */
|
18843 | ExtensionRangeOptions.encode = function encode(message, writer) {
|
18844 | if (!writer)
|
18845 | writer = $Writer.create();
|
18846 | if (message.uninterpretedOption != null && message.uninterpretedOption.length)
|
18847 | for (var i = 0; i < message.uninterpretedOption.length; ++i)
|
18848 | $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim();
|
18849 | return writer;
|
18850 | };
|
18851 |
|
18852 | /**
|
18853 | * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages.
|
18854 | * @function encodeDelimited
|
18855 | * @memberof google.protobuf.ExtensionRangeOptions
|
18856 | * @static
|
18857 | * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode
|
18858 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
18859 | * @returns {$protobuf.Writer} Writer
|
18860 | */
|
18861 | ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) {
|
18862 | return this.encode(message, writer).ldelim();
|
18863 | };
|
18864 |
|
18865 | /**
|
18866 | * Decodes an ExtensionRangeOptions message from the specified reader or buffer.
|
18867 | * @function decode
|
18868 | * @memberof google.protobuf.ExtensionRangeOptions
|
18869 | * @static
|
18870 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
18871 | * @param {number} [length] Message length if known beforehand
|
18872 | * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions
|
18873 | * @throws {Error} If the payload is not a reader or valid buffer
|
18874 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
18875 | */
|
18876 | ExtensionRangeOptions.decode = function decode(reader, length) {
|
18877 | if (!(reader instanceof $Reader))
|
18878 | reader = $Reader.create(reader);
|
18879 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions();
|
18880 | while (reader.pos < end) {
|
18881 | var tag = reader.uint32();
|
18882 | switch (tag >>> 3) {
|
18883 | case 999:
|
18884 | if (!(message.uninterpretedOption && message.uninterpretedOption.length))
|
18885 | message.uninterpretedOption = [];
|
18886 | message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32()));
|
18887 | break;
|
18888 | default:
|
18889 | reader.skipType(tag & 7);
|
18890 | break;
|
18891 | }
|
18892 | }
|
18893 | return message;
|
18894 | };
|
18895 |
|
18896 | /**
|
18897 | * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited.
|
18898 | * @function decodeDelimited
|
18899 | * @memberof google.protobuf.ExtensionRangeOptions
|
18900 | * @static
|
18901 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
18902 | * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions
|
18903 | * @throws {Error} If the payload is not a reader or valid buffer
|
18904 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
18905 | */
|
18906 | ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) {
|
18907 | if (!(reader instanceof $Reader))
|
18908 | reader = new $Reader(reader);
|
18909 | return this.decode(reader, reader.uint32());
|
18910 | };
|
18911 |
|
18912 | /**
|
18913 | * Verifies an ExtensionRangeOptions message.
|
18914 | * @function verify
|
18915 | * @memberof google.protobuf.ExtensionRangeOptions
|
18916 | * @static
|
18917 | * @param {Object.<string,*>} message Plain object to verify
|
18918 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
18919 | */
|
18920 | ExtensionRangeOptions.verify = function verify(message) {
|
18921 | if (typeof message !== "object" || message === null)
|
18922 | return "object expected";
|
18923 | if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) {
|
18924 | if (!Array.isArray(message.uninterpretedOption))
|
18925 | return "uninterpretedOption: array expected";
|
18926 | for (var i = 0; i < message.uninterpretedOption.length; ++i) {
|
18927 | var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]);
|
18928 | if (error)
|
18929 | return "uninterpretedOption." + error;
|
18930 | }
|
18931 | }
|
18932 | return null;
|
18933 | };
|
18934 |
|
18935 | /**
|
18936 | * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types.
|
18937 | * @function fromObject
|
18938 | * @memberof google.protobuf.ExtensionRangeOptions
|
18939 | * @static
|
18940 | * @param {Object.<string,*>} object Plain object
|
18941 | * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions
|
18942 | */
|
18943 | ExtensionRangeOptions.fromObject = function fromObject(object) {
|
18944 | if (object instanceof $root.google.protobuf.ExtensionRangeOptions)
|
18945 | return object;
|
18946 | var message = new $root.google.protobuf.ExtensionRangeOptions();
|
18947 | if (object.uninterpretedOption) {
|
18948 | if (!Array.isArray(object.uninterpretedOption))
|
18949 | throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected");
|
18950 | message.uninterpretedOption = [];
|
18951 | for (var i = 0; i < object.uninterpretedOption.length; ++i) {
|
18952 | if (typeof object.uninterpretedOption[i] !== "object")
|
18953 | throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected");
|
18954 | message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]);
|
18955 | }
|
18956 | }
|
18957 | return message;
|
18958 | };
|
18959 |
|
18960 | /**
|
18961 | * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified.
|
18962 | * @function toObject
|
18963 | * @memberof google.protobuf.ExtensionRangeOptions
|
18964 | * @static
|
18965 | * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions
|
18966 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
18967 | * @returns {Object.<string,*>} Plain object
|
18968 | */
|
18969 | ExtensionRangeOptions.toObject = function toObject(message, options) {
|
18970 | if (!options)
|
18971 | options = {};
|
18972 | var object = {};
|
18973 | if (options.arrays || options.defaults)
|
18974 | object.uninterpretedOption = [];
|
18975 | if (message.uninterpretedOption && message.uninterpretedOption.length) {
|
18976 | object.uninterpretedOption = [];
|
18977 | for (var j = 0; j < message.uninterpretedOption.length; ++j)
|
18978 | object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options);
|
18979 | }
|
18980 | return object;
|
18981 | };
|
18982 |
|
18983 | /**
|
18984 | * Converts this ExtensionRangeOptions to JSON.
|
18985 | * @function toJSON
|
18986 | * @memberof google.protobuf.ExtensionRangeOptions
|
18987 | * @instance
|
18988 | * @returns {Object.<string,*>} JSON object
|
18989 | */
|
18990 | ExtensionRangeOptions.prototype.toJSON = function toJSON() {
|
18991 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
18992 | };
|
18993 |
|
18994 | return ExtensionRangeOptions;
|
18995 | })();
|
18996 |
|
18997 | protobuf.FieldDescriptorProto = (function() {
|
18998 |
|
18999 | /**
|
19000 | * Properties of a FieldDescriptorProto.
|
19001 | * @memberof google.protobuf
|
19002 | * @interface IFieldDescriptorProto
|
19003 | * @property {string|null} [name] FieldDescriptorProto name
|
19004 | * @property {number|null} [number] FieldDescriptorProto number
|
19005 | * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label
|
19006 | * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type
|
19007 | * @property {string|null} [typeName] FieldDescriptorProto typeName
|
19008 | * @property {string|null} [extendee] FieldDescriptorProto extendee
|
19009 | * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue
|
19010 | * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex
|
19011 | * @property {string|null} [jsonName] FieldDescriptorProto jsonName
|
19012 | * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options
|
19013 | * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional
|
19014 | */
|
19015 |
|
19016 | /**
|
19017 | * Constructs a new FieldDescriptorProto.
|
19018 | * @memberof google.protobuf
|
19019 | * @classdesc Represents a FieldDescriptorProto.
|
19020 | * @implements IFieldDescriptorProto
|
19021 | * @constructor
|
19022 | * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set
|
19023 | */
|
19024 | function FieldDescriptorProto(properties) {
|
19025 | if (properties)
|
19026 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
19027 | if (properties[keys[i]] != null)
|
19028 | this[keys[i]] = properties[keys[i]];
|
19029 | }
|
19030 |
|
19031 | /**
|
19032 | * FieldDescriptorProto name.
|
19033 | * @member {string} name
|
19034 | * @memberof google.protobuf.FieldDescriptorProto
|
19035 | * @instance
|
19036 | */
|
19037 | FieldDescriptorProto.prototype.name = "";
|
19038 |
|
19039 | /**
|
19040 | * FieldDescriptorProto number.
|
19041 | * @member {number} number
|
19042 | * @memberof google.protobuf.FieldDescriptorProto
|
19043 | * @instance
|
19044 | */
|
19045 | FieldDescriptorProto.prototype.number = 0;
|
19046 |
|
19047 | /**
|
19048 | * FieldDescriptorProto label.
|
19049 | * @member {google.protobuf.FieldDescriptorProto.Label} label
|
19050 | * @memberof google.protobuf.FieldDescriptorProto
|
19051 | * @instance
|
19052 | */
|
19053 | FieldDescriptorProto.prototype.label = 1;
|
19054 |
|
19055 | /**
|
19056 | * FieldDescriptorProto type.
|
19057 | * @member {google.protobuf.FieldDescriptorProto.Type} type
|
19058 | * @memberof google.protobuf.FieldDescriptorProto
|
19059 | * @instance
|
19060 | */
|
19061 | FieldDescriptorProto.prototype.type = 1;
|
19062 |
|
19063 | /**
|
19064 | * FieldDescriptorProto typeName.
|
19065 | * @member {string} typeName
|
19066 | * @memberof google.protobuf.FieldDescriptorProto
|
19067 | * @instance
|
19068 | */
|
19069 | FieldDescriptorProto.prototype.typeName = "";
|
19070 |
|
19071 | /**
|
19072 | * FieldDescriptorProto extendee.
|
19073 | * @member {string} extendee
|
19074 | * @memberof google.protobuf.FieldDescriptorProto
|
19075 | * @instance
|
19076 | */
|
19077 | FieldDescriptorProto.prototype.extendee = "";
|
19078 |
|
19079 | /**
|
19080 | * FieldDescriptorProto defaultValue.
|
19081 | * @member {string} defaultValue
|
19082 | * @memberof google.protobuf.FieldDescriptorProto
|
19083 | * @instance
|
19084 | */
|
19085 | FieldDescriptorProto.prototype.defaultValue = "";
|
19086 |
|
19087 | /**
|
19088 | * FieldDescriptorProto oneofIndex.
|
19089 | * @member {number} oneofIndex
|
19090 | * @memberof google.protobuf.FieldDescriptorProto
|
19091 | * @instance
|
19092 | */
|
19093 | FieldDescriptorProto.prototype.oneofIndex = 0;
|
19094 |
|
19095 | /**
|
19096 | * FieldDescriptorProto jsonName.
|
19097 | * @member {string} jsonName
|
19098 | * @memberof google.protobuf.FieldDescriptorProto
|
19099 | * @instance
|
19100 | */
|
19101 | FieldDescriptorProto.prototype.jsonName = "";
|
19102 |
|
19103 | /**
|
19104 | * FieldDescriptorProto options.
|
19105 | * @member {google.protobuf.IFieldOptions|null|undefined} options
|
19106 | * @memberof google.protobuf.FieldDescriptorProto
|
19107 | * @instance
|
19108 | */
|
19109 | FieldDescriptorProto.prototype.options = null;
|
19110 |
|
19111 | /**
|
19112 | * FieldDescriptorProto proto3Optional.
|
19113 | * @member {boolean} proto3Optional
|
19114 | * @memberof google.protobuf.FieldDescriptorProto
|
19115 | * @instance
|
19116 | */
|
19117 | FieldDescriptorProto.prototype.proto3Optional = false;
|
19118 |
|
19119 | /**
|
19120 | * Creates a new FieldDescriptorProto instance using the specified properties.
|
19121 | * @function create
|
19122 | * @memberof google.protobuf.FieldDescriptorProto
|
19123 | * @static
|
19124 | * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set
|
19125 | * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance
|
19126 | */
|
19127 | FieldDescriptorProto.create = function create(properties) {
|
19128 | return new FieldDescriptorProto(properties);
|
19129 | };
|
19130 |
|
19131 | /**
|
19132 | * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages.
|
19133 | * @function encode
|
19134 | * @memberof google.protobuf.FieldDescriptorProto
|
19135 | * @static
|
19136 | * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode
|
19137 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
19138 | * @returns {$protobuf.Writer} Writer
|
19139 | */
|
19140 | FieldDescriptorProto.encode = function encode(message, writer) {
|
19141 | if (!writer)
|
19142 | writer = $Writer.create();
|
19143 | if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
19144 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
|
19145 | if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee"))
|
19146 | writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee);
|
19147 | if (message.number != null && Object.hasOwnProperty.call(message, "number"))
|
19148 | writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number);
|
19149 | if (message.label != null && Object.hasOwnProperty.call(message, "label"))
|
19150 | writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label);
|
19151 | if (message.type != null && Object.hasOwnProperty.call(message, "type"))
|
19152 | writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type);
|
19153 | if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName"))
|
19154 | writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName);
|
19155 | if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue"))
|
19156 | writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue);
|
19157 | if (message.options != null && Object.hasOwnProperty.call(message, "options"))
|
19158 | $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();
|
19159 | if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex"))
|
19160 | writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex);
|
19161 | if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName"))
|
19162 | writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName);
|
19163 | if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional"))
|
19164 | writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional);
|
19165 | return writer;
|
19166 | };
|
19167 |
|
19168 | /**
|
19169 | * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages.
|
19170 | * @function encodeDelimited
|
19171 | * @memberof google.protobuf.FieldDescriptorProto
|
19172 | * @static
|
19173 | * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode
|
19174 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
19175 | * @returns {$protobuf.Writer} Writer
|
19176 | */
|
19177 | FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) {
|
19178 | return this.encode(message, writer).ldelim();
|
19179 | };
|
19180 |
|
19181 | /**
|
19182 | * Decodes a FieldDescriptorProto message from the specified reader or buffer.
|
19183 | * @function decode
|
19184 | * @memberof google.protobuf.FieldDescriptorProto
|
19185 | * @static
|
19186 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
19187 | * @param {number} [length] Message length if known beforehand
|
19188 | * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto
|
19189 | * @throws {Error} If the payload is not a reader or valid buffer
|
19190 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
19191 | */
|
19192 | FieldDescriptorProto.decode = function decode(reader, length) {
|
19193 | if (!(reader instanceof $Reader))
|
19194 | reader = $Reader.create(reader);
|
19195 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto();
|
19196 | while (reader.pos < end) {
|
19197 | var tag = reader.uint32();
|
19198 | switch (tag >>> 3) {
|
19199 | case 1:
|
19200 | message.name = reader.string();
|
19201 | break;
|
19202 | case 3:
|
19203 | message.number = reader.int32();
|
19204 | break;
|
19205 | case 4:
|
19206 | message.label = reader.int32();
|
19207 | break;
|
19208 | case 5:
|
19209 | message.type = reader.int32();
|
19210 | break;
|
19211 | case 6:
|
19212 | message.typeName = reader.string();
|
19213 | break;
|
19214 | case 2:
|
19215 | message.extendee = reader.string();
|
19216 | break;
|
19217 | case 7:
|
19218 | message.defaultValue = reader.string();
|
19219 | break;
|
19220 | case 9:
|
19221 | message.oneofIndex = reader.int32();
|
19222 | break;
|
19223 | case 10:
|
19224 | message.jsonName = reader.string();
|
19225 | break;
|
19226 | case 8:
|
19227 | message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32());
|
19228 | break;
|
19229 | case 17:
|
19230 | message.proto3Optional = reader.bool();
|
19231 | break;
|
19232 | default:
|
19233 | reader.skipType(tag & 7);
|
19234 | break;
|
19235 | }
|
19236 | }
|
19237 | return message;
|
19238 | };
|
19239 |
|
19240 | /**
|
19241 | * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited.
|
19242 | * @function decodeDelimited
|
19243 | * @memberof google.protobuf.FieldDescriptorProto
|
19244 | * @static
|
19245 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
19246 | * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto
|
19247 | * @throws {Error} If the payload is not a reader or valid buffer
|
19248 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
19249 | */
|
19250 | FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) {
|
19251 | if (!(reader instanceof $Reader))
|
19252 | reader = new $Reader(reader);
|
19253 | return this.decode(reader, reader.uint32());
|
19254 | };
|
19255 |
|
19256 | /**
|
19257 | * Verifies a FieldDescriptorProto message.
|
19258 | * @function verify
|
19259 | * @memberof google.protobuf.FieldDescriptorProto
|
19260 | * @static
|
19261 | * @param {Object.<string,*>} message Plain object to verify
|
19262 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
19263 | */
|
19264 | FieldDescriptorProto.verify = function verify(message) {
|
19265 | if (typeof message !== "object" || message === null)
|
19266 | return "object expected";
|
19267 | if (message.name != null && message.hasOwnProperty("name"))
|
19268 | if (!$util.isString(message.name))
|
19269 | return "name: string expected";
|
19270 | if (message.number != null && message.hasOwnProperty("number"))
|
19271 | if (!$util.isInteger(message.number))
|
19272 | return "number: integer expected";
|
19273 | if (message.label != null && message.hasOwnProperty("label"))
|
19274 | switch (message.label) {
|
19275 | default:
|
19276 | return "label: enum value expected";
|
19277 | case 1:
|
19278 | case 2:
|
19279 | case 3:
|
19280 | break;
|
19281 | }
|
19282 | if (message.type != null && message.hasOwnProperty("type"))
|
19283 | switch (message.type) {
|
19284 | default:
|
19285 | return "type: enum value expected";
|
19286 | case 1:
|
19287 | case 2:
|
19288 | case 3:
|
19289 | case 4:
|
19290 | case 5:
|
19291 | case 6:
|
19292 | case 7:
|
19293 | case 8:
|
19294 | case 9:
|
19295 | case 10:
|
19296 | case 11:
|
19297 | case 12:
|
19298 | case 13:
|
19299 | case 14:
|
19300 | case 15:
|
19301 | case 16:
|
19302 | case 17:
|
19303 | case 18:
|
19304 | break;
|
19305 | }
|
19306 | if (message.typeName != null && message.hasOwnProperty("typeName"))
|
19307 | if (!$util.isString(message.typeName))
|
19308 | return "typeName: string expected";
|
19309 | if (message.extendee != null && message.hasOwnProperty("extendee"))
|
19310 | if (!$util.isString(message.extendee))
|
19311 | return "extendee: string expected";
|
19312 | if (message.defaultValue != null && message.hasOwnProperty("defaultValue"))
|
19313 | if (!$util.isString(message.defaultValue))
|
19314 | return "defaultValue: string expected";
|
19315 | if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex"))
|
19316 | if (!$util.isInteger(message.oneofIndex))
|
19317 | return "oneofIndex: integer expected";
|
19318 | if (message.jsonName != null && message.hasOwnProperty("jsonName"))
|
19319 | if (!$util.isString(message.jsonName))
|
19320 | return "jsonName: string expected";
|
19321 | if (message.options != null && message.hasOwnProperty("options")) {
|
19322 | var error = $root.google.protobuf.FieldOptions.verify(message.options);
|
19323 | if (error)
|
19324 | return "options." + error;
|
19325 | }
|
19326 | if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional"))
|
19327 | if (typeof message.proto3Optional !== "boolean")
|
19328 | return "proto3Optional: boolean expected";
|
19329 | return null;
|
19330 | };
|
19331 |
|
19332 | /**
|
19333 | * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types.
|
19334 | * @function fromObject
|
19335 | * @memberof google.protobuf.FieldDescriptorProto
|
19336 | * @static
|
19337 | * @param {Object.<string,*>} object Plain object
|
19338 | * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto
|
19339 | */
|
19340 | FieldDescriptorProto.fromObject = function fromObject(object) {
|
19341 | if (object instanceof $root.google.protobuf.FieldDescriptorProto)
|
19342 | return object;
|
19343 | var message = new $root.google.protobuf.FieldDescriptorProto();
|
19344 | if (object.name != null)
|
19345 | message.name = String(object.name);
|
19346 | if (object.number != null)
|
19347 | message.number = object.number | 0;
|
19348 | switch (object.label) {
|
19349 | case "LABEL_OPTIONAL":
|
19350 | case 1:
|
19351 | message.label = 1;
|
19352 | break;
|
19353 | case "LABEL_REQUIRED":
|
19354 | case 2:
|
19355 | message.label = 2;
|
19356 | break;
|
19357 | case "LABEL_REPEATED":
|
19358 | case 3:
|
19359 | message.label = 3;
|
19360 | break;
|
19361 | }
|
19362 | switch (object.type) {
|
19363 | case "TYPE_DOUBLE":
|
19364 | case 1:
|
19365 | message.type = 1;
|
19366 | break;
|
19367 | case "TYPE_FLOAT":
|
19368 | case 2:
|
19369 | message.type = 2;
|
19370 | break;
|
19371 | case "TYPE_INT64":
|
19372 | case 3:
|
19373 | message.type = 3;
|
19374 | break;
|
19375 | case "TYPE_UINT64":
|
19376 | case 4:
|
19377 | message.type = 4;
|
19378 | break;
|
19379 | case "TYPE_INT32":
|
19380 | case 5:
|
19381 | message.type = 5;
|
19382 | break;
|
19383 | case "TYPE_FIXED64":
|
19384 | case 6:
|
19385 | message.type = 6;
|
19386 | break;
|
19387 | case "TYPE_FIXED32":
|
19388 | case 7:
|
19389 | message.type = 7;
|
19390 | break;
|
19391 | case "TYPE_BOOL":
|
19392 | case 8:
|
19393 | message.type = 8;
|
19394 | break;
|
19395 | case "TYPE_STRING":
|
19396 | case 9:
|
19397 | message.type = 9;
|
19398 | break;
|
19399 | case "TYPE_GROUP":
|
19400 | case 10:
|
19401 | message.type = 10;
|
19402 | break;
|
19403 | case "TYPE_MESSAGE":
|
19404 | case 11:
|
19405 | message.type = 11;
|
19406 | break;
|
19407 | case "TYPE_BYTES":
|
19408 | case 12:
|
19409 | message.type = 12;
|
19410 | break;
|
19411 | case "TYPE_UINT32":
|
19412 | case 13:
|
19413 | message.type = 13;
|
19414 | break;
|
19415 | case "TYPE_ENUM":
|
19416 | case 14:
|
19417 | message.type = 14;
|
19418 | break;
|
19419 | case "TYPE_SFIXED32":
|
19420 | case 15:
|
19421 | message.type = 15;
|
19422 | break;
|
19423 | case "TYPE_SFIXED64":
|
19424 | case 16:
|
19425 | message.type = 16;
|
19426 | break;
|
19427 | case "TYPE_SINT32":
|
19428 | case 17:
|
19429 | message.type = 17;
|
19430 | break;
|
19431 | case "TYPE_SINT64":
|
19432 | case 18:
|
19433 | message.type = 18;
|
19434 | break;
|
19435 | }
|
19436 | if (object.typeName != null)
|
19437 | message.typeName = String(object.typeName);
|
19438 | if (object.extendee != null)
|
19439 | message.extendee = String(object.extendee);
|
19440 | if (object.defaultValue != null)
|
19441 | message.defaultValue = String(object.defaultValue);
|
19442 | if (object.oneofIndex != null)
|
19443 | message.oneofIndex = object.oneofIndex | 0;
|
19444 | if (object.jsonName != null)
|
19445 | message.jsonName = String(object.jsonName);
|
19446 | if (object.options != null) {
|
19447 | if (typeof object.options !== "object")
|
19448 | throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected");
|
19449 | message.options = $root.google.protobuf.FieldOptions.fromObject(object.options);
|
19450 | }
|
19451 | if (object.proto3Optional != null)
|
19452 | message.proto3Optional = Boolean(object.proto3Optional);
|
19453 | return message;
|
19454 | };
|
19455 |
|
19456 | /**
|
19457 | * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified.
|
19458 | * @function toObject
|
19459 | * @memberof google.protobuf.FieldDescriptorProto
|
19460 | * @static
|
19461 | * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto
|
19462 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
19463 | * @returns {Object.<string,*>} Plain object
|
19464 | */
|
19465 | FieldDescriptorProto.toObject = function toObject(message, options) {
|
19466 | if (!options)
|
19467 | options = {};
|
19468 | var object = {};
|
19469 | if (options.defaults) {
|
19470 | object.name = "";
|
19471 | object.extendee = "";
|
19472 | object.number = 0;
|
19473 | object.label = options.enums === String ? "LABEL_OPTIONAL" : 1;
|
19474 | object.type = options.enums === String ? "TYPE_DOUBLE" : 1;
|
19475 | object.typeName = "";
|
19476 | object.defaultValue = "";
|
19477 | object.options = null;
|
19478 | object.oneofIndex = 0;
|
19479 | object.jsonName = "";
|
19480 | object.proto3Optional = false;
|
19481 | }
|
19482 | if (message.name != null && message.hasOwnProperty("name"))
|
19483 | object.name = message.name;
|
19484 | if (message.extendee != null && message.hasOwnProperty("extendee"))
|
19485 | object.extendee = message.extendee;
|
19486 | if (message.number != null && message.hasOwnProperty("number"))
|
19487 | object.number = message.number;
|
19488 | if (message.label != null && message.hasOwnProperty("label"))
|
19489 | object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label;
|
19490 | if (message.type != null && message.hasOwnProperty("type"))
|
19491 | object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type;
|
19492 | if (message.typeName != null && message.hasOwnProperty("typeName"))
|
19493 | object.typeName = message.typeName;
|
19494 | if (message.defaultValue != null && message.hasOwnProperty("defaultValue"))
|
19495 | object.defaultValue = message.defaultValue;
|
19496 | if (message.options != null && message.hasOwnProperty("options"))
|
19497 | object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options);
|
19498 | if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex"))
|
19499 | object.oneofIndex = message.oneofIndex;
|
19500 | if (message.jsonName != null && message.hasOwnProperty("jsonName"))
|
19501 | object.jsonName = message.jsonName;
|
19502 | if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional"))
|
19503 | object.proto3Optional = message.proto3Optional;
|
19504 | return object;
|
19505 | };
|
19506 |
|
19507 | /**
|
19508 | * Converts this FieldDescriptorProto to JSON.
|
19509 | * @function toJSON
|
19510 | * @memberof google.protobuf.FieldDescriptorProto
|
19511 | * @instance
|
19512 | * @returns {Object.<string,*>} JSON object
|
19513 | */
|
19514 | FieldDescriptorProto.prototype.toJSON = function toJSON() {
|
19515 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
19516 | };
|
19517 |
|
19518 | /**
|
19519 | * Type enum.
|
19520 | * @name google.protobuf.FieldDescriptorProto.Type
|
19521 | * @enum {number}
|
19522 | * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value
|
19523 | * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value
|
19524 | * @property {number} TYPE_INT64=3 TYPE_INT64 value
|
19525 | * @property {number} TYPE_UINT64=4 TYPE_UINT64 value
|
19526 | * @property {number} TYPE_INT32=5 TYPE_INT32 value
|
19527 | * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value
|
19528 | * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value
|
19529 | * @property {number} TYPE_BOOL=8 TYPE_BOOL value
|
19530 | * @property {number} TYPE_STRING=9 TYPE_STRING value
|
19531 | * @property {number} TYPE_GROUP=10 TYPE_GROUP value
|
19532 | * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value
|
19533 | * @property {number} TYPE_BYTES=12 TYPE_BYTES value
|
19534 | * @property {number} TYPE_UINT32=13 TYPE_UINT32 value
|
19535 | * @property {number} TYPE_ENUM=14 TYPE_ENUM value
|
19536 | * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value
|
19537 | * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value
|
19538 | * @property {number} TYPE_SINT32=17 TYPE_SINT32 value
|
19539 | * @property {number} TYPE_SINT64=18 TYPE_SINT64 value
|
19540 | */
|
19541 | FieldDescriptorProto.Type = (function() {
|
19542 | var valuesById = {}, values = Object.create(valuesById);
|
19543 | values[valuesById[1] = "TYPE_DOUBLE"] = 1;
|
19544 | values[valuesById[2] = "TYPE_FLOAT"] = 2;
|
19545 | values[valuesById[3] = "TYPE_INT64"] = 3;
|
19546 | values[valuesById[4] = "TYPE_UINT64"] = 4;
|
19547 | values[valuesById[5] = "TYPE_INT32"] = 5;
|
19548 | values[valuesById[6] = "TYPE_FIXED64"] = 6;
|
19549 | values[valuesById[7] = "TYPE_FIXED32"] = 7;
|
19550 | values[valuesById[8] = "TYPE_BOOL"] = 8;
|
19551 | values[valuesById[9] = "TYPE_STRING"] = 9;
|
19552 | values[valuesById[10] = "TYPE_GROUP"] = 10;
|
19553 | values[valuesById[11] = "TYPE_MESSAGE"] = 11;
|
19554 | values[valuesById[12] = "TYPE_BYTES"] = 12;
|
19555 | values[valuesById[13] = "TYPE_UINT32"] = 13;
|
19556 | values[valuesById[14] = "TYPE_ENUM"] = 14;
|
19557 | values[valuesById[15] = "TYPE_SFIXED32"] = 15;
|
19558 | values[valuesById[16] = "TYPE_SFIXED64"] = 16;
|
19559 | values[valuesById[17] = "TYPE_SINT32"] = 17;
|
19560 | values[valuesById[18] = "TYPE_SINT64"] = 18;
|
19561 | return values;
|
19562 | })();
|
19563 |
|
19564 | /**
|
19565 | * Label enum.
|
19566 | * @name google.protobuf.FieldDescriptorProto.Label
|
19567 | * @enum {number}
|
19568 | * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value
|
19569 | * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value
|
19570 | * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value
|
19571 | */
|
19572 | FieldDescriptorProto.Label = (function() {
|
19573 | var valuesById = {}, values = Object.create(valuesById);
|
19574 | values[valuesById[1] = "LABEL_OPTIONAL"] = 1;
|
19575 | values[valuesById[2] = "LABEL_REQUIRED"] = 2;
|
19576 | values[valuesById[3] = "LABEL_REPEATED"] = 3;
|
19577 | return values;
|
19578 | })();
|
19579 |
|
19580 | return FieldDescriptorProto;
|
19581 | })();
|
19582 |
|
19583 | protobuf.OneofDescriptorProto = (function() {
|
19584 |
|
19585 | /**
|
19586 | * Properties of an OneofDescriptorProto.
|
19587 | * @memberof google.protobuf
|
19588 | * @interface IOneofDescriptorProto
|
19589 | * @property {string|null} [name] OneofDescriptorProto name
|
19590 | * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options
|
19591 | */
|
19592 |
|
19593 | /**
|
19594 | * Constructs a new OneofDescriptorProto.
|
19595 | * @memberof google.protobuf
|
19596 | * @classdesc Represents an OneofDescriptorProto.
|
19597 | * @implements IOneofDescriptorProto
|
19598 | * @constructor
|
19599 | * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set
|
19600 | */
|
19601 | function OneofDescriptorProto(properties) {
|
19602 | if (properties)
|
19603 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
19604 | if (properties[keys[i]] != null)
|
19605 | this[keys[i]] = properties[keys[i]];
|
19606 | }
|
19607 |
|
19608 | /**
|
19609 | * OneofDescriptorProto name.
|
19610 | * @member {string} name
|
19611 | * @memberof google.protobuf.OneofDescriptorProto
|
19612 | * @instance
|
19613 | */
|
19614 | OneofDescriptorProto.prototype.name = "";
|
19615 |
|
19616 | /**
|
19617 | * OneofDescriptorProto options.
|
19618 | * @member {google.protobuf.IOneofOptions|null|undefined} options
|
19619 | * @memberof google.protobuf.OneofDescriptorProto
|
19620 | * @instance
|
19621 | */
|
19622 | OneofDescriptorProto.prototype.options = null;
|
19623 |
|
19624 | /**
|
19625 | * Creates a new OneofDescriptorProto instance using the specified properties.
|
19626 | * @function create
|
19627 | * @memberof google.protobuf.OneofDescriptorProto
|
19628 | * @static
|
19629 | * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set
|
19630 | * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance
|
19631 | */
|
19632 | OneofDescriptorProto.create = function create(properties) {
|
19633 | return new OneofDescriptorProto(properties);
|
19634 | };
|
19635 |
|
19636 | /**
|
19637 | * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages.
|
19638 | * @function encode
|
19639 | * @memberof google.protobuf.OneofDescriptorProto
|
19640 | * @static
|
19641 | * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode
|
19642 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
19643 | * @returns {$protobuf.Writer} Writer
|
19644 | */
|
19645 | OneofDescriptorProto.encode = function encode(message, writer) {
|
19646 | if (!writer)
|
19647 | writer = $Writer.create();
|
19648 | if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
19649 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
|
19650 | if (message.options != null && Object.hasOwnProperty.call(message, "options"))
|
19651 | $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
19652 | return writer;
|
19653 | };
|
19654 |
|
19655 | /**
|
19656 | * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages.
|
19657 | * @function encodeDelimited
|
19658 | * @memberof google.protobuf.OneofDescriptorProto
|
19659 | * @static
|
19660 | * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode
|
19661 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
19662 | * @returns {$protobuf.Writer} Writer
|
19663 | */
|
19664 | OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) {
|
19665 | return this.encode(message, writer).ldelim();
|
19666 | };
|
19667 |
|
19668 | /**
|
19669 | * Decodes an OneofDescriptorProto message from the specified reader or buffer.
|
19670 | * @function decode
|
19671 | * @memberof google.protobuf.OneofDescriptorProto
|
19672 | * @static
|
19673 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
19674 | * @param {number} [length] Message length if known beforehand
|
19675 | * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto
|
19676 | * @throws {Error} If the payload is not a reader or valid buffer
|
19677 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
19678 | */
|
19679 | OneofDescriptorProto.decode = function decode(reader, length) {
|
19680 | if (!(reader instanceof $Reader))
|
19681 | reader = $Reader.create(reader);
|
19682 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto();
|
19683 | while (reader.pos < end) {
|
19684 | var tag = reader.uint32();
|
19685 | switch (tag >>> 3) {
|
19686 | case 1:
|
19687 | message.name = reader.string();
|
19688 | break;
|
19689 | case 2:
|
19690 | message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32());
|
19691 | break;
|
19692 | default:
|
19693 | reader.skipType(tag & 7);
|
19694 | break;
|
19695 | }
|
19696 | }
|
19697 | return message;
|
19698 | };
|
19699 |
|
19700 | /**
|
19701 | * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited.
|
19702 | * @function decodeDelimited
|
19703 | * @memberof google.protobuf.OneofDescriptorProto
|
19704 | * @static
|
19705 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
19706 | * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto
|
19707 | * @throws {Error} If the payload is not a reader or valid buffer
|
19708 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
19709 | */
|
19710 | OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) {
|
19711 | if (!(reader instanceof $Reader))
|
19712 | reader = new $Reader(reader);
|
19713 | return this.decode(reader, reader.uint32());
|
19714 | };
|
19715 |
|
19716 | /**
|
19717 | * Verifies an OneofDescriptorProto message.
|
19718 | * @function verify
|
19719 | * @memberof google.protobuf.OneofDescriptorProto
|
19720 | * @static
|
19721 | * @param {Object.<string,*>} message Plain object to verify
|
19722 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
19723 | */
|
19724 | OneofDescriptorProto.verify = function verify(message) {
|
19725 | if (typeof message !== "object" || message === null)
|
19726 | return "object expected";
|
19727 | if (message.name != null && message.hasOwnProperty("name"))
|
19728 | if (!$util.isString(message.name))
|
19729 | return "name: string expected";
|
19730 | if (message.options != null && message.hasOwnProperty("options")) {
|
19731 | var error = $root.google.protobuf.OneofOptions.verify(message.options);
|
19732 | if (error)
|
19733 | return "options." + error;
|
19734 | }
|
19735 | return null;
|
19736 | };
|
19737 |
|
19738 | /**
|
19739 | * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types.
|
19740 | * @function fromObject
|
19741 | * @memberof google.protobuf.OneofDescriptorProto
|
19742 | * @static
|
19743 | * @param {Object.<string,*>} object Plain object
|
19744 | * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto
|
19745 | */
|
19746 | OneofDescriptorProto.fromObject = function fromObject(object) {
|
19747 | if (object instanceof $root.google.protobuf.OneofDescriptorProto)
|
19748 | return object;
|
19749 | var message = new $root.google.protobuf.OneofDescriptorProto();
|
19750 | if (object.name != null)
|
19751 | message.name = String(object.name);
|
19752 | if (object.options != null) {
|
19753 | if (typeof object.options !== "object")
|
19754 | throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected");
|
19755 | message.options = $root.google.protobuf.OneofOptions.fromObject(object.options);
|
19756 | }
|
19757 | return message;
|
19758 | };
|
19759 |
|
19760 | /**
|
19761 | * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified.
|
19762 | * @function toObject
|
19763 | * @memberof google.protobuf.OneofDescriptorProto
|
19764 | * @static
|
19765 | * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto
|
19766 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
19767 | * @returns {Object.<string,*>} Plain object
|
19768 | */
|
19769 | OneofDescriptorProto.toObject = function toObject(message, options) {
|
19770 | if (!options)
|
19771 | options = {};
|
19772 | var object = {};
|
19773 | if (options.defaults) {
|
19774 | object.name = "";
|
19775 | object.options = null;
|
19776 | }
|
19777 | if (message.name != null && message.hasOwnProperty("name"))
|
19778 | object.name = message.name;
|
19779 | if (message.options != null && message.hasOwnProperty("options"))
|
19780 | object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options);
|
19781 | return object;
|
19782 | };
|
19783 |
|
19784 | /**
|
19785 | * Converts this OneofDescriptorProto to JSON.
|
19786 | * @function toJSON
|
19787 | * @memberof google.protobuf.OneofDescriptorProto
|
19788 | * @instance
|
19789 | * @returns {Object.<string,*>} JSON object
|
19790 | */
|
19791 | OneofDescriptorProto.prototype.toJSON = function toJSON() {
|
19792 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
19793 | };
|
19794 |
|
19795 | return OneofDescriptorProto;
|
19796 | })();
|
19797 |
|
19798 | protobuf.EnumDescriptorProto = (function() {
|
19799 |
|
19800 | /**
|
19801 | * Properties of an EnumDescriptorProto.
|
19802 | * @memberof google.protobuf
|
19803 | * @interface IEnumDescriptorProto
|
19804 | * @property {string|null} [name] EnumDescriptorProto name
|
19805 | * @property {Array.<google.protobuf.IEnumValueDescriptorProto>|null} [value] EnumDescriptorProto value
|
19806 | * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options
|
19807 | * @property {Array.<google.protobuf.EnumDescriptorProto.IEnumReservedRange>|null} [reservedRange] EnumDescriptorProto reservedRange
|
19808 | * @property {Array.<string>|null} [reservedName] EnumDescriptorProto reservedName
|
19809 | */
|
19810 |
|
19811 | /**
|
19812 | * Constructs a new EnumDescriptorProto.
|
19813 | * @memberof google.protobuf
|
19814 | * @classdesc Represents an EnumDescriptorProto.
|
19815 | * @implements IEnumDescriptorProto
|
19816 | * @constructor
|
19817 | * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set
|
19818 | */
|
19819 | function EnumDescriptorProto(properties) {
|
19820 | this.value = [];
|
19821 | this.reservedRange = [];
|
19822 | this.reservedName = [];
|
19823 | if (properties)
|
19824 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
19825 | if (properties[keys[i]] != null)
|
19826 | this[keys[i]] = properties[keys[i]];
|
19827 | }
|
19828 |
|
19829 | /**
|
19830 | * EnumDescriptorProto name.
|
19831 | * @member {string} name
|
19832 | * @memberof google.protobuf.EnumDescriptorProto
|
19833 | * @instance
|
19834 | */
|
19835 | EnumDescriptorProto.prototype.name = "";
|
19836 |
|
19837 | /**
|
19838 | * EnumDescriptorProto value.
|
19839 | * @member {Array.<google.protobuf.IEnumValueDescriptorProto>} value
|
19840 | * @memberof google.protobuf.EnumDescriptorProto
|
19841 | * @instance
|
19842 | */
|
19843 | EnumDescriptorProto.prototype.value = $util.emptyArray;
|
19844 |
|
19845 | /**
|
19846 | * EnumDescriptorProto options.
|
19847 | * @member {google.protobuf.IEnumOptions|null|undefined} options
|
19848 | * @memberof google.protobuf.EnumDescriptorProto
|
19849 | * @instance
|
19850 | */
|
19851 | EnumDescriptorProto.prototype.options = null;
|
19852 |
|
19853 | /**
|
19854 | * EnumDescriptorProto reservedRange.
|
19855 | * @member {Array.<google.protobuf.EnumDescriptorProto.IEnumReservedRange>} reservedRange
|
19856 | * @memberof google.protobuf.EnumDescriptorProto
|
19857 | * @instance
|
19858 | */
|
19859 | EnumDescriptorProto.prototype.reservedRange = $util.emptyArray;
|
19860 |
|
19861 | /**
|
19862 | * EnumDescriptorProto reservedName.
|
19863 | * @member {Array.<string>} reservedName
|
19864 | * @memberof google.protobuf.EnumDescriptorProto
|
19865 | * @instance
|
19866 | */
|
19867 | EnumDescriptorProto.prototype.reservedName = $util.emptyArray;
|
19868 |
|
19869 | /**
|
19870 | * Creates a new EnumDescriptorProto instance using the specified properties.
|
19871 | * @function create
|
19872 | * @memberof google.protobuf.EnumDescriptorProto
|
19873 | * @static
|
19874 | * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set
|
19875 | * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance
|
19876 | */
|
19877 | EnumDescriptorProto.create = function create(properties) {
|
19878 | return new EnumDescriptorProto(properties);
|
19879 | };
|
19880 |
|
19881 | /**
|
19882 | * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages.
|
19883 | * @function encode
|
19884 | * @memberof google.protobuf.EnumDescriptorProto
|
19885 | * @static
|
19886 | * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode
|
19887 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
19888 | * @returns {$protobuf.Writer} Writer
|
19889 | */
|
19890 | EnumDescriptorProto.encode = function encode(message, writer) {
|
19891 | if (!writer)
|
19892 | writer = $Writer.create();
|
19893 | if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
19894 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
|
19895 | if (message.value != null && message.value.length)
|
19896 | for (var i = 0; i < message.value.length; ++i)
|
19897 | $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
19898 | if (message.options != null && Object.hasOwnProperty.call(message, "options"))
|
19899 | $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
|
19900 | if (message.reservedRange != null && message.reservedRange.length)
|
19901 | for (var i = 0; i < message.reservedRange.length; ++i)
|
19902 | $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
|
19903 | if (message.reservedName != null && message.reservedName.length)
|
19904 | for (var i = 0; i < message.reservedName.length; ++i)
|
19905 | writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]);
|
19906 | return writer;
|
19907 | };
|
19908 |
|
19909 | /**
|
19910 | * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages.
|
19911 | * @function encodeDelimited
|
19912 | * @memberof google.protobuf.EnumDescriptorProto
|
19913 | * @static
|
19914 | * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode
|
19915 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
19916 | * @returns {$protobuf.Writer} Writer
|
19917 | */
|
19918 | EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) {
|
19919 | return this.encode(message, writer).ldelim();
|
19920 | };
|
19921 |
|
19922 | /**
|
19923 | * Decodes an EnumDescriptorProto message from the specified reader or buffer.
|
19924 | * @function decode
|
19925 | * @memberof google.protobuf.EnumDescriptorProto
|
19926 | * @static
|
19927 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
19928 | * @param {number} [length] Message length if known beforehand
|
19929 | * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto
|
19930 | * @throws {Error} If the payload is not a reader or valid buffer
|
19931 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
19932 | */
|
19933 | EnumDescriptorProto.decode = function decode(reader, length) {
|
19934 | if (!(reader instanceof $Reader))
|
19935 | reader = $Reader.create(reader);
|
19936 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto();
|
19937 | while (reader.pos < end) {
|
19938 | var tag = reader.uint32();
|
19939 | switch (tag >>> 3) {
|
19940 | case 1:
|
19941 | message.name = reader.string();
|
19942 | break;
|
19943 | case 2:
|
19944 | if (!(message.value && message.value.length))
|
19945 | message.value = [];
|
19946 | message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32()));
|
19947 | break;
|
19948 | case 3:
|
19949 | message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32());
|
19950 | break;
|
19951 | case 4:
|
19952 | if (!(message.reservedRange && message.reservedRange.length))
|
19953 | message.reservedRange = [];
|
19954 | message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32()));
|
19955 | break;
|
19956 | case 5:
|
19957 | if (!(message.reservedName && message.reservedName.length))
|
19958 | message.reservedName = [];
|
19959 | message.reservedName.push(reader.string());
|
19960 | break;
|
19961 | default:
|
19962 | reader.skipType(tag & 7);
|
19963 | break;
|
19964 | }
|
19965 | }
|
19966 | return message;
|
19967 | };
|
19968 |
|
19969 | /**
|
19970 | * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited.
|
19971 | * @function decodeDelimited
|
19972 | * @memberof google.protobuf.EnumDescriptorProto
|
19973 | * @static
|
19974 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
19975 | * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto
|
19976 | * @throws {Error} If the payload is not a reader or valid buffer
|
19977 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
19978 | */
|
19979 | EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) {
|
19980 | if (!(reader instanceof $Reader))
|
19981 | reader = new $Reader(reader);
|
19982 | return this.decode(reader, reader.uint32());
|
19983 | };
|
19984 |
|
19985 | /**
|
19986 | * Verifies an EnumDescriptorProto message.
|
19987 | * @function verify
|
19988 | * @memberof google.protobuf.EnumDescriptorProto
|
19989 | * @static
|
19990 | * @param {Object.<string,*>} message Plain object to verify
|
19991 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
19992 | */
|
19993 | EnumDescriptorProto.verify = function verify(message) {
|
19994 | if (typeof message !== "object" || message === null)
|
19995 | return "object expected";
|
19996 | if (message.name != null && message.hasOwnProperty("name"))
|
19997 | if (!$util.isString(message.name))
|
19998 | return "name: string expected";
|
19999 | if (message.value != null && message.hasOwnProperty("value")) {
|
20000 | if (!Array.isArray(message.value))
|
20001 | return "value: array expected";
|
20002 | for (var i = 0; i < message.value.length; ++i) {
|
20003 | var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]);
|
20004 | if (error)
|
20005 | return "value." + error;
|
20006 | }
|
20007 | }
|
20008 | if (message.options != null && message.hasOwnProperty("options")) {
|
20009 | var error = $root.google.protobuf.EnumOptions.verify(message.options);
|
20010 | if (error)
|
20011 | return "options." + error;
|
20012 | }
|
20013 | if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) {
|
20014 | if (!Array.isArray(message.reservedRange))
|
20015 | return "reservedRange: array expected";
|
20016 | for (var i = 0; i < message.reservedRange.length; ++i) {
|
20017 | var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]);
|
20018 | if (error)
|
20019 | return "reservedRange." + error;
|
20020 | }
|
20021 | }
|
20022 | if (message.reservedName != null && message.hasOwnProperty("reservedName")) {
|
20023 | if (!Array.isArray(message.reservedName))
|
20024 | return "reservedName: array expected";
|
20025 | for (var i = 0; i < message.reservedName.length; ++i)
|
20026 | if (!$util.isString(message.reservedName[i]))
|
20027 | return "reservedName: string[] expected";
|
20028 | }
|
20029 | return null;
|
20030 | };
|
20031 |
|
20032 | /**
|
20033 | * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types.
|
20034 | * @function fromObject
|
20035 | * @memberof google.protobuf.EnumDescriptorProto
|
20036 | * @static
|
20037 | * @param {Object.<string,*>} object Plain object
|
20038 | * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto
|
20039 | */
|
20040 | EnumDescriptorProto.fromObject = function fromObject(object) {
|
20041 | if (object instanceof $root.google.protobuf.EnumDescriptorProto)
|
20042 | return object;
|
20043 | var message = new $root.google.protobuf.EnumDescriptorProto();
|
20044 | if (object.name != null)
|
20045 | message.name = String(object.name);
|
20046 | if (object.value) {
|
20047 | if (!Array.isArray(object.value))
|
20048 | throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected");
|
20049 | message.value = [];
|
20050 | for (var i = 0; i < object.value.length; ++i) {
|
20051 | if (typeof object.value[i] !== "object")
|
20052 | throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected");
|
20053 | message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]);
|
20054 | }
|
20055 | }
|
20056 | if (object.options != null) {
|
20057 | if (typeof object.options !== "object")
|
20058 | throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected");
|
20059 | message.options = $root.google.protobuf.EnumOptions.fromObject(object.options);
|
20060 | }
|
20061 | if (object.reservedRange) {
|
20062 | if (!Array.isArray(object.reservedRange))
|
20063 | throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected");
|
20064 | message.reservedRange = [];
|
20065 | for (var i = 0; i < object.reservedRange.length; ++i) {
|
20066 | if (typeof object.reservedRange[i] !== "object")
|
20067 | throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected");
|
20068 | message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]);
|
20069 | }
|
20070 | }
|
20071 | if (object.reservedName) {
|
20072 | if (!Array.isArray(object.reservedName))
|
20073 | throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected");
|
20074 | message.reservedName = [];
|
20075 | for (var i = 0; i < object.reservedName.length; ++i)
|
20076 | message.reservedName[i] = String(object.reservedName[i]);
|
20077 | }
|
20078 | return message;
|
20079 | };
|
20080 |
|
20081 | /**
|
20082 | * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified.
|
20083 | * @function toObject
|
20084 | * @memberof google.protobuf.EnumDescriptorProto
|
20085 | * @static
|
20086 | * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto
|
20087 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
20088 | * @returns {Object.<string,*>} Plain object
|
20089 | */
|
20090 | EnumDescriptorProto.toObject = function toObject(message, options) {
|
20091 | if (!options)
|
20092 | options = {};
|
20093 | var object = {};
|
20094 | if (options.arrays || options.defaults) {
|
20095 | object.value = [];
|
20096 | object.reservedRange = [];
|
20097 | object.reservedName = [];
|
20098 | }
|
20099 | if (options.defaults) {
|
20100 | object.name = "";
|
20101 | object.options = null;
|
20102 | }
|
20103 | if (message.name != null && message.hasOwnProperty("name"))
|
20104 | object.name = message.name;
|
20105 | if (message.value && message.value.length) {
|
20106 | object.value = [];
|
20107 | for (var j = 0; j < message.value.length; ++j)
|
20108 | object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options);
|
20109 | }
|
20110 | if (message.options != null && message.hasOwnProperty("options"))
|
20111 | object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options);
|
20112 | if (message.reservedRange && message.reservedRange.length) {
|
20113 | object.reservedRange = [];
|
20114 | for (var j = 0; j < message.reservedRange.length; ++j)
|
20115 | object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options);
|
20116 | }
|
20117 | if (message.reservedName && message.reservedName.length) {
|
20118 | object.reservedName = [];
|
20119 | for (var j = 0; j < message.reservedName.length; ++j)
|
20120 | object.reservedName[j] = message.reservedName[j];
|
20121 | }
|
20122 | return object;
|
20123 | };
|
20124 |
|
20125 | /**
|
20126 | * Converts this EnumDescriptorProto to JSON.
|
20127 | * @function toJSON
|
20128 | * @memberof google.protobuf.EnumDescriptorProto
|
20129 | * @instance
|
20130 | * @returns {Object.<string,*>} JSON object
|
20131 | */
|
20132 | EnumDescriptorProto.prototype.toJSON = function toJSON() {
|
20133 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
20134 | };
|
20135 |
|
20136 | EnumDescriptorProto.EnumReservedRange = (function() {
|
20137 |
|
20138 | /**
|
20139 | * Properties of an EnumReservedRange.
|
20140 | * @memberof google.protobuf.EnumDescriptorProto
|
20141 | * @interface IEnumReservedRange
|
20142 | * @property {number|null} [start] EnumReservedRange start
|
20143 | * @property {number|null} [end] EnumReservedRange end
|
20144 | */
|
20145 |
|
20146 | /**
|
20147 | * Constructs a new EnumReservedRange.
|
20148 | * @memberof google.protobuf.EnumDescriptorProto
|
20149 | * @classdesc Represents an EnumReservedRange.
|
20150 | * @implements IEnumReservedRange
|
20151 | * @constructor
|
20152 | * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set
|
20153 | */
|
20154 | function EnumReservedRange(properties) {
|
20155 | if (properties)
|
20156 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
20157 | if (properties[keys[i]] != null)
|
20158 | this[keys[i]] = properties[keys[i]];
|
20159 | }
|
20160 |
|
20161 | /**
|
20162 | * EnumReservedRange start.
|
20163 | * @member {number} start
|
20164 | * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange
|
20165 | * @instance
|
20166 | */
|
20167 | EnumReservedRange.prototype.start = 0;
|
20168 |
|
20169 | /**
|
20170 | * EnumReservedRange end.
|
20171 | * @member {number} end
|
20172 | * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange
|
20173 | * @instance
|
20174 | */
|
20175 | EnumReservedRange.prototype.end = 0;
|
20176 |
|
20177 | /**
|
20178 | * Creates a new EnumReservedRange instance using the specified properties.
|
20179 | * @function create
|
20180 | * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange
|
20181 | * @static
|
20182 | * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set
|
20183 | * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance
|
20184 | */
|
20185 | EnumReservedRange.create = function create(properties) {
|
20186 | return new EnumReservedRange(properties);
|
20187 | };
|
20188 |
|
20189 | /**
|
20190 | * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages.
|
20191 | * @function encode
|
20192 | * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange
|
20193 | * @static
|
20194 | * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode
|
20195 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
20196 | * @returns {$protobuf.Writer} Writer
|
20197 | */
|
20198 | EnumReservedRange.encode = function encode(message, writer) {
|
20199 | if (!writer)
|
20200 | writer = $Writer.create();
|
20201 | if (message.start != null && Object.hasOwnProperty.call(message, "start"))
|
20202 | writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start);
|
20203 | if (message.end != null && Object.hasOwnProperty.call(message, "end"))
|
20204 | writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end);
|
20205 | return writer;
|
20206 | };
|
20207 |
|
20208 | /**
|
20209 | * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages.
|
20210 | * @function encodeDelimited
|
20211 | * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange
|
20212 | * @static
|
20213 | * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode
|
20214 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
20215 | * @returns {$protobuf.Writer} Writer
|
20216 | */
|
20217 | EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) {
|
20218 | return this.encode(message, writer).ldelim();
|
20219 | };
|
20220 |
|
20221 | /**
|
20222 | * Decodes an EnumReservedRange message from the specified reader or buffer.
|
20223 | * @function decode
|
20224 | * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange
|
20225 | * @static
|
20226 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
20227 | * @param {number} [length] Message length if known beforehand
|
20228 | * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange
|
20229 | * @throws {Error} If the payload is not a reader or valid buffer
|
20230 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
20231 | */
|
20232 | EnumReservedRange.decode = function decode(reader, length) {
|
20233 | if (!(reader instanceof $Reader))
|
20234 | reader = $Reader.create(reader);
|
20235 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange();
|
20236 | while (reader.pos < end) {
|
20237 | var tag = reader.uint32();
|
20238 | switch (tag >>> 3) {
|
20239 | case 1:
|
20240 | message.start = reader.int32();
|
20241 | break;
|
20242 | case 2:
|
20243 | message.end = reader.int32();
|
20244 | break;
|
20245 | default:
|
20246 | reader.skipType(tag & 7);
|
20247 | break;
|
20248 | }
|
20249 | }
|
20250 | return message;
|
20251 | };
|
20252 |
|
20253 | /**
|
20254 | * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited.
|
20255 | * @function decodeDelimited
|
20256 | * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange
|
20257 | * @static
|
20258 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
20259 | * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange
|
20260 | * @throws {Error} If the payload is not a reader or valid buffer
|
20261 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
20262 | */
|
20263 | EnumReservedRange.decodeDelimited = function decodeDelimited(reader) {
|
20264 | if (!(reader instanceof $Reader))
|
20265 | reader = new $Reader(reader);
|
20266 | return this.decode(reader, reader.uint32());
|
20267 | };
|
20268 |
|
20269 | /**
|
20270 | * Verifies an EnumReservedRange message.
|
20271 | * @function verify
|
20272 | * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange
|
20273 | * @static
|
20274 | * @param {Object.<string,*>} message Plain object to verify
|
20275 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
20276 | */
|
20277 | EnumReservedRange.verify = function verify(message) {
|
20278 | if (typeof message !== "object" || message === null)
|
20279 | return "object expected";
|
20280 | if (message.start != null && message.hasOwnProperty("start"))
|
20281 | if (!$util.isInteger(message.start))
|
20282 | return "start: integer expected";
|
20283 | if (message.end != null && message.hasOwnProperty("end"))
|
20284 | if (!$util.isInteger(message.end))
|
20285 | return "end: integer expected";
|
20286 | return null;
|
20287 | };
|
20288 |
|
20289 | /**
|
20290 | * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types.
|
20291 | * @function fromObject
|
20292 | * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange
|
20293 | * @static
|
20294 | * @param {Object.<string,*>} object Plain object
|
20295 | * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange
|
20296 | */
|
20297 | EnumReservedRange.fromObject = function fromObject(object) {
|
20298 | if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange)
|
20299 | return object;
|
20300 | var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange();
|
20301 | if (object.start != null)
|
20302 | message.start = object.start | 0;
|
20303 | if (object.end != null)
|
20304 | message.end = object.end | 0;
|
20305 | return message;
|
20306 | };
|
20307 |
|
20308 | /**
|
20309 | * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified.
|
20310 | * @function toObject
|
20311 | * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange
|
20312 | * @static
|
20313 | * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange
|
20314 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
20315 | * @returns {Object.<string,*>} Plain object
|
20316 | */
|
20317 | EnumReservedRange.toObject = function toObject(message, options) {
|
20318 | if (!options)
|
20319 | options = {};
|
20320 | var object = {};
|
20321 | if (options.defaults) {
|
20322 | object.start = 0;
|
20323 | object.end = 0;
|
20324 | }
|
20325 | if (message.start != null && message.hasOwnProperty("start"))
|
20326 | object.start = message.start;
|
20327 | if (message.end != null && message.hasOwnProperty("end"))
|
20328 | object.end = message.end;
|
20329 | return object;
|
20330 | };
|
20331 |
|
20332 | /**
|
20333 | * Converts this EnumReservedRange to JSON.
|
20334 | * @function toJSON
|
20335 | * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange
|
20336 | * @instance
|
20337 | * @returns {Object.<string,*>} JSON object
|
20338 | */
|
20339 | EnumReservedRange.prototype.toJSON = function toJSON() {
|
20340 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
20341 | };
|
20342 |
|
20343 | return EnumReservedRange;
|
20344 | })();
|
20345 |
|
20346 | return EnumDescriptorProto;
|
20347 | })();
|
20348 |
|
20349 | protobuf.EnumValueDescriptorProto = (function() {
|
20350 |
|
20351 | /**
|
20352 | * Properties of an EnumValueDescriptorProto.
|
20353 | * @memberof google.protobuf
|
20354 | * @interface IEnumValueDescriptorProto
|
20355 | * @property {string|null} [name] EnumValueDescriptorProto name
|
20356 | * @property {number|null} [number] EnumValueDescriptorProto number
|
20357 | * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options
|
20358 | */
|
20359 |
|
20360 | /**
|
20361 | * Constructs a new EnumValueDescriptorProto.
|
20362 | * @memberof google.protobuf
|
20363 | * @classdesc Represents an EnumValueDescriptorProto.
|
20364 | * @implements IEnumValueDescriptorProto
|
20365 | * @constructor
|
20366 | * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set
|
20367 | */
|
20368 | function EnumValueDescriptorProto(properties) {
|
20369 | if (properties)
|
20370 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
20371 | if (properties[keys[i]] != null)
|
20372 | this[keys[i]] = properties[keys[i]];
|
20373 | }
|
20374 |
|
20375 | /**
|
20376 | * EnumValueDescriptorProto name.
|
20377 | * @member {string} name
|
20378 | * @memberof google.protobuf.EnumValueDescriptorProto
|
20379 | * @instance
|
20380 | */
|
20381 | EnumValueDescriptorProto.prototype.name = "";
|
20382 |
|
20383 | /**
|
20384 | * EnumValueDescriptorProto number.
|
20385 | * @member {number} number
|
20386 | * @memberof google.protobuf.EnumValueDescriptorProto
|
20387 | * @instance
|
20388 | */
|
20389 | EnumValueDescriptorProto.prototype.number = 0;
|
20390 |
|
20391 | /**
|
20392 | * EnumValueDescriptorProto options.
|
20393 | * @member {google.protobuf.IEnumValueOptions|null|undefined} options
|
20394 | * @memberof google.protobuf.EnumValueDescriptorProto
|
20395 | * @instance
|
20396 | */
|
20397 | EnumValueDescriptorProto.prototype.options = null;
|
20398 |
|
20399 | /**
|
20400 | * Creates a new EnumValueDescriptorProto instance using the specified properties.
|
20401 | * @function create
|
20402 | * @memberof google.protobuf.EnumValueDescriptorProto
|
20403 | * @static
|
20404 | * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set
|
20405 | * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance
|
20406 | */
|
20407 | EnumValueDescriptorProto.create = function create(properties) {
|
20408 | return new EnumValueDescriptorProto(properties);
|
20409 | };
|
20410 |
|
20411 | /**
|
20412 | * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages.
|
20413 | * @function encode
|
20414 | * @memberof google.protobuf.EnumValueDescriptorProto
|
20415 | * @static
|
20416 | * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode
|
20417 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
20418 | * @returns {$protobuf.Writer} Writer
|
20419 | */
|
20420 | EnumValueDescriptorProto.encode = function encode(message, writer) {
|
20421 | if (!writer)
|
20422 | writer = $Writer.create();
|
20423 | if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
20424 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
|
20425 | if (message.number != null && Object.hasOwnProperty.call(message, "number"))
|
20426 | writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number);
|
20427 | if (message.options != null && Object.hasOwnProperty.call(message, "options"))
|
20428 | $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
|
20429 | return writer;
|
20430 | };
|
20431 |
|
20432 | /**
|
20433 | * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages.
|
20434 | * @function encodeDelimited
|
20435 | * @memberof google.protobuf.EnumValueDescriptorProto
|
20436 | * @static
|
20437 | * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode
|
20438 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
20439 | * @returns {$protobuf.Writer} Writer
|
20440 | */
|
20441 | EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) {
|
20442 | return this.encode(message, writer).ldelim();
|
20443 | };
|
20444 |
|
20445 | /**
|
20446 | * Decodes an EnumValueDescriptorProto message from the specified reader or buffer.
|
20447 | * @function decode
|
20448 | * @memberof google.protobuf.EnumValueDescriptorProto
|
20449 | * @static
|
20450 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
20451 | * @param {number} [length] Message length if known beforehand
|
20452 | * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto
|
20453 | * @throws {Error} If the payload is not a reader or valid buffer
|
20454 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
20455 | */
|
20456 | EnumValueDescriptorProto.decode = function decode(reader, length) {
|
20457 | if (!(reader instanceof $Reader))
|
20458 | reader = $Reader.create(reader);
|
20459 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto();
|
20460 | while (reader.pos < end) {
|
20461 | var tag = reader.uint32();
|
20462 | switch (tag >>> 3) {
|
20463 | case 1:
|
20464 | message.name = reader.string();
|
20465 | break;
|
20466 | case 2:
|
20467 | message.number = reader.int32();
|
20468 | break;
|
20469 | case 3:
|
20470 | message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32());
|
20471 | break;
|
20472 | default:
|
20473 | reader.skipType(tag & 7);
|
20474 | break;
|
20475 | }
|
20476 | }
|
20477 | return message;
|
20478 | };
|
20479 |
|
20480 | /**
|
20481 | * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited.
|
20482 | * @function decodeDelimited
|
20483 | * @memberof google.protobuf.EnumValueDescriptorProto
|
20484 | * @static
|
20485 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
20486 | * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto
|
20487 | * @throws {Error} If the payload is not a reader or valid buffer
|
20488 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
20489 | */
|
20490 | EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) {
|
20491 | if (!(reader instanceof $Reader))
|
20492 | reader = new $Reader(reader);
|
20493 | return this.decode(reader, reader.uint32());
|
20494 | };
|
20495 |
|
20496 | /**
|
20497 | * Verifies an EnumValueDescriptorProto message.
|
20498 | * @function verify
|
20499 | * @memberof google.protobuf.EnumValueDescriptorProto
|
20500 | * @static
|
20501 | * @param {Object.<string,*>} message Plain object to verify
|
20502 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
20503 | */
|
20504 | EnumValueDescriptorProto.verify = function verify(message) {
|
20505 | if (typeof message !== "object" || message === null)
|
20506 | return "object expected";
|
20507 | if (message.name != null && message.hasOwnProperty("name"))
|
20508 | if (!$util.isString(message.name))
|
20509 | return "name: string expected";
|
20510 | if (message.number != null && message.hasOwnProperty("number"))
|
20511 | if (!$util.isInteger(message.number))
|
20512 | return "number: integer expected";
|
20513 | if (message.options != null && message.hasOwnProperty("options")) {
|
20514 | var error = $root.google.protobuf.EnumValueOptions.verify(message.options);
|
20515 | if (error)
|
20516 | return "options." + error;
|
20517 | }
|
20518 | return null;
|
20519 | };
|
20520 |
|
20521 | /**
|
20522 | * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types.
|
20523 | * @function fromObject
|
20524 | * @memberof google.protobuf.EnumValueDescriptorProto
|
20525 | * @static
|
20526 | * @param {Object.<string,*>} object Plain object
|
20527 | * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto
|
20528 | */
|
20529 | EnumValueDescriptorProto.fromObject = function fromObject(object) {
|
20530 | if (object instanceof $root.google.protobuf.EnumValueDescriptorProto)
|
20531 | return object;
|
20532 | var message = new $root.google.protobuf.EnumValueDescriptorProto();
|
20533 | if (object.name != null)
|
20534 | message.name = String(object.name);
|
20535 | if (object.number != null)
|
20536 | message.number = object.number | 0;
|
20537 | if (object.options != null) {
|
20538 | if (typeof object.options !== "object")
|
20539 | throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected");
|
20540 | message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options);
|
20541 | }
|
20542 | return message;
|
20543 | };
|
20544 |
|
20545 | /**
|
20546 | * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified.
|
20547 | * @function toObject
|
20548 | * @memberof google.protobuf.EnumValueDescriptorProto
|
20549 | * @static
|
20550 | * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto
|
20551 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
20552 | * @returns {Object.<string,*>} Plain object
|
20553 | */
|
20554 | EnumValueDescriptorProto.toObject = function toObject(message, options) {
|
20555 | if (!options)
|
20556 | options = {};
|
20557 | var object = {};
|
20558 | if (options.defaults) {
|
20559 | object.name = "";
|
20560 | object.number = 0;
|
20561 | object.options = null;
|
20562 | }
|
20563 | if (message.name != null && message.hasOwnProperty("name"))
|
20564 | object.name = message.name;
|
20565 | if (message.number != null && message.hasOwnProperty("number"))
|
20566 | object.number = message.number;
|
20567 | if (message.options != null && message.hasOwnProperty("options"))
|
20568 | object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options);
|
20569 | return object;
|
20570 | };
|
20571 |
|
20572 | /**
|
20573 | * Converts this EnumValueDescriptorProto to JSON.
|
20574 | * @function toJSON
|
20575 | * @memberof google.protobuf.EnumValueDescriptorProto
|
20576 | * @instance
|
20577 | * @returns {Object.<string,*>} JSON object
|
20578 | */
|
20579 | EnumValueDescriptorProto.prototype.toJSON = function toJSON() {
|
20580 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
20581 | };
|
20582 |
|
20583 | return EnumValueDescriptorProto;
|
20584 | })();
|
20585 |
|
20586 | protobuf.ServiceDescriptorProto = (function() {
|
20587 |
|
20588 | /**
|
20589 | * Properties of a ServiceDescriptorProto.
|
20590 | * @memberof google.protobuf
|
20591 | * @interface IServiceDescriptorProto
|
20592 | * @property {string|null} [name] ServiceDescriptorProto name
|
20593 | * @property {Array.<google.protobuf.IMethodDescriptorProto>|null} [method] ServiceDescriptorProto method
|
20594 | * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options
|
20595 | */
|
20596 |
|
20597 | /**
|
20598 | * Constructs a new ServiceDescriptorProto.
|
20599 | * @memberof google.protobuf
|
20600 | * @classdesc Represents a ServiceDescriptorProto.
|
20601 | * @implements IServiceDescriptorProto
|
20602 | * @constructor
|
20603 | * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set
|
20604 | */
|
20605 | function ServiceDescriptorProto(properties) {
|
20606 | this.method = [];
|
20607 | if (properties)
|
20608 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
20609 | if (properties[keys[i]] != null)
|
20610 | this[keys[i]] = properties[keys[i]];
|
20611 | }
|
20612 |
|
20613 | /**
|
20614 | * ServiceDescriptorProto name.
|
20615 | * @member {string} name
|
20616 | * @memberof google.protobuf.ServiceDescriptorProto
|
20617 | * @instance
|
20618 | */
|
20619 | ServiceDescriptorProto.prototype.name = "";
|
20620 |
|
20621 | /**
|
20622 | * ServiceDescriptorProto method.
|
20623 | * @member {Array.<google.protobuf.IMethodDescriptorProto>} method
|
20624 | * @memberof google.protobuf.ServiceDescriptorProto
|
20625 | * @instance
|
20626 | */
|
20627 | ServiceDescriptorProto.prototype.method = $util.emptyArray;
|
20628 |
|
20629 | /**
|
20630 | * ServiceDescriptorProto options.
|
20631 | * @member {google.protobuf.IServiceOptions|null|undefined} options
|
20632 | * @memberof google.protobuf.ServiceDescriptorProto
|
20633 | * @instance
|
20634 | */
|
20635 | ServiceDescriptorProto.prototype.options = null;
|
20636 |
|
20637 | /**
|
20638 | * Creates a new ServiceDescriptorProto instance using the specified properties.
|
20639 | * @function create
|
20640 | * @memberof google.protobuf.ServiceDescriptorProto
|
20641 | * @static
|
20642 | * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set
|
20643 | * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance
|
20644 | */
|
20645 | ServiceDescriptorProto.create = function create(properties) {
|
20646 | return new ServiceDescriptorProto(properties);
|
20647 | };
|
20648 |
|
20649 | /**
|
20650 | * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages.
|
20651 | * @function encode
|
20652 | * @memberof google.protobuf.ServiceDescriptorProto
|
20653 | * @static
|
20654 | * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode
|
20655 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
20656 | * @returns {$protobuf.Writer} Writer
|
20657 | */
|
20658 | ServiceDescriptorProto.encode = function encode(message, writer) {
|
20659 | if (!writer)
|
20660 | writer = $Writer.create();
|
20661 | if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
20662 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
|
20663 | if (message.method != null && message.method.length)
|
20664 | for (var i = 0; i < message.method.length; ++i)
|
20665 | $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
20666 | if (message.options != null && Object.hasOwnProperty.call(message, "options"))
|
20667 | $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
|
20668 | return writer;
|
20669 | };
|
20670 |
|
20671 | /**
|
20672 | * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages.
|
20673 | * @function encodeDelimited
|
20674 | * @memberof google.protobuf.ServiceDescriptorProto
|
20675 | * @static
|
20676 | * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode
|
20677 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
20678 | * @returns {$protobuf.Writer} Writer
|
20679 | */
|
20680 | ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) {
|
20681 | return this.encode(message, writer).ldelim();
|
20682 | };
|
20683 |
|
20684 | /**
|
20685 | * Decodes a ServiceDescriptorProto message from the specified reader or buffer.
|
20686 | * @function decode
|
20687 | * @memberof google.protobuf.ServiceDescriptorProto
|
20688 | * @static
|
20689 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
20690 | * @param {number} [length] Message length if known beforehand
|
20691 | * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto
|
20692 | * @throws {Error} If the payload is not a reader or valid buffer
|
20693 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
20694 | */
|
20695 | ServiceDescriptorProto.decode = function decode(reader, length) {
|
20696 | if (!(reader instanceof $Reader))
|
20697 | reader = $Reader.create(reader);
|
20698 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto();
|
20699 | while (reader.pos < end) {
|
20700 | var tag = reader.uint32();
|
20701 | switch (tag >>> 3) {
|
20702 | case 1:
|
20703 | message.name = reader.string();
|
20704 | break;
|
20705 | case 2:
|
20706 | if (!(message.method && message.method.length))
|
20707 | message.method = [];
|
20708 | message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32()));
|
20709 | break;
|
20710 | case 3:
|
20711 | message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32());
|
20712 | break;
|
20713 | default:
|
20714 | reader.skipType(tag & 7);
|
20715 | break;
|
20716 | }
|
20717 | }
|
20718 | return message;
|
20719 | };
|
20720 |
|
20721 | /**
|
20722 | * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited.
|
20723 | * @function decodeDelimited
|
20724 | * @memberof google.protobuf.ServiceDescriptorProto
|
20725 | * @static
|
20726 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
20727 | * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto
|
20728 | * @throws {Error} If the payload is not a reader or valid buffer
|
20729 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
20730 | */
|
20731 | ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) {
|
20732 | if (!(reader instanceof $Reader))
|
20733 | reader = new $Reader(reader);
|
20734 | return this.decode(reader, reader.uint32());
|
20735 | };
|
20736 |
|
20737 | /**
|
20738 | * Verifies a ServiceDescriptorProto message.
|
20739 | * @function verify
|
20740 | * @memberof google.protobuf.ServiceDescriptorProto
|
20741 | * @static
|
20742 | * @param {Object.<string,*>} message Plain object to verify
|
20743 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
20744 | */
|
20745 | ServiceDescriptorProto.verify = function verify(message) {
|
20746 | if (typeof message !== "object" || message === null)
|
20747 | return "object expected";
|
20748 | if (message.name != null && message.hasOwnProperty("name"))
|
20749 | if (!$util.isString(message.name))
|
20750 | return "name: string expected";
|
20751 | if (message.method != null && message.hasOwnProperty("method")) {
|
20752 | if (!Array.isArray(message.method))
|
20753 | return "method: array expected";
|
20754 | for (var i = 0; i < message.method.length; ++i) {
|
20755 | var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]);
|
20756 | if (error)
|
20757 | return "method." + error;
|
20758 | }
|
20759 | }
|
20760 | if (message.options != null && message.hasOwnProperty("options")) {
|
20761 | var error = $root.google.protobuf.ServiceOptions.verify(message.options);
|
20762 | if (error)
|
20763 | return "options." + error;
|
20764 | }
|
20765 | return null;
|
20766 | };
|
20767 |
|
20768 | /**
|
20769 | * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types.
|
20770 | * @function fromObject
|
20771 | * @memberof google.protobuf.ServiceDescriptorProto
|
20772 | * @static
|
20773 | * @param {Object.<string,*>} object Plain object
|
20774 | * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto
|
20775 | */
|
20776 | ServiceDescriptorProto.fromObject = function fromObject(object) {
|
20777 | if (object instanceof $root.google.protobuf.ServiceDescriptorProto)
|
20778 | return object;
|
20779 | var message = new $root.google.protobuf.ServiceDescriptorProto();
|
20780 | if (object.name != null)
|
20781 | message.name = String(object.name);
|
20782 | if (object.method) {
|
20783 | if (!Array.isArray(object.method))
|
20784 | throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected");
|
20785 | message.method = [];
|
20786 | for (var i = 0; i < object.method.length; ++i) {
|
20787 | if (typeof object.method[i] !== "object")
|
20788 | throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected");
|
20789 | message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]);
|
20790 | }
|
20791 | }
|
20792 | if (object.options != null) {
|
20793 | if (typeof object.options !== "object")
|
20794 | throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected");
|
20795 | message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options);
|
20796 | }
|
20797 | return message;
|
20798 | };
|
20799 |
|
20800 | /**
|
20801 | * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified.
|
20802 | * @function toObject
|
20803 | * @memberof google.protobuf.ServiceDescriptorProto
|
20804 | * @static
|
20805 | * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto
|
20806 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
20807 | * @returns {Object.<string,*>} Plain object
|
20808 | */
|
20809 | ServiceDescriptorProto.toObject = function toObject(message, options) {
|
20810 | if (!options)
|
20811 | options = {};
|
20812 | var object = {};
|
20813 | if (options.arrays || options.defaults)
|
20814 | object.method = [];
|
20815 | if (options.defaults) {
|
20816 | object.name = "";
|
20817 | object.options = null;
|
20818 | }
|
20819 | if (message.name != null && message.hasOwnProperty("name"))
|
20820 | object.name = message.name;
|
20821 | if (message.method && message.method.length) {
|
20822 | object.method = [];
|
20823 | for (var j = 0; j < message.method.length; ++j)
|
20824 | object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options);
|
20825 | }
|
20826 | if (message.options != null && message.hasOwnProperty("options"))
|
20827 | object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options);
|
20828 | return object;
|
20829 | };
|
20830 |
|
20831 | /**
|
20832 | * Converts this ServiceDescriptorProto to JSON.
|
20833 | * @function toJSON
|
20834 | * @memberof google.protobuf.ServiceDescriptorProto
|
20835 | * @instance
|
20836 | * @returns {Object.<string,*>} JSON object
|
20837 | */
|
20838 | ServiceDescriptorProto.prototype.toJSON = function toJSON() {
|
20839 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
20840 | };
|
20841 |
|
20842 | return ServiceDescriptorProto;
|
20843 | })();
|
20844 |
|
20845 | protobuf.MethodDescriptorProto = (function() {
|
20846 |
|
20847 | /**
|
20848 | * Properties of a MethodDescriptorProto.
|
20849 | * @memberof google.protobuf
|
20850 | * @interface IMethodDescriptorProto
|
20851 | * @property {string|null} [name] MethodDescriptorProto name
|
20852 | * @property {string|null} [inputType] MethodDescriptorProto inputType
|
20853 | * @property {string|null} [outputType] MethodDescriptorProto outputType
|
20854 | * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options
|
20855 | * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming
|
20856 | * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming
|
20857 | */
|
20858 |
|
20859 | /**
|
20860 | * Constructs a new MethodDescriptorProto.
|
20861 | * @memberof google.protobuf
|
20862 | * @classdesc Represents a MethodDescriptorProto.
|
20863 | * @implements IMethodDescriptorProto
|
20864 | * @constructor
|
20865 | * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set
|
20866 | */
|
20867 | function MethodDescriptorProto(properties) {
|
20868 | if (properties)
|
20869 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
20870 | if (properties[keys[i]] != null)
|
20871 | this[keys[i]] = properties[keys[i]];
|
20872 | }
|
20873 |
|
20874 | /**
|
20875 | * MethodDescriptorProto name.
|
20876 | * @member {string} name
|
20877 | * @memberof google.protobuf.MethodDescriptorProto
|
20878 | * @instance
|
20879 | */
|
20880 | MethodDescriptorProto.prototype.name = "";
|
20881 |
|
20882 | /**
|
20883 | * MethodDescriptorProto inputType.
|
20884 | * @member {string} inputType
|
20885 | * @memberof google.protobuf.MethodDescriptorProto
|
20886 | * @instance
|
20887 | */
|
20888 | MethodDescriptorProto.prototype.inputType = "";
|
20889 |
|
20890 | /**
|
20891 | * MethodDescriptorProto outputType.
|
20892 | * @member {string} outputType
|
20893 | * @memberof google.protobuf.MethodDescriptorProto
|
20894 | * @instance
|
20895 | */
|
20896 | MethodDescriptorProto.prototype.outputType = "";
|
20897 |
|
20898 | /**
|
20899 | * MethodDescriptorProto options.
|
20900 | * @member {google.protobuf.IMethodOptions|null|undefined} options
|
20901 | * @memberof google.protobuf.MethodDescriptorProto
|
20902 | * @instance
|
20903 | */
|
20904 | MethodDescriptorProto.prototype.options = null;
|
20905 |
|
20906 | /**
|
20907 | * MethodDescriptorProto clientStreaming.
|
20908 | * @member {boolean} clientStreaming
|
20909 | * @memberof google.protobuf.MethodDescriptorProto
|
20910 | * @instance
|
20911 | */
|
20912 | MethodDescriptorProto.prototype.clientStreaming = false;
|
20913 |
|
20914 | /**
|
20915 | * MethodDescriptorProto serverStreaming.
|
20916 | * @member {boolean} serverStreaming
|
20917 | * @memberof google.protobuf.MethodDescriptorProto
|
20918 | * @instance
|
20919 | */
|
20920 | MethodDescriptorProto.prototype.serverStreaming = false;
|
20921 |
|
20922 | /**
|
20923 | * Creates a new MethodDescriptorProto instance using the specified properties.
|
20924 | * @function create
|
20925 | * @memberof google.protobuf.MethodDescriptorProto
|
20926 | * @static
|
20927 | * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set
|
20928 | * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance
|
20929 | */
|
20930 | MethodDescriptorProto.create = function create(properties) {
|
20931 | return new MethodDescriptorProto(properties);
|
20932 | };
|
20933 |
|
20934 | /**
|
20935 | * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages.
|
20936 | * @function encode
|
20937 | * @memberof google.protobuf.MethodDescriptorProto
|
20938 | * @static
|
20939 | * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode
|
20940 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
20941 | * @returns {$protobuf.Writer} Writer
|
20942 | */
|
20943 | MethodDescriptorProto.encode = function encode(message, writer) {
|
20944 | if (!writer)
|
20945 | writer = $Writer.create();
|
20946 | if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
20947 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
|
20948 | if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType"))
|
20949 | writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType);
|
20950 | if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType"))
|
20951 | writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType);
|
20952 | if (message.options != null && Object.hasOwnProperty.call(message, "options"))
|
20953 | $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
|
20954 | if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming"))
|
20955 | writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming);
|
20956 | if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming"))
|
20957 | writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming);
|
20958 | return writer;
|
20959 | };
|
20960 |
|
20961 | /**
|
20962 | * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages.
|
20963 | * @function encodeDelimited
|
20964 | * @memberof google.protobuf.MethodDescriptorProto
|
20965 | * @static
|
20966 | * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode
|
20967 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
20968 | * @returns {$protobuf.Writer} Writer
|
20969 | */
|
20970 | MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) {
|
20971 | return this.encode(message, writer).ldelim();
|
20972 | };
|
20973 |
|
20974 | /**
|
20975 | * Decodes a MethodDescriptorProto message from the specified reader or buffer.
|
20976 | * @function decode
|
20977 | * @memberof google.protobuf.MethodDescriptorProto
|
20978 | * @static
|
20979 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
20980 | * @param {number} [length] Message length if known beforehand
|
20981 | * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto
|
20982 | * @throws {Error} If the payload is not a reader or valid buffer
|
20983 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
20984 | */
|
20985 | MethodDescriptorProto.decode = function decode(reader, length) {
|
20986 | if (!(reader instanceof $Reader))
|
20987 | reader = $Reader.create(reader);
|
20988 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto();
|
20989 | while (reader.pos < end) {
|
20990 | var tag = reader.uint32();
|
20991 | switch (tag >>> 3) {
|
20992 | case 1:
|
20993 | message.name = reader.string();
|
20994 | break;
|
20995 | case 2:
|
20996 | message.inputType = reader.string();
|
20997 | break;
|
20998 | case 3:
|
20999 | message.outputType = reader.string();
|
21000 | break;
|
21001 | case 4:
|
21002 | message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32());
|
21003 | break;
|
21004 | case 5:
|
21005 | message.clientStreaming = reader.bool();
|
21006 | break;
|
21007 | case 6:
|
21008 | message.serverStreaming = reader.bool();
|
21009 | break;
|
21010 | default:
|
21011 | reader.skipType(tag & 7);
|
21012 | break;
|
21013 | }
|
21014 | }
|
21015 | return message;
|
21016 | };
|
21017 |
|
21018 | /**
|
21019 | * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited.
|
21020 | * @function decodeDelimited
|
21021 | * @memberof google.protobuf.MethodDescriptorProto
|
21022 | * @static
|
21023 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
21024 | * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto
|
21025 | * @throws {Error} If the payload is not a reader or valid buffer
|
21026 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
21027 | */
|
21028 | MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) {
|
21029 | if (!(reader instanceof $Reader))
|
21030 | reader = new $Reader(reader);
|
21031 | return this.decode(reader, reader.uint32());
|
21032 | };
|
21033 |
|
21034 | /**
|
21035 | * Verifies a MethodDescriptorProto message.
|
21036 | * @function verify
|
21037 | * @memberof google.protobuf.MethodDescriptorProto
|
21038 | * @static
|
21039 | * @param {Object.<string,*>} message Plain object to verify
|
21040 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
21041 | */
|
21042 | MethodDescriptorProto.verify = function verify(message) {
|
21043 | if (typeof message !== "object" || message === null)
|
21044 | return "object expected";
|
21045 | if (message.name != null && message.hasOwnProperty("name"))
|
21046 | if (!$util.isString(message.name))
|
21047 | return "name: string expected";
|
21048 | if (message.inputType != null && message.hasOwnProperty("inputType"))
|
21049 | if (!$util.isString(message.inputType))
|
21050 | return "inputType: string expected";
|
21051 | if (message.outputType != null && message.hasOwnProperty("outputType"))
|
21052 | if (!$util.isString(message.outputType))
|
21053 | return "outputType: string expected";
|
21054 | if (message.options != null && message.hasOwnProperty("options")) {
|
21055 | var error = $root.google.protobuf.MethodOptions.verify(message.options);
|
21056 | if (error)
|
21057 | return "options." + error;
|
21058 | }
|
21059 | if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming"))
|
21060 | if (typeof message.clientStreaming !== "boolean")
|
21061 | return "clientStreaming: boolean expected";
|
21062 | if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming"))
|
21063 | if (typeof message.serverStreaming !== "boolean")
|
21064 | return "serverStreaming: boolean expected";
|
21065 | return null;
|
21066 | };
|
21067 |
|
21068 | /**
|
21069 | * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types.
|
21070 | * @function fromObject
|
21071 | * @memberof google.protobuf.MethodDescriptorProto
|
21072 | * @static
|
21073 | * @param {Object.<string,*>} object Plain object
|
21074 | * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto
|
21075 | */
|
21076 | MethodDescriptorProto.fromObject = function fromObject(object) {
|
21077 | if (object instanceof $root.google.protobuf.MethodDescriptorProto)
|
21078 | return object;
|
21079 | var message = new $root.google.protobuf.MethodDescriptorProto();
|
21080 | if (object.name != null)
|
21081 | message.name = String(object.name);
|
21082 | if (object.inputType != null)
|
21083 | message.inputType = String(object.inputType);
|
21084 | if (object.outputType != null)
|
21085 | message.outputType = String(object.outputType);
|
21086 | if (object.options != null) {
|
21087 | if (typeof object.options !== "object")
|
21088 | throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected");
|
21089 | message.options = $root.google.protobuf.MethodOptions.fromObject(object.options);
|
21090 | }
|
21091 | if (object.clientStreaming != null)
|
21092 | message.clientStreaming = Boolean(object.clientStreaming);
|
21093 | if (object.serverStreaming != null)
|
21094 | message.serverStreaming = Boolean(object.serverStreaming);
|
21095 | return message;
|
21096 | };
|
21097 |
|
21098 | /**
|
21099 | * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified.
|
21100 | * @function toObject
|
21101 | * @memberof google.protobuf.MethodDescriptorProto
|
21102 | * @static
|
21103 | * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto
|
21104 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
21105 | * @returns {Object.<string,*>} Plain object
|
21106 | */
|
21107 | MethodDescriptorProto.toObject = function toObject(message, options) {
|
21108 | if (!options)
|
21109 | options = {};
|
21110 | var object = {};
|
21111 | if (options.defaults) {
|
21112 | object.name = "";
|
21113 | object.inputType = "";
|
21114 | object.outputType = "";
|
21115 | object.options = null;
|
21116 | object.clientStreaming = false;
|
21117 | object.serverStreaming = false;
|
21118 | }
|
21119 | if (message.name != null && message.hasOwnProperty("name"))
|
21120 | object.name = message.name;
|
21121 | if (message.inputType != null && message.hasOwnProperty("inputType"))
|
21122 | object.inputType = message.inputType;
|
21123 | if (message.outputType != null && message.hasOwnProperty("outputType"))
|
21124 | object.outputType = message.outputType;
|
21125 | if (message.options != null && message.hasOwnProperty("options"))
|
21126 | object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options);
|
21127 | if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming"))
|
21128 | object.clientStreaming = message.clientStreaming;
|
21129 | if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming"))
|
21130 | object.serverStreaming = message.serverStreaming;
|
21131 | return object;
|
21132 | };
|
21133 |
|
21134 | /**
|
21135 | * Converts this MethodDescriptorProto to JSON.
|
21136 | * @function toJSON
|
21137 | * @memberof google.protobuf.MethodDescriptorProto
|
21138 | * @instance
|
21139 | * @returns {Object.<string,*>} JSON object
|
21140 | */
|
21141 | MethodDescriptorProto.prototype.toJSON = function toJSON() {
|
21142 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
21143 | };
|
21144 |
|
21145 | return MethodDescriptorProto;
|
21146 | })();
|
21147 |
|
21148 | protobuf.FileOptions = (function() {
|
21149 |
|
21150 | /**
|
21151 | * Properties of a FileOptions.
|
21152 | * @memberof google.protobuf
|
21153 | * @interface IFileOptions
|
21154 | * @property {string|null} [javaPackage] FileOptions javaPackage
|
21155 | * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname
|
21156 | * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles
|
21157 | * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash
|
21158 | * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8
|
21159 | * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor
|
21160 | * @property {string|null} [goPackage] FileOptions goPackage
|
21161 | * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices
|
21162 | * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices
|
21163 | * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices
|
21164 | * @property {boolean|null} [phpGenericServices] FileOptions phpGenericServices
|
21165 | * @property {boolean|null} [deprecated] FileOptions deprecated
|
21166 | * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas
|
21167 | * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix
|
21168 | * @property {string|null} [csharpNamespace] FileOptions csharpNamespace
|
21169 | * @property {string|null} [swiftPrefix] FileOptions swiftPrefix
|
21170 | * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix
|
21171 | * @property {string|null} [phpNamespace] FileOptions phpNamespace
|
21172 | * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace
|
21173 | * @property {string|null} [rubyPackage] FileOptions rubyPackage
|
21174 | * @property {Array.<google.protobuf.IUninterpretedOption>|null} [uninterpretedOption] FileOptions uninterpretedOption
|
21175 | * @property {Array.<google.api.IResourceDescriptor>|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition
|
21176 | */
|
21177 |
|
21178 | /**
|
21179 | * Constructs a new FileOptions.
|
21180 | * @memberof google.protobuf
|
21181 | * @classdesc Represents a FileOptions.
|
21182 | * @implements IFileOptions
|
21183 | * @constructor
|
21184 | * @param {google.protobuf.IFileOptions=} [properties] Properties to set
|
21185 | */
|
21186 | function FileOptions(properties) {
|
21187 | this.uninterpretedOption = [];
|
21188 | this[".google.api.resourceDefinition"] = [];
|
21189 | if (properties)
|
21190 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
21191 | if (properties[keys[i]] != null)
|
21192 | this[keys[i]] = properties[keys[i]];
|
21193 | }
|
21194 |
|
21195 | /**
|
21196 | * FileOptions javaPackage.
|
21197 | * @member {string} javaPackage
|
21198 | * @memberof google.protobuf.FileOptions
|
21199 | * @instance
|
21200 | */
|
21201 | FileOptions.prototype.javaPackage = "";
|
21202 |
|
21203 | /**
|
21204 | * FileOptions javaOuterClassname.
|
21205 | * @member {string} javaOuterClassname
|
21206 | * @memberof google.protobuf.FileOptions
|
21207 | * @instance
|
21208 | */
|
21209 | FileOptions.prototype.javaOuterClassname = "";
|
21210 |
|
21211 | /**
|
21212 | * FileOptions javaMultipleFiles.
|
21213 | * @member {boolean} javaMultipleFiles
|
21214 | * @memberof google.protobuf.FileOptions
|
21215 | * @instance
|
21216 | */
|
21217 | FileOptions.prototype.javaMultipleFiles = false;
|
21218 |
|
21219 | /**
|
21220 | * FileOptions javaGenerateEqualsAndHash.
|
21221 | * @member {boolean} javaGenerateEqualsAndHash
|
21222 | * @memberof google.protobuf.FileOptions
|
21223 | * @instance
|
21224 | */
|
21225 | FileOptions.prototype.javaGenerateEqualsAndHash = false;
|
21226 |
|
21227 | /**
|
21228 | * FileOptions javaStringCheckUtf8.
|
21229 | * @member {boolean} javaStringCheckUtf8
|
21230 | * @memberof google.protobuf.FileOptions
|
21231 | * @instance
|
21232 | */
|
21233 | FileOptions.prototype.javaStringCheckUtf8 = false;
|
21234 |
|
21235 | /**
|
21236 | * FileOptions optimizeFor.
|
21237 | * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor
|
21238 | * @memberof google.protobuf.FileOptions
|
21239 | * @instance
|
21240 | */
|
21241 | FileOptions.prototype.optimizeFor = 1;
|
21242 |
|
21243 | /**
|
21244 | * FileOptions goPackage.
|
21245 | * @member {string} goPackage
|
21246 | * @memberof google.protobuf.FileOptions
|
21247 | * @instance
|
21248 | */
|
21249 | FileOptions.prototype.goPackage = "";
|
21250 |
|
21251 | /**
|
21252 | * FileOptions ccGenericServices.
|
21253 | * @member {boolean} ccGenericServices
|
21254 | * @memberof google.protobuf.FileOptions
|
21255 | * @instance
|
21256 | */
|
21257 | FileOptions.prototype.ccGenericServices = false;
|
21258 |
|
21259 | /**
|
21260 | * FileOptions javaGenericServices.
|
21261 | * @member {boolean} javaGenericServices
|
21262 | * @memberof google.protobuf.FileOptions
|
21263 | * @instance
|
21264 | */
|
21265 | FileOptions.prototype.javaGenericServices = false;
|
21266 |
|
21267 | /**
|
21268 | * FileOptions pyGenericServices.
|
21269 | * @member {boolean} pyGenericServices
|
21270 | * @memberof google.protobuf.FileOptions
|
21271 | * @instance
|
21272 | */
|
21273 | FileOptions.prototype.pyGenericServices = false;
|
21274 |
|
21275 | /**
|
21276 | * FileOptions phpGenericServices.
|
21277 | * @member {boolean} phpGenericServices
|
21278 | * @memberof google.protobuf.FileOptions
|
21279 | * @instance
|
21280 | */
|
21281 | FileOptions.prototype.phpGenericServices = false;
|
21282 |
|
21283 | /**
|
21284 | * FileOptions deprecated.
|
21285 | * @member {boolean} deprecated
|
21286 | * @memberof google.protobuf.FileOptions
|
21287 | * @instance
|
21288 | */
|
21289 | FileOptions.prototype.deprecated = false;
|
21290 |
|
21291 | /**
|
21292 | * FileOptions ccEnableArenas.
|
21293 | * @member {boolean} ccEnableArenas
|
21294 | * @memberof google.protobuf.FileOptions
|
21295 | * @instance
|
21296 | */
|
21297 | FileOptions.prototype.ccEnableArenas = true;
|
21298 |
|
21299 | /**
|
21300 | * FileOptions objcClassPrefix.
|
21301 | * @member {string} objcClassPrefix
|
21302 | * @memberof google.protobuf.FileOptions
|
21303 | * @instance
|
21304 | */
|
21305 | FileOptions.prototype.objcClassPrefix = "";
|
21306 |
|
21307 | /**
|
21308 | * FileOptions csharpNamespace.
|
21309 | * @member {string} csharpNamespace
|
21310 | * @memberof google.protobuf.FileOptions
|
21311 | * @instance
|
21312 | */
|
21313 | FileOptions.prototype.csharpNamespace = "";
|
21314 |
|
21315 | /**
|
21316 | * FileOptions swiftPrefix.
|
21317 | * @member {string} swiftPrefix
|
21318 | * @memberof google.protobuf.FileOptions
|
21319 | * @instance
|
21320 | */
|
21321 | FileOptions.prototype.swiftPrefix = "";
|
21322 |
|
21323 | /**
|
21324 | * FileOptions phpClassPrefix.
|
21325 | * @member {string} phpClassPrefix
|
21326 | * @memberof google.protobuf.FileOptions
|
21327 | * @instance
|
21328 | */
|
21329 | FileOptions.prototype.phpClassPrefix = "";
|
21330 |
|
21331 | /**
|
21332 | * FileOptions phpNamespace.
|
21333 | * @member {string} phpNamespace
|
21334 | * @memberof google.protobuf.FileOptions
|
21335 | * @instance
|
21336 | */
|
21337 | FileOptions.prototype.phpNamespace = "";
|
21338 |
|
21339 | /**
|
21340 | * FileOptions phpMetadataNamespace.
|
21341 | * @member {string} phpMetadataNamespace
|
21342 | * @memberof google.protobuf.FileOptions
|
21343 | * @instance
|
21344 | */
|
21345 | FileOptions.prototype.phpMetadataNamespace = "";
|
21346 |
|
21347 | /**
|
21348 | * FileOptions rubyPackage.
|
21349 | * @member {string} rubyPackage
|
21350 | * @memberof google.protobuf.FileOptions
|
21351 | * @instance
|
21352 | */
|
21353 | FileOptions.prototype.rubyPackage = "";
|
21354 |
|
21355 | /**
|
21356 | * FileOptions uninterpretedOption.
|
21357 | * @member {Array.<google.protobuf.IUninterpretedOption>} uninterpretedOption
|
21358 | * @memberof google.protobuf.FileOptions
|
21359 | * @instance
|
21360 | */
|
21361 | FileOptions.prototype.uninterpretedOption = $util.emptyArray;
|
21362 |
|
21363 | /**
|
21364 | * FileOptions .google.api.resourceDefinition.
|
21365 | * @member {Array.<google.api.IResourceDescriptor>} .google.api.resourceDefinition
|
21366 | * @memberof google.protobuf.FileOptions
|
21367 | * @instance
|
21368 | */
|
21369 | FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray;
|
21370 |
|
21371 | /**
|
21372 | * Creates a new FileOptions instance using the specified properties.
|
21373 | * @function create
|
21374 | * @memberof google.protobuf.FileOptions
|
21375 | * @static
|
21376 | * @param {google.protobuf.IFileOptions=} [properties] Properties to set
|
21377 | * @returns {google.protobuf.FileOptions} FileOptions instance
|
21378 | */
|
21379 | FileOptions.create = function create(properties) {
|
21380 | return new FileOptions(properties);
|
21381 | };
|
21382 |
|
21383 | /**
|
21384 | * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages.
|
21385 | * @function encode
|
21386 | * @memberof google.protobuf.FileOptions
|
21387 | * @static
|
21388 | * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode
|
21389 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
21390 | * @returns {$protobuf.Writer} Writer
|
21391 | */
|
21392 | FileOptions.encode = function encode(message, writer) {
|
21393 | if (!writer)
|
21394 | writer = $Writer.create();
|
21395 | if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage"))
|
21396 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage);
|
21397 | if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname"))
|
21398 | writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname);
|
21399 | if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor"))
|
21400 | writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor);
|
21401 | if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles"))
|
21402 | writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles);
|
21403 | if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage"))
|
21404 | writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage);
|
21405 | if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices"))
|
21406 | writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices);
|
21407 | if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices"))
|
21408 | writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices);
|
21409 | if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices"))
|
21410 | writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices);
|
21411 | if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash"))
|
21412 | writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash);
|
21413 | if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated"))
|
21414 | writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated);
|
21415 | if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8"))
|
21416 | writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8);
|
21417 | if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas"))
|
21418 | writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas);
|
21419 | if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix"))
|
21420 | writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix);
|
21421 | if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace"))
|
21422 | writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace);
|
21423 | if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix"))
|
21424 | writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix);
|
21425 | if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix"))
|
21426 | writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix);
|
21427 | if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace"))
|
21428 | writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace);
|
21429 | if (message.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices"))
|
21430 | writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices);
|
21431 | if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace"))
|
21432 | writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace);
|
21433 | if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage"))
|
21434 | writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage);
|
21435 | if (message.uninterpretedOption != null && message.uninterpretedOption.length)
|
21436 | for (var i = 0; i < message.uninterpretedOption.length; ++i)
|
21437 | $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim();
|
21438 | if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length)
|
21439 | for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i)
|
21440 | $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim();
|
21441 | return writer;
|
21442 | };
|
21443 |
|
21444 | /**
|
21445 | * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages.
|
21446 | * @function encodeDelimited
|
21447 | * @memberof google.protobuf.FileOptions
|
21448 | * @static
|
21449 | * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode
|
21450 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
21451 | * @returns {$protobuf.Writer} Writer
|
21452 | */
|
21453 | FileOptions.encodeDelimited = function encodeDelimited(message, writer) {
|
21454 | return this.encode(message, writer).ldelim();
|
21455 | };
|
21456 |
|
21457 | /**
|
21458 | * Decodes a FileOptions message from the specified reader or buffer.
|
21459 | * @function decode
|
21460 | * @memberof google.protobuf.FileOptions
|
21461 | * @static
|
21462 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
21463 | * @param {number} [length] Message length if known beforehand
|
21464 | * @returns {google.protobuf.FileOptions} FileOptions
|
21465 | * @throws {Error} If the payload is not a reader or valid buffer
|
21466 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
21467 | */
|
21468 | FileOptions.decode = function decode(reader, length) {
|
21469 | if (!(reader instanceof $Reader))
|
21470 | reader = $Reader.create(reader);
|
21471 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions();
|
21472 | while (reader.pos < end) {
|
21473 | var tag = reader.uint32();
|
21474 | switch (tag >>> 3) {
|
21475 | case 1:
|
21476 | message.javaPackage = reader.string();
|
21477 | break;
|
21478 | case 8:
|
21479 | message.javaOuterClassname = reader.string();
|
21480 | break;
|
21481 | case 10:
|
21482 | message.javaMultipleFiles = reader.bool();
|
21483 | break;
|
21484 | case 20:
|
21485 | message.javaGenerateEqualsAndHash = reader.bool();
|
21486 | break;
|
21487 | case 27:
|
21488 | message.javaStringCheckUtf8 = reader.bool();
|
21489 | break;
|
21490 | case 9:
|
21491 | message.optimizeFor = reader.int32();
|
21492 | break;
|
21493 | case 11:
|
21494 | message.goPackage = reader.string();
|
21495 | break;
|
21496 | case 16:
|
21497 | message.ccGenericServices = reader.bool();
|
21498 | break;
|
21499 | case 17:
|
21500 | message.javaGenericServices = reader.bool();
|
21501 | break;
|
21502 | case 18:
|
21503 | message.pyGenericServices = reader.bool();
|
21504 | break;
|
21505 | case 42:
|
21506 | message.phpGenericServices = reader.bool();
|
21507 | break;
|
21508 | case 23:
|
21509 | message.deprecated = reader.bool();
|
21510 | break;
|
21511 | case 31:
|
21512 | message.ccEnableArenas = reader.bool();
|
21513 | break;
|
21514 | case 36:
|
21515 | message.objcClassPrefix = reader.string();
|
21516 | break;
|
21517 | case 37:
|
21518 | message.csharpNamespace = reader.string();
|
21519 | break;
|
21520 | case 39:
|
21521 | message.swiftPrefix = reader.string();
|
21522 | break;
|
21523 | case 40:
|
21524 | message.phpClassPrefix = reader.string();
|
21525 | break;
|
21526 | case 41:
|
21527 | message.phpNamespace = reader.string();
|
21528 | break;
|
21529 | case 44:
|
21530 | message.phpMetadataNamespace = reader.string();
|
21531 | break;
|
21532 | case 45:
|
21533 | message.rubyPackage = reader.string();
|
21534 | break;
|
21535 | case 999:
|
21536 | if (!(message.uninterpretedOption && message.uninterpretedOption.length))
|
21537 | message.uninterpretedOption = [];
|
21538 | message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32()));
|
21539 | break;
|
21540 | case 1053:
|
21541 | if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length))
|
21542 | message[".google.api.resourceDefinition"] = [];
|
21543 | message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32()));
|
21544 | break;
|
21545 | default:
|
21546 | reader.skipType(tag & 7);
|
21547 | break;
|
21548 | }
|
21549 | }
|
21550 | return message;
|
21551 | };
|
21552 |
|
21553 | /**
|
21554 | * Decodes a FileOptions message from the specified reader or buffer, length delimited.
|
21555 | * @function decodeDelimited
|
21556 | * @memberof google.protobuf.FileOptions
|
21557 | * @static
|
21558 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
21559 | * @returns {google.protobuf.FileOptions} FileOptions
|
21560 | * @throws {Error} If the payload is not a reader or valid buffer
|
21561 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
21562 | */
|
21563 | FileOptions.decodeDelimited = function decodeDelimited(reader) {
|
21564 | if (!(reader instanceof $Reader))
|
21565 | reader = new $Reader(reader);
|
21566 | return this.decode(reader, reader.uint32());
|
21567 | };
|
21568 |
|
21569 | /**
|
21570 | * Verifies a FileOptions message.
|
21571 | * @function verify
|
21572 | * @memberof google.protobuf.FileOptions
|
21573 | * @static
|
21574 | * @param {Object.<string,*>} message Plain object to verify
|
21575 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
21576 | */
|
21577 | FileOptions.verify = function verify(message) {
|
21578 | if (typeof message !== "object" || message === null)
|
21579 | return "object expected";
|
21580 | if (message.javaPackage != null && message.hasOwnProperty("javaPackage"))
|
21581 | if (!$util.isString(message.javaPackage))
|
21582 | return "javaPackage: string expected";
|
21583 | if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname"))
|
21584 | if (!$util.isString(message.javaOuterClassname))
|
21585 | return "javaOuterClassname: string expected";
|
21586 | if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles"))
|
21587 | if (typeof message.javaMultipleFiles !== "boolean")
|
21588 | return "javaMultipleFiles: boolean expected";
|
21589 | if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash"))
|
21590 | if (typeof message.javaGenerateEqualsAndHash !== "boolean")
|
21591 | return "javaGenerateEqualsAndHash: boolean expected";
|
21592 | if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8"))
|
21593 | if (typeof message.javaStringCheckUtf8 !== "boolean")
|
21594 | return "javaStringCheckUtf8: boolean expected";
|
21595 | if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor"))
|
21596 | switch (message.optimizeFor) {
|
21597 | default:
|
21598 | return "optimizeFor: enum value expected";
|
21599 | case 1:
|
21600 | case 2:
|
21601 | case 3:
|
21602 | break;
|
21603 | }
|
21604 | if (message.goPackage != null && message.hasOwnProperty("goPackage"))
|
21605 | if (!$util.isString(message.goPackage))
|
21606 | return "goPackage: string expected";
|
21607 | if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices"))
|
21608 | if (typeof message.ccGenericServices !== "boolean")
|
21609 | return "ccGenericServices: boolean expected";
|
21610 | if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices"))
|
21611 | if (typeof message.javaGenericServices !== "boolean")
|
21612 | return "javaGenericServices: boolean expected";
|
21613 | if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices"))
|
21614 | if (typeof message.pyGenericServices !== "boolean")
|
21615 | return "pyGenericServices: boolean expected";
|
21616 | if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices"))
|
21617 | if (typeof message.phpGenericServices !== "boolean")
|
21618 | return "phpGenericServices: boolean expected";
|
21619 | if (message.deprecated != null && message.hasOwnProperty("deprecated"))
|
21620 | if (typeof message.deprecated !== "boolean")
|
21621 | return "deprecated: boolean expected";
|
21622 | if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas"))
|
21623 | if (typeof message.ccEnableArenas !== "boolean")
|
21624 | return "ccEnableArenas: boolean expected";
|
21625 | if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix"))
|
21626 | if (!$util.isString(message.objcClassPrefix))
|
21627 | return "objcClassPrefix: string expected";
|
21628 | if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace"))
|
21629 | if (!$util.isString(message.csharpNamespace))
|
21630 | return "csharpNamespace: string expected";
|
21631 | if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix"))
|
21632 | if (!$util.isString(message.swiftPrefix))
|
21633 | return "swiftPrefix: string expected";
|
21634 | if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix"))
|
21635 | if (!$util.isString(message.phpClassPrefix))
|
21636 | return "phpClassPrefix: string expected";
|
21637 | if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace"))
|
21638 | if (!$util.isString(message.phpNamespace))
|
21639 | return "phpNamespace: string expected";
|
21640 | if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace"))
|
21641 | if (!$util.isString(message.phpMetadataNamespace))
|
21642 | return "phpMetadataNamespace: string expected";
|
21643 | if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage"))
|
21644 | if (!$util.isString(message.rubyPackage))
|
21645 | return "rubyPackage: string expected";
|
21646 | if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) {
|
21647 | if (!Array.isArray(message.uninterpretedOption))
|
21648 | return "uninterpretedOption: array expected";
|
21649 | for (var i = 0; i < message.uninterpretedOption.length; ++i) {
|
21650 | var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]);
|
21651 | if (error)
|
21652 | return "uninterpretedOption." + error;
|
21653 | }
|
21654 | }
|
21655 | if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) {
|
21656 | if (!Array.isArray(message[".google.api.resourceDefinition"]))
|
21657 | return ".google.api.resourceDefinition: array expected";
|
21658 | for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) {
|
21659 | var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]);
|
21660 | if (error)
|
21661 | return ".google.api.resourceDefinition." + error;
|
21662 | }
|
21663 | }
|
21664 | return null;
|
21665 | };
|
21666 |
|
21667 | /**
|
21668 | * Creates a FileOptions message from a plain object. Also converts values to their respective internal types.
|
21669 | * @function fromObject
|
21670 | * @memberof google.protobuf.FileOptions
|
21671 | * @static
|
21672 | * @param {Object.<string,*>} object Plain object
|
21673 | * @returns {google.protobuf.FileOptions} FileOptions
|
21674 | */
|
21675 | FileOptions.fromObject = function fromObject(object) {
|
21676 | if (object instanceof $root.google.protobuf.FileOptions)
|
21677 | return object;
|
21678 | var message = new $root.google.protobuf.FileOptions();
|
21679 | if (object.javaPackage != null)
|
21680 | message.javaPackage = String(object.javaPackage);
|
21681 | if (object.javaOuterClassname != null)
|
21682 | message.javaOuterClassname = String(object.javaOuterClassname);
|
21683 | if (object.javaMultipleFiles != null)
|
21684 | message.javaMultipleFiles = Boolean(object.javaMultipleFiles);
|
21685 | if (object.javaGenerateEqualsAndHash != null)
|
21686 | message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash);
|
21687 | if (object.javaStringCheckUtf8 != null)
|
21688 | message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8);
|
21689 | switch (object.optimizeFor) {
|
21690 | case "SPEED":
|
21691 | case 1:
|
21692 | message.optimizeFor = 1;
|
21693 | break;
|
21694 | case "CODE_SIZE":
|
21695 | case 2:
|
21696 | message.optimizeFor = 2;
|
21697 | break;
|
21698 | case "LITE_RUNTIME":
|
21699 | case 3:
|
21700 | message.optimizeFor = 3;
|
21701 | break;
|
21702 | }
|
21703 | if (object.goPackage != null)
|
21704 | message.goPackage = String(object.goPackage);
|
21705 | if (object.ccGenericServices != null)
|
21706 | message.ccGenericServices = Boolean(object.ccGenericServices);
|
21707 | if (object.javaGenericServices != null)
|
21708 | message.javaGenericServices = Boolean(object.javaGenericServices);
|
21709 | if (object.pyGenericServices != null)
|
21710 | message.pyGenericServices = Boolean(object.pyGenericServices);
|
21711 | if (object.phpGenericServices != null)
|
21712 | message.phpGenericServices = Boolean(object.phpGenericServices);
|
21713 | if (object.deprecated != null)
|
21714 | message.deprecated = Boolean(object.deprecated);
|
21715 | if (object.ccEnableArenas != null)
|
21716 | message.ccEnableArenas = Boolean(object.ccEnableArenas);
|
21717 | if (object.objcClassPrefix != null)
|
21718 | message.objcClassPrefix = String(object.objcClassPrefix);
|
21719 | if (object.csharpNamespace != null)
|
21720 | message.csharpNamespace = String(object.csharpNamespace);
|
21721 | if (object.swiftPrefix != null)
|
21722 | message.swiftPrefix = String(object.swiftPrefix);
|
21723 | if (object.phpClassPrefix != null)
|
21724 | message.phpClassPrefix = String(object.phpClassPrefix);
|
21725 | if (object.phpNamespace != null)
|
21726 | message.phpNamespace = String(object.phpNamespace);
|
21727 | if (object.phpMetadataNamespace != null)
|
21728 | message.phpMetadataNamespace = String(object.phpMetadataNamespace);
|
21729 | if (object.rubyPackage != null)
|
21730 | message.rubyPackage = String(object.rubyPackage);
|
21731 | if (object.uninterpretedOption) {
|
21732 | if (!Array.isArray(object.uninterpretedOption))
|
21733 | throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected");
|
21734 | message.uninterpretedOption = [];
|
21735 | for (var i = 0; i < object.uninterpretedOption.length; ++i) {
|
21736 | if (typeof object.uninterpretedOption[i] !== "object")
|
21737 | throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected");
|
21738 | message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]);
|
21739 | }
|
21740 | }
|
21741 | if (object[".google.api.resourceDefinition"]) {
|
21742 | if (!Array.isArray(object[".google.api.resourceDefinition"]))
|
21743 | throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected");
|
21744 | message[".google.api.resourceDefinition"] = [];
|
21745 | for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) {
|
21746 | if (typeof object[".google.api.resourceDefinition"][i] !== "object")
|
21747 | throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected");
|
21748 | message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]);
|
21749 | }
|
21750 | }
|
21751 | return message;
|
21752 | };
|
21753 |
|
21754 | /**
|
21755 | * Creates a plain object from a FileOptions message. Also converts values to other types if specified.
|
21756 | * @function toObject
|
21757 | * @memberof google.protobuf.FileOptions
|
21758 | * @static
|
21759 | * @param {google.protobuf.FileOptions} message FileOptions
|
21760 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
21761 | * @returns {Object.<string,*>} Plain object
|
21762 | */
|
21763 | FileOptions.toObject = function toObject(message, options) {
|
21764 | if (!options)
|
21765 | options = {};
|
21766 | var object = {};
|
21767 | if (options.arrays || options.defaults) {
|
21768 | object.uninterpretedOption = [];
|
21769 | object[".google.api.resourceDefinition"] = [];
|
21770 | }
|
21771 | if (options.defaults) {
|
21772 | object.javaPackage = "";
|
21773 | object.javaOuterClassname = "";
|
21774 | object.optimizeFor = options.enums === String ? "SPEED" : 1;
|
21775 | object.javaMultipleFiles = false;
|
21776 | object.goPackage = "";
|
21777 | object.ccGenericServices = false;
|
21778 | object.javaGenericServices = false;
|
21779 | object.pyGenericServices = false;
|
21780 | object.javaGenerateEqualsAndHash = false;
|
21781 | object.deprecated = false;
|
21782 | object.javaStringCheckUtf8 = false;
|
21783 | object.ccEnableArenas = true;
|
21784 | object.objcClassPrefix = "";
|
21785 | object.csharpNamespace = "";
|
21786 | object.swiftPrefix = "";
|
21787 | object.phpClassPrefix = "";
|
21788 | object.phpNamespace = "";
|
21789 | object.phpGenericServices = false;
|
21790 | object.phpMetadataNamespace = "";
|
21791 | object.rubyPackage = "";
|
21792 | }
|
21793 | if (message.javaPackage != null && message.hasOwnProperty("javaPackage"))
|
21794 | object.javaPackage = message.javaPackage;
|
21795 | if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname"))
|
21796 | object.javaOuterClassname = message.javaOuterClassname;
|
21797 | if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor"))
|
21798 | object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor;
|
21799 | if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles"))
|
21800 | object.javaMultipleFiles = message.javaMultipleFiles;
|
21801 | if (message.goPackage != null && message.hasOwnProperty("goPackage"))
|
21802 | object.goPackage = message.goPackage;
|
21803 | if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices"))
|
21804 | object.ccGenericServices = message.ccGenericServices;
|
21805 | if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices"))
|
21806 | object.javaGenericServices = message.javaGenericServices;
|
21807 | if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices"))
|
21808 | object.pyGenericServices = message.pyGenericServices;
|
21809 | if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash"))
|
21810 | object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash;
|
21811 | if (message.deprecated != null && message.hasOwnProperty("deprecated"))
|
21812 | object.deprecated = message.deprecated;
|
21813 | if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8"))
|
21814 | object.javaStringCheckUtf8 = message.javaStringCheckUtf8;
|
21815 | if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas"))
|
21816 | object.ccEnableArenas = message.ccEnableArenas;
|
21817 | if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix"))
|
21818 | object.objcClassPrefix = message.objcClassPrefix;
|
21819 | if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace"))
|
21820 | object.csharpNamespace = message.csharpNamespace;
|
21821 | if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix"))
|
21822 | object.swiftPrefix = message.swiftPrefix;
|
21823 | if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix"))
|
21824 | object.phpClassPrefix = message.phpClassPrefix;
|
21825 | if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace"))
|
21826 | object.phpNamespace = message.phpNamespace;
|
21827 | if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices"))
|
21828 | object.phpGenericServices = message.phpGenericServices;
|
21829 | if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace"))
|
21830 | object.phpMetadataNamespace = message.phpMetadataNamespace;
|
21831 | if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage"))
|
21832 | object.rubyPackage = message.rubyPackage;
|
21833 | if (message.uninterpretedOption && message.uninterpretedOption.length) {
|
21834 | object.uninterpretedOption = [];
|
21835 | for (var j = 0; j < message.uninterpretedOption.length; ++j)
|
21836 | object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options);
|
21837 | }
|
21838 | if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) {
|
21839 | object[".google.api.resourceDefinition"] = [];
|
21840 | for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j)
|
21841 | object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options);
|
21842 | }
|
21843 | return object;
|
21844 | };
|
21845 |
|
21846 | /**
|
21847 | * Converts this FileOptions to JSON.
|
21848 | * @function toJSON
|
21849 | * @memberof google.protobuf.FileOptions
|
21850 | * @instance
|
21851 | * @returns {Object.<string,*>} JSON object
|
21852 | */
|
21853 | FileOptions.prototype.toJSON = function toJSON() {
|
21854 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
21855 | };
|
21856 |
|
21857 | /**
|
21858 | * OptimizeMode enum.
|
21859 | * @name google.protobuf.FileOptions.OptimizeMode
|
21860 | * @enum {number}
|
21861 | * @property {number} SPEED=1 SPEED value
|
21862 | * @property {number} CODE_SIZE=2 CODE_SIZE value
|
21863 | * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value
|
21864 | */
|
21865 | FileOptions.OptimizeMode = (function() {
|
21866 | var valuesById = {}, values = Object.create(valuesById);
|
21867 | values[valuesById[1] = "SPEED"] = 1;
|
21868 | values[valuesById[2] = "CODE_SIZE"] = 2;
|
21869 | values[valuesById[3] = "LITE_RUNTIME"] = 3;
|
21870 | return values;
|
21871 | })();
|
21872 |
|
21873 | return FileOptions;
|
21874 | })();
|
21875 |
|
21876 | protobuf.MessageOptions = (function() {
|
21877 |
|
21878 | /**
|
21879 | * Properties of a MessageOptions.
|
21880 | * @memberof google.protobuf
|
21881 | * @interface IMessageOptions
|
21882 | * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat
|
21883 | * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor
|
21884 | * @property {boolean|null} [deprecated] MessageOptions deprecated
|
21885 | * @property {boolean|null} [mapEntry] MessageOptions mapEntry
|
21886 | * @property {Array.<google.protobuf.IUninterpretedOption>|null} [uninterpretedOption] MessageOptions uninterpretedOption
|
21887 | * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource
|
21888 | */
|
21889 |
|
21890 | /**
|
21891 | * Constructs a new MessageOptions.
|
21892 | * @memberof google.protobuf
|
21893 | * @classdesc Represents a MessageOptions.
|
21894 | * @implements IMessageOptions
|
21895 | * @constructor
|
21896 | * @param {google.protobuf.IMessageOptions=} [properties] Properties to set
|
21897 | */
|
21898 | function MessageOptions(properties) {
|
21899 | this.uninterpretedOption = [];
|
21900 | if (properties)
|
21901 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
21902 | if (properties[keys[i]] != null)
|
21903 | this[keys[i]] = properties[keys[i]];
|
21904 | }
|
21905 |
|
21906 | /**
|
21907 | * MessageOptions messageSetWireFormat.
|
21908 | * @member {boolean} messageSetWireFormat
|
21909 | * @memberof google.protobuf.MessageOptions
|
21910 | * @instance
|
21911 | */
|
21912 | MessageOptions.prototype.messageSetWireFormat = false;
|
21913 |
|
21914 | /**
|
21915 | * MessageOptions noStandardDescriptorAccessor.
|
21916 | * @member {boolean} noStandardDescriptorAccessor
|
21917 | * @memberof google.protobuf.MessageOptions
|
21918 | * @instance
|
21919 | */
|
21920 | MessageOptions.prototype.noStandardDescriptorAccessor = false;
|
21921 |
|
21922 | /**
|
21923 | * MessageOptions deprecated.
|
21924 | * @member {boolean} deprecated
|
21925 | * @memberof google.protobuf.MessageOptions
|
21926 | * @instance
|
21927 | */
|
21928 | MessageOptions.prototype.deprecated = false;
|
21929 |
|
21930 | /**
|
21931 | * MessageOptions mapEntry.
|
21932 | * @member {boolean} mapEntry
|
21933 | * @memberof google.protobuf.MessageOptions
|
21934 | * @instance
|
21935 | */
|
21936 | MessageOptions.prototype.mapEntry = false;
|
21937 |
|
21938 | /**
|
21939 | * MessageOptions uninterpretedOption.
|
21940 | * @member {Array.<google.protobuf.IUninterpretedOption>} uninterpretedOption
|
21941 | * @memberof google.protobuf.MessageOptions
|
21942 | * @instance
|
21943 | */
|
21944 | MessageOptions.prototype.uninterpretedOption = $util.emptyArray;
|
21945 |
|
21946 | /**
|
21947 | * MessageOptions .google.api.resource.
|
21948 | * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource
|
21949 | * @memberof google.protobuf.MessageOptions
|
21950 | * @instance
|
21951 | */
|
21952 | MessageOptions.prototype[".google.api.resource"] = null;
|
21953 |
|
21954 | /**
|
21955 | * Creates a new MessageOptions instance using the specified properties.
|
21956 | * @function create
|
21957 | * @memberof google.protobuf.MessageOptions
|
21958 | * @static
|
21959 | * @param {google.protobuf.IMessageOptions=} [properties] Properties to set
|
21960 | * @returns {google.protobuf.MessageOptions} MessageOptions instance
|
21961 | */
|
21962 | MessageOptions.create = function create(properties) {
|
21963 | return new MessageOptions(properties);
|
21964 | };
|
21965 |
|
21966 | /**
|
21967 | * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages.
|
21968 | * @function encode
|
21969 | * @memberof google.protobuf.MessageOptions
|
21970 | * @static
|
21971 | * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode
|
21972 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
21973 | * @returns {$protobuf.Writer} Writer
|
21974 | */
|
21975 | MessageOptions.encode = function encode(message, writer) {
|
21976 | if (!writer)
|
21977 | writer = $Writer.create();
|
21978 | if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat"))
|
21979 | writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat);
|
21980 | if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor"))
|
21981 | writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor);
|
21982 | if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated"))
|
21983 | writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated);
|
21984 | if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry"))
|
21985 | writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry);
|
21986 | if (message.uninterpretedOption != null && message.uninterpretedOption.length)
|
21987 | for (var i = 0; i < message.uninterpretedOption.length; ++i)
|
21988 | $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim();
|
21989 | if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource"))
|
21990 | $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim();
|
21991 | return writer;
|
21992 | };
|
21993 |
|
21994 | /**
|
21995 | * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages.
|
21996 | * @function encodeDelimited
|
21997 | * @memberof google.protobuf.MessageOptions
|
21998 | * @static
|
21999 | * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode
|
22000 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
22001 | * @returns {$protobuf.Writer} Writer
|
22002 | */
|
22003 | MessageOptions.encodeDelimited = function encodeDelimited(message, writer) {
|
22004 | return this.encode(message, writer).ldelim();
|
22005 | };
|
22006 |
|
22007 | /**
|
22008 | * Decodes a MessageOptions message from the specified reader or buffer.
|
22009 | * @function decode
|
22010 | * @memberof google.protobuf.MessageOptions
|
22011 | * @static
|
22012 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
22013 | * @param {number} [length] Message length if known beforehand
|
22014 | * @returns {google.protobuf.MessageOptions} MessageOptions
|
22015 | * @throws {Error} If the payload is not a reader or valid buffer
|
22016 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
22017 | */
|
22018 | MessageOptions.decode = function decode(reader, length) {
|
22019 | if (!(reader instanceof $Reader))
|
22020 | reader = $Reader.create(reader);
|
22021 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions();
|
22022 | while (reader.pos < end) {
|
22023 | var tag = reader.uint32();
|
22024 | switch (tag >>> 3) {
|
22025 | case 1:
|
22026 | message.messageSetWireFormat = reader.bool();
|
22027 | break;
|
22028 | case 2:
|
22029 | message.noStandardDescriptorAccessor = reader.bool();
|
22030 | break;
|
22031 | case 3:
|
22032 | message.deprecated = reader.bool();
|
22033 | break;
|
22034 | case 7:
|
22035 | message.mapEntry = reader.bool();
|
22036 | break;
|
22037 | case 999:
|
22038 | if (!(message.uninterpretedOption && message.uninterpretedOption.length))
|
22039 | message.uninterpretedOption = [];
|
22040 | message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32()));
|
22041 | break;
|
22042 | case 1053:
|
22043 | message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32());
|
22044 | break;
|
22045 | default:
|
22046 | reader.skipType(tag & 7);
|
22047 | break;
|
22048 | }
|
22049 | }
|
22050 | return message;
|
22051 | };
|
22052 |
|
22053 | /**
|
22054 | * Decodes a MessageOptions message from the specified reader or buffer, length delimited.
|
22055 | * @function decodeDelimited
|
22056 | * @memberof google.protobuf.MessageOptions
|
22057 | * @static
|
22058 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
22059 | * @returns {google.protobuf.MessageOptions} MessageOptions
|
22060 | * @throws {Error} If the payload is not a reader or valid buffer
|
22061 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
22062 | */
|
22063 | MessageOptions.decodeDelimited = function decodeDelimited(reader) {
|
22064 | if (!(reader instanceof $Reader))
|
22065 | reader = new $Reader(reader);
|
22066 | return this.decode(reader, reader.uint32());
|
22067 | };
|
22068 |
|
22069 | /**
|
22070 | * Verifies a MessageOptions message.
|
22071 | * @function verify
|
22072 | * @memberof google.protobuf.MessageOptions
|
22073 | * @static
|
22074 | * @param {Object.<string,*>} message Plain object to verify
|
22075 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
22076 | */
|
22077 | MessageOptions.verify = function verify(message) {
|
22078 | if (typeof message !== "object" || message === null)
|
22079 | return "object expected";
|
22080 | if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat"))
|
22081 | if (typeof message.messageSetWireFormat !== "boolean")
|
22082 | return "messageSetWireFormat: boolean expected";
|
22083 | if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor"))
|
22084 | if (typeof message.noStandardDescriptorAccessor !== "boolean")
|
22085 | return "noStandardDescriptorAccessor: boolean expected";
|
22086 | if (message.deprecated != null && message.hasOwnProperty("deprecated"))
|
22087 | if (typeof message.deprecated !== "boolean")
|
22088 | return "deprecated: boolean expected";
|
22089 | if (message.mapEntry != null && message.hasOwnProperty("mapEntry"))
|
22090 | if (typeof message.mapEntry !== "boolean")
|
22091 | return "mapEntry: boolean expected";
|
22092 | if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) {
|
22093 | if (!Array.isArray(message.uninterpretedOption))
|
22094 | return "uninterpretedOption: array expected";
|
22095 | for (var i = 0; i < message.uninterpretedOption.length; ++i) {
|
22096 | var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]);
|
22097 | if (error)
|
22098 | return "uninterpretedOption." + error;
|
22099 | }
|
22100 | }
|
22101 | if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) {
|
22102 | var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]);
|
22103 | if (error)
|
22104 | return ".google.api.resource." + error;
|
22105 | }
|
22106 | return null;
|
22107 | };
|
22108 |
|
22109 | /**
|
22110 | * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types.
|
22111 | * @function fromObject
|
22112 | * @memberof google.protobuf.MessageOptions
|
22113 | * @static
|
22114 | * @param {Object.<string,*>} object Plain object
|
22115 | * @returns {google.protobuf.MessageOptions} MessageOptions
|
22116 | */
|
22117 | MessageOptions.fromObject = function fromObject(object) {
|
22118 | if (object instanceof $root.google.protobuf.MessageOptions)
|
22119 | return object;
|
22120 | var message = new $root.google.protobuf.MessageOptions();
|
22121 | if (object.messageSetWireFormat != null)
|
22122 | message.messageSetWireFormat = Boolean(object.messageSetWireFormat);
|
22123 | if (object.noStandardDescriptorAccessor != null)
|
22124 | message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor);
|
22125 | if (object.deprecated != null)
|
22126 | message.deprecated = Boolean(object.deprecated);
|
22127 | if (object.mapEntry != null)
|
22128 | message.mapEntry = Boolean(object.mapEntry);
|
22129 | if (object.uninterpretedOption) {
|
22130 | if (!Array.isArray(object.uninterpretedOption))
|
22131 | throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected");
|
22132 | message.uninterpretedOption = [];
|
22133 | for (var i = 0; i < object.uninterpretedOption.length; ++i) {
|
22134 | if (typeof object.uninterpretedOption[i] !== "object")
|
22135 | throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected");
|
22136 | message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]);
|
22137 | }
|
22138 | }
|
22139 | if (object[".google.api.resource"] != null) {
|
22140 | if (typeof object[".google.api.resource"] !== "object")
|
22141 | throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected");
|
22142 | message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]);
|
22143 | }
|
22144 | return message;
|
22145 | };
|
22146 |
|
22147 | /**
|
22148 | * Creates a plain object from a MessageOptions message. Also converts values to other types if specified.
|
22149 | * @function toObject
|
22150 | * @memberof google.protobuf.MessageOptions
|
22151 | * @static
|
22152 | * @param {google.protobuf.MessageOptions} message MessageOptions
|
22153 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
22154 | * @returns {Object.<string,*>} Plain object
|
22155 | */
|
22156 | MessageOptions.toObject = function toObject(message, options) {
|
22157 | if (!options)
|
22158 | options = {};
|
22159 | var object = {};
|
22160 | if (options.arrays || options.defaults)
|
22161 | object.uninterpretedOption = [];
|
22162 | if (options.defaults) {
|
22163 | object.messageSetWireFormat = false;
|
22164 | object.noStandardDescriptorAccessor = false;
|
22165 | object.deprecated = false;
|
22166 | object.mapEntry = false;
|
22167 | object[".google.api.resource"] = null;
|
22168 | }
|
22169 | if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat"))
|
22170 | object.messageSetWireFormat = message.messageSetWireFormat;
|
22171 | if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor"))
|
22172 | object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor;
|
22173 | if (message.deprecated != null && message.hasOwnProperty("deprecated"))
|
22174 | object.deprecated = message.deprecated;
|
22175 | if (message.mapEntry != null && message.hasOwnProperty("mapEntry"))
|
22176 | object.mapEntry = message.mapEntry;
|
22177 | if (message.uninterpretedOption && message.uninterpretedOption.length) {
|
22178 | object.uninterpretedOption = [];
|
22179 | for (var j = 0; j < message.uninterpretedOption.length; ++j)
|
22180 | object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options);
|
22181 | }
|
22182 | if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource"))
|
22183 | object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options);
|
22184 | return object;
|
22185 | };
|
22186 |
|
22187 | /**
|
22188 | * Converts this MessageOptions to JSON.
|
22189 | * @function toJSON
|
22190 | * @memberof google.protobuf.MessageOptions
|
22191 | * @instance
|
22192 | * @returns {Object.<string,*>} JSON object
|
22193 | */
|
22194 | MessageOptions.prototype.toJSON = function toJSON() {
|
22195 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
22196 | };
|
22197 |
|
22198 | return MessageOptions;
|
22199 | })();
|
22200 |
|
22201 | protobuf.FieldOptions = (function() {
|
22202 |
|
22203 | /**
|
22204 | * Properties of a FieldOptions.
|
22205 | * @memberof google.protobuf
|
22206 | * @interface IFieldOptions
|
22207 | * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype
|
22208 | * @property {boolean|null} [packed] FieldOptions packed
|
22209 | * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype
|
22210 | * @property {boolean|null} [lazy] FieldOptions lazy
|
22211 | * @property {boolean|null} [unverifiedLazy] FieldOptions unverifiedLazy
|
22212 | * @property {boolean|null} [deprecated] FieldOptions deprecated
|
22213 | * @property {boolean|null} [weak] FieldOptions weak
|
22214 | * @property {Array.<google.protobuf.IUninterpretedOption>|null} [uninterpretedOption] FieldOptions uninterpretedOption
|
22215 | * @property {Array.<google.api.FieldBehavior>|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior
|
22216 | * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference
|
22217 | */
|
22218 |
|
22219 | /**
|
22220 | * Constructs a new FieldOptions.
|
22221 | * @memberof google.protobuf
|
22222 | * @classdesc Represents a FieldOptions.
|
22223 | * @implements IFieldOptions
|
22224 | * @constructor
|
22225 | * @param {google.protobuf.IFieldOptions=} [properties] Properties to set
|
22226 | */
|
22227 | function FieldOptions(properties) {
|
22228 | this.uninterpretedOption = [];
|
22229 | this[".google.api.fieldBehavior"] = [];
|
22230 | if (properties)
|
22231 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
22232 | if (properties[keys[i]] != null)
|
22233 | this[keys[i]] = properties[keys[i]];
|
22234 | }
|
22235 |
|
22236 | /**
|
22237 | * FieldOptions ctype.
|
22238 | * @member {google.protobuf.FieldOptions.CType} ctype
|
22239 | * @memberof google.protobuf.FieldOptions
|
22240 | * @instance
|
22241 | */
|
22242 | FieldOptions.prototype.ctype = 0;
|
22243 |
|
22244 | /**
|
22245 | * FieldOptions packed.
|
22246 | * @member {boolean} packed
|
22247 | * @memberof google.protobuf.FieldOptions
|
22248 | * @instance
|
22249 | */
|
22250 | FieldOptions.prototype.packed = false;
|
22251 |
|
22252 | /**
|
22253 | * FieldOptions jstype.
|
22254 | * @member {google.protobuf.FieldOptions.JSType} jstype
|
22255 | * @memberof google.protobuf.FieldOptions
|
22256 | * @instance
|
22257 | */
|
22258 | FieldOptions.prototype.jstype = 0;
|
22259 |
|
22260 | /**
|
22261 | * FieldOptions lazy.
|
22262 | * @member {boolean} lazy
|
22263 | * @memberof google.protobuf.FieldOptions
|
22264 | * @instance
|
22265 | */
|
22266 | FieldOptions.prototype.lazy = false;
|
22267 |
|
22268 | /**
|
22269 | * FieldOptions unverifiedLazy.
|
22270 | * @member {boolean} unverifiedLazy
|
22271 | * @memberof google.protobuf.FieldOptions
|
22272 | * @instance
|
22273 | */
|
22274 | FieldOptions.prototype.unverifiedLazy = false;
|
22275 |
|
22276 | /**
|
22277 | * FieldOptions deprecated.
|
22278 | * @member {boolean} deprecated
|
22279 | * @memberof google.protobuf.FieldOptions
|
22280 | * @instance
|
22281 | */
|
22282 | FieldOptions.prototype.deprecated = false;
|
22283 |
|
22284 | /**
|
22285 | * FieldOptions weak.
|
22286 | * @member {boolean} weak
|
22287 | * @memberof google.protobuf.FieldOptions
|
22288 | * @instance
|
22289 | */
|
22290 | FieldOptions.prototype.weak = false;
|
22291 |
|
22292 | /**
|
22293 | * FieldOptions uninterpretedOption.
|
22294 | * @member {Array.<google.protobuf.IUninterpretedOption>} uninterpretedOption
|
22295 | * @memberof google.protobuf.FieldOptions
|
22296 | * @instance
|
22297 | */
|
22298 | FieldOptions.prototype.uninterpretedOption = $util.emptyArray;
|
22299 |
|
22300 | /**
|
22301 | * FieldOptions .google.api.fieldBehavior.
|
22302 | * @member {Array.<google.api.FieldBehavior>} .google.api.fieldBehavior
|
22303 | * @memberof google.protobuf.FieldOptions
|
22304 | * @instance
|
22305 | */
|
22306 | FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray;
|
22307 |
|
22308 | /**
|
22309 | * FieldOptions .google.api.resourceReference.
|
22310 | * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference
|
22311 | * @memberof google.protobuf.FieldOptions
|
22312 | * @instance
|
22313 | */
|
22314 | FieldOptions.prototype[".google.api.resourceReference"] = null;
|
22315 |
|
22316 | /**
|
22317 | * Creates a new FieldOptions instance using the specified properties.
|
22318 | * @function create
|
22319 | * @memberof google.protobuf.FieldOptions
|
22320 | * @static
|
22321 | * @param {google.protobuf.IFieldOptions=} [properties] Properties to set
|
22322 | * @returns {google.protobuf.FieldOptions} FieldOptions instance
|
22323 | */
|
22324 | FieldOptions.create = function create(properties) {
|
22325 | return new FieldOptions(properties);
|
22326 | };
|
22327 |
|
22328 | /**
|
22329 | * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages.
|
22330 | * @function encode
|
22331 | * @memberof google.protobuf.FieldOptions
|
22332 | * @static
|
22333 | * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode
|
22334 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
22335 | * @returns {$protobuf.Writer} Writer
|
22336 | */
|
22337 | FieldOptions.encode = function encode(message, writer) {
|
22338 | if (!writer)
|
22339 | writer = $Writer.create();
|
22340 | if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype"))
|
22341 | writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype);
|
22342 | if (message.packed != null && Object.hasOwnProperty.call(message, "packed"))
|
22343 | writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed);
|
22344 | if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated"))
|
22345 | writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated);
|
22346 | if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy"))
|
22347 | writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy);
|
22348 | if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype"))
|
22349 | writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype);
|
22350 | if (message.weak != null && Object.hasOwnProperty.call(message, "weak"))
|
22351 | writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak);
|
22352 | if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy"))
|
22353 | writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy);
|
22354 | if (message.uninterpretedOption != null && message.uninterpretedOption.length)
|
22355 | for (var i = 0; i < message.uninterpretedOption.length; ++i)
|
22356 | $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim();
|
22357 | if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) {
|
22358 | writer.uint32(/* id 1052, wireType 2 =*/8418).fork();
|
22359 | for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i)
|
22360 | writer.int32(message[".google.api.fieldBehavior"][i]);
|
22361 | writer.ldelim();
|
22362 | }
|
22363 | if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference"))
|
22364 | $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim();
|
22365 | return writer;
|
22366 | };
|
22367 |
|
22368 | /**
|
22369 | * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages.
|
22370 | * @function encodeDelimited
|
22371 | * @memberof google.protobuf.FieldOptions
|
22372 | * @static
|
22373 | * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode
|
22374 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
22375 | * @returns {$protobuf.Writer} Writer
|
22376 | */
|
22377 | FieldOptions.encodeDelimited = function encodeDelimited(message, writer) {
|
22378 | return this.encode(message, writer).ldelim();
|
22379 | };
|
22380 |
|
22381 | /**
|
22382 | * Decodes a FieldOptions message from the specified reader or buffer.
|
22383 | * @function decode
|
22384 | * @memberof google.protobuf.FieldOptions
|
22385 | * @static
|
22386 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
22387 | * @param {number} [length] Message length if known beforehand
|
22388 | * @returns {google.protobuf.FieldOptions} FieldOptions
|
22389 | * @throws {Error} If the payload is not a reader or valid buffer
|
22390 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
22391 | */
|
22392 | FieldOptions.decode = function decode(reader, length) {
|
22393 | if (!(reader instanceof $Reader))
|
22394 | reader = $Reader.create(reader);
|
22395 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions();
|
22396 | while (reader.pos < end) {
|
22397 | var tag = reader.uint32();
|
22398 | switch (tag >>> 3) {
|
22399 | case 1:
|
22400 | message.ctype = reader.int32();
|
22401 | break;
|
22402 | case 2:
|
22403 | message.packed = reader.bool();
|
22404 | break;
|
22405 | case 6:
|
22406 | message.jstype = reader.int32();
|
22407 | break;
|
22408 | case 5:
|
22409 | message.lazy = reader.bool();
|
22410 | break;
|
22411 | case 15:
|
22412 | message.unverifiedLazy = reader.bool();
|
22413 | break;
|
22414 | case 3:
|
22415 | message.deprecated = reader.bool();
|
22416 | break;
|
22417 | case 10:
|
22418 | message.weak = reader.bool();
|
22419 | break;
|
22420 | case 999:
|
22421 | if (!(message.uninterpretedOption && message.uninterpretedOption.length))
|
22422 | message.uninterpretedOption = [];
|
22423 | message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32()));
|
22424 | break;
|
22425 | case 1052:
|
22426 | if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length))
|
22427 | message[".google.api.fieldBehavior"] = [];
|
22428 | if ((tag & 7) === 2) {
|
22429 | var end2 = reader.uint32() + reader.pos;
|
22430 | while (reader.pos < end2)
|
22431 | message[".google.api.fieldBehavior"].push(reader.int32());
|
22432 | } else
|
22433 | message[".google.api.fieldBehavior"].push(reader.int32());
|
22434 | break;
|
22435 | case 1055:
|
22436 | message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32());
|
22437 | break;
|
22438 | default:
|
22439 | reader.skipType(tag & 7);
|
22440 | break;
|
22441 | }
|
22442 | }
|
22443 | return message;
|
22444 | };
|
22445 |
|
22446 | /**
|
22447 | * Decodes a FieldOptions message from the specified reader or buffer, length delimited.
|
22448 | * @function decodeDelimited
|
22449 | * @memberof google.protobuf.FieldOptions
|
22450 | * @static
|
22451 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
22452 | * @returns {google.protobuf.FieldOptions} FieldOptions
|
22453 | * @throws {Error} If the payload is not a reader or valid buffer
|
22454 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
22455 | */
|
22456 | FieldOptions.decodeDelimited = function decodeDelimited(reader) {
|
22457 | if (!(reader instanceof $Reader))
|
22458 | reader = new $Reader(reader);
|
22459 | return this.decode(reader, reader.uint32());
|
22460 | };
|
22461 |
|
22462 | /**
|
22463 | * Verifies a FieldOptions message.
|
22464 | * @function verify
|
22465 | * @memberof google.protobuf.FieldOptions
|
22466 | * @static
|
22467 | * @param {Object.<string,*>} message Plain object to verify
|
22468 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
22469 | */
|
22470 | FieldOptions.verify = function verify(message) {
|
22471 | if (typeof message !== "object" || message === null)
|
22472 | return "object expected";
|
22473 | if (message.ctype != null && message.hasOwnProperty("ctype"))
|
22474 | switch (message.ctype) {
|
22475 | default:
|
22476 | return "ctype: enum value expected";
|
22477 | case 0:
|
22478 | case 1:
|
22479 | case 2:
|
22480 | break;
|
22481 | }
|
22482 | if (message.packed != null && message.hasOwnProperty("packed"))
|
22483 | if (typeof message.packed !== "boolean")
|
22484 | return "packed: boolean expected";
|
22485 | if (message.jstype != null && message.hasOwnProperty("jstype"))
|
22486 | switch (message.jstype) {
|
22487 | default:
|
22488 | return "jstype: enum value expected";
|
22489 | case 0:
|
22490 | case 1:
|
22491 | case 2:
|
22492 | break;
|
22493 | }
|
22494 | if (message.lazy != null && message.hasOwnProperty("lazy"))
|
22495 | if (typeof message.lazy !== "boolean")
|
22496 | return "lazy: boolean expected";
|
22497 | if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy"))
|
22498 | if (typeof message.unverifiedLazy !== "boolean")
|
22499 | return "unverifiedLazy: boolean expected";
|
22500 | if (message.deprecated != null && message.hasOwnProperty("deprecated"))
|
22501 | if (typeof message.deprecated !== "boolean")
|
22502 | return "deprecated: boolean expected";
|
22503 | if (message.weak != null && message.hasOwnProperty("weak"))
|
22504 | if (typeof message.weak !== "boolean")
|
22505 | return "weak: boolean expected";
|
22506 | if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) {
|
22507 | if (!Array.isArray(message.uninterpretedOption))
|
22508 | return "uninterpretedOption: array expected";
|
22509 | for (var i = 0; i < message.uninterpretedOption.length; ++i) {
|
22510 | var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]);
|
22511 | if (error)
|
22512 | return "uninterpretedOption." + error;
|
22513 | }
|
22514 | }
|
22515 | if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) {
|
22516 | if (!Array.isArray(message[".google.api.fieldBehavior"]))
|
22517 | return ".google.api.fieldBehavior: array expected";
|
22518 | for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i)
|
22519 | switch (message[".google.api.fieldBehavior"][i]) {
|
22520 | default:
|
22521 | return ".google.api.fieldBehavior: enum value[] expected";
|
22522 | case 0:
|
22523 | case 1:
|
22524 | case 2:
|
22525 | case 3:
|
22526 | case 4:
|
22527 | case 5:
|
22528 | case 6:
|
22529 | case 7:
|
22530 | break;
|
22531 | }
|
22532 | }
|
22533 | if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) {
|
22534 | var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]);
|
22535 | if (error)
|
22536 | return ".google.api.resourceReference." + error;
|
22537 | }
|
22538 | return null;
|
22539 | };
|
22540 |
|
22541 | /**
|
22542 | * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types.
|
22543 | * @function fromObject
|
22544 | * @memberof google.protobuf.FieldOptions
|
22545 | * @static
|
22546 | * @param {Object.<string,*>} object Plain object
|
22547 | * @returns {google.protobuf.FieldOptions} FieldOptions
|
22548 | */
|
22549 | FieldOptions.fromObject = function fromObject(object) {
|
22550 | if (object instanceof $root.google.protobuf.FieldOptions)
|
22551 | return object;
|
22552 | var message = new $root.google.protobuf.FieldOptions();
|
22553 | switch (object.ctype) {
|
22554 | case "STRING":
|
22555 | case 0:
|
22556 | message.ctype = 0;
|
22557 | break;
|
22558 | case "CORD":
|
22559 | case 1:
|
22560 | message.ctype = 1;
|
22561 | break;
|
22562 | case "STRING_PIECE":
|
22563 | case 2:
|
22564 | message.ctype = 2;
|
22565 | break;
|
22566 | }
|
22567 | if (object.packed != null)
|
22568 | message.packed = Boolean(object.packed);
|
22569 | switch (object.jstype) {
|
22570 | case "JS_NORMAL":
|
22571 | case 0:
|
22572 | message.jstype = 0;
|
22573 | break;
|
22574 | case "JS_STRING":
|
22575 | case 1:
|
22576 | message.jstype = 1;
|
22577 | break;
|
22578 | case "JS_NUMBER":
|
22579 | case 2:
|
22580 | message.jstype = 2;
|
22581 | break;
|
22582 | }
|
22583 | if (object.lazy != null)
|
22584 | message.lazy = Boolean(object.lazy);
|
22585 | if (object.unverifiedLazy != null)
|
22586 | message.unverifiedLazy = Boolean(object.unverifiedLazy);
|
22587 | if (object.deprecated != null)
|
22588 | message.deprecated = Boolean(object.deprecated);
|
22589 | if (object.weak != null)
|
22590 | message.weak = Boolean(object.weak);
|
22591 | if (object.uninterpretedOption) {
|
22592 | if (!Array.isArray(object.uninterpretedOption))
|
22593 | throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected");
|
22594 | message.uninterpretedOption = [];
|
22595 | for (var i = 0; i < object.uninterpretedOption.length; ++i) {
|
22596 | if (typeof object.uninterpretedOption[i] !== "object")
|
22597 | throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected");
|
22598 | message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]);
|
22599 | }
|
22600 | }
|
22601 | if (object[".google.api.fieldBehavior"]) {
|
22602 | if (!Array.isArray(object[".google.api.fieldBehavior"]))
|
22603 | throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected");
|
22604 | message[".google.api.fieldBehavior"] = [];
|
22605 | for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i)
|
22606 | switch (object[".google.api.fieldBehavior"][i]) {
|
22607 | default:
|
22608 | case "FIELD_BEHAVIOR_UNSPECIFIED":
|
22609 | case 0:
|
22610 | message[".google.api.fieldBehavior"][i] = 0;
|
22611 | break;
|
22612 | case "OPTIONAL":
|
22613 | case 1:
|
22614 | message[".google.api.fieldBehavior"][i] = 1;
|
22615 | break;
|
22616 | case "REQUIRED":
|
22617 | case 2:
|
22618 | message[".google.api.fieldBehavior"][i] = 2;
|
22619 | break;
|
22620 | case "OUTPUT_ONLY":
|
22621 | case 3:
|
22622 | message[".google.api.fieldBehavior"][i] = 3;
|
22623 | break;
|
22624 | case "INPUT_ONLY":
|
22625 | case 4:
|
22626 | message[".google.api.fieldBehavior"][i] = 4;
|
22627 | break;
|
22628 | case "IMMUTABLE":
|
22629 | case 5:
|
22630 | message[".google.api.fieldBehavior"][i] = 5;
|
22631 | break;
|
22632 | case "UNORDERED_LIST":
|
22633 | case 6:
|
22634 | message[".google.api.fieldBehavior"][i] = 6;
|
22635 | break;
|
22636 | case "NON_EMPTY_DEFAULT":
|
22637 | case 7:
|
22638 | message[".google.api.fieldBehavior"][i] = 7;
|
22639 | break;
|
22640 | }
|
22641 | }
|
22642 | if (object[".google.api.resourceReference"] != null) {
|
22643 | if (typeof object[".google.api.resourceReference"] !== "object")
|
22644 | throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected");
|
22645 | message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]);
|
22646 | }
|
22647 | return message;
|
22648 | };
|
22649 |
|
22650 | /**
|
22651 | * Creates a plain object from a FieldOptions message. Also converts values to other types if specified.
|
22652 | * @function toObject
|
22653 | * @memberof google.protobuf.FieldOptions
|
22654 | * @static
|
22655 | * @param {google.protobuf.FieldOptions} message FieldOptions
|
22656 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
22657 | * @returns {Object.<string,*>} Plain object
|
22658 | */
|
22659 | FieldOptions.toObject = function toObject(message, options) {
|
22660 | if (!options)
|
22661 | options = {};
|
22662 | var object = {};
|
22663 | if (options.arrays || options.defaults) {
|
22664 | object.uninterpretedOption = [];
|
22665 | object[".google.api.fieldBehavior"] = [];
|
22666 | }
|
22667 | if (options.defaults) {
|
22668 | object.ctype = options.enums === String ? "STRING" : 0;
|
22669 | object.packed = false;
|
22670 | object.deprecated = false;
|
22671 | object.lazy = false;
|
22672 | object.jstype = options.enums === String ? "JS_NORMAL" : 0;
|
22673 | object.weak = false;
|
22674 | object.unverifiedLazy = false;
|
22675 | object[".google.api.resourceReference"] = null;
|
22676 | }
|
22677 | if (message.ctype != null && message.hasOwnProperty("ctype"))
|
22678 | object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype;
|
22679 | if (message.packed != null && message.hasOwnProperty("packed"))
|
22680 | object.packed = message.packed;
|
22681 | if (message.deprecated != null && message.hasOwnProperty("deprecated"))
|
22682 | object.deprecated = message.deprecated;
|
22683 | if (message.lazy != null && message.hasOwnProperty("lazy"))
|
22684 | object.lazy = message.lazy;
|
22685 | if (message.jstype != null && message.hasOwnProperty("jstype"))
|
22686 | object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype;
|
22687 | if (message.weak != null && message.hasOwnProperty("weak"))
|
22688 | object.weak = message.weak;
|
22689 | if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy"))
|
22690 | object.unverifiedLazy = message.unverifiedLazy;
|
22691 | if (message.uninterpretedOption && message.uninterpretedOption.length) {
|
22692 | object.uninterpretedOption = [];
|
22693 | for (var j = 0; j < message.uninterpretedOption.length; ++j)
|
22694 | object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options);
|
22695 | }
|
22696 | if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) {
|
22697 | object[".google.api.fieldBehavior"] = [];
|
22698 | for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j)
|
22699 | object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j];
|
22700 | }
|
22701 | if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference"))
|
22702 | object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options);
|
22703 | return object;
|
22704 | };
|
22705 |
|
22706 | /**
|
22707 | * Converts this FieldOptions to JSON.
|
22708 | * @function toJSON
|
22709 | * @memberof google.protobuf.FieldOptions
|
22710 | * @instance
|
22711 | * @returns {Object.<string,*>} JSON object
|
22712 | */
|
22713 | FieldOptions.prototype.toJSON = function toJSON() {
|
22714 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
22715 | };
|
22716 |
|
22717 | /**
|
22718 | * CType enum.
|
22719 | * @name google.protobuf.FieldOptions.CType
|
22720 | * @enum {number}
|
22721 | * @property {number} STRING=0 STRING value
|
22722 | * @property {number} CORD=1 CORD value
|
22723 | * @property {number} STRING_PIECE=2 STRING_PIECE value
|
22724 | */
|
22725 | FieldOptions.CType = (function() {
|
22726 | var valuesById = {}, values = Object.create(valuesById);
|
22727 | values[valuesById[0] = "STRING"] = 0;
|
22728 | values[valuesById[1] = "CORD"] = 1;
|
22729 | values[valuesById[2] = "STRING_PIECE"] = 2;
|
22730 | return values;
|
22731 | })();
|
22732 |
|
22733 | /**
|
22734 | * JSType enum.
|
22735 | * @name google.protobuf.FieldOptions.JSType
|
22736 | * @enum {number}
|
22737 | * @property {number} JS_NORMAL=0 JS_NORMAL value
|
22738 | * @property {number} JS_STRING=1 JS_STRING value
|
22739 | * @property {number} JS_NUMBER=2 JS_NUMBER value
|
22740 | */
|
22741 | FieldOptions.JSType = (function() {
|
22742 | var valuesById = {}, values = Object.create(valuesById);
|
22743 | values[valuesById[0] = "JS_NORMAL"] = 0;
|
22744 | values[valuesById[1] = "JS_STRING"] = 1;
|
22745 | values[valuesById[2] = "JS_NUMBER"] = 2;
|
22746 | return values;
|
22747 | })();
|
22748 |
|
22749 | return FieldOptions;
|
22750 | })();
|
22751 |
|
22752 | protobuf.OneofOptions = (function() {
|
22753 |
|
22754 | /**
|
22755 | * Properties of an OneofOptions.
|
22756 | * @memberof google.protobuf
|
22757 | * @interface IOneofOptions
|
22758 | * @property {Array.<google.protobuf.IUninterpretedOption>|null} [uninterpretedOption] OneofOptions uninterpretedOption
|
22759 | */
|
22760 |
|
22761 | /**
|
22762 | * Constructs a new OneofOptions.
|
22763 | * @memberof google.protobuf
|
22764 | * @classdesc Represents an OneofOptions.
|
22765 | * @implements IOneofOptions
|
22766 | * @constructor
|
22767 | * @param {google.protobuf.IOneofOptions=} [properties] Properties to set
|
22768 | */
|
22769 | function OneofOptions(properties) {
|
22770 | this.uninterpretedOption = [];
|
22771 | if (properties)
|
22772 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
22773 | if (properties[keys[i]] != null)
|
22774 | this[keys[i]] = properties[keys[i]];
|
22775 | }
|
22776 |
|
22777 | /**
|
22778 | * OneofOptions uninterpretedOption.
|
22779 | * @member {Array.<google.protobuf.IUninterpretedOption>} uninterpretedOption
|
22780 | * @memberof google.protobuf.OneofOptions
|
22781 | * @instance
|
22782 | */
|
22783 | OneofOptions.prototype.uninterpretedOption = $util.emptyArray;
|
22784 |
|
22785 | /**
|
22786 | * Creates a new OneofOptions instance using the specified properties.
|
22787 | * @function create
|
22788 | * @memberof google.protobuf.OneofOptions
|
22789 | * @static
|
22790 | * @param {google.protobuf.IOneofOptions=} [properties] Properties to set
|
22791 | * @returns {google.protobuf.OneofOptions} OneofOptions instance
|
22792 | */
|
22793 | OneofOptions.create = function create(properties) {
|
22794 | return new OneofOptions(properties);
|
22795 | };
|
22796 |
|
22797 | /**
|
22798 | * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages.
|
22799 | * @function encode
|
22800 | * @memberof google.protobuf.OneofOptions
|
22801 | * @static
|
22802 | * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode
|
22803 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
22804 | * @returns {$protobuf.Writer} Writer
|
22805 | */
|
22806 | OneofOptions.encode = function encode(message, writer) {
|
22807 | if (!writer)
|
22808 | writer = $Writer.create();
|
22809 | if (message.uninterpretedOption != null && message.uninterpretedOption.length)
|
22810 | for (var i = 0; i < message.uninterpretedOption.length; ++i)
|
22811 | $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim();
|
22812 | return writer;
|
22813 | };
|
22814 |
|
22815 | /**
|
22816 | * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages.
|
22817 | * @function encodeDelimited
|
22818 | * @memberof google.protobuf.OneofOptions
|
22819 | * @static
|
22820 | * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode
|
22821 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
22822 | * @returns {$protobuf.Writer} Writer
|
22823 | */
|
22824 | OneofOptions.encodeDelimited = function encodeDelimited(message, writer) {
|
22825 | return this.encode(message, writer).ldelim();
|
22826 | };
|
22827 |
|
22828 | /**
|
22829 | * Decodes an OneofOptions message from the specified reader or buffer.
|
22830 | * @function decode
|
22831 | * @memberof google.protobuf.OneofOptions
|
22832 | * @static
|
22833 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
22834 | * @param {number} [length] Message length if known beforehand
|
22835 | * @returns {google.protobuf.OneofOptions} OneofOptions
|
22836 | * @throws {Error} If the payload is not a reader or valid buffer
|
22837 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
22838 | */
|
22839 | OneofOptions.decode = function decode(reader, length) {
|
22840 | if (!(reader instanceof $Reader))
|
22841 | reader = $Reader.create(reader);
|
22842 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions();
|
22843 | while (reader.pos < end) {
|
22844 | var tag = reader.uint32();
|
22845 | switch (tag >>> 3) {
|
22846 | case 999:
|
22847 | if (!(message.uninterpretedOption && message.uninterpretedOption.length))
|
22848 | message.uninterpretedOption = [];
|
22849 | message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32()));
|
22850 | break;
|
22851 | default:
|
22852 | reader.skipType(tag & 7);
|
22853 | break;
|
22854 | }
|
22855 | }
|
22856 | return message;
|
22857 | };
|
22858 |
|
22859 | /**
|
22860 | * Decodes an OneofOptions message from the specified reader or buffer, length delimited.
|
22861 | * @function decodeDelimited
|
22862 | * @memberof google.protobuf.OneofOptions
|
22863 | * @static
|
22864 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
22865 | * @returns {google.protobuf.OneofOptions} OneofOptions
|
22866 | * @throws {Error} If the payload is not a reader or valid buffer
|
22867 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
22868 | */
|
22869 | OneofOptions.decodeDelimited = function decodeDelimited(reader) {
|
22870 | if (!(reader instanceof $Reader))
|
22871 | reader = new $Reader(reader);
|
22872 | return this.decode(reader, reader.uint32());
|
22873 | };
|
22874 |
|
22875 | /**
|
22876 | * Verifies an OneofOptions message.
|
22877 | * @function verify
|
22878 | * @memberof google.protobuf.OneofOptions
|
22879 | * @static
|
22880 | * @param {Object.<string,*>} message Plain object to verify
|
22881 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
22882 | */
|
22883 | OneofOptions.verify = function verify(message) {
|
22884 | if (typeof message !== "object" || message === null)
|
22885 | return "object expected";
|
22886 | if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) {
|
22887 | if (!Array.isArray(message.uninterpretedOption))
|
22888 | return "uninterpretedOption: array expected";
|
22889 | for (var i = 0; i < message.uninterpretedOption.length; ++i) {
|
22890 | var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]);
|
22891 | if (error)
|
22892 | return "uninterpretedOption." + error;
|
22893 | }
|
22894 | }
|
22895 | return null;
|
22896 | };
|
22897 |
|
22898 | /**
|
22899 | * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types.
|
22900 | * @function fromObject
|
22901 | * @memberof google.protobuf.OneofOptions
|
22902 | * @static
|
22903 | * @param {Object.<string,*>} object Plain object
|
22904 | * @returns {google.protobuf.OneofOptions} OneofOptions
|
22905 | */
|
22906 | OneofOptions.fromObject = function fromObject(object) {
|
22907 | if (object instanceof $root.google.protobuf.OneofOptions)
|
22908 | return object;
|
22909 | var message = new $root.google.protobuf.OneofOptions();
|
22910 | if (object.uninterpretedOption) {
|
22911 | if (!Array.isArray(object.uninterpretedOption))
|
22912 | throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected");
|
22913 | message.uninterpretedOption = [];
|
22914 | for (var i = 0; i < object.uninterpretedOption.length; ++i) {
|
22915 | if (typeof object.uninterpretedOption[i] !== "object")
|
22916 | throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected");
|
22917 | message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]);
|
22918 | }
|
22919 | }
|
22920 | return message;
|
22921 | };
|
22922 |
|
22923 | /**
|
22924 | * Creates a plain object from an OneofOptions message. Also converts values to other types if specified.
|
22925 | * @function toObject
|
22926 | * @memberof google.protobuf.OneofOptions
|
22927 | * @static
|
22928 | * @param {google.protobuf.OneofOptions} message OneofOptions
|
22929 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
22930 | * @returns {Object.<string,*>} Plain object
|
22931 | */
|
22932 | OneofOptions.toObject = function toObject(message, options) {
|
22933 | if (!options)
|
22934 | options = {};
|
22935 | var object = {};
|
22936 | if (options.arrays || options.defaults)
|
22937 | object.uninterpretedOption = [];
|
22938 | if (message.uninterpretedOption && message.uninterpretedOption.length) {
|
22939 | object.uninterpretedOption = [];
|
22940 | for (var j = 0; j < message.uninterpretedOption.length; ++j)
|
22941 | object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options);
|
22942 | }
|
22943 | return object;
|
22944 | };
|
22945 |
|
22946 | /**
|
22947 | * Converts this OneofOptions to JSON.
|
22948 | * @function toJSON
|
22949 | * @memberof google.protobuf.OneofOptions
|
22950 | * @instance
|
22951 | * @returns {Object.<string,*>} JSON object
|
22952 | */
|
22953 | OneofOptions.prototype.toJSON = function toJSON() {
|
22954 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
22955 | };
|
22956 |
|
22957 | return OneofOptions;
|
22958 | })();
|
22959 |
|
22960 | protobuf.EnumOptions = (function() {
|
22961 |
|
22962 | /**
|
22963 | * Properties of an EnumOptions.
|
22964 | * @memberof google.protobuf
|
22965 | * @interface IEnumOptions
|
22966 | * @property {boolean|null} [allowAlias] EnumOptions allowAlias
|
22967 | * @property {boolean|null} [deprecated] EnumOptions deprecated
|
22968 | * @property {Array.<google.protobuf.IUninterpretedOption>|null} [uninterpretedOption] EnumOptions uninterpretedOption
|
22969 | */
|
22970 |
|
22971 | /**
|
22972 | * Constructs a new EnumOptions.
|
22973 | * @memberof google.protobuf
|
22974 | * @classdesc Represents an EnumOptions.
|
22975 | * @implements IEnumOptions
|
22976 | * @constructor
|
22977 | * @param {google.protobuf.IEnumOptions=} [properties] Properties to set
|
22978 | */
|
22979 | function EnumOptions(properties) {
|
22980 | this.uninterpretedOption = [];
|
22981 | if (properties)
|
22982 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
22983 | if (properties[keys[i]] != null)
|
22984 | this[keys[i]] = properties[keys[i]];
|
22985 | }
|
22986 |
|
22987 | /**
|
22988 | * EnumOptions allowAlias.
|
22989 | * @member {boolean} allowAlias
|
22990 | * @memberof google.protobuf.EnumOptions
|
22991 | * @instance
|
22992 | */
|
22993 | EnumOptions.prototype.allowAlias = false;
|
22994 |
|
22995 | /**
|
22996 | * EnumOptions deprecated.
|
22997 | * @member {boolean} deprecated
|
22998 | * @memberof google.protobuf.EnumOptions
|
22999 | * @instance
|
23000 | */
|
23001 | EnumOptions.prototype.deprecated = false;
|
23002 |
|
23003 | /**
|
23004 | * EnumOptions uninterpretedOption.
|
23005 | * @member {Array.<google.protobuf.IUninterpretedOption>} uninterpretedOption
|
23006 | * @memberof google.protobuf.EnumOptions
|
23007 | * @instance
|
23008 | */
|
23009 | EnumOptions.prototype.uninterpretedOption = $util.emptyArray;
|
23010 |
|
23011 | /**
|
23012 | * Creates a new EnumOptions instance using the specified properties.
|
23013 | * @function create
|
23014 | * @memberof google.protobuf.EnumOptions
|
23015 | * @static
|
23016 | * @param {google.protobuf.IEnumOptions=} [properties] Properties to set
|
23017 | * @returns {google.protobuf.EnumOptions} EnumOptions instance
|
23018 | */
|
23019 | EnumOptions.create = function create(properties) {
|
23020 | return new EnumOptions(properties);
|
23021 | };
|
23022 |
|
23023 | /**
|
23024 | * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages.
|
23025 | * @function encode
|
23026 | * @memberof google.protobuf.EnumOptions
|
23027 | * @static
|
23028 | * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode
|
23029 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
23030 | * @returns {$protobuf.Writer} Writer
|
23031 | */
|
23032 | EnumOptions.encode = function encode(message, writer) {
|
23033 | if (!writer)
|
23034 | writer = $Writer.create();
|
23035 | if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias"))
|
23036 | writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias);
|
23037 | if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated"))
|
23038 | writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated);
|
23039 | if (message.uninterpretedOption != null && message.uninterpretedOption.length)
|
23040 | for (var i = 0; i < message.uninterpretedOption.length; ++i)
|
23041 | $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim();
|
23042 | return writer;
|
23043 | };
|
23044 |
|
23045 | /**
|
23046 | * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages.
|
23047 | * @function encodeDelimited
|
23048 | * @memberof google.protobuf.EnumOptions
|
23049 | * @static
|
23050 | * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode
|
23051 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
23052 | * @returns {$protobuf.Writer} Writer
|
23053 | */
|
23054 | EnumOptions.encodeDelimited = function encodeDelimited(message, writer) {
|
23055 | return this.encode(message, writer).ldelim();
|
23056 | };
|
23057 |
|
23058 | /**
|
23059 | * Decodes an EnumOptions message from the specified reader or buffer.
|
23060 | * @function decode
|
23061 | * @memberof google.protobuf.EnumOptions
|
23062 | * @static
|
23063 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
23064 | * @param {number} [length] Message length if known beforehand
|
23065 | * @returns {google.protobuf.EnumOptions} EnumOptions
|
23066 | * @throws {Error} If the payload is not a reader or valid buffer
|
23067 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
23068 | */
|
23069 | EnumOptions.decode = function decode(reader, length) {
|
23070 | if (!(reader instanceof $Reader))
|
23071 | reader = $Reader.create(reader);
|
23072 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions();
|
23073 | while (reader.pos < end) {
|
23074 | var tag = reader.uint32();
|
23075 | switch (tag >>> 3) {
|
23076 | case 2:
|
23077 | message.allowAlias = reader.bool();
|
23078 | break;
|
23079 | case 3:
|
23080 | message.deprecated = reader.bool();
|
23081 | break;
|
23082 | case 999:
|
23083 | if (!(message.uninterpretedOption && message.uninterpretedOption.length))
|
23084 | message.uninterpretedOption = [];
|
23085 | message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32()));
|
23086 | break;
|
23087 | default:
|
23088 | reader.skipType(tag & 7);
|
23089 | break;
|
23090 | }
|
23091 | }
|
23092 | return message;
|
23093 | };
|
23094 |
|
23095 | /**
|
23096 | * Decodes an EnumOptions message from the specified reader or buffer, length delimited.
|
23097 | * @function decodeDelimited
|
23098 | * @memberof google.protobuf.EnumOptions
|
23099 | * @static
|
23100 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
23101 | * @returns {google.protobuf.EnumOptions} EnumOptions
|
23102 | * @throws {Error} If the payload is not a reader or valid buffer
|
23103 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
23104 | */
|
23105 | EnumOptions.decodeDelimited = function decodeDelimited(reader) {
|
23106 | if (!(reader instanceof $Reader))
|
23107 | reader = new $Reader(reader);
|
23108 | return this.decode(reader, reader.uint32());
|
23109 | };
|
23110 |
|
23111 | /**
|
23112 | * Verifies an EnumOptions message.
|
23113 | * @function verify
|
23114 | * @memberof google.protobuf.EnumOptions
|
23115 | * @static
|
23116 | * @param {Object.<string,*>} message Plain object to verify
|
23117 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
23118 | */
|
23119 | EnumOptions.verify = function verify(message) {
|
23120 | if (typeof message !== "object" || message === null)
|
23121 | return "object expected";
|
23122 | if (message.allowAlias != null && message.hasOwnProperty("allowAlias"))
|
23123 | if (typeof message.allowAlias !== "boolean")
|
23124 | return "allowAlias: boolean expected";
|
23125 | if (message.deprecated != null && message.hasOwnProperty("deprecated"))
|
23126 | if (typeof message.deprecated !== "boolean")
|
23127 | return "deprecated: boolean expected";
|
23128 | if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) {
|
23129 | if (!Array.isArray(message.uninterpretedOption))
|
23130 | return "uninterpretedOption: array expected";
|
23131 | for (var i = 0; i < message.uninterpretedOption.length; ++i) {
|
23132 | var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]);
|
23133 | if (error)
|
23134 | return "uninterpretedOption." + error;
|
23135 | }
|
23136 | }
|
23137 | return null;
|
23138 | };
|
23139 |
|
23140 | /**
|
23141 | * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types.
|
23142 | * @function fromObject
|
23143 | * @memberof google.protobuf.EnumOptions
|
23144 | * @static
|
23145 | * @param {Object.<string,*>} object Plain object
|
23146 | * @returns {google.protobuf.EnumOptions} EnumOptions
|
23147 | */
|
23148 | EnumOptions.fromObject = function fromObject(object) {
|
23149 | if (object instanceof $root.google.protobuf.EnumOptions)
|
23150 | return object;
|
23151 | var message = new $root.google.protobuf.EnumOptions();
|
23152 | if (object.allowAlias != null)
|
23153 | message.allowAlias = Boolean(object.allowAlias);
|
23154 | if (object.deprecated != null)
|
23155 | message.deprecated = Boolean(object.deprecated);
|
23156 | if (object.uninterpretedOption) {
|
23157 | if (!Array.isArray(object.uninterpretedOption))
|
23158 | throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected");
|
23159 | message.uninterpretedOption = [];
|
23160 | for (var i = 0; i < object.uninterpretedOption.length; ++i) {
|
23161 | if (typeof object.uninterpretedOption[i] !== "object")
|
23162 | throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected");
|
23163 | message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]);
|
23164 | }
|
23165 | }
|
23166 | return message;
|
23167 | };
|
23168 |
|
23169 | /**
|
23170 | * Creates a plain object from an EnumOptions message. Also converts values to other types if specified.
|
23171 | * @function toObject
|
23172 | * @memberof google.protobuf.EnumOptions
|
23173 | * @static
|
23174 | * @param {google.protobuf.EnumOptions} message EnumOptions
|
23175 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
23176 | * @returns {Object.<string,*>} Plain object
|
23177 | */
|
23178 | EnumOptions.toObject = function toObject(message, options) {
|
23179 | if (!options)
|
23180 | options = {};
|
23181 | var object = {};
|
23182 | if (options.arrays || options.defaults)
|
23183 | object.uninterpretedOption = [];
|
23184 | if (options.defaults) {
|
23185 | object.allowAlias = false;
|
23186 | object.deprecated = false;
|
23187 | }
|
23188 | if (message.allowAlias != null && message.hasOwnProperty("allowAlias"))
|
23189 | object.allowAlias = message.allowAlias;
|
23190 | if (message.deprecated != null && message.hasOwnProperty("deprecated"))
|
23191 | object.deprecated = message.deprecated;
|
23192 | if (message.uninterpretedOption && message.uninterpretedOption.length) {
|
23193 | object.uninterpretedOption = [];
|
23194 | for (var j = 0; j < message.uninterpretedOption.length; ++j)
|
23195 | object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options);
|
23196 | }
|
23197 | return object;
|
23198 | };
|
23199 |
|
23200 | /**
|
23201 | * Converts this EnumOptions to JSON.
|
23202 | * @function toJSON
|
23203 | * @memberof google.protobuf.EnumOptions
|
23204 | * @instance
|
23205 | * @returns {Object.<string,*>} JSON object
|
23206 | */
|
23207 | EnumOptions.prototype.toJSON = function toJSON() {
|
23208 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
23209 | };
|
23210 |
|
23211 | return EnumOptions;
|
23212 | })();
|
23213 |
|
23214 | protobuf.EnumValueOptions = (function() {
|
23215 |
|
23216 | /**
|
23217 | * Properties of an EnumValueOptions.
|
23218 | * @memberof google.protobuf
|
23219 | * @interface IEnumValueOptions
|
23220 | * @property {boolean|null} [deprecated] EnumValueOptions deprecated
|
23221 | * @property {Array.<google.protobuf.IUninterpretedOption>|null} [uninterpretedOption] EnumValueOptions uninterpretedOption
|
23222 | */
|
23223 |
|
23224 | /**
|
23225 | * Constructs a new EnumValueOptions.
|
23226 | * @memberof google.protobuf
|
23227 | * @classdesc Represents an EnumValueOptions.
|
23228 | * @implements IEnumValueOptions
|
23229 | * @constructor
|
23230 | * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set
|
23231 | */
|
23232 | function EnumValueOptions(properties) {
|
23233 | this.uninterpretedOption = [];
|
23234 | if (properties)
|
23235 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
23236 | if (properties[keys[i]] != null)
|
23237 | this[keys[i]] = properties[keys[i]];
|
23238 | }
|
23239 |
|
23240 | /**
|
23241 | * EnumValueOptions deprecated.
|
23242 | * @member {boolean} deprecated
|
23243 | * @memberof google.protobuf.EnumValueOptions
|
23244 | * @instance
|
23245 | */
|
23246 | EnumValueOptions.prototype.deprecated = false;
|
23247 |
|
23248 | /**
|
23249 | * EnumValueOptions uninterpretedOption.
|
23250 | * @member {Array.<google.protobuf.IUninterpretedOption>} uninterpretedOption
|
23251 | * @memberof google.protobuf.EnumValueOptions
|
23252 | * @instance
|
23253 | */
|
23254 | EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray;
|
23255 |
|
23256 | /**
|
23257 | * Creates a new EnumValueOptions instance using the specified properties.
|
23258 | * @function create
|
23259 | * @memberof google.protobuf.EnumValueOptions
|
23260 | * @static
|
23261 | * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set
|
23262 | * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance
|
23263 | */
|
23264 | EnumValueOptions.create = function create(properties) {
|
23265 | return new EnumValueOptions(properties);
|
23266 | };
|
23267 |
|
23268 | /**
|
23269 | * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages.
|
23270 | * @function encode
|
23271 | * @memberof google.protobuf.EnumValueOptions
|
23272 | * @static
|
23273 | * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode
|
23274 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
23275 | * @returns {$protobuf.Writer} Writer
|
23276 | */
|
23277 | EnumValueOptions.encode = function encode(message, writer) {
|
23278 | if (!writer)
|
23279 | writer = $Writer.create();
|
23280 | if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated"))
|
23281 | writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated);
|
23282 | if (message.uninterpretedOption != null && message.uninterpretedOption.length)
|
23283 | for (var i = 0; i < message.uninterpretedOption.length; ++i)
|
23284 | $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim();
|
23285 | return writer;
|
23286 | };
|
23287 |
|
23288 | /**
|
23289 | * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages.
|
23290 | * @function encodeDelimited
|
23291 | * @memberof google.protobuf.EnumValueOptions
|
23292 | * @static
|
23293 | * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode
|
23294 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
23295 | * @returns {$protobuf.Writer} Writer
|
23296 | */
|
23297 | EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) {
|
23298 | return this.encode(message, writer).ldelim();
|
23299 | };
|
23300 |
|
23301 | /**
|
23302 | * Decodes an EnumValueOptions message from the specified reader or buffer.
|
23303 | * @function decode
|
23304 | * @memberof google.protobuf.EnumValueOptions
|
23305 | * @static
|
23306 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
23307 | * @param {number} [length] Message length if known beforehand
|
23308 | * @returns {google.protobuf.EnumValueOptions} EnumValueOptions
|
23309 | * @throws {Error} If the payload is not a reader or valid buffer
|
23310 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
23311 | */
|
23312 | EnumValueOptions.decode = function decode(reader, length) {
|
23313 | if (!(reader instanceof $Reader))
|
23314 | reader = $Reader.create(reader);
|
23315 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions();
|
23316 | while (reader.pos < end) {
|
23317 | var tag = reader.uint32();
|
23318 | switch (tag >>> 3) {
|
23319 | case 1:
|
23320 | message.deprecated = reader.bool();
|
23321 | break;
|
23322 | case 999:
|
23323 | if (!(message.uninterpretedOption && message.uninterpretedOption.length))
|
23324 | message.uninterpretedOption = [];
|
23325 | message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32()));
|
23326 | break;
|
23327 | default:
|
23328 | reader.skipType(tag & 7);
|
23329 | break;
|
23330 | }
|
23331 | }
|
23332 | return message;
|
23333 | };
|
23334 |
|
23335 | /**
|
23336 | * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited.
|
23337 | * @function decodeDelimited
|
23338 | * @memberof google.protobuf.EnumValueOptions
|
23339 | * @static
|
23340 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
23341 | * @returns {google.protobuf.EnumValueOptions} EnumValueOptions
|
23342 | * @throws {Error} If the payload is not a reader or valid buffer
|
23343 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
23344 | */
|
23345 | EnumValueOptions.decodeDelimited = function decodeDelimited(reader) {
|
23346 | if (!(reader instanceof $Reader))
|
23347 | reader = new $Reader(reader);
|
23348 | return this.decode(reader, reader.uint32());
|
23349 | };
|
23350 |
|
23351 | /**
|
23352 | * Verifies an EnumValueOptions message.
|
23353 | * @function verify
|
23354 | * @memberof google.protobuf.EnumValueOptions
|
23355 | * @static
|
23356 | * @param {Object.<string,*>} message Plain object to verify
|
23357 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
23358 | */
|
23359 | EnumValueOptions.verify = function verify(message) {
|
23360 | if (typeof message !== "object" || message === null)
|
23361 | return "object expected";
|
23362 | if (message.deprecated != null && message.hasOwnProperty("deprecated"))
|
23363 | if (typeof message.deprecated !== "boolean")
|
23364 | return "deprecated: boolean expected";
|
23365 | if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) {
|
23366 | if (!Array.isArray(message.uninterpretedOption))
|
23367 | return "uninterpretedOption: array expected";
|
23368 | for (var i = 0; i < message.uninterpretedOption.length; ++i) {
|
23369 | var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]);
|
23370 | if (error)
|
23371 | return "uninterpretedOption." + error;
|
23372 | }
|
23373 | }
|
23374 | return null;
|
23375 | };
|
23376 |
|
23377 | /**
|
23378 | * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types.
|
23379 | * @function fromObject
|
23380 | * @memberof google.protobuf.EnumValueOptions
|
23381 | * @static
|
23382 | * @param {Object.<string,*>} object Plain object
|
23383 | * @returns {google.protobuf.EnumValueOptions} EnumValueOptions
|
23384 | */
|
23385 | EnumValueOptions.fromObject = function fromObject(object) {
|
23386 | if (object instanceof $root.google.protobuf.EnumValueOptions)
|
23387 | return object;
|
23388 | var message = new $root.google.protobuf.EnumValueOptions();
|
23389 | if (object.deprecated != null)
|
23390 | message.deprecated = Boolean(object.deprecated);
|
23391 | if (object.uninterpretedOption) {
|
23392 | if (!Array.isArray(object.uninterpretedOption))
|
23393 | throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected");
|
23394 | message.uninterpretedOption = [];
|
23395 | for (var i = 0; i < object.uninterpretedOption.length; ++i) {
|
23396 | if (typeof object.uninterpretedOption[i] !== "object")
|
23397 | throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected");
|
23398 | message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]);
|
23399 | }
|
23400 | }
|
23401 | return message;
|
23402 | };
|
23403 |
|
23404 | /**
|
23405 | * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified.
|
23406 | * @function toObject
|
23407 | * @memberof google.protobuf.EnumValueOptions
|
23408 | * @static
|
23409 | * @param {google.protobuf.EnumValueOptions} message EnumValueOptions
|
23410 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
23411 | * @returns {Object.<string,*>} Plain object
|
23412 | */
|
23413 | EnumValueOptions.toObject = function toObject(message, options) {
|
23414 | if (!options)
|
23415 | options = {};
|
23416 | var object = {};
|
23417 | if (options.arrays || options.defaults)
|
23418 | object.uninterpretedOption = [];
|
23419 | if (options.defaults)
|
23420 | object.deprecated = false;
|
23421 | if (message.deprecated != null && message.hasOwnProperty("deprecated"))
|
23422 | object.deprecated = message.deprecated;
|
23423 | if (message.uninterpretedOption && message.uninterpretedOption.length) {
|
23424 | object.uninterpretedOption = [];
|
23425 | for (var j = 0; j < message.uninterpretedOption.length; ++j)
|
23426 | object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options);
|
23427 | }
|
23428 | return object;
|
23429 | };
|
23430 |
|
23431 | /**
|
23432 | * Converts this EnumValueOptions to JSON.
|
23433 | * @function toJSON
|
23434 | * @memberof google.protobuf.EnumValueOptions
|
23435 | * @instance
|
23436 | * @returns {Object.<string,*>} JSON object
|
23437 | */
|
23438 | EnumValueOptions.prototype.toJSON = function toJSON() {
|
23439 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
23440 | };
|
23441 |
|
23442 | return EnumValueOptions;
|
23443 | })();
|
23444 |
|
23445 | protobuf.ServiceOptions = (function() {
|
23446 |
|
23447 | /**
|
23448 | * Properties of a ServiceOptions.
|
23449 | * @memberof google.protobuf
|
23450 | * @interface IServiceOptions
|
23451 | * @property {boolean|null} [deprecated] ServiceOptions deprecated
|
23452 | * @property {Array.<google.protobuf.IUninterpretedOption>|null} [uninterpretedOption] ServiceOptions uninterpretedOption
|
23453 | * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost
|
23454 | * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes
|
23455 | */
|
23456 |
|
23457 | /**
|
23458 | * Constructs a new ServiceOptions.
|
23459 | * @memberof google.protobuf
|
23460 | * @classdesc Represents a ServiceOptions.
|
23461 | * @implements IServiceOptions
|
23462 | * @constructor
|
23463 | * @param {google.protobuf.IServiceOptions=} [properties] Properties to set
|
23464 | */
|
23465 | function ServiceOptions(properties) {
|
23466 | this.uninterpretedOption = [];
|
23467 | if (properties)
|
23468 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
23469 | if (properties[keys[i]] != null)
|
23470 | this[keys[i]] = properties[keys[i]];
|
23471 | }
|
23472 |
|
23473 | /**
|
23474 | * ServiceOptions deprecated.
|
23475 | * @member {boolean} deprecated
|
23476 | * @memberof google.protobuf.ServiceOptions
|
23477 | * @instance
|
23478 | */
|
23479 | ServiceOptions.prototype.deprecated = false;
|
23480 |
|
23481 | /**
|
23482 | * ServiceOptions uninterpretedOption.
|
23483 | * @member {Array.<google.protobuf.IUninterpretedOption>} uninterpretedOption
|
23484 | * @memberof google.protobuf.ServiceOptions
|
23485 | * @instance
|
23486 | */
|
23487 | ServiceOptions.prototype.uninterpretedOption = $util.emptyArray;
|
23488 |
|
23489 | /**
|
23490 | * ServiceOptions .google.api.defaultHost.
|
23491 | * @member {string} .google.api.defaultHost
|
23492 | * @memberof google.protobuf.ServiceOptions
|
23493 | * @instance
|
23494 | */
|
23495 | ServiceOptions.prototype[".google.api.defaultHost"] = "";
|
23496 |
|
23497 | /**
|
23498 | * ServiceOptions .google.api.oauthScopes.
|
23499 | * @member {string} .google.api.oauthScopes
|
23500 | * @memberof google.protobuf.ServiceOptions
|
23501 | * @instance
|
23502 | */
|
23503 | ServiceOptions.prototype[".google.api.oauthScopes"] = "";
|
23504 |
|
23505 | /**
|
23506 | * Creates a new ServiceOptions instance using the specified properties.
|
23507 | * @function create
|
23508 | * @memberof google.protobuf.ServiceOptions
|
23509 | * @static
|
23510 | * @param {google.protobuf.IServiceOptions=} [properties] Properties to set
|
23511 | * @returns {google.protobuf.ServiceOptions} ServiceOptions instance
|
23512 | */
|
23513 | ServiceOptions.create = function create(properties) {
|
23514 | return new ServiceOptions(properties);
|
23515 | };
|
23516 |
|
23517 | /**
|
23518 | * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages.
|
23519 | * @function encode
|
23520 | * @memberof google.protobuf.ServiceOptions
|
23521 | * @static
|
23522 | * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode
|
23523 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
23524 | * @returns {$protobuf.Writer} Writer
|
23525 | */
|
23526 | ServiceOptions.encode = function encode(message, writer) {
|
23527 | if (!writer)
|
23528 | writer = $Writer.create();
|
23529 | if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated"))
|
23530 | writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated);
|
23531 | if (message.uninterpretedOption != null && message.uninterpretedOption.length)
|
23532 | for (var i = 0; i < message.uninterpretedOption.length; ++i)
|
23533 | $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim();
|
23534 | if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost"))
|
23535 | writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]);
|
23536 | if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes"))
|
23537 | writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]);
|
23538 | return writer;
|
23539 | };
|
23540 |
|
23541 | /**
|
23542 | * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages.
|
23543 | * @function encodeDelimited
|
23544 | * @memberof google.protobuf.ServiceOptions
|
23545 | * @static
|
23546 | * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode
|
23547 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
23548 | * @returns {$protobuf.Writer} Writer
|
23549 | */
|
23550 | ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) {
|
23551 | return this.encode(message, writer).ldelim();
|
23552 | };
|
23553 |
|
23554 | /**
|
23555 | * Decodes a ServiceOptions message from the specified reader or buffer.
|
23556 | * @function decode
|
23557 | * @memberof google.protobuf.ServiceOptions
|
23558 | * @static
|
23559 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
23560 | * @param {number} [length] Message length if known beforehand
|
23561 | * @returns {google.protobuf.ServiceOptions} ServiceOptions
|
23562 | * @throws {Error} If the payload is not a reader or valid buffer
|
23563 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
23564 | */
|
23565 | ServiceOptions.decode = function decode(reader, length) {
|
23566 | if (!(reader instanceof $Reader))
|
23567 | reader = $Reader.create(reader);
|
23568 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions();
|
23569 | while (reader.pos < end) {
|
23570 | var tag = reader.uint32();
|
23571 | switch (tag >>> 3) {
|
23572 | case 33:
|
23573 | message.deprecated = reader.bool();
|
23574 | break;
|
23575 | case 999:
|
23576 | if (!(message.uninterpretedOption && message.uninterpretedOption.length))
|
23577 | message.uninterpretedOption = [];
|
23578 | message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32()));
|
23579 | break;
|
23580 | case 1049:
|
23581 | message[".google.api.defaultHost"] = reader.string();
|
23582 | break;
|
23583 | case 1050:
|
23584 | message[".google.api.oauthScopes"] = reader.string();
|
23585 | break;
|
23586 | default:
|
23587 | reader.skipType(tag & 7);
|
23588 | break;
|
23589 | }
|
23590 | }
|
23591 | return message;
|
23592 | };
|
23593 |
|
23594 | /**
|
23595 | * Decodes a ServiceOptions message from the specified reader or buffer, length delimited.
|
23596 | * @function decodeDelimited
|
23597 | * @memberof google.protobuf.ServiceOptions
|
23598 | * @static
|
23599 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
23600 | * @returns {google.protobuf.ServiceOptions} ServiceOptions
|
23601 | * @throws {Error} If the payload is not a reader or valid buffer
|
23602 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
23603 | */
|
23604 | ServiceOptions.decodeDelimited = function decodeDelimited(reader) {
|
23605 | if (!(reader instanceof $Reader))
|
23606 | reader = new $Reader(reader);
|
23607 | return this.decode(reader, reader.uint32());
|
23608 | };
|
23609 |
|
23610 | /**
|
23611 | * Verifies a ServiceOptions message.
|
23612 | * @function verify
|
23613 | * @memberof google.protobuf.ServiceOptions
|
23614 | * @static
|
23615 | * @param {Object.<string,*>} message Plain object to verify
|
23616 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
23617 | */
|
23618 | ServiceOptions.verify = function verify(message) {
|
23619 | if (typeof message !== "object" || message === null)
|
23620 | return "object expected";
|
23621 | if (message.deprecated != null && message.hasOwnProperty("deprecated"))
|
23622 | if (typeof message.deprecated !== "boolean")
|
23623 | return "deprecated: boolean expected";
|
23624 | if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) {
|
23625 | if (!Array.isArray(message.uninterpretedOption))
|
23626 | return "uninterpretedOption: array expected";
|
23627 | for (var i = 0; i < message.uninterpretedOption.length; ++i) {
|
23628 | var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]);
|
23629 | if (error)
|
23630 | return "uninterpretedOption." + error;
|
23631 | }
|
23632 | }
|
23633 | if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost"))
|
23634 | if (!$util.isString(message[".google.api.defaultHost"]))
|
23635 | return ".google.api.defaultHost: string expected";
|
23636 | if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes"))
|
23637 | if (!$util.isString(message[".google.api.oauthScopes"]))
|
23638 | return ".google.api.oauthScopes: string expected";
|
23639 | return null;
|
23640 | };
|
23641 |
|
23642 | /**
|
23643 | * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types.
|
23644 | * @function fromObject
|
23645 | * @memberof google.protobuf.ServiceOptions
|
23646 | * @static
|
23647 | * @param {Object.<string,*>} object Plain object
|
23648 | * @returns {google.protobuf.ServiceOptions} ServiceOptions
|
23649 | */
|
23650 | ServiceOptions.fromObject = function fromObject(object) {
|
23651 | if (object instanceof $root.google.protobuf.ServiceOptions)
|
23652 | return object;
|
23653 | var message = new $root.google.protobuf.ServiceOptions();
|
23654 | if (object.deprecated != null)
|
23655 | message.deprecated = Boolean(object.deprecated);
|
23656 | if (object.uninterpretedOption) {
|
23657 | if (!Array.isArray(object.uninterpretedOption))
|
23658 | throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected");
|
23659 | message.uninterpretedOption = [];
|
23660 | for (var i = 0; i < object.uninterpretedOption.length; ++i) {
|
23661 | if (typeof object.uninterpretedOption[i] !== "object")
|
23662 | throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected");
|
23663 | message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]);
|
23664 | }
|
23665 | }
|
23666 | if (object[".google.api.defaultHost"] != null)
|
23667 | message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]);
|
23668 | if (object[".google.api.oauthScopes"] != null)
|
23669 | message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]);
|
23670 | return message;
|
23671 | };
|
23672 |
|
23673 | /**
|
23674 | * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified.
|
23675 | * @function toObject
|
23676 | * @memberof google.protobuf.ServiceOptions
|
23677 | * @static
|
23678 | * @param {google.protobuf.ServiceOptions} message ServiceOptions
|
23679 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
23680 | * @returns {Object.<string,*>} Plain object
|
23681 | */
|
23682 | ServiceOptions.toObject = function toObject(message, options) {
|
23683 | if (!options)
|
23684 | options = {};
|
23685 | var object = {};
|
23686 | if (options.arrays || options.defaults)
|
23687 | object.uninterpretedOption = [];
|
23688 | if (options.defaults) {
|
23689 | object.deprecated = false;
|
23690 | object[".google.api.defaultHost"] = "";
|
23691 | object[".google.api.oauthScopes"] = "";
|
23692 | }
|
23693 | if (message.deprecated != null && message.hasOwnProperty("deprecated"))
|
23694 | object.deprecated = message.deprecated;
|
23695 | if (message.uninterpretedOption && message.uninterpretedOption.length) {
|
23696 | object.uninterpretedOption = [];
|
23697 | for (var j = 0; j < message.uninterpretedOption.length; ++j)
|
23698 | object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options);
|
23699 | }
|
23700 | if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost"))
|
23701 | object[".google.api.defaultHost"] = message[".google.api.defaultHost"];
|
23702 | if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes"))
|
23703 | object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"];
|
23704 | return object;
|
23705 | };
|
23706 |
|
23707 | /**
|
23708 | * Converts this ServiceOptions to JSON.
|
23709 | * @function toJSON
|
23710 | * @memberof google.protobuf.ServiceOptions
|
23711 | * @instance
|
23712 | * @returns {Object.<string,*>} JSON object
|
23713 | */
|
23714 | ServiceOptions.prototype.toJSON = function toJSON() {
|
23715 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
23716 | };
|
23717 |
|
23718 | return ServiceOptions;
|
23719 | })();
|
23720 |
|
23721 | protobuf.MethodOptions = (function() {
|
23722 |
|
23723 | /**
|
23724 | * Properties of a MethodOptions.
|
23725 | * @memberof google.protobuf
|
23726 | * @interface IMethodOptions
|
23727 | * @property {boolean|null} [deprecated] MethodOptions deprecated
|
23728 | * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel
|
23729 | * @property {Array.<google.protobuf.IUninterpretedOption>|null} [uninterpretedOption] MethodOptions uninterpretedOption
|
23730 | * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http
|
23731 | * @property {Array.<string>|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature
|
23732 | */
|
23733 |
|
23734 | /**
|
23735 | * Constructs a new MethodOptions.
|
23736 | * @memberof google.protobuf
|
23737 | * @classdesc Represents a MethodOptions.
|
23738 | * @implements IMethodOptions
|
23739 | * @constructor
|
23740 | * @param {google.protobuf.IMethodOptions=} [properties] Properties to set
|
23741 | */
|
23742 | function MethodOptions(properties) {
|
23743 | this.uninterpretedOption = [];
|
23744 | this[".google.api.methodSignature"] = [];
|
23745 | if (properties)
|
23746 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
23747 | if (properties[keys[i]] != null)
|
23748 | this[keys[i]] = properties[keys[i]];
|
23749 | }
|
23750 |
|
23751 | /**
|
23752 | * MethodOptions deprecated.
|
23753 | * @member {boolean} deprecated
|
23754 | * @memberof google.protobuf.MethodOptions
|
23755 | * @instance
|
23756 | */
|
23757 | MethodOptions.prototype.deprecated = false;
|
23758 |
|
23759 | /**
|
23760 | * MethodOptions idempotencyLevel.
|
23761 | * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel
|
23762 | * @memberof google.protobuf.MethodOptions
|
23763 | * @instance
|
23764 | */
|
23765 | MethodOptions.prototype.idempotencyLevel = 0;
|
23766 |
|
23767 | /**
|
23768 | * MethodOptions uninterpretedOption.
|
23769 | * @member {Array.<google.protobuf.IUninterpretedOption>} uninterpretedOption
|
23770 | * @memberof google.protobuf.MethodOptions
|
23771 | * @instance
|
23772 | */
|
23773 | MethodOptions.prototype.uninterpretedOption = $util.emptyArray;
|
23774 |
|
23775 | /**
|
23776 | * MethodOptions .google.api.http.
|
23777 | * @member {google.api.IHttpRule|null|undefined} .google.api.http
|
23778 | * @memberof google.protobuf.MethodOptions
|
23779 | * @instance
|
23780 | */
|
23781 | MethodOptions.prototype[".google.api.http"] = null;
|
23782 |
|
23783 | /**
|
23784 | * MethodOptions .google.api.methodSignature.
|
23785 | * @member {Array.<string>} .google.api.methodSignature
|
23786 | * @memberof google.protobuf.MethodOptions
|
23787 | * @instance
|
23788 | */
|
23789 | MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray;
|
23790 |
|
23791 | /**
|
23792 | * Creates a new MethodOptions instance using the specified properties.
|
23793 | * @function create
|
23794 | * @memberof google.protobuf.MethodOptions
|
23795 | * @static
|
23796 | * @param {google.protobuf.IMethodOptions=} [properties] Properties to set
|
23797 | * @returns {google.protobuf.MethodOptions} MethodOptions instance
|
23798 | */
|
23799 | MethodOptions.create = function create(properties) {
|
23800 | return new MethodOptions(properties);
|
23801 | };
|
23802 |
|
23803 | /**
|
23804 | * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages.
|
23805 | * @function encode
|
23806 | * @memberof google.protobuf.MethodOptions
|
23807 | * @static
|
23808 | * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode
|
23809 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
23810 | * @returns {$protobuf.Writer} Writer
|
23811 | */
|
23812 | MethodOptions.encode = function encode(message, writer) {
|
23813 | if (!writer)
|
23814 | writer = $Writer.create();
|
23815 | if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated"))
|
23816 | writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated);
|
23817 | if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel"))
|
23818 | writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel);
|
23819 | if (message.uninterpretedOption != null && message.uninterpretedOption.length)
|
23820 | for (var i = 0; i < message.uninterpretedOption.length; ++i)
|
23821 | $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim();
|
23822 | if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length)
|
23823 | for (var i = 0; i < message[".google.api.methodSignature"].length; ++i)
|
23824 | writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]);
|
23825 | if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http"))
|
23826 | $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim();
|
23827 | return writer;
|
23828 | };
|
23829 |
|
23830 | /**
|
23831 | * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages.
|
23832 | * @function encodeDelimited
|
23833 | * @memberof google.protobuf.MethodOptions
|
23834 | * @static
|
23835 | * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode
|
23836 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
23837 | * @returns {$protobuf.Writer} Writer
|
23838 | */
|
23839 | MethodOptions.encodeDelimited = function encodeDelimited(message, writer) {
|
23840 | return this.encode(message, writer).ldelim();
|
23841 | };
|
23842 |
|
23843 | /**
|
23844 | * Decodes a MethodOptions message from the specified reader or buffer.
|
23845 | * @function decode
|
23846 | * @memberof google.protobuf.MethodOptions
|
23847 | * @static
|
23848 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
23849 | * @param {number} [length] Message length if known beforehand
|
23850 | * @returns {google.protobuf.MethodOptions} MethodOptions
|
23851 | * @throws {Error} If the payload is not a reader or valid buffer
|
23852 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
23853 | */
|
23854 | MethodOptions.decode = function decode(reader, length) {
|
23855 | if (!(reader instanceof $Reader))
|
23856 | reader = $Reader.create(reader);
|
23857 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions();
|
23858 | while (reader.pos < end) {
|
23859 | var tag = reader.uint32();
|
23860 | switch (tag >>> 3) {
|
23861 | case 33:
|
23862 | message.deprecated = reader.bool();
|
23863 | break;
|
23864 | case 34:
|
23865 | message.idempotencyLevel = reader.int32();
|
23866 | break;
|
23867 | case 999:
|
23868 | if (!(message.uninterpretedOption && message.uninterpretedOption.length))
|
23869 | message.uninterpretedOption = [];
|
23870 | message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32()));
|
23871 | break;
|
23872 | case 72295728:
|
23873 | message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32());
|
23874 | break;
|
23875 | case 1051:
|
23876 | if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length))
|
23877 | message[".google.api.methodSignature"] = [];
|
23878 | message[".google.api.methodSignature"].push(reader.string());
|
23879 | break;
|
23880 | default:
|
23881 | reader.skipType(tag & 7);
|
23882 | break;
|
23883 | }
|
23884 | }
|
23885 | return message;
|
23886 | };
|
23887 |
|
23888 | /**
|
23889 | * Decodes a MethodOptions message from the specified reader or buffer, length delimited.
|
23890 | * @function decodeDelimited
|
23891 | * @memberof google.protobuf.MethodOptions
|
23892 | * @static
|
23893 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
23894 | * @returns {google.protobuf.MethodOptions} MethodOptions
|
23895 | * @throws {Error} If the payload is not a reader or valid buffer
|
23896 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
23897 | */
|
23898 | MethodOptions.decodeDelimited = function decodeDelimited(reader) {
|
23899 | if (!(reader instanceof $Reader))
|
23900 | reader = new $Reader(reader);
|
23901 | return this.decode(reader, reader.uint32());
|
23902 | };
|
23903 |
|
23904 | /**
|
23905 | * Verifies a MethodOptions message.
|
23906 | * @function verify
|
23907 | * @memberof google.protobuf.MethodOptions
|
23908 | * @static
|
23909 | * @param {Object.<string,*>} message Plain object to verify
|
23910 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
23911 | */
|
23912 | MethodOptions.verify = function verify(message) {
|
23913 | if (typeof message !== "object" || message === null)
|
23914 | return "object expected";
|
23915 | if (message.deprecated != null && message.hasOwnProperty("deprecated"))
|
23916 | if (typeof message.deprecated !== "boolean")
|
23917 | return "deprecated: boolean expected";
|
23918 | if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel"))
|
23919 | switch (message.idempotencyLevel) {
|
23920 | default:
|
23921 | return "idempotencyLevel: enum value expected";
|
23922 | case 0:
|
23923 | case 1:
|
23924 | case 2:
|
23925 | break;
|
23926 | }
|
23927 | if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) {
|
23928 | if (!Array.isArray(message.uninterpretedOption))
|
23929 | return "uninterpretedOption: array expected";
|
23930 | for (var i = 0; i < message.uninterpretedOption.length; ++i) {
|
23931 | var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]);
|
23932 | if (error)
|
23933 | return "uninterpretedOption." + error;
|
23934 | }
|
23935 | }
|
23936 | if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) {
|
23937 | var error = $root.google.api.HttpRule.verify(message[".google.api.http"]);
|
23938 | if (error)
|
23939 | return ".google.api.http." + error;
|
23940 | }
|
23941 | if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) {
|
23942 | if (!Array.isArray(message[".google.api.methodSignature"]))
|
23943 | return ".google.api.methodSignature: array expected";
|
23944 | for (var i = 0; i < message[".google.api.methodSignature"].length; ++i)
|
23945 | if (!$util.isString(message[".google.api.methodSignature"][i]))
|
23946 | return ".google.api.methodSignature: string[] expected";
|
23947 | }
|
23948 | return null;
|
23949 | };
|
23950 |
|
23951 | /**
|
23952 | * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types.
|
23953 | * @function fromObject
|
23954 | * @memberof google.protobuf.MethodOptions
|
23955 | * @static
|
23956 | * @param {Object.<string,*>} object Plain object
|
23957 | * @returns {google.protobuf.MethodOptions} MethodOptions
|
23958 | */
|
23959 | MethodOptions.fromObject = function fromObject(object) {
|
23960 | if (object instanceof $root.google.protobuf.MethodOptions)
|
23961 | return object;
|
23962 | var message = new $root.google.protobuf.MethodOptions();
|
23963 | if (object.deprecated != null)
|
23964 | message.deprecated = Boolean(object.deprecated);
|
23965 | switch (object.idempotencyLevel) {
|
23966 | case "IDEMPOTENCY_UNKNOWN":
|
23967 | case 0:
|
23968 | message.idempotencyLevel = 0;
|
23969 | break;
|
23970 | case "NO_SIDE_EFFECTS":
|
23971 | case 1:
|
23972 | message.idempotencyLevel = 1;
|
23973 | break;
|
23974 | case "IDEMPOTENT":
|
23975 | case 2:
|
23976 | message.idempotencyLevel = 2;
|
23977 | break;
|
23978 | }
|
23979 | if (object.uninterpretedOption) {
|
23980 | if (!Array.isArray(object.uninterpretedOption))
|
23981 | throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected");
|
23982 | message.uninterpretedOption = [];
|
23983 | for (var i = 0; i < object.uninterpretedOption.length; ++i) {
|
23984 | if (typeof object.uninterpretedOption[i] !== "object")
|
23985 | throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected");
|
23986 | message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]);
|
23987 | }
|
23988 | }
|
23989 | if (object[".google.api.http"] != null) {
|
23990 | if (typeof object[".google.api.http"] !== "object")
|
23991 | throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected");
|
23992 | message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]);
|
23993 | }
|
23994 | if (object[".google.api.methodSignature"]) {
|
23995 | if (!Array.isArray(object[".google.api.methodSignature"]))
|
23996 | throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected");
|
23997 | message[".google.api.methodSignature"] = [];
|
23998 | for (var i = 0; i < object[".google.api.methodSignature"].length; ++i)
|
23999 | message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]);
|
24000 | }
|
24001 | return message;
|
24002 | };
|
24003 |
|
24004 | /**
|
24005 | * Creates a plain object from a MethodOptions message. Also converts values to other types if specified.
|
24006 | * @function toObject
|
24007 | * @memberof google.protobuf.MethodOptions
|
24008 | * @static
|
24009 | * @param {google.protobuf.MethodOptions} message MethodOptions
|
24010 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
24011 | * @returns {Object.<string,*>} Plain object
|
24012 | */
|
24013 | MethodOptions.toObject = function toObject(message, options) {
|
24014 | if (!options)
|
24015 | options = {};
|
24016 | var object = {};
|
24017 | if (options.arrays || options.defaults) {
|
24018 | object.uninterpretedOption = [];
|
24019 | object[".google.api.methodSignature"] = [];
|
24020 | }
|
24021 | if (options.defaults) {
|
24022 | object.deprecated = false;
|
24023 | object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0;
|
24024 | object[".google.api.http"] = null;
|
24025 | }
|
24026 | if (message.deprecated != null && message.hasOwnProperty("deprecated"))
|
24027 | object.deprecated = message.deprecated;
|
24028 | if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel"))
|
24029 | object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel;
|
24030 | if (message.uninterpretedOption && message.uninterpretedOption.length) {
|
24031 | object.uninterpretedOption = [];
|
24032 | for (var j = 0; j < message.uninterpretedOption.length; ++j)
|
24033 | object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options);
|
24034 | }
|
24035 | if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) {
|
24036 | object[".google.api.methodSignature"] = [];
|
24037 | for (var j = 0; j < message[".google.api.methodSignature"].length; ++j)
|
24038 | object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j];
|
24039 | }
|
24040 | if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http"))
|
24041 | object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options);
|
24042 | return object;
|
24043 | };
|
24044 |
|
24045 | /**
|
24046 | * Converts this MethodOptions to JSON.
|
24047 | * @function toJSON
|
24048 | * @memberof google.protobuf.MethodOptions
|
24049 | * @instance
|
24050 | * @returns {Object.<string,*>} JSON object
|
24051 | */
|
24052 | MethodOptions.prototype.toJSON = function toJSON() {
|
24053 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
24054 | };
|
24055 |
|
24056 | /**
|
24057 | * IdempotencyLevel enum.
|
24058 | * @name google.protobuf.MethodOptions.IdempotencyLevel
|
24059 | * @enum {number}
|
24060 | * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value
|
24061 | * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value
|
24062 | * @property {number} IDEMPOTENT=2 IDEMPOTENT value
|
24063 | */
|
24064 | MethodOptions.IdempotencyLevel = (function() {
|
24065 | var valuesById = {}, values = Object.create(valuesById);
|
24066 | values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0;
|
24067 | values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1;
|
24068 | values[valuesById[2] = "IDEMPOTENT"] = 2;
|
24069 | return values;
|
24070 | })();
|
24071 |
|
24072 | return MethodOptions;
|
24073 | })();
|
24074 |
|
24075 | protobuf.UninterpretedOption = (function() {
|
24076 |
|
24077 | /**
|
24078 | * Properties of an UninterpretedOption.
|
24079 | * @memberof google.protobuf
|
24080 | * @interface IUninterpretedOption
|
24081 | * @property {Array.<google.protobuf.UninterpretedOption.INamePart>|null} [name] UninterpretedOption name
|
24082 | * @property {string|null} [identifierValue] UninterpretedOption identifierValue
|
24083 | * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue
|
24084 | * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue
|
24085 | * @property {number|null} [doubleValue] UninterpretedOption doubleValue
|
24086 | * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue
|
24087 | * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue
|
24088 | */
|
24089 |
|
24090 | /**
|
24091 | * Constructs a new UninterpretedOption.
|
24092 | * @memberof google.protobuf
|
24093 | * @classdesc Represents an UninterpretedOption.
|
24094 | * @implements IUninterpretedOption
|
24095 | * @constructor
|
24096 | * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set
|
24097 | */
|
24098 | function UninterpretedOption(properties) {
|
24099 | this.name = [];
|
24100 | if (properties)
|
24101 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
24102 | if (properties[keys[i]] != null)
|
24103 | this[keys[i]] = properties[keys[i]];
|
24104 | }
|
24105 |
|
24106 | /**
|
24107 | * UninterpretedOption name.
|
24108 | * @member {Array.<google.protobuf.UninterpretedOption.INamePart>} name
|
24109 | * @memberof google.protobuf.UninterpretedOption
|
24110 | * @instance
|
24111 | */
|
24112 | UninterpretedOption.prototype.name = $util.emptyArray;
|
24113 |
|
24114 | /**
|
24115 | * UninterpretedOption identifierValue.
|
24116 | * @member {string} identifierValue
|
24117 | * @memberof google.protobuf.UninterpretedOption
|
24118 | * @instance
|
24119 | */
|
24120 | UninterpretedOption.prototype.identifierValue = "";
|
24121 |
|
24122 | /**
|
24123 | * UninterpretedOption positiveIntValue.
|
24124 | * @member {number|Long} positiveIntValue
|
24125 | * @memberof google.protobuf.UninterpretedOption
|
24126 | * @instance
|
24127 | */
|
24128 | UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
|
24129 |
|
24130 | /**
|
24131 | * UninterpretedOption negativeIntValue.
|
24132 | * @member {number|Long} negativeIntValue
|
24133 | * @memberof google.protobuf.UninterpretedOption
|
24134 | * @instance
|
24135 | */
|
24136 | UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
24137 |
|
24138 | /**
|
24139 | * UninterpretedOption doubleValue.
|
24140 | * @member {number} doubleValue
|
24141 | * @memberof google.protobuf.UninterpretedOption
|
24142 | * @instance
|
24143 | */
|
24144 | UninterpretedOption.prototype.doubleValue = 0;
|
24145 |
|
24146 | /**
|
24147 | * UninterpretedOption stringValue.
|
24148 | * @member {Uint8Array} stringValue
|
24149 | * @memberof google.protobuf.UninterpretedOption
|
24150 | * @instance
|
24151 | */
|
24152 | UninterpretedOption.prototype.stringValue = $util.newBuffer([]);
|
24153 |
|
24154 | /**
|
24155 | * UninterpretedOption aggregateValue.
|
24156 | * @member {string} aggregateValue
|
24157 | * @memberof google.protobuf.UninterpretedOption
|
24158 | * @instance
|
24159 | */
|
24160 | UninterpretedOption.prototype.aggregateValue = "";
|
24161 |
|
24162 | /**
|
24163 | * Creates a new UninterpretedOption instance using the specified properties.
|
24164 | * @function create
|
24165 | * @memberof google.protobuf.UninterpretedOption
|
24166 | * @static
|
24167 | * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set
|
24168 | * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance
|
24169 | */
|
24170 | UninterpretedOption.create = function create(properties) {
|
24171 | return new UninterpretedOption(properties);
|
24172 | };
|
24173 |
|
24174 | /**
|
24175 | * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages.
|
24176 | * @function encode
|
24177 | * @memberof google.protobuf.UninterpretedOption
|
24178 | * @static
|
24179 | * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode
|
24180 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
24181 | * @returns {$protobuf.Writer} Writer
|
24182 | */
|
24183 | UninterpretedOption.encode = function encode(message, writer) {
|
24184 | if (!writer)
|
24185 | writer = $Writer.create();
|
24186 | if (message.name != null && message.name.length)
|
24187 | for (var i = 0; i < message.name.length; ++i)
|
24188 | $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
24189 | if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue"))
|
24190 | writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue);
|
24191 | if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue"))
|
24192 | writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue);
|
24193 | if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue"))
|
24194 | writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue);
|
24195 | if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue"))
|
24196 | writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue);
|
24197 | if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue"))
|
24198 | writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue);
|
24199 | if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue"))
|
24200 | writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue);
|
24201 | return writer;
|
24202 | };
|
24203 |
|
24204 | /**
|
24205 | * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages.
|
24206 | * @function encodeDelimited
|
24207 | * @memberof google.protobuf.UninterpretedOption
|
24208 | * @static
|
24209 | * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode
|
24210 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
24211 | * @returns {$protobuf.Writer} Writer
|
24212 | */
|
24213 | UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) {
|
24214 | return this.encode(message, writer).ldelim();
|
24215 | };
|
24216 |
|
24217 | /**
|
24218 | * Decodes an UninterpretedOption message from the specified reader or buffer.
|
24219 | * @function decode
|
24220 | * @memberof google.protobuf.UninterpretedOption
|
24221 | * @static
|
24222 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
24223 | * @param {number} [length] Message length if known beforehand
|
24224 | * @returns {google.protobuf.UninterpretedOption} UninterpretedOption
|
24225 | * @throws {Error} If the payload is not a reader or valid buffer
|
24226 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
24227 | */
|
24228 | UninterpretedOption.decode = function decode(reader, length) {
|
24229 | if (!(reader instanceof $Reader))
|
24230 | reader = $Reader.create(reader);
|
24231 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption();
|
24232 | while (reader.pos < end) {
|
24233 | var tag = reader.uint32();
|
24234 | switch (tag >>> 3) {
|
24235 | case 2:
|
24236 | if (!(message.name && message.name.length))
|
24237 | message.name = [];
|
24238 | message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32()));
|
24239 | break;
|
24240 | case 3:
|
24241 | message.identifierValue = reader.string();
|
24242 | break;
|
24243 | case 4:
|
24244 | message.positiveIntValue = reader.uint64();
|
24245 | break;
|
24246 | case 5:
|
24247 | message.negativeIntValue = reader.int64();
|
24248 | break;
|
24249 | case 6:
|
24250 | message.doubleValue = reader.double();
|
24251 | break;
|
24252 | case 7:
|
24253 | message.stringValue = reader.bytes();
|
24254 | break;
|
24255 | case 8:
|
24256 | message.aggregateValue = reader.string();
|
24257 | break;
|
24258 | default:
|
24259 | reader.skipType(tag & 7);
|
24260 | break;
|
24261 | }
|
24262 | }
|
24263 | return message;
|
24264 | };
|
24265 |
|
24266 | /**
|
24267 | * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited.
|
24268 | * @function decodeDelimited
|
24269 | * @memberof google.protobuf.UninterpretedOption
|
24270 | * @static
|
24271 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
24272 | * @returns {google.protobuf.UninterpretedOption} UninterpretedOption
|
24273 | * @throws {Error} If the payload is not a reader or valid buffer
|
24274 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
24275 | */
|
24276 | UninterpretedOption.decodeDelimited = function decodeDelimited(reader) {
|
24277 | if (!(reader instanceof $Reader))
|
24278 | reader = new $Reader(reader);
|
24279 | return this.decode(reader, reader.uint32());
|
24280 | };
|
24281 |
|
24282 | /**
|
24283 | * Verifies an UninterpretedOption message.
|
24284 | * @function verify
|
24285 | * @memberof google.protobuf.UninterpretedOption
|
24286 | * @static
|
24287 | * @param {Object.<string,*>} message Plain object to verify
|
24288 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
24289 | */
|
24290 | UninterpretedOption.verify = function verify(message) {
|
24291 | if (typeof message !== "object" || message === null)
|
24292 | return "object expected";
|
24293 | if (message.name != null && message.hasOwnProperty("name")) {
|
24294 | if (!Array.isArray(message.name))
|
24295 | return "name: array expected";
|
24296 | for (var i = 0; i < message.name.length; ++i) {
|
24297 | var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]);
|
24298 | if (error)
|
24299 | return "name." + error;
|
24300 | }
|
24301 | }
|
24302 | if (message.identifierValue != null && message.hasOwnProperty("identifierValue"))
|
24303 | if (!$util.isString(message.identifierValue))
|
24304 | return "identifierValue: string expected";
|
24305 | if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue"))
|
24306 | if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high)))
|
24307 | return "positiveIntValue: integer|Long expected";
|
24308 | if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue"))
|
24309 | if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high)))
|
24310 | return "negativeIntValue: integer|Long expected";
|
24311 | if (message.doubleValue != null && message.hasOwnProperty("doubleValue"))
|
24312 | if (typeof message.doubleValue !== "number")
|
24313 | return "doubleValue: number expected";
|
24314 | if (message.stringValue != null && message.hasOwnProperty("stringValue"))
|
24315 | if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue)))
|
24316 | return "stringValue: buffer expected";
|
24317 | if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue"))
|
24318 | if (!$util.isString(message.aggregateValue))
|
24319 | return "aggregateValue: string expected";
|
24320 | return null;
|
24321 | };
|
24322 |
|
24323 | /**
|
24324 | * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types.
|
24325 | * @function fromObject
|
24326 | * @memberof google.protobuf.UninterpretedOption
|
24327 | * @static
|
24328 | * @param {Object.<string,*>} object Plain object
|
24329 | * @returns {google.protobuf.UninterpretedOption} UninterpretedOption
|
24330 | */
|
24331 | UninterpretedOption.fromObject = function fromObject(object) {
|
24332 | if (object instanceof $root.google.protobuf.UninterpretedOption)
|
24333 | return object;
|
24334 | var message = new $root.google.protobuf.UninterpretedOption();
|
24335 | if (object.name) {
|
24336 | if (!Array.isArray(object.name))
|
24337 | throw TypeError(".google.protobuf.UninterpretedOption.name: array expected");
|
24338 | message.name = [];
|
24339 | for (var i = 0; i < object.name.length; ++i) {
|
24340 | if (typeof object.name[i] !== "object")
|
24341 | throw TypeError(".google.protobuf.UninterpretedOption.name: object expected");
|
24342 | message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]);
|
24343 | }
|
24344 | }
|
24345 | if (object.identifierValue != null)
|
24346 | message.identifierValue = String(object.identifierValue);
|
24347 | if (object.positiveIntValue != null)
|
24348 | if ($util.Long)
|
24349 | (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true;
|
24350 | else if (typeof object.positiveIntValue === "string")
|
24351 | message.positiveIntValue = parseInt(object.positiveIntValue, 10);
|
24352 | else if (typeof object.positiveIntValue === "number")
|
24353 | message.positiveIntValue = object.positiveIntValue;
|
24354 | else if (typeof object.positiveIntValue === "object")
|
24355 | message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true);
|
24356 | if (object.negativeIntValue != null)
|
24357 | if ($util.Long)
|
24358 | (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false;
|
24359 | else if (typeof object.negativeIntValue === "string")
|
24360 | message.negativeIntValue = parseInt(object.negativeIntValue, 10);
|
24361 | else if (typeof object.negativeIntValue === "number")
|
24362 | message.negativeIntValue = object.negativeIntValue;
|
24363 | else if (typeof object.negativeIntValue === "object")
|
24364 | message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber();
|
24365 | if (object.doubleValue != null)
|
24366 | message.doubleValue = Number(object.doubleValue);
|
24367 | if (object.stringValue != null)
|
24368 | if (typeof object.stringValue === "string")
|
24369 | $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0);
|
24370 | else if (object.stringValue.length)
|
24371 | message.stringValue = object.stringValue;
|
24372 | if (object.aggregateValue != null)
|
24373 | message.aggregateValue = String(object.aggregateValue);
|
24374 | return message;
|
24375 | };
|
24376 |
|
24377 | /**
|
24378 | * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified.
|
24379 | * @function toObject
|
24380 | * @memberof google.protobuf.UninterpretedOption
|
24381 | * @static
|
24382 | * @param {google.protobuf.UninterpretedOption} message UninterpretedOption
|
24383 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
24384 | * @returns {Object.<string,*>} Plain object
|
24385 | */
|
24386 | UninterpretedOption.toObject = function toObject(message, options) {
|
24387 | if (!options)
|
24388 | options = {};
|
24389 | var object = {};
|
24390 | if (options.arrays || options.defaults)
|
24391 | object.name = [];
|
24392 | if (options.defaults) {
|
24393 | object.identifierValue = "";
|
24394 | if ($util.Long) {
|
24395 | var long = new $util.Long(0, 0, true);
|
24396 | object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
24397 | } else
|
24398 | object.positiveIntValue = options.longs === String ? "0" : 0;
|
24399 | if ($util.Long) {
|
24400 | var long = new $util.Long(0, 0, false);
|
24401 | object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
24402 | } else
|
24403 | object.negativeIntValue = options.longs === String ? "0" : 0;
|
24404 | object.doubleValue = 0;
|
24405 | if (options.bytes === String)
|
24406 | object.stringValue = "";
|
24407 | else {
|
24408 | object.stringValue = [];
|
24409 | if (options.bytes !== Array)
|
24410 | object.stringValue = $util.newBuffer(object.stringValue);
|
24411 | }
|
24412 | object.aggregateValue = "";
|
24413 | }
|
24414 | if (message.name && message.name.length) {
|
24415 | object.name = [];
|
24416 | for (var j = 0; j < message.name.length; ++j)
|
24417 | object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options);
|
24418 | }
|
24419 | if (message.identifierValue != null && message.hasOwnProperty("identifierValue"))
|
24420 | object.identifierValue = message.identifierValue;
|
24421 | if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue"))
|
24422 | if (typeof message.positiveIntValue === "number")
|
24423 | object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue;
|
24424 | else
|
24425 | 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;
|
24426 | if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue"))
|
24427 | if (typeof message.negativeIntValue === "number")
|
24428 | object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue;
|
24429 | else
|
24430 | 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;
|
24431 | if (message.doubleValue != null && message.hasOwnProperty("doubleValue"))
|
24432 | object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue;
|
24433 | if (message.stringValue != null && message.hasOwnProperty("stringValue"))
|
24434 | 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;
|
24435 | if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue"))
|
24436 | object.aggregateValue = message.aggregateValue;
|
24437 | return object;
|
24438 | };
|
24439 |
|
24440 | /**
|
24441 | * Converts this UninterpretedOption to JSON.
|
24442 | * @function toJSON
|
24443 | * @memberof google.protobuf.UninterpretedOption
|
24444 | * @instance
|
24445 | * @returns {Object.<string,*>} JSON object
|
24446 | */
|
24447 | UninterpretedOption.prototype.toJSON = function toJSON() {
|
24448 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
24449 | };
|
24450 |
|
24451 | UninterpretedOption.NamePart = (function() {
|
24452 |
|
24453 | /**
|
24454 | * Properties of a NamePart.
|
24455 | * @memberof google.protobuf.UninterpretedOption
|
24456 | * @interface INamePart
|
24457 | * @property {string} namePart NamePart namePart
|
24458 | * @property {boolean} isExtension NamePart isExtension
|
24459 | */
|
24460 |
|
24461 | /**
|
24462 | * Constructs a new NamePart.
|
24463 | * @memberof google.protobuf.UninterpretedOption
|
24464 | * @classdesc Represents a NamePart.
|
24465 | * @implements INamePart
|
24466 | * @constructor
|
24467 | * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set
|
24468 | */
|
24469 | function NamePart(properties) {
|
24470 | if (properties)
|
24471 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
24472 | if (properties[keys[i]] != null)
|
24473 | this[keys[i]] = properties[keys[i]];
|
24474 | }
|
24475 |
|
24476 | /**
|
24477 | * NamePart namePart.
|
24478 | * @member {string} namePart
|
24479 | * @memberof google.protobuf.UninterpretedOption.NamePart
|
24480 | * @instance
|
24481 | */
|
24482 | NamePart.prototype.namePart = "";
|
24483 |
|
24484 | /**
|
24485 | * NamePart isExtension.
|
24486 | * @member {boolean} isExtension
|
24487 | * @memberof google.protobuf.UninterpretedOption.NamePart
|
24488 | * @instance
|
24489 | */
|
24490 | NamePart.prototype.isExtension = false;
|
24491 |
|
24492 | /**
|
24493 | * Creates a new NamePart instance using the specified properties.
|
24494 | * @function create
|
24495 | * @memberof google.protobuf.UninterpretedOption.NamePart
|
24496 | * @static
|
24497 | * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set
|
24498 | * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance
|
24499 | */
|
24500 | NamePart.create = function create(properties) {
|
24501 | return new NamePart(properties);
|
24502 | };
|
24503 |
|
24504 | /**
|
24505 | * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages.
|
24506 | * @function encode
|
24507 | * @memberof google.protobuf.UninterpretedOption.NamePart
|
24508 | * @static
|
24509 | * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode
|
24510 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
24511 | * @returns {$protobuf.Writer} Writer
|
24512 | */
|
24513 | NamePart.encode = function encode(message, writer) {
|
24514 | if (!writer)
|
24515 | writer = $Writer.create();
|
24516 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart);
|
24517 | writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension);
|
24518 | return writer;
|
24519 | };
|
24520 |
|
24521 | /**
|
24522 | * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages.
|
24523 | * @function encodeDelimited
|
24524 | * @memberof google.protobuf.UninterpretedOption.NamePart
|
24525 | * @static
|
24526 | * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode
|
24527 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
24528 | * @returns {$protobuf.Writer} Writer
|
24529 | */
|
24530 | NamePart.encodeDelimited = function encodeDelimited(message, writer) {
|
24531 | return this.encode(message, writer).ldelim();
|
24532 | };
|
24533 |
|
24534 | /**
|
24535 | * Decodes a NamePart message from the specified reader or buffer.
|
24536 | * @function decode
|
24537 | * @memberof google.protobuf.UninterpretedOption.NamePart
|
24538 | * @static
|
24539 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
24540 | * @param {number} [length] Message length if known beforehand
|
24541 | * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart
|
24542 | * @throws {Error} If the payload is not a reader or valid buffer
|
24543 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
24544 | */
|
24545 | NamePart.decode = function decode(reader, length) {
|
24546 | if (!(reader instanceof $Reader))
|
24547 | reader = $Reader.create(reader);
|
24548 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart();
|
24549 | while (reader.pos < end) {
|
24550 | var tag = reader.uint32();
|
24551 | switch (tag >>> 3) {
|
24552 | case 1:
|
24553 | message.namePart = reader.string();
|
24554 | break;
|
24555 | case 2:
|
24556 | message.isExtension = reader.bool();
|
24557 | break;
|
24558 | default:
|
24559 | reader.skipType(tag & 7);
|
24560 | break;
|
24561 | }
|
24562 | }
|
24563 | if (!message.hasOwnProperty("namePart"))
|
24564 | throw $util.ProtocolError("missing required 'namePart'", { instance: message });
|
24565 | if (!message.hasOwnProperty("isExtension"))
|
24566 | throw $util.ProtocolError("missing required 'isExtension'", { instance: message });
|
24567 | return message;
|
24568 | };
|
24569 |
|
24570 | /**
|
24571 | * Decodes a NamePart message from the specified reader or buffer, length delimited.
|
24572 | * @function decodeDelimited
|
24573 | * @memberof google.protobuf.UninterpretedOption.NamePart
|
24574 | * @static
|
24575 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
24576 | * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart
|
24577 | * @throws {Error} If the payload is not a reader or valid buffer
|
24578 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
24579 | */
|
24580 | NamePart.decodeDelimited = function decodeDelimited(reader) {
|
24581 | if (!(reader instanceof $Reader))
|
24582 | reader = new $Reader(reader);
|
24583 | return this.decode(reader, reader.uint32());
|
24584 | };
|
24585 |
|
24586 | /**
|
24587 | * Verifies a NamePart message.
|
24588 | * @function verify
|
24589 | * @memberof google.protobuf.UninterpretedOption.NamePart
|
24590 | * @static
|
24591 | * @param {Object.<string,*>} message Plain object to verify
|
24592 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
24593 | */
|
24594 | NamePart.verify = function verify(message) {
|
24595 | if (typeof message !== "object" || message === null)
|
24596 | return "object expected";
|
24597 | if (!$util.isString(message.namePart))
|
24598 | return "namePart: string expected";
|
24599 | if (typeof message.isExtension !== "boolean")
|
24600 | return "isExtension: boolean expected";
|
24601 | return null;
|
24602 | };
|
24603 |
|
24604 | /**
|
24605 | * Creates a NamePart message from a plain object. Also converts values to their respective internal types.
|
24606 | * @function fromObject
|
24607 | * @memberof google.protobuf.UninterpretedOption.NamePart
|
24608 | * @static
|
24609 | * @param {Object.<string,*>} object Plain object
|
24610 | * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart
|
24611 | */
|
24612 | NamePart.fromObject = function fromObject(object) {
|
24613 | if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart)
|
24614 | return object;
|
24615 | var message = new $root.google.protobuf.UninterpretedOption.NamePart();
|
24616 | if (object.namePart != null)
|
24617 | message.namePart = String(object.namePart);
|
24618 | if (object.isExtension != null)
|
24619 | message.isExtension = Boolean(object.isExtension);
|
24620 | return message;
|
24621 | };
|
24622 |
|
24623 | /**
|
24624 | * Creates a plain object from a NamePart message. Also converts values to other types if specified.
|
24625 | * @function toObject
|
24626 | * @memberof google.protobuf.UninterpretedOption.NamePart
|
24627 | * @static
|
24628 | * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart
|
24629 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
24630 | * @returns {Object.<string,*>} Plain object
|
24631 | */
|
24632 | NamePart.toObject = function toObject(message, options) {
|
24633 | if (!options)
|
24634 | options = {};
|
24635 | var object = {};
|
24636 | if (options.defaults) {
|
24637 | object.namePart = "";
|
24638 | object.isExtension = false;
|
24639 | }
|
24640 | if (message.namePart != null && message.hasOwnProperty("namePart"))
|
24641 | object.namePart = message.namePart;
|
24642 | if (message.isExtension != null && message.hasOwnProperty("isExtension"))
|
24643 | object.isExtension = message.isExtension;
|
24644 | return object;
|
24645 | };
|
24646 |
|
24647 | /**
|
24648 | * Converts this NamePart to JSON.
|
24649 | * @function toJSON
|
24650 | * @memberof google.protobuf.UninterpretedOption.NamePart
|
24651 | * @instance
|
24652 | * @returns {Object.<string,*>} JSON object
|
24653 | */
|
24654 | NamePart.prototype.toJSON = function toJSON() {
|
24655 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
24656 | };
|
24657 |
|
24658 | return NamePart;
|
24659 | })();
|
24660 |
|
24661 | return UninterpretedOption;
|
24662 | })();
|
24663 |
|
24664 | protobuf.SourceCodeInfo = (function() {
|
24665 |
|
24666 | /**
|
24667 | * Properties of a SourceCodeInfo.
|
24668 | * @memberof google.protobuf
|
24669 | * @interface ISourceCodeInfo
|
24670 | * @property {Array.<google.protobuf.SourceCodeInfo.ILocation>|null} [location] SourceCodeInfo location
|
24671 | */
|
24672 |
|
24673 | /**
|
24674 | * Constructs a new SourceCodeInfo.
|
24675 | * @memberof google.protobuf
|
24676 | * @classdesc Represents a SourceCodeInfo.
|
24677 | * @implements ISourceCodeInfo
|
24678 | * @constructor
|
24679 | * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set
|
24680 | */
|
24681 | function SourceCodeInfo(properties) {
|
24682 | this.location = [];
|
24683 | if (properties)
|
24684 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
24685 | if (properties[keys[i]] != null)
|
24686 | this[keys[i]] = properties[keys[i]];
|
24687 | }
|
24688 |
|
24689 | /**
|
24690 | * SourceCodeInfo location.
|
24691 | * @member {Array.<google.protobuf.SourceCodeInfo.ILocation>} location
|
24692 | * @memberof google.protobuf.SourceCodeInfo
|
24693 | * @instance
|
24694 | */
|
24695 | SourceCodeInfo.prototype.location = $util.emptyArray;
|
24696 |
|
24697 | /**
|
24698 | * Creates a new SourceCodeInfo instance using the specified properties.
|
24699 | * @function create
|
24700 | * @memberof google.protobuf.SourceCodeInfo
|
24701 | * @static
|
24702 | * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set
|
24703 | * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance
|
24704 | */
|
24705 | SourceCodeInfo.create = function create(properties) {
|
24706 | return new SourceCodeInfo(properties);
|
24707 | };
|
24708 |
|
24709 | /**
|
24710 | * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages.
|
24711 | * @function encode
|
24712 | * @memberof google.protobuf.SourceCodeInfo
|
24713 | * @static
|
24714 | * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode
|
24715 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
24716 | * @returns {$protobuf.Writer} Writer
|
24717 | */
|
24718 | SourceCodeInfo.encode = function encode(message, writer) {
|
24719 | if (!writer)
|
24720 | writer = $Writer.create();
|
24721 | if (message.location != null && message.location.length)
|
24722 | for (var i = 0; i < message.location.length; ++i)
|
24723 | $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
24724 | return writer;
|
24725 | };
|
24726 |
|
24727 | /**
|
24728 | * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages.
|
24729 | * @function encodeDelimited
|
24730 | * @memberof google.protobuf.SourceCodeInfo
|
24731 | * @static
|
24732 | * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode
|
24733 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
24734 | * @returns {$protobuf.Writer} Writer
|
24735 | */
|
24736 | SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) {
|
24737 | return this.encode(message, writer).ldelim();
|
24738 | };
|
24739 |
|
24740 | /**
|
24741 | * Decodes a SourceCodeInfo message from the specified reader or buffer.
|
24742 | * @function decode
|
24743 | * @memberof google.protobuf.SourceCodeInfo
|
24744 | * @static
|
24745 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
24746 | * @param {number} [length] Message length if known beforehand
|
24747 | * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo
|
24748 | * @throws {Error} If the payload is not a reader or valid buffer
|
24749 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
24750 | */
|
24751 | SourceCodeInfo.decode = function decode(reader, length) {
|
24752 | if (!(reader instanceof $Reader))
|
24753 | reader = $Reader.create(reader);
|
24754 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo();
|
24755 | while (reader.pos < end) {
|
24756 | var tag = reader.uint32();
|
24757 | switch (tag >>> 3) {
|
24758 | case 1:
|
24759 | if (!(message.location && message.location.length))
|
24760 | message.location = [];
|
24761 | message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32()));
|
24762 | break;
|
24763 | default:
|
24764 | reader.skipType(tag & 7);
|
24765 | break;
|
24766 | }
|
24767 | }
|
24768 | return message;
|
24769 | };
|
24770 |
|
24771 | /**
|
24772 | * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited.
|
24773 | * @function decodeDelimited
|
24774 | * @memberof google.protobuf.SourceCodeInfo
|
24775 | * @static
|
24776 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
24777 | * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo
|
24778 | * @throws {Error} If the payload is not a reader or valid buffer
|
24779 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
24780 | */
|
24781 | SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) {
|
24782 | if (!(reader instanceof $Reader))
|
24783 | reader = new $Reader(reader);
|
24784 | return this.decode(reader, reader.uint32());
|
24785 | };
|
24786 |
|
24787 | /**
|
24788 | * Verifies a SourceCodeInfo message.
|
24789 | * @function verify
|
24790 | * @memberof google.protobuf.SourceCodeInfo
|
24791 | * @static
|
24792 | * @param {Object.<string,*>} message Plain object to verify
|
24793 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
24794 | */
|
24795 | SourceCodeInfo.verify = function verify(message) {
|
24796 | if (typeof message !== "object" || message === null)
|
24797 | return "object expected";
|
24798 | if (message.location != null && message.hasOwnProperty("location")) {
|
24799 | if (!Array.isArray(message.location))
|
24800 | return "location: array expected";
|
24801 | for (var i = 0; i < message.location.length; ++i) {
|
24802 | var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]);
|
24803 | if (error)
|
24804 | return "location." + error;
|
24805 | }
|
24806 | }
|
24807 | return null;
|
24808 | };
|
24809 |
|
24810 | /**
|
24811 | * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types.
|
24812 | * @function fromObject
|
24813 | * @memberof google.protobuf.SourceCodeInfo
|
24814 | * @static
|
24815 | * @param {Object.<string,*>} object Plain object
|
24816 | * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo
|
24817 | */
|
24818 | SourceCodeInfo.fromObject = function fromObject(object) {
|
24819 | if (object instanceof $root.google.protobuf.SourceCodeInfo)
|
24820 | return object;
|
24821 | var message = new $root.google.protobuf.SourceCodeInfo();
|
24822 | if (object.location) {
|
24823 | if (!Array.isArray(object.location))
|
24824 | throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected");
|
24825 | message.location = [];
|
24826 | for (var i = 0; i < object.location.length; ++i) {
|
24827 | if (typeof object.location[i] !== "object")
|
24828 | throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected");
|
24829 | message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]);
|
24830 | }
|
24831 | }
|
24832 | return message;
|
24833 | };
|
24834 |
|
24835 | /**
|
24836 | * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified.
|
24837 | * @function toObject
|
24838 | * @memberof google.protobuf.SourceCodeInfo
|
24839 | * @static
|
24840 | * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo
|
24841 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
24842 | * @returns {Object.<string,*>} Plain object
|
24843 | */
|
24844 | SourceCodeInfo.toObject = function toObject(message, options) {
|
24845 | if (!options)
|
24846 | options = {};
|
24847 | var object = {};
|
24848 | if (options.arrays || options.defaults)
|
24849 | object.location = [];
|
24850 | if (message.location && message.location.length) {
|
24851 | object.location = [];
|
24852 | for (var j = 0; j < message.location.length; ++j)
|
24853 | object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options);
|
24854 | }
|
24855 | return object;
|
24856 | };
|
24857 |
|
24858 | /**
|
24859 | * Converts this SourceCodeInfo to JSON.
|
24860 | * @function toJSON
|
24861 | * @memberof google.protobuf.SourceCodeInfo
|
24862 | * @instance
|
24863 | * @returns {Object.<string,*>} JSON object
|
24864 | */
|
24865 | SourceCodeInfo.prototype.toJSON = function toJSON() {
|
24866 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
24867 | };
|
24868 |
|
24869 | SourceCodeInfo.Location = (function() {
|
24870 |
|
24871 | /**
|
24872 | * Properties of a Location.
|
24873 | * @memberof google.protobuf.SourceCodeInfo
|
24874 | * @interface ILocation
|
24875 | * @property {Array.<number>|null} [path] Location path
|
24876 | * @property {Array.<number>|null} [span] Location span
|
24877 | * @property {string|null} [leadingComments] Location leadingComments
|
24878 | * @property {string|null} [trailingComments] Location trailingComments
|
24879 | * @property {Array.<string>|null} [leadingDetachedComments] Location leadingDetachedComments
|
24880 | */
|
24881 |
|
24882 | /**
|
24883 | * Constructs a new Location.
|
24884 | * @memberof google.protobuf.SourceCodeInfo
|
24885 | * @classdesc Represents a Location.
|
24886 | * @implements ILocation
|
24887 | * @constructor
|
24888 | * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set
|
24889 | */
|
24890 | function Location(properties) {
|
24891 | this.path = [];
|
24892 | this.span = [];
|
24893 | this.leadingDetachedComments = [];
|
24894 | if (properties)
|
24895 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
24896 | if (properties[keys[i]] != null)
|
24897 | this[keys[i]] = properties[keys[i]];
|
24898 | }
|
24899 |
|
24900 | /**
|
24901 | * Location path.
|
24902 | * @member {Array.<number>} path
|
24903 | * @memberof google.protobuf.SourceCodeInfo.Location
|
24904 | * @instance
|
24905 | */
|
24906 | Location.prototype.path = $util.emptyArray;
|
24907 |
|
24908 | /**
|
24909 | * Location span.
|
24910 | * @member {Array.<number>} span
|
24911 | * @memberof google.protobuf.SourceCodeInfo.Location
|
24912 | * @instance
|
24913 | */
|
24914 | Location.prototype.span = $util.emptyArray;
|
24915 |
|
24916 | /**
|
24917 | * Location leadingComments.
|
24918 | * @member {string} leadingComments
|
24919 | * @memberof google.protobuf.SourceCodeInfo.Location
|
24920 | * @instance
|
24921 | */
|
24922 | Location.prototype.leadingComments = "";
|
24923 |
|
24924 | /**
|
24925 | * Location trailingComments.
|
24926 | * @member {string} trailingComments
|
24927 | * @memberof google.protobuf.SourceCodeInfo.Location
|
24928 | * @instance
|
24929 | */
|
24930 | Location.prototype.trailingComments = "";
|
24931 |
|
24932 | /**
|
24933 | * Location leadingDetachedComments.
|
24934 | * @member {Array.<string>} leadingDetachedComments
|
24935 | * @memberof google.protobuf.SourceCodeInfo.Location
|
24936 | * @instance
|
24937 | */
|
24938 | Location.prototype.leadingDetachedComments = $util.emptyArray;
|
24939 |
|
24940 | /**
|
24941 | * Creates a new Location instance using the specified properties.
|
24942 | * @function create
|
24943 | * @memberof google.protobuf.SourceCodeInfo.Location
|
24944 | * @static
|
24945 | * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set
|
24946 | * @returns {google.protobuf.SourceCodeInfo.Location} Location instance
|
24947 | */
|
24948 | Location.create = function create(properties) {
|
24949 | return new Location(properties);
|
24950 | };
|
24951 |
|
24952 | /**
|
24953 | * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages.
|
24954 | * @function encode
|
24955 | * @memberof google.protobuf.SourceCodeInfo.Location
|
24956 | * @static
|
24957 | * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode
|
24958 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
24959 | * @returns {$protobuf.Writer} Writer
|
24960 | */
|
24961 | Location.encode = function encode(message, writer) {
|
24962 | if (!writer)
|
24963 | writer = $Writer.create();
|
24964 | if (message.path != null && message.path.length) {
|
24965 | writer.uint32(/* id 1, wireType 2 =*/10).fork();
|
24966 | for (var i = 0; i < message.path.length; ++i)
|
24967 | writer.int32(message.path[i]);
|
24968 | writer.ldelim();
|
24969 | }
|
24970 | if (message.span != null && message.span.length) {
|
24971 | writer.uint32(/* id 2, wireType 2 =*/18).fork();
|
24972 | for (var i = 0; i < message.span.length; ++i)
|
24973 | writer.int32(message.span[i]);
|
24974 | writer.ldelim();
|
24975 | }
|
24976 | if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments"))
|
24977 | writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments);
|
24978 | if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments"))
|
24979 | writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments);
|
24980 | if (message.leadingDetachedComments != null && message.leadingDetachedComments.length)
|
24981 | for (var i = 0; i < message.leadingDetachedComments.length; ++i)
|
24982 | writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]);
|
24983 | return writer;
|
24984 | };
|
24985 |
|
24986 | /**
|
24987 | * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages.
|
24988 | * @function encodeDelimited
|
24989 | * @memberof google.protobuf.SourceCodeInfo.Location
|
24990 | * @static
|
24991 | * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode
|
24992 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
24993 | * @returns {$protobuf.Writer} Writer
|
24994 | */
|
24995 | Location.encodeDelimited = function encodeDelimited(message, writer) {
|
24996 | return this.encode(message, writer).ldelim();
|
24997 | };
|
24998 |
|
24999 | /**
|
25000 | * Decodes a Location message from the specified reader or buffer.
|
25001 | * @function decode
|
25002 | * @memberof google.protobuf.SourceCodeInfo.Location
|
25003 | * @static
|
25004 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
25005 | * @param {number} [length] Message length if known beforehand
|
25006 | * @returns {google.protobuf.SourceCodeInfo.Location} Location
|
25007 | * @throws {Error} If the payload is not a reader or valid buffer
|
25008 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
25009 | */
|
25010 | Location.decode = function decode(reader, length) {
|
25011 | if (!(reader instanceof $Reader))
|
25012 | reader = $Reader.create(reader);
|
25013 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location();
|
25014 | while (reader.pos < end) {
|
25015 | var tag = reader.uint32();
|
25016 | switch (tag >>> 3) {
|
25017 | case 1:
|
25018 | if (!(message.path && message.path.length))
|
25019 | message.path = [];
|
25020 | if ((tag & 7) === 2) {
|
25021 | var end2 = reader.uint32() + reader.pos;
|
25022 | while (reader.pos < end2)
|
25023 | message.path.push(reader.int32());
|
25024 | } else
|
25025 | message.path.push(reader.int32());
|
25026 | break;
|
25027 | case 2:
|
25028 | if (!(message.span && message.span.length))
|
25029 | message.span = [];
|
25030 | if ((tag & 7) === 2) {
|
25031 | var end2 = reader.uint32() + reader.pos;
|
25032 | while (reader.pos < end2)
|
25033 | message.span.push(reader.int32());
|
25034 | } else
|
25035 | message.span.push(reader.int32());
|
25036 | break;
|
25037 | case 3:
|
25038 | message.leadingComments = reader.string();
|
25039 | break;
|
25040 | case 4:
|
25041 | message.trailingComments = reader.string();
|
25042 | break;
|
25043 | case 6:
|
25044 | if (!(message.leadingDetachedComments && message.leadingDetachedComments.length))
|
25045 | message.leadingDetachedComments = [];
|
25046 | message.leadingDetachedComments.push(reader.string());
|
25047 | break;
|
25048 | default:
|
25049 | reader.skipType(tag & 7);
|
25050 | break;
|
25051 | }
|
25052 | }
|
25053 | return message;
|
25054 | };
|
25055 |
|
25056 | /**
|
25057 | * Decodes a Location message from the specified reader or buffer, length delimited.
|
25058 | * @function decodeDelimited
|
25059 | * @memberof google.protobuf.SourceCodeInfo.Location
|
25060 | * @static
|
25061 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
25062 | * @returns {google.protobuf.SourceCodeInfo.Location} Location
|
25063 | * @throws {Error} If the payload is not a reader or valid buffer
|
25064 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
25065 | */
|
25066 | Location.decodeDelimited = function decodeDelimited(reader) {
|
25067 | if (!(reader instanceof $Reader))
|
25068 | reader = new $Reader(reader);
|
25069 | return this.decode(reader, reader.uint32());
|
25070 | };
|
25071 |
|
25072 | /**
|
25073 | * Verifies a Location message.
|
25074 | * @function verify
|
25075 | * @memberof google.protobuf.SourceCodeInfo.Location
|
25076 | * @static
|
25077 | * @param {Object.<string,*>} message Plain object to verify
|
25078 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
25079 | */
|
25080 | Location.verify = function verify(message) {
|
25081 | if (typeof message !== "object" || message === null)
|
25082 | return "object expected";
|
25083 | if (message.path != null && message.hasOwnProperty("path")) {
|
25084 | if (!Array.isArray(message.path))
|
25085 | return "path: array expected";
|
25086 | for (var i = 0; i < message.path.length; ++i)
|
25087 | if (!$util.isInteger(message.path[i]))
|
25088 | return "path: integer[] expected";
|
25089 | }
|
25090 | if (message.span != null && message.hasOwnProperty("span")) {
|
25091 | if (!Array.isArray(message.span))
|
25092 | return "span: array expected";
|
25093 | for (var i = 0; i < message.span.length; ++i)
|
25094 | if (!$util.isInteger(message.span[i]))
|
25095 | return "span: integer[] expected";
|
25096 | }
|
25097 | if (message.leadingComments != null && message.hasOwnProperty("leadingComments"))
|
25098 | if (!$util.isString(message.leadingComments))
|
25099 | return "leadingComments: string expected";
|
25100 | if (message.trailingComments != null && message.hasOwnProperty("trailingComments"))
|
25101 | if (!$util.isString(message.trailingComments))
|
25102 | return "trailingComments: string expected";
|
25103 | if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) {
|
25104 | if (!Array.isArray(message.leadingDetachedComments))
|
25105 | return "leadingDetachedComments: array expected";
|
25106 | for (var i = 0; i < message.leadingDetachedComments.length; ++i)
|
25107 | if (!$util.isString(message.leadingDetachedComments[i]))
|
25108 | return "leadingDetachedComments: string[] expected";
|
25109 | }
|
25110 | return null;
|
25111 | };
|
25112 |
|
25113 | /**
|
25114 | * Creates a Location message from a plain object. Also converts values to their respective internal types.
|
25115 | * @function fromObject
|
25116 | * @memberof google.protobuf.SourceCodeInfo.Location
|
25117 | * @static
|
25118 | * @param {Object.<string,*>} object Plain object
|
25119 | * @returns {google.protobuf.SourceCodeInfo.Location} Location
|
25120 | */
|
25121 | Location.fromObject = function fromObject(object) {
|
25122 | if (object instanceof $root.google.protobuf.SourceCodeInfo.Location)
|
25123 | return object;
|
25124 | var message = new $root.google.protobuf.SourceCodeInfo.Location();
|
25125 | if (object.path) {
|
25126 | if (!Array.isArray(object.path))
|
25127 | throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected");
|
25128 | message.path = [];
|
25129 | for (var i = 0; i < object.path.length; ++i)
|
25130 | message.path[i] = object.path[i] | 0;
|
25131 | }
|
25132 | if (object.span) {
|
25133 | if (!Array.isArray(object.span))
|
25134 | throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected");
|
25135 | message.span = [];
|
25136 | for (var i = 0; i < object.span.length; ++i)
|
25137 | message.span[i] = object.span[i] | 0;
|
25138 | }
|
25139 | if (object.leadingComments != null)
|
25140 | message.leadingComments = String(object.leadingComments);
|
25141 | if (object.trailingComments != null)
|
25142 | message.trailingComments = String(object.trailingComments);
|
25143 | if (object.leadingDetachedComments) {
|
25144 | if (!Array.isArray(object.leadingDetachedComments))
|
25145 | throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected");
|
25146 | message.leadingDetachedComments = [];
|
25147 | for (var i = 0; i < object.leadingDetachedComments.length; ++i)
|
25148 | message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]);
|
25149 | }
|
25150 | return message;
|
25151 | };
|
25152 |
|
25153 | /**
|
25154 | * Creates a plain object from a Location message. Also converts values to other types if specified.
|
25155 | * @function toObject
|
25156 | * @memberof google.protobuf.SourceCodeInfo.Location
|
25157 | * @static
|
25158 | * @param {google.protobuf.SourceCodeInfo.Location} message Location
|
25159 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
25160 | * @returns {Object.<string,*>} Plain object
|
25161 | */
|
25162 | Location.toObject = function toObject(message, options) {
|
25163 | if (!options)
|
25164 | options = {};
|
25165 | var object = {};
|
25166 | if (options.arrays || options.defaults) {
|
25167 | object.path = [];
|
25168 | object.span = [];
|
25169 | object.leadingDetachedComments = [];
|
25170 | }
|
25171 | if (options.defaults) {
|
25172 | object.leadingComments = "";
|
25173 | object.trailingComments = "";
|
25174 | }
|
25175 | if (message.path && message.path.length) {
|
25176 | object.path = [];
|
25177 | for (var j = 0; j < message.path.length; ++j)
|
25178 | object.path[j] = message.path[j];
|
25179 | }
|
25180 | if (message.span && message.span.length) {
|
25181 | object.span = [];
|
25182 | for (var j = 0; j < message.span.length; ++j)
|
25183 | object.span[j] = message.span[j];
|
25184 | }
|
25185 | if (message.leadingComments != null && message.hasOwnProperty("leadingComments"))
|
25186 | object.leadingComments = message.leadingComments;
|
25187 | if (message.trailingComments != null && message.hasOwnProperty("trailingComments"))
|
25188 | object.trailingComments = message.trailingComments;
|
25189 | if (message.leadingDetachedComments && message.leadingDetachedComments.length) {
|
25190 | object.leadingDetachedComments = [];
|
25191 | for (var j = 0; j < message.leadingDetachedComments.length; ++j)
|
25192 | object.leadingDetachedComments[j] = message.leadingDetachedComments[j];
|
25193 | }
|
25194 | return object;
|
25195 | };
|
25196 |
|
25197 | /**
|
25198 | * Converts this Location to JSON.
|
25199 | * @function toJSON
|
25200 | * @memberof google.protobuf.SourceCodeInfo.Location
|
25201 | * @instance
|
25202 | * @returns {Object.<string,*>} JSON object
|
25203 | */
|
25204 | Location.prototype.toJSON = function toJSON() {
|
25205 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
25206 | };
|
25207 |
|
25208 | return Location;
|
25209 | })();
|
25210 |
|
25211 | return SourceCodeInfo;
|
25212 | })();
|
25213 |
|
25214 | protobuf.GeneratedCodeInfo = (function() {
|
25215 |
|
25216 | /**
|
25217 | * Properties of a GeneratedCodeInfo.
|
25218 | * @memberof google.protobuf
|
25219 | * @interface IGeneratedCodeInfo
|
25220 | * @property {Array.<google.protobuf.GeneratedCodeInfo.IAnnotation>|null} [annotation] GeneratedCodeInfo annotation
|
25221 | */
|
25222 |
|
25223 | /**
|
25224 | * Constructs a new GeneratedCodeInfo.
|
25225 | * @memberof google.protobuf
|
25226 | * @classdesc Represents a GeneratedCodeInfo.
|
25227 | * @implements IGeneratedCodeInfo
|
25228 | * @constructor
|
25229 | * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set
|
25230 | */
|
25231 | function GeneratedCodeInfo(properties) {
|
25232 | this.annotation = [];
|
25233 | if (properties)
|
25234 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
25235 | if (properties[keys[i]] != null)
|
25236 | this[keys[i]] = properties[keys[i]];
|
25237 | }
|
25238 |
|
25239 | /**
|
25240 | * GeneratedCodeInfo annotation.
|
25241 | * @member {Array.<google.protobuf.GeneratedCodeInfo.IAnnotation>} annotation
|
25242 | * @memberof google.protobuf.GeneratedCodeInfo
|
25243 | * @instance
|
25244 | */
|
25245 | GeneratedCodeInfo.prototype.annotation = $util.emptyArray;
|
25246 |
|
25247 | /**
|
25248 | * Creates a new GeneratedCodeInfo instance using the specified properties.
|
25249 | * @function create
|
25250 | * @memberof google.protobuf.GeneratedCodeInfo
|
25251 | * @static
|
25252 | * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set
|
25253 | * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance
|
25254 | */
|
25255 | GeneratedCodeInfo.create = function create(properties) {
|
25256 | return new GeneratedCodeInfo(properties);
|
25257 | };
|
25258 |
|
25259 | /**
|
25260 | * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages.
|
25261 | * @function encode
|
25262 | * @memberof google.protobuf.GeneratedCodeInfo
|
25263 | * @static
|
25264 | * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode
|
25265 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
25266 | * @returns {$protobuf.Writer} Writer
|
25267 | */
|
25268 | GeneratedCodeInfo.encode = function encode(message, writer) {
|
25269 | if (!writer)
|
25270 | writer = $Writer.create();
|
25271 | if (message.annotation != null && message.annotation.length)
|
25272 | for (var i = 0; i < message.annotation.length; ++i)
|
25273 | $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
25274 | return writer;
|
25275 | };
|
25276 |
|
25277 | /**
|
25278 | * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages.
|
25279 | * @function encodeDelimited
|
25280 | * @memberof google.protobuf.GeneratedCodeInfo
|
25281 | * @static
|
25282 | * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode
|
25283 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
25284 | * @returns {$protobuf.Writer} Writer
|
25285 | */
|
25286 | GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) {
|
25287 | return this.encode(message, writer).ldelim();
|
25288 | };
|
25289 |
|
25290 | /**
|
25291 | * Decodes a GeneratedCodeInfo message from the specified reader or buffer.
|
25292 | * @function decode
|
25293 | * @memberof google.protobuf.GeneratedCodeInfo
|
25294 | * @static
|
25295 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
25296 | * @param {number} [length] Message length if known beforehand
|
25297 | * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo
|
25298 | * @throws {Error} If the payload is not a reader or valid buffer
|
25299 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
25300 | */
|
25301 | GeneratedCodeInfo.decode = function decode(reader, length) {
|
25302 | if (!(reader instanceof $Reader))
|
25303 | reader = $Reader.create(reader);
|
25304 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo();
|
25305 | while (reader.pos < end) {
|
25306 | var tag = reader.uint32();
|
25307 | switch (tag >>> 3) {
|
25308 | case 1:
|
25309 | if (!(message.annotation && message.annotation.length))
|
25310 | message.annotation = [];
|
25311 | message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32()));
|
25312 | break;
|
25313 | default:
|
25314 | reader.skipType(tag & 7);
|
25315 | break;
|
25316 | }
|
25317 | }
|
25318 | return message;
|
25319 | };
|
25320 |
|
25321 | /**
|
25322 | * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited.
|
25323 | * @function decodeDelimited
|
25324 | * @memberof google.protobuf.GeneratedCodeInfo
|
25325 | * @static
|
25326 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
25327 | * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo
|
25328 | * @throws {Error} If the payload is not a reader or valid buffer
|
25329 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
25330 | */
|
25331 | GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) {
|
25332 | if (!(reader instanceof $Reader))
|
25333 | reader = new $Reader(reader);
|
25334 | return this.decode(reader, reader.uint32());
|
25335 | };
|
25336 |
|
25337 | /**
|
25338 | * Verifies a GeneratedCodeInfo message.
|
25339 | * @function verify
|
25340 | * @memberof google.protobuf.GeneratedCodeInfo
|
25341 | * @static
|
25342 | * @param {Object.<string,*>} message Plain object to verify
|
25343 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
25344 | */
|
25345 | GeneratedCodeInfo.verify = function verify(message) {
|
25346 | if (typeof message !== "object" || message === null)
|
25347 | return "object expected";
|
25348 | if (message.annotation != null && message.hasOwnProperty("annotation")) {
|
25349 | if (!Array.isArray(message.annotation))
|
25350 | return "annotation: array expected";
|
25351 | for (var i = 0; i < message.annotation.length; ++i) {
|
25352 | var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]);
|
25353 | if (error)
|
25354 | return "annotation." + error;
|
25355 | }
|
25356 | }
|
25357 | return null;
|
25358 | };
|
25359 |
|
25360 | /**
|
25361 | * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types.
|
25362 | * @function fromObject
|
25363 | * @memberof google.protobuf.GeneratedCodeInfo
|
25364 | * @static
|
25365 | * @param {Object.<string,*>} object Plain object
|
25366 | * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo
|
25367 | */
|
25368 | GeneratedCodeInfo.fromObject = function fromObject(object) {
|
25369 | if (object instanceof $root.google.protobuf.GeneratedCodeInfo)
|
25370 | return object;
|
25371 | var message = new $root.google.protobuf.GeneratedCodeInfo();
|
25372 | if (object.annotation) {
|
25373 | if (!Array.isArray(object.annotation))
|
25374 | throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected");
|
25375 | message.annotation = [];
|
25376 | for (var i = 0; i < object.annotation.length; ++i) {
|
25377 | if (typeof object.annotation[i] !== "object")
|
25378 | throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected");
|
25379 | message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]);
|
25380 | }
|
25381 | }
|
25382 | return message;
|
25383 | };
|
25384 |
|
25385 | /**
|
25386 | * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified.
|
25387 | * @function toObject
|
25388 | * @memberof google.protobuf.GeneratedCodeInfo
|
25389 | * @static
|
25390 | * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo
|
25391 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
25392 | * @returns {Object.<string,*>} Plain object
|
25393 | */
|
25394 | GeneratedCodeInfo.toObject = function toObject(message, options) {
|
25395 | if (!options)
|
25396 | options = {};
|
25397 | var object = {};
|
25398 | if (options.arrays || options.defaults)
|
25399 | object.annotation = [];
|
25400 | if (message.annotation && message.annotation.length) {
|
25401 | object.annotation = [];
|
25402 | for (var j = 0; j < message.annotation.length; ++j)
|
25403 | object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options);
|
25404 | }
|
25405 | return object;
|
25406 | };
|
25407 |
|
25408 | /**
|
25409 | * Converts this GeneratedCodeInfo to JSON.
|
25410 | * @function toJSON
|
25411 | * @memberof google.protobuf.GeneratedCodeInfo
|
25412 | * @instance
|
25413 | * @returns {Object.<string,*>} JSON object
|
25414 | */
|
25415 | GeneratedCodeInfo.prototype.toJSON = function toJSON() {
|
25416 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
25417 | };
|
25418 |
|
25419 | GeneratedCodeInfo.Annotation = (function() {
|
25420 |
|
25421 | /**
|
25422 | * Properties of an Annotation.
|
25423 | * @memberof google.protobuf.GeneratedCodeInfo
|
25424 | * @interface IAnnotation
|
25425 | * @property {Array.<number>|null} [path] Annotation path
|
25426 | * @property {string|null} [sourceFile] Annotation sourceFile
|
25427 | * @property {number|null} [begin] Annotation begin
|
25428 | * @property {number|null} [end] Annotation end
|
25429 | */
|
25430 |
|
25431 | /**
|
25432 | * Constructs a new Annotation.
|
25433 | * @memberof google.protobuf.GeneratedCodeInfo
|
25434 | * @classdesc Represents an Annotation.
|
25435 | * @implements IAnnotation
|
25436 | * @constructor
|
25437 | * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set
|
25438 | */
|
25439 | function Annotation(properties) {
|
25440 | this.path = [];
|
25441 | if (properties)
|
25442 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
25443 | if (properties[keys[i]] != null)
|
25444 | this[keys[i]] = properties[keys[i]];
|
25445 | }
|
25446 |
|
25447 | /**
|
25448 | * Annotation path.
|
25449 | * @member {Array.<number>} path
|
25450 | * @memberof google.protobuf.GeneratedCodeInfo.Annotation
|
25451 | * @instance
|
25452 | */
|
25453 | Annotation.prototype.path = $util.emptyArray;
|
25454 |
|
25455 | /**
|
25456 | * Annotation sourceFile.
|
25457 | * @member {string} sourceFile
|
25458 | * @memberof google.protobuf.GeneratedCodeInfo.Annotation
|
25459 | * @instance
|
25460 | */
|
25461 | Annotation.prototype.sourceFile = "";
|
25462 |
|
25463 | /**
|
25464 | * Annotation begin.
|
25465 | * @member {number} begin
|
25466 | * @memberof google.protobuf.GeneratedCodeInfo.Annotation
|
25467 | * @instance
|
25468 | */
|
25469 | Annotation.prototype.begin = 0;
|
25470 |
|
25471 | /**
|
25472 | * Annotation end.
|
25473 | * @member {number} end
|
25474 | * @memberof google.protobuf.GeneratedCodeInfo.Annotation
|
25475 | * @instance
|
25476 | */
|
25477 | Annotation.prototype.end = 0;
|
25478 |
|
25479 | /**
|
25480 | * Creates a new Annotation instance using the specified properties.
|
25481 | * @function create
|
25482 | * @memberof google.protobuf.GeneratedCodeInfo.Annotation
|
25483 | * @static
|
25484 | * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set
|
25485 | * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance
|
25486 | */
|
25487 | Annotation.create = function create(properties) {
|
25488 | return new Annotation(properties);
|
25489 | };
|
25490 |
|
25491 | /**
|
25492 | * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages.
|
25493 | * @function encode
|
25494 | * @memberof google.protobuf.GeneratedCodeInfo.Annotation
|
25495 | * @static
|
25496 | * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode
|
25497 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
25498 | * @returns {$protobuf.Writer} Writer
|
25499 | */
|
25500 | Annotation.encode = function encode(message, writer) {
|
25501 | if (!writer)
|
25502 | writer = $Writer.create();
|
25503 | if (message.path != null && message.path.length) {
|
25504 | writer.uint32(/* id 1, wireType 2 =*/10).fork();
|
25505 | for (var i = 0; i < message.path.length; ++i)
|
25506 | writer.int32(message.path[i]);
|
25507 | writer.ldelim();
|
25508 | }
|
25509 | if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile"))
|
25510 | writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile);
|
25511 | if (message.begin != null && Object.hasOwnProperty.call(message, "begin"))
|
25512 | writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin);
|
25513 | if (message.end != null && Object.hasOwnProperty.call(message, "end"))
|
25514 | writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end);
|
25515 | return writer;
|
25516 | };
|
25517 |
|
25518 | /**
|
25519 | * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages.
|
25520 | * @function encodeDelimited
|
25521 | * @memberof google.protobuf.GeneratedCodeInfo.Annotation
|
25522 | * @static
|
25523 | * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode
|
25524 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
25525 | * @returns {$protobuf.Writer} Writer
|
25526 | */
|
25527 | Annotation.encodeDelimited = function encodeDelimited(message, writer) {
|
25528 | return this.encode(message, writer).ldelim();
|
25529 | };
|
25530 |
|
25531 | /**
|
25532 | * Decodes an Annotation message from the specified reader or buffer.
|
25533 | * @function decode
|
25534 | * @memberof google.protobuf.GeneratedCodeInfo.Annotation
|
25535 | * @static
|
25536 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
25537 | * @param {number} [length] Message length if known beforehand
|
25538 | * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation
|
25539 | * @throws {Error} If the payload is not a reader or valid buffer
|
25540 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
25541 | */
|
25542 | Annotation.decode = function decode(reader, length) {
|
25543 | if (!(reader instanceof $Reader))
|
25544 | reader = $Reader.create(reader);
|
25545 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation();
|
25546 | while (reader.pos < end) {
|
25547 | var tag = reader.uint32();
|
25548 | switch (tag >>> 3) {
|
25549 | case 1:
|
25550 | if (!(message.path && message.path.length))
|
25551 | message.path = [];
|
25552 | if ((tag & 7) === 2) {
|
25553 | var end2 = reader.uint32() + reader.pos;
|
25554 | while (reader.pos < end2)
|
25555 | message.path.push(reader.int32());
|
25556 | } else
|
25557 | message.path.push(reader.int32());
|
25558 | break;
|
25559 | case 2:
|
25560 | message.sourceFile = reader.string();
|
25561 | break;
|
25562 | case 3:
|
25563 | message.begin = reader.int32();
|
25564 | break;
|
25565 | case 4:
|
25566 | message.end = reader.int32();
|
25567 | break;
|
25568 | default:
|
25569 | reader.skipType(tag & 7);
|
25570 | break;
|
25571 | }
|
25572 | }
|
25573 | return message;
|
25574 | };
|
25575 |
|
25576 | /**
|
25577 | * Decodes an Annotation message from the specified reader or buffer, length delimited.
|
25578 | * @function decodeDelimited
|
25579 | * @memberof google.protobuf.GeneratedCodeInfo.Annotation
|
25580 | * @static
|
25581 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
25582 | * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation
|
25583 | * @throws {Error} If the payload is not a reader or valid buffer
|
25584 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
25585 | */
|
25586 | Annotation.decodeDelimited = function decodeDelimited(reader) {
|
25587 | if (!(reader instanceof $Reader))
|
25588 | reader = new $Reader(reader);
|
25589 | return this.decode(reader, reader.uint32());
|
25590 | };
|
25591 |
|
25592 | /**
|
25593 | * Verifies an Annotation message.
|
25594 | * @function verify
|
25595 | * @memberof google.protobuf.GeneratedCodeInfo.Annotation
|
25596 | * @static
|
25597 | * @param {Object.<string,*>} message Plain object to verify
|
25598 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
25599 | */
|
25600 | Annotation.verify = function verify(message) {
|
25601 | if (typeof message !== "object" || message === null)
|
25602 | return "object expected";
|
25603 | if (message.path != null && message.hasOwnProperty("path")) {
|
25604 | if (!Array.isArray(message.path))
|
25605 | return "path: array expected";
|
25606 | for (var i = 0; i < message.path.length; ++i)
|
25607 | if (!$util.isInteger(message.path[i]))
|
25608 | return "path: integer[] expected";
|
25609 | }
|
25610 | if (message.sourceFile != null && message.hasOwnProperty("sourceFile"))
|
25611 | if (!$util.isString(message.sourceFile))
|
25612 | return "sourceFile: string expected";
|
25613 | if (message.begin != null && message.hasOwnProperty("begin"))
|
25614 | if (!$util.isInteger(message.begin))
|
25615 | return "begin: integer expected";
|
25616 | if (message.end != null && message.hasOwnProperty("end"))
|
25617 | if (!$util.isInteger(message.end))
|
25618 | return "end: integer expected";
|
25619 | return null;
|
25620 | };
|
25621 |
|
25622 | /**
|
25623 | * Creates an Annotation message from a plain object. Also converts values to their respective internal types.
|
25624 | * @function fromObject
|
25625 | * @memberof google.protobuf.GeneratedCodeInfo.Annotation
|
25626 | * @static
|
25627 | * @param {Object.<string,*>} object Plain object
|
25628 | * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation
|
25629 | */
|
25630 | Annotation.fromObject = function fromObject(object) {
|
25631 | if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation)
|
25632 | return object;
|
25633 | var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation();
|
25634 | if (object.path) {
|
25635 | if (!Array.isArray(object.path))
|
25636 | throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected");
|
25637 | message.path = [];
|
25638 | for (var i = 0; i < object.path.length; ++i)
|
25639 | message.path[i] = object.path[i] | 0;
|
25640 | }
|
25641 | if (object.sourceFile != null)
|
25642 | message.sourceFile = String(object.sourceFile);
|
25643 | if (object.begin != null)
|
25644 | message.begin = object.begin | 0;
|
25645 | if (object.end != null)
|
25646 | message.end = object.end | 0;
|
25647 | return message;
|
25648 | };
|
25649 |
|
25650 | /**
|
25651 | * Creates a plain object from an Annotation message. Also converts values to other types if specified.
|
25652 | * @function toObject
|
25653 | * @memberof google.protobuf.GeneratedCodeInfo.Annotation
|
25654 | * @static
|
25655 | * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation
|
25656 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
25657 | * @returns {Object.<string,*>} Plain object
|
25658 | */
|
25659 | Annotation.toObject = function toObject(message, options) {
|
25660 | if (!options)
|
25661 | options = {};
|
25662 | var object = {};
|
25663 | if (options.arrays || options.defaults)
|
25664 | object.path = [];
|
25665 | if (options.defaults) {
|
25666 | object.sourceFile = "";
|
25667 | object.begin = 0;
|
25668 | object.end = 0;
|
25669 | }
|
25670 | if (message.path && message.path.length) {
|
25671 | object.path = [];
|
25672 | for (var j = 0; j < message.path.length; ++j)
|
25673 | object.path[j] = message.path[j];
|
25674 | }
|
25675 | if (message.sourceFile != null && message.hasOwnProperty("sourceFile"))
|
25676 | object.sourceFile = message.sourceFile;
|
25677 | if (message.begin != null && message.hasOwnProperty("begin"))
|
25678 | object.begin = message.begin;
|
25679 | if (message.end != null && message.hasOwnProperty("end"))
|
25680 | object.end = message.end;
|
25681 | return object;
|
25682 | };
|
25683 |
|
25684 | /**
|
25685 | * Converts this Annotation to JSON.
|
25686 | * @function toJSON
|
25687 | * @memberof google.protobuf.GeneratedCodeInfo.Annotation
|
25688 | * @instance
|
25689 | * @returns {Object.<string,*>} JSON object
|
25690 | */
|
25691 | Annotation.prototype.toJSON = function toJSON() {
|
25692 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
25693 | };
|
25694 |
|
25695 | return Annotation;
|
25696 | })();
|
25697 |
|
25698 | return GeneratedCodeInfo;
|
25699 | })();
|
25700 |
|
25701 | protobuf.Duration = (function() {
|
25702 |
|
25703 | /**
|
25704 | * Properties of a Duration.
|
25705 | * @memberof google.protobuf
|
25706 | * @interface IDuration
|
25707 | * @property {number|Long|null} [seconds] Duration seconds
|
25708 | * @property {number|null} [nanos] Duration nanos
|
25709 | */
|
25710 |
|
25711 | /**
|
25712 | * Constructs a new Duration.
|
25713 | * @memberof google.protobuf
|
25714 | * @classdesc Represents a Duration.
|
25715 | * @implements IDuration
|
25716 | * @constructor
|
25717 | * @param {google.protobuf.IDuration=} [properties] Properties to set
|
25718 | */
|
25719 | function Duration(properties) {
|
25720 | if (properties)
|
25721 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
25722 | if (properties[keys[i]] != null)
|
25723 | this[keys[i]] = properties[keys[i]];
|
25724 | }
|
25725 |
|
25726 | /**
|
25727 | * Duration seconds.
|
25728 | * @member {number|Long} seconds
|
25729 | * @memberof google.protobuf.Duration
|
25730 | * @instance
|
25731 | */
|
25732 | Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
25733 |
|
25734 | /**
|
25735 | * Duration nanos.
|
25736 | * @member {number} nanos
|
25737 | * @memberof google.protobuf.Duration
|
25738 | * @instance
|
25739 | */
|
25740 | Duration.prototype.nanos = 0;
|
25741 |
|
25742 | /**
|
25743 | * Creates a new Duration instance using the specified properties.
|
25744 | * @function create
|
25745 | * @memberof google.protobuf.Duration
|
25746 | * @static
|
25747 | * @param {google.protobuf.IDuration=} [properties] Properties to set
|
25748 | * @returns {google.protobuf.Duration} Duration instance
|
25749 | */
|
25750 | Duration.create = function create(properties) {
|
25751 | return new Duration(properties);
|
25752 | };
|
25753 |
|
25754 | /**
|
25755 | * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages.
|
25756 | * @function encode
|
25757 | * @memberof google.protobuf.Duration
|
25758 | * @static
|
25759 | * @param {google.protobuf.IDuration} message Duration message or plain object to encode
|
25760 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
25761 | * @returns {$protobuf.Writer} Writer
|
25762 | */
|
25763 | Duration.encode = function encode(message, writer) {
|
25764 | if (!writer)
|
25765 | writer = $Writer.create();
|
25766 | if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds"))
|
25767 | writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds);
|
25768 | if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos"))
|
25769 | writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos);
|
25770 | return writer;
|
25771 | };
|
25772 |
|
25773 | /**
|
25774 | * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages.
|
25775 | * @function encodeDelimited
|
25776 | * @memberof google.protobuf.Duration
|
25777 | * @static
|
25778 | * @param {google.protobuf.IDuration} message Duration message or plain object to encode
|
25779 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
25780 | * @returns {$protobuf.Writer} Writer
|
25781 | */
|
25782 | Duration.encodeDelimited = function encodeDelimited(message, writer) {
|
25783 | return this.encode(message, writer).ldelim();
|
25784 | };
|
25785 |
|
25786 | /**
|
25787 | * Decodes a Duration message from the specified reader or buffer.
|
25788 | * @function decode
|
25789 | * @memberof google.protobuf.Duration
|
25790 | * @static
|
25791 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
25792 | * @param {number} [length] Message length if known beforehand
|
25793 | * @returns {google.protobuf.Duration} Duration
|
25794 | * @throws {Error} If the payload is not a reader or valid buffer
|
25795 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
25796 | */
|
25797 | Duration.decode = function decode(reader, length) {
|
25798 | if (!(reader instanceof $Reader))
|
25799 | reader = $Reader.create(reader);
|
25800 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration();
|
25801 | while (reader.pos < end) {
|
25802 | var tag = reader.uint32();
|
25803 | switch (tag >>> 3) {
|
25804 | case 1:
|
25805 | message.seconds = reader.int64();
|
25806 | break;
|
25807 | case 2:
|
25808 | message.nanos = reader.int32();
|
25809 | break;
|
25810 | default:
|
25811 | reader.skipType(tag & 7);
|
25812 | break;
|
25813 | }
|
25814 | }
|
25815 | return message;
|
25816 | };
|
25817 |
|
25818 | /**
|
25819 | * Decodes a Duration message from the specified reader or buffer, length delimited.
|
25820 | * @function decodeDelimited
|
25821 | * @memberof google.protobuf.Duration
|
25822 | * @static
|
25823 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
25824 | * @returns {google.protobuf.Duration} Duration
|
25825 | * @throws {Error} If the payload is not a reader or valid buffer
|
25826 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
25827 | */
|
25828 | Duration.decodeDelimited = function decodeDelimited(reader) {
|
25829 | if (!(reader instanceof $Reader))
|
25830 | reader = new $Reader(reader);
|
25831 | return this.decode(reader, reader.uint32());
|
25832 | };
|
25833 |
|
25834 | /**
|
25835 | * Verifies a Duration message.
|
25836 | * @function verify
|
25837 | * @memberof google.protobuf.Duration
|
25838 | * @static
|
25839 | * @param {Object.<string,*>} message Plain object to verify
|
25840 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
25841 | */
|
25842 | Duration.verify = function verify(message) {
|
25843 | if (typeof message !== "object" || message === null)
|
25844 | return "object expected";
|
25845 | if (message.seconds != null && message.hasOwnProperty("seconds"))
|
25846 | if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high)))
|
25847 | return "seconds: integer|Long expected";
|
25848 | if (message.nanos != null && message.hasOwnProperty("nanos"))
|
25849 | if (!$util.isInteger(message.nanos))
|
25850 | return "nanos: integer expected";
|
25851 | return null;
|
25852 | };
|
25853 |
|
25854 | /**
|
25855 | * Creates a Duration message from a plain object. Also converts values to their respective internal types.
|
25856 | * @function fromObject
|
25857 | * @memberof google.protobuf.Duration
|
25858 | * @static
|
25859 | * @param {Object.<string,*>} object Plain object
|
25860 | * @returns {google.protobuf.Duration} Duration
|
25861 | */
|
25862 | Duration.fromObject = function fromObject(object) {
|
25863 | if (object instanceof $root.google.protobuf.Duration)
|
25864 | return object;
|
25865 | var message = new $root.google.protobuf.Duration();
|
25866 | if (object.seconds != null)
|
25867 | if ($util.Long)
|
25868 | (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false;
|
25869 | else if (typeof object.seconds === "string")
|
25870 | message.seconds = parseInt(object.seconds, 10);
|
25871 | else if (typeof object.seconds === "number")
|
25872 | message.seconds = object.seconds;
|
25873 | else if (typeof object.seconds === "object")
|
25874 | message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber();
|
25875 | if (object.nanos != null)
|
25876 | message.nanos = object.nanos | 0;
|
25877 | return message;
|
25878 | };
|
25879 |
|
25880 | /**
|
25881 | * Creates a plain object from a Duration message. Also converts values to other types if specified.
|
25882 | * @function toObject
|
25883 | * @memberof google.protobuf.Duration
|
25884 | * @static
|
25885 | * @param {google.protobuf.Duration} message Duration
|
25886 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
25887 | * @returns {Object.<string,*>} Plain object
|
25888 | */
|
25889 | Duration.toObject = function toObject(message, options) {
|
25890 | if (!options)
|
25891 | options = {};
|
25892 | var object = {};
|
25893 | if (options.defaults) {
|
25894 | if ($util.Long) {
|
25895 | var long = new $util.Long(0, 0, false);
|
25896 | object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
25897 | } else
|
25898 | object.seconds = options.longs === String ? "0" : 0;
|
25899 | object.nanos = 0;
|
25900 | }
|
25901 | if (message.seconds != null && message.hasOwnProperty("seconds"))
|
25902 | if (typeof message.seconds === "number")
|
25903 | object.seconds = options.longs === String ? String(message.seconds) : message.seconds;
|
25904 | else
|
25905 | 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;
|
25906 | if (message.nanos != null && message.hasOwnProperty("nanos"))
|
25907 | object.nanos = message.nanos;
|
25908 | return object;
|
25909 | };
|
25910 |
|
25911 | /**
|
25912 | * Converts this Duration to JSON.
|
25913 | * @function toJSON
|
25914 | * @memberof google.protobuf.Duration
|
25915 | * @instance
|
25916 | * @returns {Object.<string,*>} JSON object
|
25917 | */
|
25918 | Duration.prototype.toJSON = function toJSON() {
|
25919 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
25920 | };
|
25921 |
|
25922 | return Duration;
|
25923 | })();
|
25924 |
|
25925 | protobuf.Empty = (function() {
|
25926 |
|
25927 | /**
|
25928 | * Properties of an Empty.
|
25929 | * @memberof google.protobuf
|
25930 | * @interface IEmpty
|
25931 | */
|
25932 |
|
25933 | /**
|
25934 | * Constructs a new Empty.
|
25935 | * @memberof google.protobuf
|
25936 | * @classdesc Represents an Empty.
|
25937 | * @implements IEmpty
|
25938 | * @constructor
|
25939 | * @param {google.protobuf.IEmpty=} [properties] Properties to set
|
25940 | */
|
25941 | function Empty(properties) {
|
25942 | if (properties)
|
25943 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
25944 | if (properties[keys[i]] != null)
|
25945 | this[keys[i]] = properties[keys[i]];
|
25946 | }
|
25947 |
|
25948 | /**
|
25949 | * Creates a new Empty instance using the specified properties.
|
25950 | * @function create
|
25951 | * @memberof google.protobuf.Empty
|
25952 | * @static
|
25953 | * @param {google.protobuf.IEmpty=} [properties] Properties to set
|
25954 | * @returns {google.protobuf.Empty} Empty instance
|
25955 | */
|
25956 | Empty.create = function create(properties) {
|
25957 | return new Empty(properties);
|
25958 | };
|
25959 |
|
25960 | /**
|
25961 | * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages.
|
25962 | * @function encode
|
25963 | * @memberof google.protobuf.Empty
|
25964 | * @static
|
25965 | * @param {google.protobuf.IEmpty} message Empty message or plain object to encode
|
25966 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
25967 | * @returns {$protobuf.Writer} Writer
|
25968 | */
|
25969 | Empty.encode = function encode(message, writer) {
|
25970 | if (!writer)
|
25971 | writer = $Writer.create();
|
25972 | return writer;
|
25973 | };
|
25974 |
|
25975 | /**
|
25976 | * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages.
|
25977 | * @function encodeDelimited
|
25978 | * @memberof google.protobuf.Empty
|
25979 | * @static
|
25980 | * @param {google.protobuf.IEmpty} message Empty message or plain object to encode
|
25981 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
25982 | * @returns {$protobuf.Writer} Writer
|
25983 | */
|
25984 | Empty.encodeDelimited = function encodeDelimited(message, writer) {
|
25985 | return this.encode(message, writer).ldelim();
|
25986 | };
|
25987 |
|
25988 | /**
|
25989 | * Decodes an Empty message from the specified reader or buffer.
|
25990 | * @function decode
|
25991 | * @memberof google.protobuf.Empty
|
25992 | * @static
|
25993 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
25994 | * @param {number} [length] Message length if known beforehand
|
25995 | * @returns {google.protobuf.Empty} Empty
|
25996 | * @throws {Error} If the payload is not a reader or valid buffer
|
25997 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
25998 | */
|
25999 | Empty.decode = function decode(reader, length) {
|
26000 | if (!(reader instanceof $Reader))
|
26001 | reader = $Reader.create(reader);
|
26002 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty();
|
26003 | while (reader.pos < end) {
|
26004 | var tag = reader.uint32();
|
26005 | switch (tag >>> 3) {
|
26006 | default:
|
26007 | reader.skipType(tag & 7);
|
26008 | break;
|
26009 | }
|
26010 | }
|
26011 | return message;
|
26012 | };
|
26013 |
|
26014 | /**
|
26015 | * Decodes an Empty message from the specified reader or buffer, length delimited.
|
26016 | * @function decodeDelimited
|
26017 | * @memberof google.protobuf.Empty
|
26018 | * @static
|
26019 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
26020 | * @returns {google.protobuf.Empty} Empty
|
26021 | * @throws {Error} If the payload is not a reader or valid buffer
|
26022 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
26023 | */
|
26024 | Empty.decodeDelimited = function decodeDelimited(reader) {
|
26025 | if (!(reader instanceof $Reader))
|
26026 | reader = new $Reader(reader);
|
26027 | return this.decode(reader, reader.uint32());
|
26028 | };
|
26029 |
|
26030 | /**
|
26031 | * Verifies an Empty message.
|
26032 | * @function verify
|
26033 | * @memberof google.protobuf.Empty
|
26034 | * @static
|
26035 | * @param {Object.<string,*>} message Plain object to verify
|
26036 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
26037 | */
|
26038 | Empty.verify = function verify(message) {
|
26039 | if (typeof message !== "object" || message === null)
|
26040 | return "object expected";
|
26041 | return null;
|
26042 | };
|
26043 |
|
26044 | /**
|
26045 | * Creates an Empty message from a plain object. Also converts values to their respective internal types.
|
26046 | * @function fromObject
|
26047 | * @memberof google.protobuf.Empty
|
26048 | * @static
|
26049 | * @param {Object.<string,*>} object Plain object
|
26050 | * @returns {google.protobuf.Empty} Empty
|
26051 | */
|
26052 | Empty.fromObject = function fromObject(object) {
|
26053 | if (object instanceof $root.google.protobuf.Empty)
|
26054 | return object;
|
26055 | return new $root.google.protobuf.Empty();
|
26056 | };
|
26057 |
|
26058 | /**
|
26059 | * Creates a plain object from an Empty message. Also converts values to other types if specified.
|
26060 | * @function toObject
|
26061 | * @memberof google.protobuf.Empty
|
26062 | * @static
|
26063 | * @param {google.protobuf.Empty} message Empty
|
26064 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
26065 | * @returns {Object.<string,*>} Plain object
|
26066 | */
|
26067 | Empty.toObject = function toObject() {
|
26068 | return {};
|
26069 | };
|
26070 |
|
26071 | /**
|
26072 | * Converts this Empty to JSON.
|
26073 | * @function toJSON
|
26074 | * @memberof google.protobuf.Empty
|
26075 | * @instance
|
26076 | * @returns {Object.<string,*>} JSON object
|
26077 | */
|
26078 | Empty.prototype.toJSON = function toJSON() {
|
26079 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
26080 | };
|
26081 |
|
26082 | return Empty;
|
26083 | })();
|
26084 |
|
26085 | protobuf.FieldMask = (function() {
|
26086 |
|
26087 | /**
|
26088 | * Properties of a FieldMask.
|
26089 | * @memberof google.protobuf
|
26090 | * @interface IFieldMask
|
26091 | * @property {Array.<string>|null} [paths] FieldMask paths
|
26092 | */
|
26093 |
|
26094 | /**
|
26095 | * Constructs a new FieldMask.
|
26096 | * @memberof google.protobuf
|
26097 | * @classdesc Represents a FieldMask.
|
26098 | * @implements IFieldMask
|
26099 | * @constructor
|
26100 | * @param {google.protobuf.IFieldMask=} [properties] Properties to set
|
26101 | */
|
26102 | function FieldMask(properties) {
|
26103 | this.paths = [];
|
26104 | if (properties)
|
26105 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
26106 | if (properties[keys[i]] != null)
|
26107 | this[keys[i]] = properties[keys[i]];
|
26108 | }
|
26109 |
|
26110 | /**
|
26111 | * FieldMask paths.
|
26112 | * @member {Array.<string>} paths
|
26113 | * @memberof google.protobuf.FieldMask
|
26114 | * @instance
|
26115 | */
|
26116 | FieldMask.prototype.paths = $util.emptyArray;
|
26117 |
|
26118 | /**
|
26119 | * Creates a new FieldMask instance using the specified properties.
|
26120 | * @function create
|
26121 | * @memberof google.protobuf.FieldMask
|
26122 | * @static
|
26123 | * @param {google.protobuf.IFieldMask=} [properties] Properties to set
|
26124 | * @returns {google.protobuf.FieldMask} FieldMask instance
|
26125 | */
|
26126 | FieldMask.create = function create(properties) {
|
26127 | return new FieldMask(properties);
|
26128 | };
|
26129 |
|
26130 | /**
|
26131 | * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages.
|
26132 | * @function encode
|
26133 | * @memberof google.protobuf.FieldMask
|
26134 | * @static
|
26135 | * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode
|
26136 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
26137 | * @returns {$protobuf.Writer} Writer
|
26138 | */
|
26139 | FieldMask.encode = function encode(message, writer) {
|
26140 | if (!writer)
|
26141 | writer = $Writer.create();
|
26142 | if (message.paths != null && message.paths.length)
|
26143 | for (var i = 0; i < message.paths.length; ++i)
|
26144 | writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]);
|
26145 | return writer;
|
26146 | };
|
26147 |
|
26148 | /**
|
26149 | * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages.
|
26150 | * @function encodeDelimited
|
26151 | * @memberof google.protobuf.FieldMask
|
26152 | * @static
|
26153 | * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode
|
26154 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
26155 | * @returns {$protobuf.Writer} Writer
|
26156 | */
|
26157 | FieldMask.encodeDelimited = function encodeDelimited(message, writer) {
|
26158 | return this.encode(message, writer).ldelim();
|
26159 | };
|
26160 |
|
26161 | /**
|
26162 | * Decodes a FieldMask message from the specified reader or buffer.
|
26163 | * @function decode
|
26164 | * @memberof google.protobuf.FieldMask
|
26165 | * @static
|
26166 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
26167 | * @param {number} [length] Message length if known beforehand
|
26168 | * @returns {google.protobuf.FieldMask} FieldMask
|
26169 | * @throws {Error} If the payload is not a reader or valid buffer
|
26170 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
26171 | */
|
26172 | FieldMask.decode = function decode(reader, length) {
|
26173 | if (!(reader instanceof $Reader))
|
26174 | reader = $Reader.create(reader);
|
26175 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask();
|
26176 | while (reader.pos < end) {
|
26177 | var tag = reader.uint32();
|
26178 | switch (tag >>> 3) {
|
26179 | case 1:
|
26180 | if (!(message.paths && message.paths.length))
|
26181 | message.paths = [];
|
26182 | message.paths.push(reader.string());
|
26183 | break;
|
26184 | default:
|
26185 | reader.skipType(tag & 7);
|
26186 | break;
|
26187 | }
|
26188 | }
|
26189 | return message;
|
26190 | };
|
26191 |
|
26192 | /**
|
26193 | * Decodes a FieldMask message from the specified reader or buffer, length delimited.
|
26194 | * @function decodeDelimited
|
26195 | * @memberof google.protobuf.FieldMask
|
26196 | * @static
|
26197 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
26198 | * @returns {google.protobuf.FieldMask} FieldMask
|
26199 | * @throws {Error} If the payload is not a reader or valid buffer
|
26200 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
26201 | */
|
26202 | FieldMask.decodeDelimited = function decodeDelimited(reader) {
|
26203 | if (!(reader instanceof $Reader))
|
26204 | reader = new $Reader(reader);
|
26205 | return this.decode(reader, reader.uint32());
|
26206 | };
|
26207 |
|
26208 | /**
|
26209 | * Verifies a FieldMask message.
|
26210 | * @function verify
|
26211 | * @memberof google.protobuf.FieldMask
|
26212 | * @static
|
26213 | * @param {Object.<string,*>} message Plain object to verify
|
26214 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
26215 | */
|
26216 | FieldMask.verify = function verify(message) {
|
26217 | if (typeof message !== "object" || message === null)
|
26218 | return "object expected";
|
26219 | if (message.paths != null && message.hasOwnProperty("paths")) {
|
26220 | if (!Array.isArray(message.paths))
|
26221 | return "paths: array expected";
|
26222 | for (var i = 0; i < message.paths.length; ++i)
|
26223 | if (!$util.isString(message.paths[i]))
|
26224 | return "paths: string[] expected";
|
26225 | }
|
26226 | return null;
|
26227 | };
|
26228 |
|
26229 | /**
|
26230 | * Creates a FieldMask message from a plain object. Also converts values to their respective internal types.
|
26231 | * @function fromObject
|
26232 | * @memberof google.protobuf.FieldMask
|
26233 | * @static
|
26234 | * @param {Object.<string,*>} object Plain object
|
26235 | * @returns {google.protobuf.FieldMask} FieldMask
|
26236 | */
|
26237 | FieldMask.fromObject = function fromObject(object) {
|
26238 | if (object instanceof $root.google.protobuf.FieldMask)
|
26239 | return object;
|
26240 | var message = new $root.google.protobuf.FieldMask();
|
26241 | if (object.paths) {
|
26242 | if (!Array.isArray(object.paths))
|
26243 | throw TypeError(".google.protobuf.FieldMask.paths: array expected");
|
26244 | message.paths = [];
|
26245 | for (var i = 0; i < object.paths.length; ++i)
|
26246 | message.paths[i] = String(object.paths[i]);
|
26247 | }
|
26248 | return message;
|
26249 | };
|
26250 |
|
26251 | /**
|
26252 | * Creates a plain object from a FieldMask message. Also converts values to other types if specified.
|
26253 | * @function toObject
|
26254 | * @memberof google.protobuf.FieldMask
|
26255 | * @static
|
26256 | * @param {google.protobuf.FieldMask} message FieldMask
|
26257 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
26258 | * @returns {Object.<string,*>} Plain object
|
26259 | */
|
26260 | FieldMask.toObject = function toObject(message, options) {
|
26261 | if (!options)
|
26262 | options = {};
|
26263 | var object = {};
|
26264 | if (options.arrays || options.defaults)
|
26265 | object.paths = [];
|
26266 | if (message.paths && message.paths.length) {
|
26267 | object.paths = [];
|
26268 | for (var j = 0; j < message.paths.length; ++j)
|
26269 | object.paths[j] = message.paths[j];
|
26270 | }
|
26271 | return object;
|
26272 | };
|
26273 |
|
26274 | /**
|
26275 | * Converts this FieldMask to JSON.
|
26276 | * @function toJSON
|
26277 | * @memberof google.protobuf.FieldMask
|
26278 | * @instance
|
26279 | * @returns {Object.<string,*>} JSON object
|
26280 | */
|
26281 | FieldMask.prototype.toJSON = function toJSON() {
|
26282 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
26283 | };
|
26284 |
|
26285 | return FieldMask;
|
26286 | })();
|
26287 |
|
26288 | protobuf.Timestamp = (function() {
|
26289 |
|
26290 | /**
|
26291 | * Properties of a Timestamp.
|
26292 | * @memberof google.protobuf
|
26293 | * @interface ITimestamp
|
26294 | * @property {number|Long|null} [seconds] Timestamp seconds
|
26295 | * @property {number|null} [nanos] Timestamp nanos
|
26296 | */
|
26297 |
|
26298 | /**
|
26299 | * Constructs a new Timestamp.
|
26300 | * @memberof google.protobuf
|
26301 | * @classdesc Represents a Timestamp.
|
26302 | * @implements ITimestamp
|
26303 | * @constructor
|
26304 | * @param {google.protobuf.ITimestamp=} [properties] Properties to set
|
26305 | */
|
26306 | function Timestamp(properties) {
|
26307 | if (properties)
|
26308 | for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
26309 | if (properties[keys[i]] != null)
|
26310 | this[keys[i]] = properties[keys[i]];
|
26311 | }
|
26312 |
|
26313 | /**
|
26314 | * Timestamp seconds.
|
26315 | * @member {number|Long} seconds
|
26316 | * @memberof google.protobuf.Timestamp
|
26317 | * @instance
|
26318 | */
|
26319 | Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
26320 |
|
26321 | /**
|
26322 | * Timestamp nanos.
|
26323 | * @member {number} nanos
|
26324 | * @memberof google.protobuf.Timestamp
|
26325 | * @instance
|
26326 | */
|
26327 | Timestamp.prototype.nanos = 0;
|
26328 |
|
26329 | /**
|
26330 | * Creates a new Timestamp instance using the specified properties.
|
26331 | * @function create
|
26332 | * @memberof google.protobuf.Timestamp
|
26333 | * @static
|
26334 | * @param {google.protobuf.ITimestamp=} [properties] Properties to set
|
26335 | * @returns {google.protobuf.Timestamp} Timestamp instance
|
26336 | */
|
26337 | Timestamp.create = function create(properties) {
|
26338 | return new Timestamp(properties);
|
26339 | };
|
26340 |
|
26341 | /**
|
26342 | * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages.
|
26343 | * @function encode
|
26344 | * @memberof google.protobuf.Timestamp
|
26345 | * @static
|
26346 | * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode
|
26347 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
26348 | * @returns {$protobuf.Writer} Writer
|
26349 | */
|
26350 | Timestamp.encode = function encode(message, writer) {
|
26351 | if (!writer)
|
26352 | writer = $Writer.create();
|
26353 | if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds"))
|
26354 | writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds);
|
26355 | if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos"))
|
26356 | writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos);
|
26357 | return writer;
|
26358 | };
|
26359 |
|
26360 | /**
|
26361 | * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages.
|
26362 | * @function encodeDelimited
|
26363 | * @memberof google.protobuf.Timestamp
|
26364 | * @static
|
26365 | * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode
|
26366 | * @param {$protobuf.Writer} [writer] Writer to encode to
|
26367 | * @returns {$protobuf.Writer} Writer
|
26368 | */
|
26369 | Timestamp.encodeDelimited = function encodeDelimited(message, writer) {
|
26370 | return this.encode(message, writer).ldelim();
|
26371 | };
|
26372 |
|
26373 | /**
|
26374 | * Decodes a Timestamp message from the specified reader or buffer.
|
26375 | * @function decode
|
26376 | * @memberof google.protobuf.Timestamp
|
26377 | * @static
|
26378 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
26379 | * @param {number} [length] Message length if known beforehand
|
26380 | * @returns {google.protobuf.Timestamp} Timestamp
|
26381 | * @throws {Error} If the payload is not a reader or valid buffer
|
26382 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
26383 | */
|
26384 | Timestamp.decode = function decode(reader, length) {
|
26385 | if (!(reader instanceof $Reader))
|
26386 | reader = $Reader.create(reader);
|
26387 | var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp();
|
26388 | while (reader.pos < end) {
|
26389 | var tag = reader.uint32();
|
26390 | switch (tag >>> 3) {
|
26391 | case 1:
|
26392 | message.seconds = reader.int64();
|
26393 | break;
|
26394 | case 2:
|
26395 | message.nanos = reader.int32();
|
26396 | break;
|
26397 | default:
|
26398 | reader.skipType(tag & 7);
|
26399 | break;
|
26400 | }
|
26401 | }
|
26402 | return message;
|
26403 | };
|
26404 |
|
26405 | /**
|
26406 | * Decodes a Timestamp message from the specified reader or buffer, length delimited.
|
26407 | * @function decodeDelimited
|
26408 | * @memberof google.protobuf.Timestamp
|
26409 | * @static
|
26410 | * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
26411 | * @returns {google.protobuf.Timestamp} Timestamp
|
26412 | * @throws {Error} If the payload is not a reader or valid buffer
|
26413 | * @throws {$protobuf.util.ProtocolError} If required fields are missing
|
26414 | */
|
26415 | Timestamp.decodeDelimited = function decodeDelimited(reader) {
|
26416 | if (!(reader instanceof $Reader))
|
26417 | reader = new $Reader(reader);
|
26418 | return this.decode(reader, reader.uint32());
|
26419 | };
|
26420 |
|
26421 | /**
|
26422 | * Verifies a Timestamp message.
|
26423 | * @function verify
|
26424 | * @memberof google.protobuf.Timestamp
|
26425 | * @static
|
26426 | * @param {Object.<string,*>} message Plain object to verify
|
26427 | * @returns {string|null} `null` if valid, otherwise the reason why it is not
|
26428 | */
|
26429 | Timestamp.verify = function verify(message) {
|
26430 | if (typeof message !== "object" || message === null)
|
26431 | return "object expected";
|
26432 | if (message.seconds != null && message.hasOwnProperty("seconds"))
|
26433 | if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high)))
|
26434 | return "seconds: integer|Long expected";
|
26435 | if (message.nanos != null && message.hasOwnProperty("nanos"))
|
26436 | if (!$util.isInteger(message.nanos))
|
26437 | return "nanos: integer expected";
|
26438 | return null;
|
26439 | };
|
26440 |
|
26441 | /**
|
26442 | * Creates a Timestamp message from a plain object. Also converts values to their respective internal types.
|
26443 | * @function fromObject
|
26444 | * @memberof google.protobuf.Timestamp
|
26445 | * @static
|
26446 | * @param {Object.<string,*>} object Plain object
|
26447 | * @returns {google.protobuf.Timestamp} Timestamp
|
26448 | */
|
26449 | Timestamp.fromObject = function fromObject(object) {
|
26450 | if (object instanceof $root.google.protobuf.Timestamp)
|
26451 | return object;
|
26452 | var message = new $root.google.protobuf.Timestamp();
|
26453 | if (object.seconds != null)
|
26454 | if ($util.Long)
|
26455 | (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false;
|
26456 | else if (typeof object.seconds === "string")
|
26457 | message.seconds = parseInt(object.seconds, 10);
|
26458 | else if (typeof object.seconds === "number")
|
26459 | message.seconds = object.seconds;
|
26460 | else if (typeof object.seconds === "object")
|
26461 | message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber();
|
26462 | if (object.nanos != null)
|
26463 | message.nanos = object.nanos | 0;
|
26464 | return message;
|
26465 | };
|
26466 |
|
26467 | /**
|
26468 | * Creates a plain object from a Timestamp message. Also converts values to other types if specified.
|
26469 | * @function toObject
|
26470 | * @memberof google.protobuf.Timestamp
|
26471 | * @static
|
26472 | * @param {google.protobuf.Timestamp} message Timestamp
|
26473 | * @param {$protobuf.IConversionOptions} [options] Conversion options
|
26474 | * @returns {Object.<string,*>} Plain object
|
26475 | */
|
26476 | Timestamp.toObject = function toObject(message, options) {
|
26477 | if (!options)
|
26478 | options = {};
|
26479 | var object = {};
|
26480 | if (options.defaults) {
|
26481 | if ($util.Long) {
|
26482 | var long = new $util.Long(0, 0, false);
|
26483 | object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
26484 | } else
|
26485 | object.seconds = options.longs === String ? "0" : 0;
|
26486 | object.nanos = 0;
|
26487 | }
|
26488 | if (message.seconds != null && message.hasOwnProperty("seconds"))
|
26489 | if (typeof message.seconds === "number")
|
26490 | object.seconds = options.longs === String ? String(message.seconds) : message.seconds;
|
26491 | else
|
26492 | 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;
|
26493 | if (message.nanos != null && message.hasOwnProperty("nanos"))
|
26494 | object.nanos = message.nanos;
|
26495 | return object;
|
26496 | };
|
26497 |
|
26498 | /**
|
26499 | * Converts this Timestamp to JSON.
|
26500 | * @function toJSON
|
26501 | * @memberof google.protobuf.Timestamp
|
26502 | * @instance
|
26503 | * @returns {Object.<string,*>} JSON object
|
26504 | */
|
26505 | Timestamp.prototype.toJSON = function toJSON() {
|
26506 | return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
26507 | };
|
26508 |
|
26509 | return Timestamp;
|
26510 | })();
|
26511 |
|
26512 | return protobuf;
|
26513 | })();
|
26514 |
|
26515 | return google;
|
26516 | })();
|
26517 |
|
26518 | return $root;
|
26519 | });
|