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




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

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

   * Constructs a new <code>CreatePaymentAuthorizationRequest</code>.
   * @alias module:models/CreatePaymentAuthorizationRequest
   * @class
   * @param auth_amount {String} The amount being authorized.
   * @param customer {module:models/PaymentAuthCustomerRequest} 
   * @param funding_account {module:models/PaymentAuthFundingAccountRequest} 
   * @param customer_account {module:models/PaymentAuthCustomerAccountRequest} 
   */
  var exports = function(auth_amount, customer, funding_account, customer_account) {
    var _this = this;


    _this['auth_amount'] = auth_amount;

    _this['customer'] = customer;
    _this['funding_account'] = funding_account;
    _this['customer_account'] = customer_account;


  };

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

      if (data.hasOwnProperty('payment_auth_reference')) {
        obj['payment_auth_reference'] = ApiClient.convertToType(data['payment_auth_reference'], 'String');
      }
      if (data.hasOwnProperty('auth_amount')) {
        obj['auth_amount'] = ApiClient.convertToType(data['auth_amount'], 'String');
      }
      if (data.hasOwnProperty('card_cvv_number')) {
        obj['card_cvv_number'] = ApiClient.convertToType(data['card_cvv_number'], 'String');
      }
      if (data.hasOwnProperty('customer')) {
        obj['customer'] = PaymentAuthCustomerRequest.constructFromObject(data['customer']);
      }
      if (data.hasOwnProperty('funding_account')) {
        obj['funding_account'] = PaymentAuthFundingAccountRequest.constructFromObject(data['funding_account']);
      }
      if (data.hasOwnProperty('customer_account')) {
        obj['customer_account'] = PaymentAuthCustomerAccountRequest.constructFromObject(data['customer_account']);
      }
      if (data.hasOwnProperty('comments')) {
        obj['comments'] = ApiClient.convertToType(data['comments'], 'String');
      }
      if (data.hasOwnProperty('custom_fields')) {
        obj['custom_fields'] = ApiClient.convertToType(data['custom_fields'], {'String': 'String'});
      }
    }
    return obj;
  };

  /**
   * The unique identifier in the client system for the payment authorization. This is mandatory in case of voyager fleet card payment.
   * @member {String} payment_auth_reference
   */
  exports.prototype['payment_auth_reference'] = undefined;
  /**
   * The amount being authorized.
   * @member {String} auth_amount
   */
  exports.prototype['auth_amount'] = undefined;
  /**
   * @member {String} card_cvv_number
   */
  exports.prototype['card_cvv_number'] = undefined;
  /**
   * @member {module:models/PaymentAuthCustomerRequest} customer
   */
  exports.prototype['customer'] = undefined;
  /**
   * @member {module:models/PaymentAuthFundingAccountRequest} funding_account
   */
  exports.prototype['funding_account'] = undefined;
  /**
   * @member {module:models/PaymentAuthCustomerAccountRequest} customer_account
   */
  exports.prototype['customer_account'] = undefined;
  /**
   * Comments that can be used to recollect the operation performed on the resource object.
   * @member {String} comments
   */
  exports.prototype['comments'] = 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;



  return exports;
}));