Skip to content

Commit

Permalink
Auto-generated nodejs SDK code update
Browse files Browse the repository at this point in the history
Summary: ignore-conflict-markers

Reviewed By: jingping2015

Differential Revision: D16677967

fbshipit-source-id: 3511b915
  • Loading branch information
jingping2015 authored and facebook-github-bot committed Aug 8, 2019
1 parent 3c0785a commit 0368626
Show file tree
Hide file tree
Showing 24 changed files with 257 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "facebook-nodejs-business-sdk",
"version": "4.0.0",
"version": "4.0.1",
"description": "SDK for the Facebook Ads API in Javascript and Node.js",
"author": "Facebook",
"maintainers": [
Expand Down
3 changes: 3 additions & 0 deletions src/bundle.es6
Expand Up @@ -147,13 +147,15 @@ export { default as AudiencePermissionForActions } from './../src/objects/audien
export { default as AudioCopyright } from './../src/objects/audio-copyright';
export { default as AutomotiveModel } from './../src/objects/automotive-model';
export { default as BilledAmountDetails } from './../src/objects/billed-amount-details';
export { default as BrandAudience } from './../src/objects/brand-audience';
export { default as BrandSafetyBlockListUsage } from './../src/objects/brand-safety-block-list-usage';
export { default as BroadTargetingCategories } from './../src/objects/broad-targeting-categories';
export { default as Business } from './../src/objects/business';
export { default as BusinessAdAccountRequest } from './../src/objects/business-ad-account-request';
export { default as BusinessAdvertisableApplicationsResult } from './../src/objects/business-advertisable-applications-result';
export { default as BusinessAgreement } from './../src/objects/business-agreement';
export { default as BusinessApplicationRequest } from './../src/objects/business-application-request';
export { default as BusinessAssetSharingAgreement } from './../src/objects/business-asset-sharing-agreement';
export { default as BusinessCreative } from './../src/objects/business-creative';
export { default as BusinessCreativeFolder } from './../src/objects/business-creative-folder';
export { default as BusinessImage } from './../src/objects/business-image';
Expand Down Expand Up @@ -417,5 +419,6 @@ export { default as VideoUploadLimits } from './../src/objects/video-upload-limi
export { default as VoipInfo } from './../src/objects/voip-info';
export { default as WebAppLink } from './../src/objects/web-app-link';
export { default as WhatsAppBusinessAccount } from './../src/objects/whats-app-business-account';
export { default as WhatsAppBusinessProfile } from './../src/objects/whats-app-business-profile';
export { default as WindowsAppLink } from './../src/objects/windows-app-link';
export { default as WindowsPhoneAppLink } from './../src/objects/windows-phone-app-link';
3 changes: 3 additions & 0 deletions src/globals.es6
Expand Up @@ -145,13 +145,15 @@ import './../src/objects/audience-permission-for-actions';
import './../src/objects/audio-copyright';
import './../src/objects/automotive-model';
import './../src/objects/billed-amount-details';
import './../src/objects/brand-audience';
import './../src/objects/brand-safety-block-list-usage';
import './../src/objects/broad-targeting-categories';
import './../src/objects/business';
import './../src/objects/business-ad-account-request';
import './../src/objects/business-advertisable-applications-result';
import './../src/objects/business-agreement';
import './../src/objects/business-application-request';
import './../src/objects/business-asset-sharing-agreement';
import './../src/objects/business-creative';
import './../src/objects/business-creative-folder';
import './../src/objects/business-image';
Expand Down Expand Up @@ -415,5 +417,6 @@ import './../src/objects/video-upload-limits';
import './../src/objects/voip-info';
import './../src/objects/web-app-link';
import './../src/objects/whats-app-business-account';
import './../src/objects/whats-app-business-profile';
import './../src/objects/windows-app-link';
import './../src/objects/windows-phone-app-link';
30 changes: 30 additions & 0 deletions src/objects/ad-account.js
Expand Up @@ -31,6 +31,7 @@ import AssignedUser from './assigned-user';
import Campaign from './campaign';
import AsyncRequest from './async-request';
import AdAsyncRequestSet from './ad-async-request-set';
import BrandAudience from './brand-audience';
import BroadTargetingCategories from './broad-targeting-categories';
import BusinessProject from './business-project';
import CustomAudience from './custom-audience';
Expand Down Expand Up @@ -606,6 +607,16 @@ export default class AdAccount extends AbstractCrudObject {
);
}

