Adrià Vilanova MartÃnez | 413cb44 | 2021-09-06 00:30:45 +0200 | [diff] [blame] | 1 | // source: google/protobuf/api.proto |
| 2 | /** |
| 3 | * @fileoverview |
| 4 | * @enhanceable |
| 5 | * @suppress {missingRequire} reports error on implicit type usages. |
| 6 | * @suppress {messageConventions} JS Compiler reports an error if a variable or |
| 7 | * field starts with 'MSG_' and isn't a translatable message. |
| 8 | * @public |
| 9 | */ |
| 10 | // GENERATED CODE -- DO NOT EDIT! |
| 11 | /* eslint-disable */ |
| 12 | // @ts-nocheck |
| 13 | |
| 14 | var jspb = require('google-protobuf'); |
| 15 | var goog = jspb; |
| 16 | var proto = {}; |
| 17 | |
| 18 | var google_protobuf_source_context_pb = require('google-protobuf/google/protobuf/source_context_pb.js'); |
| 19 | goog.object.extend(proto, google_protobuf_source_context_pb); |
| 20 | var google_protobuf_type_pb = require('google-protobuf/google/protobuf/type_pb.js'); |
| 21 | goog.object.extend(proto, google_protobuf_type_pb); |
| 22 | goog.exportSymbol('google.protobuf.Api', null, proto); |
| 23 | goog.exportSymbol('google.protobuf.Method', null, proto); |
| 24 | goog.exportSymbol('google.protobuf.Mixin', null, proto); |
| 25 | /** |
| 26 | * Generated by JsPbCodeGenerator. |
| 27 | * @param {Array=} opt_data Optional initial data array, typically from a |
| 28 | * server response, or constructed directly in Javascript. The array is used |
| 29 | * in place and becomes part of the constructed object. It is not cloned. |
| 30 | * If no data is provided, the constructed object will be empty, but still |
| 31 | * valid. |
| 32 | * @extends {jspb.Message} |
| 33 | * @constructor |
| 34 | */ |
| 35 | proto.google.protobuf.Api = function(opt_data) { |
| 36 | jspb.Message.initialize(this, opt_data, 0, -1, proto.google.protobuf.Api.repeatedFields_, null); |
| 37 | }; |
| 38 | goog.inherits(proto.google.protobuf.Api, jspb.Message); |
| 39 | if (goog.DEBUG && !COMPILED) { |
| 40 | /** |
| 41 | * @public |
| 42 | * @override |
| 43 | */ |
| 44 | proto.google.protobuf.Api.displayName = 'proto.google.protobuf.Api'; |
| 45 | } |
| 46 | /** |
| 47 | * Generated by JsPbCodeGenerator. |
| 48 | * @param {Array=} opt_data Optional initial data array, typically from a |
| 49 | * server response, or constructed directly in Javascript. The array is used |
| 50 | * in place and becomes part of the constructed object. It is not cloned. |
| 51 | * If no data is provided, the constructed object will be empty, but still |
| 52 | * valid. |
| 53 | * @extends {jspb.Message} |
| 54 | * @constructor |
| 55 | */ |
| 56 | proto.google.protobuf.Method = function(opt_data) { |
| 57 | jspb.Message.initialize(this, opt_data, 0, -1, proto.google.protobuf.Method.repeatedFields_, null); |
| 58 | }; |
| 59 | goog.inherits(proto.google.protobuf.Method, jspb.Message); |
| 60 | if (goog.DEBUG && !COMPILED) { |
| 61 | /** |
| 62 | * @public |
| 63 | * @override |
| 64 | */ |
| 65 | proto.google.protobuf.Method.displayName = 'proto.google.protobuf.Method'; |
| 66 | } |
| 67 | /** |
| 68 | * Generated by JsPbCodeGenerator. |
| 69 | * @param {Array=} opt_data Optional initial data array, typically from a |
| 70 | * server response, or constructed directly in Javascript. The array is used |
| 71 | * in place and becomes part of the constructed object. It is not cloned. |
| 72 | * If no data is provided, the constructed object will be empty, but still |
| 73 | * valid. |
| 74 | * @extends {jspb.Message} |
| 75 | * @constructor |
| 76 | */ |
| 77 | proto.google.protobuf.Mixin = function(opt_data) { |
| 78 | jspb.Message.initialize(this, opt_data, 0, -1, null, null); |
| 79 | }; |
| 80 | goog.inherits(proto.google.protobuf.Mixin, jspb.Message); |
| 81 | if (goog.DEBUG && !COMPILED) { |
| 82 | /** |
| 83 | * @public |
| 84 | * @override |
| 85 | */ |
| 86 | proto.google.protobuf.Mixin.displayName = 'proto.google.protobuf.Mixin'; |
| 87 | } |
| 88 | |
| 89 | /** |
| 90 | * List of repeated fields within this message type. |
| 91 | * @private {!Array<number>} |
| 92 | * @const |
| 93 | */ |
| 94 | proto.google.protobuf.Api.repeatedFields_ = [2,3,6]; |
| 95 | |
| 96 | |
| 97 | |
| 98 | if (jspb.Message.GENERATE_TO_OBJECT) { |
| 99 | /** |
| 100 | * Creates an object representation of this proto. |
| 101 | * Field names that are reserved in JavaScript and will be renamed to pb_name. |
| 102 | * Optional fields that are not set will be set to undefined. |
| 103 | * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. |
| 104 | * For the list of reserved names please see: |
| 105 | * net/proto2/compiler/js/internal/generator.cc#kKeyword. |
| 106 | * @param {boolean=} opt_includeInstance Deprecated. whether to include the |
| 107 | * JSPB instance for transitional soy proto support: |
| 108 | * http://goto/soy-param-migration |
| 109 | * @return {!Object} |
| 110 | */ |
| 111 | proto.google.protobuf.Api.prototype.toObject = function(opt_includeInstance) { |
| 112 | return proto.google.protobuf.Api.toObject(opt_includeInstance, this); |
| 113 | }; |
| 114 | |
| 115 | |
| 116 | /** |
| 117 | * Static version of the {@see toObject} method. |
| 118 | * @param {boolean|undefined} includeInstance Deprecated. Whether to include |
| 119 | * the JSPB instance for transitional soy proto support: |
| 120 | * http://goto/soy-param-migration |
| 121 | * @param {!proto.google.protobuf.Api} msg The msg instance to transform. |
| 122 | * @return {!Object} |
| 123 | * @suppress {unusedLocalVariables} f is only used for nested messages |
| 124 | */ |
| 125 | proto.google.protobuf.Api.toObject = function(includeInstance, msg) { |
| 126 | var f, obj = { |
| 127 | name: jspb.Message.getFieldWithDefault(msg, 1, ""), |
| 128 | methodsList: jspb.Message.toObjectList(msg.getMethodsList(), |
| 129 | proto.google.protobuf.Method.toObject, includeInstance), |
| 130 | optionsList: jspb.Message.toObjectList(msg.getOptionsList(), |
| 131 | google_protobuf_type_pb.Option.toObject, includeInstance), |
| 132 | version: jspb.Message.getFieldWithDefault(msg, 4, ""), |
| 133 | sourceContext: (f = msg.getSourceContext()) && google_protobuf_source_context_pb.SourceContext.toObject(includeInstance, f), |
| 134 | mixinsList: jspb.Message.toObjectList(msg.getMixinsList(), |
| 135 | proto.google.protobuf.Mixin.toObject, includeInstance), |
| 136 | syntax: jspb.Message.getFieldWithDefault(msg, 7, 0) |
| 137 | }; |
| 138 | |
| 139 | if (includeInstance) { |
| 140 | obj.$jspbMessageInstance = msg; |
| 141 | } |
| 142 | return obj; |
| 143 | }; |
| 144 | } |
| 145 | |
| 146 | |
| 147 | /** |
| 148 | * Deserializes binary data (in protobuf wire format). |
| 149 | * @param {jspb.ByteSource} bytes The bytes to deserialize. |
| 150 | * @return {!proto.google.protobuf.Api} |
| 151 | */ |
| 152 | proto.google.protobuf.Api.deserializeBinary = function(bytes) { |
| 153 | var reader = new jspb.BinaryReader(bytes); |
| 154 | var msg = new proto.google.protobuf.Api; |
| 155 | return proto.google.protobuf.Api.deserializeBinaryFromReader(msg, reader); |
| 156 | }; |
| 157 | |
| 158 | |
| 159 | /** |
| 160 | * Deserializes binary data (in protobuf wire format) from the |
| 161 | * given reader into the given message object. |
| 162 | * @param {!proto.google.protobuf.Api} msg The message object to deserialize into. |
| 163 | * @param {!jspb.BinaryReader} reader The BinaryReader to use. |
| 164 | * @return {!proto.google.protobuf.Api} |
| 165 | */ |
| 166 | proto.google.protobuf.Api.deserializeBinaryFromReader = function(msg, reader) { |
| 167 | while (reader.nextField()) { |
| 168 | if (reader.isEndGroup()) { |
| 169 | break; |
| 170 | } |
| 171 | var field = reader.getFieldNumber(); |
| 172 | switch (field) { |
| 173 | case 1: |
| 174 | var value = /** @type {string} */ (reader.readString()); |
| 175 | msg.setName(value); |
| 176 | break; |
| 177 | case 2: |
| 178 | var value = new proto.google.protobuf.Method; |
| 179 | reader.readMessage(value,proto.google.protobuf.Method.deserializeBinaryFromReader); |
| 180 | msg.addMethods(value); |
| 181 | break; |
| 182 | case 3: |
| 183 | var value = new google_protobuf_type_pb.Option; |
| 184 | reader.readMessage(value,google_protobuf_type_pb.Option.deserializeBinaryFromReader); |
| 185 | msg.addOptions(value); |
| 186 | break; |
| 187 | case 4: |
| 188 | var value = /** @type {string} */ (reader.readString()); |
| 189 | msg.setVersion(value); |
| 190 | break; |
| 191 | case 5: |
| 192 | var value = new google_protobuf_source_context_pb.SourceContext; |
| 193 | reader.readMessage(value,google_protobuf_source_context_pb.SourceContext.deserializeBinaryFromReader); |
| 194 | msg.setSourceContext(value); |
| 195 | break; |
| 196 | case 6: |
| 197 | var value = new proto.google.protobuf.Mixin; |
| 198 | reader.readMessage(value,proto.google.protobuf.Mixin.deserializeBinaryFromReader); |
| 199 | msg.addMixins(value); |
| 200 | break; |
| 201 | case 7: |
| 202 | var value = /** @type {!proto.google.protobuf.Syntax} */ (reader.readEnum()); |
| 203 | msg.setSyntax(value); |
| 204 | break; |
| 205 | default: |
| 206 | reader.skipField(); |
| 207 | break; |
| 208 | } |
| 209 | } |
| 210 | return msg; |
| 211 | }; |
| 212 | |
| 213 | |
| 214 | /** |
| 215 | * Serializes the message to binary data (in protobuf wire format). |
| 216 | * @return {!Uint8Array} |
| 217 | */ |
| 218 | proto.google.protobuf.Api.prototype.serializeBinary = function() { |
| 219 | var writer = new jspb.BinaryWriter(); |
| 220 | proto.google.protobuf.Api.serializeBinaryToWriter(this, writer); |
| 221 | return writer.getResultBuffer(); |
| 222 | }; |
| 223 | |
| 224 | |
| 225 | /** |
| 226 | * Serializes the given message to binary data (in protobuf wire |
| 227 | * format), writing to the given BinaryWriter. |
| 228 | * @param {!proto.google.protobuf.Api} message |
| 229 | * @param {!jspb.BinaryWriter} writer |
| 230 | * @suppress {unusedLocalVariables} f is only used for nested messages |
| 231 | */ |
| 232 | proto.google.protobuf.Api.serializeBinaryToWriter = function(message, writer) { |
| 233 | var f = undefined; |
| 234 | f = message.getName(); |
| 235 | if (f.length > 0) { |
| 236 | writer.writeString( |
| 237 | 1, |
| 238 | f |
| 239 | ); |
| 240 | } |
| 241 | f = message.getMethodsList(); |
| 242 | if (f.length > 0) { |
| 243 | writer.writeRepeatedMessage( |
| 244 | 2, |
| 245 | f, |
| 246 | proto.google.protobuf.Method.serializeBinaryToWriter |
| 247 | ); |
| 248 | } |
| 249 | f = message.getOptionsList(); |
| 250 | if (f.length > 0) { |
| 251 | writer.writeRepeatedMessage( |
| 252 | 3, |
| 253 | f, |
| 254 | google_protobuf_type_pb.Option.serializeBinaryToWriter |
| 255 | ); |
| 256 | } |
| 257 | f = message.getVersion(); |
| 258 | if (f.length > 0) { |
| 259 | writer.writeString( |
| 260 | 4, |
| 261 | f |
| 262 | ); |
| 263 | } |
| 264 | f = message.getSourceContext(); |
| 265 | if (f != null) { |
| 266 | writer.writeMessage( |
| 267 | 5, |
| 268 | f, |
| 269 | google_protobuf_source_context_pb.SourceContext.serializeBinaryToWriter |
| 270 | ); |
| 271 | } |
| 272 | f = message.getMixinsList(); |
| 273 | if (f.length > 0) { |
| 274 | writer.writeRepeatedMessage( |
| 275 | 6, |
| 276 | f, |
| 277 | proto.google.protobuf.Mixin.serializeBinaryToWriter |
| 278 | ); |
| 279 | } |
| 280 | f = message.getSyntax(); |
| 281 | if (f !== 0.0) { |
| 282 | writer.writeEnum( |
| 283 | 7, |
| 284 | f |
| 285 | ); |
| 286 | } |
| 287 | }; |
| 288 | |
| 289 | |
| 290 | /** |
| 291 | * optional string name = 1; |
| 292 | * @return {string} |
| 293 | */ |
| 294 | proto.google.protobuf.Api.prototype.getName = function() { |
| 295 | return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); |
| 296 | }; |
| 297 | |
| 298 | |
| 299 | /** |
| 300 | * @param {string} value |
| 301 | * @return {!proto.google.protobuf.Api} returns this |
| 302 | */ |
| 303 | proto.google.protobuf.Api.prototype.setName = function(value) { |
| 304 | return jspb.Message.setProto3StringField(this, 1, value); |
| 305 | }; |
| 306 | |
| 307 | |
| 308 | /** |
| 309 | * repeated Method methods = 2; |
| 310 | * @return {!Array<!proto.google.protobuf.Method>} |
| 311 | */ |
| 312 | proto.google.protobuf.Api.prototype.getMethodsList = function() { |
| 313 | return /** @type{!Array<!proto.google.protobuf.Method>} */ ( |
| 314 | jspb.Message.getRepeatedWrapperField(this, proto.google.protobuf.Method, 2)); |
| 315 | }; |
| 316 | |
| 317 | |
| 318 | /** |
| 319 | * @param {!Array<!proto.google.protobuf.Method>} value |
| 320 | * @return {!proto.google.protobuf.Api} returns this |
| 321 | */ |
| 322 | proto.google.protobuf.Api.prototype.setMethodsList = function(value) { |
| 323 | return jspb.Message.setRepeatedWrapperField(this, 2, value); |
| 324 | }; |
| 325 | |
| 326 | |
| 327 | /** |
| 328 | * @param {!proto.google.protobuf.Method=} opt_value |
| 329 | * @param {number=} opt_index |
| 330 | * @return {!proto.google.protobuf.Method} |
| 331 | */ |
| 332 | proto.google.protobuf.Api.prototype.addMethods = function(opt_value, opt_index) { |
| 333 | return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.google.protobuf.Method, opt_index); |
| 334 | }; |
| 335 | |
| 336 | |
| 337 | /** |
| 338 | * Clears the list making it empty but non-null. |
| 339 | * @return {!proto.google.protobuf.Api} returns this |
| 340 | */ |
| 341 | proto.google.protobuf.Api.prototype.clearMethodsList = function() { |
| 342 | return this.setMethodsList([]); |
| 343 | }; |
| 344 | |
| 345 | |
| 346 | /** |
| 347 | * repeated Option options = 3; |
| 348 | * @return {!Array<!proto.google.protobuf.Option>} |
| 349 | */ |
| 350 | proto.google.protobuf.Api.prototype.getOptionsList = function() { |
| 351 | return /** @type{!Array<!proto.google.protobuf.Option>} */ ( |
| 352 | jspb.Message.getRepeatedWrapperField(this, google_protobuf_type_pb.Option, 3)); |
| 353 | }; |
| 354 | |
| 355 | |
| 356 | /** |
| 357 | * @param {!Array<!proto.google.protobuf.Option>} value |
| 358 | * @return {!proto.google.protobuf.Api} returns this |
| 359 | */ |
| 360 | proto.google.protobuf.Api.prototype.setOptionsList = function(value) { |
| 361 | return jspb.Message.setRepeatedWrapperField(this, 3, value); |
| 362 | }; |
| 363 | |
| 364 | |
| 365 | /** |
| 366 | * @param {!proto.google.protobuf.Option=} opt_value |
| 367 | * @param {number=} opt_index |
| 368 | * @return {!proto.google.protobuf.Option} |
| 369 | */ |
| 370 | proto.google.protobuf.Api.prototype.addOptions = function(opt_value, opt_index) { |
| 371 | return jspb.Message.addToRepeatedWrapperField(this, 3, opt_value, proto.google.protobuf.Option, opt_index); |
| 372 | }; |
| 373 | |
| 374 | |
| 375 | /** |
| 376 | * Clears the list making it empty but non-null. |
| 377 | * @return {!proto.google.protobuf.Api} returns this |
| 378 | */ |
| 379 | proto.google.protobuf.Api.prototype.clearOptionsList = function() { |
| 380 | return this.setOptionsList([]); |
| 381 | }; |
| 382 | |
| 383 | |
| 384 | /** |
| 385 | * optional string version = 4; |
| 386 | * @return {string} |
| 387 | */ |
| 388 | proto.google.protobuf.Api.prototype.getVersion = function() { |
| 389 | return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); |
| 390 | }; |
| 391 | |
| 392 | |
| 393 | /** |
| 394 | * @param {string} value |
| 395 | * @return {!proto.google.protobuf.Api} returns this |
| 396 | */ |
| 397 | proto.google.protobuf.Api.prototype.setVersion = function(value) { |
| 398 | return jspb.Message.setProto3StringField(this, 4, value); |
| 399 | }; |
| 400 | |
| 401 | |
| 402 | /** |
| 403 | * optional SourceContext source_context = 5; |
| 404 | * @return {?proto.google.protobuf.SourceContext} |
| 405 | */ |
| 406 | proto.google.protobuf.Api.prototype.getSourceContext = function() { |
| 407 | return /** @type{?proto.google.protobuf.SourceContext} */ ( |
| 408 | jspb.Message.getWrapperField(this, google_protobuf_source_context_pb.SourceContext, 5)); |
| 409 | }; |
| 410 | |
| 411 | |
| 412 | /** |
| 413 | * @param {?proto.google.protobuf.SourceContext|undefined} value |
| 414 | * @return {!proto.google.protobuf.Api} returns this |
| 415 | */ |
| 416 | proto.google.protobuf.Api.prototype.setSourceContext = function(value) { |
| 417 | return jspb.Message.setWrapperField(this, 5, value); |
| 418 | }; |
| 419 | |
| 420 | |
| 421 | /** |
| 422 | * Clears the message field making it undefined. |
| 423 | * @return {!proto.google.protobuf.Api} returns this |
| 424 | */ |
| 425 | proto.google.protobuf.Api.prototype.clearSourceContext = function() { |
| 426 | return this.setSourceContext(undefined); |
| 427 | }; |
| 428 | |
| 429 | |
| 430 | /** |
| 431 | * Returns whether this field is set. |
| 432 | * @return {boolean} |
| 433 | */ |
| 434 | proto.google.protobuf.Api.prototype.hasSourceContext = function() { |
| 435 | return jspb.Message.getField(this, 5) != null; |
| 436 | }; |
| 437 | |
| 438 | |
| 439 | /** |
| 440 | * repeated Mixin mixins = 6; |
| 441 | * @return {!Array<!proto.google.protobuf.Mixin>} |
| 442 | */ |
| 443 | proto.google.protobuf.Api.prototype.getMixinsList = function() { |
| 444 | return /** @type{!Array<!proto.google.protobuf.Mixin>} */ ( |
| 445 | jspb.Message.getRepeatedWrapperField(this, proto.google.protobuf.Mixin, 6)); |
| 446 | }; |
| 447 | |
| 448 | |
| 449 | /** |
| 450 | * @param {!Array<!proto.google.protobuf.Mixin>} value |
| 451 | * @return {!proto.google.protobuf.Api} returns this |
| 452 | */ |
| 453 | proto.google.protobuf.Api.prototype.setMixinsList = function(value) { |
| 454 | return jspb.Message.setRepeatedWrapperField(this, 6, value); |
| 455 | }; |
| 456 | |
| 457 | |
| 458 | /** |
| 459 | * @param {!proto.google.protobuf.Mixin=} opt_value |
| 460 | * @param {number=} opt_index |
| 461 | * @return {!proto.google.protobuf.Mixin} |
| 462 | */ |
| 463 | proto.google.protobuf.Api.prototype.addMixins = function(opt_value, opt_index) { |
| 464 | return jspb.Message.addToRepeatedWrapperField(this, 6, opt_value, proto.google.protobuf.Mixin, opt_index); |
| 465 | }; |
| 466 | |
| 467 | |
| 468 | /** |
| 469 | * Clears the list making it empty but non-null. |
| 470 | * @return {!proto.google.protobuf.Api} returns this |
| 471 | */ |
| 472 | proto.google.protobuf.Api.prototype.clearMixinsList = function() { |
| 473 | return this.setMixinsList([]); |
| 474 | }; |
| 475 | |
| 476 | |
| 477 | /** |
| 478 | * optional Syntax syntax = 7; |
| 479 | * @return {!proto.google.protobuf.Syntax} |
| 480 | */ |
| 481 | proto.google.protobuf.Api.prototype.getSyntax = function() { |
| 482 | return /** @type {!proto.google.protobuf.Syntax} */ (jspb.Message.getFieldWithDefault(this, 7, 0)); |
| 483 | }; |
| 484 | |
| 485 | |
| 486 | /** |
| 487 | * @param {!proto.google.protobuf.Syntax} value |
| 488 | * @return {!proto.google.protobuf.Api} returns this |
| 489 | */ |
| 490 | proto.google.protobuf.Api.prototype.setSyntax = function(value) { |
| 491 | return jspb.Message.setProto3EnumField(this, 7, value); |
| 492 | }; |
| 493 | |
| 494 | |
| 495 | |
| 496 | /** |
| 497 | * List of repeated fields within this message type. |
| 498 | * @private {!Array<number>} |
| 499 | * @const |
| 500 | */ |
| 501 | proto.google.protobuf.Method.repeatedFields_ = [6]; |
| 502 | |
| 503 | |
| 504 | |
| 505 | if (jspb.Message.GENERATE_TO_OBJECT) { |
| 506 | /** |
| 507 | * Creates an object representation of this proto. |
| 508 | * Field names that are reserved in JavaScript and will be renamed to pb_name. |
| 509 | * Optional fields that are not set will be set to undefined. |
| 510 | * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. |
| 511 | * For the list of reserved names please see: |
| 512 | * net/proto2/compiler/js/internal/generator.cc#kKeyword. |
| 513 | * @param {boolean=} opt_includeInstance Deprecated. whether to include the |
| 514 | * JSPB instance for transitional soy proto support: |
| 515 | * http://goto/soy-param-migration |
| 516 | * @return {!Object} |
| 517 | */ |
| 518 | proto.google.protobuf.Method.prototype.toObject = function(opt_includeInstance) { |
| 519 | return proto.google.protobuf.Method.toObject(opt_includeInstance, this); |
| 520 | }; |
| 521 | |
| 522 | |
| 523 | /** |
| 524 | * Static version of the {@see toObject} method. |
| 525 | * @param {boolean|undefined} includeInstance Deprecated. Whether to include |
| 526 | * the JSPB instance for transitional soy proto support: |
| 527 | * http://goto/soy-param-migration |
| 528 | * @param {!proto.google.protobuf.Method} msg The msg instance to transform. |
| 529 | * @return {!Object} |
| 530 | * @suppress {unusedLocalVariables} f is only used for nested messages |
| 531 | */ |
| 532 | proto.google.protobuf.Method.toObject = function(includeInstance, msg) { |
| 533 | var f, obj = { |
| 534 | name: jspb.Message.getFieldWithDefault(msg, 1, ""), |
| 535 | requestTypeUrl: jspb.Message.getFieldWithDefault(msg, 2, ""), |
| 536 | requestStreaming: jspb.Message.getBooleanFieldWithDefault(msg, 3, false), |
| 537 | responseTypeUrl: jspb.Message.getFieldWithDefault(msg, 4, ""), |
| 538 | responseStreaming: jspb.Message.getBooleanFieldWithDefault(msg, 5, false), |
| 539 | optionsList: jspb.Message.toObjectList(msg.getOptionsList(), |
| 540 | google_protobuf_type_pb.Option.toObject, includeInstance), |
| 541 | syntax: jspb.Message.getFieldWithDefault(msg, 7, 0) |
| 542 | }; |
| 543 | |
| 544 | if (includeInstance) { |
| 545 | obj.$jspbMessageInstance = msg; |
| 546 | } |
| 547 | return obj; |
| 548 | }; |
| 549 | } |
| 550 | |
| 551 | |
| 552 | /** |
| 553 | * Deserializes binary data (in protobuf wire format). |
| 554 | * @param {jspb.ByteSource} bytes The bytes to deserialize. |
| 555 | * @return {!proto.google.protobuf.Method} |
| 556 | */ |
| 557 | proto.google.protobuf.Method.deserializeBinary = function(bytes) { |
| 558 | var reader = new jspb.BinaryReader(bytes); |
| 559 | var msg = new proto.google.protobuf.Method; |
| 560 | return proto.google.protobuf.Method.deserializeBinaryFromReader(msg, reader); |
| 561 | }; |
| 562 | |
| 563 | |
| 564 | /** |
| 565 | * Deserializes binary data (in protobuf wire format) from the |
| 566 | * given reader into the given message object. |
| 567 | * @param {!proto.google.protobuf.Method} msg The message object to deserialize into. |
| 568 | * @param {!jspb.BinaryReader} reader The BinaryReader to use. |
| 569 | * @return {!proto.google.protobuf.Method} |
| 570 | */ |
| 571 | proto.google.protobuf.Method.deserializeBinaryFromReader = function(msg, reader) { |
| 572 | while (reader.nextField()) { |
| 573 | if (reader.isEndGroup()) { |
| 574 | break; |
| 575 | } |
| 576 | var field = reader.getFieldNumber(); |
| 577 | switch (field) { |
| 578 | case 1: |
| 579 | var value = /** @type {string} */ (reader.readString()); |
| 580 | msg.setName(value); |
| 581 | break; |
| 582 | case 2: |
| 583 | var value = /** @type {string} */ (reader.readString()); |
| 584 | msg.setRequestTypeUrl(value); |
| 585 | break; |
| 586 | case 3: |
| 587 | var value = /** @type {boolean} */ (reader.readBool()); |
| 588 | msg.setRequestStreaming(value); |
| 589 | break; |
| 590 | case 4: |
| 591 | var value = /** @type {string} */ (reader.readString()); |
| 592 | msg.setResponseTypeUrl(value); |
| 593 | break; |
| 594 | case 5: |
| 595 | var value = /** @type {boolean} */ (reader.readBool()); |
| 596 | msg.setResponseStreaming(value); |
| 597 | break; |
| 598 | case 6: |
| 599 | var value = new google_protobuf_type_pb.Option; |
| 600 | reader.readMessage(value,google_protobuf_type_pb.Option.deserializeBinaryFromReader); |
| 601 | msg.addOptions(value); |
| 602 | break; |
| 603 | case 7: |
| 604 | var value = /** @type {!proto.google.protobuf.Syntax} */ (reader.readEnum()); |
| 605 | msg.setSyntax(value); |
| 606 | break; |
| 607 | default: |
| 608 | reader.skipField(); |
| 609 | break; |
| 610 | } |
| 611 | } |
| 612 | return msg; |
| 613 | }; |
| 614 | |
| 615 | |
| 616 | /** |
| 617 | * Serializes the message to binary data (in protobuf wire format). |
| 618 | * @return {!Uint8Array} |
| 619 | */ |
| 620 | proto.google.protobuf.Method.prototype.serializeBinary = function() { |
| 621 | var writer = new jspb.BinaryWriter(); |
| 622 | proto.google.protobuf.Method.serializeBinaryToWriter(this, writer); |
| 623 | return writer.getResultBuffer(); |
| 624 | }; |
| 625 | |
| 626 | |
| 627 | /** |
| 628 | * Serializes the given message to binary data (in protobuf wire |
| 629 | * format), writing to the given BinaryWriter. |
| 630 | * @param {!proto.google.protobuf.Method} message |
| 631 | * @param {!jspb.BinaryWriter} writer |
| 632 | * @suppress {unusedLocalVariables} f is only used for nested messages |
| 633 | */ |
| 634 | proto.google.protobuf.Method.serializeBinaryToWriter = function(message, writer) { |
| 635 | var f = undefined; |
| 636 | f = message.getName(); |
| 637 | if (f.length > 0) { |
| 638 | writer.writeString( |
| 639 | 1, |
| 640 | f |
| 641 | ); |
| 642 | } |
| 643 | f = message.getRequestTypeUrl(); |
| 644 | if (f.length > 0) { |
| 645 | writer.writeString( |
| 646 | 2, |
| 647 | f |
| 648 | ); |
| 649 | } |
| 650 | f = message.getRequestStreaming(); |
| 651 | if (f) { |
| 652 | writer.writeBool( |
| 653 | 3, |
| 654 | f |
| 655 | ); |
| 656 | } |
| 657 | f = message.getResponseTypeUrl(); |
| 658 | if (f.length > 0) { |
| 659 | writer.writeString( |
| 660 | 4, |
| 661 | f |
| 662 | ); |
| 663 | } |
| 664 | f = message.getResponseStreaming(); |
| 665 | if (f) { |
| 666 | writer.writeBool( |
| 667 | 5, |
| 668 | f |
| 669 | ); |
| 670 | } |
| 671 | f = message.getOptionsList(); |
| 672 | if (f.length > 0) { |
| 673 | writer.writeRepeatedMessage( |
| 674 | 6, |
| 675 | f, |
| 676 | google_protobuf_type_pb.Option.serializeBinaryToWriter |
| 677 | ); |
| 678 | } |
| 679 | f = message.getSyntax(); |
| 680 | if (f !== 0.0) { |
| 681 | writer.writeEnum( |
| 682 | 7, |
| 683 | f |
| 684 | ); |
| 685 | } |
| 686 | }; |
| 687 | |
| 688 | |
| 689 | /** |
| 690 | * optional string name = 1; |
| 691 | * @return {string} |
| 692 | */ |
| 693 | proto.google.protobuf.Method.prototype.getName = function() { |
| 694 | return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); |
| 695 | }; |
| 696 | |
| 697 | |
| 698 | /** |
| 699 | * @param {string} value |
| 700 | * @return {!proto.google.protobuf.Method} returns this |
| 701 | */ |
| 702 | proto.google.protobuf.Method.prototype.setName = function(value) { |
| 703 | return jspb.Message.setProto3StringField(this, 1, value); |
| 704 | }; |
| 705 | |
| 706 | |
| 707 | /** |
| 708 | * optional string request_type_url = 2; |
| 709 | * @return {string} |
| 710 | */ |
| 711 | proto.google.protobuf.Method.prototype.getRequestTypeUrl = function() { |
| 712 | return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); |
| 713 | }; |
| 714 | |
| 715 | |
| 716 | /** |
| 717 | * @param {string} value |
| 718 | * @return {!proto.google.protobuf.Method} returns this |
| 719 | */ |
| 720 | proto.google.protobuf.Method.prototype.setRequestTypeUrl = function(value) { |
| 721 | return jspb.Message.setProto3StringField(this, 2, value); |
| 722 | }; |
| 723 | |
| 724 | |
| 725 | /** |
| 726 | * optional bool request_streaming = 3; |
| 727 | * @return {boolean} |
| 728 | */ |
| 729 | proto.google.protobuf.Method.prototype.getRequestStreaming = function() { |
| 730 | return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 3, false)); |
| 731 | }; |
| 732 | |
| 733 | |
| 734 | /** |
| 735 | * @param {boolean} value |
| 736 | * @return {!proto.google.protobuf.Method} returns this |
| 737 | */ |
| 738 | proto.google.protobuf.Method.prototype.setRequestStreaming = function(value) { |
| 739 | return jspb.Message.setProto3BooleanField(this, 3, value); |
| 740 | }; |
| 741 | |
| 742 | |
| 743 | /** |
| 744 | * optional string response_type_url = 4; |
| 745 | * @return {string} |
| 746 | */ |
| 747 | proto.google.protobuf.Method.prototype.getResponseTypeUrl = function() { |
| 748 | return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); |
| 749 | }; |
| 750 | |
| 751 | |
| 752 | /** |
| 753 | * @param {string} value |
| 754 | * @return {!proto.google.protobuf.Method} returns this |
| 755 | */ |
| 756 | proto.google.protobuf.Method.prototype.setResponseTypeUrl = function(value) { |
| 757 | return jspb.Message.setProto3StringField(this, 4, value); |
| 758 | }; |
| 759 | |
| 760 | |
| 761 | /** |
| 762 | * optional bool response_streaming = 5; |
| 763 | * @return {boolean} |
| 764 | */ |
| 765 | proto.google.protobuf.Method.prototype.getResponseStreaming = function() { |
| 766 | return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 5, false)); |
| 767 | }; |
| 768 | |
| 769 | |
| 770 | /** |
| 771 | * @param {boolean} value |
| 772 | * @return {!proto.google.protobuf.Method} returns this |
| 773 | */ |
| 774 | proto.google.protobuf.Method.prototype.setResponseStreaming = function(value) { |
| 775 | return jspb.Message.setProto3BooleanField(this, 5, value); |
| 776 | }; |
| 777 | |
| 778 | |
| 779 | /** |
| 780 | * repeated Option options = 6; |
| 781 | * @return {!Array<!proto.google.protobuf.Option>} |
| 782 | */ |
| 783 | proto.google.protobuf.Method.prototype.getOptionsList = function() { |
| 784 | return /** @type{!Array<!proto.google.protobuf.Option>} */ ( |
| 785 | jspb.Message.getRepeatedWrapperField(this, google_protobuf_type_pb.Option, 6)); |
| 786 | }; |
| 787 | |
| 788 | |
| 789 | /** |
| 790 | * @param {!Array<!proto.google.protobuf.Option>} value |
| 791 | * @return {!proto.google.protobuf.Method} returns this |
| 792 | */ |
| 793 | proto.google.protobuf.Method.prototype.setOptionsList = function(value) { |
| 794 | return jspb.Message.setRepeatedWrapperField(this, 6, value); |
| 795 | }; |
| 796 | |
| 797 | |
| 798 | /** |
| 799 | * @param {!proto.google.protobuf.Option=} opt_value |
| 800 | * @param {number=} opt_index |
| 801 | * @return {!proto.google.protobuf.Option} |
| 802 | */ |
| 803 | proto.google.protobuf.Method.prototype.addOptions = function(opt_value, opt_index) { |
| 804 | return jspb.Message.addToRepeatedWrapperField(this, 6, opt_value, proto.google.protobuf.Option, opt_index); |
| 805 | }; |
| 806 | |
| 807 | |
| 808 | /** |
| 809 | * Clears the list making it empty but non-null. |
| 810 | * @return {!proto.google.protobuf.Method} returns this |
| 811 | */ |
| 812 | proto.google.protobuf.Method.prototype.clearOptionsList = function() { |
| 813 | return this.setOptionsList([]); |
| 814 | }; |
| 815 | |
| 816 | |
| 817 | /** |
| 818 | * optional Syntax syntax = 7; |
| 819 | * @return {!proto.google.protobuf.Syntax} |
| 820 | */ |
| 821 | proto.google.protobuf.Method.prototype.getSyntax = function() { |
| 822 | return /** @type {!proto.google.protobuf.Syntax} */ (jspb.Message.getFieldWithDefault(this, 7, 0)); |
| 823 | }; |
| 824 | |
| 825 | |
| 826 | /** |
| 827 | * @param {!proto.google.protobuf.Syntax} value |
| 828 | * @return {!proto.google.protobuf.Method} returns this |
| 829 | */ |
| 830 | proto.google.protobuf.Method.prototype.setSyntax = function(value) { |
| 831 | return jspb.Message.setProto3EnumField(this, 7, value); |
| 832 | }; |
| 833 | |
| 834 | |
| 835 | |
| 836 | |
| 837 | |
| 838 | if (jspb.Message.GENERATE_TO_OBJECT) { |
| 839 | /** |
| 840 | * Creates an object representation of this proto. |
| 841 | * Field names that are reserved in JavaScript and will be renamed to pb_name. |
| 842 | * Optional fields that are not set will be set to undefined. |
| 843 | * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. |
| 844 | * For the list of reserved names please see: |
| 845 | * net/proto2/compiler/js/internal/generator.cc#kKeyword. |
| 846 | * @param {boolean=} opt_includeInstance Deprecated. whether to include the |
| 847 | * JSPB instance for transitional soy proto support: |
| 848 | * http://goto/soy-param-migration |
| 849 | * @return {!Object} |
| 850 | */ |
| 851 | proto.google.protobuf.Mixin.prototype.toObject = function(opt_includeInstance) { |
| 852 | return proto.google.protobuf.Mixin.toObject(opt_includeInstance, this); |
| 853 | }; |
| 854 | |
| 855 | |
| 856 | /** |
| 857 | * Static version of the {@see toObject} method. |
| 858 | * @param {boolean|undefined} includeInstance Deprecated. Whether to include |
| 859 | * the JSPB instance for transitional soy proto support: |
| 860 | * http://goto/soy-param-migration |
| 861 | * @param {!proto.google.protobuf.Mixin} msg The msg instance to transform. |
| 862 | * @return {!Object} |
| 863 | * @suppress {unusedLocalVariables} f is only used for nested messages |
| 864 | */ |
| 865 | proto.google.protobuf.Mixin.toObject = function(includeInstance, msg) { |
| 866 | var f, obj = { |
| 867 | name: jspb.Message.getFieldWithDefault(msg, 1, ""), |
| 868 | root: jspb.Message.getFieldWithDefault(msg, 2, "") |
| 869 | }; |
| 870 | |
| 871 | if (includeInstance) { |
| 872 | obj.$jspbMessageInstance = msg; |
| 873 | } |
| 874 | return obj; |
| 875 | }; |
| 876 | } |
| 877 | |
| 878 | |
| 879 | /** |
| 880 | * Deserializes binary data (in protobuf wire format). |
| 881 | * @param {jspb.ByteSource} bytes The bytes to deserialize. |
| 882 | * @return {!proto.google.protobuf.Mixin} |
| 883 | */ |
| 884 | proto.google.protobuf.Mixin.deserializeBinary = function(bytes) { |
| 885 | var reader = new jspb.BinaryReader(bytes); |
| 886 | var msg = new proto.google.protobuf.Mixin; |
| 887 | return proto.google.protobuf.Mixin.deserializeBinaryFromReader(msg, reader); |
| 888 | }; |
| 889 | |
| 890 | |
| 891 | /** |
| 892 | * Deserializes binary data (in protobuf wire format) from the |
| 893 | * given reader into the given message object. |
| 894 | * @param {!proto.google.protobuf.Mixin} msg The message object to deserialize into. |
| 895 | * @param {!jspb.BinaryReader} reader The BinaryReader to use. |
| 896 | * @return {!proto.google.protobuf.Mixin} |
| 897 | */ |
| 898 | proto.google.protobuf.Mixin.deserializeBinaryFromReader = function(msg, reader) { |
| 899 | while (reader.nextField()) { |
| 900 | if (reader.isEndGroup()) { |
| 901 | break; |
| 902 | } |
| 903 | var field = reader.getFieldNumber(); |
| 904 | switch (field) { |
| 905 | case 1: |
| 906 | var value = /** @type {string} */ (reader.readString()); |
| 907 | msg.setName(value); |
| 908 | break; |
| 909 | case 2: |
| 910 | var value = /** @type {string} */ (reader.readString()); |
| 911 | msg.setRoot(value); |
| 912 | break; |
| 913 | default: |
| 914 | reader.skipField(); |
| 915 | break; |
| 916 | } |
| 917 | } |
| 918 | return msg; |
| 919 | }; |
| 920 | |
| 921 | |
| 922 | /** |
| 923 | * Serializes the message to binary data (in protobuf wire format). |
| 924 | * @return {!Uint8Array} |
| 925 | */ |
| 926 | proto.google.protobuf.Mixin.prototype.serializeBinary = function() { |
| 927 | var writer = new jspb.BinaryWriter(); |
| 928 | proto.google.protobuf.Mixin.serializeBinaryToWriter(this, writer); |
| 929 | return writer.getResultBuffer(); |
| 930 | }; |
| 931 | |
| 932 | |
| 933 | /** |
| 934 | * Serializes the given message to binary data (in protobuf wire |
| 935 | * format), writing to the given BinaryWriter. |
| 936 | * @param {!proto.google.protobuf.Mixin} message |
| 937 | * @param {!jspb.BinaryWriter} writer |
| 938 | * @suppress {unusedLocalVariables} f is only used for nested messages |
| 939 | */ |
| 940 | proto.google.protobuf.Mixin.serializeBinaryToWriter = function(message, writer) { |
| 941 | var f = undefined; |
| 942 | f = message.getName(); |
| 943 | if (f.length > 0) { |
| 944 | writer.writeString( |
| 945 | 1, |
| 946 | f |
| 947 | ); |
| 948 | } |
| 949 | f = message.getRoot(); |
| 950 | if (f.length > 0) { |
| 951 | writer.writeString( |
| 952 | 2, |
| 953 | f |
| 954 | ); |
| 955 | } |
| 956 | }; |
| 957 | |
| 958 | |
| 959 | /** |
| 960 | * optional string name = 1; |
| 961 | * @return {string} |
| 962 | */ |
| 963 | proto.google.protobuf.Mixin.prototype.getName = function() { |
| 964 | return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); |
| 965 | }; |
| 966 | |
| 967 | |
| 968 | /** |
| 969 | * @param {string} value |
| 970 | * @return {!proto.google.protobuf.Mixin} returns this |
| 971 | */ |
| 972 | proto.google.protobuf.Mixin.prototype.setName = function(value) { |
| 973 | return jspb.Message.setProto3StringField(this, 1, value); |
| 974 | }; |
| 975 | |
| 976 | |
| 977 | /** |
| 978 | * optional string root = 2; |
| 979 | * @return {string} |
| 980 | */ |
| 981 | proto.google.protobuf.Mixin.prototype.getRoot = function() { |
| 982 | return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); |
| 983 | }; |
| 984 | |
| 985 | |
| 986 | /** |
| 987 | * @param {string} value |
| 988 | * @return {!proto.google.protobuf.Mixin} returns this |
| 989 | */ |
| 990 | proto.google.protobuf.Mixin.prototype.setRoot = function(value) { |
| 991 | return jspb.Message.setProto3StringField(this, 2, value); |
| 992 | }; |
| 993 | |
| 994 | |
| 995 | goog.object.extend(exports, proto); |