UNPKG

dfp-lib

Version:

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

202 lines (201 loc) 10.7 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 userTeamAssociation_1 = require("../soap/userTeamAssociation"); const updateResult_1 = require("../soap/updateResult"); const userTeamAssociationAction_1 = require("../soap/userTeamAssociationAction"); const statement_1 = require("../soap/statement"); const userTeamAssociationPage_1 = require("../soap/userTeamAssociationPage"); const dfpService_1 = require("../lib/dfpService"); const objectValue_1 = require("../soap/objectValue"); 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 dfpDate_1 = require("../soap/dfpDate"); const dfpDateTime_1 = require("../soap/dfpDateTime"); const dateTimeValue_1 = require("../soap/dateTimeValue"); const dateValue_1 = require("../soap/dateValue"); const deleteUserTeamAssociations_1 = require("../soap/deleteUserTeamAssociations"); 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 statementError_1 = require("../soap/statementError"); const stringValueMapEntry_1 = require("../soap/stringValueMapEntry"); const teamError_1 = require("../soap/teamError"); const textValue_1 = require("../soap/textValue"); const userRecordTeamAssociation_1 = require("../soap/userRecordTeamAssociation"); const value_1 = require("../soap/value"); class UpdateUserTeamAssociationsResponse extends xmlElement_1.XMLElement { constructor(rval = null) { super(); this.rval = rval; } } UpdateUserTeamAssociationsResponse.XSI_TYPE = ""; class UpdateUserTeamAssociations extends xmlElement_1.XMLElement { constructor(userTeamAssociations = null) { super(); this.userTeamAssociations = userTeamAssociations; } } UpdateUserTeamAssociations.XSI_TYPE = ""; class PerformUserTeamAssociationActionResponse extends xmlElement_1.XMLElement { constructor(rval = null) { super(); this.rval = rval; } } PerformUserTeamAssociationActionResponse.XSI_TYPE = ""; class PerformUserTeamAssociationAction extends xmlElement_1.XMLElement { constructor(userTeamAssociationAction = null, statement = null) { super(); this.userTeamAssociationAction = userTeamAssociationAction; this.statement = statement; } } PerformUserTeamAssociationAction.XSI_TYPE = ""; class GetUserTeamAssociationsByStatementResponse extends xmlElement_1.XMLElement { constructor(rval = null) { super(); this.rval = rval; } } GetUserTeamAssociationsByStatementResponse.XSI_TYPE = ""; class GetUserTeamAssociationsByStatement extends xmlElement_1.XMLElement { constructor(filterStatement = null) { super(); this.filterStatement = filterStatement; } } GetUserTeamAssociationsByStatement.XSI_TYPE = ""; class CreateUserTeamAssociationsResponse extends xmlElement_1.XMLElement { constructor(rval = null) { super(); this.rval = rval; } } CreateUserTeamAssociationsResponse.XSI_TYPE = ""; class CreateUserTeamAssociations extends xmlElement_1.XMLElement { constructor(userTeamAssociations = null) { super(); this.userTeamAssociations = userTeamAssociations; } } CreateUserTeamAssociations.XSI_TYPE = ""; class UserTeamAssociationService extends dfpService_1.DfpService { constructor(user, options = {}) { options['classmap'] = UserTeamAssociationService.CLASS_MAP; super(UserTeamAssociationService.SERVICE_NAME, user, UserTeamAssociationService.ENDPOINT, options); } createUserTeamAssociations(userTeamAssociations) { return __awaiter(this, void 0, void 0, function* () { const args = new CreateUserTeamAssociations(userTeamAssociations); const result = (yield this.client.__soapCall("createUserTeamAssociations", args)).createUserTeamAssociationsResponse; return (Array.isArray(result.rval)) ? result.rval : (result.rval == null) ? [] : [result.rval]; }); } getUserTeamAssociationsByStatement(filterStatement) { return __awaiter(this, void 0, void 0, function* () { const args = new GetUserTeamAssociationsByStatement(filterStatement); const result = (yield this.client.__soapCall("getUserTeamAssociationsByStatement", args)).getUserTeamAssociationsByStatementResponse; result.rval.results = (Array.isArray(result.rval.results)) ? result.rval.results : (result.rval.results == null) ? [] : [result.rval.results]; return result.rval; }); } performUserTeamAssociationAction(userTeamAssociationAction, statement) { return __awaiter(this, void 0, void 0, function* () { const args = new PerformUserTeamAssociationAction(userTeamAssociationAction, statement); const result = (yield this.client.__soapCall("performUserTeamAssociationAction", args)).performUserTeamAssociationActionResponse; return result.rval; }); } updateUserTeamAssociations(userTeamAssociations) { return __awaiter(this, void 0, void 0, function* () { const args = new UpdateUserTeamAssociations(userTeamAssociations); const result = (yield this.client.__soapCall("updateUserTeamAssociations", args)).updateUserTeamAssociationsResponse; return (Array.isArray(result.rval)) ? result.rval : (result.rval == null) ? [] : [result.rval]; }); } } UserTeamAssociationService.SERVICE_NAME = "UserTeamAssociationService"; UserTeamAssociationService.ENDPOINT = "https://ads.google.com/apis/ads/publisher/v201611/UserTeamAssociationService"; UserTeamAssociationService.CLASS_MAP = { "ObjectValue": objectValue_1.ObjectValue, "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, "Date": dfpDate_1.DfpDate, "DateTime": dfpDateTime_1.DfpDateTime, "DateTimeValue": dateTimeValue_1.DateTimeValue, "DateValue": dateValue_1.DateValue, "DeleteUserTeamAssociations": deleteUserTeamAssociations_1.DeleteUserTeamAssociations, "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, "TeamError": teamError_1.TeamError, "TextValue": textValue_1.TextValue, "UpdateResult": updateResult_1.UpdateResult, "UserRecordTeamAssociation": userRecordTeamAssociation_1.UserRecordTeamAssociation, "UserTeamAssociationAction": userTeamAssociationAction_1.UserTeamAssociationAction, "UserTeamAssociation": userTeamAssociation_1.UserTeamAssociation, "UserTeamAssociationPage": userTeamAssociationPage_1.UserTeamAssociationPage, "Value": value_1.Value, "createUserTeamAssociations": CreateUserTeamAssociations, "createUserTeamAssociationsResponse": CreateUserTeamAssociationsResponse, "getUserTeamAssociationsByStatement": GetUserTeamAssociationsByStatement, "getUserTeamAssociationsByStatementResponse": GetUserTeamAssociationsByStatementResponse, "performUserTeamAssociationAction": PerformUserTeamAssociationAction, "performUserTeamAssociationActionResponse": PerformUserTeamAssociationActionResponse, "updateUserTeamAssociations": UpdateUserTeamAssociations, "updateUserTeamAssociationsResponse": UpdateUserTeamAssociationsResponse, }; exports.UserTeamAssociationService = UserTeamAssociationService;