dfp-lib
Version:
This project hosts the Node.JS client library for the SOAP-based DFP API at Google.
230 lines (229 loc) • 12.3 kB
JavaScript
"use strict";
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 productPackage_1 = require("../soap/productPackage");
const updateResult_1 = require("../soap/updateResult");
const productPackageAction_1 = require("../soap/productPackageAction");
const statement_1 = require("../soap/statement");
const productPackagePage_1 = require("../soap/productPackagePage");
const dfpService_1 = require("../lib/dfpService");
const objectValue_1 = require("../soap/objectValue");
const activateProductPackages_1 = require("../soap/activateProductPackages");
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 archiveProductPackages_1 = require("../soap/archiveProductPackages");
const authenticationError_1 = require("../soap/authenticationError");
const baseCustomFieldValue_1 = require("../soap/baseCustomFieldValue");
const baseRateError_1 = require("../soap/baseRateError");
const booleanValue_1 = require("../soap/booleanValue");
const collectionSizeError_1 = require("../soap/collectionSizeError");
const commonError_1 = require("../soap/commonError");
const customFieldValue_1 = require("../soap/customFieldValue");
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 deactivateProductPackages_1 = require("../soap/deactivateProductPackages");
const dropDownCustomFieldValue_1 = require("../soap/dropDownCustomFieldValue");
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 productPackageActionError_1 = require("../soap/productPackageActionError");
const productPackageItemError_1 = require("../soap/productPackageItemError");
const productPackageRateCardAssociationError_1 = require("../soap/productPackageRateCardAssociationError");
const publisherQueryLanguageContextError_1 = require("../soap/publisherQueryLanguageContextError");
const publisherQueryLanguageSyntaxError_1 = require("../soap/publisherQueryLanguageSyntaxError");
const quotaError_1 = require("../soap/quotaError");
const rangeError_1 = require("../soap/rangeError");
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 unarchiveProductPackages_1 = require("../soap/unarchiveProductPackages");
const uniqueError_1 = require("../soap/uniqueError");
const value_1 = require("../soap/value");
const rateCardError_1 = require("../soap/rateCardError");
class UpdateProductPackagesResponse extends xmlElement_1.XMLElement {
constructor(rval = null) {
super();
this.rval = rval;
}
}
UpdateProductPackagesResponse.XSI_TYPE = "";
class UpdateProductPackages extends xmlElement_1.XMLElement {
constructor(productPackages = null) {
super();
this.productPackages = productPackages;
}
}
UpdateProductPackages.XSI_TYPE = "";
class PerformProductPackageActionResponse extends xmlElement_1.XMLElement {
constructor(rval = null) {
super();
this.rval = rval;
}
}
PerformProductPackageActionResponse.XSI_TYPE = "";
class PerformProductPackageAction extends xmlElement_1.XMLElement {
constructor(action = null, statement = null) {
super();
this.action = action;
this.statement = statement;
}
}
PerformProductPackageAction.XSI_TYPE = "";
class GetProductPackagesByStatementResponse extends xmlElement_1.XMLElement {
constructor(rval = null) {
super();
this.rval = rval;
}
}
GetProductPackagesByStatementResponse.XSI_TYPE = "";
class GetProductPackagesByStatement extends xmlElement_1.XMLElement {
constructor(statement = null) {
super();
this.statement = statement;
}
}
GetProductPackagesByStatement.XSI_TYPE = "";
class CreateProductPackagesResponse extends xmlElement_1.XMLElement {
constructor(rval = null) {
super();
this.rval = rval;
}
}
CreateProductPackagesResponse.XSI_TYPE = "";
class CreateProductPackages extends xmlElement_1.XMLElement {
constructor(productPackages = null) {
super();
this.productPackages = productPackages;
}
}
CreateProductPackages.XSI_TYPE = "";
class ProductPackageService extends dfpService_1.DfpService {
constructor(user, options = {}) {
options['classmap'] = ProductPackageService.CLASS_MAP;
super(ProductPackageService.SERVICE_NAME, user, ProductPackageService.ENDPOINT, options);
}
createProductPackages(productPackages) {
return __awaiter(this, void 0, void 0, function* () {
const args = new CreateProductPackages(productPackages);
const result = (yield this.client.__soapCall("createProductPackages", args)).createProductPackagesResponse;
return (Array.isArray(result.rval)) ? result.rval :
(result.rval == null) ? [] : [result.rval];
});
}
getProductPackagesByStatement(statement) {
return __awaiter(this, void 0, void 0, function* () {
const args = new GetProductPackagesByStatement(statement);
const result = (yield this.client.__soapCall("getProductPackagesByStatement", args)).getProductPackagesByStatementResponse;
result.rval.results = (Array.isArray(result.rval.results)) ? result.rval.results :
(result.rval.results == null) ? [] : [result.rval.results];
return result.rval;
});
}
performProductPackageAction(action, statement) {
return __awaiter(this, void 0, void 0, function* () {
const args = new PerformProductPackageAction(action, statement);
const result = (yield this.client.__soapCall("performProductPackageAction", args)).performProductPackageActionResponse;
return result.rval;
});
}
updateProductPackages(productPackages) {
return __awaiter(this, void 0, void 0, function* () {
const args = new UpdateProductPackages(productPackages);
const result = (yield this.client.__soapCall("updateProductPackages", args)).updateProductPackagesResponse;
return (Array.isArray(result.rval)) ? result.rval :
(result.rval == null) ? [] : [result.rval];
});
}
}
ProductPackageService.SERVICE_NAME = "ProductPackageService";
ProductPackageService.ENDPOINT = "https://ads.google.com/apis/ads/publisher/v201611/ProductPackageService";
ProductPackageService.CLASS_MAP = {
"ObjectValue": objectValue_1.ObjectValue,
"ActivateProductPackages": activateProductPackages_1.ActivateProductPackages,
"ApiError": apiError_1.ApiError,
"ApiException": apiException_1.ApiException,
"ApiVersionError": apiVersionError_1.ApiVersionError,
"ApplicationException": applicationException_1.ApplicationException,
"ArchiveProductPackages": archiveProductPackages_1.ArchiveProductPackages,
"AuthenticationError": authenticationError_1.AuthenticationError,
"BaseCustomFieldValue": baseCustomFieldValue_1.BaseCustomFieldValue,
"BaseRateError": baseRateError_1.BaseRateError,
"BooleanValue": booleanValue_1.BooleanValue,
"CollectionSizeError": collectionSizeError_1.CollectionSizeError,
"CommonError": commonError_1.CommonError,
"CustomFieldValue": customFieldValue_1.CustomFieldValue,
"Date": dfpDate_1.DfpDate,
"DateTime": dfpDateTime_1.DfpDateTime,
"DateTimeValue": dateTimeValue_1.DateTimeValue,
"DateValue": dateValue_1.DateValue,
"DeactivateProductPackages": deactivateProductPackages_1.DeactivateProductPackages,
"DropDownCustomFieldValue": dropDownCustomFieldValue_1.DropDownCustomFieldValue,
"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,
"ProductPackageAction": productPackageAction_1.ProductPackageAction,
"ProductPackageActionError": productPackageActionError_1.ProductPackageActionError,
"ProductPackage": productPackage_1.ProductPackage,
"ProductPackageItemError": productPackageItemError_1.ProductPackageItemError,
"ProductPackagePage": productPackagePage_1.ProductPackagePage,
"ProductPackageRateCardAssociationError": productPackageRateCardAssociationError_1.ProductPackageRateCardAssociationError,
"PublisherQueryLanguageContextError": publisherQueryLanguageContextError_1.PublisherQueryLanguageContextError,
"PublisherQueryLanguageSyntaxError": publisherQueryLanguageSyntaxError_1.PublisherQueryLanguageSyntaxError,
"QuotaError": quotaError_1.QuotaError,
"RangeError": rangeError_1.RangeError,
"RateCardError": rateCardError_1.RateCardError,
"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,
"UnarchiveProductPackages": unarchiveProductPackages_1.UnarchiveProductPackages,
"UniqueError": uniqueError_1.UniqueError,
"UpdateResult": updateResult_1.UpdateResult,
"Value": value_1.Value,
"createProductPackages": CreateProductPackages,
"createProductPackagesResponse": CreateProductPackagesResponse,
"getProductPackagesByStatement": GetProductPackagesByStatement,
"getProductPackagesByStatementResponse": GetProductPackagesByStatementResponse,
"performProductPackageAction": PerformProductPackageAction,
"performProductPackageActionResponse": PerformProductPackageActionResponse,
"updateProductPackages": UpdateProductPackages,
"updateProductPackagesResponse": UpdateProductPackagesResponse,
};
exports.ProductPackageService = ProductPackageService;