(function(root, factory) {
  if (typeof define === 'function' && define.amd) {
    // AMD. Register as an anonymous module.
    define(['ApiClient', 'models/AuditInfoVo', 'models/FeeRefundResponse', 'models/PaymentNetworkResponseVo', 'models/SourcePayment'], factory);
  } else if (typeof module === 'object' && module.exports) {
    // CommonJS-like environments that support module.exports, like Node.
    module.exports = factory(require('../ApiClient'), require('./AuditInfoVo'), require('./FeeRefundResponse'), require('./PaymentNetworkResponseVo'), require('./SourcePayment'));
  } else {
    // Browser globals (root is window)
    if (!root.OrbipayPaymentsapiClient) {
      root.OrbipayPaymentsapiClient = {};
    }
    root.OrbipayPaymentsapiClient.RefundResponse = factory(root.OrbipayPaymentsapiClient.ApiClient, root.OrbipayPaymentsapiClient.AuditInfoVo, root.OrbipayPaymentsapiClient.FeeRefundResponse, root.OrbipayPaymentsapiClient.PaymentNetworkResponseVo, root.OrbipayPaymentsapiClient.SourcePayment);
  }
}(this, function(ApiClient, AuditInfoVo, FeeRefundResponse, PaymentNetworkResponseVo, SourcePayment) {
  'use strict';




  /**
   * The RefundResponse model module.
   * @module models/RefundResponse
   */

  /**
   * <h3 style="color:red"> This class subject to change without prior notice, Please dont use this class directly. </h3>

   * Constructs a new <code>RefundResponse</code>.
   * @alias module:models/RefundResponse
   * @class
   */
  var exports = function() {
    var _this = this;

















  };

  /**
   * Constructs a <code>RefundResponse</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:models/RefundResponse} obj Optional instance to populate.
   * @return {module:models/RefundResponse} The populated <code>RefundResponse</code> instance.
   */
  exports.constructFromObject = function(data, obj) {
    if (data) {
      obj = obj || new exports();

      if (data.hasOwnProperty('refund_reference')) {
        obj['refund_reference'] = ApiClient.convertToType(data['refund_reference'], 'String');
      }
      if (data.hasOwnProperty('id')) {
        obj['id'] = ApiClient.convertToType(data['id'], 'String');
      }
      if (data.hasOwnProperty('url')) {
        obj['url'] = ApiClient.convertToType(data['url'], 'String');
      }
      if (data.hasOwnProperty('refund_type')) {
        obj['refund_type'] = ApiClient.convertToType(data['refund_type'], 'String');
      }
      if (data.hasOwnProperty('refund_amount')) {
        obj['refund_amount'] = ApiClient.convertToType(data['refund_amount'], 'String');
      }
      if (data.hasOwnProperty('fee_refund')) {
        obj['fee_refund'] = FeeRefundResponse.constructFromObject(data['fee_refund']);
      }
      if (data.hasOwnProperty('status')) {
        obj['status'] = ApiClient.convertToType(data['status'], 'String');
      }
      if (data.hasOwnProperty('confirmation_number')) {
        obj['confirmation_number'] = ApiClient.convertToType(data['confirmation_number'], 'String');
      }
      if (data.hasOwnProperty('refund_date')) {
        obj['refund_date'] = ApiClient.convertToType(data['refund_date'], 'String');
      }
      if (data.hasOwnProperty('refund_entry_date')) {
        obj['refund_entry_date'] = ApiClient.convertToType(data['refund_entry_date'], 'String');
      }
      if (data.hasOwnProperty('expected_refund_settlement_date')) {
        obj['expected_refund_settlement_date'] = ApiClient.convertToType(data['expected_refund_settlement_date'], 'String');
      }
      if (data.hasOwnProperty('custom_fields')) {
        obj['custom_fields'] = ApiClient.convertToType(data['custom_fields'], {'String': 'String'});
      }
      if (data.hasOwnProperty('comments')) {
        obj['comments'] = ApiClient.convertToType(data['comments'], 'String');
      }
      if (data.hasOwnProperty('source_payment')) {
        obj['source_payment'] = SourcePayment.constructFromObject(data['source_payment']);
      }
      if (data.hasOwnProperty('payment_network_response')) {
        obj['payment_network_response'] = PaymentNetworkResponseVo.constructFromObject(data['payment_network_response']);
      }
      if (data.hasOwnProperty('audit_info')) {
        obj['audit_info'] = AuditInfoVo.constructFromObject(data['audit_info']);
      }
    }
    return obj;
  };

  /**
   * The unique identifier in the client system for the refund.
   * @member {String} refund_reference
   */
  exports.prototype['refund_reference'] = undefined;
  /**
   * The unique identifier assigned by EBPP to the refund.
   * @member {String} id
   */
  exports.prototype['id'] = undefined;
  /**
   * This URL fetches the details of refund.
   * @member {String} url
   */
  exports.prototype['url'] = undefined;
  /**
   * The portion of the payment amount that is to be or has been refunded. The original payment can be refunded fully including the amount and the fee components, or partially, for just the amount or the fee component. Refund can also be initiated for an arbitrary amount limited by the original payment amount.
   * @member {module:models/RefundResponse.RefundTypeEnum} refund_type
   */
  exports.prototype['refund_type'] = undefined;
  /**
   * The refund amount upto 2 decimal places.
   * @member {String} refund_amount
   */
  exports.prototype['refund_amount'] = undefined;
  /**
   * @member {module:models/FeeRefundResponse} fee_refund
   */
  exports.prototype['fee_refund'] = undefined;
  /**
   * The status of the refund.
   * @member {module:models/RefundResponse.StatusEnum} status
   */
  exports.prototype['status'] = undefined;
  /**
   * The confirmation number or reference provided to the customer for the refund.
   * @member {String} confirmation_number
   */
  exports.prototype['confirmation_number'] = undefined;
  /**
   * The date on which the refund is scheduled to be made. It must be in ISO8601 full-date format, namely, YYYY-MM-DD.
   * @member {String} refund_date
   */
  exports.prototype['refund_date'] = undefined;
  /**
   * The date on which the refund captured in EBPP. It must be in ISO8601 full-date format, namely, YYYY-MM-DD.
   * @member {String} refund_entry_date
   */
  exports.prototype['refund_entry_date'] = undefined;
  /**
   * The date by which the credits would be posted to the original funding account. ISO8601 full-date format, YYYY-MM-DD
   * @member {String} expected_refund_settlement_date
   */
  exports.prototype['expected_refund_settlement_date'] = undefined;
  /**
   * The additional information or meta-information that EBPP can accept, maintain and transmit back to the client. The custom fields need to be configured with EBPP before they can be accepted. EBPP would reject custom fields that are not pre-configured. Please contact <a href = \"mailto: support@billerpayments.com\">support@billerpayments.com</a> for more information on configuring and using custom fields.
   * @member {Object.<String, String>} custom_fields
   */
  exports.prototype['custom_fields'] = undefined;
  /**
   * Comments that can be used to recollect the operation performed on the resource object. API clients need to ensure that no sensitive information is passed in the memo. Alacriti (EBPP) is not responsible for the security of any sensitive information that may be passed as part of the memo.
   * @member {String} comments
   */
  exports.prototype['comments'] = undefined;
  /**
   * @member {module:models/SourcePayment} source_payment
   */
  exports.prototype['source_payment'] = undefined;
  /**
   * @member {module:models/PaymentNetworkResponseVo} payment_network_response
   */
  exports.prototype['payment_network_response'] = undefined;
  /**
   * @member {module:models/AuditInfoVo} audit_info
   */
  exports.prototype['audit_info'] = undefined;


  /**
   * Allowed values for the <code>refund_type</code> property.
   * @enum {String}
   * @readonly
   */
  exports.RefundTypeEnum = {
    /**
     * value: "payment_and_fee"
     * @const
     */
    "payment_and_fee": "payment_and_fee",
    /**
     * value: "payment_only"
     * @const
     */
    "payment_only": "payment_only",
    /**
     * value: "fee_only"
     * @const
     */
    "fee_only": "fee_only",
    /**
     * value: "other"
     * @const
     */
    "other": "other"  };

  /**
   * Allowed values for the <code>status</code> property.
   * @enum {String}
   * @readonly
   */
  exports.StatusEnum = {
    /**
     * value: "scheduled"
     * @const
     */
    "scheduled": "scheduled",
    /**
     * value: "cancelled"
     * @const
     */
    "cancelled": "cancelled",
    /**
     * value: "processing"
     * @const
     */
    "processing": "processing",
    /**
     * value: "processed"
     * @const
     */
    "processed": "processed",
    /**
     * value: "declined"
     * @const
     */
    "declined": "declined",
    /**
     * value: "returned"
     * @const
     */
    "returned": "returned",
    /**
     * value: "disputed"
     * @const
     */
    "disputed": "disputed",
    /**
     * value: "error"
     * @const
     */
    "error": "error"  };


  return exports;
}));