Channel_pb.js 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296
  1. // source: proto/Channel.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.ChannelMetadata', 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.ChannelMetadata = function (opt_data) {
  27. jspb.Message.initialize(this, opt_data, 0, -1, null, null)
  28. }
  29. goog.inherits(proto.ChannelMetadata, jspb.Message)
  30. if (goog.DEBUG && !COMPILED) {
  31. /**
  32. * @public
  33. * @override
  34. */
  35. proto.ChannelMetadata.displayName = 'proto.ChannelMetadata'
  36. }
  37. if (jspb.Message.GENERATE_TO_OBJECT) {
  38. /**
  39. * Creates an object representation of this proto.
  40. * Field names that are reserved in JavaScript and will be renamed to pb_name.
  41. * Optional fields that are not set will be set to undefined.
  42. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
  43. * For the list of reserved names please see:
  44. * net/proto2/compiler/js/internal/generator.cc#kKeyword.
  45. * @param {boolean=} opt_includeInstance Deprecated. whether to include the
  46. * JSPB instance for transitional soy proto support:
  47. * http://goto/soy-param-migration
  48. * @return {!Object}
  49. */
  50. proto.ChannelMetadata.prototype.toObject = function (opt_includeInstance) {
  51. return proto.ChannelMetadata.toObject(opt_includeInstance, this)
  52. }
  53. /**
  54. * Static version of the {@see toObject} method.
  55. * @param {boolean|undefined} includeInstance Deprecated. Whether to include
  56. * the JSPB instance for transitional soy proto support:
  57. * http://goto/soy-param-migration
  58. * @param {!proto.ChannelMetadata} msg The msg instance to transform.
  59. * @return {!Object}
  60. * @suppress {unusedLocalVariables} f is only used for nested messages
  61. */
  62. proto.ChannelMetadata.toObject = function (includeInstance, msg) {
  63. var f,
  64. obj = {
  65. title: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f,
  66. description: (f = jspb.Message.getField(msg, 2)) == null ? undefined : f,
  67. isPublic: (f = jspb.Message.getBooleanField(msg, 3)) == null ? undefined : f,
  68. language: (f = jspb.Message.getField(msg, 4)) == 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.ChannelMetadata}
  80. */
  81. proto.ChannelMetadata.deserializeBinary = function (bytes) {
  82. var reader = new jspb.BinaryReader(bytes)
  83. var msg = new proto.ChannelMetadata()
  84. return proto.ChannelMetadata.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.ChannelMetadata} msg The message object to deserialize into.
  90. * @param {!jspb.BinaryReader} reader The BinaryReader to use.
  91. * @return {!proto.ChannelMetadata}
  92. */
  93. proto.ChannelMetadata.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.setTitle(value)
  103. break
  104. case 2:
  105. var value = /** @type {string} */ (reader.readString())
  106. msg.setDescription(value)
  107. break
  108. case 3:
  109. var value = /** @type {boolean} */ (reader.readBool())
  110. msg.setIsPublic(value)
  111. break
  112. case 4:
  113. var value = /** @type {number} */ (reader.readInt32())
  114. msg.setLanguage(value)
  115. break
  116. default:
  117. reader.skipField()
  118. break
  119. }
  120. }
  121. return msg
  122. }
  123. /**
  124. * Serializes the message to binary data (in protobuf wire format).
  125. * @return {!Uint8Array}
  126. */
  127. proto.ChannelMetadata.prototype.serializeBinary = function () {
  128. var writer = new jspb.BinaryWriter()
  129. proto.ChannelMetadata.serializeBinaryToWriter(this, writer)
  130. return writer.getResultBuffer()
  131. }
  132. /**
  133. * Serializes the given message to binary data (in protobuf wire
  134. * format), writing to the given BinaryWriter.
  135. * @param {!proto.ChannelMetadata} message
  136. * @param {!jspb.BinaryWriter} writer
  137. * @suppress {unusedLocalVariables} f is only used for nested messages
  138. */
  139. proto.ChannelMetadata.serializeBinaryToWriter = function (message, writer) {
  140. var f = undefined
  141. f = /** @type {string} */ (jspb.Message.getField(message, 1))
  142. if (f != null) {
  143. writer.writeString(1, f)
  144. }
  145. f = /** @type {string} */ (jspb.Message.getField(message, 2))
  146. if (f != null) {
  147. writer.writeString(2, f)
  148. }
  149. f = /** @type {boolean} */ (jspb.Message.getField(message, 3))
  150. if (f != null) {
  151. writer.writeBool(3, f)
  152. }
  153. f = /** @type {number} */ (jspb.Message.getField(message, 4))
  154. if (f != null) {
  155. writer.writeInt32(4, f)
  156. }
  157. }
  158. /**
  159. * optional string title = 1;
  160. * @return {string}
  161. */
  162. proto.ChannelMetadata.prototype.getTitle = function () {
  163. return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ''))
  164. }
  165. /**
  166. * @param {string} value
  167. * @return {!proto.ChannelMetadata} returns this
  168. */
  169. proto.ChannelMetadata.prototype.setTitle = function (value) {
  170. return jspb.Message.setField(this, 1, value)
  171. }
  172. /**
  173. * Clears the field making it undefined.
  174. * @return {!proto.ChannelMetadata} returns this
  175. */
  176. proto.ChannelMetadata.prototype.clearTitle = function () {
  177. return jspb.Message.setField(this, 1, undefined)
  178. }
  179. /**
  180. * Returns whether this field is set.
  181. * @return {boolean}
  182. */
  183. proto.ChannelMetadata.prototype.hasTitle = function () {
  184. return jspb.Message.getField(this, 1) != null
  185. }
  186. /**
  187. * optional string description = 2;
  188. * @return {string}
  189. */
  190. proto.ChannelMetadata.prototype.getDescription = function () {
  191. return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ''))
  192. }
  193. /**
  194. * @param {string} value
  195. * @return {!proto.ChannelMetadata} returns this
  196. */
  197. proto.ChannelMetadata.prototype.setDescription = function (value) {
  198. return jspb.Message.setField(this, 2, value)
  199. }
  200. /**
  201. * Clears the field making it undefined.
  202. * @return {!proto.ChannelMetadata} returns this
  203. */
  204. proto.ChannelMetadata.prototype.clearDescription = function () {
  205. return jspb.Message.setField(this, 2, undefined)
  206. }
  207. /**
  208. * Returns whether this field is set.
  209. * @return {boolean}
  210. */
  211. proto.ChannelMetadata.prototype.hasDescription = function () {
  212. return jspb.Message.getField(this, 2) != null
  213. }
  214. /**
  215. * optional bool is_public = 3;
  216. * @return {boolean}
  217. */
  218. proto.ChannelMetadata.prototype.getIsPublic = function () {
  219. return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 3, false))
  220. }
  221. /**
  222. * @param {boolean} value
  223. * @return {!proto.ChannelMetadata} returns this
  224. */
  225. proto.ChannelMetadata.prototype.setIsPublic = function (value) {
  226. return jspb.Message.setField(this, 3, value)
  227. }
  228. /**
  229. * Clears the field making it undefined.
  230. * @return {!proto.ChannelMetadata} returns this
  231. */
  232. proto.ChannelMetadata.prototype.clearIsPublic = function () {
  233. return jspb.Message.setField(this, 3, undefined)
  234. }
  235. /**
  236. * Returns whether this field is set.
  237. * @return {boolean}
  238. */
  239. proto.ChannelMetadata.prototype.hasIsPublic = function () {
  240. return jspb.Message.getField(this, 3) != null
  241. }
  242. /**
  243. * optional int32 language = 4;
  244. * @return {number}
  245. */
  246. proto.ChannelMetadata.prototype.getLanguage = function () {
  247. return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0))
  248. }
  249. /**
  250. * @param {number} value
  251. * @return {!proto.ChannelMetadata} returns this
  252. */
  253. proto.ChannelMetadata.prototype.setLanguage = function (value) {
  254. return jspb.Message.setField(this, 4, value)
  255. }
  256. /**
  257. * Clears the field making it undefined.
  258. * @return {!proto.ChannelMetadata} returns this
  259. */
  260. proto.ChannelMetadata.prototype.clearLanguage = function () {
  261. return jspb.Message.setField(this, 4, undefined)
  262. }
  263. /**
  264. * Returns whether this field is set.
  265. * @return {boolean}
  266. */
  267. proto.ChannelMetadata.prototype.hasLanguage = function () {
  268. return jspb.Message.getField(this, 4) != null
  269. }
  270. goog.object.extend(exports, proto)