"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.HistoryCommand = void 0;
const shared_1 = require("../shared");
class HistoryCommand extends shared_1.AbstractCommand {
    watchVideo(options) {
        const { videoId, currentTime } = options;
        const path = '/api/v1/videos/' + videoId + '/watching';
        const fields = { currentTime };
        return this.putBodyRequest(Object.assign(Object.assign({}, options), { path,
            fields, implicitToken: true, defaultExpectedStatus: 204 }));
    }
    list(options = {}) {
        const { search } = options;
        const path = '/api/v1/users/me/history/videos';
        return this.getRequestBody(Object.assign(Object.assign({}, options), { path, query: {
                search
            }, implicitToken: true, defaultExpectedStatus: 200 }));
    }
    removeElement(options) {
        const { videoId } = options;
        const path = '/api/v1/users/me/history/videos/' + videoId;
        return this.deleteRequest(Object.assign(Object.assign({}, options), { path, implicitToken: true, defaultExpectedStatus: 204 }));
    }
    removeAll(options = {}) {
        const { beforeDate } = options;
        const path = '/api/v1/users/me/history/videos/remove';
        return this.postBodyRequest(Object.assign(Object.assign({}, options), { path, fields: { beforeDate }, implicitToken: true, defaultExpectedStatus: 204 }));
    }
}
exports.HistoryCommand = HistoryCommand;
//# sourceMappingURL=history-command.js.map