"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ChannelSyncsCommand = void 0;
const tslib_1 = require("tslib");
const core_utils_1 = require("../../core-utils");
const requests_1 = require("../requests");
const shared_1 = require("../shared");
class ChannelSyncsCommand extends shared_1.AbstractCommand {
    listByAccount(options) {
        const { accountName, sort = 'createdAt' } = options;
        const path = `/api/v1/accounts/${accountName}/video-channel-syncs`;
        return this.getRequestBody(Object.assign(Object.assign({}, options), { path, query: Object.assign({ sort }, (0, core_utils_1.pick)(options, ['start', 'count'])), implicitToken: true, defaultExpectedStatus: 200 }));
    }
    create(options) {
        return tslib_1.__awaiter(this, void 0, void 0, function* () {
            return (0, requests_1.unwrapBody)(this.postBodyRequest(Object.assign(Object.assign({}, options), { path: ChannelSyncsCommand.API_PATH, fields: options.attributes, implicitToken: true, defaultExpectedStatus: 200 })));
        });
    }
    delete(options) {
        const path = `${ChannelSyncsCommand.API_PATH}/${options.channelSyncId}`;
        return this.deleteRequest(Object.assign(Object.assign({}, options), { path, implicitToken: true, defaultExpectedStatus: 204 }));
    }
}
exports.ChannelSyncsCommand = ChannelSyncsCommand;
ChannelSyncsCommand.API_PATH = '/api/v1/video-channel-syncs';
//# sourceMappingURL=channel-syncs-command.js.map