2
0

field_mask_pb.js 6.0 KB

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