// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../../resource'; import * as Core from '../../../core'; import * as FixedConsensusAPI from './fixed-consensus'; import * as Shared from '../../shared'; export class FixedConsensus extends APIResource { /** * Returns FactSet Estimates consensus data using fixed fiscal dates. For example, * if the company's current unreported year is 12/2020, all data returned by * formulas that specify as the period/report basis will be for 12/2005 regardless * of what perspective dates (startDate/endDate) are used. The fixed dates are * "locked" in time and all estimated values are for that explicit date. If you are * requesting that the estimated periods can change with the perspective date, * please use the rolling-consensus endpoint. */ create( body: FixedConsensusCreateParams, options?: Core.RequestOptions, ): Core.APIPromise { return this._client.post('/factset-estimates/v2/fixed-consensus', { body, ...options }); } /** * Returns FactSet Estimates consensus data using fixed fiscal dates. For example, * if the company's current unreported year is 12/2020, all data returned by * formulas that specify as the period/report basis will be for 12/2005 regardless * of what perspective dates (startDate/endDate) are used. The fixed dates are * "locked" in time and all estimated values are for that explicit date. If you are * requesting that the estimated periods can change with the perspective date, * please use the rolling-consensus endpoint. */ retrieve( query: FixedConsensusRetrieveParams, options?: Core.RequestOptions, ): Core.APIPromise { return this._client.get('/factset-estimates/v2/fixed-consensus', { query, ...options }); } } export interface FixedConsensusCreateParams { /** * The requested list of security identifiers. Accepted ID types include Market * Tickers, SEDOL, ISINs, CUSIPs, or FactSet Permanent Ids. _ Make Note - id limit * of 3000 for defaults, otherwise the service is limited to a 30 second duration. * This can be reached when increasing total number of metrics requested and depth * of history. _ */ ids: Array; /** * Requested metrics. Use the metrics endpoint for a list of estimate items. Note, * the number of metrics you are allowed to supply is limited to 1 for now. For * more details, visit * [Online Assistant Page #15034](https://oa.apps.factset.com/pages/15034). */ metrics: Array; /** * Currency code for adjusting the data. Use input as 'ESTIMATE' for values in * Estimate currency. For a list of currency ISO codes, visit * [Online Assistant Page #1470](https://oa.apps.factset.com/pages/1470). */ currency?: string; /** * The end date requested for a given date range in **YYYY-MM-DD** format. If left * blank, the API will default to previous close. Future dates (T+1) are not * accepted in this endpoint. */ endDate?: string; /** * Fiscal period end expressed in absolute date formats. Date that will fall back * to most recent completed period during resolution. * * - **Month-end** - MM/YYYY (e.g., 11/2019) * - **Fiscal Quarter-end** - YYYY/FQ (e.g., 2019/1F, 2019/2F, 2019/3F, 2019/4F) * - **Semiannual Period-end** - YYYY/FSA (e.g., 2019/1S, 2019/2S) * - **Fiscal Year-end** - YYYY (e.g. 2019) */ fiscalPeriodEnd?: string; /** * Fiscal period start expressed in absolute date formats. Date that will fall back * to most recent completed period during resolution. * * - **Fiscal Quarter-end** - YYYY/FQ (e.g., 2019/1F, 2019/2F, 2019/3F, 2019/4F) * - **Semiannual Period-end** - YYYY/FSA (e.g., 2019/1S, 2019/2S) * - **Fiscal Year-end** - YYYY (e.g. 2019) */ fiscalPeriodStart?: string; /** * Controls the display frequency of the data returned. * * - **D** = Daily * - **W** = Weekly, based on the last day of the week of the start date. * - **AM** = Monthly, based on the start date (e.g., if the start date is June 16, * data is displayed for June 16, May 16, April 16 etc.). * - **AQ** = Quarterly, based on the start date. * - **AY** = Actual Annual, based on the start date. */ frequency?: 'D' | 'W' | 'AM' | 'AQ' | 'AY'; /** * The periodicity for the estimates, reflecting Annual, Semi-Annual and Quarterly * Estimates. Next-twelve-months (NTMA) and Last-twelve-months (LTMA) also * supported. */ periodicity?: 'ANN' | 'QTR' | 'SEMI' | 'LTMA' | 'NTMA'; /** * The start date requested for a given date range in **YYYY-MM-DD** format. If * left blank, the API will default to previous close. Future dates (T+1) are not * accepted in this #endpoint. */ startDate?: string; } export interface FixedConsensusRetrieveParams { /** * Security or Entity identifiers. FactSet Identifiers, tickers, CUSIP and SEDOL * are accepted input.

