Skip to content

Commit

Permalink
chore: add constant for api_version
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsSudip committed Aug 26, 2024
1 parent b0fd614 commit 4776544
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 75 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
const { getMappingConfig } = require('../../util');

const BASE_ENDPOINT = 'https://googleads.googleapis.com/v17/customers';
const API_VERSION = 'v17';

const BASE_ENDPOINT = `https://googleads.googleapis.com/${API_VERSION}/customers`;
const CONFIG_CATEGORIES = {
AUDIENCE_LIST: { type: 'audienceList', name: 'offlineDataJobs' },
ADDRESSINFO: { type: 'addressInfo', name: 'addressInfo' },
Expand All @@ -22,6 +24,7 @@ const consentConfigMap = {
};

module.exports = {
API_VERSION,
BASE_ENDPOINT,
TYPEOFLIST,
attributeMapping,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import {
generateProxyV1Payload,
} from '../../../testUtils';

import { API_VERSION } from '../../../../../src/v0/destinations/google_adwords_remarketing_lists/config';

export const commonHeaders = {
Authorization: 'Bearer dummy-access',
'Content-Type': 'application/json',
Expand Down Expand Up @@ -120,7 +122,7 @@ export const testScenariosForV0API = [
headers: commonHeaders,
params: commonParams,
JSON: validRequestPayload1,
endpoint: 'https://googleads.googleapis.com/v15/customers/7693729833/offlineUserDataJobs',
endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`,
}),
method: 'POST',
},
Expand Down Expand Up @@ -154,7 +156,7 @@ export const testScenariosForV0API = [
headers: commonHeaders,
params: commonParams,
JSON: invalidArgumentRequestPayload,
endpoint: 'https://googleads.googleapis.com/v15/customers/7693729834/offlineUserDataJobs',
endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729834/offlineUserDataJobs`,
}),
method: 'POST',
},
Expand Down Expand Up @@ -217,7 +219,7 @@ export const testScenariosForV0API = [
headers: commonHeaders,
params: commonParams,
JSON: validRequestPayload2,
endpoint: 'https://googleads.googleapis.com/v15/customers/7693729833/offlineUserDataJobs',
endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`,
}),
method: 'POST',
},
Expand Down Expand Up @@ -255,8 +257,7 @@ export const testScenariosForV1API = [
headers: commonHeaders,
params: commonParams,
JSON: validRequestPayload1,
endpoint:
'https://googleads.googleapis.com/v15/customers/7693729833/offlineUserDataJobs',
endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`,
},
metadataArray,
),
Expand Down Expand Up @@ -299,8 +300,7 @@ export const testScenariosForV1API = [
headers: commonHeaders,
params: commonParams,
JSON: invalidArgumentRequestPayload,
endpoint:
'https://googleads.googleapis.com/v15/customers/7693729834/offlineUserDataJobs',
endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729834/offlineUserDataJobs`,
},
metadataArray,
),
Expand Down Expand Up @@ -346,8 +346,7 @@ export const testScenariosForV1API = [
headers: commonHeaders,
params: commonParams,
JSON: validRequestPayload2,
endpoint:
'https://googleads.googleapis.com/v15/customers/7693729833/offlineUserDataJobs',
endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`,
},
metadataArray,
),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { enhanceRequestOptions, getFormData } from '../../../../src/adapters/network';
import { API_VERSION } from '../../../../src/v0/destinations/google_adwords_remarketing_lists/config';

