@ingestkorea/client-sens
Version:
INGESTKOREA SDK Naver Cloud Platform SENS Client for Node.js.
46 lines (45 loc) • 3.63 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_ListAlimtalkStatusOutput = exports.deserializeIngestkorea_restJson_ListAlimtalkStatusCommand = exports.serializeIngestkorea_restJson_ListAlimtalkStatusCommand = void 0;
const util_http_handler_1 = require("@ingestkorea/util-http-handler");
const _1 = require("./");
const serializeIngestkorea_restJson_ListAlimtalkStatusCommand = (input, config) => __awaiter(void 0, void 0, void 0, function* () {
const hostname = "sens.apigw.ntruss.com";
const path = "/alimtalk/v2/services/" + config.serviceId.kakao + "/messages";
const headers = {
host: hostname,
};
const query = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ plusFriendId: input.plusFriendId }, (input.requestId && { requestId: input.requestId })), (input.messageId && { messageId: input.messageId })), (input.requestStatusName && { requestStatusName: input.requestStatusName })), (input.messageStatusName && { messageStatusName: input.messageStatusName })), (input.templateCode && { templateCode: input.templateCode })), (input.to && { to: input.to.replace(/\-/gi, "") })), (input.requestStartTime && { requestStartTime: input.requestStartTime })), (input.requestEndTime && { requestEndTime: input.requestEndTime })), (input.pageIndex != null && { pageIndex: input.pageIndex.toString() })), (input.pageSize && { pageSize: input.pageSize.toString() }));
return new util_http_handler_1.HttpRequest({
protocol: "https:",
method: "GET",
hostname: hostname,
path: path,
headers: headers,
query: query,
});
});
exports.serializeIngestkorea_restJson_ListAlimtalkStatusCommand = serializeIngestkorea_restJson_ListAlimtalkStatusCommand;
const deserializeIngestkorea_restJson_ListAlimtalkStatusCommand = (response) => __awaiter(void 0, void 0, void 0, function* () {
const { response: httpResponse, output } = response;
if (httpResponse.statusCode > 300)
yield (0, _1.parseErrorBody)(httpResponse);
const data = yield (0, _1.parseBody)(httpResponse);
let contents = {};
contents = yield (0, exports.deserializeIngestkorea_restJson_ListAlimtalkStatusOutput)(data);
return Object.assign({ $metadata: Object.assign(Object.assign({}, (0, _1.deserializeMetadata)(httpResponse)), output.$metadata) }, contents);
});
exports.deserializeIngestkorea_restJson_ListAlimtalkStatusCommand = deserializeIngestkorea_restJson_ListAlimtalkStatusCommand;
const deserializeIngestkorea_restJson_ListAlimtalkStatusOutput = (output) => __awaiter(void 0, void 0, void 0, function* () {
return (0, _1.deserializeIngestkorea_restJson_GetAlimtalkStatusOutput)(output);
});
exports.deserializeIngestkorea_restJson_ListAlimtalkStatusOutput = deserializeIngestkorea_restJson_ListAlimtalkStatusOutput;