UNPKG

emailengine-client

Version:

A TypeScript client for the EmailEngine API

44 lines 2.3 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.LicenseApi = void 0; const helpers_1 = require("../../../misc/helpers"); const RegisterLicenseOptions_1 = require("./models/RegisterLicenseOptions"); const GetLicenseInfoOptions_1 = require("./models/GetLicenseInfoOptions"); const RemoveLicenseOptions_1 = require("./models/RemoveLicenseOptions"); class LicenseApi { constructor(client) { this.axiosInstance = client.axios; } registerLicense(options) { return __awaiter(this, void 0, void 0, function* () { options = new RegisterLicenseOptions_1.RegisterLicenseOptions(options); const response = yield this.axiosInstance.post(`/v1/license`, options.body, (0, helpers_1.setupAxiosRequestConfig)(options)); return response.data; }); } getLicenseInformation(options) { return __awaiter(this, void 0, void 0, function* () { options = new GetLicenseInfoOptions_1.GetLicenseInfoOptions(options); const response = yield this.axiosInstance.get(`/v1/license`, (0, helpers_1.setupAxiosRequestConfig)(options)); return response.data; }); } removeLicense(options) { return __awaiter(this, void 0, void 0, function* () { options = new RemoveLicenseOptions_1.RemoveLicenseOptions(options); const response = yield this.axiosInstance.delete(`/v1/license`, (0, helpers_1.setupAxiosRequestConfig)(options)); return response.data; }); } } exports.LicenseApi = LicenseApi; //# sourceMappingURL=api.js.map