"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.searchChannelsV2 = searchChannelsV2;
exports.createChannelV2 = createChannelV2;
exports.fetchChannelV2 = fetchChannelV2;
exports.updateChannelV2 = updateChannelV2;
exports.removeChannelV2 = removeChannelV2;
exports.fetchChannelNotifcationOptOutV2 = fetchChannelNotifcationOptOutV2;
exports.createChannelNotificationOptOutV2 = createChannelNotificationOptOutV2;
exports.removeChannelNotificationOptOutV2 = removeChannelNotificationOptOutV2;
exports.removeChannelActivityV2 = removeChannelActivityV2;
/* tslint:disable unified-signatures */
const discussions_api_request_1 = require("../discussions-api-request");
/**
 * Search for Channels in the Discussions API.  Channels define the capabilities,
 * permissions, and configuration for Discussion posts.
 *
 * @export
 * @param {ISearchChannelsParams} options
 * @return {*}  {Promise<IPagedResponse<IChannel>>}
 */
function searchChannelsV2(options) {
    options.httpMethod = "GET";
    return (0, discussions_api_request_1.discussionsApiRequestV2)(`/channels`, options);
}
/**
 * create channel v2
 *
 * @export
 * @param {ICreateChannelParamsV2} options
 * @return {*}  {Promise<IChannel>}
 */
function createChannelV2(options) {
    options.httpMethod = "POST";
    return (0, discussions_api_request_1.discussionsApiRequestV2)(`/channels`, options);
}
/**
 * fetch channel V2
 *
 * @export
 * @param {IFetchChannelParams} options
 * @return {*}  {Promise<IChannel>}
 */
function fetchChannelV2(options) {
    options.httpMethod = "GET";
    return (0, discussions_api_request_1.discussionsApiRequestV2)(`/channels/${options.channelId}`, options);
}
/**
 * update channel V2
 *
 * @export
 * @param {IUpdateChannelParamsV2} options
 * @return {*}  {Promise<IChannel>}
 */
function updateChannelV2(options) {
    options.httpMethod = "PATCH";
    return (0, discussions_api_request_1.discussionsApiRequestV2)(`/channels/${options.channelId}`, options);
}
/**
 * remove channel V2
 *
 * @export
 * @param {IRemoveChannelParams} options
 * @return {*}
 */
function removeChannelV2(options) {
    options.httpMethod = "DELETE";
    return (0, discussions_api_request_1.discussionsApiRequestV2)(`/channels/${options.channelId}`, options);
}
/**
 * get channel opt out status V2
 *
 * @export
 * @param {IFetchChannelNotificationOptOutParams} options
 * @return {*}
 */
function fetchChannelNotifcationOptOutV2(options) {
    options.httpMethod = "GET";
    return (0, discussions_api_request_1.discussionsApiRequestV2)(`/channels/${options.channelId}/notifications/opt-out`, options);
}
/**
 * opt out of channel notifs V2
 *
 * @export
 * @param {ICreateChannelNotificationOptOutParams} options
 * @return {*}
 */
function createChannelNotificationOptOutV2(options) {
    options.httpMethod = "POST";
    return (0, discussions_api_request_1.discussionsApiRequestV2)(`/channels/${options.channelId}/notifications/opt-out`, options);
}
/**
 * remove channel notifs V2
 *
 * @export
 * @param {IRemoveChannelNotificationOptOutParams} options
 * @return {*}
 */
function removeChannelNotificationOptOutV2(options) {
    options.httpMethod = "DELETE";
    return (0, discussions_api_request_1.discussionsApiRequestV2)(`/channels/${options.channelId}/notifications/opt-out`, options);
}
/**
 * remove all posts in a channel V2
 *
 * @export
 * @param {IRemoveChannelActivityParams} options
 * @return {*}
 */
function removeChannelActivityV2(options) {
    options.httpMethod = "DELETE";
    return (0, discussions_api_request_1.discussionsApiRequestV2)(`/channels/${options.channelId}/activity`, options);
}
//# sourceMappingURL=channels.js.map