UNPKG

facebook-nodejs-business-sdk

Version:

SDK for the Facebook Marketing API in Javascript and Node.js

127 lines (117 loc) 3.7 kB
/* * 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', custom_label_0: 'custom_label_0', custom_label_1: 'custom_label_1', custom_label_2: 'custom_label_2', custom_label_3: 'custom_label_3', custom_label_4: 'custom_label_4', custom_number_0: 'custom_number_0', custom_number_1: 'custom_number_1', custom_number_2: 'custom_number_2', custom_number_3: 'custom_number_3', custom_number_4: 'custom_number_4', 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', product_priority_0: 'product_priority_0', product_priority_1: 'product_priority_1', product_priority_2: 'product_priority_2', product_priority_3: 'product_priority_3', product_priority_4: 'product_priority_4', 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 ); } }