facebook-nodejs-business-sdk
Version:
SDK for the Facebook Marketing API in Javascript and Node.js
102 lines (93 loc) • 2.74 kB
JavaScript
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
* 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';
import Cursor from './../cursor';
import CatalogItemChannelsToIntegrityStatus from './catalog-item-channels-to-integrity-status';
import OverrideDetails from './override-details';
import DynamicVideoMetadata from './dynamic-video-metadata';
/**
* Destination
* @extends AbstractCrudObject
* @see {@link https://developers.facebook.com/docs/marketing-api/}
*/
export default class Destination extends AbstractCrudObject {
static get Fields (): Object {
return Object.freeze({
address: 'address',
applinks: 'applinks',
category_specific_fields: 'category_specific_fields',
currency: 'currency',
description: 'description',
destination_id: 'destination_id',
id: 'id',
image_fetch_status: 'image_fetch_status',
images: 'images',
name: 'name',
price: 'price',
price_change: 'price_change',
sanitized_images: 'sanitized_images',
tags: 'tags',
types: 'types',
unit_price: 'unit_price',
url: 'url',
visibility: 'visibility',
});
}
static get ImageFetchStatus (): Object {
return Object.freeze({
direct_upload: 'DIRECT_UPLOAD',
fetched: 'FETCHED',
fetch_failed: 'FETCH_FAILED',
no_status: 'NO_STATUS',
outdated: 'OUTDATED',
partial_fetch: 'PARTIAL_FETCH',
});
}
static get Visibility (): Object {
return Object.freeze({
published: 'PUBLISHED',
staging: 'STAGING',
});
}
getChannelsToIntegrityStatus (fields: Array<string>, params: Object = {}, fetchFirstPage: boolean = true): Cursor | Promise<*> {
return this.getEdge(
CatalogItemChannelsToIntegrityStatus,
fields,
params,
fetchFirstPage,
'/channels_to_integrity_status'
);
}
getOverrideDetails (fields: Array<string>, params: Object = {}, fetchFirstPage: boolean = true): Cursor | Promise<*> {
return this.getEdge(
OverrideDetails,
fields,
params,
fetchFirstPage,
'/override_details'
);
}
getVideosMetadata (fields: Array<string>, params: Object = {}, fetchFirstPage: boolean = true): Cursor | Promise<*> {
return this.getEdge(
DynamicVideoMetadata,
fields,
params,
fetchFirstPage,
'/videos_metadata'
);
}
get (fields: Array<string>, params: Object = {}): Destination {
// $FlowFixMe : Support Generic Types
return this.read(
fields,
params
);
}
}