<commit_before>'use strict'

var TogglClient = require('../client')
  , utils = require('../utils')




/**
 * Create a client
 *
 * @see https://github.com/toggl/toggl_api_docs/blob/master/chapters/clients.md
 * @public
 * @param {object} data New client data
 * @param {function} callback Accepts arguments: (err, clientData)
 */
TogglClient.prototype.createClient = function(data, callback) {
  if (!this.validateOptions('client-create', data, callback)) {
    return
  }

  var req = {
    method: 'POST',
    body:   {
      client: data
    }
  }

  this.apiRequest('/api/v8/clients', req, utils.wrapDataCallback(callback))
}




/**
 * Update client details
 *
 * @see https://github.com/toggl/toggl_api_docs/blob/master/chapters/clients.md
 * @public
 * @param {number|string} clientId Client ID
 * @param {function} callback Accepts arguments: (err)
 */
TogglClient.prototype.deleteClient = function(clientId, callback) {
  var req = {
    method: 'DELETE'
  }

  this.apiRequest('/api/v8/clients/' + clientId, req, callback)
}




/**
 * Get client details
 *
 * @see https://github.com/toggl/toggl_api_docs/blob/master/chapters/clients.md
 * @public
 * @param {number|string} clientId Client ID
 * @param {function} callback Accepts arguments: (err, clientData)
 */
TogglClient.prototype.getClientDetails = function(clientId, callback) {
  this.apiRequest('/api/v8/clients/' + clientId, {}, utils.wrapDataCallback(callback))
}




/**
 * Get client projects
 *
 * @see https://github.com/toggl/toggl_api_docs/blob/master/chapters/clients.md
 * @public
 * @param {number|string} clientId Client ID
 * @param {string|boolean} active Filter projects: active (true), archived (false), both
 * @param {function} callback Accepts arguments: (err, projects)
 */
TogglClient.prototype.getClientProjects = function(clientId, active, callback) {<commit_msg>refactor(api/clients): rename getClientDetails() to #getClientData()<commit_after>'use strict'

var TogglClient = require('../client')
  , utils = require('../utils')




/**
 * Create a client
 *
 * @see https://github.com/toggl/toggl_api_docs/blob/master/chapters/clients.md
 * @public
 * @param {object} data New client data
 * @param {function} callback Accepts arguments: (err, clientData)
 */
TogglClient.prototype.createClient = function(data, callback) {
  if (!this.validateOptions('client-create', data, callback)) {
    return
  }

  var req = {
    method: 'POST',
    body:   {
      client: data
    }
  }

  this.apiRequest('/api/v8/clients', req, utils.wrapDataCallback(callback))
}




/**
 * Delete client
 *
 * @see https://github.com/toggl/toggl_api_docs/blob/master/chapters/clients.md
 * @public
 * @param {number|string} clientId Client ID
 * @param {function} callback Accepts arguments: (err)
 */
TogglClient.prototype.deleteClient = function(clientId, callback) {
  var req = {
    method: 'DELETE'
  }

  this.apiRequest('/api/v8/clients/' + clientId, req, callback)
}




/**
 * Get client details
 *
 * @see https://github.com/toggl/toggl_api_docs/blob/master/chapters/clients.md
 * @public
 * @param {number|string} clientId Client ID
 * @param {function} callback Accepts arguments: (err, clientData)
 */
TogglClient.prototype.getClientData = function(clientId, callback) {
  this.apiRequest('/api/v8/clients/' + clientId, {}, utils.wrapDataCallback(callback))
}




/**
 * Get client projects
 *
 * @see https://github.com/toggl/toggl_api_docs/blob/master/chapters/clients.md
 * @public
 * @param {number|string} clientId Client ID
 * @param {string|boolean} active Filter projects: active (true), archived (false), both
 * @param {function} callback Accepts arguments: (err, projects)
 */
TogglClient.prototype.getClientProjects = function(clientId, active, callback) {
{'fraction_non_alphanumeric': 0.14920212765957447, 'fraction_numerical': 0.0015957446808510637, 'mean_word_length': 4.130968622100955, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4966657', 'n_tokens_mistral': 1255, 'n_tokens_neox': 1229, 'n_words': 259}