field_mask.js 5.7 KB

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