dfp-lib
Version:
This project hosts the Node.JS client library for the SOAP-based DFP API at Google.
317 lines (316 loc) • 16.3 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 dfpService_1 = require("../lib/dfpService");
const objectValue_1 = require("../soap/objectValue");
const activateCustomTargetingKeys_1 = require("../soap/activateCustomTargetingKeys");
const activateCustomTargetingValues_1 = require("../soap/activateCustomTargetingValues");
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 customTargetingError_1 = require("../soap/customTargetingError");
const customTargetingKeyAction_1 = require("../soap/customTargetingKeyAction");
const customTargetingKey_1 = require("../soap/customTargetingKey");
const customTargetingKeyPage_1 = require("../soap/customTargetingKeyPage");
const customTargetingValueAction_1 = require("../soap/customTargetingValueAction");
const customTargetingValue_1 = require("../soap/customTargetingValue");
const customTargetingValuePage_1 = require("../soap/customTargetingValuePage");
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 deleteCustomTargetingKeys_1 = require("../soap/deleteCustomTargetingKeys");
const deleteCustomTargetingValues_1 = require("../soap/deleteCustomTargetingValues");
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 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 soapRequestHeader_1 = require("../../common/soap/soapRequestHeader");
const soapResponseHeader_1 = require("../../common/soap/soapResponseHeader");
const statement_1 = require("../soap/statement");
const statementError_1 = require("../soap/statementError");
const stringValueMapEntry_1 = require("../soap/stringValueMapEntry");
const textValue_1 = require("../soap/textValue");
const typeError_1 = require("../soap/typeError");
const uniqueError_1 = require("../soap/uniqueError");
const updateResult_1 = require("../soap/updateResult");
const value_1 = require("../soap/value");
class CreateCustomTargetingKeys extends xmlElement_1.XMLElement {
constructor(keys = null) {
super();
this.keys = keys;
}
}
CreateCustomTargetingKeys.XSI_TYPE = "";
class CreateCustomTargetingKeysResponse extends xmlElement_1.XMLElement {
constructor(rval = null) {
super();
this.rval = rval;
}
}
CreateCustomTargetingKeysResponse.XSI_TYPE = "";
class CreateCustomTargetingValues extends xmlElement_1.XMLElement {
constructor(values = null) {
super();
this.values = values;
}
}
CreateCustomTargetingValues.XSI_TYPE = "";
class CreateCustomTargetingValuesResponse extends xmlElement_1.XMLElement {
constructor(rval = null) {
super();
this.rval = rval;
}
}
CreateCustomTargetingValuesResponse.XSI_TYPE = "";
class GetCustomTargetingKeysByStatement extends xmlElement_1.XMLElement {
constructor(filterStatement = null) {
super();
this.filterStatement = filterStatement;
}
}
GetCustomTargetingKeysByStatement.XSI_TYPE = "";
class GetCustomTargetingKeysByStatementResponse extends xmlElement_1.XMLElement {
constructor(rval = null) {
super();
this.rval = rval;
}
}
GetCustomTargetingKeysByStatementResponse.XSI_TYPE = "";
class GetCustomTargetingValuesByStatement extends xmlElement_1.XMLElement {
constructor(filterStatement = null) {
super();
this.filterStatement = filterStatement;
}
}
GetCustomTargetingValuesByStatement.XSI_TYPE = "";
class GetCustomTargetingValuesByStatementResponse extends xmlElement_1.XMLElement {
constructor(rval = null) {
super();
this.rval = rval;
}
}
GetCustomTargetingValuesByStatementResponse.XSI_TYPE = "";
class PerformCustomTargetingKeyAction extends xmlElement_1.XMLElement {
constructor(customTargetingKeyAction = null, filterStatement = null) {
super();
this.customTargetingKeyAction = customTargetingKeyAction;
this.filterStatement = filterStatement;
}
}
PerformCustomTargetingKeyAction.XSI_TYPE = "";
class PerformCustomTargetingKeyActionResponse extends xmlElement_1.XMLElement {
constructor(rval = null) {
super();
this.rval = rval;
}
}
PerformCustomTargetingKeyActionResponse.XSI_TYPE = "";
class PerformCustomTargetingValueAction extends xmlElement_1.XMLElement {
constructor(customTargetingValueAction = null, filterStatement = null) {
super();
this.customTargetingValueAction = customTargetingValueAction;
this.filterStatement = filterStatement;
}
}
PerformCustomTargetingValueAction.XSI_TYPE = "";
class PerformCustomTargetingValueActionResponse extends xmlElement_1.XMLElement {
constructor(rval = null) {
super();
this.rval = rval;
}
}
PerformCustomTargetingValueActionResponse.XSI_TYPE = "";
class UpdateCustomTargetingKeys extends xmlElement_1.XMLElement {
constructor(keys = null) {
super();
this.keys = keys;
}
}
UpdateCustomTargetingKeys.XSI_TYPE = "";
class UpdateCustomTargetingKeysResponse extends xmlElement_1.XMLElement {
constructor(rval = null) {
super();
this.rval = rval;
}
}
UpdateCustomTargetingKeysResponse.XSI_TYPE = "";
class UpdateCustomTargetingValues extends xmlElement_1.XMLElement {
constructor(values = null) {
super();
this.values = values;
}
}
UpdateCustomTargetingValues.XSI_TYPE = "";
class UpdateCustomTargetingValuesResponse extends xmlElement_1.XMLElement {
constructor(rval = null) {
super();
this.rval = rval;
}
}
UpdateCustomTargetingValuesResponse.XSI_TYPE = "";
class CustomTargetingService extends dfpService_1.DfpService {
constructor(user, options = {}) {
options['classmap'] = CustomTargetingService.CLASS_MAP;
super(CustomTargetingService.SERVICE_NAME, user, CustomTargetingService.ENDPOINT, options);
}
createCustomTargetingKeys(keys) {
return __awaiter(this, void 0, void 0, function* () {
const args = new CreateCustomTargetingKeys(keys);
const result = (yield this.client.__soapCall("createCustomTargetingKeys", args)).createCustomTargetingKeysResponse;
return (Array.isArray(result.rval)) ? result.rval :
(result.rval == null) ? [] : [result.rval];
});
}
createCustomTargetingValues(values) {
return __awaiter(this, void 0, void 0, function* () {
const args = new CreateCustomTargetingValues(values);
const result = (yield this.client.__soapCall("createCustomTargetingValues", args)).createCustomTargetingValuesResponse;
return (Array.isArray(result.rval)) ? result.rval :
(result.rval == null) ? [] : [result.rval];
});
}
getCustomTargetingKeysByStatement(filterStatement) {
return __awaiter(this, void 0, void 0, function* () {
const args = new GetCustomTargetingKeysByStatement(filterStatement);
const result = (yield this.client.__soapCall("getCustomTargetingKeysByStatement", args)).getCustomTargetingKeysByStatementResponse;
result.rval.results = (Array.isArray(result.rval.results)) ? result.rval.results :
(result.rval.results == null) ? [] : [result.rval.results];
return result.rval;
});
}
getCustomTargetingValuesByStatement(filterStatement) {
return __awaiter(this, void 0, void 0, function* () {
const args = new GetCustomTargetingValuesByStatement(filterStatement);
const result = (yield this.client.__soapCall("getCustomTargetingValuesByStatement", args)).getCustomTargetingValuesByStatementResponse;
result.rval.results = (Array.isArray(result.rval.results)) ? result.rval.results :
(result.rval.results == null) ? [] : [result.rval.results];
return result.rval;
});
}
performCustomTargetingKeyAction(customTargetingKeyAction, filterStatement) {
return __awaiter(this, void 0, void 0, function* () {
const args = new PerformCustomTargetingKeyAction(customTargetingKeyAction, filterStatement);
const result = (yield this.client.__soapCall("performCustomTargetingKeyAction", args)).performCustomTargetingKeyActionResponse;
return result.rval;
});
}
performCustomTargetingValueAction(customTargetingValueAction, filterStatement) {
return __awaiter(this, void 0, void 0, function* () {
const args = new PerformCustomTargetingValueAction(customTargetingValueAction, filterStatement);
const result = (yield this.client.__soapCall("performCustomTargetingValueAction", args)).performCustomTargetingValueActionResponse;
return result.rval;
});
}
updateCustomTargetingKeys(keys) {
return __awaiter(this, void 0, void 0, function* () {
const args = new UpdateCustomTargetingKeys(keys);
const result = (yield this.client.__soapCall("updateCustomTargetingKeys", args)).updateCustomTargetingKeysResponse;
return (Array.isArray(result.rval)) ? result.rval :
(result.rval == null) ? [] : [result.rval];
});
}
updateCustomTargetingValues(values) {
return __awaiter(this, void 0, void 0, function* () {
const args = new UpdateCustomTargetingValues(values);
const result = (yield this.client.__soapCall("updateCustomTargetingValues", args)).updateCustomTargetingValuesResponse;
return (Array.isArray(result.rval)) ? result.rval :
(result.rval == null) ? [] : [result.rval];
});
}
}
CustomTargetingService.SERVICE_NAME = "CustomTargetingService";
CustomTargetingService.ENDPOINT = "https://ads.google.com/apis/ads/publisher/v201611/CustomTargetingService";
CustomTargetingService.CLASS_MAP = {
"ObjectValue": objectValue_1.ObjectValue,
"ActivateCustomTargetingKeys": activateCustomTargetingKeys_1.ActivateCustomTargetingKeys,
"ActivateCustomTargetingValues": activateCustomTargetingValues_1.ActivateCustomTargetingValues,
"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,
"CustomTargetingError": customTargetingError_1.CustomTargetingError,
"CustomTargetingKeyAction": customTargetingKeyAction_1.CustomTargetingKeyAction,
"CustomTargetingKey": customTargetingKey_1.CustomTargetingKey,
"CustomTargetingKeyPage": customTargetingKeyPage_1.CustomTargetingKeyPage,
"CustomTargetingValueAction": customTargetingValueAction_1.CustomTargetingValueAction,
"CustomTargetingValue": customTargetingValue_1.CustomTargetingValue,
"CustomTargetingValuePage": customTargetingValuePage_1.CustomTargetingValuePage,
"Date": dfpDate_1.DfpDate,
"DateTime": dfpDateTime_1.DfpDateTime,
"DateTimeValue": dateTimeValue_1.DateTimeValue,
"DateValue": dateValue_1.DateValue,
"DeleteCustomTargetingKeys": deleteCustomTargetingKeys_1.DeleteCustomTargetingKeys,
"DeleteCustomTargetingValues": deleteCustomTargetingValues_1.DeleteCustomTargetingValues,
"EntityChildrenLimitReachedError": entityChildrenLimitReachedError_1.EntityChildrenLimitReachedError,
"EntityLimitReachedError": entityLimitReachedError_1.EntityLimitReachedError,
"FeatureError": featureError_1.FeatureError,
"InternalApiError": internalApiError_1.InternalApiError,
"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,
"String_ValueMapEntry": stringValueMapEntry_1.StringValueMapEntry,
"TextValue": textValue_1.TextValue,
"TypeError": typeError_1.TypeError,
"UniqueError": uniqueError_1.UniqueError,
"UpdateResult": updateResult_1.UpdateResult,
"Value": value_1.Value,
"createCustomTargetingKeys": CreateCustomTargetingKeys,
"createCustomTargetingKeysResponse": CreateCustomTargetingKeysResponse,
"createCustomTargetingValues": CreateCustomTargetingValues,
"createCustomTargetingValuesResponse": CreateCustomTargetingValuesResponse,
"getCustomTargetingKeysByStatement": GetCustomTargetingKeysByStatement,
"getCustomTargetingKeysByStatementResponse": GetCustomTargetingKeysByStatementResponse,
"getCustomTargetingValuesByStatement": GetCustomTargetingValuesByStatement,
"getCustomTargetingValuesByStatementResponse": GetCustomTargetingValuesByStatementResponse,
"performCustomTargetingKeyAction": PerformCustomTargetingKeyAction,
"performCustomTargetingKeyActionResponse": PerformCustomTargetingKeyActionResponse,
"performCustomTargetingValueAction": PerformCustomTargetingValueAction,
"performCustomTargetingValueActionResponse": PerformCustomTargetingValueActionResponse,
"updateCustomTargetingKeys": UpdateCustomTargetingKeys,
"updateCustomTargetingKeysResponse": UpdateCustomTargetingKeysResponse,
"updateCustomTargetingValues": UpdateCustomTargetingValues,
"updateCustomTargetingValuesResponse": UpdateCustomTargetingValuesResponse,
};
exports.CustomTargetingService = CustomTargetingService;