facebook-nodejs-business-sdk
Version:
SDK for the Facebook Marketing API in Javascript and Node.js
112 lines (102 loc) • 3.05 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';
/**
* Flight
* @extends AbstractCrudObject
* @see {@link https://developers.facebook.com/docs/marketing-api/}
*/
export default class Flight extends AbstractCrudObject {
static get Fields (): Object {
return Object.freeze({
applinks: 'applinks',
category_specific_fields: 'category_specific_fields',
currency: 'currency',
description: 'description',
destination_airport: 'destination_airport',
destination_city: 'destination_city',
flight_id: 'flight_id',
id: 'id',
image_fetch_status: 'image_fetch_status',
images: 'images',
oneway_currency: 'oneway_currency',
oneway_price: 'oneway_price',
origin_airport: 'origin_airport',
origin_city: 'origin_city',
price: 'price',
sanitized_images: 'sanitized_images',
tags: 'tags',
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 = {}): Flight {
// $FlowFixMe : Support Generic Types
return this.read(
fields,
params
);
}
// $FlowFixMe : Support Generic Types
update (fields: Array<string>, params: Object = {}): Flight {
// $FlowFixMe : Support Generic Types
return super.update(
params
);
}
}