src/objects/vehicle-offer.js (89 lines of code) (raw):
/**
* 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';
import AbstractObject from './../abstract-object';
import Cursor from './../cursor';
import CatalogItemChannelsToIntegrityStatus from './catalog-item-channels-to-integrity-status';
/**
* VehicleOffer
* @extends AbstractCrudObject
* @see {@link https://developers.facebook.com/docs/marketing-api/}
*/
export default class VehicleOffer extends AbstractCrudObject {
static get Fields (): Object {
return Object.freeze({
amount_currency: 'amount_currency',
amount_percentage: 'amount_percentage',
amount_price: 'amount_price',
amount_qualifier: 'amount_qualifier',
applinks: 'applinks',
body_style: 'body_style',
cashback_currency: 'cashback_currency',
cashback_price: 'cashback_price',
category_specific_fields: 'category_specific_fields',
currency: 'currency',
dma_codes: 'dma_codes',
downpayment_currency: 'downpayment_currency',
downpayment_price: 'downpayment_price',
downpayment_qualifier: 'downpayment_qualifier',
end_date: 'end_date',
end_time: 'end_time',
id: 'id',
image_fetch_status: 'image_fetch_status',
images: 'images',
make: 'make',
model: 'model',
offer_description: 'offer_description',
offer_disclaimer: 'offer_disclaimer',
offer_type: 'offer_type',
price: 'price',
sanitized_images: 'sanitized_images',
start_date: 'start_date',
start_time: 'start_time',
term_length: 'term_length',
term_qualifier: 'term_qualifier',
title: 'title',
trim: 'trim',
unit_price: 'unit_price',
url: 'url',
vehicle_offer_id: 'vehicle_offer_id',
year: 'year',
});
}
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',
});
}
getAugmentedRealitiesMetadata (fields: Array<string>, params: Object = {}, fetchFirstPage: boolean = true): Cursor | Promise<*> {
return this.getEdge(
AbstractObject,
fields,
params,
fetchFirstPage,
'/augmented_realities_metadata'
);
}
getChannelsToIntegrityStatus (fields: Array<string>, params: Object = {}, fetchFirstPage: boolean = true): Cursor | Promise<*> {
return this.getEdge(
CatalogItemChannelsToIntegrityStatus,
fields,
params,
fetchFirstPage,
'/channels_to_integrity_status'
);
}
getVideosMetadata (fields: Array<string>, params: Object = {}, fetchFirstPage: boolean = true): Cursor | Promise<*> {
return this.getEdge(
AbstractObject,
fields,
params,
fetchFirstPage,
'/videos_metadata'
);
}
get (fields: Array<string>, params: Object = {}): VehicleOffer {
// $FlowFixMe : Support Generic Types
return this.read(
fields,
params
);
}
}