Source: proto/google/protobuf/field_mask_pb.js

  1. // source: google/protobuf/field_mask.proto
  2. /**
  3. * @fileoverview
  4. * @enhanceable
  5. * @suppress {messageConventions} JS Compiler reports an error if a variable or
  6. * field starts with 'MSG_' and isn't a translatable message.
  7. * @public
  8. */
  9. // GENERATED CODE -- DO NOT EDIT!
  10. var jspb = require('google-protobuf');
  11. var goog = jspb;
  12. var global = Function('return this')();
  13. goog.exportSymbol('proto.google.protobuf.FieldMask', null, global);
  14. /**
  15. * Generated by JsPbCodeGenerator.
  16. * @param {Array=} opt_data Optional initial data array, typically from a
  17. * server response, or constructed directly in Javascript. The array is used
  18. * in place and becomes part of the constructed object. It is not cloned.
  19. * If no data is provided, the constructed object will be empty, but still
  20. * valid.
  21. * @extends {jspb.Message}
  22. * @constructor
  23. */
  24. proto.google.protobuf.FieldMask = function(opt_data) {
  25. jspb.Message.initialize(this, opt_data, 0, -1, proto.google.protobuf.FieldMask.repeatedFields_, null);
  26. };
  27. goog.inherits(proto.google.protobuf.FieldMask, jspb.Message);
  28. if (goog.DEBUG && !COMPILED) {
  29. /**
  30. * @public
  31. * @override
  32. */
  33. proto.google.protobuf.FieldMask.displayName = 'proto.google.protobuf.FieldMask';
  34. }
  35. /**
  36. * List of repeated fields within this message type.
  37. * @private {!Array<number>}
  38. * @const
  39. */
  40. proto.google.protobuf.FieldMask.repeatedFields_ = [1];
  41. if (jspb.Message.GENERATE_TO_OBJECT) {
  42. /**
  43. * Creates an object representation of this proto.
  44. * Field names that are reserved in JavaScript and will be renamed to pb_name.
  45. * Optional fields that are not set will be set to undefined.
  46. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
  47. * For the list of reserved names please see:
  48. * net/proto2/compiler/js/internal/generator.cc#kKeyword.
  49. * @param {boolean=} opt_includeInstance Deprecated. whether to include the
  50. * JSPB instance for transitional soy proto support:
  51. * http://goto/soy-param-migration
  52. * @return {!Object}
  53. */
  54. proto.google.protobuf.FieldMask.prototype.toObject = function(opt_includeInstance) {
  55. return proto.google.protobuf.FieldMask.toObject(opt_includeInstance, this);
  56. };
  57. /**
  58. * Static version of the {@see toObject} method.
  59. * @param {boolean|undefined} includeInstance Deprecated. Whether to include
  60. * the JSPB instance for transitional soy proto support:
  61. * http://goto/soy-param-migration
  62. * @param {!proto.google.protobuf.FieldMask} msg The msg instance to transform.
  63. * @return {!Object}
  64. * @suppress {unusedLocalVariables} f is only used for nested messages
  65. */
  66. proto.google.protobuf.FieldMask.toObject = function(includeInstance, msg) {
  67. var f, obj = {
  68. pathsList: (f = jspb.Message.getRepeatedField(msg, 1)) == null ? undefined : f
  69. };
  70. if (includeInstance) {
  71. obj.$jspbMessageInstance = msg;
  72. }
  73. return obj;
  74. };
  75. }
  76. /**
  77. * Deserializes binary data (in protobuf wire format).
  78. * @param {jspb.ByteSource} bytes The bytes to deserialize.
  79. * @return {!proto.google.protobuf.FieldMask}
  80. */
  81. proto.google.protobuf.FieldMask.deserializeBinary = function(bytes) {
  82. var reader = new jspb.BinaryReader(bytes);
  83. var msg = new proto.google.protobuf.FieldMask;
  84. return proto.google.protobuf.FieldMask.deserializeBinaryFromReader(msg, reader);
  85. };
  86. /**
  87. * Deserializes binary data (in protobuf wire format) from the
  88. * given reader into the given message object.
  89. * @param {!proto.google.protobuf.FieldMask} msg The message object to deserialize into.
  90. * @param {!jspb.BinaryReader} reader The BinaryReader to use.
  91. * @return {!proto.google.protobuf.FieldMask}
  92. */
  93. proto.google.protobuf.FieldMask.deserializeBinaryFromReader = function(msg, reader) {
  94. while (reader.nextField()) {
  95. if (reader.isEndGroup()) {
  96. break;
  97. }
  98. var field = reader.getFieldNumber();
  99. switch (field) {
  100. case 1:
  101. var value = /** @type {string} */ (reader.readString());
  102. msg.addPaths(value);
  103. break;
  104. default:
  105. reader.skipField();
  106. break;
  107. }
  108. }
  109. return msg;
  110. };
  111. /**
  112. * Serializes the message to binary data (in protobuf wire format).
  113. * @return {!Uint8Array}
  114. */
  115. proto.google.protobuf.FieldMask.prototype.serializeBinary = function() {
  116. var writer = new jspb.BinaryWriter();
  117. proto.google.protobuf.FieldMask.serializeBinaryToWriter(this, writer);
  118. return writer.getResultBuffer();
  119. };
  120. /**
  121. * Serializes the given message to binary data (in protobuf wire
  122. * format), writing to the given BinaryWriter.
  123. * @param {!proto.google.protobuf.FieldMask} message
  124. * @param {!jspb.BinaryWriter} writer
  125. * @suppress {unusedLocalVariables} f is only used for nested messages
  126. */
  127. proto.google.protobuf.FieldMask.serializeBinaryToWriter = function(message, writer) {
  128. var f = undefined;
  129. f = message.getPathsList();
  130. if (f.length > 0) {
  131. writer.writeRepeatedString(
  132. 1,
  133. f
  134. );
  135. }
  136. };
  137. /**
  138. * repeated string paths = 1;
  139. * @return {!Array<string>}
  140. */
  141. proto.google.protobuf.FieldMask.prototype.getPathsList = function() {
  142. return /** @type {!Array<string>} */ (jspb.Message.getRepeatedField(this, 1));
  143. };
  144. /**
  145. * @param {!Array<string>} value
  146. * @return {!proto.google.protobuf.FieldMask} returns this
  147. */
  148. proto.google.protobuf.FieldMask.prototype.setPathsList = function(value) {
  149. return jspb.Message.setField(this, 1, value || []);
  150. };
  151. /**
  152. * @param {string} value
  153. * @param {number=} opt_index
  154. * @return {!proto.google.protobuf.FieldMask} returns this
  155. */
  156. proto.google.protobuf.FieldMask.prototype.addPaths = function(value, opt_index) {
  157. return jspb.Message.addToRepeatedField(this, 1, value, opt_index);
  158. };
  159. /**
  160. * Clears the list making it empty but non-null.
  161. * @return {!proto.google.protobuf.FieldMask} returns this
  162. */
  163. proto.google.protobuf.FieldMask.prototype.clearPathsList = function() {
  164. return this.setPathsList([]);
  165. };
  166. goog.object.extend(exports, proto.google.protobuf);
  167. // Generated by Spine ProtoJs Plugin
  168. proto.google.protobuf.FieldMask.typeUrl = function() {
  169. return 'type.googleapis.com/google.protobuf.FieldMask';
  170. };