Source: remotepay/BaseResponse.js

  1. /**
  2. * Autogenerated by Avro
  3. *
  4. * DO NOT EDIT DIRECTLY
  5. */
  6. var remotepay_ResponseCode = require("../remotepay/ResponseCode");
  7. /** The base for responses */
  8. /**
  9. * @constructor
  10. * @memberof remotepay
  11. */
  12. var BaseResponse = function() {
  13. this._class_ = BaseResponse;
  14. this.success = undefined;
  15. this.result = undefined;
  16. this.reason = undefined;
  17. this.message = undefined;
  18. };
  19. /**
  20. * Set the field value
  21. * If true then the requested operation succeeded
  22. *
  23. * @memberof remotepay.BaseResponse
  24. * @param {Boolean} success
  25. */
  26. BaseResponse.prototype.setSuccess = function(success) {
  27. this.success = success;
  28. };
  29. /**
  30. * Get the field value
  31. * If true then the requested operation succeeded
  32. * @memberof remotepay.BaseResponse
  33. * @return {Boolean}
  34. */
  35. BaseResponse.prototype.getSuccess = function() {
  36. return this.success;
  37. };
  38. /**
  39. * Set the field value
  40. * The result of the requested operation.
  41. *
  42. * @memberof remotepay.BaseResponse
  43. * @param {remotepay.ResponseCode} result
  44. */
  45. BaseResponse.prototype.setResult = function(result) {
  46. this.result = result;
  47. };
  48. /**
  49. * Get the field value
  50. * The result of the requested operation.
  51. * @memberof remotepay.BaseResponse
  52. * @return {remotepay.ResponseCode}
  53. */
  54. BaseResponse.prototype.getResult = function() {
  55. return this.result;
  56. };
  57. /**
  58. * Set the field value
  59. * Optional information about result.
  60. *
  61. * @memberof remotepay.BaseResponse
  62. * @param {String|Null} reason
  63. */
  64. BaseResponse.prototype.setReason = function(reason) {
  65. this.reason = reason;
  66. };
  67. /**
  68. * Get the field value
  69. * Optional information about result.
  70. * @memberof remotepay.BaseResponse
  71. * @return {String|Null}
  72. */
  73. BaseResponse.prototype.getReason = function() {
  74. return this.reason;
  75. };
  76. /**
  77. * Set the field value
  78. * Detailed information about result.
  79. *
  80. * @memberof remotepay.BaseResponse
  81. * @param {String|Null} message
  82. */
  83. BaseResponse.prototype.setMessage = function(message) {
  84. this.message = message;
  85. };
  86. /**
  87. * Get the field value
  88. * Detailed information about result.
  89. * @memberof remotepay.BaseResponse
  90. * @return {String|Null}
  91. */
  92. BaseResponse.prototype.getMessage = function() {
  93. return this.message;
  94. };
  95. /**
  96. * @memberof remotepay.BaseResponse
  97. * @private
  98. */
  99. BaseResponse.prototype.getMetaInfo = function(fieldName) {
  100. var curclass = this._class_;
  101. do {
  102. var fieldMetaInfo = curclass._meta_.fields[fieldName];
  103. if(fieldMetaInfo) {
  104. return fieldMetaInfo;
  105. }
  106. if(curclass._meta_._superMeta_) {
  107. curclass = curclass._meta_._superMeta_._class_;
  108. } else {
  109. curclass = null;
  110. }
  111. } while(curclass);
  112. return null;
  113. };
  114. BaseResponse.prototype.toString = function() {
  115. return JSON.stringify(this);
  116. };
  117. BaseResponse._meta_ = {fields: {}};
  118. BaseResponse._meta_._class_ = BaseResponse;
  119. BaseResponse._meta_.fields["success"] = {};
  120. BaseResponse._meta_.fields["success"].type = Boolean;
  121. BaseResponse._meta_.fields["result"] = {};
  122. BaseResponse._meta_.fields["result"].type = remotepay_ResponseCode;
  123. BaseResponse._meta_.fields["reason"] = {};
  124. BaseResponse._meta_.fields["reason"].type = String;
  125. BaseResponse._meta_.fields["message"] = {};
  126. BaseResponse._meta_.fields["message"].type = String;
  127. //
  128. // Expose the module.
  129. //
  130. if ('undefined' !== typeof module) {
  131. module.exports = BaseResponse;
  132. }