Source: payments/VasPayloadElement.js

  1. /**
  2. * Autogenerated by Avro
  3. *
  4. * DO NOT EDIT DIRECTLY
  5. */
  6. var payments_VasResponseFormat = require("../payments/VasResponseFormat");
  7. var payments_VasProtocol = require("../payments/VasProtocol");
  8. var payments_VasDataType = require("../payments/VasDataType");
  9. /**
  10. * @constructor
  11. * @memberof payments
  12. */
  13. var VasPayloadElement = function() {
  14. this._class_ = VasPayloadElement;
  15. this.dataType = undefined;
  16. this.responseFormat = undefined;
  17. this.vasData = undefined;
  18. this.protocolId = undefined;
  19. this.merchantId = undefined;
  20. };
  21. /**
  22. * Set the field value
  23. * Indicates the type of data in this response.
  24. *
  25. * @memberof payments.VasPayloadElement
  26. * @param {payments.VasDataType} dataType
  27. */
  28. VasPayloadElement.prototype.setDataType = function(dataType) {
  29. this.dataType = dataType;
  30. };
  31. /**
  32. * Get the field value
  33. * Indicates the type of data in this response.
  34. * @memberof payments.VasPayloadElement
  35. * @return {payments.VasDataType}
  36. */
  37. VasPayloadElement.prototype.getDataType = function() {
  38. return this.dataType;
  39. };
  40. /**
  41. * Set the field value
  42. * Format of vasData payload.
  43. *
  44. * @memberof payments.VasPayloadElement
  45. * @param {payments.VasResponseFormat} responseFormat
  46. */
  47. VasPayloadElement.prototype.setResponseFormat = function(responseFormat) {
  48. this.responseFormat = responseFormat;
  49. };
  50. /**
  51. * Get the field value
  52. * Format of vasData payload.
  53. * @memberof payments.VasPayloadElement
  54. * @return {payments.VasResponseFormat}
  55. */
  56. VasPayloadElement.prototype.getResponseFormat = function() {
  57. return this.responseFormat;
  58. };
  59. /**
  60. * Set the field value
  61. * Vas data. For NDEF it will be base64 encoded binary.
  62. *
  63. * @memberof payments.VasPayloadElement
  64. * @param {String} vasData
  65. */
  66. VasPayloadElement.prototype.setVasData = function(vasData) {
  67. this.vasData = vasData;
  68. };
  69. /**
  70. * Get the field value
  71. * Vas data. For NDEF it will be base64 encoded binary.
  72. * @memberof payments.VasPayloadElement
  73. * @return {String}
  74. */
  75. VasPayloadElement.prototype.getVasData = function() {
  76. return this.vasData;
  77. };
  78. /**
  79. * Set the field value
  80. * Protocol this payload element was derived from
  81. *
  82. * @memberof payments.VasPayloadElement
  83. * @param {payments.VasProtocol} protocolId
  84. */
  85. VasPayloadElement.prototype.setProtocolId = function(protocolId) {
  86. this.protocolId = protocolId;
  87. };
  88. /**
  89. * Get the field value
  90. * Protocol this payload element was derived from
  91. * @memberof payments.VasPayloadElement
  92. * @return {payments.VasProtocol}
  93. */
  94. VasPayloadElement.prototype.getProtocolId = function() {
  95. return this.protocolId;
  96. };
  97. /**
  98. * Set the field value
  99. * Merchant id associated with this payload element (hex encoded)
  100. *
  101. * @memberof payments.VasPayloadElement
  102. * @param {String} merchantId
  103. */
  104. VasPayloadElement.prototype.setMerchantId = function(merchantId) {
  105. this.merchantId = merchantId;
  106. };
  107. /**
  108. * Get the field value
  109. * Merchant id associated with this payload element (hex encoded)
  110. * @memberof payments.VasPayloadElement
  111. * @return {String}
  112. */
  113. VasPayloadElement.prototype.getMerchantId = function() {
  114. return this.merchantId;
  115. };
  116. /**
  117. * @memberof payments.VasPayloadElement
  118. * @private
  119. */
  120. VasPayloadElement.prototype.getMetaInfo = function(fieldName) {
  121. var curclass = this._class_;
  122. do {
  123. var fieldMetaInfo = curclass._meta_.fields[fieldName];
  124. if(fieldMetaInfo) {
  125. return fieldMetaInfo;
  126. }
  127. if(curclass._meta_._superMeta_) {
  128. curclass = curclass._meta_._superMeta_._class_;
  129. } else {
  130. curclass = null;
  131. }
  132. } while(curclass);
  133. return null;
  134. };
  135. VasPayloadElement.prototype.toString = function() {
  136. return JSON.stringify(this);
  137. };
  138. VasPayloadElement._meta_ = {fields: {}};
  139. VasPayloadElement._meta_._class_ = VasPayloadElement;
  140. VasPayloadElement._meta_.fields["dataType"] = {};
  141. VasPayloadElement._meta_.fields["dataType"].type = payments_VasDataType;
  142. VasPayloadElement._meta_.fields["responseFormat"] = {};
  143. VasPayloadElement._meta_.fields["responseFormat"].type = payments_VasResponseFormat;
  144. VasPayloadElement._meta_.fields["vasData"] = {};
  145. VasPayloadElement._meta_.fields["vasData"].type = String;
  146. VasPayloadElement._meta_.fields["protocolId"] = {};
  147. VasPayloadElement._meta_.fields["protocolId"].type = payments_VasProtocol;
  148. VasPayloadElement._meta_.fields["merchantId"] = {};
  149. VasPayloadElement._meta_.fields["merchantId"].type = String;
  150. //
  151. // Expose the module.
  152. //
  153. if ('undefined' !== typeof module) {
  154. module.exports = VasPayloadElement;
  155. }