(function(root, factory) {

if (typeof module === 'object' && module.exports) {
    // CommonJS-like environments that support module.exports, like Node.
    module.exports = factory(require('../ApiClient'), require('./InvocationContext'), require('../CommonUtil'), require('../ResponseWrapper'), require('./Base'), require('../OrbipayApiError'));
  }
}(this, function(ApiClient, InvocationContext, CommonUtil, ResponseWrapper, Base, OrbipayApiError) {
  'use strict';

    /**
    * The PaymentSchedule wrapper module.
    * @module wrappers/PaymentSchedule
    */
  var exports = function(payment_recurring_type, payment_recurring_count, payment_amount_type, payment_start_date, payment_end_date, payment_limit_amount, payment_plan_id, payment_defer_days) {
  	var _this = this;
        Base.call(_this);
  		_this['payment_recurring_type'] = payment_recurring_type;
  		_this['payment_recurring_count'] = payment_recurring_count;
  		_this['payment_amount_type'] = payment_amount_type;
  		_this['payment_start_date'] = payment_start_date;
  		_this['payment_end_date'] = payment_end_date;
  		_this['payment_limit_amount'] = payment_limit_amount;
  		_this['payment_plan_id'] = payment_plan_id;
  		_this['payment_defer_days'] = payment_defer_days;
  };

      /**
      * Constructs a <code>PaymentSchedule</code> from a plain JavaScript object, optionally creating a new instance.
      * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
      * @param {Object} data The plain JavaScript object bearing properties of interest.
      * @param {module:wrappers/PaymentSchedule} obj Optional instance to populate.
      * @return {module:wrappers/PaymentSchedule} The populated <code>PaymentSchedule</code> instance.
      */
  exports.constructFromObject = function (data, obj) {
        if (data) {
            obj = obj || new exports();
            if (data.hasOwnProperty('payment_recurring_type')) {
                obj['payment_recurring_type'] = data['payment_recurring_type'];
            }
            if (data.hasOwnProperty('payment_recurring_count')) {
                obj['payment_recurring_count'] = data['payment_recurring_count'];
            }
            if (data.hasOwnProperty('payment_amount_type')) {
                obj['payment_amount_type'] = data['payment_amount_type'];
            }
            if (data.hasOwnProperty('payment_start_date')) {
                obj['payment_start_date'] = data['payment_start_date'];
            }
            if (data.hasOwnProperty('payment_end_date')) {
                obj['payment_end_date'] = data['payment_end_date'];
            }
            if (data.hasOwnProperty('payment_limit_amount')) {
                obj['payment_limit_amount'] = data['payment_limit_amount'];
            }
            if (data.hasOwnProperty('payment_plan_id')) {
                obj['payment_plan_id'] = data['payment_plan_id'];
            }
            if (data.hasOwnProperty('payment_defer_days')) {
                obj['payment_defer_days'] = data['payment_defer_days'];
            }
        }
        return obj;
  };


  exports.prototype = Object.create(Base.prototype);
  exports.prototype.constructor = exports;

    /**
    * The frequency of the payments created as part of a payment setup.
    * @member {String} payment_recurring_type
    */
  exports.prototype['payment_recurring_type'] = undefined;
    /**
    * The maximum number of payments that can be created as part of a recurring payment setup.
    * @member {String} payment_recurring_count
    */
  exports.prototype['payment_recurring_count'] = undefined;
    /**
    * The amount type that is used to set the amount for payments created as part of a recurring payment or autopay setup. 
    * @member {String} payment_amount_type
    */
  exports.prototype['payment_amount_type'] = undefined;
    /**
    * The date on which the first payment will be drafted as part of a recurring payment setup. This is to be specified in the ISO8601 full-date format, namely, YYYY-MM-DD.
    * @member {String} payment_start_date
    */
  exports.prototype['payment_start_date'] = undefined;
    /**
    * The date by which the last payment will be drafted as part of a recurring payment setup. This is to be specified in the ISO8601 full-date format, namely, YYYY-MM-DD.
    * @member {String} payment_end_date
    */
  exports.prototype['payment_end_date'] = undefined;
    /**
    * The upper limit for the payment amount in the case of recurring or autopay payments.
    * @member {String} payment_limit_amount
    */
  exports.prototype['payment_limit_amount'] = undefined;
    /**
    * The reference to the payment plan, offered by the biller, that is used to set up the recurring payment. The list of payment plans offered is published as part of the biller set-up.
    * @member {String} payment_plan_id
    */
  exports.prototype['payment_plan_id'] = undefined;
    /**
    * The number of days from the bill due date that the customer wishes to delay the autopay payment by.
    * @member {String} payment_defer_days
    */
  exports.prototype['payment_defer_days'] = undefined;

  /**
  * @param  {String} payment_limit_amount - The payment_limit_amount of PaymentSchedule. 
  * @return {module:wrappers/PaymentSchedule} The instance of <code>PaymentSchedule</code>.
  */
  exports.prototype.withPaymentLimitAmount = function (payment_limit_amount) {
        var _this = this;

        _this['payment_limit_amount'] = payment_limit_amount;


        return _this;
  };



  return exports;

}));