UNPKG

@niur/google-admanager-api

Version:
27 lines 1.01 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.AdManagerClient = void 0; const constants_1 = require("../common/constants"); const googleSoap_service_1 = require("./googleSoap.service"); class AdManagerClient { constructor(networkCode, credential, applicationName) { this.networkCode = networkCode; this.credential = credential; this.applicationName = applicationName || constants_1.DEFAULT_APPLICATION_NAME; } async getService(serviceName) { try { const token = await this.credential.getToken(); return await new googleSoap_service_1.GoogleSoapService(serviceName, { networkCode: this.networkCode, token: token, applicationName: this.applicationName, }).createClient(); } catch (err) { throw new Error(err); } } } exports.AdManagerClient = AdManagerClient; //# sourceMappingURL=adManager.client.js.map