Source: remotemessage/RemoteMessage.js

  1. /**
  2. * Autogenerated by Avro
  3. *
  4. * DO NOT EDIT DIRECTLY
  5. */
  6. var remotemessage_Method = require("../remotemessage/Method");
  7. var remotemessage_RemoteMessageType = require("../remotemessage/RemoteMessageType");
  8. /**
  9. * @constructor
  10. * @memberof remotemessage
  11. */
  12. var RemoteMessage = function() {
  13. this._class_ = RemoteMessage;
  14. this.id = undefined;
  15. this.type = undefined;
  16. this.packageName = undefined;
  17. this.method = undefined;
  18. this.payload = undefined;
  19. this.remoteSourceSDK = undefined;
  20. this.remoteApplicationID = undefined;
  21. this.version = undefined;
  22. this.fragmentIndex = undefined;
  23. this.lastFragment = undefined;
  24. this.attachmentEncoding = undefined;
  25. this.attachment = undefined;
  26. };
  27. /**
  28. * Set the field value
  29. * Identifier for the message
  30. *
  31. * @memberof remotemessage.RemoteMessage
  32. * @param {String} id
  33. */
  34. RemoteMessage.prototype.setId = function(id) {
  35. this.id = id;
  36. };
  37. /**
  38. * Get the field value
  39. * Identifier for the message
  40. * @memberof remotemessage.RemoteMessage
  41. * @return {String}
  42. */
  43. RemoteMessage.prototype.getId = function() {
  44. return this.id;
  45. };
  46. /**
  47. * Set the field value
  48. * @memberof remotemessage.RemoteMessage
  49. * @param {remotemessage.RemoteMessageType} type
  50. */
  51. RemoteMessage.prototype.setType = function(type) {
  52. this.type = type;
  53. };
  54. /**
  55. * Get the field value
  56. * @memberof remotemessage.RemoteMessage
  57. * @return {remotemessage.RemoteMessageType}
  58. */
  59. RemoteMessage.prototype.getType = function() {
  60. return this.type;
  61. };
  62. /**
  63. * Set the field value
  64. * The package name of the sending Clover api
  65. *
  66. * @memberof remotemessage.RemoteMessage
  67. * @param {String} packageName
  68. */
  69. RemoteMessage.prototype.setPackageName = function(packageName) {
  70. this.packageName = packageName;
  71. };
  72. /**
  73. * Get the field value
  74. * The package name of the sending Clover api
  75. * @memberof remotemessage.RemoteMessage
  76. * @return {String}
  77. */
  78. RemoteMessage.prototype.getPackageName = function() {
  79. return this.packageName;
  80. };
  81. /**
  82. * Set the field value
  83. * The name of the business message being sent
  84. *
  85. * @memberof remotemessage.RemoteMessage
  86. * @param {remotemessage.Method} method
  87. */
  88. RemoteMessage.prototype.setMethod = function(method) {
  89. this.method = method;
  90. };
  91. /**
  92. * Get the field value
  93. * The name of the business message being sent
  94. * @memberof remotemessage.RemoteMessage
  95. * @return {remotemessage.Method}
  96. */
  97. RemoteMessage.prototype.getMethod = function() {
  98. return this.method;
  99. };
  100. /**
  101. * Set the field value
  102. * The payload message being sent. Interpreted based on the method.
  103. *
  104. * @memberof remotemessage.RemoteMessage
  105. * @param {String} payload
  106. */
  107. RemoteMessage.prototype.setPayload = function(payload) {
  108. this.payload = payload;
  109. };
  110. /**
  111. * Get the field value
  112. * The payload message being sent. Interpreted based on the method.
  113. * @memberof remotemessage.RemoteMessage
  114. * @return {String}
  115. */
  116. RemoteMessage.prototype.getPayload = function() {
  117. return this.payload;
  118. };
  119. /**
  120. * Set the field value
  121. * The identifier for the source SDK. This identifies the connector.
  122. *
  123. * @memberof remotemessage.RemoteMessage
  124. * @param {String} remoteSourceSDK
  125. */
  126. RemoteMessage.prototype.setRemoteSourceSDK = function(remoteSourceSDK) {
  127. this.remoteSourceSDK = remoteSourceSDK;
  128. };
  129. /**
  130. * Get the field value
  131. * The identifier for the source SDK. This identifies the connector.
  132. * @memberof remotemessage.RemoteMessage
  133. * @return {String}
  134. */
  135. RemoteMessage.prototype.getRemoteSourceSDK = function() {
  136. return this.remoteSourceSDK;
  137. };
  138. /**
  139. * Set the field value
  140. * The identifier for the sending application. This identifies the app.
  141. *
  142. * @memberof remotemessage.RemoteMessage
  143. * @param {String} remoteApplicationID
  144. */
  145. RemoteMessage.prototype.setRemoteApplicationID = function(remoteApplicationID) {
  146. this.remoteApplicationID = remoteApplicationID;
  147. };
  148. /**
  149. * Get the field value
  150. * The identifier for the sending application. This identifies the app.
  151. * @memberof remotemessage.RemoteMessage
  152. * @return {String}
  153. */
  154. RemoteMessage.prototype.getRemoteApplicationID = function() {
  155. return this.remoteApplicationID;
  156. };
  157. /**
  158. * Set the field value
  159. * The Remote Message version.
  160. *
  161. * @memberof remotemessage.RemoteMessage
  162. * @param {Number} version must be an integer
  163. */
  164. RemoteMessage.prototype.setVersion = function(version) {
  165. this.version = version;
  166. };
  167. /**
  168. * Get the field value
  169. * The Remote Message version.
  170. * @memberof remotemessage.RemoteMessage
  171. * @return {Number} must be an integer
  172. */
  173. RemoteMessage.prototype.getVersion = function() {
  174. return this.version;
  175. };
  176. /**
  177. * Set the field value
  178. * The order of fragments when message is split for large attachments.
  179. *
  180. * @memberof remotemessage.RemoteMessage
  181. * @param {Number} fragmentIndex must be an integer
  182. */
  183. RemoteMessage.prototype.setFragmentIndex = function(fragmentIndex) {
  184. this.fragmentIndex = fragmentIndex;
  185. };
  186. /**
  187. * Get the field value
  188. * The order of fragments when message is split for large attachments.
  189. * @memberof remotemessage.RemoteMessage
  190. * @return {Number} must be an integer
  191. */
  192. RemoteMessage.prototype.getFragmentIndex = function() {
  193. return this.fragmentIndex;
  194. };
  195. /**
  196. * Set the field value
  197. * If this is the final fragment in a series.
  198. *
  199. * @memberof remotemessage.RemoteMessage
  200. * @param {Boolean} lastFragment
  201. */
  202. RemoteMessage.prototype.setLastFragment = function(lastFragment) {
  203. this.lastFragment = lastFragment;
  204. };
  205. /**
  206. * Get the field value
  207. * If this is the final fragment in a series.
  208. * @memberof remotemessage.RemoteMessage
  209. * @return {Boolean}
  210. */
  211. RemoteMessage.prototype.getLastFragment = function() {
  212. return this.lastFragment;
  213. };
  214. /**
  215. * Set the field value
  216. * The type of encoding used for the attachment, typically BASE64.
  217. *
  218. * @memberof remotemessage.RemoteMessage
  219. * @param {String} attachmentEncoding
  220. */
  221. RemoteMessage.prototype.setAttachmentEncoding = function(attachmentEncoding) {
  222. this.attachmentEncoding = attachmentEncoding;
  223. };
  224. /**
  225. * Get the field value
  226. * The type of encoding used for the attachment, typically BASE64.
  227. * @memberof remotemessage.RemoteMessage
  228. * @return {String}
  229. */
  230. RemoteMessage.prototype.getAttachmentEncoding = function() {
  231. return this.attachmentEncoding;
  232. };
  233. /**
  234. * Set the field value
  235. * The encoded attachment.
  236. *
  237. * @memberof remotemessage.RemoteMessage
  238. * @param {String} attachment
  239. */
  240. RemoteMessage.prototype.setAttachment = function(attachment) {
  241. this.attachment = attachment;
  242. };
  243. /**
  244. * Get the field value
  245. * The encoded attachment.
  246. * @memberof remotemessage.RemoteMessage
  247. * @return {String}
  248. */
  249. RemoteMessage.prototype.getAttachment = function() {
  250. return this.attachment;
  251. };
  252. /**
  253. * @memberof remotemessage.RemoteMessage
  254. * @private
  255. */
  256. RemoteMessage.prototype.getMetaInfo = function(fieldName) {
  257. var curclass = this._class_;
  258. do {
  259. var fieldMetaInfo = curclass._meta_.fields[fieldName];
  260. if(fieldMetaInfo) {
  261. return fieldMetaInfo;
  262. }
  263. if(curclass._meta_._superMeta_) {
  264. curclass = curclass._meta_._superMeta_._class_;
  265. } else {
  266. curclass = null;
  267. }
  268. } while(curclass);
  269. return null;
  270. };
  271. RemoteMessage.prototype.toString = function() {
  272. return JSON.stringify(this);
  273. };
  274. RemoteMessage._meta_ = {fields: {}};
  275. RemoteMessage._meta_._class_ = RemoteMessage;
  276. RemoteMessage._meta_.fields["id"] = {};
  277. RemoteMessage._meta_.fields["id"].type = String;
  278. RemoteMessage._meta_.fields["type"] = {};
  279. RemoteMessage._meta_.fields["type"].type = remotemessage_RemoteMessageType;
  280. RemoteMessage._meta_.fields["packageName"] = {};
  281. RemoteMessage._meta_.fields["packageName"].type = String;
  282. RemoteMessage._meta_.fields["method"] = {};
  283. RemoteMessage._meta_.fields["method"].type = remotemessage_Method;
  284. RemoteMessage._meta_.fields["payload"] = {};
  285. RemoteMessage._meta_.fields["payload"].type = String;
  286. RemoteMessage._meta_.fields["remoteSourceSDK"] = {};
  287. RemoteMessage._meta_.fields["remoteSourceSDK"].type = String;
  288. RemoteMessage._meta_.fields["remoteApplicationID"] = {};
  289. RemoteMessage._meta_.fields["remoteApplicationID"].type = String;
  290. RemoteMessage._meta_.fields["version"] = {};
  291. RemoteMessage._meta_.fields["version"].type = Number;
  292. RemoteMessage._meta_.fields["fragmentIndex"] = {};
  293. RemoteMessage._meta_.fields["fragmentIndex"].type = Number;
  294. RemoteMessage._meta_.fields["lastFragment"] = {};
  295. RemoteMessage._meta_.fields["lastFragment"].type = Boolean;
  296. RemoteMessage._meta_.fields["attachmentEncoding"] = {};
  297. RemoteMessage._meta_.fields["attachmentEncoding"].type = String;
  298. RemoteMessage._meta_.fields["attachment"] = {};
  299. RemoteMessage._meta_.fields["attachment"].type = String;
  300. //
  301. // Expose the module.
  302. //
  303. if ('undefined' !== typeof module) {
  304. module.exports = RemoteMessage;
  305. }