getAffectedAdSets (fields: Array<string>, params: Object = {}, fetchFirstPage: boolean = true): Cursor | Promise<*> {
return this.getEdge(
AdSet,
fields,
params,
fetchFirstPage,
'/affectedadsets'
);
}

deleteAgencies (params: Object = {}): Promise<*> {
return super.deleteEdge(
'/agencies',
Expand Down Expand Up @@ -742,6 +753,16 @@ export default class AdAccount extends AbstractCrudObject {
);
}

getBrandAudiences (fields: Array<string>, params: Object = {}, fetchFirstPage: boolean = true): Cursor | Promise<*> {
return this.getEdge(
BrandAudience,
fields,
params,
fetchFirstPage,
'/brand_audiences'
);
}

getBroadTargetingCategories (fields: Array<string>, params: Object = {}, fetchFirstPage: boolean = true): Cursor | Promise<*> {
return this.getEdge(
BroadTargetingCategories,
Expand Down Expand Up @@ -884,6 +905,15 @@ export default class AdAccount extends AbstractCrudObject {
);
}

createEmailImport (fields: Array<string>, params: Object = {}): Promise<AbstractObject> {
return this.createEdge(
'/emailimport',
fields,
params,

);
}

getGeneratePreviews (fields: Array<string>, params: Object = {}, fetchFirstPage: boolean = true): Cursor | Promise<*> {
return this.getEdge(
AdPreview,
Expand Down
2 changes: 2 additions & 0 deletions src/objects/ad-creative.js
Expand Up @@ -158,6 +158,8 @@ export default class AdCreative extends AbstractCrudObject {
return Object.freeze({
active: 'ACTIVE',
deleted: 'DELETED',
in_process: 'IN_PROCESS',
with_issues: 'WITH_ISSUES',
});
}
static get AuthorizationCategory (): Object {
Expand Down
1 change: 1 addition & 0 deletions src/objects/ad-place-page-set-metadata.js
Expand Up @@ -17,6 +17,7 @@ export default class AdPlacePageSetMetadata extends AbstractCrudObject {
static get Fields () {
return Object.freeze({
audience: 'audience',
custom: 'custom',
extra_data: 'extra_data',
fixed_radius: 'fixed_radius',
});
Expand Down
1 change: 1 addition & 0 deletions src/objects/ad-rule-execution-spec.js
Expand Up @@ -25,6 +25,7 @@ export default class AdRuleExecutionSpec extends AbstractCrudObject {
return Object.freeze({
change_bid: 'CHANGE_BID',
change_budget: 'CHANGE_BUDGET',
change_campaign_budget: 'CHANGE_CAMPAIGN_BUDGET',
notification: 'NOTIFICATION',
pause: 'PAUSE',
ping_endpoint: 'PING_ENDPOINT',
Expand Down
2 changes: 2 additions & 0 deletions src/objects/ad-set.js
Expand Up @@ -116,6 +116,7 @@ export default class AdSet extends AbstractCrudObject {
active: 'ACTIVE',
archived: 'ARCHIVED',
deleted: 'DELETED',
in_process: 'IN_PROCESS',
paused: 'PAUSED',
with_issues: 'WITH_ISSUES',
});
Expand Down Expand Up @@ -161,6 +162,7 @@ export default class AdSet extends AbstractCrudObject {
return Object.freeze({
app: 'APP',
applinks_automatic: 'APPLINKS_AUTOMATIC',
facebook: 'FACEBOOK',
messenger: 'MESSENGER',
undefined: 'UNDEFINED',
website: 'WEBSITE',
Expand Down
1 change: 1 addition & 0 deletions src/objects/ad.js
Expand Up @@ -88,6 +88,7 @@ export default class Ad extends AbstractCrudObject {
campaign_paused: 'CAMPAIGN_PAUSED',
deleted: 'DELETED',
disapproved: 'DISAPPROVED',
in_process: 'IN_PROCESS',
paused: 'PAUSED',
pending_billing_info: 'PENDING_BILLING_INFO',
pending_review: 'PENDING_REVIEW',
Expand Down
41 changes: 41 additions & 0 deletions src/objects/brand-audience.js
@@ -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';

/**
* BrandAudience
* @extends AbstractCrudObject
* @see {@link https://developers.facebook.com/docs/marketing-api/}
*/
export default class BrandAudience extends AbstractCrudObject {
static get Fields () {
return Object.freeze({
account: 'account',
delivery_targeting: 'delivery_targeting',
description: 'description',
id: 'id',
name: 'name',
sentence_lines: 'sentence_lines',
status: 'status',
targeting: 'targeting',
time_created: 'time_created',
time_updated: 'time_updated',
});
}



get (fields: Array<string>, params: Object = {}): BrandAudience {
// $FlowFixMe : Support Generic Types
return this.read(
fields,
params
);
}
}
2 changes: 2 additions & 0 deletions src/objects/business-advertisable-applications-result.js
Expand Up @@ -16,6 +16,8 @@ import {AbstractCrudObject} from './../abstract-crud-object';
export default class BusinessAdvertisableApplicationsResult extends AbstractCrudObject {
static get Fields () {
return Object.freeze({
are_app_events_unavailable: 'are_app_events_unavailable',
business: 'business',
has_insight_permission: 'has_insight_permission',
id: 'id',
name: 'name',
Expand Down
53 changes: 53 additions & 0 deletions src/objects/business-asset-sharing-agreement.js
@@ -0,0 +1,53 @@
/**
* 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';

/**
* BusinessAssetSharingAgreement
* @extends AbstractCrudObject
* @see {@link https://developers.facebook.com/docs/marketing-api/}
*/
export default class BusinessAssetSharingAgreement extends AbstractCrudObject {
static get Fields () {
return Object.freeze({
id: 'id',
initiator: 'initiator',
recipient: 'recipient',
relationship_type: 'relationship_type',
request_status: 'request_status',
request_type: 'request_type',
});
}

static get RequestStatus (): Object {
return Object.freeze({
approve: 'APPROVE',
decline: 'DECLINE',
expired: 'EXPIRED',
in_progress: 'IN_PROGRESS',
});
}


get (fields: Array<string>, params: Object = {}): BusinessAssetSharingAgreement {
// $FlowFixMe : Support Generic Types
return this.read(
fields,
params
);
}

// $FlowFixMe : Support Generic Types
update (fields: Array<string>, params: Object = {}): BusinessAssetSharingAgreement {
// $FlowFixMe : Support Generic Types
return super.update(
params
);
}
}
21 changes: 21 additions & 0 deletions src/objects/business.js
Expand Up @@ -29,6 +29,7 @@ import BusinessCreative from './business-creative';
import DirectDeal from './direct-deal';
import EventSourceGroup from './event-source-group';
import ExtendedCredit from './extended-credit';
import BusinessAssetSharingAgreement from './business-asset-sharing-agreement';
import BusinessAgreement from './business-agreement';
import InstagramUser from './instagram-user';
import OfflineConversionDataSet from './offline-conversion-data-set';
Expand Down Expand Up @@ -557,6 +558,16 @@ export default class Business extends AbstractCrudObject {
);
}

getInitiatedAudienceSharingRequests (fields: Array<string>, params: Object = {}, fetchFirstPage: boolean = true): Cursor | Promise<*> {
return this.getEdge(
BusinessAssetSharingAgreement,
fields,
params,
fetchFirstPage,
'/initiated_audience_sharing_requests'
);
}

getInitiatedSharingAgreements (fields: Array<string>, params: Object = {}, fetchFirstPage: boolean = true): Cursor | Promise<*> {
return this.getEdge(
BusinessAgreement,
Expand Down Expand Up @@ -870,6 +881,16 @@ export default class Business extends AbstractCrudObject {
);
}

getReceivedAudienceSharingRequests (fields: Array<string>, params: Object = {}, fetchFirstPage: boolean = true): Cursor | Promise<*> {
return this.getEdge(
BusinessAssetSharingAgreement,
fields,
params,
fetchFirstPage,
'/received_audience_sharing_requests'
);
}

getReceivedInprogressOnBehalfRequests (fields: Array<string>, params: Object = {}, fetchFirstPage: boolean = true): Cursor | Promise<*> {
return this.getEdge(
BusinessOwnedObjectOnBehalfOfRequest,
Expand Down
1 change: 1 addition & 0 deletions src/objects/campaign.js
Expand Up @@ -78,6 +78,7 @@ export default class Campaign extends AbstractCrudObject {
active: 'ACTIVE',
archived: 'ARCHIVED',
deleted: 'DELETED',
in_process: 'IN_PROCESS',
paused: 'PAUSED',
with_issues: 'WITH_ISSUES',
});
Expand Down
2 changes: 1 addition & 1 deletion src/objects/check-batch-request-status.js
Expand Up @@ -19,7 +19,7 @@ export default class CheckBatchRequestStatus extends AbstractCrudObject {
errors: 'errors',
errors_total_count: 'errors_total_count',
handle: 'handle',
invalid_item_ids: 'invalid_item_ids',
ids_of_invalid_requests: 'ids_of_invalid_requests',
status: 'status',
warnings: 'warnings',
warnings_total_count: 'warnings_total_count',
Expand Down
7 changes: 7 additions & 0 deletions src/objects/custom-audience.js
Expand Up @@ -149,6 +149,13 @@ export default class CustomAudience extends AbstractCrudObject {
);
}

deleteCapabilities (params: Object = {}): Promise<*> {
return super.deleteEdge(
'/capabilities',
params
);
}

createCapability (fields: Array<string>, params: Object = {}): Promise<AbstractObject> {
return this.createEdge(
'/capabilities',
Expand Down
17 changes: 17 additions & 0 deletions src/objects/page-call-to-action.js
Expand Up @@ -7,6 +7,7 @@
* @flow
*/
import {AbstractCrudObject} from './../abstract-crud-object';
import AbstractObject from './../abstract-object';

/**
* PageCallToAction
Expand Down Expand Up @@ -104,6 +105,14 @@ export default class PageCallToAction extends AbstractCrudObject {
});
}

// $FlowFixMe : Support Generic Types
delete (fields: Array<string>, params: Object = {}): AbstractObject {
// $FlowFixMe : Support Generic Types
return super.delete(
params
);
}


get (fields: Array<string>, params: Object = {}): PageCallToAction {
// $FlowFixMe : Support Generic Types
Expand All @@ -112,4 +121,12 @@ export default class PageCallToAction extends AbstractCrudObject {
params
);
}

// $FlowFixMe : Support Generic Types
update (fields: Array<string>, params: Object = {}): PageCallToAction {
// $FlowFixMe : Support Generic Types
return super.update(
params
);
}
}
1 change: 1 addition & 0 deletions src/objects/page-change-proposal.js
Expand Up @@ -21,6 +21,7 @@ export default class PageChangeProposal extends AbstractCrudObject {
current_value: 'current_value',
id: 'id',
proposed_value: 'proposed_value',
upcoming_change_info: 'upcoming_change_info',
});
}

Expand Down
1 change: 1 addition & 0 deletions src/objects/page-post.js
Expand Up @@ -140,6 +140,7 @@ export default class PagePost extends AbstractCrudObject {
inline_created: 'INLINE_CREATED',
published: 'PUBLISHED',
scheduled: 'SCHEDULED',
scheduled_recurring: 'SCHEDULED_RECURRING',
});
}
static get With (): Object {
Expand Down

0 comments on commit 0368626

Please sign in to comment.