// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from '../../../resource';
import * as Core from '../../../core';
import * as RollingConsensusAPI from './rolling-consensus';
import * as Shared from '../../shared';
export class RollingConsensus extends APIResource {
/**
* Returns FactSet Estimates consensus data using rolling fiscal dates.
The
* rolling behavior causes fiscal year to automatically roll from one year to the
* next as the historical perspective date changes. The fiscal period rolls forward
* as of each period end. This endpoint is optimized to allow the request to simply
* include a relative fiscal period (e.g. use relativeFiscalStart integer 1 and
* periodicity ANN for next unreported fiscal year end), and then see what the
* consensus thought the "next fiscal year" estimates were through time as you
* "roll" back your perspective dates. This differs from locking down an absolute
* estimate period such as explicitly stating Fiscal Year 2019. This can be done in
* the fixed-consensus endpoint.
*/
create(
body: RollingConsensusCreateParams,
options?: Core.RequestOptions,
): Core.APIPromise {
return this._client.post('/factset-estimates/v2/rolling-consensus', { body, ...options });
}
/**
* Returns FactSet Estimates consensus data using rolling fiscal dates. The
* rolling behavior causes fiscal year to automatically roll from one year to the
* next as the historical perspective date changes. The fiscal period rolls forward
* as of each period end. This endpoint is optimized to allow the request to simply
* include a relative fiscal period (e.g. use relativeFiscalStart integer 1 and
* periodicity ANN for next unreported fiscal year end), and then see what the
* consensus thought the "next fiscal year" estimates were through time as you
* "roll" back your perspective dates. This differs from locking down an absolute
* estimate period such as explicitly stating Fiscal Year 2019. This can be done in
* the fixed-consensus endpoint.
*/
list(
query: RollingConsensusListParams,
options?: Core.RequestOptions,
): Core.APIPromise {
return this._client.get('/factset-estimates/v2/rolling-consensus', { query, ...options });
}
}
export interface RollingConsensusCreateParams {
/**
* 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;
/**
* 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';
/**
* Relative fiscal period, expressed as an integer, used to filter results.
*/
relativeFiscalEnd?: number;
/**
* Relative fiscal period, expressed as an integer, used to filter results.
*/
relativeFiscalStart?: number;
/**
* 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 RollingConsensusListParams {
/**
* 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;
/**
* 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';
/**
* Relative fiscal period, expressed as an integer, used to filter results. This is
* combined with the periodicity parameter to specify a relative estimate period.
* For example, set to 2 and periodicity to ANN to ask for relative Fiscal Year 1
* (FY2).
*/
relativeFiscalEnd?: number;
/**
* Relative fiscal period, expressed as an integer, used to filter results. This is
* combined with the periodicity parameter to specify a relative estimate period.
* For example, set to 1 and periodicity to ANN to ask for relative Fiscal Year 1
* (FY1).
*/
relativeFiscalStart?: number;
/**
* Start date for point in time of estimates expressed in YYYY-MM-DD format.
*/
startDate?: string;
}
export namespace RollingConsensus {
export import RollingConsensusCreateParams = RollingConsensusAPI.RollingConsensusCreateParams;
export import RollingConsensusListParams = RollingConsensusAPI.RollingConsensusListParams;
}