Source: base/Challenge.js

/**
 * Autogenerated by Avro
 * 
 * DO NOT EDIT DIRECTLY
 */

var order_VoidReason = require("../order/VoidReason");
var base_ChallengeType = require("../base/ChallengeType");

/**
* @constructor
* @memberof base
*/
var Challenge = function() {
  this._class_ = Challenge;
  this.type = undefined;
  this.reason = undefined;
  this.message = undefined;
};


/**
* Set the field value
* The type of the challenge.
*
* @memberof base.Challenge
* @param {base.ChallengeType} type 
*/
Challenge.prototype.setType = function(type) {
  this.type = type;
};

/**
* Get the field value
* The type of the challenge.
* @memberof base.Challenge
* @return {base.ChallengeType} 
*/
Challenge.prototype.getType = function() {
  return this.type;
};

/**
* Set the field value
* If the challenge is not accepted, then this reason can be used when responding.  The response could be an explicit void of the payment, or some other message, that may or may not use this reason.
*
* @memberof base.Challenge
* @param {order.VoidReason} reason 
*/
Challenge.prototype.setReason = function(reason) {
  this.reason = reason;
};

/**
* Get the field value
* If the challenge is not accepted, then this reason can be used when responding.  The response could be an explicit void of the payment, or some other message, that may or may not use this reason.
* @memberof base.Challenge
* @return {order.VoidReason} 
*/
Challenge.prototype.getReason = function() {
  return this.reason;
};

/**
* Set the field value
* A default message that indicates what the challenge is in a user friendly format.
*
* @memberof base.Challenge
* @param {String} message 
*/
Challenge.prototype.setMessage = function(message) {
  this.message = message;
};

/**
* Get the field value
* A default message that indicates what the challenge is in a user friendly format.
* @memberof base.Challenge
* @return {String} 
*/
Challenge.prototype.getMessage = function() {
  return this.message;
};

/**
* @memberof base.Challenge
* @private
*/
Challenge.prototype.getMetaInfo = function(fieldName) {
  var curclass = this._class_;
  do {
    var fieldMetaInfo = curclass._meta_.fields[fieldName];
    if(fieldMetaInfo) {
      return fieldMetaInfo;
    }
    if(curclass._meta_._superMeta_) {
      curclass = curclass._meta_._superMeta_._class_;
    } else {
      curclass = null;
    }
  } while(curclass);
  return null;
};

Challenge.prototype.toString = function() {
  return JSON.stringify(this);
};

Challenge._meta_ =  {fields:  {}};
Challenge._meta_._class_ =  Challenge;
Challenge._meta_.fields["type"] = {};
Challenge._meta_.fields["type"].type = base_ChallengeType;
Challenge._meta_.fields["reason"] = {};
Challenge._meta_.fields["reason"].type = order_VoidReason;
Challenge._meta_.fields["message"] = {};
Challenge._meta_.fields["message"].type = String;

//
// Expose the module.
//
if ('undefined' !== typeof module) {
module.exports = Challenge;
}