**\*ids limit** = 3000 per request*

* Make Note - id * limit of 3000 for defaults, otherwise the service is limited to a 30 second * duration. This can be reached when increasing total number of metrics requested * and depth of history. \* */ ids: Array; /** * Requested metrics. Use the /metrics endpoint to return a list of available * estimate items. Note, the number of metrics you are allowed to supply is limited * to 1 for now. **Top 10** most used metrics are **EPS, SALES, DPS, EBITDA,EBIT, * PRICE_TGT, CFPS, BPS, NET_INC, and ASSETS**. For more details, visit * [Online Assistant Page #15034](https://oa.apps.factset.com/pages/15034). */ metrics: Array; /** * Currency code for adjusting the data. Use 'ESTIMATE' as input value for the * values in Estimate Currency. For a list of currency ISO codes, visit * [Online Assistant Page #1470](https://oa.apps.factset.com/pages/1470). */ currency?: string; /** * End date for point in time of estimates expressed in YYYY-MM-DD format. */ endDate?: string; /** * Fiscal period start expressed in absolute date formats. Date that will fall back * to most recent completed period during resolution. * * - **Fiscal Quarter-end** - YYYY/FQ (e.g., 2019/1F, 2019/2F, 2019/3F, 2019/4F) * - **Fiscal Year-end** - YYYY (e.g. 2019) */ fiscalPeriodEnd?: string; /** * Fiscal period start expressed in absolute date formats. Date that will fall back * to most recent completed period during resolution. * * - **Fiscal Quarter-end** - YYYY/FQ (e.g., 2019/1F, 2019/2F, 2019/3F, 2019/4F) * - **Fiscal Year-end** - YYYY (e.g. 2019) */ fiscalPeriodStart?: string; /** * Controls the frequency of the data returned. * * - **D** = Daily * - **W** = Weekly, based on the last day of the week of the start date. * - **AM** = Monthly, based on the start date (e.g., if the start date is June 16, * data is displayed for June 16, May 16, April 16 etc.). * - **AQ** = Quarterly, based on the start date. * - **AY** = Actual Annual, based on the start date. */ frequency?: 'D' | 'W' | 'AM' | 'AQ' | 'AY'; /** * The periodicity for the estimates requested, allowing you to fetch Quarterly, * Semi-Annual, Annual, and NTMA/LTMA Estimates. * * - **ANN** - Annual * - **QTR** - Quarterly * - **SEMI** - Semi-Annual * - **NTMA** - Next-Twelve-Months - Time-weighted Annual. Estimates use a * percentage of annual estimates from two fiscal years to create an estimate * based on the 12-month period. Visit * [OA 16614](https://my.apps.factset.com/oa/pages/16614) for detail. * - **LTMA** - Last-Twelve-Months - Time-weighted Annual. Estimates use a * percentage of annual estimates from two fiscal years to create an estimate * based on the 12-month period. Visit * [OA 16614](https://my.apps.factset.com/oa/pages/16614) for detail. */ periodicity?: 'ANN' | 'QTR' | 'SEMI' | 'NTMA' | 'LTMA'; /** * Start date for point in time of estimates expressed in YYYY-MM-DD format. */ startDate?: string; } export namespace FixedConsensus { export import FixedConsensusCreateParams = FixedConsensusAPI.FixedConsensusCreateParams; export import FixedConsensusRetrieveParams = FixedConsensusAPI.FixedConsensusRetrieveParams; }