UNPKG

dfp-lib

Version:

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

326 lines (325 loc) 18.6 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 dfpService_1 = require("../lib/dfpService"); const xmlElement_1 = require("../../common/soap/xmlElement"); const apiError_1 = require("../soap/apiError"); const apiVersionError_1 = require("../soap/apiVersionError"); const applicationException_1 = require("../soap/applicationException"); const authenticationError_1 = require("../soap/authenticationError"); 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 featureError_1 = require("../soap/featureError"); const value_1 = require("../soap/value"); const textValue_1 = require("../soap/textValue"); const objectValue_1 = require("../soap/objectValue"); const booleanValue_1 = require("../soap/booleanValue"); const numberValue_1 = require("../soap/numberValue"); const setValue_1 = require("../soap/setValue"); const internalApiError_1 = require("../soap/internalApiError"); const apiException_1 = require("../soap/apiException"); const soapRequestHeader_1 = require("../../common/soap/soapRequestHeader"); const soapResponseHeader_1 = require("../../common/soap/soapResponseHeader"); const invalidEmailError_1 = require("../soap/invalidEmailError"); const parseError_1 = require("../soap/parseError"); const permissionError_1 = require("../soap/permissionError"); const dateTimeValue_1 = require("../soap/dateTimeValue"); const dateValue_1 = require("../soap/dateValue"); const nullError_1 = require("../soap/nullError"); const notNullError_1 = require("../soap/notNullError"); const quotaError_1 = require("../soap/quotaError"); const statement_1 = require("../soap/statement"); const statementError_1 = require("../soap/statementError"); const publisherQueryLanguageContextError_1 = require("../soap/publisherQueryLanguageContextError"); 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 publisherQueryLanguageSyntaxError_1 = require("../soap/publisherQueryLanguageSyntaxError"); const stringValueMapEntry_1 = require("../soap/stringValueMapEntry"); const entityChildrenLimitReachedError_1 = require("../soap/entityChildrenLimitReachedError"); const entityLimitReachedError_1 = require("../soap/entityLimitReachedError"); const inventoryTargetingError_1 = require("../soap/inventoryTargetingError"); const money_1 = require("../soap/money"); const stringLengthError_1 = require("../soap/stringLengthError"); const uniqueError_1 = require("../soap/uniqueError"); const updateResult_1 = require("../soap/updateResult"); const appliedLabel_1 = require("../soap/appliedLabel"); const audienceExtensionError_1 = require("../soap/audienceExtensionError"); const baseCustomFieldValue_1 = require("../soap/baseCustomFieldValue"); const clickTrackingLineItemError_1 = require("../soap/clickTrackingLineItemError"); const companyCreditStatusError_1 = require("../soap/companyCreditStatusError"); const contentMetadataTargetingError_1 = require("../soap/contentMetadataTargetingError"); const creativeError_1 = require("../soap/creativeError"); const crossSellError_1 = require("../soap/crossSellError"); const customFieldValue_1 = require("../soap/customFieldValue"); const customFieldValueError_1 = require("../soap/customFieldValueError"); const customTargetingError_1 = require("../soap/customTargetingError"); const dateTimeRangeTargetingError_1 = require("../soap/dateTimeRangeTargetingError"); const dayPartTargetingError_1 = require("../soap/dayPartTargetingError"); const dropDownCustomFieldValue_1 = require("../soap/dropDownCustomFieldValue"); const frequencyCapError_1 = require("../soap/frequencyCapError"); const genericTargetingError_1 = require("../soap/genericTargetingError"); const geoTargetingError_1 = require("../soap/geoTargetingError"); const grpSettingsError_1 = require("../soap/grpSettingsError"); const imageError_1 = require("../soap/imageError"); const invalidUrlError_1 = require("../soap/invalidUrlError"); const labelEntityAssociationError_1 = require("../soap/labelEntityAssociationError"); const lineItemActivityAssociationError_1 = require("../soap/lineItemActivityAssociationError"); const lineItemCreativeAssociationError_1 = require("../soap/lineItemCreativeAssociationError"); const lineItemError_1 = require("../soap/lineItemError"); const lineItemFlightDateError_1 = require("../soap/lineItemFlightDateError"); const lineItemOperationError_1 = require("../soap/lineItemOperationError"); const orderActionError_1 = require("../soap/orderActionError"); const orderError_1 = require("../soap/orderError"); const programmaticError_1 = require("../soap/programmaticError"); const requiredSizeError_1 = require("../soap/requiredSizeError"); const reservationDetailsError_1 = require("../soap/reservationDetailsError"); const audienceSegmentError_1 = require("../soap/audienceSegmentError"); const setTopBoxLineItemError_1 = require("../soap/setTopBoxLineItemError"); const teamError_1 = require("../soap/teamError"); const technologyTargetingError_1 = require("../soap/technologyTargetingError"); const timeZoneError_1 = require("../soap/timeZoneError"); const userDomainTargetingError_1 = require("../soap/userDomainTargetingError"); const videoPositionTargetingError_1 = require("../soap/videoPositionTargetingError"); const order_1 = require("../soap/order"); const approveAndOverbookOrders_1 = require("../soap/approveAndOverbookOrders"); const approveOrders_1 = require("../soap/approveOrders"); const approveOrdersWithoutReservationChanges_1 = require("../soap/approveOrdersWithoutReservationChanges"); const archiveOrders_1 = require("../soap/archiveOrders"); const deleteOrders_1 = require("../soap/deleteOrders"); const disapproveOrders_1 = require("../soap/disapproveOrders"); const disapproveOrdersWithoutReservationChanges_1 = require("../soap/disapproveOrdersWithoutReservationChanges"); const forecastError_1 = require("../soap/forecastError"); const orderAction_1 = require("../soap/orderAction"); const orderPage_1 = require("../soap/orderPage"); const pauseOrders_1 = require("../soap/pauseOrders"); const resumeAndOverbookOrders_1 = require("../soap/resumeAndOverbookOrders"); const resumeOrders_1 = require("../soap/resumeOrders"); const retractOrders_1 = require("../soap/retractOrders"); const retractOrdersWithoutReservationChanges_1 = require("../soap/retractOrdersWithoutReservationChanges"); const submitOrdersForApproval_1 = require("../soap/submitOrdersForApproval"); const submitOrdersForApprovalAndOverbook_1 = require("../soap/submitOrdersForApprovalAndOverbook"); const submitOrdersForApprovalWithoutReservationChanges_1 = require("../soap/submitOrdersForApprovalWithoutReservationChanges"); const templateInstantiatedCreativeError_1 = require("../soap/templateInstantiatedCreativeError"); const unarchiveOrders_1 = require("../soap/unarchiveOrders"); class CreateOrders extends xmlElement_1.XMLElement { constructor(orders = null) { super(); this.orders = orders; } } CreateOrders.XSI_TYPE = ""; class CreateOrdersResponse extends xmlElement_1.XMLElement { constructor(rval = null) { super(); this.rval = rval; } } CreateOrdersResponse.XSI_TYPE = ""; class GetOrdersByStatement extends xmlElement_1.XMLElement { constructor(filterStatement = null) { super(); this.filterStatement = filterStatement; } } GetOrdersByStatement.XSI_TYPE = ""; class GetOrdersByStatementResponse extends xmlElement_1.XMLElement { constructor(rval = null) { super(); this.rval = rval; } } GetOrdersByStatementResponse.XSI_TYPE = ""; class PerformOrderAction extends xmlElement_1.XMLElement { constructor(orderAction = null, filterStatement = null) { super(); this.orderAction = orderAction; this.filterStatement = filterStatement; } } PerformOrderAction.XSI_TYPE = ""; class PerformOrderActionResponse extends xmlElement_1.XMLElement { constructor(rval = null) { super(); this.rval = rval; } } PerformOrderActionResponse.XSI_TYPE = ""; class UpdateOrders extends xmlElement_1.XMLElement { constructor(orders = null) { super(); this.orders = orders; } } UpdateOrders.XSI_TYPE = ""; class UpdateOrdersResponse extends xmlElement_1.XMLElement { constructor(rval = null) { super(); this.rval = rval; } } UpdateOrdersResponse.XSI_TYPE = ""; class OrderService extends dfpService_1.DfpService { constructor(user, options = {}) { options['classmap'] = OrderService.CLASS_MAP; super(OrderService.SERVICE_NAME, user, OrderService.ENDPOINT, options); } createOrders(orders) { return __awaiter(this, void 0, void 0, function* () { const args = new CreateOrders(orders); const result = (yield this.client.__soapCall("createOrders", args)).createOrdersResponse; return (Array.isArray(result.rval)) ? result.rval : (result.rval == null) ? [] : [result.rval]; }); } getOrdersByStatement(filterStatement) { return __awaiter(this, void 0, void 0, function* () { const args = new GetOrdersByStatement(filterStatement); const result = (yield this.client.__soapCall("getOrdersByStatement", args)).getOrdersByStatementResponse; result.rval.results = (Array.isArray(result.rval.results)) ? result.rval.results : (result.rval.results == null) ? [] : [result.rval.results]; return result.rval; }); } performOrderAction(orderAction, filterStatement) { return __awaiter(this, void 0, void 0, function* () { const args = new PerformOrderAction(orderAction, filterStatement); const result = (yield this.client.__soapCall("performOrderAction", args)).performOrderActionResponse; return result.rval; }); } updateOrders(orders) { return __awaiter(this, void 0, void 0, function* () { const args = new UpdateOrders(orders); const result = (yield this.client.__soapCall("updateOrders", args)).updateOrdersResponse; return (Array.isArray(result.rval)) ? result.rval : (result.rval == null) ? [] : [result.rval]; }); } } OrderService.SERVICE_NAME = "OrderService"; OrderService.ENDPOINT = "https://ads.google.com/apis/ads/publisher/v201611/OrderService"; OrderService.CLASS_MAP = { "ObjectValue": objectValue_1.ObjectValue, "ApiError": apiError_1.ApiError, "ApiException": apiException_1.ApiException, "ApiVersionError": apiVersionError_1.ApiVersionError, "ApplicationException": applicationException_1.ApplicationException, "AppliedLabel": appliedLabel_1.AppliedLabel, "ApproveAndOverbookOrders": approveAndOverbookOrders_1.ApproveAndOverbookOrders, "ApproveOrders": approveOrders_1.ApproveOrders, "ApproveOrdersWithoutReservationChanges": approveOrdersWithoutReservationChanges_1.ApproveOrdersWithoutReservationChanges, "ArchiveOrders": archiveOrders_1.ArchiveOrders, "AudienceExtensionError": audienceExtensionError_1.AudienceExtensionError, "AuthenticationError": authenticationError_1.AuthenticationError, "BaseCustomFieldValue": baseCustomFieldValue_1.BaseCustomFieldValue, "BooleanValue": booleanValue_1.BooleanValue, "ClickTrackingLineItemError": clickTrackingLineItemError_1.ClickTrackingLineItemError, "CollectionSizeError": collectionSizeError_1.CollectionSizeError, "CommonError": commonError_1.CommonError, "CompanyCreditStatusError": companyCreditStatusError_1.CompanyCreditStatusError, "ContentMetadataTargetingError": contentMetadataTargetingError_1.ContentMetadataTargetingError, "CreativeError": creativeError_1.CreativeError, "CrossSellError": crossSellError_1.CrossSellError, "CustomFieldValue": customFieldValue_1.CustomFieldValue, "CustomFieldValueError": customFieldValueError_1.CustomFieldValueError, "CustomTargetingError": customTargetingError_1.CustomTargetingError, "Date": dfpDate_1.DfpDate, "DateTime": dfpDateTime_1.DfpDateTime, "DateTimeRangeTargetingError": dateTimeRangeTargetingError_1.DateTimeRangeTargetingError, "DateTimeValue": dateTimeValue_1.DateTimeValue, "DateValue": dateValue_1.DateValue, "DayPartTargetingError": dayPartTargetingError_1.DayPartTargetingError, "DeleteOrders": deleteOrders_1.DeleteOrders, "DisapproveOrders": disapproveOrders_1.DisapproveOrders, "DisapproveOrdersWithoutReservationChanges": disapproveOrdersWithoutReservationChanges_1.DisapproveOrdersWithoutReservationChanges, "DropDownCustomFieldValue": dropDownCustomFieldValue_1.DropDownCustomFieldValue, "EntityChildrenLimitReachedError": entityChildrenLimitReachedError_1.EntityChildrenLimitReachedError, "EntityLimitReachedError": entityLimitReachedError_1.EntityLimitReachedError, "FeatureError": featureError_1.FeatureError, "ForecastError": forecastError_1.ForecastError, "FrequencyCapError": frequencyCapError_1.FrequencyCapError, "GenericTargetingError": genericTargetingError_1.GenericTargetingError, "GeoTargetingError": geoTargetingError_1.GeoTargetingError, "GrpSettingsError": grpSettingsError_1.GrpSettingsError, "ImageError": imageError_1.ImageError, "InternalApiError": internalApiError_1.InternalApiError, "InvalidEmailError": invalidEmailError_1.InvalidEmailError, "InvalidUrlError": invalidUrlError_1.InvalidUrlError, "InventoryTargetingError": inventoryTargetingError_1.InventoryTargetingError, "LabelEntityAssociationError": labelEntityAssociationError_1.LabelEntityAssociationError, "LineItemActivityAssociationError": lineItemActivityAssociationError_1.LineItemActivityAssociationError, "LineItemCreativeAssociationError": lineItemCreativeAssociationError_1.LineItemCreativeAssociationError, "LineItemError": lineItemError_1.LineItemError, "LineItemFlightDateError": lineItemFlightDateError_1.LineItemFlightDateError, "LineItemOperationError": lineItemOperationError_1.LineItemOperationError, "Money": money_1.Money, "NotNullError": notNullError_1.NotNullError, "NullError": nullError_1.NullError, "NumberValue": numberValue_1.NumberValue, "OrderAction": orderAction_1.OrderAction, "OrderActionError": orderActionError_1.OrderActionError, "Order": order_1.Order, "OrderError": orderError_1.OrderError, "OrderPage": orderPage_1.OrderPage, "ParseError": parseError_1.ParseError, "PauseOrders": pauseOrders_1.PauseOrders, "PermissionError": permissionError_1.PermissionError, "ProgrammaticError": programmaticError_1.ProgrammaticError, "PublisherQueryLanguageContextError": publisherQueryLanguageContextError_1.PublisherQueryLanguageContextError, "PublisherQueryLanguageSyntaxError": publisherQueryLanguageSyntaxError_1.PublisherQueryLanguageSyntaxError, "QuotaError": quotaError_1.QuotaError, "RangeError": RangeError, "RequiredCollectionError": requiredCollectionError_1.RequiredCollectionError, "RequiredError": requiredError_1.RequiredError, "RequiredNumberError": requiredNumberError_1.RequiredNumberError, "RequiredSizeError": requiredSizeError_1.RequiredSizeError, "ReservationDetailsError": reservationDetailsError_1.ReservationDetailsError, "ResumeAndOverbookOrders": resumeAndOverbookOrders_1.ResumeAndOverbookOrders, "ResumeOrders": resumeOrders_1.ResumeOrders, "RetractOrders": retractOrders_1.RetractOrders, "RetractOrdersWithoutReservationChanges": retractOrdersWithoutReservationChanges_1.RetractOrdersWithoutReservationChanges, "AudienceSegmentError": audienceSegmentError_1.AudienceSegmentError, "ServerError": serverError_1.ServerError, "SetTopBoxLineItemError": setTopBoxLineItemError_1.SetTopBoxLineItemError, "SetValue": setValue_1.SetValue, "SoapRequestHeader": soapRequestHeader_1.SoapRequestHeader, "SoapResponseHeader": soapResponseHeader_1.SoapResponseHeader, "Statement": statement_1.Statement, "StatementError": statementError_1.StatementError, "StringLengthError": stringLengthError_1.StringLengthError, "StringValueMapEntry": stringValueMapEntry_1.StringValueMapEntry, "SubmitOrdersForApproval": submitOrdersForApproval_1.SubmitOrdersForApproval, "SubmitOrdersForApprovalAndOverbook": submitOrdersForApprovalAndOverbook_1.SubmitOrdersForApprovalAndOverbook, "SubmitOrdersForApprovalWithoutReservationChanges": submitOrdersForApprovalWithoutReservationChanges_1.SubmitOrdersForApprovalWithoutReservationChanges, "TeamError": teamError_1.TeamError, "TechnologyTargetingError": technologyTargetingError_1.TechnologyTargetingError, "TemplateInstantiatedCreativeError": templateInstantiatedCreativeError_1.TemplateInstantiatedCreativeError, "TextValue": textValue_1.TextValue, "TimeZoneError": timeZoneError_1.TimeZoneError, "TypeError": TypeError, "UnarchiveOrders": unarchiveOrders_1.UnarchiveOrders, "UniqueError": uniqueError_1.UniqueError, "UpdateResult": updateResult_1.UpdateResult, "UserDomainTargetingError": userDomainTargetingError_1.UserDomainTargetingError, "Value": value_1.Value, "VideoPositionTargetingError": videoPositionTargetingError_1.VideoPositionTargetingError, "createOrders": CreateOrders, "createOrdersResponse": CreateOrdersResponse, "getOrdersByStatement": GetOrdersByStatement, "getOrdersByStatementResponse": GetOrdersByStatementResponse, "performOrderAction": PerformOrderAction, "performOrderActionResponse": PerformOrderActionResponse, "updateOrders": UpdateOrders, "updateOrdersResponse": UpdateOrdersResponse, }; exports.OrderService = OrderService;