<commit_before>import {
  TimeEntriesPagenationParameters,
  TimeEntry
} from '../models/timeEntries.models';

// Admin permissions required.
export class TimeEntriesAPI {
  harvest;
  baseUrl: string;

  constructor(harvest) {
    this.baseUrl = '/v2/time_entries';
    this.harvest = harvest;
  }

  public get(id) {
    return this.harvest.request('GET', `${this.baseUrl}/${id}`);
  }

  public list(query: TimeEntriesPagenationParameters = {}) {
    return this.harvest.request('GET', this.baseUrl, query);
  }

  public create(data: TimeEntry) {
    return this.harvest.request('POST', this.baseUrl, data);
  }

  public update(id, data) {
    return this.harvest.request('PATCH', `${this.baseUrl}/${id}`, data);
  }

  public delete(id) {
    return this.harvest.request('DELETE', `${this.baseUrl}/${id}`);
  }

  // Restarting a time entry is only possible if it isn’t currently running.
  // Returns a 200 OK response code if the call succeeded.
  public restart(id) {
    return this.harvest.request('PATCH', `${this.baseUrl}/${id}/restart`);
  }

  // Stopping a time entry is only possible if it’s currently running.
  // Returns a 200 OK response code if the call succeeded.
  public stop(id) {
    return this.harvest.request('PATCH', `${this.baseUrl}/${id}/stop`);
  }
}
<commit_msg>Use creation interfaces for parameter<commit_after>import {
  TimeEntriesPagenationParameters,
  TimeEntry,
  TimeEntryCreateFromDuration,
  TimeEntryCreateFromStartAndEndTime
} from '../models/timeEntries.models';

// Admin permissions required.
export class TimeEntriesAPI {
  harvest;
  baseUrl: string;

  constructor(harvest) {
    this.baseUrl = '/v2/time_entries';
    this.harvest = harvest;
  }

  public get(id) {
    return this.harvest.request('GET', `${this.baseUrl}/${id}`);
  }

  public list(query: TimeEntriesPagenationParameters = {}) {
    return this.harvest.request('GET', this.baseUrl, query);
  }

  public create(data: TimeEntryCreateFromDuration | TimeEntryCreateFromStartAndEndTime) {
    return this.harvest.request('POST', this.baseUrl, data);
  }

  public update(id, data) {
    return this.harvest.request('PATCH', `${this.baseUrl}/${id}`, data);
  }

  public delete(id) {
    return this.harvest.request('DELETE', `${this.baseUrl}/${id}`);
  }

  // Restarting a time entry is only possible if it isn’t currently running.
  // Returns a 200 OK response code if the call succeeded.
  public restart(id) {
    return this.harvest.request('PATCH', `${this.baseUrl}/${id}/restart`);
  }

  // Stopping a time entry is only possible if it’s currently running.
  // Returns a 200 OK response code if the call succeeded.
  public stop(id) {
    return this.harvest.request('PATCH', `${this.baseUrl}/${id}/stop`);
  }
}

{'fraction_non_alphanumeric': 0.1447848285922684, 'fraction_numerical': 0.005105762217359592, 'mean_word_length': 3.837742504409171, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '5411852', 'n_tokens_mistral': 883, 'n_tokens_neox': 875, 'n_words': 213}