Playlist_pb.js 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  1. // source: proto/Playlist.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 = Function('return this')();
  16. goog.exportSymbol('proto.PlaylistMetadata', null, global);
  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.PlaylistMetadata = function(opt_data) {
  28. jspb.Message.initialize(this, opt_data, 0, -1, proto.PlaylistMetadata.repeatedFields_, null);
  29. };
  30. goog.inherits(proto.PlaylistMetadata, jspb.Message);
  31. if (goog.DEBUG && !COMPILED) {
  32. /**
  33. * @public
  34. * @override
  35. */
  36. proto.PlaylistMetadata.displayName = 'proto.PlaylistMetadata';
  37. }
  38. /**
  39. * List of repeated fields within this message type.
  40. * @private {!Array<number>}
  41. * @const
  42. */
  43. proto.PlaylistMetadata.repeatedFields_ = [2];
  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.PlaylistMetadata.prototype.toObject = function(opt_includeInstance) {
  58. return proto.PlaylistMetadata.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.PlaylistMetadata} msg The msg instance to transform.
  66. * @return {!Object}
  67. * @suppress {unusedLocalVariables} f is only used for nested messages
  68. */
  69. proto.PlaylistMetadata.toObject = function(includeInstance, msg) {
  70. var f, obj = {
  71. title: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f,
  72. videosList: (f = jspb.Message.getRepeatedField(msg, 2)) == null ? undefined : f
  73. };
  74. if (includeInstance) {
  75. obj.$jspbMessageInstance = msg;
  76. }
  77. return obj;
  78. };
  79. }
  80. /**
  81. * Deserializes binary data (in protobuf wire format).
  82. * @param {jspb.ByteSource} bytes The bytes to deserialize.
  83. * @return {!proto.PlaylistMetadata}
  84. */
  85. proto.PlaylistMetadata.deserializeBinary = function(bytes) {
  86. var reader = new jspb.BinaryReader(bytes);
  87. var msg = new proto.PlaylistMetadata;
  88. return proto.PlaylistMetadata.deserializeBinaryFromReader(msg, reader);
  89. };
  90. /**
  91. * Deserializes binary data (in protobuf wire format) from the
  92. * given reader into the given message object.
  93. * @param {!proto.PlaylistMetadata} msg The message object to deserialize into.
  94. * @param {!jspb.BinaryReader} reader The BinaryReader to use.
  95. * @return {!proto.PlaylistMetadata}
  96. */
  97. proto.PlaylistMetadata.deserializeBinaryFromReader = function(msg, reader) {
  98. while (reader.nextField()) {
  99. if (reader.isEndGroup()) {
  100. break;
  101. }
  102. var field = reader.getFieldNumber();
  103. switch (field) {
  104. case 1:
  105. var value = /** @type {string} */ (reader.readString());
  106. msg.setTitle(value);
  107. break;
  108. case 2:
  109. var values = /** @type {!Array<number>} */ (reader.isDelimited() ? reader.readPackedUint64() : [reader.readUint64()]);
  110. for (var i = 0; i < values.length; i++) {
  111. msg.addVideos(values[i]);
  112. }
  113. break;
  114. default:
  115. reader.skipField();
  116. break;
  117. }
  118. }
  119. return msg;
  120. };
  121. /**
  122. * Serializes the message to binary data (in protobuf wire format).
  123. * @return {!Uint8Array}
  124. */
  125. proto.PlaylistMetadata.prototype.serializeBinary = function() {
  126. var writer = new jspb.BinaryWriter();
  127. proto.PlaylistMetadata.serializeBinaryToWriter(this, writer);
  128. return writer.getResultBuffer();
  129. };
  130. /**
  131. * Serializes the given message to binary data (in protobuf wire
  132. * format), writing to the given BinaryWriter.
  133. * @param {!proto.PlaylistMetadata} message
  134. * @param {!jspb.BinaryWriter} writer
  135. * @suppress {unusedLocalVariables} f is only used for nested messages
  136. */
  137. proto.PlaylistMetadata.serializeBinaryToWriter = function(message, writer) {
  138. var f = undefined;
  139. f = /** @type {string} */ (jspb.Message.getField(message, 1));
  140. if (f != null) {
  141. writer.writeString(
  142. 1,
  143. f
  144. );
  145. }
  146. f = message.getVideosList();
  147. if (f.length > 0) {
  148. writer.writeRepeatedUint64(
  149. 2,
  150. f
  151. );
  152. }
  153. };
  154. /**
  155. * optional string title = 1;
  156. * @return {string}
  157. */
  158. proto.PlaylistMetadata.prototype.getTitle = function() {
  159. return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
  160. };
  161. /**
  162. * @param {string} value
  163. * @return {!proto.PlaylistMetadata} returns this
  164. */
  165. proto.PlaylistMetadata.prototype.setTitle = function(value) {
  166. return jspb.Message.setField(this, 1, value);
  167. };
  168. /**
  169. * Clears the field making it undefined.
  170. * @return {!proto.PlaylistMetadata} returns this
  171. */
  172. proto.PlaylistMetadata.prototype.clearTitle = function() {
  173. return jspb.Message.setField(this, 1, undefined);
  174. };
  175. /**
  176. * Returns whether this field is set.
  177. * @return {boolean}
  178. */
  179. proto.PlaylistMetadata.prototype.hasTitle = function() {
  180. return jspb.Message.getField(this, 1) != null;
  181. };
  182. /**
  183. * repeated uint64 videos = 2;
  184. * @return {!Array<number>}
  185. */
  186. proto.PlaylistMetadata.prototype.getVideosList = function() {
  187. return /** @type {!Array<number>} */ (jspb.Message.getRepeatedField(this, 2));
  188. };
  189. /**
  190. * @param {!Array<number>} value
  191. * @return {!proto.PlaylistMetadata} returns this
  192. */
  193. proto.PlaylistMetadata.prototype.setVideosList = function(value) {
  194. return jspb.Message.setField(this, 2, value || []);
  195. };
  196. /**
  197. * @param {number} value
  198. * @param {number=} opt_index
  199. * @return {!proto.PlaylistMetadata} returns this
  200. */
  201. proto.PlaylistMetadata.prototype.addVideos = function(value, opt_index) {
  202. return jspb.Message.addToRepeatedField(this, 2, value, opt_index);
  203. };
  204. /**
  205. * Clears the list making it empty but non-null.
  206. * @return {!proto.PlaylistMetadata} returns this
  207. */
  208. proto.PlaylistMetadata.prototype.clearVideosList = function() {
  209. return this.setVideosList([]);
  210. };
  211. goog.object.extend(exports, proto);