Source: order/Discount.js

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

var base_Reference = require("../base/Reference");

/**
* @constructor
* @memberof order
*/
var Discount = function() {
  this._class_ = Discount;
  this.id = undefined;
  this.orderRef = undefined;
  this.lineItemRef = undefined;
  this.discount = undefined;
  this.approver = undefined;
  this.name = undefined;
  this.amount = undefined;
  this.percentage = undefined;
};


/**
* Set the field value
* Unique identifier
*
* @memberof order.Discount
* @param {String} id 
*/
Discount.prototype.setId = function(id) {
  this.id = id;
};

/**
* Get the field value
* Unique identifier
* @memberof order.Discount
* @return {String} 
*/
Discount.prototype.getId = function() {
  return this.id;
};

/**
* Set the field value
* The order with which the discount is associated
*
* @memberof order.Discount
* @param {Null|base.Reference} orderRef 
*/
Discount.prototype.setOrderRef = function(orderRef) {
  this.orderRef = orderRef;
};

/**
* Get the field value
* The order with which the discount is associated
* @memberof order.Discount
* @return {Null|base.Reference} 
*/
Discount.prototype.getOrderRef = function() {
  return this.orderRef;
};

/**
* Set the field value
* The lineItem with which the discount is associated
*
* @memberof order.Discount
* @param {Null|base.Reference} lineItemRef 
*/
Discount.prototype.setLineItemRef = function(lineItemRef) {
  this.lineItemRef = lineItemRef;
};

/**
* Get the field value
* The lineItem with which the discount is associated
* @memberof order.Discount
* @return {Null|base.Reference} 
*/
Discount.prototype.getLineItemRef = function() {
  return this.lineItemRef;
};

/**
* Set the field value
* If this item is based on a standard discount, this will point to the appropriate inventory.Discount
*
* @memberof order.Discount
* @param {Null|base.Reference} discount 
*/
Discount.prototype.setDiscount = function(discount) {
  this.discount = discount;
};

/**
* Get the field value
* If this item is based on a standard discount, this will point to the appropriate inventory.Discount
* @memberof order.Discount
* @return {Null|base.Reference} 
*/
Discount.prototype.getDiscount = function() {
  return this.discount;
};

/**
* Set the field value
* The person that authorized a discount
*
* @memberof order.Discount
* @param {Null|base.Reference} approver 
*/
Discount.prototype.setApprover = function(approver) {
  this.approver = approver;
};

/**
* Get the field value
* The person that authorized a discount
* @memberof order.Discount
* @return {Null|base.Reference} 
*/
Discount.prototype.getApprover = function() {
  return this.approver;
};

/**
* Set the field value
* Name of the discount
*
* @memberof order.Discount
* @param {String} name 
*/
Discount.prototype.setName = function(name) {
  this.name = name;
};

/**
* Get the field value
* Name of the discount
* @memberof order.Discount
* @return {String} 
*/
Discount.prototype.getName = function() {
  return this.name;
};

/**
* Set the field value
* Discount amount in fraction of currency unit (e.g. cents) based on currency fraction digits supported
*
* @memberof order.Discount
* @param {Null|Number} amount must be a long integer
*/
Discount.prototype.setAmount = function(amount) {
  this.amount = amount;
};

/**
* Get the field value
* Discount amount in fraction of currency unit (e.g. cents) based on currency fraction digits supported
* @memberof order.Discount
* @return {Null|Number} must be a long integer
*/
Discount.prototype.getAmount = function() {
  return this.amount;
};

/**
* Set the field value
* Discount amount in percent
*
* @memberof order.Discount
* @param {Null|Number} percentage must be a long integer
*/
Discount.prototype.setPercentage = function(percentage) {
  this.percentage = percentage;
};

/**
* Get the field value
* Discount amount in percent
* @memberof order.Discount
* @return {Null|Number} must be a long integer
*/
Discount.prototype.getPercentage = function() {
  return this.percentage;
};

/**
* @memberof order.Discount
* @private
*/
Discount.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;
};

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

Discount._meta_ =  {fields:  {}};
Discount._meta_._class_ =  Discount;
Discount._meta_.fields["id"] = {};
Discount._meta_.fields["id"].type = String;
Discount._meta_.fields["orderRef"] = {};
Discount._meta_.fields["orderRef"].type = base_Reference;
Discount._meta_.fields["lineItemRef"] = {};
Discount._meta_.fields["lineItemRef"].type = base_Reference;
Discount._meta_.fields["discount"] = {};
Discount._meta_.fields["discount"].type = base_Reference;
Discount._meta_.fields["approver"] = {};
Discount._meta_.fields["approver"].type = base_Reference;
Discount._meta_.fields["name"] = {};
Discount._meta_.fields["name"].type = String;
Discount._meta_.fields["amount"] = {};
Discount._meta_.fields["amount"].type = Number;
Discount._meta_.fields["percentage"] = {};
Discount._meta_.fields["percentage"].type = Number;

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