UNPKG

dfp-lib

Version:

This project hosts the Node.JS client library for the SOAP-based DFP API at Google.

368 lines (367 loc) 21.9 kB
"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 productTemplate_1 = require("../soap/productTemplate"); const updateResult_1 = require("../soap/updateResult"); const productTemplateAction_1 = require("../soap/productTemplateAction"); const statement_1 = require("../soap/statement"); const productTemplatePage_1 = require("../soap/productTemplatePage"); const dfpService_1 = require("../lib/dfpService"); const objectValue_1 = require("../soap/objectValue"); const activateProductTemplates_1 = require("../soap/activateProductTemplates"); const adUnitTargeting_1 = require("../soap/adUnitTargeting"); const apiError_1 = require("../soap/apiError"); const apiException_1 = require("../soap/apiException"); const technologyTargeting_1 = require("../soap/technologyTargeting"); const apiVersionError_1 = require("../soap/apiVersionError"); const applicationException_1 = require("../soap/applicationException"); const appliedLabel_1 = require("../soap/appliedLabel"); const archiveProductTemplates_1 = require("../soap/archiveProductTemplates"); const authenticationError_1 = require("../soap/authenticationError"); const bandwidthGroup_1 = require("../soap/bandwidthGroup"); const bandwidthGroupTargeting_1 = require("../soap/bandwidthGroupTargeting"); const baseCustomFieldValue_1 = require("../soap/baseCustomFieldValue"); const baseRateError_1 = require("../soap/baseRateError"); const booleanValue_1 = require("../soap/booleanValue"); const browser_1 = require("../soap/browser"); const browserLanguage_1 = require("../soap/browserLanguage"); const browserLanguageTargeting_1 = require("../soap/browserLanguageTargeting"); const browserTargeting_1 = require("../soap/browserTargeting"); const collectionSizeError_1 = require("../soap/collectionSizeError"); const commonError_1 = require("../soap/commonError"); const contentMetadataKeyHierarchyTargeting_1 = require("../soap/contentMetadataKeyHierarchyTargeting"); const contentMetadataTargetingError_1 = require("../soap/contentMetadataTargetingError"); const contentTargeting_1 = require("../soap/contentTargeting"); const creativePlaceholder_1 = require("../soap/creativePlaceholder"); const customCriteria_1 = require("../soap/customCriteria"); const customCriteriaSet_1 = require("../soap/customCriteriaSet"); const customFieldValue_1 = require("../soap/customFieldValue"); const customFieldValueError_1 = require("../soap/customFieldValueError"); const customTargetingError_1 = require("../soap/customTargetingError"); const customCriteriaLeaf_1 = require("../soap/customCriteriaLeaf"); const customCriteriaNode_1 = require("../soap/customCriteriaNode"); const audienceSegmentCriteria_1 = require("../soap/audienceSegmentCriteria"); const customizableAttributes_1 = require("../soap/customizableAttributes"); const dfpDate_1 = require("../soap/dfpDate"); const dfpDateTime_1 = require("../soap/dfpDateTime"); const dateTimeRangeTargetingError_1 = require("../soap/dateTimeRangeTargetingError"); const dateTimeValue_1 = require("../soap/dateTimeValue"); const dateValue_1 = require("../soap/dateValue"); const dayPart_1 = require("../soap/dayPart"); const dayPartTargeting_1 = require("../soap/dayPartTargeting"); const dayPartTargetingError_1 = require("../soap/dayPartTargetingError"); const deactivateProductTemplates_1 = require("../soap/deactivateProductTemplates"); const deviceCapability_1 = require("../soap/deviceCapability"); const deviceCapabilityTargeting_1 = require("../soap/deviceCapabilityTargeting"); const deviceCategory_1 = require("../soap/deviceCategory"); const deviceCategoryTargeting_1 = require("../soap/deviceCategoryTargeting"); const deviceManufacturer_1 = require("../soap/deviceManufacturer"); const deviceManufacturerTargeting_1 = require("../soap/deviceManufacturerTargeting"); 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 frequencyCap_1 = require("../soap/frequencyCap"); const frequencyCapError_1 = require("../soap/frequencyCapError"); const genericTargetingError_1 = require("../soap/genericTargetingError"); const geoTargeting_1 = require("../soap/geoTargeting"); const geoTargetingError_1 = require("../soap/geoTargetingError"); const internalApiError_1 = require("../soap/internalApiError"); const inventoryTargeting_1 = require("../soap/inventoryTargeting"); const inventoryTargetingError_1 = require("../soap/inventoryTargetingError"); const dfpLocation_1 = require("../soap/dfpLocation"); const mobileCarrier_1 = require("../soap/mobileCarrier"); const mobileCarrierTargeting_1 = require("../soap/mobileCarrierTargeting"); const mobileDevice_1 = require("../soap/mobileDevice"); const mobileDeviceSubmodel_1 = require("../soap/mobileDeviceSubmodel"); const mobileDeviceSubmodelTargeting_1 = require("../soap/mobileDeviceSubmodelTargeting"); const mobileDeviceTargeting_1 = require("../soap/mobileDeviceTargeting"); const notNullError_1 = require("../soap/notNullError"); const nullError_1 = require("../soap/nullError"); const numberValue_1 = require("../soap/numberValue"); const operatingSystem_1 = require("../soap/operatingSystem"); const operatingSystemTargeting_1 = require("../soap/operatingSystemTargeting"); const operatingSystemVersion_1 = require("../soap/operatingSystemVersion"); const operatingSystemVersionTargeting_1 = require("../soap/operatingSystemVersionTargeting"); const parseError_1 = require("../soap/parseError"); const permissionError_1 = require("../soap/permissionError"); const placementTargeting_1 = require("../soap/placementTargeting"); const productTemplateActionError_1 = require("../soap/productTemplateActionError"); const productTemplateError_1 = require("../soap/productTemplateError"); const productSegmentation_1 = require("../soap/productSegmentation"); 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 requiredNumberError_1 = require("../soap/requiredNumberError"); const serverError_1 = require("../soap/serverError"); const setValue_1 = require("../soap/setValue"); const size_1 = require("../soap/size"); 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 targeting_1 = require("../soap/targeting"); const technology_1 = require("../soap/technology"); const technologyTargetingError_1 = require("../soap/technologyTargetingError"); const textValue_1 = require("../soap/textValue"); const timeOfDay_1 = require("../soap/timeOfDay"); const typeError_1 = require("../soap/typeError"); const unarchiveProductTemplates_1 = require("../soap/unarchiveProductTemplates"); const uniqueError_1 = require("../soap/uniqueError"); const userDomainTargeting_1 = require("../soap/userDomainTargeting"); const userDomainTargetingError_1 = require("../soap/userDomainTargetingError"); const value_1 = require("../soap/value"); const videoPosition_1 = require("../soap/videoPosition"); const videoPositionTargeting_1 = require("../soap/videoPositionTargeting"); const videoPositionTargetingError_1 = require("../soap/videoPositionTargetingError"); const videoPositionWithinPod_1 = require("../soap/videoPositionWithinPod"); const videoPositionTarget_1 = require("../soap/videoPositionTarget"); const creativeSizeType_1 = require("../soap/creativeSizeType"); const productTemplateMarketplaceInfo_1 = require("../soap/productTemplateMarketplaceInfo"); const programmaticProductError_1 = require("../soap/programmaticProductError"); const programmaticEntitiesError_1 = require("../soap/programmaticEntitiesError"); const adExchangeEnvironment_1 = require("../soap/adExchangeEnvironment"); const mobileApplicationTargeting_1 = require("../soap/mobileApplicationTargeting"); class UpdateProductTemplatesResponse extends xmlElement_1.XMLElement { constructor(rval = null) { super(); this.rval = rval; } } UpdateProductTemplatesResponse.XSI_TYPE = ""; class UpdateProductTemplates extends xmlElement_1.XMLElement { constructor(productTemplates = null) { super(); this.productTemplates = productTemplates; } } UpdateProductTemplates.XSI_TYPE = ""; class PerformProductTemplateActionResponse extends xmlElement_1.XMLElement { constructor(rval = null) { super(); this.rval = rval; } } PerformProductTemplateActionResponse.XSI_TYPE = ""; class PerformProductTemplateAction extends xmlElement_1.XMLElement { constructor(action = null, filterStatement = null) { super(); this.action = action; this.filterStatement = filterStatement; } } PerformProductTemplateAction.XSI_TYPE = ""; class GetProductTemplatesByStatementResponse extends xmlElement_1.XMLElement { constructor(rval = null) { super(); this.rval = rval; } } GetProductTemplatesByStatementResponse.XSI_TYPE = ""; class GetProductTemplatesByStatement extends xmlElement_1.XMLElement { constructor(statement = null) { super(); this.statement = statement; } } GetProductTemplatesByStatement.XSI_TYPE = ""; class CreateProductTemplatesResponse extends xmlElement_1.XMLElement { constructor(rval = null) { super(); this.rval = rval; } } CreateProductTemplatesResponse.XSI_TYPE = ""; class CreateProductTemplates extends xmlElement_1.XMLElement { constructor(productTemplates = null) { super(); this.productTemplates = productTemplates; } } CreateProductTemplates.XSI_TYPE = ""; class ProductTemplateService extends dfpService_1.DfpService { constructor(user, options = {}) { options['classmap'] = ProductTemplateService.CLASS_MAP; super(ProductTemplateService.SERVICE_NAME, user, ProductTemplateService.ENDPOINT, options); } createProductTemplates(productTemplates) { return __awaiter(this, void 0, void 0, function* () { const args = new CreateProductTemplates(productTemplates); const result = (yield this.client.__soapCall("createProductTemplates", args)).createProductTemplatesResponse; return (Array.isArray(result.rval)) ? result.rval : (result.rval == null) ? [] : [result.rval]; }); } getProductTemplatesByStatement(statement) { return __awaiter(this, void 0, void 0, function* () { const args = new GetProductTemplatesByStatement(statement); const result = (yield this.client.__soapCall("getProductTemplatesByStatement", args)).getProductTemplatesByStatementResponse; result.rval.results = (Array.isArray(result.rval.results)) ? result.rval.results : (result.rval.results == null) ? [] : [result.rval.results]; return result.rval; }); } performProductTemplateAction(action, filterStatement) { return __awaiter(this, void 0, void 0, function* () { const args = new PerformProductTemplateAction(action, filterStatement); const result = (yield this.client.__soapCall("performProductTemplateAction", args)).performProductTemplateActionResponse; return result.rval; }); } updateProductTemplates(productTemplates) { return __awaiter(this, void 0, void 0, function* () { const args = new UpdateProductTemplates(productTemplates); const result = (yield this.client.__soapCall("updateProductTemplates", args)).updateProductTemplatesResponse; return (Array.isArray(result.rval)) ? result.rval : (result.rval == null) ? [] : [result.rval]; }); } } ProductTemplateService.SERVICE_NAME = "ProductTemplateService"; ProductTemplateService.ENDPOINT = "https://ads.google.com/apis/ads/publisher/v201611/ProductTemplateService"; ProductTemplateService.CLASS_MAP = { "ObjectValue": objectValue_1.ObjectValue, "ActivateProductTemplates": activateProductTemplates_1.ActivateProductTemplates, "AdUnitTargeting": adUnitTargeting_1.AdUnitTargeting, "ApiError": apiError_1.ApiError, "ApiException": apiException_1.ApiException, "TechnologyTargeting": technologyTargeting_1.TechnologyTargeting, "ApiVersionError": apiVersionError_1.ApiVersionError, "ApplicationException": applicationException_1.ApplicationException, "AppliedLabel": appliedLabel_1.AppliedLabel, "ArchiveProductTemplates": archiveProductTemplates_1.ArchiveProductTemplates, "AuthenticationError": authenticationError_1.AuthenticationError, "BandwidthGroup": bandwidthGroup_1.BandwidthGroup, "BandwidthGroupTargeting": bandwidthGroupTargeting_1.BandwidthGroupTargeting, "BaseCustomFieldValue": baseCustomFieldValue_1.BaseCustomFieldValue, "BaseRateError": baseRateError_1.BaseRateError, "BooleanValue": booleanValue_1.BooleanValue, "Browser": browser_1.Browser, "BrowserLanguage": browserLanguage_1.BrowserLanguage, "BrowserLanguageTargeting": browserLanguageTargeting_1.BrowserLanguageTargeting, "BrowserTargeting": browserTargeting_1.BrowserTargeting, "CollectionSizeError": collectionSizeError_1.CollectionSizeError, "CommonError": commonError_1.CommonError, "ContentMetadataKeyHierarchyTargeting": contentMetadataKeyHierarchyTargeting_1.ContentMetadataKeyHierarchyTargeting, "ContentMetadataTargetingError": contentMetadataTargetingError_1.ContentMetadataTargetingError, "ContentTargeting": contentTargeting_1.ContentTargeting, "CreativePlaceholder": creativePlaceholder_1.CreativePlaceholder, "CustomCriteria": customCriteria_1.CustomCriteria, "CustomCriteriaSet": customCriteriaSet_1.CustomCriteriaSet, "CustomFieldValue": customFieldValue_1.CustomFieldValue, "CustomFieldValueError": customFieldValueError_1.CustomFieldValueError, "CustomTargetingError": customTargetingError_1.CustomTargetingError, "CustomCriteriaLeaf": customCriteriaLeaf_1.CustomCriteriaLeaf, "CustomCriteriaNode": customCriteriaNode_1.CustomCriteriaNode, "AudienceSegmentCriteria": audienceSegmentCriteria_1.AudienceSegmentCriteria, "CustomizableAttributes": customizableAttributes_1.CustomizableAttributes, "Date": dfpDate_1.DfpDate, "DateTime": dfpDateTime_1.DfpDateTime, "DateTimeRangeTargetingError": dateTimeRangeTargetingError_1.DateTimeRangeTargetingError, "DateTimeValue": dateTimeValue_1.DateTimeValue, "DateValue": dateValue_1.DateValue, "DayPart": dayPart_1.DayPart, "DayPartTargeting": dayPartTargeting_1.DayPartTargeting, "DayPartTargetingError": dayPartTargetingError_1.DayPartTargetingError, "DeactivateProductTemplates": deactivateProductTemplates_1.DeactivateProductTemplates, "DeviceCapability": deviceCapability_1.DeviceCapability, "DeviceCapabilityTargeting": deviceCapabilityTargeting_1.DeviceCapabilityTargeting, "DeviceCategory": deviceCategory_1.DeviceCategory, "DeviceCategoryTargeting": deviceCategoryTargeting_1.DeviceCategoryTargeting, "DeviceManufacturer": deviceManufacturer_1.DeviceManufacturer, "DeviceManufacturerTargeting": deviceManufacturerTargeting_1.DeviceManufacturerTargeting, "DropDownCustomFieldValue": dropDownCustomFieldValue_1.DropDownCustomFieldValue, "EntityChildrenLimitReachedError": entityChildrenLimitReachedError_1.EntityChildrenLimitReachedError, "EntityLimitReachedError": entityLimitReachedError_1.EntityLimitReachedError, "FeatureError": featureError_1.FeatureError, "FrequencyCap": frequencyCap_1.FrequencyCap, "FrequencyCapError": frequencyCapError_1.FrequencyCapError, "GenericTargetingError": genericTargetingError_1.GenericTargetingError, "GeoTargeting": geoTargeting_1.GeoTargeting, "GeoTargetingError": geoTargetingError_1.GeoTargetingError, "InternalApiError": internalApiError_1.InternalApiError, "InventoryTargeting": inventoryTargeting_1.InventoryTargeting, "InventoryTargetingError": inventoryTargetingError_1.InventoryTargetingError, "Location": dfpLocation_1.DfpLocation, "MobileApplicationTargeting": mobileApplicationTargeting_1.MobileApplicationTargeting, "MobileCarrier": mobileCarrier_1.MobileCarrier, "MobileCarrierTargeting": mobileCarrierTargeting_1.MobileCarrierTargeting, "MobileDevice": mobileDevice_1.MobileDevice, "MobileDeviceSubmodel": mobileDeviceSubmodel_1.MobileDeviceSubmodel, "MobileDeviceSubmodelTargeting": mobileDeviceSubmodelTargeting_1.MobileDeviceSubmodelTargeting, "MobileDeviceTargeting": mobileDeviceTargeting_1.MobileDeviceTargeting, "NotNullError": notNullError_1.NotNullError, "NullError": nullError_1.NullError, "NumberValue": numberValue_1.NumberValue, "OperatingSystem": operatingSystem_1.OperatingSystem, "OperatingSystemTargeting": operatingSystemTargeting_1.OperatingSystemTargeting, "OperatingSystemVersion": operatingSystemVersion_1.OperatingSystemVersion, "OperatingSystemVersionTargeting": operatingSystemVersionTargeting_1.OperatingSystemVersionTargeting, "ParseError": parseError_1.ParseError, "PermissionError": permissionError_1.PermissionError, "PlacementTargeting": placementTargeting_1.PlacementTargeting, "ProductTemplateAction": productTemplateAction_1.ProductTemplateAction, "ProductTemplateActionError": productTemplateActionError_1.ProductTemplateActionError, "ProductTemplate": productTemplate_1.ProductTemplate, "ProductTemplateError": productTemplateError_1.ProductTemplateError, "ProductTemplateMarketplaceInfo": productTemplateMarketplaceInfo_1.ProductTemplateMarketplaceInfo, "ProductTemplatePage": productTemplatePage_1.ProductTemplatePage, "ProductSegmentation": productSegmentation_1.ProductSegmentation, "ProgrammaticEntitiesError": programmaticEntitiesError_1.ProgrammaticEntitiesError, "ProgrammaticProductError": programmaticProductError_1.ProgrammaticProductError, "PublisherQueryLanguageContextError": publisherQueryLanguageContextError_1.PublisherQueryLanguageContextError, "PublisherQueryLanguageSyntaxError": publisherQueryLanguageSyntaxError_1.PublisherQueryLanguageSyntaxError, "QuotaError": quotaError_1.QuotaError, "RangeError": rangeError_1.RangeError, "RequiredCollectionError": requiredCollectionError_1.RequiredCollectionError, "RequiredError": requiredError_1.RequiredError, "RequiredNumberError": requiredNumberError_1.RequiredNumberError, "ServerError": serverError_1.ServerError, "SetValue": setValue_1.SetValue, "Size": size_1.Size, "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, "Targeting": targeting_1.Targeting, "Technology": technology_1.Technology, "TechnologyTargetingError": technologyTargetingError_1.TechnologyTargetingError, "TextValue": textValue_1.TextValue, "TimeOfDay": timeOfDay_1.TimeOfDay, "TypeError": typeError_1.TypeError, "UnarchiveProductTemplates": unarchiveProductTemplates_1.UnarchiveProductTemplates, "UniqueError": uniqueError_1.UniqueError, "UpdateResult": updateResult_1.UpdateResult, "UserDomainTargeting": userDomainTargeting_1.UserDomainTargeting, "UserDomainTargetingError": userDomainTargetingError_1.UserDomainTargetingError, "Value": value_1.Value, "VideoPosition": videoPosition_1.VideoPosition, "VideoPositionTargeting": videoPositionTargeting_1.VideoPositionTargeting, "VideoPositionTargetingError": videoPositionTargetingError_1.VideoPositionTargetingError, "VideoPositionWithinPod": videoPositionWithinPod_1.VideoPositionWithinPod, "VideoPositionTarget": videoPositionTarget_1.VideoPositionTarget, "AdExchangeEnvironment": adExchangeEnvironment_1.AdExchangeEnvironment, "CreativeSizeType": creativeSizeType_1.CreativeSizeType, "createProductTemplates": CreateProductTemplates, "createProductTemplatesResponse": CreateProductTemplatesResponse, "getProductTemplatesByStatement": GetProductTemplatesByStatement, "getProductTemplatesByStatementResponse": GetProductTemplatesByStatementResponse, "performProductTemplateAction": PerformProductTemplateAction, "performProductTemplateActionResponse": PerformProductTemplateActionResponse, "updateProductTemplates": UpdateProductTemplates, "updateProductTemplatesResponse": UpdateProductTemplatesResponse, }; exports.ProductTemplateService = ProductTemplateService;