{"size": 758, "ext": "js", "max_stars_repo_path": "ui/src/services/aliyun-pop-core/base-client.js", "max_stars_repo_name": "aliyun/open-drive", "max_stars_repo_stars_event_min_datetime": "2019-02-01T18:33:01.000Z", "max_stars_repo_stars_event_max_datetime": "2019-06-17T21:31:59.000Z", "max_issues_repo_path": "ui/src/services/aliyun-pop-core/base-client.js", "max_issues_repo_name": "aliyun/open-drive", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "ui/src/services/aliyun-pop-core/base-client.js", "max_forks_repo_name": "aliyun/open-drive", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 2, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 26.1379310345, "max_line_length": 78, "alphanum_fraction": 0.6635883905}
var requiredFields = ['accessKeyId','accessKeySecret','endpoint','apiVersion']

class BaseClient {
  /**
  * @param opt {Object} required
  * @param opt.accessKeyId {String} required
  * @param opt.accessKeySecret {String} required
  * @param opt.endpoint {String}  required
  * @param opt.apiVersion {String}  required

  * @param opt.httpOptions {Object}  optional
  * @param opt.httpOptions.timeout {Integer} optional unit: ms
  * @param opt.httpOptions.headers {Object} optional extenal headers
  */
  constructor(opt) {
    if(!opt){
      throw new Error('Invalid arguments')
    }
    for(var k of requiredFields){
      if(!opt[k]){
        throw new Error(k +' is required')
      }
    }
    this.authInfo = opt;
  }
}

module.exports = BaseClient
