@ingestkorea/client-sens
Version:
INGESTKOREA SDK Naver Cloud Platform SENS Client for Node.js.
61 lines (60 loc) • 3.82 kB
JavaScript
;
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.deserializeIngestkorea_restJson_Channel = exports.deserializeIngestkorea_restJson_ListAlimtalkChannelsOutput = exports.deserializeIngestkorea_restJson_ListAlimtalkChannelsCommand = exports.serializeIngestkorea_restJson_ListAlimtalkChannelsCommand = void 0;
const util_http_handler_1 = require("@ingestkorea/util-http-handler");
const constants_1 = require("./constants");
const serializeIngestkorea_restJson_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.serializeIngestkorea_restJson_ListAlimtalkChannelsCommand = serializeIngestkorea_restJson_ListAlimtalkChannelsCommand;
const deserializeIngestkorea_restJson_ListAlimtalkChannelsCommand = (response) => __awaiter(void 0, void 0, void 0, function* () {
const { response: httpResponse, output } = response;
if (httpResponse.statusCode > 300)
yield (0, constants_1.parseErrorBody)(httpResponse);
const data = yield (0, constants_1.parseBody)(httpResponse); // ListAlimtalkChannelsOutput
let contents = {};
contents = yield (0, exports.deserializeIngestkorea_restJson_ListAlimtalkChannelsOutput)(data);
return Object.assign({ $metadata: Object.assign(Object.assign({}, (0, constants_1.deserializeMetadata)(httpResponse)), output.$metadata) }, contents);
});
exports.deserializeIngestkorea_restJson_ListAlimtalkChannelsCommand = deserializeIngestkorea_restJson_ListAlimtalkChannelsCommand;
const deserializeIngestkorea_restJson_ListAlimtalkChannelsOutput = (outputs) => __awaiter(void 0, void 0, void 0, function* () {
return {
channels: (0, exports.deserializeIngestkorea_restJson_Channel)(outputs),
};
});
exports.deserializeIngestkorea_restJson_ListAlimtalkChannelsOutput = deserializeIngestkorea_restJson_ListAlimtalkChannelsOutput;
const deserializeIngestkorea_restJson_Channel = (outputs) => {
const result = outputs.map((output) => {
return {
createTime: output.createTime != undefined ? output.createTime : undefined,
updateTime: output.updateTime != undefined ? 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,
};
});
return result;
};
exports.deserializeIngestkorea_restJson_Channel = deserializeIngestkorea_restJson_Channel;