Adrià Vilanova MartÃnez | 413cb44 | 2021-09-06 00:30:45 +0200 | [diff] [blame] | 1 | // source: google/protobuf/type.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_any_pb = require('google-protobuf/google/protobuf/any_pb.js'); |
| 19 | goog.object.extend(proto, google_protobuf_any_pb); |
| 20 | var google_protobuf_source_context_pb = require('google-protobuf/google/protobuf/source_context_pb.js'); |
| 21 | goog.object.extend(proto, google_protobuf_source_context_pb); |
| 22 | goog.exportSymbol('google.protobuf.Enum', null, proto); |
| 23 | goog.exportSymbol('google.protobuf.EnumValue', null, proto); |
| 24 | goog.exportSymbol('google.protobuf.Field', null, proto); |
| 25 | goog.exportSymbol('google.protobuf.Field.Cardinality', null, proto); |
| 26 | goog.exportSymbol('google.protobuf.Field.Kind', null, proto); |
| 27 | goog.exportSymbol('google.protobuf.Option', null, proto); |
| 28 | goog.exportSymbol('google.protobuf.Syntax', null, proto); |
| 29 | goog.exportSymbol('google.protobuf.Type', null, proto); |
| 30 | /** |
| 31 | * Generated by JsPbCodeGenerator. |
| 32 | * @param {Array=} opt_data Optional initial data array, typically from a |
| 33 | * server response, or constructed directly in Javascript. The array is used |
| 34 | * in place and becomes part of the constructed object. It is not cloned. |
| 35 | * If no data is provided, the constructed object will be empty, but still |
| 36 | * valid. |
| 37 | * @extends {jspb.Message} |
| 38 | * @constructor |
| 39 | */ |
| 40 | proto.google.protobuf.Type = function(opt_data) { |
| 41 | jspb.Message.initialize(this, opt_data, 0, -1, proto.google.protobuf.Type.repeatedFields_, null); |
| 42 | }; |
| 43 | goog.inherits(proto.google.protobuf.Type, jspb.Message); |
| 44 | if (goog.DEBUG && !COMPILED) { |
| 45 | /** |
| 46 | * @public |
| 47 | * @override |
| 48 | */ |
| 49 | proto.google.protobuf.Type.displayName = 'proto.google.protobuf.Type'; |
| 50 | } |
| 51 | /** |
| 52 | * Generated by JsPbCodeGenerator. |
| 53 | * @param {Array=} opt_data Optional initial data array, typically from a |
| 54 | * server response, or constructed directly in Javascript. The array is used |
| 55 | * in place and becomes part of the constructed object. It is not cloned. |
| 56 | * If no data is provided, the constructed object will be empty, but still |
| 57 | * valid. |
| 58 | * @extends {jspb.Message} |
| 59 | * @constructor |
| 60 | */ |
| 61 | proto.google.protobuf.Field = function(opt_data) { |
| 62 | jspb.Message.initialize(this, opt_data, 0, -1, proto.google.protobuf.Field.repeatedFields_, null); |
| 63 | }; |
| 64 | goog.inherits(proto.google.protobuf.Field, jspb.Message); |
| 65 | if (goog.DEBUG && !COMPILED) { |
| 66 | /** |
| 67 | * @public |
| 68 | * @override |
| 69 | */ |
| 70 | proto.google.protobuf.Field.displayName = 'proto.google.protobuf.Field'; |
| 71 | } |
| 72 | /** |
| 73 | * Generated by JsPbCodeGenerator. |
| 74 | * @param {Array=} opt_data Optional initial data array, typically from a |
| 75 | * server response, or constructed directly in Javascript. The array is used |
| 76 | * in place and becomes part of the constructed object. It is not cloned. |
| 77 | * If no data is provided, the constructed object will be empty, but still |
| 78 | * valid. |
| 79 | * @extends {jspb.Message} |
| 80 | * @constructor |
| 81 | */ |
| 82 | proto.google.protobuf.Enum = function(opt_data) { |
| 83 | jspb.Message.initialize(this, opt_data, 0, -1, proto.google.protobuf.Enum.repeatedFields_, null); |
| 84 | }; |
| 85 | goog.inherits(proto.google.protobuf.Enum, jspb.Message); |
| 86 | if (goog.DEBUG && !COMPILED) { |
| 87 | /** |
| 88 | * @public |
| 89 | * @override |
| 90 | */ |
| 91 | proto.google.protobuf.Enum.displayName = 'proto.google.protobuf.Enum'; |
| 92 | } |
| 93 | /** |
| 94 | * Generated by JsPbCodeGenerator. |
| 95 | * @param {Array=} opt_data Optional initial data array, typically from a |
| 96 | * server response, or constructed directly in Javascript. The array is used |
| 97 | * in place and becomes part of the constructed object. It is not cloned. |
| 98 | * If no data is provided, the constructed object will be empty, but still |
| 99 | * valid. |
| 100 | * @extends {jspb.Message} |
| 101 | * @constructor |
| 102 | */ |
| 103 | proto.google.protobuf.EnumValue = function(opt_data) { |
| 104 | jspb.Message.initialize(this, opt_data, 0, -1, proto.google.protobuf.EnumValue.repeatedFields_, null); |
| 105 | }; |
| 106 | goog.inherits(proto.google.protobuf.EnumValue, jspb.Message); |
| 107 | if (goog.DEBUG && !COMPILED) { |
| 108 | /** |
| 109 | * @public |
| 110 | * @override |
| 111 | */ |
| 112 | proto.google.protobuf.EnumValue.displayName = 'proto.google.protobuf.EnumValue'; |
| 113 | } |
| 114 | /** |
| 115 | * Generated by JsPbCodeGenerator. |
| 116 | * @param {Array=} opt_data Optional initial data array, typically from a |
| 117 | * server response, or constructed directly in Javascript. The array is used |
| 118 | * in place and becomes part of the constructed object. It is not cloned. |
| 119 | * If no data is provided, the constructed object will be empty, but still |
| 120 | * valid. |
| 121 | * @extends {jspb.Message} |
| 122 | * @constructor |
| 123 | */ |
| 124 | proto.google.protobuf.Option = function(opt_data) { |
| 125 | jspb.Message.initialize(this, opt_data, 0, -1, null, null); |
| 126 | }; |
| 127 | goog.inherits(proto.google.protobuf.Option, jspb.Message); |
| 128 | if (goog.DEBUG && !COMPILED) { |
| 129 | /** |
| 130 | * @public |
| 131 | * @override |
| 132 | */ |
| 133 | proto.google.protobuf.Option.displayName = 'proto.google.protobuf.Option'; |
| 134 | } |
| 135 | |
| 136 | /** |
| 137 | * List of repeated fields within this message type. |
| 138 | * @private {!Array<number>} |
| 139 | * @const |
| 140 | */ |
| 141 | proto.google.protobuf.Type.repeatedFields_ = [2,3,4]; |
| 142 | |
| 143 | |
| 144 | |
| 145 | if (jspb.Message.GENERATE_TO_OBJECT) { |
| 146 | /** |
| 147 | * Creates an object representation of this proto. |
| 148 | * Field names that are reserved in JavaScript and will be renamed to pb_name. |
| 149 | * Optional fields that are not set will be set to undefined. |
| 150 | * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. |
| 151 | * For the list of reserved names please see: |
| 152 | * net/proto2/compiler/js/internal/generator.cc#kKeyword. |
| 153 | * @param {boolean=} opt_includeInstance Deprecated. whether to include the |
| 154 | * JSPB instance for transitional soy proto support: |
| 155 | * http://goto/soy-param-migration |
| 156 | * @return {!Object} |
| 157 | */ |
| 158 | proto.google.protobuf.Type.prototype.toObject = function(opt_includeInstance) { |
| 159 | return proto.google.protobuf.Type.toObject(opt_includeInstance, this); |
| 160 | }; |
| 161 | |
| 162 | |
| 163 | /** |
| 164 | * Static version of the {@see toObject} method. |
| 165 | * @param {boolean|undefined} includeInstance Deprecated. Whether to include |
| 166 | * the JSPB instance for transitional soy proto support: |
| 167 | * http://goto/soy-param-migration |
| 168 | * @param {!proto.google.protobuf.Type} msg The msg instance to transform. |
| 169 | * @return {!Object} |
| 170 | * @suppress {unusedLocalVariables} f is only used for nested messages |
| 171 | */ |
| 172 | proto.google.protobuf.Type.toObject = function(includeInstance, msg) { |
| 173 | var f, obj = { |
| 174 | name: jspb.Message.getFieldWithDefault(msg, 1, ""), |
| 175 | fieldsList: jspb.Message.toObjectList(msg.getFieldsList(), |
| 176 | proto.google.protobuf.Field.toObject, includeInstance), |
| 177 | oneofsList: (f = jspb.Message.getRepeatedField(msg, 3)) == null ? undefined : f, |
| 178 | optionsList: jspb.Message.toObjectList(msg.getOptionsList(), |
| 179 | proto.google.protobuf.Option.toObject, includeInstance), |
| 180 | sourceContext: (f = msg.getSourceContext()) && google_protobuf_source_context_pb.SourceContext.toObject(includeInstance, f), |
| 181 | syntax: jspb.Message.getFieldWithDefault(msg, 6, 0) |
| 182 | }; |
| 183 | |
| 184 | if (includeInstance) { |
| 185 | obj.$jspbMessageInstance = msg; |
| 186 | } |
| 187 | return obj; |
| 188 | }; |
| 189 | } |
| 190 | |
| 191 | |
| 192 | /** |
| 193 | * Deserializes binary data (in protobuf wire format). |
| 194 | * @param {jspb.ByteSource} bytes The bytes to deserialize. |
| 195 | * @return {!proto.google.protobuf.Type} |
| 196 | */ |
| 197 | proto.google.protobuf.Type.deserializeBinary = function(bytes) { |
| 198 | var reader = new jspb.BinaryReader(bytes); |
| 199 | var msg = new proto.google.protobuf.Type; |
| 200 | return proto.google.protobuf.Type.deserializeBinaryFromReader(msg, reader); |
| 201 | }; |
| 202 | |
| 203 | |
| 204 | /** |
| 205 | * Deserializes binary data (in protobuf wire format) from the |
| 206 | * given reader into the given message object. |
| 207 | * @param {!proto.google.protobuf.Type} msg The message object to deserialize into. |
| 208 | * @param {!jspb.BinaryReader} reader The BinaryReader to use. |
| 209 | * @return {!proto.google.protobuf.Type} |
| 210 | */ |
| 211 | proto.google.protobuf.Type.deserializeBinaryFromReader = function(msg, reader) { |
| 212 | while (reader.nextField()) { |
| 213 | if (reader.isEndGroup()) { |
| 214 | break; |
| 215 | } |
| 216 | var field = reader.getFieldNumber(); |
| 217 | switch (field) { |
| 218 | case 1: |
| 219 | var value = /** @type {string} */ (reader.readString()); |
| 220 | msg.setName(value); |
| 221 | break; |
| 222 | case 2: |
| 223 | var value = new proto.google.protobuf.Field; |
| 224 | reader.readMessage(value,proto.google.protobuf.Field.deserializeBinaryFromReader); |
| 225 | msg.addFields(value); |
| 226 | break; |
| 227 | case 3: |
| 228 | var value = /** @type {string} */ (reader.readString()); |
| 229 | msg.addOneofs(value); |
| 230 | break; |
| 231 | case 4: |
| 232 | var value = new proto.google.protobuf.Option; |
| 233 | reader.readMessage(value,proto.google.protobuf.Option.deserializeBinaryFromReader); |
| 234 | msg.addOptions(value); |
| 235 | break; |
| 236 | case 5: |
| 237 | var value = new google_protobuf_source_context_pb.SourceContext; |
| 238 | reader.readMessage(value,google_protobuf_source_context_pb.SourceContext.deserializeBinaryFromReader); |
| 239 | msg.setSourceContext(value); |
| 240 | break; |
| 241 | case 6: |
| 242 | var value = /** @type {!proto.google.protobuf.Syntax} */ (reader.readEnum()); |
| 243 | msg.setSyntax(value); |
| 244 | break; |
| 245 | default: |
| 246 | reader.skipField(); |
| 247 | break; |
| 248 | } |
| 249 | } |
| 250 | return msg; |
| 251 | }; |
| 252 | |
| 253 | |
| 254 | /** |
| 255 | * Serializes the message to binary data (in protobuf wire format). |
| 256 | * @return {!Uint8Array} |
| 257 | */ |
| 258 | proto.google.protobuf.Type.prototype.serializeBinary = function() { |
| 259 | var writer = new jspb.BinaryWriter(); |
| 260 | proto.google.protobuf.Type.serializeBinaryToWriter(this, writer); |
| 261 | return writer.getResultBuffer(); |
| 262 | }; |
| 263 | |
| 264 | |
| 265 | /** |
| 266 | * Serializes the given message to binary data (in protobuf wire |
| 267 | * format), writing to the given BinaryWriter. |
| 268 | * @param {!proto.google.protobuf.Type} message |
| 269 | * @param {!jspb.BinaryWriter} writer |
| 270 | * @suppress {unusedLocalVariables} f is only used for nested messages |
| 271 | */ |
| 272 | proto.google.protobuf.Type.serializeBinaryToWriter = function(message, writer) { |
| 273 | var f = undefined; |
| 274 | f = message.getName(); |
| 275 | if (f.length > 0) { |
| 276 | writer.writeString( |
| 277 | 1, |
| 278 | f |
| 279 | ); |
| 280 | } |
| 281 | f = message.getFieldsList(); |
| 282 | if (f.length > 0) { |
| 283 | writer.writeRepeatedMessage( |
| 284 | 2, |
| 285 | f, |
| 286 | proto.google.protobuf.Field.serializeBinaryToWriter |
| 287 | ); |
| 288 | } |
| 289 | f = message.getOneofsList(); |
| 290 | if (f.length > 0) { |
| 291 | writer.writeRepeatedString( |
| 292 | 3, |
| 293 | f |
| 294 | ); |
| 295 | } |
| 296 | f = message.getOptionsList(); |
| 297 | if (f.length > 0) { |
| 298 | writer.writeRepeatedMessage( |
| 299 | 4, |
| 300 | f, |
| 301 | proto.google.protobuf.Option.serializeBinaryToWriter |
| 302 | ); |
| 303 | } |
| 304 | f = message.getSourceContext(); |
| 305 | if (f != null) { |
| 306 | writer.writeMessage( |
| 307 | 5, |
| 308 | f, |
| 309 | google_protobuf_source_context_pb.SourceContext.serializeBinaryToWriter |
| 310 | ); |
| 311 | } |
| 312 | f = message.getSyntax(); |
| 313 | if (f !== 0.0) { |
| 314 | writer.writeEnum( |
| 315 | 6, |
| 316 | f |
| 317 | ); |
| 318 | } |
| 319 | }; |
| 320 | |
| 321 | |
| 322 | /** |
| 323 | * optional string name = 1; |
| 324 | * @return {string} |
| 325 | */ |
| 326 | proto.google.protobuf.Type.prototype.getName = function() { |
| 327 | return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); |
| 328 | }; |
| 329 | |
| 330 | |
| 331 | /** |
| 332 | * @param {string} value |
| 333 | * @return {!proto.google.protobuf.Type} returns this |
| 334 | */ |
| 335 | proto.google.protobuf.Type.prototype.setName = function(value) { |
| 336 | return jspb.Message.setProto3StringField(this, 1, value); |
| 337 | }; |
| 338 | |
| 339 | |
| 340 | /** |
| 341 | * repeated Field fields = 2; |
| 342 | * @return {!Array<!proto.google.protobuf.Field>} |
| 343 | */ |
| 344 | proto.google.protobuf.Type.prototype.getFieldsList = function() { |
| 345 | return /** @type{!Array<!proto.google.protobuf.Field>} */ ( |
| 346 | jspb.Message.getRepeatedWrapperField(this, proto.google.protobuf.Field, 2)); |
| 347 | }; |
| 348 | |
| 349 | |
| 350 | /** |
| 351 | * @param {!Array<!proto.google.protobuf.Field>} value |
| 352 | * @return {!proto.google.protobuf.Type} returns this |
| 353 | */ |
| 354 | proto.google.protobuf.Type.prototype.setFieldsList = function(value) { |
| 355 | return jspb.Message.setRepeatedWrapperField(this, 2, value); |
| 356 | }; |
| 357 | |
| 358 | |
| 359 | /** |
| 360 | * @param {!proto.google.protobuf.Field=} opt_value |
| 361 | * @param {number=} opt_index |
| 362 | * @return {!proto.google.protobuf.Field} |
| 363 | */ |
| 364 | proto.google.protobuf.Type.prototype.addFields = function(opt_value, opt_index) { |
| 365 | return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.google.protobuf.Field, opt_index); |
| 366 | }; |
| 367 | |
| 368 | |
| 369 | /** |
| 370 | * Clears the list making it empty but non-null. |
| 371 | * @return {!proto.google.protobuf.Type} returns this |
| 372 | */ |
| 373 | proto.google.protobuf.Type.prototype.clearFieldsList = function() { |
| 374 | return this.setFieldsList([]); |
| 375 | }; |
| 376 | |
| 377 | |
| 378 | /** |
| 379 | * repeated string oneofs = 3; |
| 380 | * @return {!Array<string>} |
| 381 | */ |
| 382 | proto.google.protobuf.Type.prototype.getOneofsList = function() { |
| 383 | return /** @type {!Array<string>} */ (jspb.Message.getRepeatedField(this, 3)); |
| 384 | }; |
| 385 | |
| 386 | |
| 387 | /** |
| 388 | * @param {!Array<string>} value |
| 389 | * @return {!proto.google.protobuf.Type} returns this |
| 390 | */ |
| 391 | proto.google.protobuf.Type.prototype.setOneofsList = function(value) { |
| 392 | return jspb.Message.setField(this, 3, value || []); |
| 393 | }; |
| 394 | |
| 395 | |
| 396 | /** |
| 397 | * @param {string} value |
| 398 | * @param {number=} opt_index |
| 399 | * @return {!proto.google.protobuf.Type} returns this |
| 400 | */ |
| 401 | proto.google.protobuf.Type.prototype.addOneofs = function(value, opt_index) { |
| 402 | return jspb.Message.addToRepeatedField(this, 3, value, opt_index); |
| 403 | }; |
| 404 | |
| 405 | |
| 406 | /** |
| 407 | * Clears the list making it empty but non-null. |
| 408 | * @return {!proto.google.protobuf.Type} returns this |
| 409 | */ |
| 410 | proto.google.protobuf.Type.prototype.clearOneofsList = function() { |
| 411 | return this.setOneofsList([]); |
| 412 | }; |
| 413 | |
| 414 | |
| 415 | /** |
| 416 | * repeated Option options = 4; |
| 417 | * @return {!Array<!proto.google.protobuf.Option>} |
| 418 | */ |
| 419 | proto.google.protobuf.Type.prototype.getOptionsList = function() { |
| 420 | return /** @type{!Array<!proto.google.protobuf.Option>} */ ( |
| 421 | jspb.Message.getRepeatedWrapperField(this, proto.google.protobuf.Option, 4)); |
| 422 | }; |
| 423 | |
| 424 | |
| 425 | /** |
| 426 | * @param {!Array<!proto.google.protobuf.Option>} value |
| 427 | * @return {!proto.google.protobuf.Type} returns this |
| 428 | */ |
| 429 | proto.google.protobuf.Type.prototype.setOptionsList = function(value) { |
| 430 | return jspb.Message.setRepeatedWrapperField(this, 4, value); |
| 431 | }; |
| 432 | |
| 433 | |
| 434 | /** |
| 435 | * @param {!proto.google.protobuf.Option=} opt_value |
| 436 | * @param {number=} opt_index |
| 437 | * @return {!proto.google.protobuf.Option} |
| 438 | */ |
| 439 | proto.google.protobuf.Type.prototype.addOptions = function(opt_value, opt_index) { |
| 440 | return jspb.Message.addToRepeatedWrapperField(this, 4, opt_value, proto.google.protobuf.Option, opt_index); |
| 441 | }; |
| 442 | |
| 443 | |
| 444 | /** |
| 445 | * Clears the list making it empty but non-null. |
| 446 | * @return {!proto.google.protobuf.Type} returns this |
| 447 | */ |
| 448 | proto.google.protobuf.Type.prototype.clearOptionsList = function() { |
| 449 | return this.setOptionsList([]); |
| 450 | }; |
| 451 | |
| 452 | |
| 453 | /** |
| 454 | * optional SourceContext source_context = 5; |
| 455 | * @return {?proto.google.protobuf.SourceContext} |
| 456 | */ |
| 457 | proto.google.protobuf.Type.prototype.getSourceContext = function() { |
| 458 | return /** @type{?proto.google.protobuf.SourceContext} */ ( |
| 459 | jspb.Message.getWrapperField(this, google_protobuf_source_context_pb.SourceContext, 5)); |
| 460 | }; |
| 461 | |
| 462 | |
| 463 | /** |
| 464 | * @param {?proto.google.protobuf.SourceContext|undefined} value |
| 465 | * @return {!proto.google.protobuf.Type} returns this |
| 466 | */ |
| 467 | proto.google.protobuf.Type.prototype.setSourceContext = function(value) { |
| 468 | return jspb.Message.setWrapperField(this, 5, value); |
| 469 | }; |
| 470 | |
| 471 | |
| 472 | /** |
| 473 | * Clears the message field making it undefined. |
| 474 | * @return {!proto.google.protobuf.Type} returns this |
| 475 | */ |
| 476 | proto.google.protobuf.Type.prototype.clearSourceContext = function() { |
| 477 | return this.setSourceContext(undefined); |
| 478 | }; |
| 479 | |
| 480 | |
| 481 | /** |
| 482 | * Returns whether this field is set. |
| 483 | * @return {boolean} |
| 484 | */ |
| 485 | proto.google.protobuf.Type.prototype.hasSourceContext = function() { |
| 486 | return jspb.Message.getField(this, 5) != null; |
| 487 | }; |
| 488 | |
| 489 | |
| 490 | /** |
| 491 | * optional Syntax syntax = 6; |
| 492 | * @return {!proto.google.protobuf.Syntax} |
| 493 | */ |
| 494 | proto.google.protobuf.Type.prototype.getSyntax = function() { |
| 495 | return /** @type {!proto.google.protobuf.Syntax} */ (jspb.Message.getFieldWithDefault(this, 6, 0)); |
| 496 | }; |
| 497 | |
| 498 | |
| 499 | /** |
| 500 | * @param {!proto.google.protobuf.Syntax} value |
| 501 | * @return {!proto.google.protobuf.Type} returns this |
| 502 | */ |
| 503 | proto.google.protobuf.Type.prototype.setSyntax = function(value) { |
| 504 | return jspb.Message.setProto3EnumField(this, 6, value); |
| 505 | }; |
| 506 | |
| 507 | |
| 508 | |
| 509 | /** |
| 510 | * List of repeated fields within this message type. |
| 511 | * @private {!Array<number>} |
| 512 | * @const |
| 513 | */ |
| 514 | proto.google.protobuf.Field.repeatedFields_ = [9]; |
| 515 | |
| 516 | |
| 517 | |
| 518 | if (jspb.Message.GENERATE_TO_OBJECT) { |
| 519 | /** |
| 520 | * Creates an object representation of this proto. |
| 521 | * Field names that are reserved in JavaScript and will be renamed to pb_name. |
| 522 | * Optional fields that are not set will be set to undefined. |
| 523 | * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. |
| 524 | * For the list of reserved names please see: |
| 525 | * net/proto2/compiler/js/internal/generator.cc#kKeyword. |
| 526 | * @param {boolean=} opt_includeInstance Deprecated. whether to include the |
| 527 | * JSPB instance for transitional soy proto support: |
| 528 | * http://goto/soy-param-migration |
| 529 | * @return {!Object} |
| 530 | */ |
| 531 | proto.google.protobuf.Field.prototype.toObject = function(opt_includeInstance) { |
| 532 | return proto.google.protobuf.Field.toObject(opt_includeInstance, this); |
| 533 | }; |
| 534 | |
| 535 | |
| 536 | /** |
| 537 | * Static version of the {@see toObject} method. |
| 538 | * @param {boolean|undefined} includeInstance Deprecated. Whether to include |
| 539 | * the JSPB instance for transitional soy proto support: |
| 540 | * http://goto/soy-param-migration |
| 541 | * @param {!proto.google.protobuf.Field} msg The msg instance to transform. |
| 542 | * @return {!Object} |
| 543 | * @suppress {unusedLocalVariables} f is only used for nested messages |
| 544 | */ |
| 545 | proto.google.protobuf.Field.toObject = function(includeInstance, msg) { |
| 546 | var f, obj = { |
| 547 | kind: jspb.Message.getFieldWithDefault(msg, 1, 0), |
| 548 | cardinality: jspb.Message.getFieldWithDefault(msg, 2, 0), |
| 549 | number: jspb.Message.getFieldWithDefault(msg, 3, 0), |
| 550 | name: jspb.Message.getFieldWithDefault(msg, 4, ""), |
| 551 | typeUrl: jspb.Message.getFieldWithDefault(msg, 6, ""), |
| 552 | oneofIndex: jspb.Message.getFieldWithDefault(msg, 7, 0), |
| 553 | packed: jspb.Message.getBooleanFieldWithDefault(msg, 8, false), |
| 554 | optionsList: jspb.Message.toObjectList(msg.getOptionsList(), |
| 555 | proto.google.protobuf.Option.toObject, includeInstance), |
| 556 | jsonName: jspb.Message.getFieldWithDefault(msg, 10, ""), |
| 557 | defaultValue: jspb.Message.getFieldWithDefault(msg, 11, "") |
| 558 | }; |
| 559 | |
| 560 | if (includeInstance) { |
| 561 | obj.$jspbMessageInstance = msg; |
| 562 | } |
| 563 | return obj; |
| 564 | }; |
| 565 | } |
| 566 | |
| 567 | |
| 568 | /** |
| 569 | * Deserializes binary data (in protobuf wire format). |
| 570 | * @param {jspb.ByteSource} bytes The bytes to deserialize. |
| 571 | * @return {!proto.google.protobuf.Field} |
| 572 | */ |
| 573 | proto.google.protobuf.Field.deserializeBinary = function(bytes) { |
| 574 | var reader = new jspb.BinaryReader(bytes); |
| 575 | var msg = new proto.google.protobuf.Field; |
| 576 | return proto.google.protobuf.Field.deserializeBinaryFromReader(msg, reader); |
| 577 | }; |
| 578 | |
| 579 | |
| 580 | /** |
| 581 | * Deserializes binary data (in protobuf wire format) from the |
| 582 | * given reader into the given message object. |
| 583 | * @param {!proto.google.protobuf.Field} msg The message object to deserialize into. |
| 584 | * @param {!jspb.BinaryReader} reader The BinaryReader to use. |
| 585 | * @return {!proto.google.protobuf.Field} |
| 586 | */ |
| 587 | proto.google.protobuf.Field.deserializeBinaryFromReader = function(msg, reader) { |
| 588 | while (reader.nextField()) { |
| 589 | if (reader.isEndGroup()) { |
| 590 | break; |
| 591 | } |
| 592 | var field = reader.getFieldNumber(); |
| 593 | switch (field) { |
| 594 | case 1: |
| 595 | var value = /** @type {!proto.google.protobuf.Field.Kind} */ (reader.readEnum()); |
| 596 | msg.setKind(value); |
| 597 | break; |
| 598 | case 2: |
| 599 | var value = /** @type {!proto.google.protobuf.Field.Cardinality} */ (reader.readEnum()); |
| 600 | msg.setCardinality(value); |
| 601 | break; |
| 602 | case 3: |
| 603 | var value = /** @type {number} */ (reader.readInt32()); |
| 604 | msg.setNumber(value); |
| 605 | break; |
| 606 | case 4: |
| 607 | var value = /** @type {string} */ (reader.readString()); |
| 608 | msg.setName(value); |
| 609 | break; |
| 610 | case 6: |
| 611 | var value = /** @type {string} */ (reader.readString()); |
| 612 | msg.setTypeUrl(value); |
| 613 | break; |
| 614 | case 7: |
| 615 | var value = /** @type {number} */ (reader.readInt32()); |
| 616 | msg.setOneofIndex(value); |
| 617 | break; |
| 618 | case 8: |
| 619 | var value = /** @type {boolean} */ (reader.readBool()); |
| 620 | msg.setPacked(value); |
| 621 | break; |
| 622 | case 9: |
| 623 | var value = new proto.google.protobuf.Option; |
| 624 | reader.readMessage(value,proto.google.protobuf.Option.deserializeBinaryFromReader); |
| 625 | msg.addOptions(value); |
| 626 | break; |
| 627 | case 10: |
| 628 | var value = /** @type {string} */ (reader.readString()); |
| 629 | msg.setJsonName(value); |
| 630 | break; |
| 631 | case 11: |
| 632 | var value = /** @type {string} */ (reader.readString()); |
| 633 | msg.setDefaultValue(value); |
| 634 | break; |
| 635 | default: |
| 636 | reader.skipField(); |
| 637 | break; |
| 638 | } |
| 639 | } |
| 640 | return msg; |
| 641 | }; |
| 642 | |
| 643 | |
| 644 | /** |
| 645 | * Serializes the message to binary data (in protobuf wire format). |
| 646 | * @return {!Uint8Array} |
| 647 | */ |
| 648 | proto.google.protobuf.Field.prototype.serializeBinary = function() { |
| 649 | var writer = new jspb.BinaryWriter(); |
| 650 | proto.google.protobuf.Field.serializeBinaryToWriter(this, writer); |
| 651 | return writer.getResultBuffer(); |
| 652 | }; |
| 653 | |
| 654 | |
| 655 | /** |
| 656 | * Serializes the given message to binary data (in protobuf wire |
| 657 | * format), writing to the given BinaryWriter. |
| 658 | * @param {!proto.google.protobuf.Field} message |
| 659 | * @param {!jspb.BinaryWriter} writer |
| 660 | * @suppress {unusedLocalVariables} f is only used for nested messages |
| 661 | */ |
| 662 | proto.google.protobuf.Field.serializeBinaryToWriter = function(message, writer) { |
| 663 | var f = undefined; |
| 664 | f = message.getKind(); |
| 665 | if (f !== 0.0) { |
| 666 | writer.writeEnum( |
| 667 | 1, |
| 668 | f |
| 669 | ); |
| 670 | } |
| 671 | f = message.getCardinality(); |
| 672 | if (f !== 0.0) { |
| 673 | writer.writeEnum( |
| 674 | 2, |
| 675 | f |
| 676 | ); |
| 677 | } |
| 678 | f = message.getNumber(); |
| 679 | if (f !== 0) { |
| 680 | writer.writeInt32( |
| 681 | 3, |
| 682 | f |
| 683 | ); |
| 684 | } |
| 685 | f = message.getName(); |
| 686 | if (f.length > 0) { |
| 687 | writer.writeString( |
| 688 | 4, |
| 689 | f |
| 690 | ); |
| 691 | } |
| 692 | f = message.getTypeUrl(); |
| 693 | if (f.length > 0) { |
| 694 | writer.writeString( |
| 695 | 6, |
| 696 | f |
| 697 | ); |
| 698 | } |
| 699 | f = message.getOneofIndex(); |
| 700 | if (f !== 0) { |
| 701 | writer.writeInt32( |
| 702 | 7, |
| 703 | f |
| 704 | ); |
| 705 | } |
| 706 | f = message.getPacked(); |
| 707 | if (f) { |
| 708 | writer.writeBool( |
| 709 | 8, |
| 710 | f |
| 711 | ); |
| 712 | } |
| 713 | f = message.getOptionsList(); |
| 714 | if (f.length > 0) { |
| 715 | writer.writeRepeatedMessage( |
| 716 | 9, |
| 717 | f, |
| 718 | proto.google.protobuf.Option.serializeBinaryToWriter |
| 719 | ); |
| 720 | } |
| 721 | f = message.getJsonName(); |
| 722 | if (f.length > 0) { |
| 723 | writer.writeString( |
| 724 | 10, |
| 725 | f |
| 726 | ); |
| 727 | } |
| 728 | f = message.getDefaultValue(); |
| 729 | if (f.length > 0) { |
| 730 | writer.writeString( |
| 731 | 11, |
| 732 | f |
| 733 | ); |
| 734 | } |
| 735 | }; |
| 736 | |
| 737 | |
| 738 | /** |
| 739 | * @enum {number} |
| 740 | */ |
| 741 | proto.google.protobuf.Field.Kind = { |
| 742 | TYPE_UNKNOWN: 0, |
| 743 | TYPE_DOUBLE: 1, |
| 744 | TYPE_FLOAT: 2, |
| 745 | TYPE_INT64: 3, |
| 746 | TYPE_UINT64: 4, |
| 747 | TYPE_INT32: 5, |
| 748 | TYPE_FIXED64: 6, |
| 749 | TYPE_FIXED32: 7, |
| 750 | TYPE_BOOL: 8, |
| 751 | TYPE_STRING: 9, |
| 752 | TYPE_GROUP: 10, |
| 753 | TYPE_MESSAGE: 11, |
| 754 | TYPE_BYTES: 12, |
| 755 | TYPE_UINT32: 13, |
| 756 | TYPE_ENUM: 14, |
| 757 | TYPE_SFIXED32: 15, |
| 758 | TYPE_SFIXED64: 16, |
| 759 | TYPE_SINT32: 17, |
| 760 | TYPE_SINT64: 18 |
| 761 | }; |
| 762 | |
| 763 | /** |
| 764 | * @enum {number} |
| 765 | */ |
| 766 | proto.google.protobuf.Field.Cardinality = { |
| 767 | CARDINALITY_UNKNOWN: 0, |
| 768 | CARDINALITY_OPTIONAL: 1, |
| 769 | CARDINALITY_REQUIRED: 2, |
| 770 | CARDINALITY_REPEATED: 3 |
| 771 | }; |
| 772 | |
| 773 | /** |
| 774 | * optional Kind kind = 1; |
| 775 | * @return {!proto.google.protobuf.Field.Kind} |
| 776 | */ |
| 777 | proto.google.protobuf.Field.prototype.getKind = function() { |
| 778 | return /** @type {!proto.google.protobuf.Field.Kind} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); |
| 779 | }; |
| 780 | |
| 781 | |
| 782 | /** |
| 783 | * @param {!proto.google.protobuf.Field.Kind} value |
| 784 | * @return {!proto.google.protobuf.Field} returns this |
| 785 | */ |
| 786 | proto.google.protobuf.Field.prototype.setKind = function(value) { |
| 787 | return jspb.Message.setProto3EnumField(this, 1, value); |
| 788 | }; |
| 789 | |
| 790 | |
| 791 | /** |
| 792 | * optional Cardinality cardinality = 2; |
| 793 | * @return {!proto.google.protobuf.Field.Cardinality} |
| 794 | */ |
| 795 | proto.google.protobuf.Field.prototype.getCardinality = function() { |
| 796 | return /** @type {!proto.google.protobuf.Field.Cardinality} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); |
| 797 | }; |
| 798 | |
| 799 | |
| 800 | /** |
| 801 | * @param {!proto.google.protobuf.Field.Cardinality} value |
| 802 | * @return {!proto.google.protobuf.Field} returns this |
| 803 | */ |
| 804 | proto.google.protobuf.Field.prototype.setCardinality = function(value) { |
| 805 | return jspb.Message.setProto3EnumField(this, 2, value); |
| 806 | }; |
| 807 | |
| 808 | |
| 809 | /** |
| 810 | * optional int32 number = 3; |
| 811 | * @return {number} |
| 812 | */ |
| 813 | proto.google.protobuf.Field.prototype.getNumber = function() { |
| 814 | return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); |
| 815 | }; |
| 816 | |
| 817 | |
| 818 | /** |
| 819 | * @param {number} value |
| 820 | * @return {!proto.google.protobuf.Field} returns this |
| 821 | */ |
| 822 | proto.google.protobuf.Field.prototype.setNumber = function(value) { |
| 823 | return jspb.Message.setProto3IntField(this, 3, value); |
| 824 | }; |
| 825 | |
| 826 | |
| 827 | /** |
| 828 | * optional string name = 4; |
| 829 | * @return {string} |
| 830 | */ |
| 831 | proto.google.protobuf.Field.prototype.getName = function() { |
| 832 | return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); |
| 833 | }; |
| 834 | |
| 835 | |
| 836 | /** |
| 837 | * @param {string} value |
| 838 | * @return {!proto.google.protobuf.Field} returns this |
| 839 | */ |
| 840 | proto.google.protobuf.Field.prototype.setName = function(value) { |
| 841 | return jspb.Message.setProto3StringField(this, 4, value); |
| 842 | }; |
| 843 | |
| 844 | |
| 845 | /** |
| 846 | * optional string type_url = 6; |
| 847 | * @return {string} |
| 848 | */ |
| 849 | proto.google.protobuf.Field.prototype.getTypeUrl = function() { |
| 850 | return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, "")); |
| 851 | }; |
| 852 | |
| 853 | |
| 854 | /** |
| 855 | * @param {string} value |
| 856 | * @return {!proto.google.protobuf.Field} returns this |
| 857 | */ |
| 858 | proto.google.protobuf.Field.prototype.setTypeUrl = function(value) { |
| 859 | return jspb.Message.setProto3StringField(this, 6, value); |
| 860 | }; |
| 861 | |
| 862 | |
| 863 | /** |
| 864 | * optional int32 oneof_index = 7; |
| 865 | * @return {number} |
| 866 | */ |
| 867 | proto.google.protobuf.Field.prototype.getOneofIndex = function() { |
| 868 | return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 7, 0)); |
| 869 | }; |
| 870 | |
| 871 | |
| 872 | /** |
| 873 | * @param {number} value |
| 874 | * @return {!proto.google.protobuf.Field} returns this |
| 875 | */ |
| 876 | proto.google.protobuf.Field.prototype.setOneofIndex = function(value) { |
| 877 | return jspb.Message.setProto3IntField(this, 7, value); |
| 878 | }; |
| 879 | |
| 880 | |
| 881 | /** |
| 882 | * optional bool packed = 8; |
| 883 | * @return {boolean} |
| 884 | */ |
| 885 | proto.google.protobuf.Field.prototype.getPacked = function() { |
| 886 | return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 8, false)); |
| 887 | }; |
| 888 | |
| 889 | |
| 890 | /** |
| 891 | * @param {boolean} value |
| 892 | * @return {!proto.google.protobuf.Field} returns this |
| 893 | */ |
| 894 | proto.google.protobuf.Field.prototype.setPacked = function(value) { |
| 895 | return jspb.Message.setProto3BooleanField(this, 8, value); |
| 896 | }; |
| 897 | |
| 898 | |
| 899 | /** |
| 900 | * repeated Option options = 9; |
| 901 | * @return {!Array<!proto.google.protobuf.Option>} |
| 902 | */ |
| 903 | proto.google.protobuf.Field.prototype.getOptionsList = function() { |
| 904 | return /** @type{!Array<!proto.google.protobuf.Option>} */ ( |
| 905 | jspb.Message.getRepeatedWrapperField(this, proto.google.protobuf.Option, 9)); |
| 906 | }; |
| 907 | |
| 908 | |
| 909 | /** |
| 910 | * @param {!Array<!proto.google.protobuf.Option>} value |
| 911 | * @return {!proto.google.protobuf.Field} returns this |
| 912 | */ |
| 913 | proto.google.protobuf.Field.prototype.setOptionsList = function(value) { |
| 914 | return jspb.Message.setRepeatedWrapperField(this, 9, value); |
| 915 | }; |
| 916 | |
| 917 | |
| 918 | /** |
| 919 | * @param {!proto.google.protobuf.Option=} opt_value |
| 920 | * @param {number=} opt_index |
| 921 | * @return {!proto.google.protobuf.Option} |
| 922 | */ |
| 923 | proto.google.protobuf.Field.prototype.addOptions = function(opt_value, opt_index) { |
| 924 | return jspb.Message.addToRepeatedWrapperField(this, 9, opt_value, proto.google.protobuf.Option, opt_index); |
| 925 | }; |
| 926 | |
| 927 | |
| 928 | /** |
| 929 | * Clears the list making it empty but non-null. |
| 930 | * @return {!proto.google.protobuf.Field} returns this |
| 931 | */ |
| 932 | proto.google.protobuf.Field.prototype.clearOptionsList = function() { |
| 933 | return this.setOptionsList([]); |
| 934 | }; |
| 935 | |
| 936 | |
| 937 | /** |
| 938 | * optional string json_name = 10; |
| 939 | * @return {string} |
| 940 | */ |
| 941 | proto.google.protobuf.Field.prototype.getJsonName = function() { |
| 942 | return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 10, "")); |
| 943 | }; |
| 944 | |
| 945 | |
| 946 | /** |
| 947 | * @param {string} value |
| 948 | * @return {!proto.google.protobuf.Field} returns this |
| 949 | */ |
| 950 | proto.google.protobuf.Field.prototype.setJsonName = function(value) { |
| 951 | return jspb.Message.setProto3StringField(this, 10, value); |
| 952 | }; |
| 953 | |
| 954 | |
| 955 | /** |
| 956 | * optional string default_value = 11; |
| 957 | * @return {string} |
| 958 | */ |
| 959 | proto.google.protobuf.Field.prototype.getDefaultValue = function() { |
| 960 | return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 11, "")); |
| 961 | }; |
| 962 | |
| 963 | |
| 964 | /** |
| 965 | * @param {string} value |
| 966 | * @return {!proto.google.protobuf.Field} returns this |
| 967 | */ |
| 968 | proto.google.protobuf.Field.prototype.setDefaultValue = function(value) { |
| 969 | return jspb.Message.setProto3StringField(this, 11, value); |
| 970 | }; |
| 971 | |
| 972 | |
| 973 | |
| 974 | /** |
| 975 | * List of repeated fields within this message type. |
| 976 | * @private {!Array<number>} |
| 977 | * @const |
| 978 | */ |
| 979 | proto.google.protobuf.Enum.repeatedFields_ = [2,3]; |
| 980 | |
| 981 | |
| 982 | |
| 983 | if (jspb.Message.GENERATE_TO_OBJECT) { |
| 984 | /** |
| 985 | * Creates an object representation of this proto. |
| 986 | * Field names that are reserved in JavaScript and will be renamed to pb_name. |
| 987 | * Optional fields that are not set will be set to undefined. |
| 988 | * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. |
| 989 | * For the list of reserved names please see: |
| 990 | * net/proto2/compiler/js/internal/generator.cc#kKeyword. |
| 991 | * @param {boolean=} opt_includeInstance Deprecated. whether to include the |
| 992 | * JSPB instance for transitional soy proto support: |
| 993 | * http://goto/soy-param-migration |
| 994 | * @return {!Object} |
| 995 | */ |
| 996 | proto.google.protobuf.Enum.prototype.toObject = function(opt_includeInstance) { |
| 997 | return proto.google.protobuf.Enum.toObject(opt_includeInstance, this); |
| 998 | }; |
| 999 | |
| 1000 | |
| 1001 | /** |
| 1002 | * Static version of the {@see toObject} method. |
| 1003 | * @param {boolean|undefined} includeInstance Deprecated. Whether to include |
| 1004 | * the JSPB instance for transitional soy proto support: |
| 1005 | * http://goto/soy-param-migration |
| 1006 | * @param {!proto.google.protobuf.Enum} msg The msg instance to transform. |
| 1007 | * @return {!Object} |
| 1008 | * @suppress {unusedLocalVariables} f is only used for nested messages |
| 1009 | */ |
| 1010 | proto.google.protobuf.Enum.toObject = function(includeInstance, msg) { |
| 1011 | var f, obj = { |
| 1012 | name: jspb.Message.getFieldWithDefault(msg, 1, ""), |
| 1013 | enumvalueList: jspb.Message.toObjectList(msg.getEnumvalueList(), |
| 1014 | proto.google.protobuf.EnumValue.toObject, includeInstance), |
| 1015 | optionsList: jspb.Message.toObjectList(msg.getOptionsList(), |
| 1016 | proto.google.protobuf.Option.toObject, includeInstance), |
| 1017 | sourceContext: (f = msg.getSourceContext()) && google_protobuf_source_context_pb.SourceContext.toObject(includeInstance, f), |
| 1018 | syntax: jspb.Message.getFieldWithDefault(msg, 5, 0) |
| 1019 | }; |
| 1020 | |
| 1021 | if (includeInstance) { |
| 1022 | obj.$jspbMessageInstance = msg; |
| 1023 | } |
| 1024 | return obj; |
| 1025 | }; |
| 1026 | } |
| 1027 | |
| 1028 | |
| 1029 | /** |
| 1030 | * Deserializes binary data (in protobuf wire format). |
| 1031 | * @param {jspb.ByteSource} bytes The bytes to deserialize. |
| 1032 | * @return {!proto.google.protobuf.Enum} |
| 1033 | */ |
| 1034 | proto.google.protobuf.Enum.deserializeBinary = function(bytes) { |
| 1035 | var reader = new jspb.BinaryReader(bytes); |
| 1036 | var msg = new proto.google.protobuf.Enum; |
| 1037 | return proto.google.protobuf.Enum.deserializeBinaryFromReader(msg, reader); |
| 1038 | }; |
| 1039 | |
| 1040 | |
| 1041 | /** |
| 1042 | * Deserializes binary data (in protobuf wire format) from the |
| 1043 | * given reader into the given message object. |
| 1044 | * @param {!proto.google.protobuf.Enum} msg The message object to deserialize into. |
| 1045 | * @param {!jspb.BinaryReader} reader The BinaryReader to use. |
| 1046 | * @return {!proto.google.protobuf.Enum} |
| 1047 | */ |
| 1048 | proto.google.protobuf.Enum.deserializeBinaryFromReader = function(msg, reader) { |
| 1049 | while (reader.nextField()) { |
| 1050 | if (reader.isEndGroup()) { |
| 1051 | break; |
| 1052 | } |
| 1053 | var field = reader.getFieldNumber(); |
| 1054 | switch (field) { |
| 1055 | case 1: |
| 1056 | var value = /** @type {string} */ (reader.readString()); |
| 1057 | msg.setName(value); |
| 1058 | break; |
| 1059 | case 2: |
| 1060 | var value = new proto.google.protobuf.EnumValue; |
| 1061 | reader.readMessage(value,proto.google.protobuf.EnumValue.deserializeBinaryFromReader); |
| 1062 | msg.addEnumvalue(value); |
| 1063 | break; |
| 1064 | case 3: |
| 1065 | var value = new proto.google.protobuf.Option; |
| 1066 | reader.readMessage(value,proto.google.protobuf.Option.deserializeBinaryFromReader); |
| 1067 | msg.addOptions(value); |
| 1068 | break; |
| 1069 | case 4: |
| 1070 | var value = new google_protobuf_source_context_pb.SourceContext; |
| 1071 | reader.readMessage(value,google_protobuf_source_context_pb.SourceContext.deserializeBinaryFromReader); |
| 1072 | msg.setSourceContext(value); |
| 1073 | break; |
| 1074 | case 5: |
| 1075 | var value = /** @type {!proto.google.protobuf.Syntax} */ (reader.readEnum()); |
| 1076 | msg.setSyntax(value); |
| 1077 | break; |
| 1078 | default: |
| 1079 | reader.skipField(); |
| 1080 | break; |
| 1081 | } |
| 1082 | } |
| 1083 | return msg; |
| 1084 | }; |
| 1085 | |
| 1086 | |
| 1087 | /** |
| 1088 | * Serializes the message to binary data (in protobuf wire format). |
| 1089 | * @return {!Uint8Array} |
| 1090 | */ |
| 1091 | proto.google.protobuf.Enum.prototype.serializeBinary = function() { |
| 1092 | var writer = new jspb.BinaryWriter(); |
| 1093 | proto.google.protobuf.Enum.serializeBinaryToWriter(this, writer); |
| 1094 | return writer.getResultBuffer(); |
| 1095 | }; |
| 1096 | |
| 1097 | |
| 1098 | /** |
| 1099 | * Serializes the given message to binary data (in protobuf wire |
| 1100 | * format), writing to the given BinaryWriter. |
| 1101 | * @param {!proto.google.protobuf.Enum} message |
| 1102 | * @param {!jspb.BinaryWriter} writer |
| 1103 | * @suppress {unusedLocalVariables} f is only used for nested messages |
| 1104 | */ |
| 1105 | proto.google.protobuf.Enum.serializeBinaryToWriter = function(message, writer) { |
| 1106 | var f = undefined; |
| 1107 | f = message.getName(); |
| 1108 | if (f.length > 0) { |
| 1109 | writer.writeString( |
| 1110 | 1, |
| 1111 | f |
| 1112 | ); |
| 1113 | } |
| 1114 | f = message.getEnumvalueList(); |
| 1115 | if (f.length > 0) { |
| 1116 | writer.writeRepeatedMessage( |
| 1117 | 2, |
| 1118 | f, |
| 1119 | proto.google.protobuf.EnumValue.serializeBinaryToWriter |
| 1120 | ); |
| 1121 | } |
| 1122 | f = message.getOptionsList(); |
| 1123 | if (f.length > 0) { |
| 1124 | writer.writeRepeatedMessage( |
| 1125 | 3, |
| 1126 | f, |
| 1127 | proto.google.protobuf.Option.serializeBinaryToWriter |
| 1128 | ); |
| 1129 | } |
| 1130 | f = message.getSourceContext(); |
| 1131 | if (f != null) { |
| 1132 | writer.writeMessage( |
| 1133 | 4, |
| 1134 | f, |
| 1135 | google_protobuf_source_context_pb.SourceContext.serializeBinaryToWriter |
| 1136 | ); |
| 1137 | } |
| 1138 | f = message.getSyntax(); |
| 1139 | if (f !== 0.0) { |
| 1140 | writer.writeEnum( |
| 1141 | 5, |
| 1142 | f |
| 1143 | ); |
| 1144 | } |
| 1145 | }; |
| 1146 | |
| 1147 | |
| 1148 | /** |
| 1149 | * optional string name = 1; |
| 1150 | * @return {string} |
| 1151 | */ |
| 1152 | proto.google.protobuf.Enum.prototype.getName = function() { |
| 1153 | return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); |
| 1154 | }; |
| 1155 | |
| 1156 | |
| 1157 | /** |
| 1158 | * @param {string} value |
| 1159 | * @return {!proto.google.protobuf.Enum} returns this |
| 1160 | */ |
| 1161 | proto.google.protobuf.Enum.prototype.setName = function(value) { |
| 1162 | return jspb.Message.setProto3StringField(this, 1, value); |
| 1163 | }; |
| 1164 | |
| 1165 | |
| 1166 | /** |
| 1167 | * repeated EnumValue enumvalue = 2; |
| 1168 | * @return {!Array<!proto.google.protobuf.EnumValue>} |
| 1169 | */ |
| 1170 | proto.google.protobuf.Enum.prototype.getEnumvalueList = function() { |
| 1171 | return /** @type{!Array<!proto.google.protobuf.EnumValue>} */ ( |
| 1172 | jspb.Message.getRepeatedWrapperField(this, proto.google.protobuf.EnumValue, 2)); |
| 1173 | }; |
| 1174 | |
| 1175 | |
| 1176 | /** |
| 1177 | * @param {!Array<!proto.google.protobuf.EnumValue>} value |
| 1178 | * @return {!proto.google.protobuf.Enum} returns this |
| 1179 | */ |
| 1180 | proto.google.protobuf.Enum.prototype.setEnumvalueList = function(value) { |
| 1181 | return jspb.Message.setRepeatedWrapperField(this, 2, value); |
| 1182 | }; |
| 1183 | |
| 1184 | |
| 1185 | /** |
| 1186 | * @param {!proto.google.protobuf.EnumValue=} opt_value |
| 1187 | * @param {number=} opt_index |
| 1188 | * @return {!proto.google.protobuf.EnumValue} |
| 1189 | */ |
| 1190 | proto.google.protobuf.Enum.prototype.addEnumvalue = function(opt_value, opt_index) { |
| 1191 | return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.google.protobuf.EnumValue, opt_index); |
| 1192 | }; |
| 1193 | |
| 1194 | |
| 1195 | /** |
| 1196 | * Clears the list making it empty but non-null. |
| 1197 | * @return {!proto.google.protobuf.Enum} returns this |
| 1198 | */ |
| 1199 | proto.google.protobuf.Enum.prototype.clearEnumvalueList = function() { |
| 1200 | return this.setEnumvalueList([]); |
| 1201 | }; |
| 1202 | |
| 1203 | |
| 1204 | /** |
| 1205 | * repeated Option options = 3; |
| 1206 | * @return {!Array<!proto.google.protobuf.Option>} |
| 1207 | */ |
| 1208 | proto.google.protobuf.Enum.prototype.getOptionsList = function() { |
| 1209 | return /** @type{!Array<!proto.google.protobuf.Option>} */ ( |
| 1210 | jspb.Message.getRepeatedWrapperField(this, proto.google.protobuf.Option, 3)); |
| 1211 | }; |
| 1212 | |
| 1213 | |
| 1214 | /** |
| 1215 | * @param {!Array<!proto.google.protobuf.Option>} value |
| 1216 | * @return {!proto.google.protobuf.Enum} returns this |
| 1217 | */ |
| 1218 | proto.google.protobuf.Enum.prototype.setOptionsList = function(value) { |
| 1219 | return jspb.Message.setRepeatedWrapperField(this, 3, value); |
| 1220 | }; |
| 1221 | |
| 1222 | |
| 1223 | /** |
| 1224 | * @param {!proto.google.protobuf.Option=} opt_value |
| 1225 | * @param {number=} opt_index |
| 1226 | * @return {!proto.google.protobuf.Option} |
| 1227 | */ |
| 1228 | proto.google.protobuf.Enum.prototype.addOptions = function(opt_value, opt_index) { |
| 1229 | return jspb.Message.addToRepeatedWrapperField(this, 3, opt_value, proto.google.protobuf.Option, opt_index); |
| 1230 | }; |
| 1231 | |
| 1232 | |
| 1233 | /** |
| 1234 | * Clears the list making it empty but non-null. |
| 1235 | * @return {!proto.google.protobuf.Enum} returns this |
| 1236 | */ |
| 1237 | proto.google.protobuf.Enum.prototype.clearOptionsList = function() { |
| 1238 | return this.setOptionsList([]); |
| 1239 | }; |
| 1240 | |
| 1241 | |
| 1242 | /** |
| 1243 | * optional SourceContext source_context = 4; |
| 1244 | * @return {?proto.google.protobuf.SourceContext} |
| 1245 | */ |
| 1246 | proto.google.protobuf.Enum.prototype.getSourceContext = function() { |
| 1247 | return /** @type{?proto.google.protobuf.SourceContext} */ ( |
| 1248 | jspb.Message.getWrapperField(this, google_protobuf_source_context_pb.SourceContext, 4)); |
| 1249 | }; |
| 1250 | |
| 1251 | |
| 1252 | /** |
| 1253 | * @param {?proto.google.protobuf.SourceContext|undefined} value |
| 1254 | * @return {!proto.google.protobuf.Enum} returns this |
| 1255 | */ |
| 1256 | proto.google.protobuf.Enum.prototype.setSourceContext = function(value) { |
| 1257 | return jspb.Message.setWrapperField(this, 4, value); |
| 1258 | }; |
| 1259 | |
| 1260 | |
| 1261 | /** |
| 1262 | * Clears the message field making it undefined. |
| 1263 | * @return {!proto.google.protobuf.Enum} returns this |
| 1264 | */ |
| 1265 | proto.google.protobuf.Enum.prototype.clearSourceContext = function() { |
| 1266 | return this.setSourceContext(undefined); |
| 1267 | }; |
| 1268 | |
| 1269 | |
| 1270 | /** |
| 1271 | * Returns whether this field is set. |
| 1272 | * @return {boolean} |
| 1273 | */ |
| 1274 | proto.google.protobuf.Enum.prototype.hasSourceContext = function() { |
| 1275 | return jspb.Message.getField(this, 4) != null; |
| 1276 | }; |
| 1277 | |
| 1278 | |
| 1279 | /** |
| 1280 | * optional Syntax syntax = 5; |
| 1281 | * @return {!proto.google.protobuf.Syntax} |
| 1282 | */ |
| 1283 | proto.google.protobuf.Enum.prototype.getSyntax = function() { |
| 1284 | return /** @type {!proto.google.protobuf.Syntax} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); |
| 1285 | }; |
| 1286 | |
| 1287 | |
| 1288 | /** |
| 1289 | * @param {!proto.google.protobuf.Syntax} value |
| 1290 | * @return {!proto.google.protobuf.Enum} returns this |
| 1291 | */ |
| 1292 | proto.google.protobuf.Enum.prototype.setSyntax = function(value) { |
| 1293 | return jspb.Message.setProto3EnumField(this, 5, value); |
| 1294 | }; |
| 1295 | |
| 1296 | |
| 1297 | |
| 1298 | /** |
| 1299 | * List of repeated fields within this message type. |
| 1300 | * @private {!Array<number>} |
| 1301 | * @const |
| 1302 | */ |
| 1303 | proto.google.protobuf.EnumValue.repeatedFields_ = [3]; |
| 1304 | |
| 1305 | |
| 1306 | |
| 1307 | if (jspb.Message.GENERATE_TO_OBJECT) { |
| 1308 | /** |
| 1309 | * Creates an object representation of this proto. |
| 1310 | * Field names that are reserved in JavaScript and will be renamed to pb_name. |
| 1311 | * Optional fields that are not set will be set to undefined. |
| 1312 | * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. |
| 1313 | * For the list of reserved names please see: |
| 1314 | * net/proto2/compiler/js/internal/generator.cc#kKeyword. |
| 1315 | * @param {boolean=} opt_includeInstance Deprecated. whether to include the |
| 1316 | * JSPB instance for transitional soy proto support: |
| 1317 | * http://goto/soy-param-migration |
| 1318 | * @return {!Object} |
| 1319 | */ |
| 1320 | proto.google.protobuf.EnumValue.prototype.toObject = function(opt_includeInstance) { |
| 1321 | return proto.google.protobuf.EnumValue.toObject(opt_includeInstance, this); |
| 1322 | }; |
| 1323 | |
| 1324 | |
| 1325 | /** |
| 1326 | * Static version of the {@see toObject} method. |
| 1327 | * @param {boolean|undefined} includeInstance Deprecated. Whether to include |
| 1328 | * the JSPB instance for transitional soy proto support: |
| 1329 | * http://goto/soy-param-migration |
| 1330 | * @param {!proto.google.protobuf.EnumValue} msg The msg instance to transform. |
| 1331 | * @return {!Object} |
| 1332 | * @suppress {unusedLocalVariables} f is only used for nested messages |
| 1333 | */ |
| 1334 | proto.google.protobuf.EnumValue.toObject = function(includeInstance, msg) { |
| 1335 | var f, obj = { |
| 1336 | name: jspb.Message.getFieldWithDefault(msg, 1, ""), |
| 1337 | number: jspb.Message.getFieldWithDefault(msg, 2, 0), |
| 1338 | optionsList: jspb.Message.toObjectList(msg.getOptionsList(), |
| 1339 | proto.google.protobuf.Option.toObject, includeInstance) |
| 1340 | }; |
| 1341 | |
| 1342 | if (includeInstance) { |
| 1343 | obj.$jspbMessageInstance = msg; |
| 1344 | } |
| 1345 | return obj; |
| 1346 | }; |
| 1347 | } |
| 1348 | |
| 1349 | |
| 1350 | /** |
| 1351 | * Deserializes binary data (in protobuf wire format). |
| 1352 | * @param {jspb.ByteSource} bytes The bytes to deserialize. |
| 1353 | * @return {!proto.google.protobuf.EnumValue} |
| 1354 | */ |
| 1355 | proto.google.protobuf.EnumValue.deserializeBinary = function(bytes) { |
| 1356 | var reader = new jspb.BinaryReader(bytes); |
| 1357 | var msg = new proto.google.protobuf.EnumValue; |
| 1358 | return proto.google.protobuf.EnumValue.deserializeBinaryFromReader(msg, reader); |
| 1359 | }; |
| 1360 | |
| 1361 | |
| 1362 | /** |
| 1363 | * Deserializes binary data (in protobuf wire format) from the |
| 1364 | * given reader into the given message object. |
| 1365 | * @param {!proto.google.protobuf.EnumValue} msg The message object to deserialize into. |
| 1366 | * @param {!jspb.BinaryReader} reader The BinaryReader to use. |
| 1367 | * @return {!proto.google.protobuf.EnumValue} |
| 1368 | */ |
| 1369 | proto.google.protobuf.EnumValue.deserializeBinaryFromReader = function(msg, reader) { |
| 1370 | while (reader.nextField()) { |
| 1371 | if (reader.isEndGroup()) { |
| 1372 | break; |
| 1373 | } |
| 1374 | var field = reader.getFieldNumber(); |
| 1375 | switch (field) { |
| 1376 | case 1: |
| 1377 | var value = /** @type {string} */ (reader.readString()); |
| 1378 | msg.setName(value); |
| 1379 | break; |
| 1380 | case 2: |
| 1381 | var value = /** @type {number} */ (reader.readInt32()); |
| 1382 | msg.setNumber(value); |
| 1383 | break; |
| 1384 | case 3: |
| 1385 | var value = new proto.google.protobuf.Option; |
| 1386 | reader.readMessage(value,proto.google.protobuf.Option.deserializeBinaryFromReader); |
| 1387 | msg.addOptions(value); |
| 1388 | break; |
| 1389 | default: |
| 1390 | reader.skipField(); |
| 1391 | break; |
| 1392 | } |
| 1393 | } |
| 1394 | return msg; |
| 1395 | }; |
| 1396 | |
| 1397 | |
| 1398 | /** |
| 1399 | * Serializes the message to binary data (in protobuf wire format). |
| 1400 | * @return {!Uint8Array} |
| 1401 | */ |
| 1402 | proto.google.protobuf.EnumValue.prototype.serializeBinary = function() { |
| 1403 | var writer = new jspb.BinaryWriter(); |
| 1404 | proto.google.protobuf.EnumValue.serializeBinaryToWriter(this, writer); |
| 1405 | return writer.getResultBuffer(); |
| 1406 | }; |
| 1407 | |
| 1408 | |
| 1409 | /** |
| 1410 | * Serializes the given message to binary data (in protobuf wire |
| 1411 | * format), writing to the given BinaryWriter. |
| 1412 | * @param {!proto.google.protobuf.EnumValue} message |
| 1413 | * @param {!jspb.BinaryWriter} writer |
| 1414 | * @suppress {unusedLocalVariables} f is only used for nested messages |
| 1415 | */ |
| 1416 | proto.google.protobuf.EnumValue.serializeBinaryToWriter = function(message, writer) { |
| 1417 | var f = undefined; |
| 1418 | f = message.getName(); |
| 1419 | if (f.length > 0) { |
| 1420 | writer.writeString( |
| 1421 | 1, |
| 1422 | f |
| 1423 | ); |
| 1424 | } |
| 1425 | f = message.getNumber(); |
| 1426 | if (f !== 0) { |
| 1427 | writer.writeInt32( |
| 1428 | 2, |
| 1429 | f |
| 1430 | ); |
| 1431 | } |
| 1432 | f = message.getOptionsList(); |
| 1433 | if (f.length > 0) { |
| 1434 | writer.writeRepeatedMessage( |
| 1435 | 3, |
| 1436 | f, |
| 1437 | proto.google.protobuf.Option.serializeBinaryToWriter |
| 1438 | ); |
| 1439 | } |
| 1440 | }; |
| 1441 | |
| 1442 | |
| 1443 | /** |
| 1444 | * optional string name = 1; |
| 1445 | * @return {string} |
| 1446 | */ |
| 1447 | proto.google.protobuf.EnumValue.prototype.getName = function() { |
| 1448 | return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); |
| 1449 | }; |
| 1450 | |
| 1451 | |
| 1452 | /** |
| 1453 | * @param {string} value |
| 1454 | * @return {!proto.google.protobuf.EnumValue} returns this |
| 1455 | */ |
| 1456 | proto.google.protobuf.EnumValue.prototype.setName = function(value) { |
| 1457 | return jspb.Message.setProto3StringField(this, 1, value); |
| 1458 | }; |
| 1459 | |
| 1460 | |
| 1461 | /** |
| 1462 | * optional int32 number = 2; |
| 1463 | * @return {number} |
| 1464 | */ |
| 1465 | proto.google.protobuf.EnumValue.prototype.getNumber = function() { |
| 1466 | return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); |
| 1467 | }; |
| 1468 | |
| 1469 | |
| 1470 | /** |
| 1471 | * @param {number} value |
| 1472 | * @return {!proto.google.protobuf.EnumValue} returns this |
| 1473 | */ |
| 1474 | proto.google.protobuf.EnumValue.prototype.setNumber = function(value) { |
| 1475 | return jspb.Message.setProto3IntField(this, 2, value); |
| 1476 | }; |
| 1477 | |
| 1478 | |
| 1479 | /** |
| 1480 | * repeated Option options = 3; |
| 1481 | * @return {!Array<!proto.google.protobuf.Option>} |
| 1482 | */ |
| 1483 | proto.google.protobuf.EnumValue.prototype.getOptionsList = function() { |
| 1484 | return /** @type{!Array<!proto.google.protobuf.Option>} */ ( |
| 1485 | jspb.Message.getRepeatedWrapperField(this, proto.google.protobuf.Option, 3)); |
| 1486 | }; |
| 1487 | |
| 1488 | |
| 1489 | /** |
| 1490 | * @param {!Array<!proto.google.protobuf.Option>} value |
| 1491 | * @return {!proto.google.protobuf.EnumValue} returns this |
| 1492 | */ |
| 1493 | proto.google.protobuf.EnumValue.prototype.setOptionsList = function(value) { |
| 1494 | return jspb.Message.setRepeatedWrapperField(this, 3, value); |
| 1495 | }; |
| 1496 | |
| 1497 | |
| 1498 | /** |
| 1499 | * @param {!proto.google.protobuf.Option=} opt_value |
| 1500 | * @param {number=} opt_index |
| 1501 | * @return {!proto.google.protobuf.Option} |
| 1502 | */ |
| 1503 | proto.google.protobuf.EnumValue.prototype.addOptions = function(opt_value, opt_index) { |
| 1504 | return jspb.Message.addToRepeatedWrapperField(this, 3, opt_value, proto.google.protobuf.Option, opt_index); |
| 1505 | }; |
| 1506 | |
| 1507 | |
| 1508 | /** |
| 1509 | * Clears the list making it empty but non-null. |
| 1510 | * @return {!proto.google.protobuf.EnumValue} returns this |
| 1511 | */ |
| 1512 | proto.google.protobuf.EnumValue.prototype.clearOptionsList = function() { |
| 1513 | return this.setOptionsList([]); |
| 1514 | }; |
| 1515 | |
| 1516 | |
| 1517 | |
| 1518 | |
| 1519 | |
| 1520 | if (jspb.Message.GENERATE_TO_OBJECT) { |
| 1521 | /** |
| 1522 | * Creates an object representation of this proto. |
| 1523 | * Field names that are reserved in JavaScript and will be renamed to pb_name. |
| 1524 | * Optional fields that are not set will be set to undefined. |
| 1525 | * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. |
| 1526 | * For the list of reserved names please see: |
| 1527 | * net/proto2/compiler/js/internal/generator.cc#kKeyword. |
| 1528 | * @param {boolean=} opt_includeInstance Deprecated. whether to include the |
| 1529 | * JSPB instance for transitional soy proto support: |
| 1530 | * http://goto/soy-param-migration |
| 1531 | * @return {!Object} |
| 1532 | */ |
| 1533 | proto.google.protobuf.Option.prototype.toObject = function(opt_includeInstance) { |
| 1534 | return proto.google.protobuf.Option.toObject(opt_includeInstance, this); |
| 1535 | }; |
| 1536 | |
| 1537 | |
| 1538 | /** |
| 1539 | * Static version of the {@see toObject} method. |
| 1540 | * @param {boolean|undefined} includeInstance Deprecated. Whether to include |
| 1541 | * the JSPB instance for transitional soy proto support: |
| 1542 | * http://goto/soy-param-migration |
| 1543 | * @param {!proto.google.protobuf.Option} msg The msg instance to transform. |
| 1544 | * @return {!Object} |
| 1545 | * @suppress {unusedLocalVariables} f is only used for nested messages |
| 1546 | */ |
| 1547 | proto.google.protobuf.Option.toObject = function(includeInstance, msg) { |
| 1548 | var f, obj = { |
| 1549 | name: jspb.Message.getFieldWithDefault(msg, 1, ""), |
| 1550 | value: (f = msg.getValue()) && google_protobuf_any_pb.Any.toObject(includeInstance, f) |
| 1551 | }; |
| 1552 | |
| 1553 | if (includeInstance) { |
| 1554 | obj.$jspbMessageInstance = msg; |
| 1555 | } |
| 1556 | return obj; |
| 1557 | }; |
| 1558 | } |
| 1559 | |
| 1560 | |
| 1561 | /** |
| 1562 | * Deserializes binary data (in protobuf wire format). |
| 1563 | * @param {jspb.ByteSource} bytes The bytes to deserialize. |
| 1564 | * @return {!proto.google.protobuf.Option} |
| 1565 | */ |
| 1566 | proto.google.protobuf.Option.deserializeBinary = function(bytes) { |
| 1567 | var reader = new jspb.BinaryReader(bytes); |
| 1568 | var msg = new proto.google.protobuf.Option; |
| 1569 | return proto.google.protobuf.Option.deserializeBinaryFromReader(msg, reader); |
| 1570 | }; |
| 1571 | |
| 1572 | |
| 1573 | /** |
| 1574 | * Deserializes binary data (in protobuf wire format) from the |
| 1575 | * given reader into the given message object. |
| 1576 | * @param {!proto.google.protobuf.Option} msg The message object to deserialize into. |
| 1577 | * @param {!jspb.BinaryReader} reader The BinaryReader to use. |
| 1578 | * @return {!proto.google.protobuf.Option} |
| 1579 | */ |
| 1580 | proto.google.protobuf.Option.deserializeBinaryFromReader = function(msg, reader) { |
| 1581 | while (reader.nextField()) { |
| 1582 | if (reader.isEndGroup()) { |
| 1583 | break; |
| 1584 | } |
| 1585 | var field = reader.getFieldNumber(); |
| 1586 | switch (field) { |
| 1587 | case 1: |
| 1588 | var value = /** @type {string} */ (reader.readString()); |
| 1589 | msg.setName(value); |
| 1590 | break; |
| 1591 | case 2: |
| 1592 | var value = new google_protobuf_any_pb.Any; |
| 1593 | reader.readMessage(value,google_protobuf_any_pb.Any.deserializeBinaryFromReader); |
| 1594 | msg.setValue(value); |
| 1595 | break; |
| 1596 | default: |
| 1597 | reader.skipField(); |
| 1598 | break; |
| 1599 | } |
| 1600 | } |
| 1601 | return msg; |
| 1602 | }; |
| 1603 | |
| 1604 | |
| 1605 | /** |
| 1606 | * Serializes the message to binary data (in protobuf wire format). |
| 1607 | * @return {!Uint8Array} |
| 1608 | */ |
| 1609 | proto.google.protobuf.Option.prototype.serializeBinary = function() { |
| 1610 | var writer = new jspb.BinaryWriter(); |
| 1611 | proto.google.protobuf.Option.serializeBinaryToWriter(this, writer); |
| 1612 | return writer.getResultBuffer(); |
| 1613 | }; |
| 1614 | |
| 1615 | |
| 1616 | /** |
| 1617 | * Serializes the given message to binary data (in protobuf wire |
| 1618 | * format), writing to the given BinaryWriter. |
| 1619 | * @param {!proto.google.protobuf.Option} message |
| 1620 | * @param {!jspb.BinaryWriter} writer |
| 1621 | * @suppress {unusedLocalVariables} f is only used for nested messages |
| 1622 | */ |
| 1623 | proto.google.protobuf.Option.serializeBinaryToWriter = function(message, writer) { |
| 1624 | var f = undefined; |
| 1625 | f = message.getName(); |
| 1626 | if (f.length > 0) { |
| 1627 | writer.writeString( |
| 1628 | 1, |
| 1629 | f |
| 1630 | ); |
| 1631 | } |
| 1632 | f = message.getValue(); |
| 1633 | if (f != null) { |
| 1634 | writer.writeMessage( |
| 1635 | 2, |
| 1636 | f, |
| 1637 | google_protobuf_any_pb.Any.serializeBinaryToWriter |
| 1638 | ); |
| 1639 | } |
| 1640 | }; |
| 1641 | |
| 1642 | |
| 1643 | /** |
| 1644 | * optional string name = 1; |
| 1645 | * @return {string} |
| 1646 | */ |
| 1647 | proto.google.protobuf.Option.prototype.getName = function() { |
| 1648 | return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); |
| 1649 | }; |
| 1650 | |
| 1651 | |
| 1652 | /** |
| 1653 | * @param {string} value |
| 1654 | * @return {!proto.google.protobuf.Option} returns this |
| 1655 | */ |
| 1656 | proto.google.protobuf.Option.prototype.setName = function(value) { |
| 1657 | return jspb.Message.setProto3StringField(this, 1, value); |
| 1658 | }; |
| 1659 | |
| 1660 | |
| 1661 | /** |
| 1662 | * optional Any value = 2; |
| 1663 | * @return {?proto.google.protobuf.Any} |
| 1664 | */ |
| 1665 | proto.google.protobuf.Option.prototype.getValue = function() { |
| 1666 | return /** @type{?proto.google.protobuf.Any} */ ( |
| 1667 | jspb.Message.getWrapperField(this, google_protobuf_any_pb.Any, 2)); |
| 1668 | }; |
| 1669 | |
| 1670 | |
| 1671 | /** |
| 1672 | * @param {?proto.google.protobuf.Any|undefined} value |
| 1673 | * @return {!proto.google.protobuf.Option} returns this |
| 1674 | */ |
| 1675 | proto.google.protobuf.Option.prototype.setValue = function(value) { |
| 1676 | return jspb.Message.setWrapperField(this, 2, value); |
| 1677 | }; |
| 1678 | |
| 1679 | |
| 1680 | /** |
| 1681 | * Clears the message field making it undefined. |
| 1682 | * @return {!proto.google.protobuf.Option} returns this |
| 1683 | */ |
| 1684 | proto.google.protobuf.Option.prototype.clearValue = function() { |
| 1685 | return this.setValue(undefined); |
| 1686 | }; |
| 1687 | |
| 1688 | |
| 1689 | /** |
| 1690 | * Returns whether this field is set. |
| 1691 | * @return {boolean} |
| 1692 | */ |
| 1693 | proto.google.protobuf.Option.prototype.hasValue = function() { |
| 1694 | return jspb.Message.getField(this, 2) != null; |
| 1695 | }; |
| 1696 | |
| 1697 | |
| 1698 | /** |
| 1699 | * @enum {number} |
| 1700 | */ |
| 1701 | proto.google.protobuf.Syntax = { |
| 1702 | SYNTAX_PROTO2: 0, |
| 1703 | SYNTAX_PROTO3: 1 |
| 1704 | }; |
| 1705 | |
| 1706 | goog.object.extend(exports, proto); |