dfp-lib
Version:
This project hosts the Node.JS client library for the SOAP-based DFP API at Google.
168 lines (167 loc) • 9.72 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 updateResult_1 = require("../soap/updateResult");
const workflowRequestAction_1 = require("../soap/workflowRequestAction");
const statement_1 = require("../soap/statement");
const workflowRequestPage_1 = require("../soap/workflowRequestPage");
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 approveWorkflowApprovalRequests_1 = require("../soap/approveWorkflowApprovalRequests");
const authenticationError_1 = require("../soap/authenticationError");
const workflowRequest_1 = require("../soap/workflowRequest");
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 skipWorkflowExternalConditionRequests_1 = require("../soap/skipWorkflowExternalConditionRequests");
const featureError_1 = require("../soap/featureError");
const forecastError_1 = require("../soap/forecastError");
const internalApiError_1 = require("../soap/internalApiError");
const lineItemOperationError_1 = require("../soap/lineItemOperationError");
const notNullError_1 = require("../soap/notNullError");
const numberValue_1 = require("../soap/numberValue");
const parseError_1 = require("../soap/parseError");
const triggerWorkflowExternalConditionRequests_1 = require("../soap/triggerWorkflowExternalConditionRequests");
const permissionError_1 = require("../soap/permissionError");
const proposalActionError_1 = require("../soap/proposalActionError");
const publisherQueryLanguageContextError_1 = require("../soap/publisherQueryLanguageContextError");
const publisherQueryLanguageSyntaxError_1 = require("../soap/publisherQueryLanguageSyntaxError");
const quotaError_1 = require("../soap/quotaError");
const rejectWorkflowApprovalRequests_1 = require("../soap/rejectWorkflowApprovalRequests");
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 textValue_1 = require("../soap/textValue");
const value_1 = require("../soap/value");
const workflowActionError_1 = require("../soap/workflowActionError");
const workflowApprovalRequest_1 = require("../soap/workflowApprovalRequest");
const workflowExternalConditionRequest_1 = require("../soap/workflowExternalConditionRequest");
const workflowRequestError_1 = require("../soap/workflowRequestError");
class PerformWorkflowRequestActionResponse extends xmlElement_1.XMLElement {
constructor(rval = null) {
super();
this.rval = rval;
}
}
PerformWorkflowRequestActionResponse.XSI_TYPE = "";
class PerformWorkflowRequestAction extends xmlElement_1.XMLElement {
constructor(action = null, filterStatement = null) {
super();
this.action = action;
this.filterStatement = filterStatement;
}
}
PerformWorkflowRequestAction.XSI_TYPE = "";
class GetWorkflowRequestsByStatementResponse extends xmlElement_1.XMLElement {
constructor(rval = null) {
super();
this.rval = rval;
}
}
GetWorkflowRequestsByStatementResponse.XSI_TYPE = "";
class GetWorkflowRequestsByStatement extends xmlElement_1.XMLElement {
constructor(filterStatement = null) {
super();
this.filterStatement = filterStatement;
}
}
GetWorkflowRequestsByStatement.XSI_TYPE = "";
class WorkflowRequestService extends dfpService_1.DfpService {
constructor(user, options = {}) {
options['classmap'] = WorkflowRequestService.CLASS_MAP;
super(WorkflowRequestService.SERVICE_NAME, user, WorkflowRequestService.ENDPOINT, options);
}
getWorkflowRequestsByStatement(filterStatement) {
return __awaiter(this, void 0, void 0, function* () {
const args = new GetWorkflowRequestsByStatement(filterStatement);
const result = (yield this.client.__soapCall("getWorkflowRequestsByStatement", args)).getWorkflowRequestsByStatementResponse;
result.rval.results = (Array.isArray(result.rval.results)) ? result.rval.results :
(result.rval.results == null) ? [] : [result.rval.results];
return result.rval;
});
}
performWorkflowRequestAction(action, filterStatement) {
return __awaiter(this, void 0, void 0, function* () {
const args = new PerformWorkflowRequestAction(action, filterStatement);
const result = (yield this.client.__soapCall("performWorkflowRequestAction", args)).performWorkflowRequestActionResponse;
return result.rval;
});
}
}
WorkflowRequestService.SERVICE_NAME = "WorkflowRequestService";
WorkflowRequestService.ENDPOINT = "https://ads.google.com/apis/ads/publisher/v201611/WorkflowRequestService";
WorkflowRequestService.CLASS_MAP = {
"ObjectValue": objectValue_1.ObjectValue,
"ApiError": apiError_1.ApiError,
"ApiException": apiException_1.ApiException,
"ApiVersionError": apiVersionError_1.ApiVersionError,
"ApplicationException": applicationException_1.ApplicationException,
"ApproveWorkflowApprovalRequests": approveWorkflowApprovalRequests_1.ApproveWorkflowApprovalRequests,
"AuthenticationError": authenticationError_1.AuthenticationError,
"WorkflowRequest": workflowRequest_1.WorkflowRequest,
"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,
"SkipWorkflowExternalConditionRequests": skipWorkflowExternalConditionRequests_1.SkipWorkflowExternalConditionRequests,
"FeatureError": featureError_1.FeatureError,
"ForecastError": forecastError_1.ForecastError,
"InternalApiError": internalApiError_1.InternalApiError,
"LineItemOperationError": lineItemOperationError_1.LineItemOperationError,
"NotNullError": notNullError_1.NotNullError,
"NumberValue": numberValue_1.NumberValue,
"ParseError": parseError_1.ParseError,
"TriggerWorkflowExternalConditionRequests": triggerWorkflowExternalConditionRequests_1.TriggerWorkflowExternalConditionRequests,
"PermissionError": permissionError_1.PermissionError,
"ProposalActionError": proposalActionError_1.ProposalActionError,
"PublisherQueryLanguageContextError": publisherQueryLanguageContextError_1.PublisherQueryLanguageContextError,
"PublisherQueryLanguageSyntaxError": publisherQueryLanguageSyntaxError_1.PublisherQueryLanguageSyntaxError,
"QuotaError": quotaError_1.QuotaError,
"RejectWorkflowApprovalRequests": rejectWorkflowApprovalRequests_1.RejectWorkflowApprovalRequests,
"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,
"TextValue": textValue_1.TextValue,
"UpdateResult": updateResult_1.UpdateResult,
"Value": value_1.Value,
"WorkflowActionError": workflowActionError_1.WorkflowActionError,
"WorkflowApprovalRequest": workflowApprovalRequest_1.WorkflowApprovalRequest,
"WorkflowExternalConditionRequest": workflowExternalConditionRequest_1.WorkflowExternalConditionRequest,
"WorkflowRequestAction": workflowRequestAction_1.WorkflowRequestAction,
"WorkflowRequestError": workflowRequestError_1.WorkflowRequestError,
"WorkflowRequestPage": workflowRequestPage_1.WorkflowRequestPage,
"getWorkflowRequestsByStatement": GetWorkflowRequestsByStatement,
"getWorkflowRequestsByStatementResponse": GetWorkflowRequestsByStatementResponse,
"performWorkflowRequestAction": PerformWorkflowRequestAction,
"performWorkflowRequestActionResponse": PerformWorkflowRequestActionResponse,
};
exports.WorkflowRequestService = WorkflowRequestService;