dfp-lib
Version:
This project hosts the Node.JS client library for the SOAP-based DFP API at Google.
212 lines (211 loc) • 11.2 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 adExclusionRule_1 = require("../soap/adExclusionRule");
const updateResult_1 = require("../soap/updateResult");
const adExclusionRuleAction_1 = require("../soap/adExclusionRuleAction");
const statement_1 = require("../soap/statement");
const adExclusionRulePage_1 = require("../soap/adExclusionRulePage");
const dfpService_1 = require("../lib/dfpService");
const objectValue_1 = require("../soap/objectValue");
const activateAdExclusionRules_1 = require("../soap/activateAdExclusionRules");
const adExclusionRuleError_1 = require("../soap/adExclusionRuleError");
const adUnitTargeting_1 = require("../soap/adUnitTargeting");
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 dfpDate_1 = require("../soap/dfpDate");
const dfpDateTime_1 = require("../soap/dfpDateTime");
const dateTimeValue_1 = require("../soap/dateTimeValue");
const dateValue_1 = require("../soap/dateValue");
const deactivateAdExclusionRules_1 = require("../soap/deactivateAdExclusionRules");
const entityChildrenLimitReachedError_1 = require("../soap/entityChildrenLimitReachedError");
const entityLimitReachedError_1 = require("../soap/entityLimitReachedError");
const featureError_1 = require("../soap/featureError");
const internalApiError_1 = require("../soap/internalApiError");
const inventoryTargeting_1 = require("../soap/inventoryTargeting");
const notNullError_1 = require("../soap/notNullError");
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 soapRequestHeader_1 = require("../../common/soap/soapRequestHeader");
const soapResponseHeader_1 = require("../../common/soap/soapResponseHeader");
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 UpdateAdExclusionRulesResponse extends xmlElement_1.XMLElement {
constructor(rval = null) {
super();
this.rval = rval;
}
}
UpdateAdExclusionRulesResponse.XSI_TYPE = "";
class UpdateAdExclusionRules extends xmlElement_1.XMLElement {
constructor(adExclusionRules = null) {
super();
this.adExclusionRules = adExclusionRules;
}
}
UpdateAdExclusionRules.XSI_TYPE = "";
class PerformAdExclusionRuleActionResponse extends xmlElement_1.XMLElement {
constructor(rval = null) {
super();
this.rval = rval;
}
}
PerformAdExclusionRuleActionResponse.XSI_TYPE = "";
class PerformAdExclusionRuleAction extends xmlElement_1.XMLElement {
constructor(adExclusionRuleAction = null, filterStatement = null) {
super();
this.adExclusionRuleAction = adExclusionRuleAction;
this.filterStatement = filterStatement;
}
}
PerformAdExclusionRuleAction.XSI_TYPE = "";
class GetAdExclusionRulesByStatementResponse extends xmlElement_1.XMLElement {
constructor(rval = null) {
super();
this.rval = rval;
}
}
GetAdExclusionRulesByStatementResponse.XSI_TYPE = "";
class GetAdExclusionRulesByStatement extends xmlElement_1.XMLElement {
constructor(filterStatement = null) {
super();
this.filterStatement = filterStatement;
}
}
GetAdExclusionRulesByStatement.XSI_TYPE = "";
class CreateAdExclusionRulesResponse extends xmlElement_1.XMLElement {
constructor(rval = null) {
super();
this.rval = rval;
}
}
CreateAdExclusionRulesResponse.XSI_TYPE = "";
class CreateAdExclusionRules extends xmlElement_1.XMLElement {
constructor(adExclusionRules = null) {
super();
this.adExclusionRules = adExclusionRules;
}
}
CreateAdExclusionRules.XSI_TYPE = "";
class AdExclusionRuleService extends dfpService_1.DfpService {
constructor(user, options = {}) {
options['classmap'] = AdExclusionRuleService.CLASS_MAP;
super(AdExclusionRuleService.SERVICE_NAME, user, AdExclusionRuleService.ENDPOINT, options);
}
createAdExclusionRules(adExclusionRules) {
return __awaiter(this, void 0, void 0, function* () {
const args = new CreateAdExclusionRules(adExclusionRules);
const result = (yield this.client.__soapCall("createAdExclusionRules", args)).createAdExclusionRulesResponse;
return (Array.isArray(result.rval)) ? result.rval :
(result.rval == null) ? [] : [result.rval];
});
}
getAdExclusionRulesByStatement(filterStatement) {
return __awaiter(this, void 0, void 0, function* () {
const args = new GetAdExclusionRulesByStatement(filterStatement);
const result = (yield this.client.__soapCall("getAdExclusionRulesByStatement", args)).getAdExclusionRulesByStatementResponse;
result.rval.results = (Array.isArray(result.rval.results)) ? result.rval.results :
(result.rval.results == null) ? [] : [result.rval.results];
return result.rval;
});
}
performAdExclusionRuleAction(adExclusionRuleAction, filterStatement) {
return __awaiter(this, void 0, void 0, function* () {
const args = new PerformAdExclusionRuleAction(adExclusionRuleAction, filterStatement);
const result = (yield this.client.__soapCall("performAdExclusionRuleAction", args)).performAdExclusionRuleActionResponse;
return result.rval;
});
}
updateAdExclusionRules(adExclusionRules) {
return __awaiter(this, void 0, void 0, function* () {
const args = new UpdateAdExclusionRules(adExclusionRules);
const result = (yield this.client.__soapCall("updateAdExclusionRules", args)).updateAdExclusionRulesResponse;
return (Array.isArray(result.rval)) ? result.rval :
(result.rval == null) ? [] : [result.rval];
});
}
}
AdExclusionRuleService.SERVICE_NAME = "AdExclusionRuleService";
AdExclusionRuleService.ENDPOINT = "https://ads.google.com/apis/ads/publisher/v201611/AdExclusionRuleService";
AdExclusionRuleService.CLASS_MAP = {
"ObjectValue": objectValue_1.ObjectValue,
"ActivateAdExclusionRules": activateAdExclusionRules_1.ActivateAdExclusionRules,
"AdExclusionRuleAction": adExclusionRuleAction_1.AdExclusionRuleAction,
"AdExclusionRule": adExclusionRule_1.AdExclusionRule,
"AdExclusionRuleError": adExclusionRuleError_1.AdExclusionRuleError,
"AdExclusionRulePage": adExclusionRulePage_1.AdExclusionRulePage,
"AdUnitTargeting": adUnitTargeting_1.AdUnitTargeting,
"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": dfpDate_1.DfpDate,
"DateTime": dfpDateTime_1.DfpDateTime,
"DateTimeValue": dateTimeValue_1.DateTimeValue,
"DateValue": dateValue_1.DateValue,
"DeactivateAdExclusionRules": deactivateAdExclusionRules_1.DeactivateAdExclusionRules,
"EntityChildrenLimitReachedError": entityChildrenLimitReachedError_1.EntityChildrenLimitReachedError,
"EntityLimitReachedError": entityLimitReachedError_1.EntityLimitReachedError,
"FeatureError": featureError_1.FeatureError,
"InternalApiError": internalApiError_1.InternalApiError,
"InventoryTargeting": inventoryTargeting_1.InventoryTargeting,
"NotNullError": notNullError_1.NotNullError,
"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,
"createAdExclusionRules": CreateAdExclusionRules,
"createAdExclusionRulesResponse": CreateAdExclusionRulesResponse,
"getAdExclusionRulesByStatement": GetAdExclusionRulesByStatement,
"getAdExclusionRulesByStatementResponse": GetAdExclusionRulesByStatementResponse,
"performAdExclusionRuleAction": PerformAdExclusionRuleAction,
"performAdExclusionRuleActionResponse": PerformAdExclusionRuleActionResponse,
"updateAdExclusionRules": UpdateAdExclusionRules,
"updateAdExclusionRulesResponse": UpdateAdExclusionRulesResponse,
};
exports.AdExclusionRuleService = AdExclusionRuleService;