UNPKG

@ingestkorea/client-sens

Version:

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

49 lines (48 loc) 2.35 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_ListSMSStatusCommand = exports.se_ListSMSStatusCommand = void 0; const util_http_handler_1 = require("@ingestkorea/util-http-handler"); const constants_js_1 = require("./constants.js"); const GetSMSStatus_js_1 = require("./GetSMSStatus.js"); const se_ListSMSStatusCommand = (input, config) => __awaiter(void 0, void 0, void 0, function* () { const hostname = "sens.apigw.ntruss.com"; const path = "/sms/v2/services/" + config.serviceId.sms + "/messages"; const headers = { host: hostname, }; const query = Object.entries(input).reduce((acc, [key, value]) => { if (value !== undefined && value !== null) { acc[key] = String(value); } return acc; }, {}); return new util_http_handler_1.HttpRequest({ protocol: "https:", method: "GET", hostname, path, query, headers, }); }); exports.se_ListSMSStatusCommand = se_ListSMSStatusCommand; const de_ListSMSStatusCommand = (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_ListSMSStatusResult(data); return Object.assign({ $metadata: (0, constants_js_1.deserializeMetadata)(response) }, (0, constants_js_1.compact)(contents)); }); exports.de_ListSMSStatusCommand = de_ListSMSStatusCommand; const de_ListSMSStatusResult = (output) => { return (0, GetSMSStatus_js_1.de_GetSMSStatusResult)(output); };