Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto-generated nodejs SDK code update
Summary: ignore-conflict-markers Reviewed By: jingping2015 Differential Revision: D17326747 fbshipit-source-id: 0cb4402e
- Loading branch information
1 parent
9772ddd
commit a0ae6de
Showing
14 changed files
with
151 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/** | ||
* Copyright (c) 2017-present, Facebook, Inc. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* @flow | ||
*/ | ||
|
||
'use strict'; | ||
const bizSdk = require('facebook-nodejs-business-sdk'); | ||
const AdAccount = bizSdk.AdAccount; | ||
const AdSet = bizSdk.AdSet; | ||
|
||
const access_token = '<ACCESS_TOKEN>'; | ||
const app_secret = '<APP_SECRET>'; | ||
const app_id = '<APP_ID>'; | ||
const id = '<AD_ACCOUNT_ID>'; | ||
const api = bizSdk.FacebookAdsApi.init(access_token); | ||
const showDebugingInfo = true; // Setting this to true shows more debugging info. | ||
if (showDebugingInfo) { | ||
api.setDebug(true); | ||
} | ||
|
||
const logApiCallResult = (apiCallName, data) => { | ||
console.log(apiCallName); | ||
if (showDebugingInfo) { | ||
console.log('Data:' + JSON.stringify(data)); | ||
} | ||
}; | ||
|
||
let fields, params; | ||
fields = [ | ||
]; | ||
params = { | ||
'name' : 'Mobile App Installs Ad Set', | ||
'daily_budget' : '1000', | ||
'bid_amount' : '2', | ||
'billing_event' : 'IMPRESSIONS', | ||
'optimization_goal' : 'APP_INSTALLS', | ||
'campaign_id' : '<adCampaignAppInstallsID>', | ||
'promoted_object' : {'application_id':'<appID>','object_store_url':'<appLink>'}, | ||
'targeting' : {'device_platforms':['mobile'],'facebook_positions':['feed'],'geo_locations':{'countries':['US']},'publisher_platforms':['facebook','audience_network'],'user_os':['IOS']}, | ||
'status' : 'PAUSED', | ||
}; | ||
const adsets = (new AdAccount(id)).createAdSet( | ||
fields, | ||
params | ||
); | ||
logApiCallResult('adsets api call complete.', adsets); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/** | ||
* Copyright (c) 2017-present, Facebook, Inc. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* @flow | ||
*/ | ||
import {AbstractCrudObject} from './../abstract-crud-object'; | ||
|
||
/** | ||
* StoreCatalogSettings | ||
* @extends AbstractCrudObject | ||
* @see {@link https://developers.facebook.com/docs/marketing-api/} | ||
*/ | ||
export default class StoreCatalogSettings extends AbstractCrudObject { | ||
static get Fields () { | ||
return Object.freeze({ | ||
id: 'id', | ||
page: 'page', | ||
}); | ||
} | ||
|
||
|
||
|
||
get (fields: Array<string>, params: Object = {}): StoreCatalogSettings { | ||
// $FlowFixMe : Support Generic Types | ||
return this.read( | ||
fields, | ||
params | ||
); | ||
} | ||
|
||
// $FlowFixMe : Support Generic Types | ||
update (fields: Array<string>, params: Object = {}): StoreCatalogSettings { | ||
// $FlowFixMe : Support Generic Types | ||
return super.update( | ||
params | ||
); | ||
} | ||
} |