@RequiresEnterpriseLicense(allowEval=true) @Connector(name="google-ad-manager", friendlyName="Google Ad Manager", minMuleVersion="3.9") @RequiresEntitlement(name="google-ad-manager", provider="Ricston-Ltd") public class GoogleAdManagerConnector extends Object
All processors can throw a AdManagerApiException when there is a problem with the request submitted to the API or a AdManagerCommunicationException if there is a communication problem with the API (such as timeouts etc.).
Constructor and Description |
---|
GoogleAdManagerConnector() |
Modifier and Type | Method and Description |
---|---|
Object |
create(CreateSelector selector,
Object objects)
Create Objects on a service.
|
com.google.api.ads.admanager.axis.v201902.ReportJob |
createReport(DownloadReportMethod createReportMethod,
String dimensions,
String columns,
String dimensionAttributes,
Date startDate,
Date endDate)
Creates a Report with the given parameters.
|
InputStream |
downloadReport(com.google.api.ads.admanager.axis.v201902.ReportJob reportJob,
ExportFormat exportFormat)
Download a Report from the Google Ad Manager service.
|
Object |
get(GetSelector selector)
Gets a object(s) depending on the service chosen.
|
com.google.api.ads.admanager.axis.v201902.AvailabilityForecast |
getAvailabilityForecast(com.google.api.ads.admanager.axis.v201902.ProspectiveLineItem prospectiveLineItem,
Boolean includeTargetingCriteriaBreakdown,
Boolean includeContendingLineItems,
com.google.api.ads.admanager.axis.v201902.ForecastBreakdownOptions forecastBreakdownOptions)
Retrieve the Availability Forecast for the given prospective Line Item.
|
com.google.api.ads.admanager.axis.v201902.AvailabilityForecast |
getAvailabilityForecastById(long lineItemId,
Boolean includeTargetingCriteriaBreakdown,
Boolean includeContendingLineItems,
com.google.api.ads.admanager.axis.v201902.ForecastBreakdownOptions forecastBreakdownOptions)
Retrieve the Availability Forecast for the given prospective Line Item ID.
|
Object |
getByStatement(GetByStatementSelector selector,
String queryString,
Map<String,Object> queryParams,
String queryOrder,
Integer queryOffset)
Retrieve object(s) that match the query.
|
AbstractConfig |
getConnectionStrategy()
Returns the connection strategy.
|
com.google.api.ads.admanager.axis.v201902.CustomFieldOption |
getCustomFieldOption(long customFieldOptionId)
Gets a Custom Field with the given Custom field Option ID.
|
com.google.api.ads.admanager.axis.v201902.DeliveryForecast |
getDeliveryForecast(List<com.google.api.ads.admanager.axis.v201902.ProspectiveLineItem> prospectiveLineItems,
String ignoredLineItems)
Retrieve the Delivery Forecast for the given prospective Line Items.
|
com.google.api.ads.admanager.axis.v201902.DeliveryForecast |
getDeliveryForecastByIds(String lineItemIds,
String ignoredLineItems)
Retrieve the Delivery Forecast for the given prospective Line Item IDs.
|
String |
getReportDownloadUrl(long reportJobId,
com.google.api.ads.admanager.axis.v201902.ReportDownloadOptions reportDownloadOptions)
Gets the URL containing the Report generated.
|
com.google.api.ads.admanager.axis.v201902.ReportJobStatus |
getReportJobStatus(long reportJobId)
Gets the status of a created Report Job.
|
Integer |
perform(String selector,
String queryString,
Map<String,Object> queryParams)
Perform action onto objects.
|
List<String[]> |
selectPql(String selectCols,
String fromTable,
String queryString,
Map<String,Object> queryParams,
String queryOrder,
Integer queryOffset)
Method for executing a PQL (Publisher-Query-Language) select statement to
retrieve data from Google Ad Manager.
|
void |
setConnectionStrategy(AbstractConfig connectionStrategy)
Sets the connection strategy according to the provided one.
|
Object |
update(UpdateSelector selector,
Object items)
Update a list of Objects.
|
public AbstractConfig getConnectionStrategy()
AbstractConfig
Google Ad Manager connection strategypublic void setConnectionStrategy(AbstractConfig connectionStrategy)
connectionStrategy
- AbstractConfig
Google Ad Manager connection strategy@Processor(friendlyName="Download Report") @MetaDataScope(value=DownloadReportDataSense.class) public InputStream downloadReport(@Default(value="#[payload]") @RefOnly com.google.api.ads.admanager.axis.v201902.ReportJob reportJob, @MetaDataKeyParam(affects=OUTPUT) @Default(value="XML") ExportFormat exportFormat) throws AdManagerException
reportJob
- the Report Job for which the download needs to be generatedexportFormat
- the format in which the document should be producedInputStream
containing a dump of the reportAdManagerException
- AdManagerApiException
if there is a problem with the
request made to the API. AdManagerCommunicationException
if there is a communication problem with the API (such as
timeouts etc.)@Processor(friendlyName="Get Report Download URL") public String getReportDownloadUrl(long reportJobId, com.google.api.ads.admanager.axis.v201902.ReportDownloadOptions reportDownloadOptions) throws AdManagerCommunicationException
reportJobId
- the Report Job ID (refer to Create
Report)reportDownloadOptions
- Report Download Options a POJO containing the report download
optionsString
containing the URL location of the ReportAdManagerCommunicationException
- if there is a communication problem with the API (such as
timeouts etc.)@Processor(friendlyName="Select PQL") public List<String[]> selectPql(@Default(value="*") String selectCols, String fromTable, String queryString, Map<String,Object> queryParams, @Default(value="ASC") String queryOrder, @Default(value="0") Integer queryOffset) throws AdManagerCommunicationException
selectCols
- a comma-delimited list of columns to be selected, if it's left
blank or an asterisk ('*') is used every column will be returnedfromTable
- the name of the table from which the data will be obtainedqueryString
- the query string to filter the objects The query string is written
as id=:id, in turns the queryParams must contain
the parameter specified (e.g. :id)queryParams
- the query parameters to filter the objects, these parameters
should match the promised parameters specified in the queryString
parameterqueryOrder
- the order in which the results will be retrievedqueryOffset
- the query limit for the statementEach element of the List is a row of the table which contains an array with the values of every columns, with the first element of the list containing the names of every column for which data have been obtained.
AdManagerCommunicationException
- if there is a communication problem with the API (such as
timeouts etc.)@MetaDataScope(value=GetByStatementSelectorDataSense.class) @Processor(friendlyName="Get by Statement") public Object getByStatement(@MetaDataKeyParam(affects=OUTPUT) @Placement(order=0,group="Service") @FriendlyName(value="Service") GetByStatementSelector selector, String queryString, Map<String,Object> queryParams, @Default(value="ASC") String queryOrder, @Default(value="0") Integer queryOffset) throws AdManagerException, SelectorException
selector
- the object that will be retrievedqueryString
- the query string to filter the objects The query string is written
as id=:id, in turns the queryParams
must contain the parameter specified (e.g. :id)queryParams
- the query parameters to filter the objects, these parameters
should match the promised parameters specified in the
queryString
parameterqueryOrder
- the order in which the results will be retrievedqueryOffset
- the query offset for the statementAdManagerException
- when : a) Exception is raised by the API, in this case a specific
AdManagerApiException
is thrown b) Exception is raised
because of a communication problem with the API
AdManagerCommunicationException
c) Exception is raised
because of an incorrect action AdManagerException
SelectorException
- if service chosen is not supported@Processor @MetaDataScope(value=GetSelectorDataSense.class) public Object get(@MetaDataKeyParam(affects=OUTPUT) @Placement(order=0,group="Service") @FriendlyName(value="Service") GetSelector selector) throws SelectorException, AdManagerApiException, AdManagerCommunicationException
selector
- the object that will be retrievedUser
or
List
of
Role
SelectorException
- if selector provided does not match a serviceAdManagerCommunicationException
- If there are exceptions related to communication with the Google
Ad Manager ServiceAdManagerApiException
- if there is a problem with the request made to the API.@Processor @MetaDataScope(value=PerformSelectorDataSense.class) public Integer perform(@MetaDataKeyParam(labels={"Service","Action"}) String selector, String queryString, Map<String,Object> queryParams) throws AdManagerException, SelectorException
queryString
- the query string to filter the objects the query string is written
as id=:id, in turns the queryParams must contain
the parameter specified (e.g. :id)queryParams
- the query parameters to filter the objects, these parameters
should match the promised parameters specified in the queryString
parameterselector
- the service that an action should be performed on, and the action
to be perform.
The string should take form of object||action such as Ad Units||Activate Ad Units.
Supported objects can be found in the
PerformSelector
enum, the actions supported match the ones in the Google
Ad Manager documentation
AdManagerException
- when :
AdManagerApiException
is thrown
AdManagerCommunicationException
AdManagerException
SelectorException
- if service chosen is not supported@Processor @MetaDataScope(value=CreateSelectorDataSense.class) public Object create(@MetaDataKeyParam(affects=BOTH) @Placement(order=0,group="Service") @FriendlyName(value="Service") CreateSelector selector, @Default(value="#[payload]") @RefOnly Object objects) throws AdManagerApiException, AdManagerCommunicationException, SelectorException
objects
- List<Object>
Objects to be created (different depending on
the service chosen)selector
- the type of object being created (see CreateSelector
)AdManagerApiException
- if there is a problem with the request made to the API.AdManagerCommunicationException
- if there is a communication problem with the API (such as
timeouts etc.)SelectorException
- if service chosen is not supported@MetaDataScope(value=UpdateSelectorDataSense.class) @Processor public Object update(@MetaDataKeyParam(affects=BOTH) @Placement(order=0,group="Service") @FriendlyName(value="Service") UpdateSelector selector, @Default(value="#[payload]") @RefOnly Object items) throws SelectorException, AdManagerCommunicationException, AdManagerApiException
selector
- the update operation to be performeditems
- the items to be updatedSelectorException
- if service chosen is not supportedAdManagerCommunicationException
- if there is a communication problem with the API (such as
timeouts etc.)AdManagerApiException
- if there is a problem with the request made to the API.@Processor(friendlyName="Create Report") public com.google.api.ads.admanager.axis.v201902.ReportJob createReport(DownloadReportMethod createReportMethod, String dimensions, String columns, @Optional String dimensionAttributes, Date startDate, Date endDate) throws AdManagerException
createReportMethod
- whether sync (wait for report to be created) or async (refer to
Get Report Job Status)dimensions
- comma-delimited dimensions listcolumns
- comma-delimited columns listdimensionAttributes
- comma-delimited dimension attributes liststartDate
- the start of the Report dateendDate
- the end of the report dateAdManagerException
- when : a) Exception is raised by the API, in this case a specific
AdManagerApiException
is thrown b) Exception is raised
because of a communication problem with the API
AdManagerCommunicationException
c) Exception is raised
because of an incorrect action AdManagerException
@Processor(friendlyName="Get Custom Field Option") public com.google.api.ads.admanager.axis.v201902.CustomFieldOption getCustomFieldOption(long customFieldOptionId) throws AdManagerApiException, AdManagerCommunicationException
customFieldOptionId
- the ID of the Custom field OptionAdManagerCommunicationException
- if there is a communication problem with the API (such as
timeouts etc.)AdManagerApiException
- if there is a problem with the request made to the API.@Processor(friendlyName="Get Report Job Status") public com.google.api.ads.admanager.axis.v201902.ReportJobStatus getReportJobStatus(long reportJobId) throws AdManagerApiException
DownloadReportMethod
set as Async)reportJobId
- the ID of the Report JobReportJobStatus
the job status of the Report that has the ID
submittedAdManagerApiException
- if there is a problem with the request made to the API.@Processor(friendlyName="Get Availability Forecast") public com.google.api.ads.admanager.axis.v201902.AvailabilityForecast getAvailabilityForecast(@RefOnly @Default(value="#[payload]") com.google.api.ads.admanager.axis.v201902.ProspectiveLineItem prospectiveLineItem, @Optional Boolean includeTargetingCriteriaBreakdown, @Optional Boolean includeContendingLineItems, com.google.api.ads.admanager.axis.v201902.ForecastBreakdownOptions forecastBreakdownOptions) throws AdManagerApiException, AdManagerCommunicationException
prospectiveLineItem
- the prospective Line Item to retrieve the Availability Forecast
forincludeTargetingCriteriaBreakdown
- boolean to include or not targeting criteria breakdownincludeContendingLineItems
- boolean to include or not contending Line ItemsforecastBreakdownOptions
- Configuration of the forecast breakdownAvailabilityForecast
the Availability Forecast for the
prospective Line Item given by parameterAdManagerCommunicationException
- if there is a communication problem with the API (such as
timeouts etc.)AdManagerApiException
- if there is a problem with the request made to the API.@Processor(friendlyName="Get Availability Forecast by ID") public com.google.api.ads.admanager.axis.v201902.AvailabilityForecast getAvailabilityForecastById(long lineItemId, @Optional Boolean includeTargetingCriteriaBreakdown, @Optional Boolean includeContendingLineItems, com.google.api.ads.admanager.axis.v201902.ForecastBreakdownOptions forecastBreakdownOptions) throws AdManagerApiException, AdManagerCommunicationException
lineItemId
- the prospective Line Item ID for retrieve the Availability
ForecastincludeTargetingCriteriaBreakdown
- boolean for include or not targeting criteria breakdownincludeContendingLineItems
- boolean for include or not contending Line ItemsforecastBreakdownOptions
- configuration of the forecast breakdownAvailabilityForecast
the Availability Forecast for the
prospective Line Item ID given by parameterAdManagerCommunicationException
- if there is a communication problem with the API (such as
timeouts etc.)AdManagerApiException
- if there is a problem with the request made to the API.@Processor(friendlyName="Get Delivery Forecast by IDs") public com.google.api.ads.admanager.axis.v201902.DeliveryForecast getDeliveryForecastByIds(@Optional String lineItemIds, @Optional String ignoredLineItems) throws AdManagerApiException, AdManagerCommunicationException, AdManagerUserException
lineItemIds
- comma-delimited list of IDs for the Line Items to includeignoredLineItems
- comma-delimited list of IDs for the Line Items to ignoreDeliveryForecast
the Delivery Forecast for the prospective
Line Item IDs given by parameterAdManagerCommunicationException
- if there is a communication problem with the API (such as
timeouts etc.)AdManagerApiException
- if there is a problem with the request made to the API.AdManagerUserException
- if there is a user error when using the operation.@Processor(friendlyName="Get Delivery Forecast") public com.google.api.ads.admanager.axis.v201902.DeliveryForecast getDeliveryForecast(@RefOnly @Default(value="#[payload]") List<com.google.api.ads.admanager.axis.v201902.ProspectiveLineItem> prospectiveLineItems, @Optional String ignoredLineItems) throws AdManagerApiException, AdManagerCommunicationException
prospectiveLineItems
- list of prospective Line Items for the Delivery ForecastignoredLineItems
- comma-delimited list of IDs for the Line Items to ignoreDeliveryForecast
the Delivery Forecast for the prospective
Line Items given by parameterAdManagerCommunicationException
- if there is a communication problem with the API (such as
timeouts etc.)AdManagerApiException
- if there is a problem with the request made to the API.Copyright © 2010–2019. All rights reserved.