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




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

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

   * Constructs a new <code>AddFundingAccountRequest</code>.
   * @alias module:models/AddFundingAccountRequest
   * @class
   * @param account_holder_name {String} The name as specified on the account.
   * @param account_number {String} The number or reference that a customer uses to identify the funding account.
   */
  var exports = function(account_holder_name, account_number) {
    var _this = this;

    _this['account_holder_name'] = account_holder_name;


    _this['account_number'] = account_number;







  };

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

      if (data.hasOwnProperty('account_holder_name')) {
        obj['account_holder_name'] = ApiClient.convertToType(data['account_holder_name'], 'String');
      }
      if (data.hasOwnProperty('nickname')) {
        obj['nickname'] = ApiClient.convertToType(data['nickname'], 'String');
      }
      if (data.hasOwnProperty('address')) {
        obj['address'] = FundingAccountAddress.constructFromObject(data['address']);
      }
      if (data.hasOwnProperty('account_number')) {
        obj['account_number'] = ApiClient.convertToType(data['account_number'], 'String');
      }
      if (data.hasOwnProperty('aba_routing_number')) {
        obj['aba_routing_number'] = ApiClient.convertToType(data['aba_routing_number'], 'String');
      }
      if (data.hasOwnProperty('expiry_date')) {
        obj['expiry_date'] = ApiClient.convertToType(data['expiry_date'], 'String');
      }
      if (data.hasOwnProperty('account_holder_type')) {
        obj['account_holder_type'] = ApiClient.convertToType(data['account_holder_type'], 'String');
      }
      if (data.hasOwnProperty('custom_fields')) {
        obj['custom_fields'] = ApiClient.convertToType(data['custom_fields'], {'String': 'String'});
      }
      if (data.hasOwnProperty('account_subtype')) {
        obj['account_subtype'] = ApiClient.convertToType(data['account_subtype'], 'String');
      }
      if (data.hasOwnProperty('card_cvv_number')) {
        obj['card_cvv_number'] = ApiClient.convertToType(data['card_cvv_number'], 'String');
      }
      if (data.hasOwnProperty('comments')) {
        obj['comments'] = ApiClient.convertToType(data['comments'], 'String');
      }
    }
    return obj;
  };

  /**
   * The name as specified on the account.
   * @member {String} account_holder_name
   */
  exports.prototype['account_holder_name'] = undefined;
  /**
   * The nickname by which a customer might want to identify the account.
   * @member {String} nickname
   */
  exports.prototype['nickname'] = undefined;
  /**
   * @member {module:models/FundingAccountAddress} address
   */
  exports.prototype['address'] = undefined;
  /**
   * The number or reference that a customer uses to identify the funding account.
   * @member {String} account_number
   */
  exports.prototype['account_number'] = undefined;
  /**
   * The ABA/Routing number for the bank account.
   * @member {String} aba_routing_number
   */
  exports.prototype['aba_routing_number'] = undefined;
  /**
   * The expiry date for the card. This is to be in the format MM/YY.
   * @member {String} expiry_date
   */
  exports.prototype['expiry_date'] = undefined;
  /**
   * The type of ownership for the funding account. This is applicable only in the case of bank accounts and it is defaults to personal. 
   * @member {module:models/AddFundingAccountRequest.AccountHolderTypeEnum} account_holder_type
   */
  exports.prototype['account_holder_type'] = 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. Only the custom fields enabled for the client, in EBPP, would be accepted in the requests.
   * @member {Object.<String, String>} custom_fields
   */
  exports.prototype['custom_fields'] = undefined;
  /**
   * The sub type of the funding account. This is derived by EBPP in the case of card funding accounts. It needs to be passed when adding or editing a DDA/Bank/ApplePay account. For e.g., a savings account, a checking account.
   * @member {module:models/AddFundingAccountRequest.AccountSubtypeEnum} account_subtype
   */
  exports.prototype['account_subtype'] = undefined;
  /**
   * This is never returned by EBPP. This needs to be passed to EBPP when adding or editing a card funding account.
   * @member {String} card_cvv_number
   */
  exports.prototype['card_cvv_number'] = 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;


  /**
   * Allowed values for the <code>account_holder_type</code> property.
   * @enum {String}
   * @readonly
   */
  exports.AccountHolderTypeEnum = {
    /**
     * value: "personal"
     * @const
     */
    "personal": "personal",
    /**
     * value: "business"
     * @const
     */
    "business": "business"  };

  /**
   * Allowed values for the <code>account_subtype</code> property.
   * @enum {String}
   * @readonly
   */
  exports.AccountSubtypeEnum = {
    /**
     * value: "savings"
     * @const
     */
    "savings": "savings",
    /**
     * value: "checking"
     * @const
     */
    "checking": "checking",
    /**
     * value: "money_market"
     * @const
     */
    "money_market": "money_market",
    /**
     * value: "visa_credit"
     * @const
     */
    "visa_credit": "visa_credit",
    /**
     * value: "mastercard_credit"
     * @const
     */
    "mastercard_credit": "mastercard_credit",
    /**
     * value: "american_express_credit"
     * @const
     */
    "american_express_credit": "american_express_credit",
    /**
     * value: "discover_credit"
     * @const
     */
    "discover_credit": "discover_credit",
    /**
     * value: "visa_debit"
     * @const
     */
    "visa_debit": "visa_debit",
    /**
     * value: "mastercard_debit"
     * @const
     */
    "mastercard_debit": "mastercard_debit",
    /**
     * value: "discover_debit"
     * @const
     */
    "discover_debit": "discover_debit"  };


  return exports;
}));