(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.ReplaceFundingAccountRequest = factory(root.OrbipayPaymentsapiClient.ApiClient, root.OrbipayPaymentsapiClient.FundingAccountAddress);
  }
}(this, function(ApiClient, FundingAccountAddress) {
  'use strict';




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

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

   * Constructs a new <code>ReplaceFundingAccountRequest</code>.
   * @alias module:models/ReplaceFundingAccountRequest
   * @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>ReplaceFundingAccountRequest</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/ReplaceFundingAccountRequest} obj Optional instance to populate.
   * @return {module:models/ReplaceFundingAccountRequest} The populated <code>ReplaceFundingAccountRequest</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.
   * @member {module:models/ReplaceFundingAccountRequest.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. 
   * @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.
   * @member {module:models/ReplaceFundingAccountRequest.AccountSubtypeEnum} account_subtype
   */
  exports.prototype['account_subtype'] = undefined;
  /**
   * This is never returned by EBPP.
   * @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.
   * @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",
    /**
     * value: "voyager_fleet"
     * @const
     */
    "voyager_fleet": "voyager_fleet"  };


  return exports;
}));