mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-14 00:24:07 -08:00
d2b97c0713
* 👕 Enable rule `node-class-description-non-core-color-present` * 👕 Apply rule to remove deprecated `color` * ✏️ Fix unrelated typos * ✏️ Fix another unrelated typo Co-authored-by: Michael Kret <michael.k@radency.com>
72 lines
1.6 KiB
TypeScript
72 lines
1.6 KiB
TypeScript
import { INodeType, INodeTypeDescription } from 'n8n-workflow';
|
|
|
|
import { campaignFields, campaignOperations } from './CampaignDescription';
|
|
|
|
export class GoogleAds implements INodeType {
|
|
description: INodeTypeDescription = {
|
|
displayName: 'Google Ads',
|
|
name: 'googleAds',
|
|
icon: 'file:googleAds.svg',
|
|
group: ['transform'],
|
|
version: 1,
|
|
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
|
|
description: 'Use the Google Ads API',
|
|
defaults: {
|
|
name: 'Google Ads',
|
|
},
|
|
inputs: ['main'],
|
|
outputs: ['main'],
|
|
credentials: [
|
|
{
|
|
name: 'googleAdsOAuth2Api',
|
|
required: true,
|
|
testedBy: {
|
|
request: {
|
|
method: 'GET',
|
|
url: '/v9/customers:listAccessibleCustomers',
|
|
},
|
|
},
|
|
},
|
|
],
|
|
requestDefaults: {
|
|
returnFullResponse: true,
|
|
baseURL: 'https://googleads.googleapis.com',
|
|
headers: {
|
|
'developer-token': '={{$credentials.developerToken}}',
|
|
},
|
|
},
|
|
properties: [
|
|
{
|
|
displayName: 'Resource',
|
|
name: 'resource',
|
|
type: 'options',
|
|
noDataExpression: true,
|
|
options: [
|
|
{
|
|
name: 'Campaign',
|
|
value: 'campaign',
|
|
},
|
|
],
|
|
default: 'campaign',
|
|
},
|
|
//-------------------------------
|
|
// Campaign Operations
|
|
//-------------------------------
|
|
...campaignOperations,
|
|
{
|
|
displayName:
|
|
'Divide field names expressed with <i>micros</i> by 1,000,000 to get the actual value',
|
|
name: 'campaigsNotice',
|
|
type: 'notice',
|
|
default: '',
|
|
displayOptions: {
|
|
show: {
|
|
resource: ['campaign'],
|
|
},
|
|
},
|
|
},
|
|
...campaignFields,
|
|
],
|
|
};
|
|
}
|