Playlist_pb.js 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  1. // source: proto/Playlist.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. /* eslint-disable */
  11. // @ts-nocheck
  12. var jspb = require('google-protobuf');
  13. var goog = jspb;
  14. var global = Function('return this')();
  15. goog.exportSymbol('proto.PlaylistMetadata', null, global);
  16. /**
  17. * Generated by JsPbCodeGenerator.
  18. * @param {Array=} opt_data Optional initial data array, typically from a
  19. * server response, or constructed directly in Javascript. The array is used
  20. * in place and becomes part of the constructed object. It is not cloned.
  21. * If no data is provided, the constructed object will be empty, but still
  22. * valid.
  23. * @extends {jspb.Message}
  24. * @constructor
  25. */
  26. proto.PlaylistMetadata = function(opt_data) {
  27. jspb.Message.initialize(this, opt_data, 0, -1, proto.PlaylistMetadata.repeatedFields_, null);
  28. };
  29. goog.inherits(proto.PlaylistMetadata, jspb.Message);
  30. if (goog.DEBUG && !COMPILED) {
  31. /**
  32. * @public
  33. * @override
  34. */
  35. proto.PlaylistMetadata.displayName = 'proto.PlaylistMetadata';
  36. }
  37. /**
  38. * List of repeated fields within this message type.
  39. * @private {!Array<number>}
  40. * @const
  41. */
  42. proto.PlaylistMetadata.repeatedFields_ = [2];
  43. if (jspb.Message.GENERATE_TO_OBJECT) {
  44. /**
  45. * Creates an object representation of this proto.
  46. * Field names that are reserved in JavaScript and will be renamed to pb_name.
  47. * Optional fields that are not set will be set to undefined.
  48. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
  49. * For the list of reserved names please see:
  50. * net/proto2/compiler/js/internal/generator.cc#kKeyword.
  51. * @param {boolean=} opt_includeInstance Deprecated. whether to include the
  52. * JSPB instance for transitional soy proto support:
  53. * http://goto/soy-param-migration
  54. * @return {!Object}
  55. */
  56. proto.PlaylistMetadata.prototype.toObject = function(opt_includeInstance) {
  57. return proto.PlaylistMetadata.toObject(opt_includeInstance, this);
  58. };
  59. /**
  60. * Static version of the {@see toObject} method.
  61. * @param {boolean|undefined} includeInstance Deprecated. Whether to include
  62. * the JSPB instance for transitional soy proto support:
  63. * http://goto/soy-param-migration
  64. * @param {!proto.PlaylistMetadata} msg The msg instance to transform.
  65. * @return {!Object}
  66. * @suppress {unusedLocalVariables} f is only used for nested messages
  67. */
  68. proto.PlaylistMetadata.toObject = function(includeInstance, msg) {
  69. var f, obj = {
  70. title: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f,
  71. videosList: (f = jspb.Message.getRepeatedField(msg, 2)) == 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.PlaylistMetadata}
  83. */
  84. proto.PlaylistMetadata.deserializeBinary = function(bytes) {
  85. var reader = new jspb.BinaryReader(bytes);
  86. var msg = new proto.PlaylistMetadata;
  87. return proto.PlaylistMetadata.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.PlaylistMetadata} msg The message object to deserialize into.
  93. * @param {!jspb.BinaryReader} reader The BinaryReader to use.
  94. * @return {!proto.PlaylistMetadata}
  95. */
  96. proto.PlaylistMetadata.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.setTitle(value);
  106. break;
  107. case 2:
  108. var values = /** @type {!Array<number>} */ (reader.isDelimited() ? reader.readPackedUint64() : [reader.readUint64()]);
  109. for (var i = 0; i < values.length; i++) {
  110. msg.addVideos(values[i]);
  111. }
  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.PlaylistMetadata.prototype.serializeBinary = function() {
  125. var writer = new jspb.BinaryWriter();
  126. proto.PlaylistMetadata.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.PlaylistMetadata} message
  133. * @param {!jspb.BinaryWriter} writer
  134. * @suppress {unusedLocalVariables} f is only used for nested messages
  135. */
  136. proto.PlaylistMetadata.serializeBinaryToWriter = function(message, writer) {
  137. var f = undefined;
  138. f = /** @type {string} */ (jspb.Message.getField(message, 1));
  139. if (f != null) {
  140. writer.writeString(
  141. 1,
  142. f
  143. );
  144. }
  145. f = message.getVideosList();
  146. if (f.length > 0) {
  147. writer.writeRepeatedUint64(
  148. 2,
  149. f
  150. );
  151. }
  152. };
  153. /**
  154. * optional string title = 1;
  155. * @return {string}
  156. */
  157. proto.PlaylistMetadata.prototype.getTitle = function() {
  158. return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
  159. };
  160. /**
  161. * @param {string} value
  162. * @return {!proto.PlaylistMetadata} returns this
  163. */
  164. proto.PlaylistMetadata.prototype.setTitle = function(value) {
  165. return jspb.Message.setField(this, 1, value);
  166. };
  167. /**
  168. * Clears the field making it undefined.
  169. * @return {!proto.PlaylistMetadata} returns this
  170. */
  171. proto.PlaylistMetadata.prototype.clearTitle = function() {
  172. return jspb.Message.setField(this, 1, undefined);
  173. };
  174. /**
  175. * Returns whether this field is set.
  176. * @return {boolean}
  177. */
  178. proto.PlaylistMetadata.prototype.hasTitle = function() {
  179. return jspb.Message.getField(this, 1) != null;
  180. };
  181. /**
  182. * repeated uint64 videos = 2;
  183. * @return {!Array<number>}
  184. */
  185. proto.PlaylistMetadata.prototype.getVideosList = function() {
  186. return /** @type {!Array<number>} */ (jspb.Message.getRepeatedField(this, 2));
  187. };
  188. /**
  189. * @param {!Array<number>} value
  190. * @return {!proto.PlaylistMetadata} returns this
  191. */
  192. proto.PlaylistMetadata.prototype.setVideosList = function(value) {
  193. return jspb.Message.setField(this, 2, value || []);
  194. };
  195. /**
  196. * @param {number} value
  197. * @param {number=} opt_index
  198. * @return {!proto.PlaylistMetadata} returns this
  199. */
  200. proto.PlaylistMetadata.prototype.addVideos = function(value, opt_index) {
  201. return jspb.Message.addToRepeatedField(this, 2, value, opt_index);
  202. };
  203. /**
  204. * Clears the list making it empty but non-null.
  205. * @return {!proto.PlaylistMetadata} returns this
  206. */
  207. proto.PlaylistMetadata.prototype.clearVideosList = function() {
  208. return this.setVideosList([]);
  209. };
  210. goog.object.extend(exports, proto);