UNPKG

@ingestkorea/client-sens

Version:

INGESTKOREA SDK Naver Cloud Platform SENS Client for Node.js.

57 lines (56 loc) 3.09 kB
"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.de_ListAlimtalkChannelsCommand = exports.se_ListAlimtalkChannelsCommand = void 0; const util_http_handler_1 = require("@ingestkorea/util-http-handler"); const constants_js_1 = require("./constants.js"); const se_ListAlimtalkChannelsCommand = (input, config) => __awaiter(void 0, void 0, void 0, function* () { const hostname = "sens.apigw.ntruss.com"; const path = "/alimtalk/v2/services/" + config.serviceId.kakao + "/channels"; const headers = { host: hostname, }; return new util_http_handler_1.HttpRequest({ protocol: "https:", method: "GET", hostname: hostname, path: path, headers: headers, }); }); exports.se_ListAlimtalkChannelsCommand = se_ListAlimtalkChannelsCommand; const de_ListAlimtalkChannelsCommand = (response, config) => __awaiter(void 0, void 0, void 0, function* () { if (response.statusCode >= 300) yield (0, constants_js_1.parseErrorBody)(response); const data = yield (0, constants_js_1.parseBody)(response); const contents = de_ListAlimtalkChannelsResult(data); return Object.assign({ $metadata: (0, constants_js_1.deserializeMetadata)(response) }, (0, constants_js_1.compact)(contents)); }); exports.de_ListAlimtalkChannelsCommand = de_ListAlimtalkChannelsCommand; const de_ListAlimtalkChannelsResult = (output) => { return { channels: output.channels ? de_AlimtalkChannelList(output.channels) : [], }; }; const de_AlimtalkChannelList = (output) => { return (output || []).filter((e) => e != null).map((entry) => de_AlimtalkChannel(entry)); }; const de_AlimtalkChannel = (output) => { return { createTime: output.createTime != undefined ? (0, constants_js_1.convertToUtc)(output.createTime) : undefined, updateTime: output.updateTime != undefined ? (0, constants_js_1.convertToUtc)(output.updateTime) : undefined, serviceId: output.serviceId != undefined ? output.serviceId : undefined, channelId: output.channelId != undefined ? output.channelId : undefined, channelName: output.channelName != undefined ? output.channelName : undefined, channelStatus: output.channelStatus != undefined ? output.channelStatus : undefined, useSmsFailover: output.useSmsFailover != undefined ? output.useSmsFailover : undefined, }; };