dfp-lib
Version:
This project hosts the Node.JS client library for the SOAP-based DFP API at Google.
207 lines (206 loc) • 11 kB
JavaScript
;
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
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) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
const xmlElement_1 = require("../../common/soap/xmlElement");
const soapRequestHeader_1 = require("../../common/soap/soapRequestHeader");
const soapResponseHeader_1 = require("../../common/soap/soapResponseHeader");
const mobileApplicationAction_1 = require("../soap/mobileApplicationAction");
const mobileApplicationActionError_1 = require("../soap/mobileApplicationActionError");
const mobileApplication_1 = require("../soap/mobileApplication");
const mobileApplicationError_1 = require("../soap/mobileApplicationError");
const mobileApplicationPage_1 = require("../soap/mobileApplicationPage");
const archiveMobileApplications_1 = require("../soap/archiveMobileApplications");
const unarchiveMobileApplications_1 = require("../soap/unarchiveMobileApplications");
const statement_1 = require("../soap/statement");
const updateResult_1 = require("../soap/updateResult");
const dfpService_1 = require("../lib/dfpService");
const objectValue_1 = require("../soap/objectValue");
const apiError_1 = require("../soap/apiError");
const apiException_1 = require("../soap/apiException");
const apiVersionError_1 = require("../soap/apiVersionError");
const applicationException_1 = require("../soap/applicationException");
const authenticationError_1 = require("../soap/authenticationError");
const booleanValue_1 = require("../soap/booleanValue");
const collectionSizeError_1 = require("../soap/collectionSizeError");
const commonError_1 = require("../soap/commonError");
const dfpDateTime_1 = require("../soap/dfpDateTime");
const dateTimeValue_1 = require("../soap/dateTimeValue");
const dateValue_1 = require("../soap/dateValue");
const featureError_1 = require("../soap/featureError");
const internalApiError_1 = require("../soap/internalApiError");
const notNullError_1 = require("../soap/notNullError");
const nullError_1 = require("../soap/nullError");
const numberValue_1 = require("../soap/numberValue");
const parseError_1 = require("../soap/parseError");
const permissionError_1 = require("../soap/permissionError");
const publisherQueryLanguageContextError_1 = require("../soap/publisherQueryLanguageContextError");
const publisherQueryLanguageSyntaxError_1 = require("../soap/publisherQueryLanguageSyntaxError");
const quotaError_1 = require("../soap/quotaError");
const requiredCollectionError_1 = require("../soap/requiredCollectionError");
const requiredError_1 = require("../soap/requiredError");
const serverError_1 = require("../soap/serverError");
const setValue_1 = require("../soap/setValue");
const statementError_1 = require("../soap/statementError");
const stringLengthError_1 = require("../soap/stringLengthError");
const stringValueMapEntry_1 = require("../soap/stringValueMapEntry");
const textValue_1 = require("../soap/textValue");
const uniqueError_1 = require("../soap/uniqueError");
const value_1 = require("../soap/value");
class CreateMobileApplications extends xmlElement_1.XMLElement {
constructor(mobileApplications = null) {
super();
this.mobileApplications = mobileApplications;
}
}
CreateMobileApplications.XSI_TYPE = "";
class CreateMobileApplicationsResponse extends xmlElement_1.XMLElement {
constructor(rval = null) {
super();
this.rval = rval;
}
}
CreateMobileApplicationsResponse.XSI_TYPE = "";
class GetMobileApplicationsByStatement extends xmlElement_1.XMLElement {
constructor(filterStatement = null) {
super();
this.filterStatement = filterStatement;
}
}
GetMobileApplicationsByStatement.XSI_TYPE = "";
class GetMobileApplicationsByStatementResponse extends xmlElement_1.XMLElement {
constructor(rval = null) {
super();
this.rval = rval;
}
}
GetMobileApplicationsByStatementResponse.XSI_TYPE = "";
class PerformMobileApplicationAction extends xmlElement_1.XMLElement {
constructor(mobileApplicationAction = null, filterStatement = null) {
super();
this.mobileApplicationAction = mobileApplicationAction;
this.filterStatement = filterStatement;
}
}
PerformMobileApplicationAction.XSI_TYPE = "";
class PerformMobileApplicationActionResponse extends xmlElement_1.XMLElement {
constructor(rval = null) {
super();
this.rval = rval;
}
}
PerformMobileApplicationActionResponse.XSI_TYPE = "";
class UpdateMobileApplications extends xmlElement_1.XMLElement {
constructor(mobileApplications = null) {
super();
this.mobileApplications = mobileApplications;
}
}
UpdateMobileApplications.XSI_TYPE = "";
class UpdateMobileApplicationsResponse extends xmlElement_1.XMLElement {
constructor(rval = null) {
super();
this.rval = rval;
}
}
UpdateMobileApplicationsResponse.XSI_TYPE = "";
class MobileApplicationService extends dfpService_1.DfpService {
constructor(user, options = {}) {
options['classmap'] = MobileApplicationService.CLASS_MAP;
super(MobileApplicationService.SERVICE_NAME, user, MobileApplicationService.ENDPOINT, options);
}
createMobileApplications(mobileApplications) {
return __awaiter(this, void 0, void 0, function* () {
const args = new CreateMobileApplications(mobileApplications);
const result = (yield this.client.__soapCall("createMobileApplications", args)).createMobileApplicationsResponse;
return (Array.isArray(result.rval)) ? result.rval :
(result.rval == null) ? [] : [result.rval];
});
}
getMobileApplicationsByStatement(filterStatement) {
return __awaiter(this, void 0, void 0, function* () {
const args = new GetMobileApplicationsByStatement(filterStatement);
const result = (yield this.client.__soapCall("getMobileApplicationsByStatement", args)).getMobileApplicationsByStatementResponse;
result.rval.results = (Array.isArray(result.rval.results)) ? result.rval.results :
(result.rval.results == null) ? [] : [result.rval.results];
return result.rval;
});
}
performMobileApplicationAction(mobileApplicationAction, filterStatement) {
return __awaiter(this, void 0, void 0, function* () {
const args = new PerformMobileApplicationAction(mobileApplicationAction, filterStatement);
const result = (yield this.client.__soapCall("performMobileApplicationAction", args)).performMobileApplicationActionResponse;
return result.rval;
});
}
updateMobileApplications(mobileApplications) {
return __awaiter(this, void 0, void 0, function* () {
const args = new UpdateMobileApplications(mobileApplications);
const result = (yield this.client.__soapCall("updateMobileApplications", args)).updateMobileApplicationsResponse;
return (Array.isArray(result.rval)) ? result.rval :
(result.rval == null) ? [] : [result.rval];
});
}
}
MobileApplicationService.SERVICE_NAME = "MobileApplicationService";
MobileApplicationService.ENDPOINT = "https://ads.google.com/apis/ads/publisher/v201611/MobileApplicationService";
MobileApplicationService.CLASS_MAP = {
"ObjectValue": objectValue_1.ObjectValue,
"UnarchiveMobileApplications": unarchiveMobileApplications_1.UnarchiveMobileApplications,
"ApiError": apiError_1.ApiError,
"ApiException": apiException_1.ApiException,
"ApiVersionError": apiVersionError_1.ApiVersionError,
"ApplicationException": applicationException_1.ApplicationException,
"AuthenticationError": authenticationError_1.AuthenticationError,
"BooleanValue": booleanValue_1.BooleanValue,
"CollectionSizeError": collectionSizeError_1.CollectionSizeError,
"CommonError": commonError_1.CommonError,
"Date": Date,
"DateTime": dfpDateTime_1.DfpDateTime,
"DateTimeValue": dateTimeValue_1.DateTimeValue,
"DateValue": dateValue_1.DateValue,
"ArchiveMobileApplications": archiveMobileApplications_1.ArchiveMobileApplications,
"FeatureError": featureError_1.FeatureError,
"InternalApiError": internalApiError_1.InternalApiError,
"MobileApplicationAction": mobileApplicationAction_1.MobileApplicationAction,
"MobileApplicationActionError": mobileApplicationActionError_1.MobileApplicationActionError,
"MobileApplication": mobileApplication_1.MobileApplication,
"MobileApplicationError": mobileApplicationError_1.MobileApplicationError,
"MobileApplicationPage": mobileApplicationPage_1.MobileApplicationPage,
"NotNullError": notNullError_1.NotNullError,
"NullError": nullError_1.NullError,
"NumberValue": numberValue_1.NumberValue,
"ParseError": parseError_1.ParseError,
"PermissionError": permissionError_1.PermissionError,
"PublisherQueryLanguageContextError": publisherQueryLanguageContextError_1.PublisherQueryLanguageContextError,
"PublisherQueryLanguageSyntaxError": publisherQueryLanguageSyntaxError_1.PublisherQueryLanguageSyntaxError,
"QuotaError": quotaError_1.QuotaError,
"RequiredCollectionError": requiredCollectionError_1.RequiredCollectionError,
"RequiredError": requiredError_1.RequiredError,
"ServerError": serverError_1.ServerError,
"SetValue": setValue_1.SetValue,
"SoapRequestHeader": soapRequestHeader_1.SoapRequestHeader,
"SoapResponseHeader": soapResponseHeader_1.SoapResponseHeader,
"Statement": statement_1.Statement,
"StatementError": statementError_1.StatementError,
"StringLengthError": stringLengthError_1.StringLengthError,
"String_ValueMapEntry": stringValueMapEntry_1.StringValueMapEntry,
"TextValue": textValue_1.TextValue,
"UniqueError": uniqueError_1.UniqueError,
"UpdateResult": updateResult_1.UpdateResult,
"Value": value_1.Value,
"createMobileApplications": CreateMobileApplications,
"createMobileApplicationsResponse": CreateMobileApplicationsResponse,
"getMobileApplicationsByStatement": GetMobileApplicationsByStatement,
"getMobileApplicationsByStatementResponse": GetMobileApplicationsByStatementResponse,
"performMobileApplicationAction": PerformMobileApplicationAction,
"performMobileApplicationActionResponse": PerformMobileApplicationActionResponse,
"updateMobileApplications": UpdateMobileApplications,
"updateMobileApplicationsResponse": UpdateMobileApplicationsResponse
};
exports.MobileApplicationService = MobileApplicationService;