dfp-lib
Version:
This project hosts the Node.JS client library for the SOAP-based DFP API at Google.
340 lines (339 loc) • 20.7 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 dfpService_1 = require("../lib/dfpService");
const baseDynamicAllocationCreative_1 = require("../soap/baseDynamicAllocationCreative");
const baseCreativeTemplateVariableValue_1 = require("../soap/baseCreativeTemplateVariableValue");
const objectValue_1 = require("../soap/objectValue");
const adExchangeCreative_1 = require("../soap/adExchangeCreative");
const adMobBackfillCreative_1 = require("../soap/adMobBackfillCreative");
const adSenseCreative_1 = require("../soap/adSenseCreative");
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 appliedLabel_1 = require("../soap/appliedLabel");
const aspectRatioImageCreative_1 = require("../soap/aspectRatioImageCreative");
const assetCreativeTemplateVariableValue_1 = require("../soap/assetCreativeTemplateVariableValue");
const asset_1 = require("../soap/asset");
const assetError_1 = require("../soap/assetError");
const authenticationError_1 = require("../soap/authenticationError");
const baseCustomFieldValue_1 = require("../soap/baseCustomFieldValue");
const baseFlashCreative_1 = require("../soap/baseFlashCreative");
const baseFlashRedirectCreative_1 = require("../soap/baseFlashRedirectCreative");
const baseImageCreative_1 = require("../soap/baseImageCreative");
const baseImageRedirectCreative_1 = require("../soap/baseImageRedirectCreative");
const baseRichMediaStudioCreative_1 = require("../soap/baseRichMediaStudioCreative");
const baseVideoCreative_1 = require("../soap/baseVideoCreative");
const booleanValue_1 = require("../soap/booleanValue");
const clickTag_1 = require("../soap/clickTag");
const clickTrackingCreative_1 = require("../soap/clickTrackingCreative");
const collectionSizeError_1 = require("../soap/collectionSizeError");
const commonError_1 = require("../soap/commonError");
const conversionEventTrackingUrlsMapEntry_1 = require("../soap/conversionEventTrackingUrlsMapEntry");
const creativeAsset_1 = require("../soap/creativeAsset");
const customCreativeAsset_1 = require("../soap/customCreativeAsset");
const creativeAssetMacroError_1 = require("../soap/creativeAssetMacroError");
const creative_1 = require("../soap/creative");
const creativeError_1 = require("../soap/creativeError");
const creativePage_1 = require("../soap/creativePage");
const creativeSetError_1 = require("../soap/creativeSetError");
const creativeTemplateError_1 = require("../soap/creativeTemplateError");
const creativeTemplateOperationError_1 = require("../soap/creativeTemplateOperationError");
const customCreative_1 = require("../soap/customCreative");
const customCreativeError_1 = require("../soap/customCreativeError");
const customFieldValue_1 = require("../soap/customFieldValue");
const customFieldValueError_1 = require("../soap/customFieldValueError");
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 legacyDfpMobileCreative_1 = require("../soap/legacyDfpMobileCreative");
const dropDownCustomFieldValue_1 = require("../soap/dropDownCustomFieldValue");
const entityLimitReachedError_1 = require("../soap/entityLimitReachedError");
const featureError_1 = require("../soap/featureError");
const fileError_1 = require("../soap/fileError");
const flashCreative_1 = require("../soap/flashCreative");
const flashOverlayCreative_1 = require("../soap/flashOverlayCreative");
const flashRedirectCreative_1 = require("../soap/flashRedirectCreative");
const flashRedirectOverlayCreative_1 = require("../soap/flashRedirectOverlayCreative");
const hasDestinationUrlCreative_1 = require("../soap/hasDestinationUrlCreative");
const hasHtmlSnippetDynamicAllocationCreative_1 = require("../soap/hasHtmlSnippetDynamicAllocationCreative");
const html5Creative_1 = require("../soap/html5Creative");
const htmlBundleProcessorError_1 = require("../soap/htmlBundleProcessorError");
const imageCreative_1 = require("../soap/imageCreative");
const imageError_1 = require("../soap/imageError");
const imageOverlayCreative_1 = require("../soap/imageOverlayCreative");
const imageRedirectCreative_1 = require("../soap/imageRedirectCreative");
const imageRedirectOverlayCreative_1 = require("../soap/imageRedirectOverlayCreative");
const internalApiError_1 = require("../soap/internalApiError");
const internalRedirectCreative_1 = require("../soap/internalRedirectCreative");
const invalidPhoneNumberError_1 = require("../soap/invalidPhoneNumberError");
const invalidUrlError_1 = require("../soap/invalidUrlError");
const labelEntityAssociationError_1 = require("../soap/labelEntityAssociationError");
const legacyDfpCreative_1 = require("../soap/legacyDfpCreative");
const lineItemCreativeAssociationError_1 = require("../soap/lineItemCreativeAssociationError");
const longCreativeTemplateVariableValue_1 = require("../soap/longCreativeTemplateVariableValue");
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 programmaticCreative_1 = require("../soap/programmaticCreative");
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 redirectAsset_1 = require("../soap/redirectAsset");
const requiredCollectionError_1 = require("../soap/requiredCollectionError");
const requiredError_1 = require("../soap/requiredError");
const requiredNumberError_1 = require("../soap/requiredNumberError");
const requiredSizeError_1 = require("../soap/requiredSizeError");
const richMediaStudioChildAssetProperty_1 = require("../soap/richMediaStudioChildAssetProperty");
const richMediaStudioCreative_1 = require("../soap/richMediaStudioCreative");
const richMediaStudioCreativeError_1 = require("../soap/richMediaStudioCreativeError");
const serverError_1 = require("../soap/serverError");
const setTopBoxCreative_1 = require("../soap/setTopBoxCreative");
const setTopBoxCreativeError_1 = require("../soap/setTopBoxCreativeError");
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 statement_1 = require("../soap/statement");
const statementError_1 = require("../soap/statementError");
const stringCreativeTemplateVariableValue_1 = require("../soap/stringCreativeTemplateVariableValue");
const stringLengthError_1 = require("../soap/stringLengthError");
const stringValueMapEntry_1 = require("../soap/stringValueMapEntry");
const swiffyConversionError_1 = require("../soap/swiffyConversionError");
const swiffyFallbackAsset_1 = require("../soap/swiffyFallbackAsset");
const templateCreative_1 = require("../soap/templateCreative");
const templateInstantiatedCreativeError_1 = require("../soap/templateInstantiatedCreativeError");
const textValue_1 = require("../soap/textValue");
const thirdPartyCreative_1 = require("../soap/thirdPartyCreative");
const trackingUrls_1 = require("../soap/trackingUrls");
const typeError_1 = require("../soap/typeError");
const uniqueError_1 = require("../soap/uniqueError");
const unsupportedCreative_1 = require("../soap/unsupportedCreative");
const urlCreativeTemplateVariableValue_1 = require("../soap/urlCreativeTemplateVariableValue");
const value_1 = require("../soap/value");
const vastRedirectCreative_1 = require("../soap/vastRedirectCreative");
const videoCreative_1 = require("../soap/videoCreative");
const videoMetadata_1 = require("../soap/videoMetadata");
const videoRedirectAsset_1 = require("../soap/videoRedirectAsset");
const videoRedirectCreative_1 = require("../soap/videoRedirectCreative");
const vpaidLinearCreative_1 = require("../soap/vpaidLinearCreative");
const vpaidLinearRedirectCreative_1 = require("../soap/vpaidLinearRedirectCreative");
const conversionEvent_1 = require("../soap/conversionEvent");
class CreateCreatives extends xmlElement_1.XMLElement {
constructor(creatives = null) {
super();
this.creatives = creatives;
}
}
CreateCreatives.XSI_TYPE = "";
class CreateCreativesResponse extends xmlElement_1.XMLElement {
constructor(rval = null) {
super();
this.rval = rval;
}
}
CreateCreativesResponse.XSI_TYPE = "";
class GetCreativesByStatement extends xmlElement_1.XMLElement {
constructor(filterStatement = null) {
super();
this.filterStatement = filterStatement;
}
}
GetCreativesByStatement.XSI_TYPE = "";
class GetCreativesByStatementResponse extends xmlElement_1.XMLElement {
constructor(rval = null) {
super();
this.rval = rval;
}
}
GetCreativesByStatementResponse.XSI_TYPE = "";
class UpdateCreatives extends xmlElement_1.XMLElement {
constructor(creatives = null) {
super();
this.creatives = creatives;
}
}
UpdateCreatives.XSI_TYPE = "";
class UpdateCreativesResponse extends xmlElement_1.XMLElement {
constructor(rval = null) {
super();
this.rval = rval;
}
}
UpdateCreativesResponse.XSI_TYPE = "";
class CreativeService extends dfpService_1.DfpService {
constructor(user, options = {}) {
options['classmap'] = CreativeService.CLASS_MAP;
super(CreativeService.SERVICE_NAME, user, CreativeService.ENDPOINT, options);
}
createCreatives(creatives) {
return __awaiter(this, void 0, void 0, function* () {
const args = new CreateCreatives(creatives);
const result = (yield this.client.__soapCall("createCreatives", args)).createCreativesResponse;
return (Array.isArray(result.rval)) ? result.rval :
(result.rval == null) ? [] : [result.rval];
});
}
getCreativesByStatement(filterStatement) {
return __awaiter(this, void 0, void 0, function* () {
const args = new GetCreativesByStatement(filterStatement);
const result = (yield this.client.__soapCall("getCreativesByStatement", args)).getCreativesByStatementResponse;
result.rval.results = (Array.isArray(result.rval.results)) ? result.rval.results :
(result.rval.results == null) ? [] : [result.rval.results];
return result.rval;
});
}
updateCreatives(creatives) {
return __awaiter(this, void 0, void 0, function* () {
const args = new UpdateCreatives(creatives);
const result = (yield this.client.__soapCall("updateCreatives", args)).updateCreativesResponse;
return (Array.isArray(result.rval)) ? result.rval :
(result.rval == null) ? [] : [result.rval];
});
}
}
CreativeService.SERVICE_NAME = "CreativeService";
CreativeService.ENDPOINT = "https://ads.google.com/apis/ads/publisher/v201611/CreativeService";
CreativeService.CLASS_MAP = {
"BaseDynamicAllocationCreative": baseDynamicAllocationCreative_1.BaseDynamicAllocationCreative,
"BaseCreativeTemplateVariableValue": baseCreativeTemplateVariableValue_1.BaseCreativeTemplateVariableValue,
"ObjectValue": objectValue_1.ObjectValue,
"AdExchangeCreative": adExchangeCreative_1.AdExchangeCreative,
"AdMobBackfillCreative": adMobBackfillCreative_1.AdMobBackfillCreative,
"AdSenseCreative": adSenseCreative_1.AdSenseCreative,
"ApiError": apiError_1.ApiError,
"ApiException": apiException_1.ApiException,
"ApiVersionError": apiVersionError_1.ApiVersionError,
"ApplicationException": applicationException_1.ApplicationException,
"AppliedLabel": appliedLabel_1.AppliedLabel,
"AspectRatioImageCreative": aspectRatioImageCreative_1.AspectRatioImageCreative,
"AssetCreativeTemplateVariableValue": assetCreativeTemplateVariableValue_1.AssetCreativeTemplateVariableValue,
"Asset": asset_1.Asset,
"AssetError": assetError_1.AssetError,
"AuthenticationError": authenticationError_1.AuthenticationError,
"BaseCustomFieldValue": baseCustomFieldValue_1.BaseCustomFieldValue,
"BaseFlashCreative": baseFlashCreative_1.BaseFlashCreative,
"BaseFlashRedirectCreative": baseFlashRedirectCreative_1.BaseFlashRedirectCreative,
"BaseImageCreative": baseImageCreative_1.BaseImageCreative,
"BaseImageRedirectCreative": baseImageRedirectCreative_1.BaseImageRedirectCreative,
"BaseRichMediaStudioCreative": baseRichMediaStudioCreative_1.BaseRichMediaStudioCreative,
"BaseVideoCreative": baseVideoCreative_1.BaseVideoCreative,
"BooleanValue": booleanValue_1.BooleanValue,
"ClickTag": clickTag_1.ClickTag,
"ClickTrackingCreative": clickTrackingCreative_1.ClickTrackingCreative,
"CollectionSizeError": collectionSizeError_1.CollectionSizeError,
"CommonError": commonError_1.CommonError,
"ConversionEventTrackingUrlsMapEntry": conversionEventTrackingUrlsMapEntry_1.ConversionEventTrackingUrlsMapEntry,
"CreativeAsset": creativeAsset_1.CreativeAsset,
"CustomCreativeAsset": customCreativeAsset_1.CustomCreativeAsset,
"CreativeAssetMacroError": creativeAssetMacroError_1.CreativeAssetMacroError,
"Creative": creative_1.Creative,
"CreativeError": creativeError_1.CreativeError,
"CreativePage": creativePage_1.CreativePage,
"CreativeSetError": creativeSetError_1.CreativeSetError,
"CreativeTemplateError": creativeTemplateError_1.CreativeTemplateError,
"CreativeTemplateOperationError": creativeTemplateOperationError_1.CreativeTemplateOperationError,
"CustomCreative": customCreative_1.CustomCreative,
"CustomCreativeError": customCreativeError_1.CustomCreativeError,
"CustomFieldValue": customFieldValue_1.CustomFieldValue,
"CustomFieldValueError": customFieldValueError_1.CustomFieldValueError,
"Date": dfpDate_1.DfpDate,
"DateTime": dfpDateTime_1.DfpDateTime,
"DateTimeValue": dateTimeValue_1.DateTimeValue,
"DateValue": dateValue_1.DateValue,
"LegacyDfpMobileCreative": legacyDfpMobileCreative_1.LegacyDfpMobileCreative,
"DropDownCustomFieldValue": dropDownCustomFieldValue_1.DropDownCustomFieldValue,
"EntityLimitReachedError": entityLimitReachedError_1.EntityLimitReachedError,
"FeatureError": featureError_1.FeatureError,
"FileError": fileError_1.FileError,
"FlashCreative": flashCreative_1.FlashCreative,
"FlashOverlayCreative": flashOverlayCreative_1.FlashOverlayCreative,
"FlashRedirectCreative": flashRedirectCreative_1.FlashRedirectCreative,
"FlashRedirectOverlayCreative": flashRedirectOverlayCreative_1.FlashRedirectOverlayCreative,
"HasDestinationUrlCreative": hasDestinationUrlCreative_1.HasDestinationUrlCreative,
"HasHtmlSnippetDynamicAllocationCreative": hasHtmlSnippetDynamicAllocationCreative_1.HasHtmlSnippetDynamicAllocationCreative,
"Html5Creative": html5Creative_1.Html5Creative,
"HtmlBundleProcessorError": htmlBundleProcessorError_1.HtmlBundleProcessorError,
"ImageCreative": imageCreative_1.ImageCreative,
"ImageError": imageError_1.ImageError,
"ImageOverlayCreative": imageOverlayCreative_1.ImageOverlayCreative,
"ImageRedirectCreative": imageRedirectCreative_1.ImageRedirectCreative,
"ImageRedirectOverlayCreative": imageRedirectOverlayCreative_1.ImageRedirectOverlayCreative,
"InternalApiError": internalApiError_1.InternalApiError,
"InternalRedirectCreative": internalRedirectCreative_1.InternalRedirectCreative,
"InvalidPhoneNumberError": invalidPhoneNumberError_1.InvalidPhoneNumberError,
"InvalidUrlError": invalidUrlError_1.InvalidUrlError,
"LabelEntityAssociationError": labelEntityAssociationError_1.LabelEntityAssociationError,
"LegacyDfpCreative": legacyDfpCreative_1.LegacyDfpCreative,
"LineItemCreativeAssociationError": lineItemCreativeAssociationError_1.LineItemCreativeAssociationError,
"LongCreativeTemplateVariableValue": longCreativeTemplateVariableValue_1.LongCreativeTemplateVariableValue,
"NotNullError": notNullError_1.NotNullError,
"NullError": nullError_1.NullError,
"NumberValue": numberValue_1.NumberValue,
"ParseError": parseError_1.ParseError,
"PermissionError": permissionError_1.PermissionError,
"ProgrammaticCreative": programmaticCreative_1.ProgrammaticCreative,
"PublisherQueryLanguageContextError": publisherQueryLanguageContextError_1.PublisherQueryLanguageContextError,
"PublisherQueryLanguageSyntaxError": publisherQueryLanguageSyntaxError_1.PublisherQueryLanguageSyntaxError,
"QuotaError": quotaError_1.QuotaError,
"RangeError": rangeError_1.RangeError,
"RedirectAsset": redirectAsset_1.RedirectAsset,
"RequiredCollectionError": requiredCollectionError_1.RequiredCollectionError,
"RequiredError": requiredError_1.RequiredError,
"RequiredNumberError": requiredNumberError_1.RequiredNumberError,
"RequiredSizeError": requiredSizeError_1.RequiredSizeError,
"RichMediaStudioChildAssetProperty": richMediaStudioChildAssetProperty_1.RichMediaStudioChildAssetProperty,
"RichMediaStudioCreative": richMediaStudioCreative_1.RichMediaStudioCreative,
"RichMediaStudioCreativeError": richMediaStudioCreativeError_1.RichMediaStudioCreativeError,
"ServerError": serverError_1.ServerError,
"SetTopBoxCreative": setTopBoxCreative_1.SetTopBoxCreative,
"SetTopBoxCreativeError": setTopBoxCreativeError_1.SetTopBoxCreativeError,
"SetValue": setValue_1.SetValue,
"Size": size_1.Size,
"SoapRequestHeader": soapRequestHeader_1.SoapRequestHeader,
"SoapResponseHeader": soapResponseHeader_1.SoapResponseHeader,
"Statement": statement_1.Statement,
"StatementError": statementError_1.StatementError,
"StringCreativeTemplateVariableValue": stringCreativeTemplateVariableValue_1.StringCreativeTemplateVariableValue,
"StringLengthError": stringLengthError_1.StringLengthError,
"StringValueMapEntry": stringValueMapEntry_1.StringValueMapEntry,
"SwiffyConversionError": swiffyConversionError_1.SwiffyConversionError,
"SwiffyFallbackAsset": swiffyFallbackAsset_1.SwiffyFallbackAsset,
"TemplateCreative": templateCreative_1.TemplateCreative,
"TemplateInstantiatedCreativeError": templateInstantiatedCreativeError_1.TemplateInstantiatedCreativeError,
"TextValue": textValue_1.TextValue,
"ThirdPartyCreative": thirdPartyCreative_1.ThirdPartyCreative,
"TrackingUrls": trackingUrls_1.TrackingUrls,
"TypeError": typeError_1.TypeError,
"UniqueError": uniqueError_1.UniqueError,
"UnsupportedCreative": unsupportedCreative_1.UnsupportedCreative,
"UrlCreativeTemplateVariableValue": urlCreativeTemplateVariableValue_1.UrlCreativeTemplateVariableValue,
"Value": value_1.Value,
"VastRedirectCreative": vastRedirectCreative_1.VastRedirectCreative,
"VideoCreative": videoCreative_1.VideoCreative,
"VideoMetadata": videoMetadata_1.VideoMetadata,
"VideoRedirectAsset": videoRedirectAsset_1.VideoRedirectAsset,
"VideoRedirectCreative": videoRedirectCreative_1.VideoRedirectCreative,
"VpaidLinearCreative": vpaidLinearCreative_1.VpaidLinearCreative,
"VpaidLinearRedirectCreative": vpaidLinearRedirectCreative_1.VpaidLinearRedirectCreative,
"ConversionEvent": conversionEvent_1.ConversionEvent,
"createCreatives": CreateCreatives,
"createCreativesResponse": CreateCreativesResponse,
"getCreativesByStatement": GetCreativesByStatement,
"getCreativesByStatementResponse": GetCreativesByStatementResponse,
"updateCreatives": UpdateCreatives,
"updateCreativesResponse": UpdateCreativesResponse
};
exports.CreativeService = CreativeService;