export const networkCallsData = [
{
httpReq: {
url: 'https://googleads.googleapis.com/v15/customers/7693729833/offlineUserDataJobs:create',
url: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs:create`,
data: {
job: {
type: 'CUSTOMER_MATCH_USER_LIST',
Expand All @@ -29,7 +29,7 @@ export const networkCallsData = [
},
{
httpReq: {
url: 'https://googleads.googleapis.com/v15/customers/7693729833/offlineUserDataJobs/18025019461:addOperations',
url: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs/18025019461:addOperations`,
data: {
enablePartialFailure: true,
operations: [
Expand Down Expand Up @@ -71,7 +71,7 @@ export const networkCallsData = [
},
{
httpReq: {
url: 'https://googleads.googleapis.com/v15/customers/7693729833/offlineUserDataJobs/18025019461:run',
url: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs/18025019461:run`,
headers: {
Authorization: 'Bearer dummy-access',
'Content-Type': 'application/json',
Expand All @@ -85,7 +85,7 @@ export const networkCallsData = [
},
{
httpReq: {
url: 'https://googleads.googleapis.com/v15/customers/7693729834/offlineUserDataJobs:create',
url: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729834/offlineUserDataJobs:create`,
data: {
job: {
type: 'CUSTOMER_MATCH_USER_LIST',
Expand All @@ -111,7 +111,7 @@ export const networkCallsData = [
},
{
httpReq: {
url: 'https://googleads.googleapis.com/v15/customers/7693729834/offlineUserDataJobs/18025019462:addOperations',
url: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729834/offlineUserDataJobs/18025019462:addOperations`,
data: {
enablePartialFailure: true,
operations: [{ create: { userIdentifiers: [{ hashedEmail: '[email protected]' }] } }],
Expand Down Expand Up @@ -167,7 +167,7 @@ export const networkCallsData = [
},
{
httpReq: {
url: 'https://googleads.googleapis.com/v15/customers/7693729833/offlineUserDataJobs/18025019461:addOperations',
url: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs/18025019461:addOperations`,
data: {
enablePartialFailure: true,
operations: [
Expand Down Expand Up @@ -209,7 +209,7 @@ export const networkCallsData = [
},
{
httpReq: {
url: 'https://googleads.googleapis.com/v17/customers/customerid/offlineUserDataJobs:create',
url: `https://googleads.googleapis.com/${API_VERSION}/customers/customerid/offlineUserDataJobs:create`,
data: {
job: {
type: 'CUSTOMER_MATCH_USER_LIST',
Expand Down Expand Up @@ -243,7 +243,7 @@ export const networkCallsData = [
},
{
httpReq: {
url: 'https://googleads.googleapis.com/v17/customers/customerid/offlineUserDataJobs:create',
url: `https://googleads.googleapis.com/${API_VERSION}/customers/customerid/offlineUserDataJobs:create`,
data: {
job: {
type: 'CUSTOMER_MATCH_USER_LIST',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { API_VERSION } from '../../../../../src/v0/destinations/google_adwords_remarketing_lists/config';
export const data = [
{
name: 'google_adwords_remarketing_lists',
Expand Down Expand Up @@ -69,8 +70,7 @@ export const data = [
version: '1',
type: 'REST',
method: 'POST',
endpoint:
'https://googleads.googleapis.com/v17/customers/7693729833/offlineUserDataJobs',
endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`,
headers: {
Authorization: 'Bearer dummy-access',
'Content-Type': 'application/json',
Expand Down Expand Up @@ -202,8 +202,7 @@ export const data = [
version: '1',
type: 'REST',
method: 'POST',
endpoint:
'https://googleads.googleapis.com/v17/customers/7693729833/offlineUserDataJobs',
endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`,
headers: {
Authorization: 'Bearer dummy-access',
'Content-Type': 'application/json',
Expand Down Expand Up @@ -322,8 +321,7 @@ export const data = [
version: '1',
type: 'REST',
method: 'POST',
endpoint:
'https://googleads.googleapis.com/v17/customers/7693729833/offlineUserDataJobs',
endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`,
headers: {
Authorization: 'Bearer dummy-access',
'Content-Type': 'application/json',
Expand Down Expand Up @@ -1424,8 +1422,7 @@ export const data = [
version: '1',
type: 'REST',
method: 'POST',
endpoint:
'https://googleads.googleapis.com/v17/customers/7693729833/offlineUserDataJobs',
endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`,
headers: {
Authorization: 'Bearer dummy-access',
'Content-Type': 'application/json',
Expand Down Expand Up @@ -2819,8 +2816,7 @@ export const data = [
version: '1',
type: 'REST',
method: 'POST',
endpoint:
'https://googleads.googleapis.com/v17/customers/7693729833/offlineUserDataJobs',
endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`,
headers: {
Authorization: 'Bearer dummy-access',
'Content-Type': 'application/json',
Expand Down Expand Up @@ -2899,8 +2895,7 @@ export const data = [
version: '1',
type: 'REST',
method: 'POST',
endpoint:
'https://googleads.googleapis.com/v17/customers/7693729833/offlineUserDataJobs',
endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`,
headers: {
Authorization: 'Bearer dummy-access',
'Content-Type': 'application/json',
Expand Down Expand Up @@ -4112,8 +4107,7 @@ export const data = [
version: '1',
type: 'REST',
method: 'POST',
endpoint:
'https://googleads.googleapis.com/v17/customers/7693729833/offlineUserDataJobs',
endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`,
headers: {
Authorization: 'Bearer dummy-access',
'Content-Type': 'application/json',
Expand Down Expand Up @@ -5412,8 +5406,7 @@ export const data = [
version: '1',
type: 'REST',
method: 'POST',
endpoint:
'https://googleads.googleapis.com/v17/customers/7693729833/offlineUserDataJobs',
endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`,
headers: {
Authorization: 'Bearer dummy-access',
'Content-Type': 'application/json',
Expand Down Expand Up @@ -6789,8 +6782,7 @@ export const data = [
version: '1',
type: 'REST',
method: 'POST',
endpoint:
'https://googleads.googleapis.com/v17/customers/7693729833/offlineUserDataJobs',
endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`,
headers: {
Authorization: 'Bearer dummy-access',
'Content-Type': 'application/json',
Expand Down Expand Up @@ -8099,8 +8091,7 @@ export const data = [
version: '1',
type: 'REST',
method: 'POST',
endpoint:
'https://googleads.googleapis.com/v17/customers/7693729833/offlineUserDataJobs',
endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`,
headers: {
Authorization: 'Bearer dummy-access',
'Content-Type': 'application/json',
Expand Down Expand Up @@ -9399,8 +9390,7 @@ export const data = [
version: '1',
type: 'REST',
method: 'POST',
endpoint:
'https://googleads.googleapis.com/v17/customers/7693729833/offlineUserDataJobs',
endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`,
headers: {
Authorization: 'Bearer dummy-access',
'Content-Type': 'application/json',
Expand Down Expand Up @@ -10794,8 +10784,7 @@ export const data = [
version: '1',
type: 'REST',
method: 'POST',
endpoint:
'https://googleads.googleapis.com/v17/customers/7693729833/offlineUserDataJobs',
endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`,
headers: {
Authorization: 'Bearer dummy-access',
'Content-Type': 'application/json',
Expand Down Expand Up @@ -10874,8 +10863,7 @@ export const data = [
version: '1',
type: 'REST',
method: 'POST',
endpoint:
'https://googleads.googleapis.com/v17/customers/7693729833/offlineUserDataJobs',
endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`,
headers: {
Authorization: 'Bearer dummy-access',
'Content-Type': 'application/json',
Expand Down Expand Up @@ -11049,8 +11037,7 @@ export const data = [
version: '1',
type: 'REST',
method: 'POST',
endpoint:
'https://googleads.googleapis.com/v17/customers/7693729833/offlineUserDataJobs',
endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`,
headers: {
Authorization: 'Bearer dummy-access',
'Content-Type': 'application/json',
Expand Down Expand Up @@ -11127,8 +11114,7 @@ export const data = [
version: '1',
type: 'REST',
method: 'POST',
endpoint:
'https://googleads.googleapis.com/v17/customers/7693729833/offlineUserDataJobs',
endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`,
headers: {
Authorization: 'Bearer dummy-access',
'Content-Type': 'application/json',
Expand Down Expand Up @@ -11271,8 +11257,7 @@ export const data = [
version: '1',
type: 'REST',
method: 'POST',
endpoint:
'https://googleads.googleapis.com/v17/customers/7693729833/offlineUserDataJobs',
endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`,
headers: {
Authorization: 'Bearer dummy-access',
'Content-Type': 'application/json',
Expand Down Expand Up @@ -11478,8 +11463,7 @@ export const data = [
version: '1',
type: 'REST',
method: 'POST',
endpoint:
'https://googleads.googleapis.com/v17/customers/7693729833/offlineUserDataJobs',
endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`,
headers: {
Authorization: 'Bearer dummy-access',
'Content-Type': 'application/json',
Expand Down Expand Up @@ -11617,8 +11601,7 @@ export const data = [
version: '1',
type: 'REST',
method: 'POST',
endpoint:
'https://googleads.googleapis.com/v17/customers/7693729833/offlineUserDataJobs',
endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`,
headers: {
Authorization: 'Bearer dummy-access',
'Content-Type': 'application/json',
Expand Down Expand Up @@ -11755,8 +11738,7 @@ export const data = [
version: '1',
type: 'REST',
method: 'POST',
endpoint:
'https://googleads.googleapis.com/v17/customers/7693729833/offlineUserDataJobs',
endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`,
headers: {
Authorization: 'Bearer dummy-access',
'Content-Type': 'application/json',
Expand Down Expand Up @@ -11895,8 +11877,7 @@ export const data = [
version: '1',
type: 'REST',
method: 'POST',
endpoint:
'https://googleads.googleapis.com/v17/customers/7693729833/offlineUserDataJobs',
endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`,
headers: {
Authorization: 'Bearer dummy-access',
'Content-Type': 'application/json',
Expand Down Expand Up @@ -12038,8 +12019,7 @@ export const data = [
version: '1',
type: 'REST',
method: 'POST',
endpoint:
'https://googleads.googleapis.com/v17/customers/7693729833/offlineUserDataJobs',
endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`,
headers: {
Authorization: 'Bearer dummy-access',
'Content-Type': 'application/json',
Expand Down
Loading

0 comments on commit 4776544

Please sign in to comment.