Skip to content

Commit

Permalink
chore: update api version to 17 from 16 (#3669)
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsSudip authored Aug 30, 2024
2 parents 26926c4 + 30a804c commit b03eee9
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 79 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/v16/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
@@ -1,5 +1,5 @@
const { populateIdentifiers, responseBuilder } = require('./util');

const { API_VERSION } = require('./config');
const accessToken = 'abcd1234';
const developerToken = 'ijkl9101';
const body = {
Expand Down Expand Up @@ -66,7 +66,7 @@ const expectedResponse = {
version: '1',
type: 'REST',
method: 'POST',
endpoint: 'https://googleads.googleapis.com/v16/customers/7693729833/offlineUserDataJobs',
endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/7693729833/offlineUserDataJobs`,
headers: {
Authorization: 'Bearer abcd1234',
'Content-Type': 'application/json',
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,5 +1,6 @@
import { generateMetadata, generateProxyV1Payload } from '../../../testUtils';
import { commonHeaders, commonParams, validRequestPayload1 } from './business';
import { API_VERSION } from '../../../../../src/v0/destinations/google_adwords_remarketing_lists/config';

const commonStatTags = {
destType: 'GOOGLE_ADWORDS_REMARKETING_LISTS',
Expand Down Expand Up @@ -29,7 +30,7 @@ export const oauthError = [
headers: commonHeaders,
params: commonParams,
JSON: validRequestPayload1,
endpoint: 'https://googleads.googleapis.com/v16/customers/customerid/offlineUserDataJobs',
endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/customerid/offlineUserDataJobs`,
accessToken: 'dummy-access',
}),
method: 'POST',
Expand Down Expand Up @@ -84,7 +85,7 @@ export const oauthError = [
headers: { ...commonHeaders, Authorization: 'Bearer wrongCustomerID' },
params: { ...commonParams, customerId: 'wrongCustomerID' },
JSON: validRequestPayload1,
endpoint: 'https://googleads.googleapis.com/v16/customers/customerid/offlineUserDataJobs',
endpoint: `https://googleads.googleapis.com/${API_VERSION}/customers/customerid/offlineUserDataJobs`,
accessToken: 'wrongCustomerID',
}),
method: 'POST',
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/v16/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/v16/customers/customerid/offlineUserDataJobs:create',
url: `https://googleads.googleapis.com/${API_VERSION}/customers/customerid/offlineUserDataJobs:create`,
data: {
job: {
type: 'CUSTOMER_MATCH_USER_LIST',
Expand Down
Loading

0 comments on commit b03eee9

Please sign in to comment.