facebook-nodejs-business-sdk
Version:
SDK for the Facebook Marketing API in Javascript and Node.js
55 lines (48 loc) • 1.28 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 AdVideo from './ad-video';
/**
* VideoList
* @extends AbstractCrudObject
* @see {@link https://developers.facebook.com/docs/marketing-api/}
*/
export default class VideoList extends AbstractCrudObject {
static get Fields (): Object {
return Object.freeze({
creation_time: 'creation_time',
description: 'description',
id: 'id',
last_modified: 'last_modified',
owner: 'owner',
season_number: 'season_number',
thumbnail: 'thumbnail',
title: 'title',
videos_count: 'videos_count',
});
}
getVideos (fields: Array<string>, params: Object = {}, fetchFirstPage: boolean = true): Cursor | Promise<*> {
return this.getEdge(
AdVideo,
fields,
params,
fetchFirstPage,
'/videos'
);
}
get (fields: Array<string>, params: Object = {}): VideoList {
// $FlowFixMe : Support Generic Types
return this.read(
fields,
params
);
}
}