UNPKG

@asposecloud/aspose-email-cloud

Version:
86 lines (82 loc) 4.05 kB
"use strict"; /* * MIT License * Copyright (c) 2018-2020 Aspose Pty Ltd * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ 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.DisposableEmailApi = void 0; const object_serializer_1 = require("../internal/object-serializer"); const request_helper_1 = require("../internal/request-helper"); /** * DisposableEmailApi operations. */ class DisposableEmailApi { constructor(configuration) { this.configuration = configuration; } /** * Check email address is disposable * @param request contains request parameters */ isDisposable(request) { return __awaiter(this, void 0, void 0, function* () { const localVarPath = this.configuration.getApiBaseUrl() + "/email/disposable/is-disposable"; const queryParameters = {}; const headerParams = {}; const formParams = {}; // verify required parameter 'request.address' is not null or undefined if (request.address === null || request.address === undefined) { throw new Error('Required parameter "request.address" was null or undefined when calling isDisposable.'); } if (request.address !== undefined) { queryParameters.address = object_serializer_1.ObjectSerializer.serialize(request.address, "string"); } // tslint:disable-next-line:prefer-const let useFormData = false; const requestOptions = { method: "GET", qs: queryParameters, headers: headerParams, uri: localVarPath, json: true, }; if (Object.keys(formParams).length) { if (useFormData) { requestOptions.formData = formParams; } else { requestOptions.form = formParams; } } const response = yield request_helper_1.invokeApiMethod(requestOptions, this.configuration); const result = object_serializer_1.ObjectSerializer.deserialize(response.body, "ValueTOfBoolean"); return Promise.resolve(result); }); } } exports.DisposableEmailApi = DisposableEmailApi; //# sourceMappingURL=disposable-email-api.js.map